2017-07-29 7 views
0
public function payment_confirmation($invoice_id = 0) 
{ 
    $data['get_sitename'] = $this->model_settings->sitename_settings(); 
    $data['get_footer'] = $this->model_settings->footer_settings(); 
    $this->form_validation->set_rules('invoice_id_input','Invoice id','required|integer'); 
    $this->form_validation->set_rules('amount_input','Amount Transfered','required|integer'); 

    if($this->form_validation->run() == FALSE) 
    { 
     if($this->input->post('invoice_id_input')) 
     { 
      $data['invoice_id'] =set_value('invoice_id_input'); 
     }else{ 
       $data['invoice_id'] = $invoice_id; 
      } 
     $this->load->view('customer/form_payment_confirmation',$data); 
    }else{ 
     $config['upload_path'] = './assets/uploads/'; 
     $config['allowed_types'] = 'gif|jpg|png'; 
     $config['max_size'] = 2000; 
     $config['max_width'] = 2000; 
     $config['max_height'] = 2000; 
     $this->load->library('upload', $config); 
     $this->upload->initialize($config); 
     $this->upload->do_upload(); 
     $upload_image = $this->upload->data(); 
     $userfile = array(
     'bukti_trnsfr' => set_value('userfile')); 

     $is_valid = $this->model_customer->mark_invoice_paid_confirmed(set_value('invoice_id_input'),set_value('amount_input'),$userfile); 
      if ($is_valid) 
      { 
        $this->session->set_flashdata('message','Terima Kasih, Produk Yang Anda Pesan Akan Segera Kami Proses'); 
        redirect('customer/shopping_history'); 
      }else{ 
        $this->session->set_flashdata('error','Jumlah Nominal Salah, Silahkan Coba Lagi '); 
        redirect('customer/payment_confirmation/'.set_value('invoice_id_input')); 
       } 

     } 
} 

これは、ユーザーが支払いを確認するためのコントローラです。ユーザーは私の電子商取引システムに貨幣転送の証拠として画像をアップロードする必要があります。私はこの問題を抱えています、イメージはフォルダにありませんが、イメージ名はデータベーステーブルに保存されています。助けてください!データベースに画像の名前がアップロードされました。しかし、私はパスフォルダの画像を見つけることができません

+1

画像がアップロードされている場合だけでなく、あなたが、関係なく、チェックの画像をアップロードしている、あなたデータをデータベースに保存します。アップロードの例外をキャッチし、データベース操作を処理する必要があります。画像アップロードのデバッグの答えで@Shyamが言ったことに従ってください。 – cyberrspiritt

+0

この行の後に '$ upload_image = $ this-> upload-> data();'これを追加して出力 'print_r($ upload_image); die;' –

答えて

0

下記の同じ解決策を見つけてください。それはあなたを助けるでしょう。

FCPATHを次のようにアップロードディレクトリのパスに追加します。

$config['upload_path'] = FCPATH.'assets/uploads/'; 

はまた、あなたがデータベースに名前を保存する前に、サーバー上か、アップロードされた画像を確認する必要が​​3210

$this->upload->do_upload('userfile'); 

に入力ファイル名を追加する必要があります。

if($this->upload->do_upload('userfile')){ 
    $userfile = array('bukti_trnsfr' => set_value('userfile')); 
}else{ 
    $userfile = array('bukti_trnsfr' => ''); 
} 

動作しない場合は教えてください。

+0

は出力しません。メールアドレスはありますか?/ –

+0

'application/logs'フォルダのエラーログを確認し、出力を共有することができます –

+0

もっと助けが必要な場合は、ここでコードを共有できますhttps://codebunk.com/b/512151751/ –

0

あなたが使用するUbuntuのplateformまたは任意のサーバー、このフォルダのその後のアクセス許可を持っている場合は、後のアクセス許可の問題があるため、画像をアップロードしよう

関連する問題