daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function update($id='')
  2. {
  3.  
  4.       $session_data = $this->session->userdata('logged_in');
  5.         $data['username'] = $session_data['username'];
  6.  
  7.         $id=$this->input->post('update');
  8.         echo "<pre>";var_dump($id);
  9.             $dc=$this->input->post('dc');
  10.             if($dc=='c'){
  11.             $amount=$this->input->post('credit1');
  12.                         }
  13.             else if ($dc=='d') {
  14.             $amount=$this->input->post('debit');
  15.                                 }
  16.  
  17. $data=array(
  18.       'date' =>$this->input->post('TDate'),
  19.       'code' =>$this->input->post('TName'),
  20.       'project' =>$this->input->post('TName1'),
  21.       'part' =>$this->input->post('part1'),
  22.       'part1' =>$this->input->post('part2'),
  23.       'dc'=>$this->input->post('dc'),
  24.       'amount'=>$amount,
  25.    );
  26. $this->db->where('recno', $id);
  27. $this->db->update('daybook', $data);
  28. $this->session->set_flashdata('Add1', 'Updated Successfully');
  29. redirect('BookKeeping/daybook','refresh');
  30. }
  31.    
  32. <a href="<?=site_url('BookKeeping/update/'.$currentID)?>" class="btn btn-info btn-"><i class="icon-new position-left">
  33.                         <input type="hidden" name="update" id="id" value="<?php echo $currentID?>">
  34.                     </i>Update</a>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top