Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function proc_register(){
- $this->load->helper('misc');
- $config['upload_path'] = './assets/upload/file';
- $config['allowed_types'] = 'png|jpg';
- $config['max_size'] = '15000';
- //$config['max_width'] = '700';
- //$config['max_height'] = '600';
- $config['overwrite'] = TRUE;
- // $config['encrypt_name'] = TRUE;
- //$config['remove_spaces'] = TRUE;
- $this->load->library('upload', $config);
- $userid = $this->security->xss_clean($this->input->post('user_id'));
- $name = $this->security->xss_clean($this->input->post('name'));
- $tmp_lahir = $this->security->xss_clean($this->input->post('tmp_lahir'));
- $tgl_lahir = $this->security->xss_clean($this->input->post('tgl_lahir'));
- $alamat = $this->security->xss_clean($this->input->post('alamat'));
- $email = $this->security->xss_clean($this->input->post('email'));
- $phone = $this->security->xss_clean($this->input->post('phone'));
- $nm_rtrwnet = $this->security->xss_clean($this->input->post('nm_rtrwnet'));
- $alamat_rtrwnet = $this->security->xss_clean($this->input->post('alamat_rtrwnet'));
- $jarak_min = $this->security->xss_clean($this->input->post('jarak_min'));
- $jarak_max = $this->security->xss_clean($this->input->post('jarak_max'));
- $router1 = $this->security->xss_clean($this->input->post('router1'));
- $router2 = $this->security->xss_clean($this->input->post('router2'));
- $router3 = $this->security->xss_clean($this->input->post('router3'));
- $ap1 = $this->security->xss_clean($this->input->post('ap1'));
- $ap2 = $this->security->xss_clean($this->input->post('ap2'));
- $ap3 = $this->security->xss_clean($this->input->post('ap3'));
- $ap4 = $this->security->xss_clean($this->input->post('ap4'));
- if ($this->upload->do_upload('file_ktp') && $this->upload->do_upload('file_foto') && $this->upload->do_upload('file_bukti')) {
- $up_data = $this->upload->data();
- $up_data1 = $this->upload->data();
- $up_data2 = $this->upload->data();
- $data = array(
- 'user_id' => $userid,
- 'name' => $name,
- 'tmp_lahir' => $tmp_lahir,
- 'tgl_lahir' => $tgl_lahir,
- 'alamat' => $alamat,
- 'email' => $email,
- 'phone' => $phone,
- 'nm_rtrwnet' => $nm_rtrwnet,
- 'alamat_rtrwnet' => $alamat_rtrwnet,
- 'jarak_min' => $jarak_min,
- 'jarak_max' => $jarak_max,
- 'router1' => $router1,
- 'router2' => $router2,
- 'router3' => $router3,
- 'ap1' => $ap1,
- 'ap2' => $ap2,
- 'ap3' => $ap3,
- 'ap4' => $ap4,
- 'ktp' => $up_data['file_name'],
- 'foto' => $up_data1['file_name'],
- 'bukti_pembayaran' => $up_data2['file_name'],
- 'status' => 0,
- 'role_id' => 3,
- 'date_create' => date('Y-m-d H:i:s'),
- );
- print_r($data);
- }else{
- $data = array(
- 'user_id' => $userid,
- 'name' => $name,
- 'tmp_lahir' => $tmp_lahir,
- 'tgl_lahir' => $tgl_lahir,
- 'alamat' => $alamat,
- 'email' => $email,
- 'phone' => $phone,
- 'nm_rtrwnet' => $nm_rtrwnet,
- 'alamat_rtrwnet' => $alamat_rtrwnet,
- 'jarak_min' => $jarak_min,
- 'jarak_max' => $jarak_max,
- 'router1' => $router1,
- 'router2' => $router2,
- 'router3' => $router3,
- 'ap1' => $ap1,
- 'ap2' => $ap2,
- 'ap3' => $ap3,
- 'ap4' => $ap4,
- 'status' => 0,
- 'role_id' => 3,
- 'date_create' => date('Y-m-d H:i:s'),
- );
- print_r($data);
- echo $this->upload->display_errors();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement