db->query($sql1); $sql2 = "SELECT * from ".STAFF.""; $count2 = $this->db->query($sql2); if( $count2->num_rows() > 0) { $result['status'] = true; $result['total_student'] = $count1->num_rows(); $result['total_staff'] = $count2->num_rows(); $result['message'] = "Total Number of Users"; } else { $result['status'] = true; $result['total_student'] = $count1->num_rows(); $result['total_staff'] = $count2->num_rows(); $result['message'] = "No student Users"; } return $result; } // get total number of students public function get_total_students($data) { // print_r($data);exit(); $sql = "SELECT * from ".STUDENTS.""; $count = $this->db->query($sql); if( $count->num_rows() > 0) { $result['status'] = true; $result['total_student'] = $count->num_rows(); $result['message'] = "Total Number of Students"; } else { $result['status'] = true; $result['total_student'] = $count->num_rows(); $result['message'] = "No student exist"; } return $result; } // get total number of employees public function get_total_employee($data) { // print_r($data);exit(); $sql = "SELECT * from ".STAFF.""; $count = $this->db->query($sql); if( $count->num_rows() > 0) { $result['status'] = true; $result['total_employee'] = $count->num_rows(); $result['message'] = "Total Number of Employee"; } else { $result['status'] = true; $result['total_employee'] = $count->num_rows(); $result['message'] = "No Employee exist"; } return $result; } }