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"> -