Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
d695166852
@ -493,3 +493,4 @@ $routes->post('updateTrpSandUseStockDetails', 'StockController::updateTrpSandUse
|
||||
$routes->match(['GET', 'POST'], 'trpProductionDetails', 'StockController::trpProductionDetails');
|
||||
$routes->post('updateTrpProductionDetails', 'StockController::updateTrpProductionDetails');
|
||||
|
||||
|
||||
|
||||
@ -173,6 +173,9 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- generating date options -->
|
||||
|
||||
<?php
|
||||
|
||||
$date = DateTime::createFromFormat('M-Y', $month);
|
||||
@ -196,6 +199,27 @@
|
||||
?>
|
||||
|
||||
|
||||
<!-- generating time options -->
|
||||
|
||||
<?php
|
||||
|
||||
$timeOptions = [] ;
|
||||
|
||||
foreach (["AM", "PM"] as $meridian) {
|
||||
for ($hour = 0; $hour < 12; $hour++) {
|
||||
for ($minute = 0; $minute < 60; $minute += 15) {
|
||||
$formattedHour = $hour === 0 ? 12 : $hour;
|
||||
$timeOptions[] = sprintf("%02d:%02d %s", $formattedHour, $minute, $meridian);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$timeOtions [] = "12:00 AM";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
@ -448,19 +472,43 @@
|
||||
<!-- openingTime -->
|
||||
<!-- td:eq(1) -->
|
||||
<td class="celda_normal trpProductionStock openingTime"
|
||||
data-id="<?= $dateInMonth ?> openingTime"
|
||||
oninput="trpStockChange(this)"
|
||||
contenteditable="true">
|
||||
0
|
||||
data-id="<?= $dateInMonth ?> openingTime" >
|
||||
|
||||
<select class="timeDropdown trp_on_time" style="width: 150px;"
|
||||
>
|
||||
<?php
|
||||
foreach($timeOptions as $timeOption)
|
||||
{
|
||||
?>
|
||||
<option value="<?= $timeOption ?>">
|
||||
<?= $timeOption ?>
|
||||
</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<!-- closingTime -->
|
||||
<!-- closingTime -->
|
||||
<!-- td:eq(2) -->
|
||||
<td class="celda_normal trpProductionStock closingTime"
|
||||
data-id="<?= $dateInMonth ?> closingTime"
|
||||
oninput="trpStockChange(this)"
|
||||
contenteditable="true">
|
||||
0
|
||||
data-id="<?= $dateInMonth ?> closingTime" >
|
||||
|
||||
<select class="timeDropdown trp_off_time" style="width: 150px;"
|
||||
>
|
||||
<?php
|
||||
foreach($timeOptions as $timeOption)
|
||||
{
|
||||
?>
|
||||
<option value="<?= $timeOption ?>">
|
||||
<?= $timeOption ?>
|
||||
</option>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<!-- totalHours -->
|
||||
@ -1069,66 +1117,45 @@
|
||||
<script>
|
||||
|
||||
function trpStockChange(tdElement) {
|
||||
|
||||
|
||||
|
||||
try{
|
||||
|
||||
|
||||
let tr = $(tdElement).closest('tr');
|
||||
|
||||
|
||||
let openingTime = tr.find('td:eq(1)').text().trim();
|
||||
let closingTime = tr.find('td:eq(2)').text().trim();
|
||||
let totalHours = tr.find('td:eq(3)').text().trim();
|
||||
let coldStart = tr.find('td:eq(4)').text().trim();
|
||||
let breakdownHours = tr.find('td:eq(5)').text().trim();
|
||||
let burnerFiringHours = tr.find('td:eq(6)').text().trim();
|
||||
let sandFeedingHours = tr.find('td:eq(7)').text().trim();
|
||||
let gasReceiptBg = tr.find('td:eq(8)').text().trim();
|
||||
let gasReceiptPg = tr.find('td:eq(9)').text().trim();
|
||||
let physicalGasConsumption = tr.find('td:eq(10)').text().trim();
|
||||
let drierGasConsumption =tr.find('td:eq(11)').text().trim();
|
||||
let coatingGasConsumption =tr.find('td:eq(12)').text().trim();
|
||||
let trpPlusDrierGasConsumption = tr.find('td:eq(13)').text().trim();
|
||||
let trpPhysicalGasPerTon = tr.find('td:eq(14)').text().trim();
|
||||
let panelGasConsumption = tr.find('td:eq(15)').text().trim();
|
||||
let panelGasPerTon =tr.find('td:eq(16)').text().trim();
|
||||
let als = tr.find('td:eq(17)').text().trim();
|
||||
let ale = tr.find('td:eq(18)').text().trim();
|
||||
let me = tr.find('td:eq(19)').text().trim();
|
||||
let si = tr.find('td:eq(20)').text().trim();
|
||||
let caparo = tr.find('td:eq(21)').text().trim();
|
||||
let nemak = tr.find('td:eq(22)').text().trim();
|
||||
let dr = tr.find('td:eq(23)').text().trim();
|
||||
let edRunningHours = tr.find('td:eq(24)').text().trim();
|
||||
tr.find('td:eq(25)').text().trim();
|
||||
tr.find('td:eq(26)').text().trim();
|
||||
tr.find('td:eq(27)').text().trim();
|
||||
tr.find('td:eq(28)').text().trim();
|
||||
tr.find('td:eq(29)').text().trim();
|
||||
tr.find('td:eq(30)').text().trim();
|
||||
tr.find('td:eq(31)').text().trim();
|
||||
tr.find('td:eq(32)').text().trim();
|
||||
tr.find('td:eq(33)').text().trim();
|
||||
tr.find('td:eq(34)').text().trim();
|
||||
tr.find('td:eq(35)').text().trim();
|
||||
tr.find('td:eq(36)').text().trim();
|
||||
tr.find('td:eq(37)').text().trim();
|
||||
tr.find('td:eq(38)').text().trim();
|
||||
tr.find('td:eq(39)').text().trim();
|
||||
tr.find('td:eq(40)').text().trim();
|
||||
tr.find('td:eq(41)').text().trim();
|
||||
tr.find('td:eq(42)').text().trim();
|
||||
tr.find('td:eq(43)').text().trim();
|
||||
tr.find('td:eq(44)').text().trim();
|
||||
tr.find('td:eq(45)').text().trim();
|
||||
tr.find('td:eq(46)').text().trim();
|
||||
tr.find('td:eq(47)').text().trim();
|
||||
tr.find('td:eq(48)').text().trim();
|
||||
tr.find('td:eq(49)').text().trim();
|
||||
tr.find('td:eq(50)').text().trim();
|
||||
let openingTime = tr.find('td:eq(1)').text().trim();
|
||||
let closingTime = tr.find('td:eq(2)').text().trim();
|
||||
let totalHours = tr.find('td:eq(3)').text().trim();
|
||||
let coldStart = tr.find('td:eq(4)').text().trim();
|
||||
let breakdownHours = tr.find('td:eq(5)').text().trim();
|
||||
let burnerFiringHours = tr.find('td:eq(6)').text().trim();
|
||||
let sandFeedingHours = tr.find('td:eq(7)').text().trim();
|
||||
|
||||
|
||||
|
||||
console.log(panelGasConsumption);
|
||||
let gasReceiptBg = tr.find('td:eq(8)').text().trim();
|
||||
let gasReceiptPg = tr.find('td:eq(9)').text().trim();
|
||||
let physicalGasConsumption = tr.find('td:eq(10)').text().trim();
|
||||
let drierGasConsumption = tr.find('td:eq(11)').text().trim();
|
||||
let coatingGasConsumption = tr.find('td:eq(12)').text().trim();
|
||||
let trpPlusDrierGasConsumption = tr.find('td:eq(13)').text().trim();
|
||||
let trpPhysicalGasPerTon = tr.find('td:eq(14)').text().trim();
|
||||
let panelGasConsumption = tr.find('td:eq(15)').text().trim();
|
||||
let panelGasPerTon = tr.find('td:eq(16)').text().trim();
|
||||
|
||||
let edRunningHours = tr.find('td:eq(24)').text().trim();
|
||||
let edProduction = tr.find('td:eq(25)').text().trim();
|
||||
let edUsage = tr.find('td:eq(26)').text().trim();
|
||||
let trpProduction = tr.find('td:eq(27)').text().trim();
|
||||
let trpProductionPerHour = tr.find('td:eq(28)').text().trim();
|
||||
let coating = tr.find('td:eq(29)').text().trim();
|
||||
|
||||
let ebReading = tr.find('td:eq(37)').text().trim();
|
||||
let ebReadingPerUnitTon = tr.find('td:eq(38)').text().trim();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1146,3 +1173,221 @@
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.timeDropdown').select2({
|
||||
placeholder: "Select",
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.timeDropdown').change( function(){
|
||||
|
||||
console.log("working")
|
||||
|
||||
var tr = $(this).closest('tr');
|
||||
|
||||
var trpOnTime = tr.find('.trp_on_time').val();
|
||||
var trpOffTime = tr.find('.trp_off_time').val();
|
||||
|
||||
if (trpOnTime != '' && trpOffTime != '') {
|
||||
|
||||
const startDate = new Date(`1970-01-01T${convertTo24Hour(trpOnTime)}`);
|
||||
const endDate = new Date(`1970-01-01T${convertTo24Hour(trpOffTime)}`);
|
||||
|
||||
// Handle the case where end time is on the next day
|
||||
if (endDate < startDate) {
|
||||
endDate.setDate(endDate.getDate() + 1);
|
||||
}
|
||||
|
||||
// Calculate the difference in milliseconds
|
||||
const diffInMs = endDate - startDate;
|
||||
|
||||
// Convert milliseconds to hours and minutes
|
||||
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
|
||||
const totalHours = hours + (minutes / 60);
|
||||
|
||||
tr.find('td:eq(3)').text(totalHours);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
})
|
||||
|
||||
console.log("working")
|
||||
|
||||
|
||||
function convertTo24Hour(time) {
|
||||
|
||||
const [timePart, modifier] = time.split(" ");
|
||||
let [hours, minutes] = timePart.split(":");
|
||||
|
||||
// Convert hours to a number
|
||||
hours = parseInt(hours, 10);
|
||||
|
||||
// Adjust hours based on AM/PM
|
||||
if (modifier === "PM" && hours < 12) {
|
||||
hours += 12;
|
||||
} else if (modifier === "AM" && hours === 12) {
|
||||
hours = 0;
|
||||
}
|
||||
|
||||
return `${String(hours).padStart(2, '0')}:${minutes}`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// dont delete this commented code , this is used for refernce in getting td values
|
||||
|
||||
// let openingTime = tr.find('td:eq(1)').text().trim();
|
||||
// let closingTime = tr.find('td:eq(2)').text().trim();
|
||||
// let totalHours = tr.find('td:eq(3)').text().trim();
|
||||
// let coldStart = tr.find('td:eq(4)').text().trim();
|
||||
// let breakdownHours = tr.find('td:eq(5)').text().trim();
|
||||
// let burnerFiringHours = tr.find('td:eq(6)').text().trim();
|
||||
// let sandFeedingHours = tr.find('td:eq(7)').text().trim();
|
||||
// let gasReceiptBg = tr.find('td:eq(8)').text().trim();
|
||||
// let gasReceiptPg = tr.find('td:eq(9)').text().trim();
|
||||
// let physicalGasConsumption = tr.find('td:eq(10)').text().trim();
|
||||
// let drierGasConsumption = tr.find('td:eq(11)').text().trim();
|
||||
// let coatingGasConsumption = tr.find('td:eq(12)').text().trim();
|
||||
// let trpPlusDrierGasConsumption = tr.find('td:eq(13)').text().trim();
|
||||
// let trpPhysicalGasPerTon = tr.find('td:eq(14)').text().trim();
|
||||
// let panelGasConsumption = tr.find('td:eq(15)').text().trim();
|
||||
// let panelGasPerTon = tr.find('td:eq(16)').text().trim();
|
||||
// let isolAls = tr.find('td:eq(17)').text().trim();
|
||||
// let isolAle = tr.find('td:eq(18)').text().trim();
|
||||
// let isolMe = tr.find('td:eq(19)').text().trim();
|
||||
// let isolSi = tr.find('td:eq(20)').text().trim();
|
||||
// let isolCaparo = tr.find('td:eq(21)').text().trim();
|
||||
// let isolNemak = tr.find('td:eq(22)').text().trim();
|
||||
// let isolDr = tr.find('td:eq(23)').text().trim();
|
||||
// let edRunningHours = tr.find('td:eq(24)').text().trim();
|
||||
// let edProduction = tr.find('td:eq(25)').text().trim();
|
||||
// let edUsage = tr.find('td:eq(26)').text().trim();
|
||||
// let trpProduction = tr.find('td:eq(27)').text().trim();
|
||||
// let trpProductionPerHour = tr.find('td:eq(28)').text().trim();
|
||||
// let coating = tr.find('td:eq(29)').text().trim();
|
||||
// let usageHindhuja = tr.find('td:eq(30)').text().trim();
|
||||
// let usageNemak = tr.find('td:eq(31)').text().trim();
|
||||
// let usageMe = tr.find('td:eq(32)').text().trim();
|
||||
// let usageBi = tr.find('td:eq(33)').text().trim();
|
||||
// let usageKarmen = tr.find('td:eq(34)').text().trim();
|
||||
// let waterReceipt = tr.find('td:eq(35)').text().trim();
|
||||
// let waterConsumption = tr.find('td:eq(36)').text().trim();
|
||||
// let ebReading = tr.find('td:eq(37)').text().trim();
|
||||
// let ebReadingPerUnitTon = tr.find('td:eq(38)').text().trim();
|
||||
// let workingPersonEngineers = tr.find('td:eq(39)').text().trim();
|
||||
// let workingPersonSupervisiors = tr.find('td:eq(40)').text().trim();
|
||||
// let workingPersonOperators = tr.find('td:eq(41)').text().trim();
|
||||
// let rollerDrivers = tr.find('td:eq(42)').text().trim();
|
||||
// let natureOfMaintenance = tr.find('td:eq(43)').text().trim();
|
||||
// let location = tr.find('td:eq(44)').text().trim();
|
||||
// let description = tr.find('td:eq(45)').text().trim();
|
||||
// let msSeperation = tr.find('td:eq(46)').text().trim();
|
||||
// let edWaste = tr.find('td:eq(47)').text().trim();
|
||||
// let coolerBags = tr.find('td:eq(48)').text().trim();
|
||||
// let edPlus20Waste = tr.find('td:eq(49)').text().trim();
|
||||
// let cycloneWaste = tr.find('td:eq(50)').text().trim();
|
||||
|
||||
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
// !caution!
|
||||
|
||||
// dont delete this commented code , this is used for refernce in getting td values
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user