D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ksclnmuac
/
www
/
ci_panel
/
application
/
controllers
/
admin
/
Filename :
Home.php
back
Copy
<?php class Home extends CI_controller{ public function __construct(){ parent::__construct(); $admin = $this->session->userdata('admin'); if(empty($admin)){ $this->session->set_flashdata('msg', 'Your session has been expired'); redirect(base_url('admin/login/index')); } } public function index() { # code... $data = []; // for sidebar $data['mainModule'] = 'dashboard'; $data['subModule'] = 'dashboard'; $this->load->model('Notification_model'); $this->load->model('Teacher_model'); $this->load->model('Non_teacher_model'); $this->load->model('Department_model'); $this->load->model('Slider_model'); $this->load->model('Gallery_model'); $noti_count = $this->Notification_model->getNotificationCounts(); $data['noti_count'] = $noti_count; $teacher_count = count($this->Teacher_model->get_teacher()); $data['teacher_count'] = $teacher_count; $staff_count = count($this->Non_teacher_model->get_non_teaching()); $data['staff_count'] = $staff_count; $dept_count = $this->Department_model->dept_count(); $data['dept_count'] = $dept_count; $slider_count = $this->Slider_model->sliderCount(); $data['slider_count'] = $slider_count; $gal_count = $this->Gallery_model->galCount(); $data['gal_count'] = $gal_count; $notification = $this->Notification_model->get_notification(); $data['notification'] = $notification; $this->load->view('admin/dashboard', $data); } }