From 702a9a71e23f1e7188e8973016d32c92b42ba1f6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Mon, 4 Jun 2018 12:14:17 +0530 Subject: [PATCH] pdf and date filetr break down history --- application/controllers/batchcard.php | 18 ++- application/models/batchcard_model.php | 33 ++++- application/views/BatchcardMaintListing.php | 141 +++++++++++++++++++- 3 files changed, 182 insertions(+), 10 deletions(-) diff --git a/application/controllers/batchcard.php b/application/controllers/batchcard.php index a17a7818..c0caf7b7 100755 --- a/application/controllers/batchcard.php +++ b/application/controllers/batchcard.php @@ -711,9 +711,25 @@ class batchcard extends BaseController } function getMaintListing(){ - $data['MaintListing'] = $this->batchcard_model->getmaint_dtl(); + + if ($this->input->post('btn_submit')) + { + + $fdate = $this->input->post('from_date'); + + $tdate = $this->input->post('to_date'); + $type = $this->input->post('mySelect'); + + + } + + $data['MaintListing'] = $this->batchcard_model->getmaint_dtl( $fdate,$tdate, $type ); + $this->global['pageTitle'] = 'Siddharth : Maintenance/Breakdown Listing'; $this->loadViews("BatchcardMaintListing", $this->global,$data,NULL); + + + } function addMaint(){ diff --git a/application/models/batchcard_model.php b/application/models/batchcard_model.php index 3042fc3c..2a919672 100755 --- a/application/models/batchcard_model.php +++ b/application/models/batchcard_model.php @@ -233,19 +233,44 @@ class batchcard_model extends CI_Model return $res->result(); } } - function getmaint_dtl() + function getmaint_dtl($fdate,$tdate,$type ) { - // $r->FirstName.' '.$r->LastName - $this->db->select('BMD.*'); + + + $this->db->select('BMD.*'); + // $this->db->select() $this->db->select('CONCAT(ED1.FirstName, " - " , ED1.LastName) AS Approver_Name', FALSE); $this->db->select('CONCAT(ED2.FirstName, " - " , ED2.LastName) AS Worker_Name', FALSE); $this->db->from('T_Batchcard_MaintanceDetails BMD'); + $this->db->like('BMD.CreatedOn', date('Y-m')); $this->db->join('T_Employee_Details ED1', 'ED1.EmpID = BMD.Approved_By', 'left'); $this->db->join('T_Employee_Details ED2', 'ED2.EmpID = BMD.WorkDone_By', 'left'); - $bmd = $this->db->get(); + + + + if ($fdate and $tdate != ''){ + + + $fromdate= date("Y-m-d",strtotime($fdate)); + $todate=date("Y-m-d",strtotime($tdate)); + + $date = "date(BMD.CreatedOn) >= '".$fromdate."' + and date( BMD.CreatedOn) <= '". $todate."'"; + $this->db->where($date); + } + + if($type!=""){ + + $this->db->where("BMD.type" ,$type); + + + } + $bmd = $this->db->get(); return $bmd->result(); } + + function getmaint_dtl_MntID($MntID) { diff --git a/application/views/BatchcardMaintListing.php b/application/views/BatchcardMaintListing.php index 289b57d1..4549f477 100755 --- a/application/views/BatchcardMaintListing.php +++ b/application/views/BatchcardMaintListing.php @@ -1,18 +1,91 @@ + + + + + + + + +

Siddharth Industries -Maintenance/Breakdown Listing

+ + + +
- +
+ -
- + + +
+
+
+ +
+ + + + +
+
+ + +
+ +
+ + + + +
+
+ +
+ + +
+ +
+ + +
+
+ +
+
+ + + +
@@ -72,6 +145,7 @@
+
@@ -83,14 +157,71 @@ $(function () { $('#mnttable').DataTable({ + dom: 'lBfrtip', + buttons: [ + 'pdf' + ], "paging": true, "lengthChange": true, "searching": true, "ordering": true, "info": true, - "autoWidth": true + "autoWidth": true, + + }); }); - \ No newline at end of file + + + + + + --> + + + + + \ No newline at end of file