Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (68414 Members, 793 Products, 5353 Topic, 13045 Comments)

Foto Konsumen - Marketplace Multi Seller Multi Buyer Codeigniter 3.x

Dibuat
Login Terakhir 4 Hari lalu,
Telah Dilihat 1030 Kali
ali sadikin Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2. Bagaimana menambah kan foto pada konsumen pada Marketplace Multi Seller Multi Buyer Codeigniter 3.x
  3. terima kasih sebelumnya, semoga mas Robby dan Buchori bisa membantu

Ada 6 Jawaban

JEFRI GINANJAR
commented on 21 Sep 2019 19:26:02
  1. Assalamualaikum,..
Bukhori Muslim
commented on 23 Sep 2019 07:34:38
  1. Assalamualaikum,.. untuk field foto sudah ada didatabase pada table konsumen, tinggal tampilkan
  2. caranya buka file : application/views/phpmu-tigo/reseller/view_profile.php
  3. lalu pada baris 10 di atas <tr><td width='170px'><b>Username</b></td> <td><b>$row[username]</b></td></tr>
  4.  
  5. tambahkan script ini :
  6. <tr><td valign=top style='background-color:#E7EAEC' width='160px' rowspan='12'>";
  7. if (trim($row['foto'])=='' OR !file_exists("asset/foto_user/".$row['foto'])){
  8. echo "<img class='img-thumbnail' style='width:155px' src='".base_url()."asset/foto_user/blank.png'>";
  9. }else{
  10. echo "<img class='img-thumbnail' style='width:155px' src='".base_url()."asset/foto_user/$row[foto]'>";
  11. }
  12. echo "</td></tr>
  13.  
  14. Beres, silahkan lihat hasilnya. ^_^
ali sadikin
commented on 23 Sep 2019 08:48:28
  1. Assalamualaikum,..
  2. terima kasi mas Buchori namun belum ada menu input foto pada edit profil konsumen
  3. (klo ditambah lagi mas Input Foto KTP..pada edit profil konsumen.)
  4.  
  5. Kemudian bagaimana membuat atau menambah field pada produk, aktif dan tidak aktif ..??
  6.  
  7. agar reseller bisa nonaktifkan produk yang lagi stocknya kosong dan mengaktifkan kembali
  8.  
  9. saat stocknya telah ditambah ......
Bukhori Muslim
commented on 23 Sep 2019 14:11:52
  1. Assalamualaikum,.. caranya buka file : application/views/phpmu-tigo/reseller/view_profile_edit.php
  2. pada baris 42 tambahkan input foto : <tr><td>Foto</td> <td><input style='width:40%' class='form-control' type='file' name='foto'></td></tr>
  3.  
  4. terakhir buka application/models/model_reseller.php
  5. lalu baris 162 cari ubah menjadi :
  6. $config['upload_path'] = 'asset/foto_user/';
  7. $config['allowed_types'] = 'gif|jpg|png|JPG|gif|JPEG|jpeg';
  8. $config['max_size'] = '2000'; // kb
  9. $this->load->library('upload', $config);
  10. $this->upload->do_upload('foto');
  11. $hasil=$this->upload->data();
  12. if ($hasil['file_name']!=''){
  13. if (trim($this->input->post('a')) != ''){
  14. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  15. 'password'=>hash("sha512", md5($this->input->post('a'))),
  16. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  17. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  18. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  19. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  20. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  21. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  22. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  23. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  24. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))),
  25. 'foto'=>$hasil['file_name']);
  26. }else{
  27. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  28. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  29. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  30. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  31. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  32. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  33. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  34. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  35. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  36. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))),
  37. 'foto'=>$hasil['file_name']);
  38. }
  39. }else{
  40. if (trim($this->input->post('a')) != ''){
  41. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  42. 'password'=>hash("sha512", md5($this->input->post('a'))),
  43. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  44. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  45. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  46. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  47. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  48. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  49. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  50. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  51. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))));
  52. }else{
  53. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  54. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  55. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  56. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  57. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  58. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  59. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  60. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  61. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  62. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))));
  63. }
  64. }
ali sadikin
commented on 23 Sep 2019 19:59:44
  1. Assalamualaikum,..
  2. Terima mas bukhori sy sudah melakukan seperti petunjuk diatas hasil uploud sudah ada dalam folder : asset/foto_user
  3. namun foto p[rofil tidak berubah tetap blank.. berikut sy sertakan yang sy rubah pada File : application/models/model_reseller.php
  4.  
  5. function profile_update($id){
  6. $config['upload_path'] = 'asset/foto_user/';
  7. $config['allowed_types'] = 'gif|jpg|png|JPG|gif|JPEG|jpeg';
  8. $config['max_size'] = '2000'; // kb
  9. $this->load->library('upload', $config);
  10. $this->upload->do_upload('foto');
  11. $hasil=$this->upload->data();
  12. if ($hasil['file_name']!=''){
  13. if (trim($this->input->post('a')) != ''){
  14. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  15. 'password'=>hash("sha512", md5($this->input->post('a'))),
  16. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  17. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  18. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  19. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  20. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  21. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  22. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  23. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  24. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))),
  25. 'foto'=>$hasil['file_name']);
  26. }else{
  27. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  28. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  29. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  30. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  31. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  32. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  33. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  34. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  35. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  36. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))),
  37. 'foto'=>$hasil['file_name']);
  38. }
  39. }else{
  40. if (trim($this->input->post('a')) != ''){
  41. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  42. 'password'=>hash("sha512", md5($this->input->post('a'))),
  43. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  44. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  45. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  46. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  47. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  48. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  49. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  50. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  51. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))));
  52. }else{
  53. $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))),
  54. 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))),
  55. 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))),
  56. 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')),
  57. 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')),
  58. 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))),
  59. 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))),
  60. 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))),
  61. 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))),
  62. 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))));
  63. }
  64. }
  65. $this->db->where('id_konsumen',$id);
  66. $this->db->update('rb_konsumen',$datadbd);
  67. }
  68.  
  69. function penjualan_list_konsumen_top($id,$level){
  70. return $this->db->query("SELECT * FROM `rb_penjualan` a JOIN rb_konsumen b ON a.id_pembeli=b.id_konsumen where a.status_penjual='$level' AND a.id_penjual='$id' ORDER BY a.id_penjualan DESC LIMIT 10");
  71. }
  72.  
joko ahmadi
commented on 16 Jan 2020 08:10:49
  1. Assalamualaikum,..
  2.  
  3.  
  4. Tambahkan kata foto pada line 101
  5. function profile_konsumen($id){
  6. return $this->db->query("SELECT foto, a.id_konsumen, a.username, a.nama_lengkap, a.email, a.jenis_kelamin, a.tanggal_lahir, a.tempat_lahir, a.alamat_lengkap, a.kecamatan, a.no_hp,
  7.  
  8.  
  9. alhamdulillah berhasil mas monggo silahkan dicoba
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!

Online