From 0fe29a960d78cd32633ff95e6b71a44e6a438fe3 Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Tue, 17 Jul 2018 17:43:58 +0530 Subject: [PATCH] igrfiles --- .../controllers/inwardgateregister.php | 4 +- .../models/inwardgateregister_model.php | 39 +++++++++---------- application/views/viewIGRDetails.php | 18 +++++++-- 3 files changed, 36 insertions(+), 25 deletions(-) diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 2930bb08..d179429a 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -694,7 +694,9 @@ $prefile =array(); { $IGRNO= $this->input->post('id'); $PO =$this->input->post('id1'); - $data = $this->inwardgateregister_model->viewIGRFile($IGRNO); + $igrfile = $this->inwardgateregister_model->viewIGRFile($IGRNO); + $billfile = $this->inwardgateregister_model->viewIGRFile1($IGRNO); + $data = array_merge($igrfile,$billfile); echo json_encode($data); } diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php index d34f4166..b99d5e91 100755 --- a/application/models/inwardgateregister_model.php +++ b/application/models/inwardgateregister_model.php @@ -112,29 +112,28 @@ return $afftectedRows; - // function viewIGRFile($IGRNO) - // { - // $this->db->distinct(); - // $this->db->select('*'); //BillNo,IGRNO,FilePath,PONO - // $this->db->from('T_Inwardgateregister_fileupload'); - // $this->db->where('IGRNO',$IGRNO); - - // $query = $this->db->get(); - - // $result = $query->result(); - // // print_r($result);die; - // //print_r($this->db->last_query()); - // return $result; - - - - // } - function viewIGRFile($IGRNO) + function viewIGRFile($IGRNO) { $this->db->distinct(); - $this->db->select('igrm.file,igrf.*'); //BillNo,IGRNO,FilePath,PONO + $this->db->select('*'); //BillNo,IGRNO,FilePath,PONO + $this->db->from('T_Inwardgateregister_fileupload'); + $this->db->where('IGRNO',$IGRNO); + + $query = $this->db->get(); + + $result = $query->result(); + + return $result; + + + + } + function viewIGRFile1($IGRNO) + { + $this->db->distinct(); + $this->db->select('igrm.file,igrm.PONO as pono'); //BillNo,IGRNO,FilePath,PONO $this->db->from('T_IGR_Master igrm'); - $this->db->join('T_Inwardgateregister_fileupload igrf','igrm.IGRNO = igrf.IGRNO','left'); + //$this->db->join('T_Inwardgateregister_fileupload igrf','igrm.IGRNO = igrf.IGRNO','left'); //$this->db->join('T_IGR_Details igrd','igrm.IGRNO = igrd.IGRNO','left'); $this->db->where('igrm.IGRNO',$IGRNO); diff --git a/application/views/viewIGRDetails.php b/application/views/viewIGRDetails.php index 59550a5a..8b6f1b7b 100755 --- a/application/views/viewIGRDetails.php +++ b/application/views/viewIGRDetails.php @@ -98,7 +98,7 @@ else {?> - + @@ -178,6 +178,8 @@ @@ -481,30 +483,38 @@ $("#hiddenPONO").val(po); var trHTML = ''; var FilePath =''; var Filename = ''; + var PONO =''; + var BillNO =''; $.each(JSON.parse(file), function (i, item) { if(item.file == null) { if(item.Remarks ==null) { //alert() + PONO =item.PONO; + BillNO =item.BillNo; Filename =item.FilePath; FilePath = "uploads/Igrfiles/"+item.FilePath; }else{ Filename ="BillDetails"; + PONO =item.PONO; FilePath = item.FilePath; } }else{ Filename = item.file; + PONO =item.pono; + BillNO = '-'; + FilePath =item.file; } - if(item.BillNo != null) + if(Filename != null) { i=i+1; trHTML += '' + '' + i + '' + - '' + item.BillNo+ '' + - '' + item.PONO+ '' + + '' + BillNO+ '' + + '' + PONO+ '' + ''+ Filename +'' +