CHANGE in drier machine : GWM
This commit is contained in:
commit
2e2f3051a7
@ -52,6 +52,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$postData=$this->request->getPost();
|
$postData=$this->request->getPost();
|
||||||
|
|
||||||
|
|
||||||
$inserted= $this->coatingMachineDetails_model->insert($postData);
|
$inserted= $this->coatingMachineDetails_model->insert($postData);
|
||||||
|
|
||||||
if ($inserted) {
|
if ($inserted) {
|
||||||
|
|||||||
@ -74,7 +74,9 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<!-- start page title -->
|
<!-- start page title -->
|
||||||
<div>
|
<div>
|
||||||
<?php
|
|
||||||
|
<!-- flash message is removed -->
|
||||||
|
<!-- <?php
|
||||||
helper('form');
|
helper('form');
|
||||||
$error = session()->getFlashdata('error');
|
$error = session()->getFlashdata('error');
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -86,7 +88,7 @@
|
|||||||
$type = "success";
|
$type = "success";
|
||||||
echo show_alert($type, $success);
|
echo show_alert($type, $success);
|
||||||
}
|
}
|
||||||
?>
|
?> -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
@ -99,7 +101,8 @@
|
|||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn btn-success" data-target="#coatingMachineDetailModal" data-toggle="modal" >
|
<button type="button" class="btn btn-success" data-target="#coatingMachineDetailModal"
|
||||||
|
data-toggle="modal">
|
||||||
Add New Record
|
Add New Record
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -113,11 +116,12 @@
|
|||||||
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
|
<table id="datatable" class="table table-hover table-bordered"
|
||||||
|
style="background-color:#fff;">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align:center !important;">Customer Name</th>
|
|
||||||
<th style="text-align:center !important;">Date</th>
|
<th style="text-align:center !important;">Date</th>
|
||||||
<th style="text-align:center !important;">Shift</th>
|
<th style="text-align:center !important;">Shift</th>
|
||||||
<th style="text-align:center !important;">Machine On Time</th>
|
<th style="text-align:center !important;">Machine On Time</th>
|
||||||
@ -127,7 +131,9 @@
|
|||||||
<th style="text-align:center !important;">Total Coating Sand (kg)</th>
|
<th style="text-align:center !important;">Total Coating Sand (kg)</th>
|
||||||
<th style="text-align:center !important;">Total Gas Consumption</th>
|
<th style="text-align:center !important;">Total Gas Consumption</th>
|
||||||
<th style="text-align:center !important;">Per Hour Gas Consumption</th>
|
<th style="text-align:center !important;">Per Hour Gas Consumption</th>
|
||||||
<th style="text-align:center !important;">Per Hour Coating Sand QTY (kg)</th>
|
<th style="text-align:center !important;">Per Hour Coating Sand QTY (kg)
|
||||||
|
</th>
|
||||||
|
<th style="text-align:center !important;">Customer Name</th>
|
||||||
<th style="text-align:center !important;">Action</th>
|
<th style="text-align:center !important;">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -139,19 +145,21 @@
|
|||||||
foreach ($coatingMachineDetails as $record) {
|
foreach ($coatingMachineDetails as $record) {
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?php echo $record['id']; ?>">
|
<tr data-id="<?php echo $record['id']; ?>">
|
||||||
<td align="center"><?php echo $record['customerName']; ?></td>
|
|
||||||
<td align="center"><?php echo $record['date'] ?></td>
|
<td align="center"><?php echo $record['date'] ?></td>
|
||||||
<td align="center"><?php echo $record['shift'] ?></td>
|
<td align="center"><?php echo $record['shift'] ?></td>
|
||||||
<td align="center"><?php echo $record['machineOnTime'] ?></td>
|
<td align="center"><?php echo $record['machineOnTime'] ?></td>
|
||||||
<td align="center"><?php echo $record['machineOffTime'] ?></td>
|
<td align="center"><?php echo $record['machineOffTime'] ?></td>
|
||||||
<td align="center"><?php echo $record['machineRunningInHrs']??'' ?></td>
|
<td align="center"><?php echo $record['machineRunningInHrs'] ?? '' ?></td>
|
||||||
<td align="center"><?php echo $record['totalCoating'] ?></td>
|
<td align="center"><?php echo $record['totalCoating'] ?></td>
|
||||||
<td align="center"><?php echo $record['totalCoatingSandInKg'] ?></td>
|
<td align="center"><?php echo $record['totalCoatingSandInKg'] ?></td>
|
||||||
<td align="center"><?php echo $record['totalGasConsumption'] ?></td>
|
<td align="center"><?php echo $record['totalGasConsumption'] ?></td>
|
||||||
<td align="center"><?php echo $record['perHourGasConsumption']??'' ?></td>
|
<td align="center"><?php echo $record['perHourGasConsumption'] ?? '' ?></td>
|
||||||
<td align="center"><?php echo $record['perHourCoatingSandQTY']??'' ?></td>
|
<td align="center"><?php echo $record['perHourCoatingSandQTY'] ?? '' ?></td>
|
||||||
|
<td align="center"><?php echo $record['customerName']; ?></td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a data-toggle="tooltip" class="edit-btn" data-target="editCoatingMachineDetailModal" data-toggle="modal"
|
<a data-toggle="tooltip" class="edit-btn"
|
||||||
|
data-target="editCoatingMachineDetailModal" data-toggle="modal"
|
||||||
style="cursor:pointer">
|
style="cursor:pointer">
|
||||||
<i class="fa fa-pencil-alt" data-toggle="tooltip"
|
<i class="fa fa-pencil-alt" data-toggle="tooltip"
|
||||||
title="Click here to Edit "></i>
|
title="Click here to Edit "></i>
|
||||||
@ -161,8 +169,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<a data-toggle="tooltip" onclick="confirmDelete(event)"
|
<a data-toggle="tooltip" onclick="confirmDelete(event)"
|
||||||
href="<?php echo base_url(); ?>deleteCoatingMachineDetails?id=<?php echo $record['id'] ?>"
|
href="<?php echo base_url(); ?>deleteCoatingMachineDetails?id=<?php echo $record['id'] ?>">
|
||||||
>
|
|
||||||
<i class="fa fa-trash" data-toggle="tooltip"
|
<i class="fa fa-trash" data-toggle="tooltip"
|
||||||
title="Click here to Delete "></i>
|
title="Click here to Delete "></i>
|
||||||
|
|
||||||
@ -192,9 +199,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
|
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog"
|
||||||
|
aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
|
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
|
||||||
<div class="modal-content" >
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|
||||||
<h5 class="modal-title" id="coatingMachineDetailModalLabel">
|
<h5 class="modal-title" id="coatingMachineDetailModalLabel">
|
||||||
@ -213,48 +221,110 @@
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="dateId">Date</label>
|
<label for="dateId">Date</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="date" class="form-control" id="dateId"
|
<input type="date" class="form-control" id="dateId" name="date" value="" required>
|
||||||
name="date" value="" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="shiftId">Shift</label>
|
<label for="shiftId">Shift</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="shiftId"
|
<input type="text" class="form-control" id="shiftId" name="shift" value="" required>
|
||||||
name="shift" value="" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="machineOnTimeId">Machine On Time</label>
|
<label for="machineOnTimeHrId">Machine On Time</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="datetime-local" class="form-control" id="machineOnTimeId"
|
<select class="form-control" name="machineOnTime" id="machineOnTimeHrId">
|
||||||
name="machineOnTime" value="" required>
|
<option value="">Select Time</option>
|
||||||
</div>
|
<option value="12:00 AM" > 12:00 AM</option>
|
||||||
<div class="form-group col-md-3">
|
<option value="12:30 AM"> 12:30 AM</option>
|
||||||
<label for="machineOffTimeId">Machine Off Time</label>
|
<?php
|
||||||
<span class="badge mandatory">*</span>
|
// Loop through the hours 1 to 12
|
||||||
<input type="datetime-local" class="form-control" id="machineOffTimeId"
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
name="machineOffTime" value="" required>
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 AM"> ' . $formattedHour . ':00 AM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 AM">' . $formattedHour . ':30 AM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<option value="12:00 PM" > 12:00 PM</option>
|
||||||
|
<option value="12:30 PM"> 12:30 PM</option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 PM"> ' . $formattedHour . ':00 PM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 PM">' . $formattedHour . ':30 PM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="machineOffTimeHrId">Machine Off Time</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<select class="form-control" name="machineOffTime" id="machineOffTimeHrId">
|
||||||
|
<option value="">Select Time</option>
|
||||||
|
<option value="12:00 AM" > 12:00 AM</option>
|
||||||
|
<option value="12:30 AM"> 12:30 AM</option>
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
echo '<option value="' . $formattedHour . ':00 AM"> ' . $formattedHour . ':00 AM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 AM">' . $formattedHour . ':30 AM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<option value="12:00 PM" > 12:00 PM</option>
|
||||||
|
<option value="12:30 PM"> 12:30 PM</option>
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
echo '<option value="' . $formattedHour . ':00 PM"> ' . $formattedHour . ':00 PM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 PM">' . $formattedHour . ':30 PM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="customerNameId">Customer Name</label>
|
<label for="customerNameId">Customer Name</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="customerNameId"
|
<input type="text" class="form-control" id="customerNameId" name="customerName" value=""
|
||||||
name="customerName" value="" required>
|
required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="totalCoatingId">Total Coating</label>
|
<label for="totalCoatingId">Total Coating</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="totalCoatingId"
|
<input type="text" class="form-control" id="totalCoatingId" name="totalCoating" value=""
|
||||||
name="totalCoating" value="" required>
|
required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
|
<label for="totalCoatingSandId">Total Coating Sand (in Kg)</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="totalCoatingSandId"
|
<input type="text" class="form-control" id="totalCoatingSandId" name="totalCoatingSandInKg"
|
||||||
name="totalCoatingSandInKg" value="" required>
|
value="" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="totalGasConsumptionId">Total Gas Consumption</label>
|
<label for="totalGasConsumptionId">Total Gas Consumption</label>
|
||||||
@ -264,10 +334,35 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hidden input fields -->
|
|
||||||
<input type="hidden" class="form-control" id="machineRunningInHrsId" name="machineRunningInHrs">
|
|
||||||
<input type="hidden" class="form-control" id="perHourGasConsumptionId" name="perHourGasConsumption">
|
</div>
|
||||||
<input type="hidden" class="form-control" id="perHourCoatingSandQTYId" name="perHourCoatingSandQTY" >
|
|
||||||
|
<div class="form-row">
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="machineRunningInHrsId"> Machine Running In Hrs</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="machineRunningInHrsId"
|
||||||
|
name="machineRunningInHrs" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="perHourGasConsumptionId">Per Hour Gas Consumption </label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="perHourGasConsumptionId"
|
||||||
|
name="perHourGasConsumption" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="perHourCoatingSandQTY">Per Hour Coating Sand QTY</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="perHourCoatingSandQTYId"
|
||||||
|
name="perHourCoatingSandQTY" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -283,9 +378,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- editCoatingMachineDetailModal -->
|
<!-- editCoatingMachineDetailModal -->
|
||||||
<div class="modal fade" id="editCoatingMachineDetailModal" tabindex="-1" role="dialog" aria-labelledby="editCoatingMachineDetailModalLabel" aria-hidden="true">
|
<div class="modal fade" id="editCoatingMachineDetailModal" tabindex="-1" role="dialog"
|
||||||
|
aria-labelledby="editCoatingMachineDetailModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
|
<div class="modal-dialog modal-xl" style="width:1060px !important ;" role="document">
|
||||||
<div class="modal-content" >
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
|
||||||
<h5 class="modal-title" id="editCoatingMachineDetailModalLabel">
|
<h5 class="modal-title" id="editCoatingMachineDetailModalLabel">
|
||||||
@ -297,50 +393,111 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- form -->
|
<!-- form -->
|
||||||
<form method="post" id="editCoatingMachineDetailModalFormId" action="<?php echo base_url(); ?>updateCoatingMachineDetails">
|
<form method="post" id="editCoatingMachineDetailModalFormId"
|
||||||
|
action="<?php echo base_url(); ?>updateCoatingMachineDetails">
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editDateId">Date</label>
|
<label for="editDateId">Date</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="date" class="form-control" id="editDateId"
|
<input type="date" class="form-control" id="editDateId" name="date" value="" required>
|
||||||
name="date" value="" required>
|
|
||||||
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
|
<input type="hidden" name="editCoatingMachineDetailId" id="editCoatingMachineDetailId">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editShiftId">Shift</label>
|
<label for="editShiftId">Shift</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="editShiftId"
|
<input type="text" class="form-control" id="editShiftId" name="shift" value="" required>
|
||||||
name="shift" value="" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editMachineOnTimeId">Machine On Time</label>
|
<label for="editMachineOnTimeHrId">Machine On Time</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="datetime-local" class="form-control" id="editMachineOnTimeId"
|
<select class="form-control" name="machineOnTime" id="editMachineOnTimeHrId">
|
||||||
name="machineOnTime" value="" required>
|
<option value="">Select Time</option>
|
||||||
</div>
|
<option value="12:00 AM"> 12:00 AM</option>
|
||||||
<div class="form-group col-md-3">
|
<option value="12:30 AM"> 12:30 AM</option>
|
||||||
<label for="editMachineOffTimeId">Machine Off Time</label>
|
<?php
|
||||||
<span class="badge mandatory">*</span>
|
// Loop through the hours 1 to 12
|
||||||
<input type="datetime-local" class="form-control" id="editMachineOffTimeId"
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
name="machineOffTime" value="" required>
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 AM"> ' . $formattedHour . ':00 AM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 AM">' . $formattedHour . ':30 AM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
<option value="12:00 PM"> 12:00 PM</option>
|
||||||
|
<option value="12:30 PM"> 12:30 PM</option>
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 PM"> ' . $formattedHour . ':00 PM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 PM">' . $formattedHour . ':30 PM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="editMachineOffTimeHrId">Machine Off Time</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<select class="form-control" name="machineOffTime" id="editMachineOffTimeHrId">
|
||||||
|
<option value="">Select Time</option>
|
||||||
|
<option value="12:00 AM"> 12:00 AM</option>
|
||||||
|
<option value="12:30 AM"> 12:30 AM</option>
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 AM"> ' . $formattedHour . ':00 AM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 AM">' . $formattedHour . ':30 AM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<option value="12:00 PM"> 12:00 PM</option>
|
||||||
|
<option value="12:30 PM"> 12:30 PM</option>
|
||||||
|
<?php
|
||||||
|
// Loop through the hours 1 to 12
|
||||||
|
for ($hour = 1; $hour < 12; $hour++) {
|
||||||
|
// Display each hour with ":00"
|
||||||
|
$formattedHour = str_pad($hour, 2, '0', STR_PAD_LEFT);
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':00 PM"> ' . $formattedHour . ':00 PM</option>';
|
||||||
|
|
||||||
|
echo '<option value="' . $formattedHour . ':30 PM">' . $formattedHour . ':30 PM</option>';
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editCustomerNameId">Customer Name</label>
|
<label for="editCustomerNameId">Customer Name</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="editCustomerNameId"
|
<input type="text" class="form-control" id="editCustomerNameId" name="customerName" value=""
|
||||||
name="customerName" value="" required>
|
required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editTotalCoatingId">Total Coating</label>
|
<label for="editTotalCoatingId">Total Coating</label>
|
||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="editTotalCoatingId"
|
<input type="text" class="form-control" id="editTotalCoatingId" name="totalCoating" value=""
|
||||||
name="totalCoating" value="" required>
|
required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="editTotalCoatingSandId">Total Coating Sand (in Kg)</label>
|
<label for="editTotalCoatingSandId">Total Coating Sand (in Kg)</label>
|
||||||
@ -353,14 +510,37 @@
|
|||||||
<span class="badge mandatory">*</span>
|
<span class="badge mandatory">*</span>
|
||||||
<input type="text" class="form-control" id="editTotalGasConsumptionId"
|
<input type="text" class="form-control" id="editTotalGasConsumptionId"
|
||||||
name="totalGasConsumption" value="" required>
|
name="totalGasConsumption" value="" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- hidden input fields -->
|
<div class="form-row">
|
||||||
<input type="hidden" class="form-control" id="editMachineRunningInHrsId" name="machineRunningInHrs">
|
|
||||||
<input type="hidden" class="form-control" id="editPerHourGasConsumptionId" name="perHourGasConsumption">
|
|
||||||
<input type="hidden" class="form-control" id="editPerHourCoatingSandQTYId" name="perHourCoatingSandQTY" >
|
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="editMachineRunningInHrsId"> Machine Running In Hrs</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="editMachineRunningInHrsId"
|
||||||
|
name="machineRunningInHrs" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="editPerHourGasConsumptionId">Per Hour Gas Consumption </label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="editPerHourGasConsumptionId"
|
||||||
|
name="perHourGasConsumption" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group col-md-3">
|
||||||
|
<label for="editPerHourCoatingSandQTYId">Per Hour Coating Sand QTY</label>
|
||||||
|
<span class="badge mandatory">*</span>
|
||||||
|
<input type="text" class="form-control" id="editPerHourCoatingSandQTYId"
|
||||||
|
name="perHourCoatingSandQTY" required>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -376,27 +556,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
<!-- <script type="text/javascript">
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
|
|
||||||
$('#datatable').DataTable({
|
|
||||||
"paging": true,
|
|
||||||
"lengthChange": true,
|
|
||||||
"searching": true,
|
|
||||||
"ordering": true,
|
|
||||||
"info": true,
|
|
||||||
"autoWidth": true,
|
|
||||||
"pageLength": 10,
|
|
||||||
"lengthMenu": [10, 25, 50, 100]
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
</script> -->
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
|
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||||
var dateSplit = date.split('-');
|
var dateSplit = date.split('-');
|
||||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||||
};
|
};
|
||||||
@ -405,10 +569,10 @@
|
|||||||
var table = $('#datatable').DataTable({
|
var table = $('#datatable').DataTable({
|
||||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||||
buttons: [
|
buttons: [
|
||||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
'csv', 'excel', 'pdf' // Export buttons
|
||||||
],
|
],
|
||||||
pageLength: 10, // Default rows per page
|
pageLength: 10, // Default rows per page
|
||||||
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
|
lengthMenu: [[10, 20, 30, 50, -1], [10, 20, 30, 50, "All"]], // Rows per page options
|
||||||
// responsive: true, // Responsive table
|
// responsive: true, // Responsive table
|
||||||
order: [], // Default ordering (column index 0, descending)
|
order: [], // Default ordering (column index 0, descending)
|
||||||
language: {
|
language: {
|
||||||
@ -421,7 +585,7 @@
|
|||||||
|
|
||||||
|
|
||||||
// Handle form submission
|
// Handle form submission
|
||||||
$("#DateRangeFilter").submit(function(e) {
|
$("#DateRangeFilter").submit(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
table.draw();
|
table.draw();
|
||||||
});
|
});
|
||||||
@ -429,18 +593,23 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function confirmDelete(event){
|
function confirmDelete(event) {
|
||||||
|
|
||||||
let result= confirm(` Do you Confirm to Delete the Coating Machine Detail?`);
|
let result = confirm(` Do you Confirm to Delete the Coating Machine Detail?`);
|
||||||
if(result){return result; }else{event.preventDefault();}
|
if (result) { return result; } else { event.preventDefault(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
$('#exampleSelect2').select2();
|
$('#exampleSelect2 ').select2();
|
||||||
|
$('#machineOnTimeHrId ').select2();
|
||||||
|
$('#machineOffTimeHrId ').select2();
|
||||||
|
$('#editMachineOnTimeHrId ').select2();
|
||||||
|
$('#editMachineOffTimeHrId ').select2();
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -448,46 +617,48 @@ $(document).ready(function() {
|
|||||||
<!-- appending values in the edit coating machine detail modal from the table -->
|
<!-- appending values in the edit coating machine detail modal from the table -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
|
|
||||||
$('#datatable tbody').on('click', '.edit-btn', function() {
|
$('#datatable tbody').on('click', '.edit-btn', function () {
|
||||||
|
|
||||||
var row = $(this).closest('tr');
|
var row = $(this).closest('tr');
|
||||||
|
|
||||||
// Get values from the row
|
// Get values from the row
|
||||||
var customerName = row.find('td:eq(0)').text();
|
|
||||||
var date = row.find('td:eq(1)').text();
|
|
||||||
var shift = row.find('td:eq(2)').text();
|
|
||||||
var machineOnTime = row.find('td:eq(3)').text();
|
|
||||||
var machineOffTime = row.find('td:eq(4)').text();
|
|
||||||
var machineRunningInHrs= row.find('td:eq(5)').text();
|
|
||||||
var totalCoating = row.find('td:eq(6)').text();
|
|
||||||
var totalCoatingSandInKg = row.find('td:eq(7)').text();
|
|
||||||
var totalGasConsumption = row.find('td:eq(8)').text();
|
|
||||||
var perHourGasConsumption =row.find('td:eq(9)').text();
|
|
||||||
var perHourCoatingSandQTY =row.find('td:eq(10)').text();
|
|
||||||
|
|
||||||
|
var date = row.find('td:eq(0)').text();
|
||||||
|
var shift = row.find('td:eq(1)').text();
|
||||||
|
var machineOnTimeHr = row.find('td:eq(2)').text();
|
||||||
|
var machineOffTimeHr = row.find('td:eq(3)').text();
|
||||||
|
var machineRunningInHrs = row.find('td:eq(4)').text();
|
||||||
|
var totalCoating = row.find('td:eq(5)').text();
|
||||||
|
var totalCoatingSandInKg = row.find('td:eq(6)').text();
|
||||||
|
var totalGasConsumption = row.find('td:eq(7)').text();
|
||||||
|
var perHourGasConsumption = row.find('td:eq(8)').text();
|
||||||
|
var perHourCoatingSandQTY = row.find('td:eq(9)').text();
|
||||||
|
var customerName = row.find('td:eq(10)').text();
|
||||||
|
|
||||||
|
|
||||||
// Fill the modal fields with the values
|
// Fill the modal fields with the values
|
||||||
|
|
||||||
|
$('#editCoatingMachineDetailId').val(row.data('id'));
|
||||||
$('#editCustomerNameId').val(customerName);
|
$('#editCustomerNameId').val(customerName);
|
||||||
$('#editDateId').val(date);
|
$('#editDateId').val(date);
|
||||||
$('#editShiftId').val(shift);
|
$('#editShiftId').val(shift);
|
||||||
$('#editMachineOnTimeId').val(machineOnTime);
|
$('#editMachineOnTimeHrId').val(machineOnTimeHr).change();
|
||||||
$('#editMachineOffTimeId').val(machineOffTime);
|
$('#editMachineOffTimeHrId').val(machineOffTimeHr).change();
|
||||||
$('#editTotalCoatingId').val(totalCoating);
|
$('#editTotalCoatingId').val(totalCoating);
|
||||||
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
|
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
|
||||||
$('#editTotalGasConsumptionId').val(totalGasConsumption);
|
$('#editTotalGasConsumptionId').val(totalGasConsumption);
|
||||||
$('#editCoatingMachineDetailId').val(row.data('id'));
|
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
||||||
|
$('#editPerHourGasConsumptionId').val(perHourGasConsumption);
|
||||||
|
$('#editPerHourCoatingSandQTYId').val(perHourCoatingSandQTY);
|
||||||
|
|
||||||
// Show the modal
|
// Show the modal
|
||||||
$('#editCoatingMachineDetailModal').modal('show');
|
$('#editCoatingMachineDetailModal').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -495,72 +666,90 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
|
||||||
$('#machineOnTimeId').change(function(){
|
$('#machineOnTimeHrId').change(function () {
|
||||||
let machineOnTime = $(this).val();
|
|
||||||
let machineOffTime =$('#machineOffTimeId').val();
|
let machineOnDate = $('#dateId').val();
|
||||||
|
|
||||||
|
if (machineOnDate == '') {
|
||||||
|
alert('Please Select Date before entering Machine On and Off Time ..!!');
|
||||||
|
$('#machineOnTimeHrId').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let machineOnTimeHr = $('#machineOnTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOnTimeAmOrPm = $('#machineOnTimeHrId').val().split(' ')[1];
|
||||||
|
let machineOffTimeHr = $('#machineOffTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOffTimeAmOrPm = $('#machineOffTimeHrId').val().split(' ')[1];
|
||||||
|
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime){
|
let machineRunningInHrs = calculateMachineRunInHrs(machineOnDate, machineOnTimeHr, machineOnTimeAmOrPm, machineOffTimeHr, machineOffTimeAmOrPm);
|
||||||
|
|
||||||
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
if (!machineRunningInHrs) {
|
||||||
|
$('machineOnTimeHrId').val('');
|
||||||
if(!machineRunningInHrs){
|
|
||||||
$(this).val('');
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$('#machineRunningInHrsId').val(machineRunningInHrs);
|
$('#machineRunningInHrsId').val(machineRunningInHrs);
|
||||||
$('#totalCoatingSandId').trigger('change');
|
$('#totalCoatingSandId').trigger('change');
|
||||||
$('#totalGasConsumptionId').trigger('change');
|
$('#totalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#machineOffTimeId').change(function(){
|
$('#machineOffTimeHrId').change(function () {
|
||||||
|
|
||||||
let machineOffTime = $(this).val();
|
let machineOnDate = $('#dateId').val();
|
||||||
let machineOnTime =$('#machineOnTimeId').val();
|
|
||||||
|
if (machineOnDate == '') {
|
||||||
|
alert('Please Select Date before entering Machine On and Off Time ..!!');
|
||||||
|
$('#machineOffTimeHrId').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
let machineOffTimeHr = $('#machineOffTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOffTimeAmOrPm = $('#machineOffTimeHrId').val().split(' ')[1];
|
||||||
|
let machineOnTimeHr = $('#machineOnTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOnTimeAmOrPm = $('#machineOnTimeHrId').val().split(' ')[1];
|
||||||
|
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime ){
|
let machineRunningInHrs = calculateMachineRunInHrs(machineOnDate, machineOnTimeHr, machineOnTimeAmOrPm, machineOffTimeHr, machineOffTimeAmOrPm);
|
||||||
|
|
||||||
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
if (!machineRunningInHrs) {
|
||||||
if(!machineRunningInHrs){
|
|
||||||
|
|
||||||
$(this).val('');
|
$('#machineOffTimeHrId').val('');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$('#machineRunningInHrsId').val(machineRunningInHrs);
|
$('#machineRunningInHrsId').val(machineRunningInHrs);
|
||||||
$('#totalCoatingSandId').trigger('change');
|
$('#totalCoatingSandId').trigger('change');
|
||||||
$('#totalGasConsumptionId').trigger('change');
|
$('#totalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#totalCoatingSandId').change(function(){
|
$('#totalCoatingSandId').change(function () {
|
||||||
|
|
||||||
let totalCoatingSandValue= $(this).val();
|
let totalCoatingSandValue = $(this).val();
|
||||||
let machineRunningInHrsValue= $('#machineRunningInHrsId').val();
|
let machineRunningInHrsValue = $('#machineRunningInHrsId').val();
|
||||||
|
|
||||||
if(totalCoatingSandValue && machineRunningInHrsValue){
|
if (totalCoatingSandValue && machineRunningInHrsValue) {
|
||||||
let perHourCoatingSandQTYValue= (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
let perHourCoatingSandQTYValue = (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
||||||
$('#perHourCoatingSandQTYId').val(perHourCoatingSandQTYValue);
|
$('#perHourCoatingSandQTYId').val(perHourCoatingSandQTYValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#totalGasConsumptionId').change(function(){
|
$('#totalGasConsumptionId').change(function () {
|
||||||
|
|
||||||
let totalGasConsumptionValue=$(this).val();
|
let totalGasConsumptionValue = $(this).val();
|
||||||
let machineRunningInHrsValue= $('#machineRunningInHrsId').val();
|
let machineRunningInHrsValue = $('#machineRunningInHrsId').val();
|
||||||
if(totalGasConsumptionValue && machineRunningInHrsValue){
|
if (totalGasConsumptionValue && machineRunningInHrsValue) {
|
||||||
let perHourGasConsumptionValue= (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
let perHourGasConsumptionValue = (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
||||||
$('#perHourGasConsumptionId').val(perHourGasConsumptionValue);
|
$('#perHourGasConsumptionId').val(perHourGasConsumptionValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -574,72 +763,89 @@ $(document).ready(function() {
|
|||||||
<!-- calculations for some fields needed in onChange while editing coating machine details -->
|
<!-- calculations for some fields needed in onChange while editing coating machine details -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
|
||||||
$('#editMachineOnTimeId').change(function(){
|
$('#editMachineOnTimeHrId').change(function () {
|
||||||
let machineOnTime = $(this).val();
|
|
||||||
let machineOffTime =$('#editMachineOffTimeId').val();
|
|
||||||
|
|
||||||
|
let machineOnDate = $('#editDateId').val();
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime){
|
if (machineOnDate == '') {
|
||||||
|
alert('Please Select Date before entering Machine On and Off Time ..!!');
|
||||||
|
$('#editMachineOnTimeHrId').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
let machineOnTimeHr = $('#editMachineOnTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOnTimeAmOrPm = $('#editMachineOnTimeHrId').val().split(' ')[1];
|
||||||
|
let machineOffTimeHr = $('#editMachineOffTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOffTimeAmOrPm = $('#editMachineOffTimeHrId').val().split(' ')[1];
|
||||||
|
|
||||||
if(!machineRunningInHrs){
|
let machineRunningInHrs = calculateMachineRunInHrs(machineOnDate, machineOnTimeHr, machineOnTimeAmOrPm, machineOffTimeHr, machineOffTimeAmOrPm);
|
||||||
$(this).val('');
|
|
||||||
|
if (!machineRunningInHrs) {
|
||||||
|
$('#editMachineOnTimeHrId').val('');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
||||||
$('#editTotalCoatingSandId').trigger('change');
|
$('#editTotalCoatingSandId').trigger('change');
|
||||||
$('#editTotalGasConsumptionId').trigger('change');
|
$('#editTotalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#editMachineOffTimeId').change(function(){
|
$('#editMachineOffTimeHrId').change(function () {
|
||||||
|
|
||||||
let machineOffTime = $(this).val();
|
let machineOnDate = $('#editDateId').val();
|
||||||
let machineOnTime =$('#editMachineOnTimeId').val();
|
|
||||||
|
if (machineOnDate == '') {
|
||||||
|
alert('Please Select Date before entering Machine On and Off Time ..!!');
|
||||||
|
$('#editMachineOnTimeHrId').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if( machineOnTime && machineOffTime ){
|
let machineOnTimeHr = $('#editMachineOnTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOnTimeAmOrPm = $('#editMachineOnTimeHrId').val().split(' ')[1];
|
||||||
|
let machineOffTimeHr = $('#editMachineOffTimeHrId').val().split(' ')[0];
|
||||||
|
let machineOffTimeAmOrPm = $('#editMachineOffTimeHrId').val().split(' ')[1];
|
||||||
|
|
||||||
let machineRunningInHrs= calculateMachineRunInHrs(machineOnTime , machineOffTime );
|
let machineRunningInHrs = calculateMachineRunInHrs(machineOnDate, machineOnTimeHr, machineOnTimeAmOrPm, machineOffTimeHr, machineOffTimeAmOrPm);
|
||||||
if(!machineRunningInHrs){
|
|
||||||
|
|
||||||
$(this).val('');
|
if (!machineRunningInHrs) {
|
||||||
|
|
||||||
|
$('#editMachineOffTimeHrId').val('');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
$('#editMachineRunningInHrsId').val(machineRunningInHrs);
|
||||||
$('#editTotalCoatingSandId').trigger('change');
|
$('#editTotalCoatingSandId').trigger('change');
|
||||||
$('#editTotalGasConsumptionId').trigger('change');
|
$('#editTotalGasConsumptionId').trigger('change');
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#editTotalCoatingSandId').change(function(){
|
$('#editTotalCoatingSandId').change(function () {
|
||||||
|
|
||||||
let totalCoatingSandValue= $(this).val();
|
let totalCoatingSandValue = $(this).val();
|
||||||
let machineRunningInHrsValue= $('#editMachineRunningInHrsId').val();
|
let machineRunningInHrsValue = $('#editMachineRunningInHrsId').val();
|
||||||
|
|
||||||
if(totalCoatingSandValue && machineRunningInHrsValue){
|
if (totalCoatingSandValue && machineRunningInHrsValue) {
|
||||||
let perHourCoatingSandQTYValue= (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
let perHourCoatingSandQTYValue = (totalCoatingSandValue / machineRunningInHrsValue).toFixed(2);
|
||||||
$('#editPerHourCoatingSandQTYId').val(perHourCoatingSandQTYValue);
|
$('#editPerHourCoatingSandQTYId').val(perHourCoatingSandQTYValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#editTotalGasConsumptionId').change(function(){
|
$('#editTotalGasConsumptionId').change(function () {
|
||||||
|
|
||||||
let totalGasConsumptionValue=$(this).val();
|
let totalGasConsumptionValue = $(this).val();
|
||||||
let machineRunningInHrsValue= $('#editMachineRunningInHrsId').val();
|
let machineRunningInHrsValue = $('#editMachineRunningInHrsId').val();
|
||||||
if(totalGasConsumptionValue && machineRunningInHrsValue){
|
if (totalGasConsumptionValue && machineRunningInHrsValue) {
|
||||||
let perHourGasConsumptionValue= (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
let perHourGasConsumptionValue = (totalGasConsumptionValue / machineRunningInHrsValue).toFixed(2);
|
||||||
$('#editPerHourGasConsumptionId').val(perHourGasConsumptionValue);
|
$('#editPerHourGasConsumptionId').val(perHourGasConsumptionValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -653,30 +859,75 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function calculateMachineRunInHrs(machineOnTime , machineOffTime ){
|
function calculateMachineRunInHrs(machineOnDate, machineOnTimeHr, machineOnTimeAmOrPm, machineOffTimeHr, machineOffTimeAmOrPm) {
|
||||||
|
|
||||||
let startTime = new Date(machineOnTime);
|
let machineOnTime12 = machineOnTimeHr + " " + machineOnTimeAmOrPm; //07:00 PM
|
||||||
let endTime = new Date(machineOffTime);
|
let machineOffTime12 = machineOffTimeHr + " " + machineOffTimeAmOrPm; //03:00 PM
|
||||||
|
|
||||||
let startDate = startTime.toISOString().split('T')[0];
|
let machineOnTime24 = convertTo24HrFormat(machineOnTime12) + ":00"; //19:00:00
|
||||||
let endDate = endTime.toISOString().split('T')[0];
|
let machineOffTime24 = convertTo24HrFormat(machineOffTime12) + ":00"; //15:00:00
|
||||||
|
|
||||||
|
|
||||||
|
let machineOnDateAndTime;
|
||||||
|
let machineOffDateAndTime;
|
||||||
|
|
||||||
|
if (machineOnTimeAmOrPm == 'PM' && machineOffTimeAmOrPm == 'AM') {
|
||||||
|
machineOnDateAndTime = machineOnDate + "T" + machineOnTime24;
|
||||||
|
machineOffDateAndTime = getNextDay(machineOnDate) + "T" + machineOffTime24;
|
||||||
|
} else {
|
||||||
|
machineOnDateAndTime = machineOnDate + "T" + machineOnTime24;
|
||||||
|
machineOffDateAndTime = machineOnDate + "T" + machineOffTime24;
|
||||||
|
|
||||||
if (startDate === endDate && startTime.getTime() >= endTime.getTime()) {
|
|
||||||
alert(" Machine On time cannot be greater than or equal to Machine Off time on the same day." );
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startTime > endTime) {
|
|
||||||
alert( "Start date cannot be greater than end date");
|
let startTime = new Date(machineOnDateAndTime);
|
||||||
return false
|
let endTime = new Date(machineOffDateAndTime);
|
||||||
}
|
|
||||||
|
console.log(startTime); //Thu Oct 17 2024 01:00:00 GMT+0530 (India Standard Time)
|
||||||
|
|
||||||
|
console.log(endTime); //Thu Oct 17 2024 05:30:00 GMT+0530 (India Standard Time)
|
||||||
|
|
||||||
|
let startDate = machineOnDateAndTime.split('T')[0];
|
||||||
|
let endDate = machineOffDateAndTime.split('T')[0];
|
||||||
|
|
||||||
let timeDifferenceInMs = endTime - startTime;
|
let timeDifferenceInMs = endTime - startTime;
|
||||||
|
|
||||||
// Convert the time difference from milliseconds to hours
|
|
||||||
let timeDifferenceInHours = timeDifferenceInMs / (1000 * 60 * 60);
|
|
||||||
|
|
||||||
// Display the result in hours
|
let timeDifferenceInMinutes = Math.floor(timeDifferenceInMs / (1000 * 60));
|
||||||
return Math.abs(timeDifferenceInHours).toFixed(2) ;
|
let hours = Math.floor(timeDifferenceInMinutes / 60);
|
||||||
|
let minutes = timeDifferenceInMinutes % 60;
|
||||||
|
|
||||||
|
let timeDifferenceFormatted = `${hours}.${minutes >= 30 ? 5 : 0}`;
|
||||||
|
|
||||||
|
return Math.abs(timeDifferenceFormatted).toFixed(1);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function convertTo24HrFormat(timeStr) {
|
||||||
|
const [time, modifier] = timeStr.split(' ');
|
||||||
|
let [hours, minutes] = time.split(':');
|
||||||
|
if (hours === '12') {
|
||||||
|
hours = '00';
|
||||||
|
}
|
||||||
|
if (modifier === 'PM') {
|
||||||
|
hours = parseInt(hours, 10) + 12;
|
||||||
|
}
|
||||||
|
return `${hours}:${minutes}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getNextDay(givenDate) {
|
||||||
|
// Given date in 'YYYY-MM-DD' format
|
||||||
|
let date = new Date(givenDate);
|
||||||
|
|
||||||
|
// Increment the date by 1 day
|
||||||
|
date.setDate(date.getDate() + 1);
|
||||||
|
|
||||||
|
// Output the updated date
|
||||||
|
return date.toISOString().split('T')[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user