Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function admin_debit()
- {
- $date= date('Y-m-d H:i:s');
- $trans_type=2;
- $amount=$this->input->post('amount');
- $total_amount = array_sum($amount);
- $json=json_encode($_POST);
- $user=$this->session->userdata('sess_pt_userid');
- $data=array(
- 'dated_on'=>$date,
- 'amount'=>$total_amount,
- 'userid'=>$user,
- 'purpose'=>$json,
- 'trans_type'=>$trans_type
- );
- $response = $this->Petty_model->debit_insert($data);
- //add flash data
- if($response)
- {
- $this->session->set_flashdata('success', 'Cash Debited Successfully ');
- redirect('Petty_controller/debitview');
- }
- else
- {
- $this->session->set_flashdata('error', 'Something worng. Error!!');
- redirect('Petty_controller/debitview');
- }
- }
- $amount=$this->input->post('amount');
- $total_amount = array_sum($amount);
- $total_amount=0;
- if($this->input->post('amount') && is_array($this->input->post('amount')){
- $total_amount = array_sum($this->input->post('amount'));
- }
- $date= date('Y-m-d H:i:s');
- $trans_type=2;
- $json=json_encode($_POST);
- $user=$this->session->userdata('sess_pt_userid');
- $data=array(
- 'dated_on'=>$date,
- 'amount'=>$total_amount,
- 'userid'=>$user,
- 'purpose'=>$json,
- 'trans_type'=>$trans_type
- );
- $response = $this->Petty_model->debit_insert($data);
Add Comment
Please, Sign In to add comment