function information_save($id = '') { $data['page_name'] = '<b>Add Information</b>'; $this->config->load('deductions'); if ($id != '') { $data['page_name'] = '<b>Edit Information</b>'; } $data['msg'] = ''; $di = new Deduction_information(); $data['deduction'] = $di->get_by_id($id); if (Input::get('op')) { $di->code = Input::get('code'); $di->desc = Input::get('desc'); $di->deduction_agency_id = Input::get('agency_id'); $di->type = Input::get('type'); $di->mandatory = Input::get('mandatory'); $di->tax_exempted = Input::get('tax_exempted'); $di->er_share = Input::get('er_share'); $di->official = Input::get('official'); $di->optional_amount = Input::get('optional_amount'); $di->amount = Input::get('amount'); $di->reference_table = Input::get('reference_table'); $di->amount_exempted = Input::get('amount_exempted'); $di->report_order = Input::get('report_order'); $di->line_no = Input::get('line_no'); $di->save(); return Redirect::to('payroll/deduction/information', 'refresh'); } $d = new Deduction_agency(); $data['agencies'] = $d->get_agencies(); $data['main_content'] = 'deduction/information/information_save'; return View::make('includes/template', $data); }