Haloo! Selamat Datang di Komunitas Private Training Web Development (49091 Members, 473 Projects, 3791 Topic, 10260 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!
File Gambar lain berubah ketika dilakukan pengeditan
kadri yusuf Mengatakan : Members -
Rate Topic :
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. Mas, saya ingin menanyakan tentang pengeditan file.
  4. contoh:
  5. Dalam satu record terdiri dari 5 atribut file gambar, katakanlah atribut a,b,c,d,e. kelima atribut gambar tersebut telah terisi. Namun ada perubahan pada file gambar pada atribut c, ketika dilakukan perubahan pada atribut c, maka file gambar a,b,d dan e menjadi kosong. Kira2 solusi nya seperti apa ya mas, mohon pencerahannya. Berikut ini saya lampirkan potongan controller editnya
  6.  
  7. function FO_Edit(){
  8. //cek_session_akses('izinbidan',$this->session->id_session);
  9. $id = $this->uri->segment(3);
  10. if (isset($_POST['submit'])){
  11. $config['upload_path'] = 'asset/izin/';
  12. $config['allowed_types'] = 'gif|pdf|jpg|png|JPG|JPEG';
  13. $config['max_size'] = '3000'; // kb
  14.  
  15. $this->load->library('upload', $config);
  16.  
  17.  
  18. /* if($this->upload->do_upload('h2')){
  19.   $lmp_ijasah=$this->upload->data();
  20.   }
  21.  */
  22.  
  23. $hasil0 = null;
  24. $hasil = null;
  25. $hasil2 = null;
  26. $hasil3 = null;
  27. $hasil4 = null;
  28. $hasil5 = null;
  29. $hasil6 = null;
  30. $hasil7 = null;
  31. $hasil8 = null;
  32.  
  33. if($this->upload->do_upload('i2'))
  34. {
  35. $hasil0=$this->upload->data();
  36. }
  37.  
  38. if($this->upload->do_upload('j'))
  39. {
  40. $hasil=$this->upload->data();
  41. }
  42. if($this->upload->do_upload('k'))
  43. {
  44. $hasil2=$this->upload->data();
  45. }
  46.  
  47. if($this->upload->do_upload('l'))
  48. {
  49. $hasil3=$this->upload->data();
  50. }
  51. if($this->upload->do_upload('m'))
  52. {
  53. $hasil4=$this->upload->data();
  54. }
  55. if($this->upload->do_upload('n'))
  56. {
  57. $hasil5=$this->upload->data();
  58. }
  59. if($this->upload->do_upload('o'))
  60. {
  61. $hasil6=$this->upload->data();
  62. }
  63. if($this->upload->do_upload('p'))
  64. {
  65. $hasil7=$this->upload->data();
  66. }
  67. if($this->upload->do_upload('q'))
  68. {
  69. $hasil8=$this->upload->data();
  70. }
  71. echo $hasil['file_name'];
  72. echo $hasil0['file_name'];
  73. // exit;
  74. $config['wm_text'] = '';
  75. $config['wm_type'] = 'text';
  76. $config['wm_font_path'] = './system/fonts/texb.ttf';
  77. $config['wm_font_size'] = '26';
  78. $config['wm_font_color'] = 'ffffff';
  79. $config['wm_vrt_alignment'] = 'middle';
  80. $config['wm_hor_alignment'] = 'center';
  81. $config['wm_padding'] = '20';
  82. $this->load->library('image_lib',$config);
  83. $this->image_lib->watermark();
  84. {
  85. $data = array('tahun_lulusan'=>$this->db->escape_str($this->input->post('c')),
  86. 'nomor_str'=>$this->db->escape_str($this->input->post('d')),
  87. 'tanggal_pengajuan'=>$this->db->escape_str($this->input->post('d1')),
  88. 'nomor_rekomendasiop'=>$this->db->escape_str($this->input->post('e')),
  89. 'tempat_praktik'=>$this->db->escape_str($this->input->post('e1')),
  90. 'praktik_sebagai'=>$this->db->escape_str($this->input->post('e2')),
  91. 'alamat_praktik'=>$this->db->escape_str($this->input->post('f')),
  92. 'kecamatan'=>$this->db->escape_str($this->input->post('h')),
  93. 'desa'=>$this->db->escape_str($this->input->post('i')),
  94. 'lamp_ijasah'=>$hasil0['file_name'],
  95. 'lamp_ktp'=>$hasil['file_name'],
  96. 'lamp_str'=>$hasil2['file_name'],
  97. 'lamp_sksf'=>$hasil3['file_name'],
  98. 'lamp_rekomendasi'=>$hasil6['file_name'],
  99. 'lamp_pernyataan'=>$hasil7['file_name'],
  100. 'lamp_kuasa'=>$hasil8['file_name'],
  101. 'masa_berlaku_izin'=>$this->db->escape_str($this->input->post('r')),
  102. 'no_sertfikat_bidan'=>$this->db->escape_str($this->input->post('s'))
  103. );
  104. }
  105. $where = array('izin_id' => $this->input->post('id'));
  106. $this->model_app->update('izin', $data, $where);
  107.  
  108.  
  109. // Update data pemohon
  110. $dataPemohon = array('foto'=>$hasil5['file_name']);
  111. $wherePemohon = array('pemohon_id' => $this->input->post('id'));
  112. $this->model_app->update('pemohon', $dataPemohon, $wherePemohon);
  113.  
  114.  
  115. redirect('izin');
  116. }else
  117. {
  118. // $record = $this->model_app->view_ordering('kecamatan','id_kec','DESC');
  119. $record = $this->model_app->view_where_ordering('kecamatan', array('id_kab' => '1221'), 'id_kec','DESC');
  120. $recorddesa = $this->model_app->view_ordering('kelurahan','id_kec','DESC');
  121.  
  122.  
  123. $this->db->select('*');
  124. $this->db->from('izin');
  125. $this->db->join('pemohon','pemohon.nik=izin.nik');
  126. $this->db->join('kabupaten','kabupaten.id_kab=izin.kabupaten');
  127. $this->db->join('kecamatan','kecamatan.id_kec=izin.kecamatan');
  128. $this->db->join('kelurahan','kelurahan.id_kel=izin.desa');
  129. $this->db->where('izin.izin_id',$id);
  130.  
  131.  
  132. $query=$this->db->get();
  133. $data = array('record' => $record,'recorddesa' =>$recorddesa);
  134. // $data = array('recorddesa' => $recorddesa);
  135. //$data = array('recorddesa' => $recorddesa);
  136.  
  137. $data['rows']= $query->row_array();
  138. $this->template->load('administrator/template','administrator/mod_perizinan/FO_Edit',$data);
  139.  
  140.  
  141. }
  142.  
  143. }
  144.  
  145. Terima Kasih.
  146.  
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!