Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function edit_profil($id=0)
- {
- $this->load->view("app_user/global/header");
- if ($this->input->post('nama_user')){
- $query=$this->app_model->edit_profil();
- $this->session->set_flashdata('success', 'Data profil berhasil di edite!');
- header('location:'.base_url().'app_user/manage_profil');
- }elseif ($this->input->post('foto_user')){
- $config['upload_path'] = "./cover/"; //lokasi folder yang akan digunakan untuk menyimpan file
- $config['allowed_types'] = 'gif|jpg|png|JPEG'; //extension yang diperbolehkan untuk diupload
- $config['file_name'] = url_title($this->input->post('foto_user'));
- $this->upload->initialize($config); //meng set config yang sudah di atur
- if( !$this->upload->do_upload('foto_user'))
- {
- $this->session->set_flashdata('msg', 'Foto user harap di isi kembali!');
- header('location:'.base_url().'app_user/manage_profil');
- }
- else{
- $query=$this->app_model->edit_foto();
- $this->session->set_flashdata('success', 'Foto user berhasil di edite!');
- header('location:'.base_url().'app_user/manage_profil');
- }
- }else{
- $data['user'] = $this->app_model->view_profil();
- $this->load->view('app_user/halaman/edite_profil',$data);
- }
- $this->load->view("app_user/global/script");
- }
Advertisement
Add Comment
Please, Sign In to add comment