Assalamualaikum,.. Terima mas bukhori sy sudah melakukan seperti petunjuk diatas hasil uploud sudah ada dalam folder : asset/foto_user namun foto p [rofil tidak berubah tetap blank .. berikut sy sertakan yang sy rubah pada File : application /models /model_reseller .php function profile_update($id){ $config['upload_path'] = 'asset/foto_user/'; $config['allowed_types'] = 'gif|jpg|png|JPG|gif|JPEG|jpeg'; $config['max_size'] = '2000'; // kb $this->load->library('upload', $config); $this->upload->do_upload('foto'); $hasil=$this->upload->data(); if ($hasil['file_name']!=''){ if (trim($this->input->post('a')) != ''){ $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))), 'password'=>hash("sha512", md5($this->input->post('a'))), 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))), 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))), 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')), 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')), 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))), 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))), 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))), 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))), 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))), 'foto'=>$hasil['file_name']); }else{ $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))), 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))), 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))), 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')), 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')), 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))), 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))), 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))), 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))), 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l'))), 'foto'=>$hasil['file_name']); } }else{ if (trim($this->input->post('a')) != ''){ $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))), 'password'=>hash("sha512", md5($this->input->post('a'))), 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))), 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))), 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')), 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')), 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))), 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))), 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))), 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))), 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l')))); }else{ $datadbd = array('username'=>$this->db->escape_str(strip_tags($this->input->post('aa'))), 'nama_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('b'))), 'email'=>$this->db->escape_str(strip_tags($this->input->post('c'))), 'jenis_kelamin'=>$this->db->escape_str($this->input->post('d')), 'tanggal_lahir'=>$this->db->escape_str($this->input->post('e')), 'tempat_lahir'=>$this->db->escape_str(strip_tags($this->input->post('f'))), 'alamat_lengkap'=>$this->db->escape_str(strip_tags($this->input->post('g'))), 'kecamatan'=>$this->db->escape_str(strip_tags($this->input->post('k'))), 'kota_id'=>$this->db->escape_str(strip_tags($this->input->post('ga'))), 'no_hp'=>$this->db->escape_str(strip_tags($this->input->post('l')))); } } $this->db->where('id_konsumen',$id); $this->db->update('rb_konsumen',$datadbd); } function penjualan_list_konsumen_top($id,$level){ 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"); }
|