?
Current Path : /home1/savoy/public_html/savoyglobal.net/horeitia/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/horeitia/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('administrationmodel'); $this->load->model('onboardingmodel'); $this->load->model('reportmodel'); $this->load->helper('to_pdf'); } function get_post_values() { $data = array(); foreach ($_POST as $key => $value) { if($key != "submit") { $data[$key] = $this->input->post($key); } } return $data; } /* common function loading pages through jquery load method . * Usages:-used for displaying addform. */ function addformdisplay($page,$directory,$table="",$pagenum="") { $perm=$this->mastermodel->check_user_permission($_SESSION['current_mode'], $_SESSION['userid'],1); if(!$perm) { $data['msg']="Permission Denied"; $this->load->view('message',$data); } else { $this->load->view(''.$directory.'/'.$page.''); } } function addinreport($modelfunction,$page) { $postdata=$this->get_post_values(); $data=$this->reportmodel->$modelfunction($postdata); $data['msg']=$data['msg']; if($data['res']==1) { $this->viewinreport($data['resfunction'],$page,'1'); $this->load->view('message',$data); } else { $this->viewinreport($data['resfunction'],$page,'1'); $this->load->view('message',$data); } } function viewinreport($modelfunction,$page) { $output=$this->reportmodel->$modelfunction($postdata); $data['viewinfo']=$output['results']; $this->load->view('Reports/'.$page.'',$data); } function getinreport($modelfunction,$page) { $postdata=$this->get_post_values(); $data['postdata']=$postdata; $output=$this->reportmodel->$modelfunction($postdata); $data['report']=$output; $page=$postdata['report_type'].$page; $this->load->view('Reports/'.$page.'',$data); } function load_all_employees() { $q = strtolower($_POST["q"]); if (!$q) return; $employee_list=$this->reportmodel->get_all_employees(); foreach ($employee_list as $items) { $name = $items['emp_non_full_name']; $emp_non_no= $items['emp_non_no']; $batch= $items['batch_code']; if (strpos(strtolower($name), $q) !== false) { echo '"'.$name.'" <'.$emp_non_no.'>'; echo "\n"; } else if (strpos(strtolower($emp_non_no), $q) !== false) { echo '"'.$name.'" <'.$emp_non_no.'>'; echo "\n"; } else if (strpos(strtolower($batch), $q) !== false) { echo '"'.$name.'" <'.$emp_non_no.'>'; echo "\n"; } } } }