============== # Grab Tickets #============================= $this->core->db->construct( array( 'select' => array( 'id', 'mid', 'status' ), 'from' => 'tickets', ) ); $this->core->db->execute(); if ( $this->core->db->get_num_rows() ) { while( $t = $this->core->db->fetch_row() ) { if ( $t['status'] != 6 ) { $o_tickets[ $t['mid'] ] ++; } $tickets[ $t['mid'] ] ++; } } #============================= # Grab Members #============================= $this->core->db->construct( array( 'select' => array( 'id' ), 'from' => 'members', ) ); $this->core->db->execute(); if ( $this->core->db->get_num_rows() ) { while( $m = $this->core->db->fetch_row() ) { $members[ $m['id'] ] = 1; } } #============================= # Update Members #============================= while ( list( $mid, ) = each( $members ) ) { $this->core->db->construct( array( 'update' => 'members', 'set' => array( 'open_tickets' => $o_tickets[ $mid ], 'tickets' => $tickets[ $mid ] ), 'where' => array( 'id', '=', $mid ), 'limit' => array( 1 ), ) ); $this->core->db->execute(); } $this->log( 'admin', "Recounted Tickets Per Member" ); } #======================================= # @ Recount: Tickets per Department # Recounts the number of tickets per # department. #======================================= function r_tickets_per_dept($shutdown=0) { if ( $shutdown == 1 ) { $this->shutdown_funcs[] = 'r_tickets_per_dept'; return TRUE; } #============================= # Grab Tickets #============================= $this->core->db->construct( array( 'select' => array( 'id', 'did' ), 'from' => 'tickets', ) ); $this->core->db->execute(); if ( $this->core->db->get_num_rows() ) { while( $t = $this->core->db->fetch_row() ) { $tickets[ $t['did'] ] ++; } } #============================= # Grab Departments #============================= $this->core->db->construct( array( 'select' => array( 'id' ), 'from' => 'departments', ) ); $this->core->db->execute(); if ( $this->core->db->get_num_rows() ) { while( $d = $this->core->db->fetch_row() ) { $departs[ $d['id'] ] = 1; } } #============================= # Update Departments #============================= while ( list( $did, ) = each( $departs ) ) { $this->core->db->construct( array( 'update' => 'departments', 'set' => array( 'tickets' => $tickets[ $did ] ), 'where' => array( 'id', '=', $did ), 'limit' => array( 1 ), ) ); $this->core->db->execute(); } $this->log( 'admin', "Recounted Tickets Per Department" ); } } ?>
Fatal error: Class 'ifthd' not found in /home/khaisiung/inspirationdna.com/support/index.php on line 66