Ejemplo n.º 1
0
 public function allowances_add()
 {
     $this->form_validation->set_rules('txtAllowanceType', 'Allowance Type', 'trim|required');
     $this->form_validation->set_rules('txtAmount', 'Amount', 'trim|required|numeric');
     $this->form_validation->set_rules('txtPercentage', 'Percentage', 'trim|required|numeric');
     if ($this->form_validation->run()) {
         $post = $this->input->post();
         if (Allowance_model::insert_allowances($post['txtAllowanceType'], $post['txtAmount'], $post['txtPercentage'])) {
             $this->session->set_userdata('added', 1);
             redirect("payroll/allowances");
         }
     }
     $data = array();
     $data['pageTitle'] = 'Add Allowance Type - MSInc.';
     $data['content'] = 'allowance/allowance_add';
     $this->load->view($this->master_layout, $data);
     $this->display_notif();
 }