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'));
}
}
}
這是用戶確認付款的控制器。用戶應在我的電子商務系統中上傳圖片作爲匯款的證據。我遇到了這個問題,圖像不在文件夾中,但圖像名稱保存在數據庫表中。請幫忙!圖片名稱上傳到數據庫。但我找不到路徑文件夾中的圖像
好您要上傳的圖片,但不管檢查,如果圖像上傳,您將數據保存到數據庫。您需要捕獲上傳異常,然後處理它的數據庫操作。遵循@Shyam在圖片上傳調試的答案中所說的內容。 – cyberrspiritt
這行後面'$ upload_image = $ this-> upload-> data();'添加這個和後期輸出'print_r($ upload_image); die;' –