コード例 #1
0
 public function save_payslip()
 {
     $data = array();
     $data['employees'] = View_job_history::all();
     $data['payslip'] = array();
     if ($this->form_validation->run()) {
         $post = $this->input->post();
         $data['record'] = $this->attendance_model->generate_payslip($post['cboEmployee'], $post['txtStartDate'], $post['txtEndDate']);
         $data['post'] = array("cboEmployee" => $post['cboEmployee'], "txtPayrollDate" => $post['txtPayrollDate'], "txtStartDate" => $post['txtStartDate'], "txtEndDate" => $post['txtEndDate']);
         if (isset($post['btnGenerate']) and $post['hidID'] != null) {
             $insert_payslip = array('emp_id' => $post['hidID'], 'payslip_date' => $post['hidPayDate'], 'start_date' => $post['hidPayStart'], 'end_date' => $post['hidPayEnd'], 'monthly_rate' => $data['record']['employee']->salary, 'basic_salary' => $data['record']['employee']->salary / 2, 'total_overtime' => $data['record']['total_overtime'], 'total_tardiness' => $data['record']['total_tardiness'], 'days_absent' => $data['record']['total_absent'], 'total_absent_amount' => $data['record']['total_absent_amount'], 'total_allowances' => $data['record']['total_allowance'], 'total_taxes' => $data['record']['total_tax'], 'gross_pay' => $data['record']['gross_income'], 'net_pay' => $data['record']['net_income'], "allowances" => $data['record']['allowances'], "taxes" => $data['record']['taxes'], 'remarks' => "");
             $this->attendance_model->insert_payslip($insert_payslip);
             $this->session->set_userdata('added', 1);
         }
     } else {
         $data['record'] = array("attendance" => array(), "allowances" => array(), "taxes" => array(), "employee" => array(), "cutoffsalary" => 0, "perdaysalary" => 0, "total" => array(), "total_absent" => 0, "total_overtime" => 0, 'total_tardiness' => 0, "total_absent_amount" => 0, "total_allowance" => 0, "total_tax" => 0, "net_income" => 0, "gross_income" => 0);
     }
     /*
     		$data = array();
     		$data['payslip'] = array();
     		$data['record'] = array(
     			"attendance"=>array(),
     			"allowances"=>array(),
     			"taxes"=>array(),
     			"employee"=>array(),
     			"cutoffsalary"=>0,
     			"perdaysalary"=>0,
     			"total"=>array(),
     			"total_absent"=>0,
     			"total_overtime"=>0,
     			'total_tardiness'=>0,
     			"total_absent_amount"=>0,
     			"total_allowance"=>0,
     			"total_tax"=>0,
     			"net_income"=>0,
     			"gross_income"=>0);
     		$data['employees'] = $this->attendance_model->view_employees();
     		$post = $this->input->post();
     		if($post){
     			//$data['payslip'] = $this->attendance_model->retrievePayslipDates($post['cboDate']);
     			//$data['record'] = $this->attendance_model->generate_payslip(1, '2015-06-01', '2015-06-15');
     			$data['record'] = $this->attendance_model->generate_payslip($post['cboEmployee'], $post['txtStartDate'], $post['txtEndDate']);
     			//$data['post'] = $post;
     			/*$data['post'] = array(
     				"cboEmployee"=>1,
     				"txtPayrollDate"=>'2015-06-20',
     				"txtStartDate"=>'2015-06-01',
     				"txtEndDate"=>'2015-06-15');/
     			$data['post'] = array(
     				"cboEmployee"=>$post['cboEmployee'],
     				"txtPayrollDate"=>'2015-06-20',
     				"txtStartDate"=>$post['txtStartDate'],
     				"txtEndDate"=>$post['txtEndDate']);
     			if($this->input->get('generate')){
     				$insert_payslip = array(
     					'emp_id'=>$post['hidID'],
     					'payslip_date'=>$post['hidPayDate'],
     					'start_date'=>$post['hidPayStart'],
     					'end_date'=>$post['hidPayEnd'],
     					'monthly_rate'=>$data['record']['employee']->salary,
     					'basic_salary'=>$data['record']['employee']->salary/2,
     					'total_overtime'=>$data['record']['total_overtime'],
     					'total_tardiness'=>$data['record']['total_tardiness'],
     					'days_absent'=>$data['record']['total_absent'],
     					'total_absent_amount'=>$data['record']['total_absent_amount'],
     					'total_allowances'=>$data['record']['total_allowance'],
     					'total_taxes'=>$data['record']['total_tax'],
     					'gross_pay'=>$data['record']['gross_income'],
     					'net_pay'=>$data['record']['net_income'],
     					"allowances"=>$data['record']['allowances'],
     					"taxes"=>$data['record']['taxes'],
     					'remarks'=>"");
     				$this->attendance_model->insert_payslip($insert_payslip);
     			}
     		}*/
     $data['pageTitle'] = 'Generate Payslip - MSInc.';
     $data['content'] = 'payroll/generate_payslip';
     $this->load->view($this->master_layout, $data);
     $this->display_notif();
 }
コード例 #2
0
ファイル: ems.php プロジェクト: ardendeveloper/system_draft
 public function view_details()
 {
     $id = $this->input->get('emp_id');
     $data['departments'] = Departments_model::all();
     $data['job_titles'] = Job_titles_model::all();
     $data['employment_type'] = Employment_type_model::all();
     $data['countryy'] = Countries::all();
     $data['user_level'] = View_user_level::all();
     $data['record'] = Dependent_model::find('all', array('conditions' => "employee_id='{$id}'"));
     //get dependents by id
     $data['info'] = Emp_info_model::find($id);
     //Tab 1a - Personal Tab
     $data['gov_id'] = Gov_id_model::find($id);
     //Tab 1b - Gov ID Tab
     $data['address'] = View_emp_address::find($id);
     //Tab 2a - Contact Tab
     $data['contact'] = Emp_contact_model::find($id);
     //Tab 2b - Contact Tab
     $data['contactP'] = Emp_contact_person::find($id);
     //Tab 2c - Contact Tab
     $data['school'] = Emp_school_model::find($id);
     //Tab 3 - School Tab
     $data['job_hist'] = Job_history_model::find('all', array('conditions' => "employee_id ='{$id}'"));
     //Tab 4 - Job History Tab
     $data['emp'] = View_job_history::find($id);
     //Tab 5 - Employment Tab
     $data['leaves'] = View_leaves_left::find('all', array('conditions' => "employee_id ='{$id}'"));
     //Tab 6 - Leaves Tab
     $data['asset'] = View_assigned_assets_model::find('all', array('conditions' => "emp_id ='{$id}'"));
     //Tab 7 - Asset Tab
     $data['project'] = View_project_workers::find('all', array('conditions' => "emp_id ='{$id}'"));
     //Tab 8 - Project Tab
     $data['account'] = View_users_model::find_by_employee_id($id);
     //Tab 9 - Users Tab
     $data['pageTitle'] = 'Employee Details - MSInc.';
     $data['content'] = 'employee/employee_details';
     $this->load->view($this->master_layout, $data);
     $this->display_notif();
 }