function adcom_options($e = '') { $options = array(); $d = new Additional_compensation_m(); $d->order_by('name'); $rows = $d->get(); //$options[''] = '---ALL---'; foreach ($rows as $row) { $options[$row->id] = $row->code; } return $options; }
function staff_entitlement_save($id = '', $employee_id = '') { $data['page_name'] = '<b>Save Staff Entitlement</b>'; $data['msg'] = ''; $di = new Staff_entitlement_m(); $data['deduction'] = $di->get_by_id($id); $data['employee_id'] = $employee_id; if (Input::get('op')) { // Add employee id if insert only if ($id == 0) { $di->employee_id = $employee_id; } $di->additional_compensation_id = Input::get('additional_compensation_id'); $di->effectivity_date = Input::get('effectivity_date'); $di->ineffectivity_date = Input::get('ineffectivity_date'); $di->amount = Input::get('amount'); $di->save(); return Redirect::to('payroll/adcom/staff_entitlement/' . $employee_id, 'refresh'); } $d = new Additional_compensation_m(); $d->order_by('name'); //$d->where('type', 'loan'); $data['informations'] = $d->get(); //echo $this->db->last_query(); $data['main_content'] = 'adcom/staff/staff_entitlement_save'; return View::make('includes/template', $data); }