From a3275490cdca75ad902a495c25a1508fdcebf22b Mon Sep 17 00:00:00 2001 From: vadivel J Date: Fri, 18 Oct 2024 17:31:45 +0530 Subject: [PATCH] finished coating machine details --- app/Config/Routes.php | 1 + app/Controllers/StockController.php | 21 +++++++++++++ app/Views/CoatingMachineDetail.php | 46 ++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 861406c1..de22087a 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -421,6 +421,7 @@ $routes->post('getSilicaIGR', 'Supplier::getSilicaIGR'); //Stock Module $routes->get('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); +$routes->post('coatingMachineDetails' , 'StockController::loadView_coatingMachineDetails'); $routes->post('addNewCoatingMachineDetails' , 'StockController::addNewCoatingMachineDetails'); $routes->post('updateCoatingMachineDetails','StockController::updateCoatingMachineDetails'); $routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMachineDetails'); diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 6f1f2c49..b2901432 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -37,13 +37,34 @@ class StockController extends BaseController public function loadView_coatingMachineDetails(){ + if ($this->request->getMethod() === 'POST'){ + $month = $this->request->getPost('month'); + + $date = DateTime::createFromFormat('M-Y', $month); + + $formattedDate = $date->format('Y-m'); + + $month=$formattedDate; + } + else{ + $month = date('Y-m'); + // dd($month); + } + $this->global['pageTitle'] = 'Coating Machine Details '; $data['coatingMachineDetails']= $this->coatingMachineDetails_model ->where('is_active', 1) ->orderBy('created_at','DESC') + ->like('created_at', $month, 'after') ->findAll(); + $date = DateTime::createFromFormat('Y-m', $month); + + $formattedDate = $date->format('M-Y'); + + $data['month']=$formattedDate; + return $this->loadViews("CoatingMachineDetail", $this->global, $data, NULL); } diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index af5ab65d..8ae76f9e 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -64,7 +64,9 @@ } - + + + @@ -113,8 +115,27 @@
+
+
-
+
+
+ + + + + +
+ +
+ +
+ +
+ + @@ -126,12 +147,12 @@ - + - + - - + @@ -569,7 +590,7 @@ var table = $('#datatable').DataTable({ dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination buttons: [ - 'csv', 'excel', 'pdf' // Export buttons + 'csv', 'excel', 'pdf', // Export buttons ], pageLength: 10, // Default rows per page lengthMenu: [[10, 20, 30, 50, -1], [10, 20, 30, 50, "All"]], // Rows per page options @@ -930,4 +951,15 @@ } + + + \ No newline at end of file
Shift Machine On Time Machine Off TimeMachine Running (hr)Machine Running(hr) Total CoatingTotal Coating Sand (kg)Total Coating Sand(kg) Total Gas ConsumptionPer Hour Gas ConsumptionPer Hour Coating Sand QTY (kg) + Hour GasHour QTY(kg) Customer Name Action