diff --git a/application/config/routes.php b/application/config/routes.php index 7effb624..c5015542 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -1,7 +1,7 @@ load->library('upload',$config); $this->upload->initialize($config); if($this->upload->do_upload($pathname)) { + // echo "uploadif"; $uploadData = $this->upload->data(); $picture = $uploadData['file_name']; } @@ -212,6 +213,7 @@ class emergencypurchaseorder extends BaseController } else { + // echo "else"; $picture = ''; } @@ -222,7 +224,7 @@ class emergencypurchaseorder extends BaseController /*----------------------------------special po file upload service----------------------------------*/ function add($pathname) { - // echo "add files"; + echo "add files"; // die(); //echo $pathname; die(); @@ -234,12 +236,13 @@ function add($pathname) $config['allowed_types'] = '*'; //$config['allowed_types'] = 'jpg|jpeg|png|gif'; $config['file_name'] = $_FILES[$pathname]['name']; - + echo "if"; //Load upload library and initialize configuration $this->load->library('upload',$config); $this->upload->initialize($config); if($this->upload->do_upload($pathname)) { + echo "uploadif"; $uploadData = $this->upload->data(); $picture = $uploadData['file_name']; } @@ -251,6 +254,7 @@ function add($pathname) } else { + echo "else"; $picture = ''; } @@ -459,9 +463,7 @@ function add($pathname) } } - else { - - } + @@ -473,19 +475,48 @@ function add($pathname) $constant = $this->input->post('hideconstants'); -$arr = []; - for($i=1;$i<=$constant;$i++){ + + $arr = []; +$prefile =array(); + + for($i=1;$i<=$constant;$i++) + { $pathname = 'browseFiles'.$i; + if(!empty($_FILES[$pathname]['name'])) { - - - $Picture = $this->add($pathname); - //echo $Picture; - $arr[] = array($Picture); + $fcount = 0; + + foreach ($prefile as $value) + { + + + if($value == $_FILES[$pathname]['name']) + { + + + $fcount++; + } + + + + + } + + if($fcount == 0) + { + $Picture = $this->add($pathname); + //echo $Picture; + $arr[] = array($Picture); + + } + + $prefile[] = $_FILES[$pathname]['name']; + } - } + } + //print_r($arr); if(!empty($arr)) { @@ -501,13 +532,13 @@ $arr = []; } -$myfile = array('FilePath'=>$filename,'PONO'=>$PONO); + $myfile = array('FilePath'=>$filename,'PONO'=>$PONO); $this->purchaseorder_model->fileupload($myfile); - } - } + } + } } @@ -984,52 +1015,93 @@ $RequestedBy = $this->input->post('drpDepartment'); $constants = $this->input->post('hideconstant'); -$arr = []; +// $arr = []; - for($i=1;$i<=$constants;$i++){ +// for($i=1;$i<=$constants;$i++){ +// $pathname = 'browseFiles'.$i; + + + +// if(!empty($_FILES[$pathname]['name'])) +// { +// $Picture = $this->addfile($pathname); +// //echo $Picture; +// $arr[$i] = array($Picture); +// } + + +// } + + $arr = []; +$prefile =array(); + + for($i=1;$i<=$constants;$i++) + { $pathname = 'browseFiles'.$i; - - if(!empty($_FILES[$pathname]['name'])) { - $Picture = $this->addfile($pathname); - //echo $Picture; - $arr[$i] = array($Picture); + $fcount = 0; + + foreach ($prefile as $value) + { + + + if($value == $_FILES[$pathname]['name']) + { + + + $fcount++; + } + + + + + } + + if($fcount == 0) + { + $Picture = $this->addfile($pathname); + //echo $Picture; + $arr[] = array($Picture); + + } + + $prefile[] = $_FILES[$pathname]['name']; + } - - - } -//print_r($arr); + } if(!empty($arr)) { - foreach($arr as $ma){ + foreach($arr as $ma) + { $index = 0; $filename = null; - foreach($ma as $key=>$value){ + foreach($ma as $key=>$value) + { $index++; if($index == 1){ $filename = $value; } } - + if(!empty($filename)) + { $myfile = array('FilePath'=>$filename,'PONO'=>$PONO,'IGRNO'=>$IGRNO); - - - - - $this->purchaseorder_model->fileupload($myfile); + $this->purchaseorder_model->fileupload($myfile); + } - - -} + } - } + + } + + + } diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index fa3d3290..b4d5a639 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -504,6 +504,8 @@ function edited(){ /* End Here */ $data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO); + //print_r($data['POMaster']); + //die(); //$data['POSTATUS']=$this->purchaseorder_model->GetServicePurchaseOrder($PONO); //print_r($data['POMaster']); foreach ($data['POMaster'] as $Exc) diff --git a/application/controllers/report.php b/application/controllers/report.php index b2376b89..e8117720 100755 --- a/application/controllers/report.php +++ b/application/controllers/report.php @@ -7,7 +7,7 @@ require APPPATH . '/libraries/BaseController.php'; * User Class to control all user related operations. * @author : Saravana kumar * @version : 1.1 - * @since : 10 Jun 2017 + * @since : 10 Jun 2017 */ class report extends BaseController { diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 537ee0ab..25f0cc23 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -919,7 +919,7 @@ function GetPOType($ReqNo) $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); $this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO'); - $this->db->join('T_IGR_Master IGR','POMast.PONO = IGR.PONO'); + $this->db->join('T_IGR_Master IGR','POMast.PONO = IGR.PONO','left'); $this->db->where('POMast.PONO', $PONO); $query = $this->db->get(); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 909438a8..f574d683 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -94,7 +94,7 @@ if(!empty($POMaster)) } } -//echo $BudgetType; +//echo $PONO; if(!empty($RequistionDetails)) { diff --git a/application/views/FinalProductlisting.php b/application/views/FinalProductlisting.php index 5850cc59..77430a1e 100644 --- a/application/views/FinalProductlisting.php +++ b/application/views/FinalProductlisting.php @@ -82,7 +82,11 @@ "scrollCollapse" : true, "searching" : true, "columnDefs" : [{"targets":3, "type":"date-eu"}], - "bInfo": true + "bInfo": true, + + // "aaSorting": [[ 0, "desc" ]], + // "info": true, + // "autoWidth": true }); }); diff --git a/application/views/Report_POreleased.php b/application/views/Report_POreleased.php index 422da54a..9c7d4a04 100755 --- a/application/views/Report_POreleased.php +++ b/application/views/Report_POreleased.php @@ -254,6 +254,9 @@ $(document).ready(function() { "language": { "emptyTable": "