diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 9ee79d98..36356168 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -130,19 +130,33 @@ class StockController extends BaseController { if ($this->request->getMethod() === 'POST') { + $month = $this->request->getPost('month'); $date = DateTime::createFromFormat('M-Y', $month); $formattedDate = $date->format('Y-m'); - $month = $formattedDate; + $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + } else { - $filteredMonth = $this->request->getGet('month'); - $month = $filteredMonth ?? date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } + } + $data['month'] = $month ; + $this->global['pageTitle'] = 'Coating Machine Details '; @@ -181,8 +195,6 @@ class StockController extends BaseController $message3 = ''; $postData = $this->request->getPost(); - $month = $this->request->getGet('month'); - $month = DateTime::createFromFormat('M-Y', $month)->format('Y-m'); $date = $postData['date']; $shift = $postData['shift']; @@ -265,7 +277,7 @@ class StockController extends BaseController // Set flashdata for success message - return redirect()->to("/coatingMachineDetails?month=$month") + return redirect()->to("/coatingMachineDetails") ->with('success', $message1 . " " . $message2 . " " . $message3); } catch (\Exception $error) { $this->db->transRollback(); @@ -284,8 +296,7 @@ class StockController extends BaseController $message3 = ''; $putData = $this->request->getPost(); - $month = $this->request->getGet('month'); - $month = DateTime::createFromFormat('M-Y', $month)->format('Y-m'); + $id = $putData['editCoatingMachineDetailId']; @@ -361,7 +372,7 @@ class StockController extends BaseController // Set flashdata for success message - return redirect()->to("/coatingMachineDetails?month=$month") + return redirect()->to("/coatingMachineDetails") ->with('success', $message1 . " " . $message2 . " " . $message3); } else { throw new \Exception('Failed to update Coating machine details.'); @@ -443,10 +454,23 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + + } else { $remark = $this->request->getVar('remark'); - $month = date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } + } $data['month'] = $month; @@ -677,14 +701,21 @@ class StockController extends BaseController $month = $formattedDate; + $session = session (); + $session->set('stock_month',$month); - $filterMaterialCode = $this->request->getPost('filterMaterialCode'); - - $filterMaterialCode = $this->request->getPost('filterMaterialCode'); } else { - $month = date('Y-m'); + + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } + } $data = []; @@ -879,8 +910,19 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + } else { - $month = date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; @@ -975,8 +1017,19 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + } else { - $month = date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; @@ -1175,8 +1228,19 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + } else { - $month = date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; @@ -1446,7 +1510,13 @@ class StockController extends BaseController $month = $formattedDate; } else { - $month = date('Y-m'); + $session = session(); + + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; @@ -1543,12 +1613,21 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + + } else { - // $month = new DateTime('2024-10-01'); - // $month = $month->format('Y-m'); + $session = session(); - $month = date('Y-m'); + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } @@ -2061,11 +2140,21 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + + } else { - // $month = '2024-12'; + $session = session(); - $month = date('Y-m'); + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; @@ -2336,11 +2425,20 @@ class StockController extends BaseController $formattedDate = $date->format('Y-m'); $month = $formattedDate; + + $session = session (); + + $session->set('stock_month',$month); + } else { - // $month = '2025-02'; + $session = session(); - $month = date('Y-m'); + $month = $session->get('stock_month'); + + if (empty($month)) { + $month = date('Y-m'); // Default to the current month + } } $data = []; diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index 6e356d93..901088a8 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -32,7 +32,7 @@ } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -1493,6 +1493,10 @@ let machineOnTime12 = machineOnTimeHr; let machineOffTime12 = machineOffTimeHr; + if(machineOnTime12 == machineOffTime12){ + return `24.00`; + } + let machineOnTime24 = convertTo24Hr(machineOnTime12); let machineOffTime24 = convertTo24Hr(machineOffTime12); diff --git a/app/Views/bagStockDetails.php b/app/Views/bagStockDetails.php index 437f9ac3..7954f9fa 100644 --- a/app/Views/bagStockDetails.php +++ b/app/Views/bagStockDetails.php @@ -18,7 +18,7 @@ } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -140,7 +140,7 @@ .celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -171,7 +171,7 @@ position: sticky; top: 0; z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #00a65a; /* Header background color */ + background-color: #50bbd9; /* Header background color */ } .dropdown-menu { @@ -185,7 +185,7 @@ position: sticky; top: 0; z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #00a65a; /* Green background */ + background-color: #50bbd9; /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; @@ -196,7 +196,7 @@ .fht-table td:nth-child(1) { position: sticky; left: 0; - background-color: #00a65a; + background-color: #50bbd9; z-index: 15; /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; diff --git a/app/Views/dieselStockDetails.php b/app/Views/dieselStockDetails.php index fc107457..002fc9e8 100644 --- a/app/Views/dieselStockDetails.php +++ b/app/Views/dieselStockDetails.php @@ -18,7 +18,7 @@ } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -142,7 +142,7 @@ .celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -173,7 +173,7 @@ position: sticky; top: 0; z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #00a65a; /* Header background color */ + background-color: #50bbd9; /* Header background color */ } .dropdown-menu { @@ -187,7 +187,7 @@ position: sticky; top: 0; z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #00a65a; /* Green background */ + background-color: #50bbd9; /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; @@ -198,7 +198,7 @@ .fht-table td:nth-child(1) { position: sticky; left: 0; - background-color: #00a65a; + background-color: #50bbd9; z-index: 15; /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; diff --git a/app/Views/drierMachineDetails.php b/app/Views/drierMachineDetails.php index 1468c6ed..dd0ef391 100644 --- a/app/Views/drierMachineDetails.php +++ b/app/Views/drierMachineDetails.php @@ -23,7 +23,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -107,7 +107,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); th.celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -188,7 +188,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); .celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -218,7 +218,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); position: sticky; top: 0; z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #00a65a; /* Header background color */ + background-color: #50bbd9; /* Header background color */ } .dropdown-menu { diff --git a/app/Views/dustAndRoughStockDetails.php b/app/Views/dustAndRoughStockDetails.php index 9fbd1d66..333b025a 100644 --- a/app/Views/dustAndRoughStockDetails.php +++ b/app/Views/dustAndRoughStockDetails.php @@ -18,7 +18,7 @@ } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -144,7 +144,7 @@ .celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -175,7 +175,7 @@ position: sticky; top: 0; z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #00a65a; /* Header background color */ + background-color: #50bbd9; /* Header background color */ } .dropdown-menu { @@ -189,7 +189,7 @@ position: sticky; top: 0; z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #00a65a; /* Green background */ + background-color: #50bbd9; /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; @@ -200,7 +200,7 @@ .fht-table td:nth-child(1) { position: sticky; left: 0; - background-color: #00a65a; + background-color: #50bbd9; z-index: 15; /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; diff --git a/app/Views/incomingSilicaSandDetails.php b/app/Views/incomingSilicaSandDetails.php index 6a0a95e3..c536ff4e 100644 --- a/app/Views/incomingSilicaSandDetails.php +++ b/app/Views/incomingSilicaSandDetails.php @@ -24,7 +24,7 @@ } .fht-table td:hover { - background-color: #00a65a; + background-color: #50bbd9; color: #ffffff; } @@ -107,7 +107,7 @@ .celda_encabezado_general { - background-color: #00a65a; + background-color: #50bbd9; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -187,7 +187,7 @@ position: sticky; left: 0; top: 0; - background-color: #00a65a; + background-color: #50bbd9; z-index: 7!important; border-right: 2px solid #ddd; color: #ffffff; @@ -198,7 +198,7 @@ { position: sticky; left: 0; - background-color: #00a65a; + background-color: #50bbd9; z-index: 2; border-right: 2px solid #ddd; color: #ffffff; @@ -565,12 +565,12 @@