From 3824f47fd3ef87fc6eb90743fc38a49d6c2a7c90 Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Wed, 13 Jun 2018 18:48:33 +0530 Subject: [PATCH] file upload --- .../controllers/emergencypurchaseorder.php | 72 ++++++++++--------- .../views/EditservicePurchaseorder.php | 2 +- application/views/alterpurchaseorder.php | 4 +- .../views/editRevenuepurchaseorder.php | 2 +- 4 files changed, 41 insertions(+), 39 deletions(-) diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index e9ee66da..c66f5630 100755 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -470,38 +470,41 @@ function add($pathname) if($POStatus==SPECIAL_PO){ $count = $this->input->post('hidecounters'); - //$constant = $this->input->post('hideconstants'); + $constant = $this->input->post('hideconstants'); - for($i=1;$i<=$count;$i++){ + for($i=1;$i<=$constant;$i++){ $pathname = 'browseFiles'.$i; if(!empty($_FILES[$pathname]['name'])) { $Picture = $this->add($pathname); - - $arr[$i] = $Picture; + //echo $Picture; + $arr[] = array($Picture); } - // } - + } +//print_r($arr); foreach($arr as $ma){ - $myfile = array('FilePath'=>$ma,'PONO'=>$PONO); - // $index = 0; - // foreach($ma as $key=>$value){ - // $index++; - // if($index == 1){ - // $filename = $value; - // } - // } - } - + + $index = 0; + foreach($ma as $key=>$value){ + $index++; + if($index == 1){ + $filename = $value; + } + } + + +$myfile = array('FilePath'=>$filename,'PONO'=>$PONO); $this->purchaseorder_model->fileupload($myfile); + } + } @@ -975,43 +978,42 @@ $RequestedBy = $this->input->post('drpDepartment'); } $counts = $this->input->post('hidecounter'); - //$constants = $this->input->post('hideconstant'); + $constants = $this->input->post('hideconstant'); - for($i=1;$i<=$counts;$i++){ + for($i=1;$i<=$constants;$i++){ $pathname = 'browseFiles'.$i; if(!empty($_FILES[$pathname]['name'])) { - - $Picture = $this->addfile($pathname); //echo $Picture; - $arr[$i] =$Picture; + $arr[$i] = array($Picture); } - + } +//print_r($arr); foreach($arr as $ma){ - $myfile = array('FilePath'=>$ma,'PONO'=>$PONO,'IGRNO'=>$IGRNO); - // $index = 0; - // $filename = null; - // foreach($ma as $key=>$value){ - // $index++; - // if($index == 1){ - // $filename = $value; - // } - // } - } - - + + $index = 0; + $filename = null; + foreach($ma as $key=>$value){ + $index++; + if($index == 1){ + $filename = $value; + } + } + + + $myfile = array('FilePath'=>$filename,'PONO'=>$PONO,'IGRNO'=>$IGRNO); - + $this->purchaseorder_model->fileupload($myfile); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 18170e55..909438a8 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -3846,7 +3846,7 @@ $("#addmorebutton").click(function(){ var bill = ; if(bill.length>=5){ - alert("Five files Only updated");//this allows only 5 files; + alert("You have to upload five files only");//this allows only 5 files; return false; } else{ diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 1fbea0e6..854a0098 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -8715,7 +8715,7 @@ $("#addmorebutton").click(function(){ //alert('sda'); if(counter>4){ - alert("Five files Only updated");//this allows only 5 files; + alert("You have to upload five files only");//this allows only 5 files; return false; } else{ @@ -8823,7 +8823,7 @@ $("#addemorebutton").click(function(){ //alert('sda'); if(counters>4){ - alert("Five files Only updated");//this allows only 5 files; + alert("You have to upload five files only");//this allows only 5 files; return false; } else{ diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index 3828cb3a..c09f9760 100644 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -5775,7 +5775,7 @@ return tot; //alert(bill.length); if(bill.length>=5){ - alert("Five files Only updated");//this allows only 5 files; + alert("You have to upload five files only");//this allows only 5 files; return false; } else{