Advertisement
taktikhek

Untitled

Sep 13th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. function add() {
  2. $id_penerobos = $this->session->login['id_user'];
  3. $data['trobosan'] = $this->Keuangan_model->data_user($id_penerobos);
  4. $n = count($data['trobosan']);
  5. if($_SERVER['REQUEST_METHOD'] == "POST"){
  6. for($i=1; $i<=$n; $i++)
  7. {
  8. $id_user = $this->input->post('id_user'.$i);
  9. if ($this->input->post('bayar'.$i)==1) {
  10. $bayar = "Y";
  11. }else{
  12. $bayar = "N";
  13. }
  14. $catatan = $this->input->post('catatan'.$i);
  15. $bulan = $this->input->post('bulan');
  16. $tahun = $this->input->post('tahun');
  17. $bultah = $tahun.'-'.$bulan;
  18. $tanggal = $tahun.'-'.$bulan.'-'.date('d');
  19. $data = array(
  20. 'id_penerobos' => $id_penerobos,
  21. 'id_user' => $id_user,
  22. 'id_ku' => $id_penerobos,
  23. 'bayar' => $bayar,
  24. 'catatan' => $catatan,
  25. 'tanggal' => $tanggal
  26. );
  27.  
  28. $this->Keuangan_model->insert($data);
  29. }
  30.  
  31. $this->Keuangan_model->delete($bultah);
  32. $data['successMsg'] = "<strong>Berhasil Import. <a href='".base_url()."admin/keuangan'>Lihat Infaq Rezeqi</a></strong>";
  33. }
  34. // main
  35. $data['notifpost'] = count($this->Post_model->get_all_baru());
  36. $data['notifuserbaru'] = count($this->User_model->get_all_baru());
  37. $data['title'] = 'Infaq Rezeki';
  38. $data['contents'] = 'admin/keuangan/add';
  39. $this->load->view('admin/layout/template', $data);
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement