D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
public_html
/
alumni
/
application
/
models
/
admin
/
reports
/
Filename :
DashboardReport.php
back
Copy
<?php /** * Description of User * * @author Softpro India Pvt. Ltd. */ class DashboardReport extends CI_Model { //put your code here public function __construct() { parent::__construct(); } function getStudentCountReportInJSON() { $dataValues = []; $dataLabel = []; $this->db->select("COUNT(sa.userid) as stuCount , co.c_id, co.c_name"); $this->db->from("tbl_stu_alu sa"); $this->db->join('tbl_course co', 'sa.c_id = co.c_id'); $this->db->where("sa.user_type='Student'"); $this->db->group_by("co.c_name,co.c_id"); $data = $this->db->get()->result(); foreach ($data as $row) { array_push($dataValues, $row->stuCount); array_push($dataLabel, $row->c_name); } return json_encode(array( 'data' => $dataValues, 'labels' => $dataLabel )); } function getAlumniCountReportInJSON() { $dataValues = []; $dataLabel = []; $this->db->select("COUNT(sa.userid) as stuCount , co.c_id, co.c_name"); $this->db->from("tbl_stu_alu sa"); $this->db->join('tbl_course co', 'sa.c_id = co.c_id'); $this->db->where("sa.user_type='Alumni'"); $this->db->group_by("co.c_name,co.c_id"); $data = $this->db->get()->result(); foreach ($data as $row) { array_push($dataValues, $row->stuCount); array_push($dataLabel, $row->c_name); } return json_encode(array( 'data' => $dataValues, 'labels' => $dataLabel )); } function getTotalStudentResgistered() { $this->db->select("count(*) totalStudent"); $this->db->from('tbl_stu_alu sa'); $this->db->where("sa.user_type = 'Student'"); return $this->db->get()->result(); } function getTotalAlumniResgistered() { $this->db->select("count(*) totalAlumni"); $this->db->from('tbl_stu_alu sa'); $this->db->where("sa.user_type = 'Alumni'"); return $this->db->get()->result(); } }