From 2e309f4343d9d8f7e27eac6b1634cd37354f904d Mon Sep 17 00:00:00 2001 From: vadivel J Date: Tue, 22 Oct 2024 14:26:34 +0530 Subject: [PATCH] finished incoming silica module --- app/Controllers/StockController.php | 20 +++++++++++++++++++- app/Views/incomingSilicaSandDetails.php | 14 +++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 55d4e785..c24bda22 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -144,7 +144,19 @@ class StockController extends BaseController public function loadView_incomingSilicaSandDetails(){ - $month='2024-09'; + 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'); + } + $data['month']=$month; $this->global['pageTitle']='Incoming Silica Sand Details'; @@ -158,6 +170,12 @@ class StockController extends BaseController $data['igrDetails'] = []; } + $date = DateTime::createFromFormat('Y-m', $month); + + $formattedDate = $date->format('M-Y'); + + $data['month']=$formattedDate; + return $this->loadViews("incomingSilicaSandDetails", $this->global, $data, NULL); } diff --git a/app/Views/incomingSilicaSandDetails.php b/app/Views/incomingSilicaSandDetails.php index 5262fb9f..01449351 100644 --- a/app/Views/incomingSilicaSandDetails.php +++ b/app/Views/incomingSilicaSandDetails.php @@ -200,8 +200,8 @@ " class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1"> -
- +
+
@@ -273,12 +273,12 @@ - + - + - + - + -