diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index df0de8f7..dbc8ab0c 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1445,10 +1445,16 @@ class StockController extends BaseController - public function updateTrpProductionDetails($inserts, $freshEntry = false) + public function updateTrpProductionDetails($inserts = null, $freshEntry = false) { - $postData = $this->request->getPost(); - + + + $postData = json_decode($this->request->getPost('updateTrpProductionDetails')); + + + //converting std class object to associative array.. + $postData['updateTrpProductionDetails'] = json_decode(json_encode($postData), true); + if (empty($postData['updateTrpProductionDetails'])) { if (empty($inserts)) { return $this->response->setJSON(['error' => 'No data found to update']); diff --git a/app/Views/trpProductionStockDetails.php b/app/Views/trpProductionStockDetails.php index cf1529c4..be6192cc 100644 --- a/app/Views/trpProductionStockDetails.php +++ b/app/Views/trpProductionStockDetails.php @@ -101,26 +101,6 @@ - .celda_encabezado_general { - background-color: #00a65a; - border: 1px solid #ccc; - color: #ffffff; - font-weight: bold; - padding: 6px 10px;; - text-align: center; - } - - - .celda_encabezado_general { - background-color: #00a65a; - border: 1px solid #ccc; - color: #ffffff; - font-weight: bold; - padding: 6px 10px;; - text-align: center; - } - - ._Separador { background-color: #fff; height: 12px; @@ -167,19 +147,19 @@ border: 1px solid #ccc; color: #ffffff; font-weight: bold; - padding: 2px 4px; + padding: 6px 10px; text-align: center; } .celda_encabezado_total { - background-color:#ffffff !important; + background-color: #ffffff !important; border: 1px solid #ffffff; color: #ffffff !important; font-weight: bold; padding: 6px 10px; text-align: center; } - + .celda_normal { /*background-color: #fff;*/ /* */ @@ -193,12 +173,14 @@ .fht-table thead { position: sticky; top: 0; - z-index: 20; /* Ensure the entire header stays above table rows */ - background-color: #00a65a; /* Header background color */ + z-index: 20; + /* Ensure the entire header stays above table rows */ + background-color: #00a65a; + /* Header background color */ } - .dropdown-menu { - z-index :25 ; + .dropdown-menu { + z-index: 25; } @@ -207,15 +189,13 @@ .fht-table thead th { position: sticky; top: 0; - z-index: 11; /* Higher than table rows but lower than first column */ - background-color: #00a65a; /* Green background */ + z-index: 11; + /* Higher than table rows but lower than first column */ + background-color: #00a65a; + /* Green background */ color: #ffffff; border: 1px solid #ddd; padding: 10px; - white-space: normal; /* Allows text to wrap */ - word-wrap: break-word; /* Breaks long words if needed */ - text-align: center; /* Centers text for better alignment */ - max-width: 150px; /* Set a max width to control wrapping */ } /* Sticky First Column */ @@ -224,7 +204,8 @@ position: sticky; left: 0; background-color: #00a65a; - z-index: 15; /* Ensures it stays above other cells */ + z-index: 15; + /* Ensures it stays above other cells */ border-right: 2px solid #ddd; color: #ffffff; } @@ -232,21 +213,16 @@ /* Table Wrapper for Scrolling */ .table-responsive { overflow-x: auto; - overflow-y: auto; - max-height: 450px; /* Adjust as needed */ + overflow-y: auto; + max-height: 450px; + /* Adjust as needed */ position: relative; } - td{ - min-width: 100px; - max-width: 100px; + td { + min-width: 100px; + max-width: 100px; } - - th{ - min-width: 100px; - max-width: 100px; - } - @@ -254,48 +230,48 @@ - modify('first day of this month')->format('Y-m-d'); - $endDate = $date->modify('last day of this month')->format('Y-m-d'); +$startDate = $date->modify('first day of this month')->format('Y-m-d'); +$endDate = $date->modify('last day of this month')->format('Y-m-d'); - $datesInMonth = []; +$datesInMonth = []; - $period = new DatePeriod( - new DateTime($startDate), - new DateInterval('P1D'), - (new DateTime($endDate))->modify('+1 day') - ); +$period = new DatePeriod( + new DateTime($startDate), + new DateInterval('P1D'), + (new DateTime($endDate))->modify('+1 day') +); - foreach ($period as $day) { - $datesInMonth[] = $day->format('Y-m-d'); - } +foreach ($period as $day) { + $datesInMonth[] = $day->format('Y-m-d'); +} - ?> +?> - +?> @@ -344,633 +320,1201 @@
-
- -
+
+ +
- +
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - $trpProductionDetail) - { - + - $trpProductionDetail) { - + + format('d-m-Y'); - if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} - ?> - - > - - - - - - - - + ?>> - - - - + + + + - - - + + + + + + + - - - + + + - - - + + + - - - + + + - + + + - - - + + + - + + + - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - - - - - - - - - - - - - - - + + + - + + + - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0, + 'coldStart' => 0, + 'breakdownHours' => 0, + 'burnerFiringHours' => 0, + 'sandFeedingHours' => 0, + 'gasReceiptBg' => 0, + 'gasReceiptPg' => 0, + 'physicalGasConsumption' => 0, + 'drierGasConsumption' => 0, + 'coatingGasConsumption' => 0, + 'trpPlusDrierGasConsumption' => 0, + 'trpPhysicalGasPerTon' => 0, + 'panelGasConsumption' => 0, + 'panelGasPerTon' => 0, + 'ALs_wcs' => 0, + 'ALe_wcs' => 0, + 'ME_wcs' => 0, + 'SI_wcs' => 0, + 'caparo_wcs' => 0, + 'Nemak_wcs' => 0, + 'DR_wcs' => 0, + 'edRunningHours' => 0, + 'edProduction' => 0, + 'edUsage' => 0, + 'trpProduction' => 0, + 'trpProductionPerHour' => 0, + 'coating' => 0, + 'ALs_crs' => 0, + 'Nemak_crs' => 0, + 'ME_crs' => 0, + 'BI_crs' => 0, + 'Karmen_crs' => 0, + 'waterReceipt' => 0, + 'waterConsumption' => 0, + 'ebReading' => 0, + 'ebReadingPerUnitTon' => 0, + 'workingPersonEngineers' => 0, + 'workingPersonSupervisiors' => 0, + 'workingPersonOperators' => 0, + 'msSeperation' => 0, + 'edWaste' => 0, + 'coolerBags' => 0, + 'edPlus20Waste' => 0, + 'cycloneWaste' => 0 + + ]; + } + + // Sum values for the material + + $summary['totalHours'] += is_numeric($trpProductionDetail['totalHours']) ? $trpProductionDetail['totalHours'] : 0; + $summary['coldStart'] += is_numeric($trpProductionDetail['coldStart']) ? $trpProductionDetail['coldStart'] : 0; + $summary['breakdownHours'] += is_numeric($trpProductionDetail['breakdownHours']) ? $trpProductionDetail['breakDownHours'] : 0; + $summary['burnerFiringHours'] += is_numeric($trpProductionDetail['burnerFiringHours']) ? $trpProductionDetail['burnerFiringHours'] : 0; + $summary['sandFeedingHours'] += is_numeric($trpProductionDetail['sandFeedingHours']) ? $trpProductionDetail['sandFeedingHours'] : 0; + $summary['gasReceiptBg'] += is_numeric($trpProductionDetail['gasReceiptBg']) ? $trpProductionDetail['gasReceiptBg'] : 0; + $summary['gasReceiptPg'] += is_numeric($trpProductionDetail['gasReceiptPg']) ? $trpProductionDetail['gasReceiptPg'] : 0; + $summary['physicalGasConsumption'] += is_numeric($trpProductionDetail['physicalGasConsumption']) ? $trpProductionDetail['physicalGasConsumption'] : 0; + $summary['drierGasConsumption'] += is_numeric($trpProductionDetail['drierGasConsumption']) ? $trpProductionDetail['drierGasConsumption'] : 0; + $summary['coatingGasConsumption'] += is_numeric($trpProductionDetail['coatingGasConsumption']) ? $trpProductionDetail['coatingGasConsumption'] : 0; + $summary['trpPlusDrierGasConsumption'] += is_numeric($trpProductionDetail['trpPlusDrierGasConsumption'])? $trpProductionDetail['trpPlusDrierGasConsumption'] : 0; + $summary['trpPhysicalGasPerTon'] += is_numeric($trpProductionDetail['trpPhysicalGasPerTon']) ? $trpProductionDetail['trpPhysicalGasPerTon'] : 0; + $summary['panelGasConsumption'] += is_numeric($trpProductionDetail['panelGasConsumption']) ? $trpProductionDetail['panelGasConsumption'] : 0; + $summary['panelGasPerTon'] += is_numeric($trpProductionDetail['panelGasPerTon']) ? $trpProductionDetail['panelGasPerTon'] : 0; + $summary['ALs_wcs'] += is_numeric($trpProductionDetail['ALs_wcs']) ? $trpProductionDetail['ALs_wcs'] : 0; + $summary['ALe_wcs'] += is_numeric($trpProductionDetail['ALe_wcs']) ? $trpProductionDetail['ALe_wcs'] : 0; + $summary['ME_wcs'] += is_numeric($trpProductionDetail['ME_wcs']) ? $trpProductionDetail['ME_wcs'] : 0; + $summary['SI_wcs'] += is_numeric($trpProductionDetail['SI_wcs']) ? $trpProductionDetail['SI_wcs'] : 0; + $summary['caparo_wcs'] += is_numeric($trpProductionDetail['caparo_wcs']) ? $trpProductionDetail['caparo_wcs'] : 0; + $summary['Nemak_wcs'] += is_numeric($trpProductionDetail['Nemak_wcs']) ? $trpProductionDetail['Nemak_wcs'] : 0; + $summary['DR_wcs'] += is_numeric($trpProductionDetail['DR_wcs']) ? $trpProductionDetail['DR_wcs'] : 0; + $summary['edRunningHours'] += is_numeric($trpProductionDetail['edRunningHours']) ? $trpProductionDetail['edRunningHours'] : 0; + $summary['edProduction'] += is_numeric($trpProductionDetail['edProduction']) ? $trpProductionDetail['edProduction'] : 0; + $summary['edUsage'] += is_numeric($trpProductionDetail['edUsage']) ? $trpProductionDetail['edUsage'] : 0; + $summary['trpProduction'] += is_numeric($trpProductionDetail['trpProduction']) ? $trpProductionDetail['trpProduction'] : 0; + $summary['trpProductionPerHour'] += is_numeric($trpProductionDetail['trpProductionPerHour']) ? $trpProductionDetail['trpProductionPerHour'] : 0; + $summary['coating'] += is_numeric($trpProductionDetail['coating']) ? $trpProductionDetail['coating'] : 0; + $summary['ALs_crs'] += is_numeric($trpProductionDetail['ALs_crs']) ? $trpProductionDetail['ALs_crs'] : 0; + $summary['Nemak_crs'] += is_numeric($trpProductionDetail['Nemak_crs']) ? $trpProductionDetail['Nemak_crs'] : 0; + $summary['ME_crs'] += is_numeric($trpProductionDetail['ME_crs']) ? $trpProductionDetail['ME_crs'] : 0; + $summary['BI_crs'] += is_numeric($trpProductionDetail['BI_crs']) ? $trpProductionDetail['BI_crs'] : 0; + $summary['Karmen_crs'] += is_numeric($trpProductionDetail['Karmen_crs']) ? $trpProductionDetail['Karmen_crs'] : 0; + $summary['waterReceipt'] += is_numeric($trpProductionDetail['waterReceipt']) ? $trpProductionDetail['waterReceipt'] : 0; + $summary['waterConsumption'] += is_numeric($trpProductionDetail['waterConsumption']) ? $trpProductionDetail['waterConsumption'] : 0; + $summary['ebReading'] += is_numeric($trpProductionDetail['ebReading']) ? $trpProductionDetail['ebReading'] : 0; + $summary['ebReadingPerUnitTon'] += is_numeric($trpProductionDetail['ebReadingPerUnitTon']) ? $trpProductionDetail['ebReadingPerUnitTon'] : 0; + $summary['workingPersonEngineers'] += is_numeric($trpProductionDetail['workingPersonEngineers']) ? $trpProductionDetail['workingPersonEngineers'] : 0; + $summary['workingPersonSupervisiors'] += is_numeric($trpProductionDetail['workingPersonSupervisiors']) ? $trpProductionDetail['workingPersonSupervisiors'] : 0; + $summary['workingPersonOperators'] += is_numeric($trpProductionDetail['workingPersonOperators']) ? $trpProductionDetail['workingPersonOperators'] : 0; + $summary['msSeperation'] += is_numeric($trpProductionDetail['msSeperation']) ? $trpProductionDetail['msSeperation'] : 0; + $summary['edWaste'] += is_numeric($trpProductionDetail['edWaste']) ? $trpProductionDetail['edWaste'] : 0; + $summary['coolerBags'] += is_numeric($trpProductionDetail['coolerBags']) ? $trpProductionDetail['coolerBags'] : 0; + $summary['edPlus20Waste'] += is_numeric($trpProductionDetail['edPlus20Waste']) ? $trpProductionDetail['edPlus20Waste'] : 0; + $summary['cycloneWaste'] += is_numeric($trpProductionDetail['cycloneWaste']) ? $trpProductionDetail['cycloneWaste'] : 0; + } ?> + + + + +
Date Opening Time Closing Time Total Hours Cold Start Break Down Hours Burner Firing Hours Sand Feeding Hours Gas Receipt Physical Gas Consumption Drier Gas Consumption Coating Gas Consumption TRP plus Drier Gas Consumption TRP Physical Gas Per Ton Panel Gas Consumption Panel Gas Per Ton Incoming Sand/ Lump details ED details TRP Sand Usage Water EB Reading EB Unit Per Ton Working Persons Maintanence Details Description MS Seperation ED Waste Cooler Bags ED +20 Waste Cyclone Waste Date Opening Time Closing Time Total Hours Cold Start Break Down Hours Burner Firing Hours Sand Feeding Hours Gas Receipt Physical Gas Consumption Drier Gas Consumption Coating Gas Consumption TRP plus Drier Gas Consumption TRP Physical Gas Per Ton Panel Gas Consumption Panel Gas Per Ton Incoming Sand/ Lump details ED details TRP Sand Usage Water EB Reading EB Unit Per Ton Working Persons Maintanence Details Description MS Seperation ED Waste Cooler Bags ED +20 Waste Cyclone Waste
BGPG AL(S) AL(E) ME SI caparo Nemak DRRunning Hours Production Usage Production Production Per Hour Coating Hindhuja NemakME BI Karmen Receipt Consumption Engineers SupervisorsOperators Roller Drivers Nature Of Maintenance Location
BGPG AL(S) AL(E) ME SI caparo Nemak DRRunning Hours Production Usage Production Production Per Hour Coating Hindhuja NemakME BI Karmen Receipt Consumption Engineers SupervisorsOperators Roller Drivers Nature Of Maintenance Location
- - - - - + + + + + - - - - - - - - - - - - - - - - + + - - + + - - + + + + - - + + + + - - - - - - - - + + - - - - - - - - - - - - - - + + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date Opening Time Closing Time Total Hours Cold Start Break Down Hours Burner Firing Hours Sand Feeding Hours Gas Receipt Physical Gas Consumption Drier Gas Consumption Coating Gas Consumption TRP plus Drier Gas Consumption TRP Physical Gas Per Ton Panel Gas Consumption Panel Gas Per Ton Incoming Sand/ Lump details ED details TRP Sand Usage Water EB Reading EB Unit Per Ton Working Persons Maintanence Details Description MS Seperation ED Waste Cooler Bags ED +20 Waste Cyclone Waste
BGPG AL(S) AL(E) ME SI caparo Nemak DRRunning Hours Production Usage Production Production Per Hour Coating Hindhuja NemakME BI Karmen Receipt Consumption Engineers SupervisorsOperators Roller Drivers Nature Of Maintenance Location
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + -
+ +
@@ -989,35 +1533,35 @@
-
-