/** * Index */ public function index() { $this->load->library(array('overtime')); $this->load->helper(array('my_datetime_helper', 'my_variable_helper')); if ($this->input->post('startdate') && $this->input->post('enddate')) { $data['otlist'] = $this->overtime->display_overtime($this->session->userdata('employeenumber'), $this->input->post('startdate'), $this->input->post('enddate')); $data['startdate'] = $this->input->post('startdate'); $data['enddate'] = $this->input->post('enddate'); } else { // Set the default filter to start date equivalent to 5 days prior // to current date, end date to current date. $data['otlist'] = $this->overtime->display_overtime($this->session->userdata('employeenumber'), date_subtract(5), date('Y-m-d')); } $this->page_title('Overtime - TREC Webforms'); $this->add_css(array('datepicker.min', 'dataTables.bootstrap.min')); $this->add_js_footer(array('bootstrap-datepicker.min', 'input-datepicker', 'jquery.dataTables.min', 'dataTables.bootstrap.min', 'initdttable', 'overtime')); $this->display_master('index', $data); }
/** * Index */ public function index() { $this->load->library(array('overtime')); $this->load->helper(array('my_datetime_helper', 'my_variable_helper')); if ($this->input->post('startdate') && $this->input->post('enddate')) { // Live $data['subordinates'] = $this->overtime->filed_overtime($this->session->userdata('employeenumber'), $this->input->post('startdate'), $this->input->post('enddate')); // Test // $data['subordinates'] = $this->overtime->filed_overtime('051039', $this->input->post('startdate'), $this->input->post('enddate')); $data['startdate'] = $this->input->post('startdate'); $data['enddate'] = $this->input->post('enddate'); } else { // Use this for live. $data['subordinates'] = $this->overtime->filed_overtime($this->session->userdata('employeenumber'), date_subtract(3), date('Y-m-d')); // Test // $data['subordinates'] = $this->overtime->filed_overtime('051039', date_subtract(3), date('Y-m-d')); } $this->page_title('Filed Overtime - TREC Webforms'); $this->add_css(array('datepicker.min', 'dataTables.bootstrap.min')); $this->add_js_footer(array('bootstrap-datepicker.min', 'input-datepicker', 'jquery.dataTables.min', 'dataTables.bootstrap.min', 'initdttable', 'overtime')); $this->display_master('index', $data); }
/** * Retrieve leave details * * @param int $leavefileid * @return void */ public function leavedetails($leavefileid) { $this->_ci->employeeleavesfiled->load($leavefileid); // Get the number of days of the filed leave. $days = days_difference($this->_ci->employeeleavesfiled->LeaveFrom, $this->_ci->employeeleavesfiled->LeaveTo); // We'll loop through the days. for ($i = 0; $i < $days; $i++) { $scheddate = date_subtract($i, date_create($this->_ci->employeeleavesfiled->LeaveTo)); $this->_inserttoemplogs($scheddate, $this->_ci->employeeleavesfiled); } }