<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');


class Uploadpayslip extends MY_Controller
{
	function __construct()
	{
		parent::__construct();

		$this->module->checkModuleAccess(6);

		$this->load->model('admin/model_user');		
		$this->load->model('leave/model_leave');		
		
		//MODULE
	}

	function index()
	{
		// if($this->session->userdata('logged_in')){
		// 	$this->home();
		// } else {
		// 	redirect(base_url('admin/user/login'), 'refresh');
		// }
	}

	function home()
	{
		$data = $this->template->pageSetup('leave', 'home', 'leave/index');
		$this->template->view('leave', $data);
	}

	function view2()
	{	//$this->template->pageSetup(modulename,controller,pagetitle)
			$this->load->model("CRM/general_model");

		$data['view2'] = $this->payslip_model->print_list2('SA 080');
		$data['page_setup'] = $this->template->pageSetup('HR', 'Payslip', 'My Pay Slip');
		$this->template->view('hr/Payroll/my_pay_slip.php',$data);
		
		
		/* $body = array(
				'table' => array(
					'header' => array(
						'Company Name',
						'Company No.'
					),
					'right-column' => array(),
					'total-column' => array(),
					'body' => $customerList,
					'footer' => array(
					//'title' => 'Grand Total',
					//'total-column' => array(5)
					)
				),
				'filter' => array(
				)
			);*/
			
			$data['companies'] = $this->payslip_model->view();
			var_dump($data['companies']);

		$body = array(
				'table' => array(
					'header' => array(
						
					),
					'right-column' => array(),
					'total-column' => array(),
					'body' => array(
						'first-column' => array(
							'Basic Pay',
							'',
							'Phone Allowance',
						),
						'second-column' => array(
							'Other Allowance',
							'',
							'SOCSO'
						),
						'third-column' => array(
							'Phone Allowance',
							'',
							'SIP'
						),
						'fourth-column' => array(
							'',
							'',
							'Zakat'
						),
						'fifth-column' => array(
							'',
							'',
							'Loan'
						),
						'sixth-column' => array(
							'',
							'',
							'Club Fee'
						),
						'seventh-column' => array(
							'Gross Pay',
							'',
							'Total Deductions',
							''
						),
						'eight-column' => array(
							'',
							'',
							'Net Pay'
						),'ninth-column' => array(
							'Employer EPF',
							'',
							''
						),
						'tenth-column' => array(
							'Employer SOCSO',
							'',
							''
						),
						'eleventh-column' => array(
							'Employer SIP',
							'',
							''
						),
						
					),
					//'footer' => array(
					//'title' => 'Grand Total',
					//'total-column' => array(5)
					//)
				),
				'filter' => array(
				)
			);
		$header = array();
		$header['title'] = 'CUSTOMER LIST REPORT';
		$this->load->view('hr/report/header.php', $header);
		$this->load->view('hr/report/printList2.php', $body);
		$this->load->view('hr/report/footer.php');
	}
}