Advertisement
sanca

methodInput

Nov 20th, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.44 KB | None | 0 0
  1. public function prosesinput()
  2.     {
  3.     if ($this->session->getValue('username')==TRUE){
  4.         if ($_POST){
  5.            
  6.             //upload
  7.             $this->upload->setOption(
  8.              array(
  9.                 'folderLocation'=>'uploads/'.date('Y').'/'.date('m').'/',
  10.                 'autoCreateFolder' => true,
  11.                 'permittedFileType' => 'gif|png|jpg',
  12.                 'maximumSize' => 1000000,
  13.              )         
  14.             );
  15.            
  16.             if (isset($_FILES['foto'])){
  17.                 $file=$this->upload->now($_FILES['foto']);
  18.                 if ($file){
  19.                     $datafoto=$this->upload->getFileInfo();
  20.                     $foto=$datafoto['name'];               
  21.                 }else if(empty($file)){
  22.                     $foto='';
  23.                 }else{
  24.                     $error=$this->upload->getError('message');
  25.                     $error=$error[3];
  26.                 }              
  27.             }
  28.            
  29.             //end upload           
  30.        
  31.             $nama=$this->request->post('nama');
  32.             $sekolah=$this->request->post('sekolah');
  33.             $kelamin=$this->request->post('kelamin');
  34.             $kelas=$this->request->post('kelas');
  35.             $tempatlahir=$this->request->post('tempatlahir');
  36.             $tanggallahir=$this->request->post('tanggallahir');
  37.             $telpon=$this->request->post('telpon');
  38.             $alamat=$this->request->post('alamat');
  39.             $status=$this->request->post('status');
  40.            
  41.            
  42.            
  43.             $database=array(
  44.                 'nama'=>$nama,
  45.                 'sekolah'=>$sekolah,
  46.                 'kelamin'=>$kelamin,
  47.                 'kelas'=>$kelas,
  48.                 'tempatlahir'=>$tempatlahir,
  49.                 'tanggallahir'=>$tanggallahir,
  50.                 'telpon'=>$telpon,
  51.                 'alamat'=>$alamat,
  52.                 'status'=>$status,
  53.                 'foto'=>$foto,
  54.             );
  55.            
  56.             print_r($database); exit;      
  57.         }
  58.    
  59.     }
  60.    
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement