From 271b049d97ac9d609fde98a909ac7341a777d2eb Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Wed, 18 Jul 2018 14:50:12 +0530 Subject: [PATCH] igr --- .../controllers/inwardgateregister.php | 53 ++++++++++++------- application/controllers/purchaseorder.php | 4 +- .../models/inwardgateregister_model.php | 2 +- application/views/viewIGRDetails.php | 2 +- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 71a77e82..6a189f14 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -250,29 +250,33 @@ class inwardgateregister extends BaseController if(!empty($_FILES['file']['name'])) { $config['upload_path'] = 'uploads/Igrfiles/'; - $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; + $config['allowed_types'] = '*'; $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); - // print_r($config);die; + //print_r($config);die; //Load upload library and initialize configuration - $this->load->library('upload',$config); - $this->upload->initialize($config); + + $this->load->library('upload',$config); + $this->upload->initialize($config); + + if($this->upload->do_upload('file')) + { + echo "uploadif"; + $uploadData = $this->upload->data(); + $picture = $uploadData['file_name']; + } + else + { + $error = array('error' => $this->upload->display_errors()); + $picture = ''; + } - if($this->upload->do_upload('file')) - { - $uploadData = $this->upload->data(); - $picture = $uploadData['file_name']; - } - else - { - $error = array('error' => $this->upload->display_errors()); - $picture = ''; - } } else { $picture = ''; } + return $picture ; } @@ -280,17 +284,21 @@ class inwardgateregister extends BaseController function addloadfile() { + $upfiles = ''; $pono= $this->input->post('PONO'); $igr= $this->input->post('igr'); - +//print_r($igr); $new_file_name =$_FILES['file']['name']; $new_file_name = str_replace(" ","",$new_file_name); + // print_r($new_file_name); + $files = $this->inwardgateregister_model->getfies($igr); + //print_r($files); $fcount = 0; @@ -302,9 +310,12 @@ $fcount = 0; if($lastfile == $new_file_name) { + //echo 'eqal'; + + //echo 'cm'.$fcount; $fcount ++; - + //echo 'cp'.$fcount; } } @@ -312,11 +323,15 @@ $fcount = 0; if($fcount == 0) { - + //echo 'if'.$fcount; + if(!empty($new_file_name)) - { $Picture = $this->adfile(); + { + $Picture = $this->adfile(); + + // print_r($Picture); die; $myfiles =array('PONO'=>$pono,'IGRNO'=>$igr,'FilePath'=>$Picture); - // print_r($myfiles); + $upfiles = $this->inwardgateregister_model->fileupload($myfiles); //print_r($upfiles); } diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 231e2bbe..e60b3bc8 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -4250,7 +4250,7 @@ $fcount = 0; if(!empty($_FILES['file']['name'])) { $config['upload_path'] = 'uploads/BillFiles/'; - $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; + $config['allowed_types'] = '*'; $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); // print_r($config);die; //Load upload library and initialize configuration @@ -4372,7 +4372,7 @@ function uploadfile() if(!empty($_FILES['file']['name'])) { $config['upload_path'] = 'uploads/BillFiles/'; - $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; + $config['allowed_types'] = '*'; //$config['file_name'] = $_FILES['file']['name']; $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php index 2310fc96..bf28a512 100755 --- a/application/models/inwardgateregister_model.php +++ b/application/models/inwardgateregister_model.php @@ -161,7 +161,7 @@ return $afftectedRows; $this->db->join('T_OGR_Master OGM ', 'POM.PONO = OGM.PONO_INV','left'); $this->db->where('POM.Status',PO_RELEASED); $this->db->where('POM.POType !=',SERVICE); - $this->db->or_where('POM.Status',IGR_CREATED); + // $this->db->or_where('POM.Status',IGR_CREATED); $this->db->or_where('POM.Status',MRIR_CREATED); $this->db->or_where('POM.Status',MRIR_APPROVED); $this->db->or_where('POM.Status',OGR_COMPLETE); diff --git a/application/views/viewIGRDetails.php b/application/views/viewIGRDetails.php index 8b6f1b7b..b81f95b2 100755 --- a/application/views/viewIGRDetails.php +++ b/application/views/viewIGRDetails.php @@ -690,7 +690,7 @@ counter++; // ''+ '
'+ ''+ - '
'+ + '
'+ '
'+ // '
' // ''+