?
Current Path : /home1/savoy/public_html/savoyglobal.net/koolkids/school/application/controllers/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/koolkids/school/application/controllers/report.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Report extends BaseController { function __construct() { parent::BaseController(); $this->load->helper('to_pdf'); $this->load->model('reportmodel'); $this->load->model('mastermodel'); $this->load->model('settingsmodel'); $this->load->model('teachermodel'); $this->load->library('Fpaginate'); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function viewinreport($modelfunction,$page,$pagenum="") { /*<---------------- For pagination purpose------------>*/ $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['userid'],0); if(!$perm) { $this->load->view('Settings/nopermission'); } else { $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; $_SESSION['searchdata'] = ''; if($pagenum==1) { $data['id']=1; } else { $data['id']= (($pagenum-1)*$perpage)+1; } /*<---------------- For pagination purpose------------> */ if(isset($encoded_data)) { $decoded_data= urldecode($encoded_data); $postdata=json_decode($decoded_data, true); } else { $postdata=""; } $output=$this->reportmodel->$modelfunction($postdata,$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['viewinfo']=$output['results']; $this->load->view('Report/'.$page.'',$data); } } function viewinreportsearch($modelfunction,$page,$pagenum) { /*<---------------- For pagination purpose------------>*/ $perpage= $this->config->item('perpage'); $data['pagenum']=$pagenum; if($pagenum==1) { $data['id']=1; $postdata=$this->get_post_values(); $_SESSION['searchdata']=$postdata; } else { $data['id']= (($pagenum-1)*$perpage)+1; } /*<---------------- For pagination purpose------------> */ $_SESSION['searchdata']=$postdata; if(!isset($_SESSION['searchdata'])) $_SESSION['searchdata']=""; $output=$this->reportmodel->$modelfunction($postdata,$pagenum); $data['startpage']=$output['startpage']; $data['endpage']=$output['endpage']; $data['viewinfo']=$output['results']; $this->load->view('Report/'.$page.'',$data); } function addinreport($modelfunction,$page) { $postdata=$this->get_post_values(); $data=$this->smsmodel->$modelfunction($postdata); $data=$this->reportmodel->$modelfunction($postdata); if($data['res']==1) { $this->viewinreport($data['resfunction'],$page,'1'); $this->load->view('insertsuccess'); } else { $this->viewinreport($data['resfunction'],$page,'1'); $this->load->view('insertfailure'); } } function editform($controllerfunction,$id) { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['userid'],1); if(!$perm) { $this->load->view('Settings/nopermission'); } else { $this->$controllerfunction($id); } } function loadreportform($page) { $this->load->view('Report/'.$page); } function load_attendance_report($page) { $postdata=$this->get_post_values(); $data['student']=$this->mastermodel->get_student_class($postdata['classlevel_id']); $data['classlevel_id']=$postdata['classlevel_id']; $data['year']=$postdata['year']; $data['month']=$postdata['month']; $this->load->view('Report/'.$page,$data); } function load_attendance_report_student($page) { $postdata=$this->get_post_values(); $data['viewinfo']=$this->mastermodel->get_data('attendance_register',$postdata['student_id'],'student_id'); $this->load->view('Report/'.$page,$data); } function attendance_report($classlevel_id,$month,$year,$num) { $data['student']=$this->mastermodel->get_student_class($classlevel_id); $data['classlevel_id']=$classlevel_id; $data['year']=$year; $data['month']=$month; $data['num']=$num; $this->load->view('Report/viewattendancereportpdf',$data); } function load_student_report($student_id="",$page) { $data['student']=$this->mastermodel->get_joined_single_info('student','student_id','student_address','student_id','student_id',$student_id); $data['other']=$this->mastermodel->get_data_srow('student_otherinfo',$student_id,'student_id'); $data['admission']=$this->mastermodel->get_data_srow('student_admission_info',$student_id,'student_id'); $this->load->view('Report/'.$page,$data); } function studentreport($student_id) { $data['student']=$this->mastermodel->get_joined_single_info('student','student_id','student_address','student_id','student_id',$student_id); $data['other']=$this->mastermodel->get_data_srow('student_otherinfo',$student_id,'student_id'); $this->load->view('Report/student_reportpdf',$data); } function teacherreport($id,$page) { $data['teacher']=$this->mastermodel->get_data_srow('teacher',$id,'teacher_id'); $data['address']=$this->mastermodel->get_data_srow('teacher_address',$id,'teacher_id'); $data['teacher_subject']=$this->teachermodel->get_data_subject($id); $data['teacher_qualification']=$this->mastermodel->get_data('teacher_qualification',$id,'teacher_id'); $data['teacher_work_experience']=$this->mastermodel->get_data('teacher_work_experience',$id,'teacher_id'); $this->load->view('Report/'.$page,$data); } function nonteacherreport($id,$page) { $data['staff']=$this->mastermodel->get_data_srow('staff',$id,'staff_id'); $data['address']=$this->mastermodel->get_data_srow('staff_address',$id,'staff_id'); $this->load->view('Report/'.$page,$data); } function load_payment_report($page,$feecollectionid="") { if($feecollectionid=="") { $postdata=$this->get_post_values(); $feecollection_id=$postdata['feecollection_id']; } else $feecollection_id = $feecollectionid; $data=array(); $data['viewinfo']=$this->reportmodel->get_payment_report($feecollection_id); $data['feecollection_id'] = $feecollection_id; $this->load->view('Report/'.$page,$data); } function load_defaulter_report($page,$feecollection_id="",$classlevel_id="") { if($feecollection_id=="") { $postdata=$this->get_post_values(); $feecollection_id=$postdata['feecollection_id']; $classlevel_id=$postdata['classlevel_id']; } $data=array(); $data['viewinfo']=$this->reportmodel->get_defaulter_report($feecollection_id,$classlevel_id); $data['feecollection_id'] = $feecollection_id; $data['classlevel_id'] = $classlevel_id; $this->load->view('Report/'.$page,$data); } function load_student_attendance_report($page,$fromdate="",$todate="",$classlevel_id="") { if($fromdate=="") { $postdata=$this->get_post_values(); $fromdate= $this->mastermodel->convertdateformat($postdata['from_date']); $todate= $this->mastermodel->convertdateformat($postdata['to_date']); $classlevel_id= $postdata['classlevel_id']; } $data=array(); $data['fromdate']=$fromdate; $data['todate']=$todate; $data['classlevel_id']=$classlevel_id; $data['viewinfo']=$this->reportmodel->studentyearlyattendancereport($fromdate,$todate,$classlevel_id); $this->load->view('Report/'.$page,$data); } function load_teacher_attendance_report($page,$fromdate="",$todate="") { if($fromdate=="") { $postdata=$this->get_post_values(); $fromdate= $this->mastermodel->convertdateformat($postdata['from_date']); $todate= $this->mastermodel->convertdateformat($postdata['to_date']); } $data=array(); $data['fromdate']=$fromdate; $data['todate']=$todate; $data['viewinfo']=$this->reportmodel->teacheryearlyattendancereport($fromdate,$todate); $this->load->view('Report/'.$page,$data); } function load_employee_attendance_report($page,$fromdate="",$todate="") { if($fromdate=="") { $postdata=$this->get_post_values(); $fromdate= $this->mastermodel->convertdateformat($postdata['from_date']); $todate= $this->mastermodel->convertdateformat($postdata['to_date']); } $data=array(); $data['fromdate']=$fromdate; $data['todate']=$todate; $data['viewinfo']=$this->reportmodel->staffyearlyattendancereport($fromdate,$todate); $this->load->view('Report/'.$page,$data); } function load_studentclass_report($page,$classlevel_id="") { if($classlevel_id=="") { $postdata=$this->get_post_values(); $classlevel_id= $postdata['classlevel_id']; } $data=array(); $data['classlevel_id']=$classlevel_id; $data['viewinfo']=$this->reportmodel->getstudentclassreport($classlevel_id); $this->load->view('Report/'.$page,$data); } function load_teacherdetail_report($page,$classlevel_id="") { if($classlevel_id=="") { $postdata=$this->get_post_values(); if(isset ($postdata['classlevel_id'])) $classlevel_id= $postdata['classlevel_id']; else { $classlevel_id=''; } } $data=array(); $data['classlevel_id']=$classlevel_id; $data['viewinfo']=$this->reportmodel->getteacherdetailreport($classlevel_id); $this->load->view('Report/'.$page,$data); } function load_nonteacherdetail_report($page,$department_id="",$designation_id="") { if($department_id=="") { $postdata=$this->get_post_values(); if(isset ($postdata['department_id'])) $department_id= $postdata['department_id']; else $department_id=''; } if($designation_id=="") { $postdata=$this->get_post_values(); if(isset ($postdata['designation_id'])) $designation_id= $postdata['designation_id']; else $designation_id=''; } $data=array(); $data['department_id']=$department_id; $data['designation_id']=$designation_id; $data['viewinfo']=$this->reportmodel->getnonteacherdetailreport($department_id,$designation_id); $this->load->view('Report/'.$page,$data); } }