?
Current Path : /home1/savoy/public_html/savoyglobal.net/oscardraft/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/oscardraft/application/controllers/hr.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Hr extends MY_Controller { public function __construct() { parent::__construct(); $this->load->model('mastermodel'); $this->load->model('accountingmodel'); $this->load->model('hrmodel'); $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; } function viewinhrsearch($modelfunction,$page,$pagenum) { $output=$this->hrmodel->$modelfunction($pagenum); $data['viewinfo']=$output['results']; $this->load->view('hr/'.$page.'',$data); } function addformdisplay($page,$directory,$return_page='') { $data=array(); $data['return_page']=$return_page; $perm=$this->hrmodel->check_user_permission($_SESSION['current_mode'], $_SESSION['user_id'],1); if(!$perm) { $data['msg']="Permission Denied"; $this->load->view('message',$data); } else { $this->load->view(''.$directory.'/'.$page.'',$data); } } function addinhr($modelfunction,$page) { $data=array(); $postdata = $this->get_post_values(); $data=$this->hrmodel->$modelfunction($postdata); $this->viewinhrsearch($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']="Permission Denied"; 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']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['id']=$id; $this->load->view('hr/'.$page,$data); } } function edit_salary_setting($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']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['allowdeduc']=$this->mastermodel->get_data('employee_salary_allowdeduc',$id,'employee_salary_id'); $data['medical']=$this->mastermodel->get_data('employee_salary_medical',$id,'employee_salary_id'); $data['id']=$id; $this->load->view('hr/'.$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']="Permission Denied"; $this->load->view('message',$data); } else { $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['id']=$id; $this->load->view('hr/'.$page,$data); } } function single_salary_setting($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']="Permission Denied"; $this->load->view('message',$data); } else { // $data['viewinfo']=$this->mastermodel->get_data_srow($table,$id,$field); $data['viewinfo']=$this->mastermodel->get_data_srow_joined($table,'employee','employee_id','employee_id',$id,$field); $data['allowdeduc']=$this->mastermodel->get_data('employee_salary_allowdeduc',$id,'employee_salary_id'); $data['medical']=$this->mastermodel->get_data('employee_salary_medical',$id,'employee_salary_id'); $data['id']=$id; $this->load->view('hr/'.$page,$data); } } function load_items($page,$employee_id) { $data['employee_id'] = $employee_id; $this->load->view('hr/'.$page,$data); } function load_employee_details($id) { $employee_id=$this->mastermodel->get_single_field_value('employee','employee_id','employee_id',$id); $data['emp']=$this->mastermodel->get_data_srow('employee',$employee_id,'employee_id'); $data['designation']=$this->mastermodel->get_single_field_value('designation','designation_name','designation_id',$data['emp']->employee_designation_id); $data['department']=$this->mastermodel->get_single_field_value('department','department_name','department_id',$data['emp']->employee_department_id); $this->load->view('hr/employee_details',$data); } function load_all_employee_salary_payment($date) { $data['viewinfo']=$this->hrmodel->getemployeelist(); $data['date']=$date; $this->load->view('hr/add_multiple_employee_salary_payment',$data); } function checksalarymonth() { $data=array(); $data['info']=$_POST; $salary_count = $this->hrmodel->count_data_salary('employee_salary',$data['info']['id'],$data['info']['date']) ; if($salary_count == 0) { echo "salary_not_set"; } else { $salary_exist= $this->hrmodel->check_salary_month($data['info']['id'],$data['info']['date']); if($salary_exist>0) echo "salary_exists"; } } function load_employees_salary($id,$date, $type = "") { $employee_salary_id=$this->hrmodel->get_employee_salary_id($id,$date); if($employee_salary_id!="") { $data['viewinfo']=$this->mastermodel->get_data_srow('employee_salary',$employee_salary_id,'employee_salary_id'); $data['salary_date']=$date; $data['form_type'] = $type; $data['emp_sal_id']=$employee_salary_id; $this->load->view('hr/add_single_employee_salary_payment',$data); } else { echo '<script type="text/javascript">alert(\'Employee Salary Not set\');</script>'; } } function loadsalary($page,$post,$date) { $data['viewinfo'] = $this->hrmodel->loademployeesalary($post,$date); $data['wef_date']=$date; $this->load->view('hr/'.$page.'',$data); } function loadunpostedsalary($page,$salid,$date) { $data['wef_date']=$date; $data['salpay']= $this->hrmodel->loadunpostedsalary($salid); $this->load->view('hr/'.$page.'',$data); } function loadpostedsalary($page,$salid) { $data=array(); $data['salpay']= $this->hrmodel->loadpostedsalary($salid); $this->load->view('hr/'.$page.'',$data); } function unposted_payslip_pdf($salid) { $data=array(); $data['salpay'] = $this->hrmodel->loadunpostedsalary($salid); $this->load->view('hr/payslip_pdf', $data); } function posted_payslip_pdf($salid) { $data=array(); $data['salpay'] = $this->hrmodel->loadpostedsalary($salid); $this->load->view('hr/payslip_pdf', $data); } function leave_approval($id,$status) { echo $this->hrmodel->leave_approval($id,$status); } function load_payment_method($payment_type_id) { $data['payment_type'] = $payment_type_id; $this->load->view('hr/payment_method', $data); } function autosuggestemployeesalarypayment($salary_date) { $q = strtolower($_POST["q"]); if (!$q) return; $salary_month= date("m", strtotime($salary_date)); $salary_year=date("Y", strtotime($salary_date)); $employee_list = $this->hrmodel->getunpaidemployees($salary_month, $salary_year); foreach ($employee_list as $items) { $name = $items['employee_name']; $emp_no = $items['employee_no']; if (strpos(strtolower($name), $q) !== false) { echo '' . $name . '-' . $emp_no . '#' . $items['employee_id'] . '#'; echo "\n"; } else if (strpos(strtolower($emp_no), $q) !== false) { echo '' . $name . '-' . $emp_no . '#' . $items['employee_id'] . '#'; echo "\n"; } } } function datecheck() { $date = $_POST['date']; $checkdate=$this->mastermodel->get_single_field_value('employee_attendance','employee_attendance_id','employee_attendance_date',$date); if($checkdate != "") { echo 1; } else { echo 0; } } } /* End of file master.php */ /* Location: ./application/controllers/master.php */