Advertisement
anticims19

ctrl_UploadMulti.php

May 16th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.34 KB | None | 0 0
  1. public function proc_register(){
  2.         $this->load->helper('misc');
  3.  
  4.         $config['upload_path'] = './assets/upload/file';
  5.         $config['allowed_types'] = 'png|jpg';
  6.         $config['max_size'] = '15000';
  7.         //$config['max_width']  = '700';
  8.         //$config['max_height']  = '600';
  9.         $config['overwrite']  = TRUE;
  10.         // $config['encrypt_name']  = TRUE;
  11.         //$config['remove_spaces']  = TRUE;
  12.         $this->load->library('upload', $config);
  13.  
  14.         $userid = $this->security->xss_clean($this->input->post('user_id'));
  15.         $name = $this->security->xss_clean($this->input->post('name'));
  16.         $tmp_lahir = $this->security->xss_clean($this->input->post('tmp_lahir'));
  17.         $tgl_lahir = $this->security->xss_clean($this->input->post('tgl_lahir'));
  18.         $alamat = $this->security->xss_clean($this->input->post('alamat'));
  19.         $email = $this->security->xss_clean($this->input->post('email'));
  20.         $phone = $this->security->xss_clean($this->input->post('phone'));
  21.         $nm_rtrwnet = $this->security->xss_clean($this->input->post('nm_rtrwnet'));
  22.         $alamat_rtrwnet = $this->security->xss_clean($this->input->post('alamat_rtrwnet'));
  23.         $jarak_min = $this->security->xss_clean($this->input->post('jarak_min'));
  24.         $jarak_max = $this->security->xss_clean($this->input->post('jarak_max'));
  25.         $router1 = $this->security->xss_clean($this->input->post('router1'));
  26.         $router2 = $this->security->xss_clean($this->input->post('router2'));
  27.         $router3 = $this->security->xss_clean($this->input->post('router3'));
  28.         $ap1 = $this->security->xss_clean($this->input->post('ap1'));
  29.         $ap2 = $this->security->xss_clean($this->input->post('ap2'));
  30.         $ap3 = $this->security->xss_clean($this->input->post('ap3'));
  31.         $ap4 = $this->security->xss_clean($this->input->post('ap4'));
  32.  
  33.         if ($this->upload->do_upload('file_ktp') && $this->upload->do_upload('file_foto') && $this->upload->do_upload('file_bukti')) {
  34.             $up_data        = $this->upload->data();
  35.             $up_data1       = $this->upload->data();
  36.             $up_data2       = $this->upload->data();
  37.  
  38.             $data = array(
  39.                 'user_id'   => $userid,
  40.                 'name'      => $name,
  41.                 'tmp_lahir' => $tmp_lahir,
  42.                 'tgl_lahir' => $tgl_lahir,
  43.                 'alamat'    => $alamat,
  44.                 'email'     => $email,
  45.                 'phone'     => $phone,
  46.                 'nm_rtrwnet'    => $nm_rtrwnet,
  47.                 'alamat_rtrwnet'    => $alamat_rtrwnet,
  48.                 'jarak_min' => $jarak_min,
  49.                 'jarak_max' => $jarak_max,
  50.                 'router1'   => $router1,
  51.                 'router2'   => $router2,
  52.                 'router3'   => $router3,
  53.                 'ap1'   => $ap1,
  54.                 'ap2'   => $ap2,
  55.                 'ap3'   => $ap3,
  56.                 'ap4'   => $ap4,
  57.                 'ktp'   => $up_data['file_name'],
  58.                 'foto'  => $up_data1['file_name'],
  59.                 'bukti_pembayaran'  => $up_data2['file_name'],
  60.                 'status'    => 0,
  61.                 'role_id'   => 3,
  62.                 'date_create' => date('Y-m-d H:i:s'),
  63.             );
  64.  
  65.             print_r($data);
  66.         }else{
  67.  
  68.             $data = array(
  69.                 'user_id'   => $userid,
  70.                 'name'      => $name,
  71.                 'tmp_lahir' => $tmp_lahir,
  72.                 'tgl_lahir' => $tgl_lahir,
  73.                 'alamat'    => $alamat,
  74.                 'email'     => $email,
  75.                 'phone'     => $phone,
  76.                 'nm_rtrwnet'    => $nm_rtrwnet,
  77.                 'alamat_rtrwnet'    => $alamat_rtrwnet,
  78.                 'jarak_min' => $jarak_min,
  79.                 'jarak_max' => $jarak_max,
  80.                 'router1'   => $router1,
  81.                 'router2'   => $router2,
  82.                 'router3'   => $router3,
  83.                 'ap1'   => $ap1,
  84.                 'ap2'   => $ap2,
  85.                 'ap3'   => $ap3,
  86.                 'ap4'   => $ap4,
  87.                 'status'    => 0,
  88.                 'role_id'   => 3,
  89.                 'date_create' => date('Y-m-d H:i:s'),
  90.             );
  91.  
  92.             print_r($data);
  93.  
  94.             echo $this->upload->display_errors();
  95.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement