From 3114128885da86682b6edc303cd762bbb5e5260f Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Mon, 18 Jun 2018 19:01:09 +0530 Subject: [PATCH] pofile --- .../controllers/emergencypurchaseorder.php | 23 ++++++++++--------- application/controllers/purchaseorder.php | 13 +++++++---- .../controllers/servicepurchaseorder.php | 19 +++++++++++---- .../views/EditservicePurchaseorder.php | 11 ++++++--- .../views/editRevenuepurchaseorder.php | 3 ++- 5 files changed, 45 insertions(+), 24 deletions(-) diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 3ce50da8..7ad77223 100644 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -194,7 +194,8 @@ class emergencypurchaseorder extends BaseController $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = '*'; //$config['allowed_types'] = 'jpg|jpeg|png|gif'; - $config['file_name'] = $_FILES[$pathname]['name']; + $config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']); + // echo $config['file_name']; // echo "if"; //Load upload library and initialize configuration $this->load->library('upload',$config); @@ -235,8 +236,9 @@ function add($pathname) $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = '*'; //$config['allowed_types'] = 'jpg|jpeg|png|gif'; - $config['file_name'] = $_FILES[$pathname]['name']; - // echo "if"; + $config['file_name'] = str_replace(" ","",$_FILES[$pathname]['name']); + + //Load upload library and initialize configuration $this->load->library('upload',$config); $this->upload->initialize($config); @@ -484,7 +486,7 @@ $prefile =array(); { $pathname = 'browseFiles'.$i; - if(!empty($_FILES[$pathname]['name'])) + if(!empty(str_replace(" ","",$_FILES[$pathname]['name']))) { $fcount = 0; @@ -492,7 +494,7 @@ $prefile =array(); { - if($value == $_FILES[$pathname]['name']) + if($value == str_replace(" ","",$_FILES[$pathname]['name'])) { @@ -512,7 +514,7 @@ $prefile =array(); } - $prefile[] = $_FILES[$pathname]['name']; + $prefile[] = str_replace(" ","",$_FILES[$pathname]['name']); } } @@ -529,8 +531,7 @@ $prefile =array(); if($index == 1){ $filename = $value; } - } - + } if(!empty($filename)) { @@ -1041,7 +1042,7 @@ $prefile =array(); { $pathname = 'browseFiles'.$i; - if(!empty($_FILES[$pathname]['name'])) + if(!empty(str_replace(" ","",$_FILES[$pathname]['name']))) { $fcount = 0; @@ -1049,7 +1050,7 @@ $prefile =array(); { - if($value == $_FILES[$pathname]['name']) + if($value == str_replace(" ","",$_FILES[$pathname]['name'])) { @@ -1069,7 +1070,7 @@ $prefile =array(); } - $prefile[] = $_FILES[$pathname]['name']; + $prefile[] = str_replace(" ","",$_FILES[$pathname]['name']); } } diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index d17a4605..543c1be3 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -4165,7 +4165,7 @@ function addloadfile() $igr= $this->input->post('igr'); $new_file_name =$_FILES['file']['name']; - + $new_file_name = str_replace(" ","",$new_file_name); $files = $this->purchaseorder_model->getfies($pono); @@ -4203,7 +4203,7 @@ $fcount = 0; } else { - echo " File name already Exist"; + echo "No File Choose or File name already Exist"; } } @@ -4215,7 +4215,7 @@ $fcount = 0; { $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; - $config['file_name'] = $_FILES['file']['name']; + $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); // print_r($config);die; //Load upload library and initialize configuration $this->load->library('upload',$config); @@ -4306,6 +4306,8 @@ function uploadfile() $oldfile = $this->input->post('param2'); $newfile =$this->input->post('file'); + // $new_file_name =$_FILES['file']['name']; + $newfile = str_replace(" ","",$newfile); @@ -4335,7 +4337,10 @@ function uploadfile() { $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; - $config['file_name'] = $_FILES['file']['name']; + //$config['file_name'] = $_FILES['file']['name']; + $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); + + //print_r($config) ;die; //Load upload library and initialize configuration $this->load->library('upload',$config); diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 53af4688..e5d5b4ec 100644 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -598,7 +598,11 @@ function uploadfile() { $bill= $this->input->post('param1'); $oldfile= $this->input->post('param2'); - $new_file_name =$_FILES['file']['name']; + // $new_file_name =$_FILES['file']['name']; + + + $new_file_name =$_FILES['file']['name']; + $new_file_name = str_replace(" ","",$new_file_name); if(!empty($new_file_name)) { @@ -622,7 +626,8 @@ function uploadfile() { $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; - $config['file_name'] = $_FILES['file']['name']; + //$config['file_name'] = $_FILES['file']['name']; + $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); //print_r($config) ; //Load upload library and initialize configuration $this->load->library('upload',$config); @@ -663,7 +668,10 @@ function uploadfile() $pono= $this->input->post('PONO'); - $new_file_name =$_FILES['file']['name']; + + $new_file_name =$_FILES['file']['name']; + + $new_file_name = str_replace(" ","",$new_file_name); $files = $this->purchaseorder_model->getfies($pono); @@ -701,7 +709,7 @@ $upfile=''; echo "file updated successfully!"; } else{ - echo "File name already Exist"; + echo " No File Choose or File name already Exist"; } } @@ -713,7 +721,8 @@ $upfile=''; { $config['upload_path'] = 'uploads/BillFiles/'; $config['allowed_types'] = 'docx|pdf|doc|png|jpg'; - $config['file_name'] = $_FILES['file']['name']; + // $config['file_name'] = $_FILES['file']['name']; + $config['file_name'] = str_replace(" ","",$_FILES['file']['name']); //print_r($config);die; //Load upload library and initialize configuration $this->load->library('upload',$config); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 469f3d73..ee7f8963 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -3893,11 +3893,15 @@ function addRow() { //alert(); -var file = $('#images').val(); - //alert(file); +//var filec= $('#images'+counter).val(); + + + +var file = $('#images'+counter).val(); + //alert("fgh"+file); // return false; - if (file == '' || file == undefined) + if (file == '') { alert('File not found'); @@ -3906,6 +3910,7 @@ var file = $('#images').val(); else{ fileupload(counter); } + } function Copyfilename(id) diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index 68242237..f2e07d9c 100644 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -5827,7 +5827,8 @@ else{ //var file = $('#imag').val(); var file = $('#images').val(); - if (file == '' || file == undefined) + + if (file == '') { alert('File not found');