?
Current Path : /home1/savoy/public_html/savoyglobal.net/sec_old/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/sec_old/application/controllers/report.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Report extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('mastermodel'); $this->load->model('reportmodel'); $this->load->model('studentmodel'); $this->load->model('inventorymodel'); $this->load->helper('to_pdf'); } function viewinreportsearch($modelfunction, $page, $pagenum) { $output = $this->reportmodel->$modelfunction($pagenum); $data['viewinfo'] = $output['results']; $this->load->view('report/' . $page . '', $data); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if ($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } function addformdisplay($page, $directory, $return_page = '') { $data = array(); $data['return_page'] = $return_page; $perm = $this->reportmodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 1); if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $this->load->view('' . $directory . '/' . $page . '', $data); } } function addinreport($modelfunction, $page) { $data = array(); $postdata = $this->get_post_values(); $data = $this->reportmodel->$modelfunction($postdata); $this->viewinreportsearch($data['resfunction'], $page, $_SESSION['pagenum']); $this->load->view('message', $data); } function deletedata($table, $id, $field) { $data = array(); $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 3); if (!$perm) $data['msg'] = "Access is restricted"; else $data = $this->mastermodel->deletedata($table, $id, $field); $arr = array('msg' => $data['msg'], 'res' => $data['res']); echo json_encode($arr); } function edit_page($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 2); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('report/' . $page, $data); } } function single_page($id, $table, $field, $page) { if ($_SESSION['current_mode'] != "") { $perm = $this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'], 0); } else { $perm = 1; } if (!$perm) { $data['msg'] = "Access is restricted"; $this->load->view('message', $data); } else { $data['viewinfo'] = $this->mastermodel->get_data_srow($table, $id, $field); $data['id'] = $id; $this->load->view('report/' . $page, $data); } } function generate_report($modelfunction, $page, $view = 'view', $flag = '') { $data = array(); $logo = $this->mastermodel->get_single_field_value('centre', 'logo', 'centre_id', '1'); $postdata = $this->get_post_values(); $data['postdata'] = $postdata; $data['modelfunction'] = $modelfunction; $data['page'] = $page; $_SESSION['postdata'] = $postdata; $output = ""; $output = $this->reportmodel->$modelfunction($postdata); $data['postdata'] = $postdata; $data['logo'] = $logo; $data['view'] = $view; if ($modelfunction == "get_attendance_report") { $batch = $this->mastermodel->get_data_srow('batch', $postdata['batch_id'], 'batch_id'); $main_course = $this->mastermodel->get_data_srow_joined('course', 'main_course', 'main_course_id', 'main_course_id', $batch->course_id, 'course_id'); $data['main_course_id'] = $main_course->main_course_id; if ($data['main_course_id'] == 6) $page = '_sos_attendance_report'; } if ($modelfunction == "get_fee_attendance_report") { $batch = $this->mastermodel->get_data_srow('batch', $postdata['batch_id'], 'batch_id'); $main_course = $this->mastermodel->get_data_srow_joined('course', 'main_course', 'main_course_id', 'main_course_id', $batch->course_id, 'course_id'); $data['main_course_id'] = $main_course->main_course_id; if ($data['main_course_id'] == 6) $page = '_sos_fee_attendance_report'; } $page = 'xls' . $page; if (!empty($output)) { $data['report'] = $output; //$page = 'xls' . $page; $this->load->view('report/' . $page . '', $data); } else { if ($flag == 1) { $data['report'] = ""; $this->load->view('report/' . $page . '', $data); } else { if ($view == 'view') { echo "0"; } else { redirect('master/index/' . $_SESSION['current_mode'] . '/11'); } } } } function generate_business_report($modelfunction, $page, $view = 'view', $flag = '') { $data = array(); $logo = $this->mastermodel->get_single_field_value('centre', 'logo', 'centre_id', '1'); $postdata = $this->get_post_values(); $data['postdata'] = $postdata; $data['student_type'] = $postdata['student_type']; $data['modelfunction'] = $modelfunction; $data['page'] = $page; $_SESSION['postdata'] = $postdata; $output = ""; $output = $this->reportmodel->$modelfunction($postdata); $data['report_format'] = $postdata['report_type']; $data['postdata'] = $postdata; $data['logo'] = $logo; $page = 'xls' . $page; $data['view'] = $view; if (!empty($output)) { $data['report'] = $output; //$page = 'xls' . $page; $this->load->view('report/' . $page . '', $data); } else { if ($flag == 1) { $data['report'] = ""; $this->load->view('report/' . $page . '', $data); } else { if ($view == 'view') { echo "0"; } else { redirect('master/index/' . $_SESSION['current_mode'] . '/11'); } } } } function generate_business_dashboard_report($modelfunction, $page, $view = 'view', $flag = '') { $data = array(); $logo = $this->mastermodel->get_single_field_value('centre', 'logo', 'centre_id', '1'); $postdata = $this->get_post_values(); $data['postdata'] = $postdata; $data['student_type'] = $postdata['student_type']; $data['modelfunction'] = $modelfunction; $data['page'] = $page; $_SESSION['postdata'] = $postdata; $output = ""; $output = $this->reportmodel->$modelfunction($postdata); $data['report_format'] = $postdata['report_type']; $data['postdata'] = $postdata; $data['logo'] = $logo; $page = 'xls' . $page; $data['view'] = $view; $data['report'] = $output; $html=$this->load->view('report/xls_business_dashboard_report', $data,true); if($view == 'xls') { header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=" . $postdata['report_name'] . ".xls"); header("Pragma: no-cache"); header("Expires: 0"); echo $html; } else if($view == 'pdf') { pdf_create($html, 'Bussiness Dashboard Report'); } else { echo $html; } } function generate_fee_report($modelfunction, $page, $view = 'view', $flag = '') { $data = array(); $logo = $this->mastermodel->get_single_field_value('centre', 'logo', 'centre_id', '1'); $postdata = $this->get_post_values(); $data['postdata'] = $postdata; $data['modelfunction'] = $modelfunction; $data['page'] = $page; $_SESSION['postdata'] = $postdata; $output = ""; $output = $this->reportmodel->$modelfunction($postdata); $data['report_format'] = $postdata['report_type']; $data['postdata'] = $postdata; $data['logo'] = $logo; $page = 'xls' . $page; $data['view'] = $view; if (!empty($output)) { $data['report'] = $output['result']; $data['row_span'] = $output['rowspan']; $this->load->view('report/' . $page . '', $data); } else { if ($flag == 1) { $data['report'] = ""; $this->load->view('report/' . $page . '', $data); } else { if ($view == 'view') { echo "0"; } else { redirect('master/index/' . $_SESSION['current_mode'] . '/11'); } } } } function generate_fee_pending_report($modelfunction, $page, $view = 'view', $flag = '') { $data = array(); $logo = $this->mastermodel->get_single_field_value('centre', 'logo', 'centre_id', '1'); $postdata = $this->get_post_values(); $data['postdata'] = $postdata; $data['modelfunction'] = $modelfunction; $data['page'] = $page; $_SESSION['postdata'] = $postdata; $output = ""; $output = $this->reportmodel->$modelfunction($postdata); $data['report_format'] = $postdata['report_type']; $data['postdata'] = $postdata; $data['logo'] = $logo; $data['logo'] = $logo; $page = 'xls' . $page; $data['view'] = $view; if (!empty($output)) { $data['report'] = $output['result']; $data['row_span'] = $output['rowspan']; $this->load->view('report/' . $page . '', $data); } else { if ($flag == 1) { $data['report'] = ""; $this->load->view('report/' . $page . '', $data); } else { redirect('master/index/' . $_SESSION['current_mode'] . '/11'); } } } } /* End of file master.php */ /* Location: ./application/controllers/master.php */