Postingan lainnya
Upload file pdf dengan codeigniter
private function _uploadPdf() { $config['upload_path'] = './assets/upload/invoice/'; $config['allowed_types'] = 'pdf'; $config['file_name'] = $this->invoice_no; $config['overwrite'] = true;
$this->load->library('upload', $config);
if ($this->upload->do_upload('invoice_file')) { return $this->upload->data("file_name"); }
return false; }
function form_process(){ $id = $this->input->post('id'); $id_po = $this->input->post('id_po'); $invoice_no = $this->input->post('invoice_no'); $invoice_file = $this->_uploadPdf(); $status = $this->input->post('status');
$data_redirect = array(); $data_redirect['status'] = 'success';
if( $id == '0' || $id == '' ){ if($this->action_menu(28,26)){ $data_insert = array( 'id_po'=>$id_po, 'invoice_no'=>$invoice_no, 'invoice_file'=>$this->_uploadPdf(), 'status'=>'active', 'created_by'=>$this->staff_email, 'created_at'=>date("Y-m-d H:i:s") );
$this->mi->insert_table($data_insert); $data_redirect['message'] = 'Data has been insert'; }else{ $data_redirect['message'] = 'You don\t have access'; }
mau tanya master master,kenapa hasilnya jadi 0 ya?
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban