stock module - 28-03-2025

This commit is contained in:
vadivelJ96 2025-03-28 17:38:58 +05:30
parent a5fa744513
commit 3e7a903cc0
11 changed files with 6557 additions and 6007 deletions

View File

@ -45,8 +45,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -133,7 +135,8 @@
.celda_encabezado_general { .celda_encabezado_general {
background-color:rgb(80, 187, 217); /* blue background */ background-color: rgb(80, 187, 217);
/* blue background */
border: 1px solid #ccc; border: 1px solid #ccc;
color: #ffffff; color: #ffffff;
font-weight: bold; font-weight: bold;
@ -141,10 +144,14 @@
text-align: center; text-align: center;
min-width: 120px; min-width: 120px;
max-width: 120px; max-width: 120px;
white-space: normal; /* Allows text to wrap */ white-space: normal;
word-wrap: break-word; /* Breaks long words if needed */ /* Allows text to wrap */
text-align: center; /* Centers text for better alignment */ word-wrap: break-word;
max-width: 150px; /* Set a max width to control wrapping */ /* Breaks long words if needed */
text-align: center;
/* Centers text for better alignment */
max-width: 150px;
/* Set a max width to control wrapping */
} }
.celda_encabezado_total { .celda_encabezado_total {
@ -208,23 +215,23 @@
.fht-table th:nth-child(1), .fht-table th:nth-child(1),
.fht-table th:nth-child(1) .fht-table th:nth-child(1) {
{
position: sticky; position: sticky;
left: 0; left: 0;
top: 0; top: 0;
background-color:rgb(80, 187, 217); /* blue background */ background-color: rgb(80, 187, 217);
/* blue background */
z-index: 7 !important; z-index: 7 !important;
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
.fht-table td:nth-child(1) .fht-table td:nth-child(1) {
{
position: sticky; position: sticky;
left: 0; left: 0;
background-color:rgb(80, 187, 217); /* blue background */ background-color: rgb(80, 187, 217);
/* blue background */
z-index: 2; z-index: 2;
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
@ -240,20 +247,36 @@
} }
/* Adjust heights based on screen zoom */ /* Adjust heights based on screen zoom */
@media only screen and (min-height: 1400px) { /* Approximate Zoom < 100% */ @media only screen and (min-height: 1400px) {
.table-responsive { max-height: 425px; }
/* Approximate Zoom < 100% */
.table-responsive {
max-height: 425px;
}
} }
@media only screen and (min-height: 1200px) { /* Approximate Zoom ~ 90% */ @media only screen and (min-height: 1200px) {
.table-responsive { max-height: 500px; }
/* Approximate Zoom ~ 90% */
.table-responsive {
max-height: 500px;
}
} }
@media only screen and (min-height: 1000px) { /* Approximate Zoom ~ 80% */ @media only screen and (min-height: 1000px) {
.table-responsive { max-height: 600px; }
/* Approximate Zoom ~ 80% */
.table-responsive {
max-height: 600px;
}
} }
@media only screen and (min-height: 800px) { /* Approximate Zoom ~ 75% */ @media only screen and (min-height: 800px) {
.table-responsive { max-height: 650px; }
/* Approximate Zoom ~ 75% */
.table-responsive {
max-height: 650px;
}
} }
.fht-table thead th { .fht-table thead th {
@ -269,10 +292,14 @@
body[data-layout-mode=horizontal] .container-fluid { body[data-layout-mode=horizontal] .container-fluid {
max-width: 100%; max-width: 100%;
} }
.card-body{ padding-bottom: 0;}
.card{ margin-bottom: 5px;}
.card-body {
padding-bottom: 0;
}
.card {
margin-bottom: 5px;
}
</style> </style>
<div class="content-page"> <div class="content-page">
@ -375,8 +402,7 @@
title="Add Entry" title="Add Entry"
data-target="#coatingMachineDetailModal" data-target="#coatingMachineDetailModal"
data-toggle="modal" data-toggle="modal"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer;">
>
</i> </i>
@ -387,188 +413,6 @@
</form> </form>
<div class="table-responsive" id="table-responsive">
<table id="coatingMachineDetailTableId" class="fht-table "
style="background-color:#fff;">
<thead>
<tr>
<th class="celda_encabezado_general" >Date</th>
<th class="celda_encabezado_general" >Shift</th>
<th class="celda_encabezado_general" >Machine On Time</th>
<th class="celda_encabezado_general" >Machine Off Time</th>
<th class="celda_encabezado_general" >Machine Running(hr)</th>
<th class="celda_encabezado_general" >Customer Name</th>
<th class="celda_encabezado_general" >Grade</th>
<th class="celda_encabezado_general" >Total Coating</th>
<th class="celda_encabezado_general" >Total Coating Sand(kg)</th>
<th class="celda_encabezado_general" >Total Gas Consumption</th>
<th class="celda_encabezado_general" >Hour Gas</th>
<th class="celda_encabezado_general" >Hour QTY(kg)</th>
<th class="celda_encabezado_general" >Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($coatingMachineDetails)) {
$summary = [] ;
foreach ($coatingMachineDetails as $record) {
$batchCardFiles =json_decode($record['batchcard_files'],true);
?>
<tr data-id="<?php echo $record['id']; ?>"
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<?php
$date = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y');
?>
<!-- td:eq(0) -->
<td class="celda_normal"><?php echo $date ?></td>
<!-- td:eq(1) -->
<td class="celda_normal"><?php echo $record['shift'] ?></td>
<!-- td:eq(2) -->
<td class="celda_normal"><?php echo $record['machineOnTime'] ?></td>
<!-- td:eq(3) -->
<td class="celda_normal"><?php echo $record['machineOffTime'] ?></td>
<!-- td:eq(4) -->
<td class="celda_normal"><?php echo $record['machineRunningInHrs'] ?? ' ' ?></td>
<!-- td:eq(5) -->
<td class="celda_normal"><?php echo $record['customerName'] ?? '' ?></td>
<!-- td:eq(6) -->
<td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
<!-- td:eq(7) -->
<td class="celda_normal"><?php echo $record['totalCoating'] ?></td>
<!-- td:eq(8) -->
<td class="celda_normal"><?php echo $record['totalCoatingSandInKg'] ?></td>
<!-- td:eq(9) -->
<td class="celda_normal"><?php echo $record['totalGasConsumption'] ?></td>
<!-- td:eq(10) -->
<td class="celda_normal"><?php echo $record['perHourGasConsumption'] ?? '' ?></td>
<!-- td:eq(11) -->
<td class="celda_normal"><?php echo $record['perHourCoatingSandQTY'] ?? '' ?></td>
<!-- td:eq(12) -->
<!-- edit and download option..!! -->
<td class="celda_normal" >
<a data-toggle="tooltip" class="edit-btn"
data-target="editCoatingMachineDetailModal" data-toggle="modal"
style="cursor:pointer;">
<i class="fa fa-edit"
title="Click here to Edit ">
</i>
&nbsp;&nbsp;&nbsp;
</a>
<?php
foreach ($batchCardFiles as $index => $files) {
if ($index === 0 && !empty($files['batchCardId']) && $files['coating_id'] == $record['id'])
{
?>
<a href="<?= base_url('download-batchcard-zip?coating_id='.$record['id'].'&date='.$date); ?>"
data-toggle="tooltip" title="Download Batch Card" >
<i class="fa fa-download"></i>
</a>
<?php
break;
}
}
?>
</td>
<!-- td:eq(13) -->
<td style="display:none;"><?php echo $record['batchcard_files'] ?? ' ' ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['totalCoating'])) {
$summary['totalMachineRunningHrs'] = 0 ;
$summary['totalCoating'] = 0 ;
$summary['totalCoatingSandInKg'] = 0 ;
$summary['totalGasConsumption'] = 0 ;
$summary['perHourGasConsumption'] = 0 ;
$summary['perHourCoatingSandQTY'] = 0 ;
}
$summary['totalMachineRunningHrs'] += $record['machineRunningInHrs'] == "-" ? 0 : (float) $record['machineRunningInHrs'];
$summary['totalCoating'] += $record['totalCoating'] == "-" ? 0 : (float) $record['totalCoating'] ;
$summary['totalCoatingSandInKg'] += $record['totalCoatingSandInKg'] == "-" ? 0 : (float) $record['totalCoatingSandInKg'] ;
$summary['totalGasConsumption'] += $record['totalGasConsumption'] == "-" ? 0 :(float) $record['totalGasConsumption'] ;
$summary['perHourGasConsumption'] += $record['perHourGasConsumption'] == "-" ? 0 : (float) $record['perHourGasConsumption'] ;
$summary['perHourCoatingSandQTY'] += $record['perHourCoatingSandQTY'] == "-" ? 0 :(float) $record['perHourCoatingSandQTY'] ;
} ?>
<tfoot>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> <?=$summary['totalMachineRunningHrs']?></td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "><?=$summary['totalCoating']?></td>
<td class="celda_normal "><?=$summary['totalCoatingSandInKg']?></td>
<td class="celda_normal "><?=$summary['totalGasConsumption']?></td>
<td class="celda_normal "><?=number_format($summary['totalGasConsumption']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
<td class="celda_normal "><?=number_format($summary['totalCoatingSandInKg']/$summary['totalMachineRunningHrs'], 2)?> (avg)</td>
</tr>
</tfoot>
</div>
<?php
}
?>
</tbody>
</table>
</div>
<br>
<?php if (empty($coatingMachineDetails)) { ?>
<h5 align="center" style="color:grey;">
No Coating Machine Details present in this month
</h5>
<?php } ?>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog" <div class="modal fade" id="coatingMachineDetailModal" tabindex="-1" role="dialog"
aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true"> aria-labelledby="coatingMachineDetailModalLabel" aria-hidden="true">
@ -610,7 +454,7 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="machineOnTimeHrId">Machine On Time</label> <label for="machineOnTimeHrId">Machine On Time</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<select class="form-control" name="machineOnTime" id="machineOnTimeHrId" required> <select class="form-control select2" name="machineOnTime" id="machineOnTimeHrId" required>
<option value="">Select Time</option> <option value="">Select Time</option>
<option value="12:00 AM">12:00 AM</option> <option value="12:00 AM">12:00 AM</option>
<option value="12:30 AM"> 12:30 AM</option> <option value="12:30 AM"> 12:30 AM</option>
@ -648,7 +492,7 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="machineOffTimeHrId">Machine Off Time</label> <label for="machineOffTimeHrId">Machine Off Time</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<select class="form-control" name="machineOffTime" id="machineOffTimeHrId" required> <select class="form-control select2" name="machineOffTime" id="machineOffTimeHrId" required>
<option value="">Select Time</option> <option value="">Select Time</option>
<option value="12:00 AM"> 12:00 AM</option> <option value="12:00 AM"> 12:00 AM</option>
<option value="12:30 AM"> 12:30 AM</option> <option value="12:30 AM"> 12:30 AM</option>
@ -832,7 +676,7 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="editMachineOnTimeHrId">Machine On Time</label> <label for="editMachineOnTimeHrId">Machine On Time</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<select class="form-control" name="machineOnTime" id="editMachineOnTimeHrId" required> <select class="form-control select2" name="machineOnTime" id="editMachineOnTimeHrId" required>
<option value="">Select Time</option> <option value="">Select Time</option>
<option value="12:00 AM">12:00 AM</option> <option value="12:00 AM">12:00 AM</option>
<option value="12:30 AM">12:30 AM</option> <option value="12:30 AM">12:30 AM</option>
@ -869,7 +713,7 @@
<div class="form-group col-md-3"> <div class="form-group col-md-3">
<label for="editMachineOffTimeHrId">Machine Off Time</label> <label for="editMachineOffTimeHrId">Machine Off Time</label>
<span class="badge mandatory">*</span> <span class="badge mandatory">*</span>
<select class="form-control" name="machineOffTime" id="editMachineOffTimeHrId" required> <select class="form-control select2" name="machineOffTime" id="editMachineOffTimeHrId" required>
<option value="">Select Time</option> <option value="">Select Time</option>
<option value="12:00 AM">12:00 AM</option> <option value="12:00 AM">12:00 AM</option>
<option value="12:30 AM">12:30 AM</option> <option value="12:30 AM">12:30 AM</option>
@ -1010,6 +854,258 @@
</div> </div>
</div> </div>
<!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<?php
$currentDateInDmY = date('d-m-Y');
?>
<?php
$startDate = DateTime::createFromFormat('M-Y', $month);
if ($startDate) {
$startDate->modify('first day of this month');
$daysInMonth = $startDate->format('t');
$dateArray = [];
for ($i = 0; $i < $daysInMonth; $i++) {
$dateArray[] = $startDate->format('d-m-Y');
$startDate->modify('+1 day');
}
} else {
echo "Invalid date format.";
}
?>
<!-- From Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="fromDateFilter">Select From Date</label>
<select id="fromDateFilter" name="fromDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $index => $date) : ?>
<option value="<?= $date ?>"><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<!-- To Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="toDateFilter">Select Date</label>
<select id="toDateFilter" name="toDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $date) : ?>
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ? "selected" : " " ?>><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<button type="button" class="btn btn-primary float-right" onclick="customFilterDate(event)">Filter</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<div class="table-responsive" id="table-responsive">
<table id="coatingMachineDetailTableId" class="fht-table table-responsiv"
style="background-color:#fff;">
<thead>
<tr>
<th class="celda_encabezado_general">Date</th>
<th class="celda_encabezado_general">Shift</th>
<th class="celda_encabezado_general">Machine On Time</th>
<th class="celda_encabezado_general">Machine Off Time</th>
<th class="celda_encabezado_general">Machine Running(hr)</th>
<th class="celda_encabezado_general">Customer Name</th>
<th class="celda_encabezado_general">Grade</th>
<th class="celda_encabezado_general">Total Coating</th>
<th class="celda_encabezado_general">Total Coating Sand(kg)</th>
<th class="celda_encabezado_general">Total Gas Consumption</th>
<th class="celda_encabezado_general">Hour Gas</th>
<th class="celda_encabezado_general">Hour QTY(kg)</th>
<th class="celda_encabezado_general">Action</th>
</tr>
</thead>
<tbody>
<?php
if (!empty($coatingMachineDetails)) {
$summary = [];
foreach ($coatingMachineDetails as $record) {
$batchCardFiles = json_decode($record['batchcard_files'], true);
?>
<tr data-id="<?php echo $record['id']; ?>"
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<?php
$date = DateTime::createFromFormat('Y-m-d', $record['date'])->format('d-m-Y');
?>
<!-- td:eq(0) -->
<td class="celda_normal"><?php echo $date ?></td>
<!-- td:eq(1) -->
<td class="celda_normal"><?php echo $record['shift'] ?></td>
<!-- td:eq(2) -->
<td class="celda_normal"><?php echo $record['machineOnTime'] ?></td>
<!-- td:eq(3) -->
<td class="celda_normal"><?php echo $record['machineOffTime'] ?></td>
<!-- td:eq(4) -->
<td class="celda_normal"><?php echo $record['machineRunningInHrs'] ?? ' ' ?></td>
<!-- td:eq(5) -->
<td class="celda_normal"><?php echo $record['customerName'] ?? '' ?></td>
<!-- td:eq(6) -->
<td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
<!-- td:eq(7) -->
<td class="celda_normal"><?php echo $record['totalCoating'] ?></td>
<!-- td:eq(8) -->
<td class="celda_normal"><?php echo $record['totalCoatingSandInKg'] ?></td>
<!-- td:eq(9) -->
<td class="celda_normal"><?php echo $record['totalGasConsumption'] ?></td>
<!-- td:eq(10) -->
<td class="celda_normal"><?php echo $record['perHourGasConsumption'] ?? '' ?></td>
<!-- td:eq(11) -->
<td class="celda_normal"><?php echo $record['perHourCoatingSandQTY'] ?? '' ?></td>
<!-- td:eq(12) -->
<!-- edit and download option..!! -->
<td class="celda_normal">
<a data-toggle="tooltip" class="edit-btn"
data-target="editCoatingMachineDetailModal" data-toggle="modal"
style="cursor:pointer;">
<i class="fa fa-edit"
title="Click here to Edit ">
</i>
&nbsp;&nbsp;&nbsp;
</a>
<?php
foreach ($batchCardFiles as $index => $files) {
if ($index === 0 && !empty($files['batchCardId']) && $files['coating_id'] == $record['id']) {
?>
<a href="<?= base_url('download-batchcard-zip?coating_id=' . $record['id'] . '&date=' . $date); ?>"
data-toggle="tooltip" title="Download Batch Card">
<i class="fa fa-download"></i>
</a>
<?php
break;
}
}
?>
</td>
<!-- td:eq(13) -->
<td style="display:none;"><?php echo $record['batchcard_files'] ?? ' ' ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['totalCoating'])) {
$summary['totalMachineRunningHrs'] = 0;
$summary['totalCoating'] = 0;
$summary['totalCoatingSandInKg'] = 0;
$summary['totalGasConsumption'] = 0;
$summary['perHourGasConsumption'] = 0;
$summary['perHourCoatingSandQTY'] = 0;
}
$summary['totalMachineRunningHrs'] += $record['machineRunningInHrs'] == "-" ? 0 : (float) $record['machineRunningInHrs'];
$summary['totalCoating'] += $record['totalCoating'] == "-" ? 0 : (float) $record['totalCoating'];
$summary['totalCoatingSandInKg'] += $record['totalCoatingSandInKg'] == "-" ? 0 : (float) $record['totalCoatingSandInKg'];
$summary['totalGasConsumption'] += $record['totalGasConsumption'] == "-" ? 0 : (float) $record['totalGasConsumption'];
$summary['perHourGasConsumption'] += $record['perHourGasConsumption'] == "-" ? 0 : (float) $record['perHourGasConsumption'];
$summary['perHourCoatingSandQTY'] += $record['perHourCoatingSandQTY'] == "-" ? 0 : (float) $record['perHourCoatingSandQTY'];
} ?>
<tfoot>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> <?= $summary['totalMachineRunningHrs'] ?></td>
<td class="celda_normal "> - </td>
<td class="celda_normal "> - </td>
<td class="celda_normal "><?= $summary['totalCoating'] ?></td>
<td class="celda_normal "><?= $summary['totalCoatingSandInKg'] ?></td>
<td class="celda_normal "><?= $summary['totalGasConsumption'] ?></td>
<td class="celda_normal "><?= number_format($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs'], 2) ?> (avg)</td>
<td class="celda_normal "><?= number_format($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs'], 2) ?> (avg)</td>
</tr>
</tfoot>
</div>
<?php
}
?>
</tbody>
</table>
</div>
<br>
<?php if (empty($coatingMachineDetails)) { ?>
<h5 align="center" style="color:grey;">
No Coating Machine Details present in this month
</h5>
<?php } ?>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<!-- productionBatchCardModal --> <!-- productionBatchCardModal -->
<div class="modal fade" id="productionBatchCardDetailModalId" tabindex="-1" role="dialog" <div class="modal fade" id="productionBatchCardDetailModalId" tabindex="-1" role="dialog"
@ -1156,78 +1252,6 @@
<!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<?php
$currentDateInDmY = date('d-m-Y');
?>
<?php
$startDate = DateTime::createFromFormat('M-Y', $month);
if ($startDate) {
$startDate->modify('first day of this month');
$daysInMonth = $startDate->format('t');
$dateArray = [];
for ($i = 0; $i < $daysInMonth; $i++) {
$dateArray[] = $startDate->format('d-m-Y');
$startDate->modify('+1 day');
}
} else {
echo "Invalid date format.";
}
?>
<!-- From Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="fromDateFilter">Select From Date</label>
<select id="fromDateFilter" name="fromDateFilter" class="form-control">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $index => $date) : ?>
<option value="<?= $date ?>" ><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<!-- To Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="toDateFilter">Select Date</label>
<select id="toDateFilter" name="toDateFilter" class="form-control">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $date) : ?>
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ?"selected" :" " ?> ><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
@ -1357,13 +1381,11 @@
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#editCoatingMachineDetailModal').on('hidden.bs.modal', function() { $('#editCoatingMachineDetailModal').on('hidden.bs.modal', function() {
$('.batch-container').remove(); // This will remove all child elements $('.batch-container').remove(); // This will remove all child elements
}); });
}); });
</script> </script>
<!-- calculations for some fields needed in onChange while adding coating machine details --> <!-- calculations for some fields needed in onChange while adding coating machine details -->
@ -1606,21 +1628,28 @@
<script> <script>
$('#monthpicker').change(function(){ $(document).on('change', '#month', function() {
$('#changeMonthForm').submit(); $('#changeMonthForm').submit();
}) });
$('#monthpicker').datepicker({ $(document).ready(function(){
$('#month').datepicker({
format: 'M-yyyy', format: 'M-yyyy',
viewMode: 'months', viewMode: 'months',
minViewMode: 'months', minViewMode: 'months',
autoclose: true, autoclose: true,
orientation: 'bottom' orientation: 'bottom'
}) })
})
</script> </script>
<script> <script>
function customFilterDate(){ function customFilterDate(event) {
event.preventDefault();
let fromDate = $('#fromDateFilter').val(); //01-12-2024 let fromDate = $('#fromDateFilter').val(); //01-12-2024
let toDate = $('#toDateFilter').val(); //05-12-2024 let toDate = $('#toDateFilter').val(); //05-12-2024
@ -1659,13 +1688,11 @@
let parts = dateString.split('-'); let parts = dateString.split('-');
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
let table = document.getElementById(tableID); let table = document.getElementById(tableID);
@ -1706,14 +1733,9 @@ $(document).ready(function () {
}); });
}); });
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('#batchCardAddBtnId').click(function() { $('#batchCardAddBtnId').click(function() {
@ -1766,7 +1788,9 @@ $(document).ready(function () {
$.ajax({ $.ajax({
url: "<?php echo base_url(); ?>/deleteBatchCardFile", url: "<?php echo base_url(); ?>/deleteBatchCardFile",
type: "POST", type: "POST",
data: { id: batchId }, data: {
id: batchId
},
success: function(response) { success: function(response) {
if (response.status == "200") { if (response.status == "200") {
alert("Batch File Deleted Successfully!"); alert("Batch File Deleted Successfully!");
@ -1786,7 +1810,6 @@ $(document).ready(function () {
}); });
}); });
</script> </script>
<!-- onchange of month submit will happen --> <!-- onchange of month submit will happen -->
@ -1825,10 +1848,67 @@ $(document).ready(function () {
$("#searchInput").on("keyup", function() { $("#searchInput").on("keyup", function() {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$(".table-responsive tbody tr").filter(function () { $("#table-responsive tbody tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#filterModalId,').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#coatingMachineDetailModal').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#editCoatingMachineDetailModal').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script> </script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#filterModalId, #coatingMachineDetailModal, #editCoatingMachineDetailModal').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script>

View File

@ -14,11 +14,13 @@
} }
.grab { .grab {
cursor: grab; /* Default open-hand cursor */ cursor: grab;
/* Default open-hand cursor */
} }
.grab:active { .grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */ cursor: grabbing;
/* Closed-hand cursor when dragging */
} }
.fht-table td { .fht-table td {
@ -28,8 +30,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -187,8 +191,10 @@
.fht-table thead { .fht-table thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */ z-index: 20;
background-color: #50bbd9; /* Header background color */ /* Ensure the entire header stays above table rows */
background-color: #50bbd9;
/* Header background color */
} }
.dropdown-menu { .dropdown-menu {
@ -201,14 +207,19 @@
.fht-table thead th { .fht-table thead th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 11; /* Higher than table rows but lower than first column */ z-index: 11;
background-color: #50bbd9; /* Green background */ /* Higher than table rows but lower than first column */
background-color: #50bbd9;
/* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 10px; padding: 10px;
white-space: normal; /* Allows text to wrap */ white-space: normal;
word-wrap: break-word; /* Breaks long words if needed */ /* Allows text to wrap */
text-align: center; /* Centers text for better alignment */ word-wrap: break-word;
/* Breaks long words if needed */
text-align: center;
/* Centers text for better alignment */
} }
/* Sticky First Column */ /* Sticky First Column */
@ -217,7 +228,8 @@
position: sticky; position: sticky;
left: 0; left: 0;
background-color: #50bbd9; background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */ z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
@ -251,15 +263,15 @@
body[data-layout-mode=horizontal] .container-fluid { body[data-layout-mode=horizontal] .container-fluid {
max-width: 100%; max-width: 100%;
} }
.card-body { .card-body {
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.card{ margin-bottom: 5px;}
.card {
margin-bottom: 5px;
}
</style> </style>
@ -317,51 +329,7 @@
<div class="col-12"> <div class="col-12">
<div class="card" id="fullscreenDiv"> <div class="card" id="fullscreenDiv">
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" >
<div class="modal-content" >
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="bagDropdown">Select Bag</label>
<select id="bagDropdown" class="form-control select2">
<option value="">Select Bag</option>
<?php foreach($bagMaterials as $bagMaterial): ?>
<option value=" <?= $bagMaterial['MaterialName']?>">
<?= $bagMaterial['MaterialName']?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach($datesInMonth as $selectDate): ?>
<?php $selectDate=DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?=$selectDate?>"><?=$selectDate?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToBag()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="card-body"> <div class="card-body">
@ -456,7 +424,7 @@
<div class="col"> <div class="col">
<div class="form-group"> <div class="form-group">
<label for="customizeHeader"> Add For This Month </label> <label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()"> <select id="customizeHeader" class="form-control select2" onchange="addBackToList()">
<option value="">Select</option> <option value="">Select</option>
<?php <?php
foreach ($activeBagMaterials as $index => $activeBagMaterial) { ?> foreach ($activeBagMaterials as $index => $activeBagMaterial) { ?>
@ -516,6 +484,59 @@
</form> </form>
<!-- modal placed here for Navigation option inside full screen -->
<!---------------------------------------
this modal is used to navigate to particular material/machine section
1)choose which material/machines you want
2)choose Date
------------------------------------------------------------>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="bagDropdown">Select Bag</label>
<select id="bagDropdown" class="form-control select2">
<option value="">Select Bag</option>
<?php foreach ($bagMaterials as $bagMaterial): ?>
<option value=" <?= $bagMaterial['MaterialName'] ?>">
<?= $bagMaterial['MaterialName'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToBag()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
@ -571,8 +592,7 @@
<tbody style="background-color: #fff;"> <tbody style="background-color: #fff;">
<?php if(!empty($groupedBagStockDetails)) <?php if (!empty($groupedBagStockDetails)) {
{
$summary = []; $summary = [];
@ -585,9 +605,10 @@
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $bagStockDetails[0]['date'])->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $bagStockDetails[0]['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} if ($dateInMonthDmYFormat === $currentDate) {
?> echo 'style="background: #cef0ad;"';
> }
?>>
<?php foreach ($bagStockDetails as $bagStockIndex => $bagStock) { ?> <?php foreach ($bagStockDetails as $bagStockIndex => $bagStock) { ?>
<?php if ($bagStockIndex == 0): ?> <?php if ($bagStockIndex == 0): ?>
<?php <?php
@ -619,25 +640,20 @@
<?php if ($groupedBagStockDetailsIndex == 0): ?> <?php if ($groupedBagStockDetailsIndex == 0): ?>
oninput="openingStockChange(this)" oninput="openingStockChange(this)"
contenteditable="true" contenteditable="true"
<?php endif; ?> <?php endif; ?>><?= $bagStock['opening'] ?? " " ?>
><?= $bagStock['opening'] ?? " " ?>
</td> </td>
<td class="celda_normal receiptStock" <td class="celda_normal receiptStock"
data-id="<?= $bagStock['date'] ?> <?= $bagStock['materialCode'] ?>" data-id="<?= $bagStock['date'] ?> <?= $bagStock['materialCode'] ?>"
oninput="receiptStockChange(this)" oninput="receiptStockChange(this)"
contenteditable="true" contenteditable="true">
>
<?= $bagStock['receipt'] ?? " " ?> <?= $bagStock['receipt'] ?? " " ?>
</td> </td>
<td class="celda_normal usedStock" <td class="celda_normal usedStock"
data-id="<?= $bagStock['date'] ?> <?= $bagStock['materialCode'] ?>" data-id="<?= $bagStock['date'] ?> <?= $bagStock['materialCode'] ?>"
oninput="usedStockChange(this)" oninput="usedStockChange(this)"
contenteditable="true" contenteditable="true">
>
<?= $bagStock['used'] ?? " " ?> <?= $bagStock['used'] ?? " " ?>
</td> </td>
@ -669,8 +685,6 @@
$summary[$materialCode]['receipt'] += is_numeric($bagStock['receipt']) ? $bagStock['receipt'] : 0; $summary[$materialCode]['receipt'] += is_numeric($bagStock['receipt']) ? $bagStock['receipt'] : 0;
$summary[$materialCode]['used'] += is_numeric($bagStock['used']) ? $bagStock['used'] : 0; $summary[$materialCode]['used'] += is_numeric($bagStock['used']) ? $bagStock['used'] : 0;
$summary[$materialCode]['balanceStock'] = is_numeric($bagStock['balanceStock']) ? $bagStock['balanceStock'] : 0; $summary[$materialCode]['balanceStock'] = is_numeric($bagStock['balanceStock']) ? $bagStock['balanceStock'] : 0;
} ?> } ?>
</tr> </tr>
@ -702,7 +716,8 @@
with initial values 0 for entire month --> with initial values 0 for entire month -->
<?php } else { <?php } else {
// dd($bagMaterials); // dd($bagMaterials);
// dd($previousMonthBagStockDetails); ?> // dd($previousMonthBagStockDetails);
?>
<?php foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { ?> <?php foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { ?>
<tr <tr
@ -711,10 +726,11 @@
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y'); $dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dateInMonth)->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';} if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?> ?>>
>
<?php <?php
foreach ($bagMaterials as $bagMaterialIndex => $bagMaterial) { ?> foreach ($bagMaterials as $bagMaterialIndex => $bagMaterial) { ?>
<!-- this will loop till materials present --> <!-- this will loop till materials present -->
@ -750,18 +766,14 @@
oninput="openingStockChange(this)" oninput="openingStockChange(this)"
contenteditable="true" contenteditable="true"
<?php }?> <?php } ?>>
>
<?php <?php
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) foreach ($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) {
{
if ($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']) { if ($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']) {
echo $previousMonthBagStockDetail['balanceStock']; echo $previousMonthBagStockDetail['balanceStock'];
break; break;
} }
} }
?> ?>
@ -777,16 +789,13 @@
oninput="usedStockChange(this)" contenteditable="true"> <?= " " ?> </td> oninput="usedStockChange(this)" contenteditable="true"> <?= " " ?> </td>
<td class="celda_normal balanceStock" <td class="celda_normal balanceStock"
data-id="<?=$dateInMonth?> <?=$bagMaterial['MaterialCode']?>" data-id="<?= $dateInMonth ?> <?= $bagMaterial['MaterialCode'] ?>">
>
<?php <?php
foreach($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) foreach ($previousMonthBagStockDetails as $index => $previousMonthBagStockDetail) {
{
if ($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']) { if ($previousMonthBagStockDetail['materialCode'] == $bagMaterial['MaterialCode']) {
echo $previousMonthBagStockDetail['balanceStock']; echo $previousMonthBagStockDetail['balanceStock'];
break; break;
} }
} }
?> ?>
</td> </td>
@ -813,56 +822,6 @@
<div >
<!-- <div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md" >
<div class="modal-content" >
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="bagDropdown">Select Bag</label>
<select id="bagDropdown" class="form-control select2">
<option value="">Select Bag</option>
<?php foreach($bagMaterials as $bagMaterial): ?>
<option value=" <?= $bagMaterial['MaterialName']?>">
<?= $bagMaterial['MaterialName']?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach($datesInMonth as $selectDate): ?>
<?php $selectDate=DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?=$selectDate?>"><?=$selectDate?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToBag()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>/.modal -->
</div>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.select2').select2(); $('.select2').select2();
@ -941,14 +900,11 @@
} }
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#saveId').click(function() { $('#saveId').click(function() {
@ -993,7 +949,6 @@
}); });
}); });
</script> </script>
<script> <script>
@ -1028,11 +983,9 @@
return JSON.stringify(rows, null, 2); return JSON.stringify(rows, null, 2);
} }
</script> </script>
<script> <script>
function openingStockChange(tdElement) { function openingStockChange(tdElement) {
try { try {
@ -1119,7 +1072,6 @@
</script> </script>
<script> <script>
function updateStockValue(date, materialCode, currentBalanceStock) { function updateStockValue(date, materialCode, currentBalanceStock) {
const table = $('#bagStockDetailsTableId'); const table = $('#bagStockDetailsTableId');
@ -1182,16 +1134,11 @@
return input; return input;
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
@ -1246,9 +1193,6 @@
}) })
</script> </script>
<script> <script>
@ -1286,7 +1230,6 @@
} }
} }
}); });
</script> </script>
@ -1329,10 +1272,14 @@
const box = child.getBoundingClientRect(); const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2; const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset return offset < 0 && offset > closest.offset ? {
? { offset, element: child } offset,
: closest; element: child
}, { offset: Number.NEGATIVE_INFINITY }).element; } :
closest;
}, {
offset: Number.NEGATIVE_INFINITY
}).element;
} }
// Attach drag events to existing items // Attach drag events to existing items
@ -1371,7 +1318,6 @@
} }
}; };
}); });
</script> </script>
<script> <script>
@ -1395,7 +1341,6 @@ $(document).ready(function () {
$(document).ready(function() { $(document).ready(function() {
$('#customizeHeader').select2(); $('#customizeHeader').select2();
}) })
</script> </script>
<script> <script>
@ -1415,15 +1360,10 @@ $(document).ready(function () {
tableResponsive.style.maxHeight = "90vh"; tableResponsive.style.maxHeight = "90vh";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
} }
// Delay Select2 reinitialization
setTimeout(() => {
$('.select2').select2();
}, 1000);
}).catch(err => console.log("Error enabling fullscreen:", err)); }).catch(err => console.log("Error enabling fullscreen:", err));
} else { } else {
document.exitFullscreen().then(() => { document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen // Reset .table-responsive height when exiting fullscreen
if (tableResponsive) { if (tableResponsive) {
@ -1444,6 +1384,49 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown
$('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script> </script>

View File

@ -5,11 +5,13 @@
.grab { .grab {
cursor: grab; /* Default open-hand cursor */ cursor: grab;
/* Default open-hand cursor */
} }
.grab:active { .grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */ cursor: grabbing;
/* Closed-hand cursor when dragging */
} }
.fht-table, .fht-table,
@ -29,8 +31,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -188,8 +192,10 @@
.fht-table thead { .fht-table thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */ z-index: 20;
background-color: #50bbd9; /* Header background color */ /* Ensure the entire header stays above table rows */
background-color: #50bbd9;
/* Header background color */
} }
.dropdown-menu { .dropdown-menu {
@ -202,8 +208,10 @@
.fht-table thead th { .fht-table thead th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 11; /* Higher than table rows but lower than first column */ z-index: 11;
background-color: #50bbd9; /* Green background */ /* Higher than table rows but lower than first column */
background-color: #50bbd9;
/* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 10px; padding: 10px;
@ -215,7 +223,8 @@
position: sticky; position: sticky;
left: 0; left: 0;
background-color: #50bbd9; background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */ z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
@ -242,16 +251,15 @@
body[data-layout-mode=horizontal] .container-fluid { body[data-layout-mode=horizontal] .container-fluid {
max-width: 100%; max-width: 100%;
} }
.card-body { .card-body {
padding-top: 0; padding-top: 0;
padding-bottom: 0; padding-bottom: 0;
} }
.card{ margin-bottom: 5px;}
.card {
margin-bottom: 5px;
}
</style> </style>
@ -466,6 +474,54 @@ foreach ($period as $day) {
</form> </form>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dieselDropdown">Select Machine</label>
<select id="dieselDropdown" class="form-control select2">
<option value="">Select Diesel</option>
<?php foreach ($dieselMachines as $dieselMachine): ?>
<option value=" <?= $dieselMachine['machine_name'] ?>">
<?= $dieselMachine['machine_name'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToDiesel()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
@ -554,9 +610,7 @@ foreach ($period as $day) {
<?php if ($groupedDieselMachineStockDetailsIndex == 0): ?> <?php if ($groupedDieselMachineStockDetailsIndex == 0): ?>
oninput="openingTDStockChange(this)" oninput="openingTDStockChange(this)"
contenteditable="true" contenteditable="true"
<?php endif; ?> <?php endif; ?>><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td>
><?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['opening_stock'] ?? ' ' ?></td>
<td class="celda_normal purchaseTD" <td class="celda_normal purchaseTD"
@ -577,8 +631,7 @@ foreach ($period as $day) {
</td> </td>
<td class="celda_normal balanceTD" <td class="celda_normal balanceTD"
data-id="<?=$totalDiesel[$groupedDieselMachineStockDetailsIndex]['date']?>" data-id="<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['date'] ?>">
>
<?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?> <?= $totalDiesel[$groupedDieselMachineStockDetailsIndex]['balance_stock'] ?? ' ' ?>
@ -661,8 +714,7 @@ foreach ($period as $day) {
</td> </td>
<td class="celda_normal runningHours" <td class="celda_normal runningHours"
data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>" data-id="<?= $dieselStock['date'] ?> <?= $dieselStock['machine_id'] ?>">
>
<?= $dieselStock['running_hours'] ?? " " ?> <?= $dieselStock['running_hours'] ?? " " ?>
@ -707,19 +759,12 @@ foreach ($period as $day) {
$summary["machineId_$machineId"]['consumption'] / $summary["machineId_$machineId"]['running_hours'], $summary["machineId_$machineId"]['consumption'] / $summary["machineId_$machineId"]['running_hours'],
2 2
); );
} else { } else {
$dieselMileage = 0; $dieselMileage = 0;
} }
$summary["machineId_$machineId"]['mileage'] = is_numeric($dieselMileage) ? $dieselMileage : 0; $summary["machineId_$machineId"]['mileage'] = is_numeric($dieselMileage) ? $dieselMileage : 0;
} ?> } ?>
</tr> </tr>
@ -799,9 +844,7 @@ foreach ($period as $day) {
oninput="openingTDStockChange(this)" oninput="openingTDStockChange(this)"
contenteditable="true" contenteditable="true"
<?php } ?> <?php } ?>><?= !empty($previousMonthTotalDieselMachineStockDetails)
><?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock'] ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " "; : " ";
?></td> ?></td>
@ -818,9 +861,7 @@ foreach ($period as $day) {
data-id="<?= $dateInMonth ?>"> </td> data-id="<?= $dateInMonth ?>"> </td>
<td class="celda_normal balanceTD" <td class="celda_normal balanceTD"
data-id="<?= $dateInMonth ?>" data-id="<?= $dateInMonth ?>"><?= !empty($previousMonthTotalDieselMachineStockDetails)
><?= !empty($previousMonthTotalDieselMachineStockDetails)
? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock'] ? $previousMonthTotalDieselMachineStockDetails[0]['balance_stock']
: " "; : " ";
?> ?>
@ -853,20 +894,14 @@ foreach ($period as $day) {
oninput="openingReadingChange(this)" oninput="openingReadingChange(this)"
contenteditable="true" contenteditable="true"
<?php } ?> <?php } ?>>
>
<?php <?php
foreach($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail) foreach ($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail) {
{
if ($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']) { if ($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']) {
echo $previousMonthDieselMachineStockDetail['closing_reading']; echo $previousMonthDieselMachineStockDetail['closing_reading'];
break; break;
} }
} }
?> ?>
</td> </td>
@ -879,13 +914,11 @@ foreach ($period as $day) {
<?php <?php
foreach($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail) foreach ($previousMonthDieselMachineStockDetails as $index => $previousMonthDieselMachineStockDetail) {
{
if ($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']) { if ($previousMonthDieselMachineStockDetail['machine_id'] == $dieselMachine['id']) {
echo $previousMonthDieselMachineStockDetail['closing_reading']; echo $previousMonthDieselMachineStockDetail['closing_reading'];
break; break;
} }
} }
?> ?>
@ -928,56 +961,10 @@ foreach ($period as $day) {
</div> </div>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dieselDropdown">Select Machine</label>
<select id="dieselDropdown" class="form-control select2">
<option value="">Select Diesel</option>
<?php foreach ($dieselMachines as $dieselMachine): ?>
<option value=" <?= $dieselMachine['machine_name'] ?>">
<?= $dieselMachine['machine_name'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToDiesel()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<script> <script>
function navigateToDiesel() { function navigateToDiesel() {
@ -1158,9 +1145,6 @@ foreach ($period as $day) {
</script> </script>
<script> <script>
function openingReadingChange(tdElement) { function openingReadingChange(tdElement) {
try { try {
@ -1252,8 +1236,8 @@ foreach ($period as $day) {
machines.forEach((each) => { machines.forEach((each) => {
totalFillingDiesel += Number(document.querySelector(`td.fillingDiesel[data-id="${date} ${each.id}"]`).innerText totalFillingDiesel += Number(document.querySelector(`td.fillingDiesel[data-id="${date} ${each.id}"]`).innerText)
)}); });
document.querySelector(`td.fillingTD[data-id="${date}"]`).innerText = parseFloat(totalFillingDiesel).toFixed(2); document.querySelector(`td.fillingTD[data-id="${date}"]`).innerText = parseFloat(totalFillingDiesel).toFixed(2);
@ -1352,16 +1336,9 @@ foreach ($period as $day) {
return input; return input;
} }
</script> </script>
<script> <script>
function updateStockValue(date, machine_id, closingReading) { function updateStockValue(date, machine_id, closingReading) {
const table = $('#dieselStockDetailsTableId'); const table = $('#dieselStockDetailsTableId');
@ -1454,12 +1431,10 @@ foreach ($period as $day) {
}) })
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
@ -1512,9 +1487,6 @@ foreach ($period as $day) {
}) })
</script> </script>
<script> <script>
@ -1552,7 +1524,6 @@ foreach ($period as $day) {
} }
} }
}); });
</script> </script>
@ -1595,10 +1566,15 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect(); const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2; const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset return offset < 0 && offset > closest.offset ?
? { offset, element: child } {
: closest; offset,
}, { offset: Number.NEGATIVE_INFINITY }).element; element: child
} :
closest;
}, {
offset: Number.NEGATIVE_INFINITY
}).element;
} }
// Attach drag events to existing items // Attach drag events to existing items
@ -1637,7 +1613,6 @@ foreach ($period as $day) {
} }
}; };
}); });
</script> </script>
<script> <script>
@ -1645,7 +1620,6 @@ foreach ($period as $day) {
$('#customizeHeader').select2(); $('#customizeHeader').select2();
$('.select2').select2(); $('.select2').select2();
}) })
</script> </script>
<script> <script>
@ -1700,6 +1674,53 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,13 @@
} }
.grab { .grab {
cursor: grab; /* Default open-hand cursor */ cursor: grab;
/* Default open-hand cursor */
} }
.grab:active { .grab:active {
cursor: grabbing; /* Closed-hand cursor when dragging */ cursor: grabbing;
/* Closed-hand cursor when dragging */
} }
/* .fht-table td[contenteditable="true"] { /* .fht-table td[contenteditable="true"] {
@ -33,8 +35,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -239,20 +243,36 @@
} }
/* Adjust heights based on screen zoom */ /* Adjust heights based on screen zoom */
@media only screen and (min-height: 1400px) { /* Approximate Zoom < 100% */ @media only screen and (min-height: 1400px) {
.table-responsive { max-height: 425px; }
/* Approximate Zoom < 100% */
.table-responsive {
max-height: 425px;
}
} }
@media only screen and (min-height: 1200px) { /* Approximate Zoom ~ 90% */ @media only screen and (min-height: 1200px) {
.table-responsive { max-height: 500px; }
/* Approximate Zoom ~ 90% */
.table-responsive {
max-height: 500px;
}
} }
@media only screen and (min-height: 1000px) { /* Approximate Zoom ~ 80% */ @media only screen and (min-height: 1000px) {
.table-responsive { max-height: 600px; }
/* Approximate Zoom ~ 80% */
.table-responsive {
max-height: 600px;
}
} }
@media only screen and (min-height: 800px) { /* Approximate Zoom ~ 75% */ @media only screen and (min-height: 800px) {
.table-responsive { max-height: 650px; }
/* Approximate Zoom ~ 75% */
.table-responsive {
max-height: 650px;
}
} }
td { td {
@ -274,10 +294,9 @@
padding-bottom: 0; padding-bottom: 0;
} }
.card{ margin-bottom: 5px;} .card {
margin-bottom: 5px;
}
</style> </style>
@ -308,13 +327,13 @@
<div class="row" align="center"> <div class="row" >
<div class="col-12"> <div class="col-12">
<div class="card" id="fullscreenDiv"> <div class="card" id="fullscreenDiv">
<div class="card-body"> <div class="card-body">
<form id="changeMonthForm" action="<?= base_url('dustAndRoughStockDetails'); ?>" method="post"> <form align="center" id="changeMonthForm" action="<?= base_url('dustAndRoughStockDetails'); ?>" method="post">
<div class="row"> <div class="row">
@ -368,8 +387,7 @@
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer;"
id="saveId" id="saveId">
>
</i> </i>
@ -382,177 +400,6 @@
</div> </div>
</form> </form>
<div class="table-responsive" id="table-responsive">
<table style="width: 700px;" id="dustAndRoughStockDetailsTableId" class="fht-table ">
<thead class="celda_encabezado_general" style="padding: 10px;">
<tr>
<th
style="width: 100px;"
class="celda_encabezado_general" rowspan="2" colspan="1">Date </th>
<th class="celda_encabezado_general" colspan="1">Final Rough </th>
<th class="celda_encabezado_general" colspan="1">Dust </th>
<th class="celda_encabezado_general" rowspan="2" colspan="1">Total </th>
</tr>
<tr>
<th class="celda_encabezado_general" colspan="1">+16 Mesh </th>
<th class="celda_encabezado_general" colspan="1">10 Ton Dryer </th>
</tr>
</thead>
<tbody style="background-color: #fff;" >
<?php
if(!empty($dustAndRoughStockDetails)){
$summary = [] ;
foreach($dustAndRoughStockDetails as $dustAndRoughStockDetailsIndex => $dustAndRoughStockDetail){
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat=DateTime::createFromFormat('Y-m-d', $dustAndRoughStockDetail['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';}
?>
>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dustAndRoughStockDetail['date']));
?>
</td>
<td class="celda_normal finalRough"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"
oninput="finalRoughStockChange(this)"
contenteditable="true"
><?= $dustAndRoughStockDetail['finalRough'] ?? ' ' ?></td>
<td class="celda_normal dust"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"
oninput="dustStockChange(this)"
contenteditable="true"
><?= $dustAndRoughStockDetail['dust'] ?? ' ' ?></td>
<td class="celda_normal total"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"
><?= $dustAndRoughStockDetail['total'] ?? ' ' ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['finalRough'])) {
$summary['finalRough'] = 0 ;
$summary['dust'] = 0 ;
$summary['total'] = 0 ;
}
$summary['finalRough'] += $dustAndRoughStockDetail['finalRough'] == "-" ? 0 : (float) $dustAndRoughStockDetail['finalRough'] ;
$summary['dust'] += $dustAndRoughStockDetail['dust'] == "-" ? 0 : (float) $dustAndRoughStockDetail['dust'] ;
$summary['total'] += $dustAndRoughStockDetail['total'] == "-" ? 0 : (float) $dustAndRoughStockDetail['total'] ;
} ?>
<tfoot>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
<td class="celda_normal "> <b> <?=$summary['finalRough']?> </b> </td>
<td class="celda_normal "> <b> <?=$summary['dust']?> </b> </td>
<td class="celda_normal "> <b> <?=$summary['total']?> </b> </td>
</tr>
</tfoot>
<?php }else{
$date = DateTime::createFromFormat('M-Y', $month);
$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 = [];
$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($datesInMonth as $datesInMonthIndex => $dateInMonth){
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat=date("d-m-Y", strtotime($dateInMonth));
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';}
?>
>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dateInMonth));
?>
</td>
<td class="celda_normal finalRough"
data-id="<?= $dateInMonth ?>"
oninput="finalRoughStockChange(this)"
contenteditable="true"
><?= ' ' ?></td>
<td class="celda_normal dust"
data-id="<?= $dateInMonth ?>"
oninput="dustStockChange(this)"
contenteditable="true"
><?= ' ' ?></td>
<td class="celda_normal total"
data-id="<?= $dateInMonth ?>"
><?= ' ' ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div> <!-- End card-body -->
</div> <!-- End card -->
</div> <!-- End col -->
</div> <!-- End row -->
</div>
</div> <!-- End container-fluid -->
</div>
</div>
<!-- modal section -->
<!-- filter modal --> <!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true"> <div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md"> <div class="modal-dialog modal-md">
@ -630,6 +477,174 @@
<!-- end modal section --> <!-- end modal section -->
<div class="table-responsive" id="table-responsive" align="center">
<table style="width: 700px;" id="dustAndRoughStockDetailsTableId" class="fht-table ">
<thead class="celda_encabezado_general" style="padding: 10px;">
<tr>
<th
style="width: 100px;"
class="celda_encabezado_general" rowspan="2" colspan="1">Date </th>
<th class="celda_encabezado_general" colspan="1">Final Rough </th>
<th class="celda_encabezado_general" colspan="1">Dust </th>
<th class="celda_encabezado_general" rowspan="2" colspan="1">Total </th>
</tr>
<tr>
<th class="celda_encabezado_general" colspan="1">+16 Mesh </th>
<th class="celda_encabezado_general" colspan="1">10 Ton Dryer </th>
</tr>
</thead>
<tbody style="background-color: #fff;">
<?php
if (!empty($dustAndRoughStockDetails)) {
$summary = [];
foreach ($dustAndRoughStockDetails as $dustAndRoughStockDetailsIndex => $dustAndRoughStockDetail) {
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $dustAndRoughStockDetail['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dustAndRoughStockDetail['date']));
?>
</td>
<td class="celda_normal finalRough"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"
oninput="finalRoughStockChange(this)"
contenteditable="true"><?= $dustAndRoughStockDetail['finalRough'] ?? ' ' ?></td>
<td class="celda_normal dust"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"
oninput="dustStockChange(this)"
contenteditable="true"><?= $dustAndRoughStockDetail['dust'] ?? ' ' ?></td>
<td class="celda_normal total"
data-id="<?= $dustAndRoughStockDetail['date'] ?>"><?= $dustAndRoughStockDetail['total'] ?? ' ' ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['finalRough'])) {
$summary['finalRough'] = 0;
$summary['dust'] = 0;
$summary['total'] = 0;
}
$summary['finalRough'] += $dustAndRoughStockDetail['finalRough'] == "-" ? 0 : (float) $dustAndRoughStockDetail['finalRough'];
$summary['dust'] += $dustAndRoughStockDetail['dust'] == "-" ? 0 : (float) $dustAndRoughStockDetail['dust'];
$summary['total'] += $dustAndRoughStockDetail['total'] == "-" ? 0 : (float) $dustAndRoughStockDetail['total'];
} ?>
<tfoot>
<tr>
<td style="background-color:rgb(189, 9, 6); color:#ffff;"> Total </td>
<td class="celda_normal "> <b> <?= $summary['finalRough'] ?> </b> </td>
<td class="celda_normal "> <b> <?= $summary['dust'] ?> </b> </td>
<td class="celda_normal "> <b> <?= $summary['total'] ?> </b> </td>
</tr>
</tfoot>
<?php } else {
$date = DateTime::createFromFormat('M-Y', $month);
$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 = [];
$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 ($datesInMonth as $datesInMonthIndex => $dateInMonth) {
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = date("d-m-Y", strtotime($dateInMonth));
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dateInMonth));
?>
</td>
<td class="celda_normal finalRough"
data-id="<?= $dateInMonth ?>"
oninput="finalRoughStockChange(this)"
contenteditable="true"><?= ' ' ?></td>
<td class="celda_normal dust"
data-id="<?= $dateInMonth ?>"
oninput="dustStockChange(this)"
contenteditable="true"><?= ' ' ?></td>
<td class="celda_normal total"
data-id="<?= $dateInMonth ?>"><?= ' ' ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div> <!-- End card-body -->
</div> <!-- End card -->
</div> <!-- End col -->
</div> <!-- End row -->
</div>
</div> <!-- End container-fluid -->
</div>
</div>
<!-- modal section -->
<script> <script>
function customFilterDate() { function customFilterDate() {
@ -670,7 +685,6 @@
let parts = dateString.split('-'); let parts = dateString.split('-');
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
} }
</script> </script>
<script> <script>
@ -681,8 +695,6 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#saveId').click(function() { $('#saveId').click(function() {
@ -726,7 +738,6 @@
}); });
}); });
</script> </script>
<script> <script>
@ -757,11 +768,9 @@
return JSON.stringify(rows, null, 2); return JSON.stringify(rows, null, 2);
} }
</script> </script>
<script> <script>
function finalRoughStockChange(tdElement) { function finalRoughStockChange(tdElement) {
try { try {
@ -815,15 +824,10 @@
return input; return input;
} }
</script> </script>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
@ -880,9 +884,6 @@
}) })
</script> </script>
<script> <script>
@ -920,12 +921,10 @@
} }
} }
}); });
</script> </script>
<script> <script>
$('#month').change(function() { $('#month').change(function() {
$('#changeMonthForm').submit(); $('#changeMonthForm').submit();
}) })
@ -982,6 +981,45 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#filterModalId,').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#filterModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script> </script>

View File

@ -20,8 +20,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -179,8 +181,10 @@
.fht-table thead { .fht-table thead {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 20; /* Ensure the entire header stays above table rows */ z-index: 20;
background-color: #50bbd9; /* Header background color */ /* Ensure the entire header stays above table rows */
background-color: #50bbd9;
/* Header background color */
} }
.dropdown-menu { .dropdown-menu {
@ -193,8 +197,10 @@
.fht-table thead th { .fht-table thead th {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 11; /* Higher than table rows but lower than first column */ z-index: 11;
background-color: #50bbd9; /* Green background */ /* Higher than table rows but lower than first column */
background-color: #50bbd9;
/* Green background */
color: #ffffff; color: #ffffff;
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 10px; padding: 10px;
@ -206,7 +212,8 @@
position: sticky; position: sticky;
left: 0; left: 0;
background-color: #50bbd9; background-color: #50bbd9;
z-index: 15; /* Ensures it stays above other cells */ z-index: 15;
/* Ensures it stays above other cells */
border-right: 2px solid #ddd; border-right: 2px solid #ddd;
color: #ffffff; color: #ffffff;
} }
@ -221,20 +228,36 @@
} }
/* Adjust heights based on screen zoom */ /* Adjust heights based on screen zoom */
@media only screen and (min-height: 1400px) { /* Approximate Zoom < 100% */ @media only screen and (min-height: 1400px) {
.table-responsive { max-height: 425px; }
/* Approximate Zoom < 100% */
.table-responsive {
max-height: 425px;
}
} }
@media only screen and (min-height: 1200px) { /* Approximate Zoom ~ 90% */ @media only screen and (min-height: 1200px) {
.table-responsive { max-height: 500px; }
/* Approximate Zoom ~ 90% */
.table-responsive {
max-height: 500px;
}
} }
@media only screen and (min-height: 1000px) { /* Approximate Zoom ~ 80% */ @media only screen and (min-height: 1000px) {
.table-responsive { max-height: 600px; }
/* Approximate Zoom ~ 80% */
.table-responsive {
max-height: 600px;
}
} }
@media only screen and (min-height: 800px) { /* Approximate Zoom ~ 75% */ @media only screen and (min-height: 800px) {
.table-responsive { max-height: 650px; }
/* Approximate Zoom ~ 75% */
.table-responsive {
max-height: 650px;
}
} }
td { td {
@ -249,13 +272,14 @@
body[data-layout-mode=horizontal] .container-fluid { body[data-layout-mode=horizontal] .container-fluid {
max-width: 100%; max-width: 100%;
} }
.card-body{ padding-bottom: 0;}
.card{ margin-bottom: 5px;}
.card-body {
padding-bottom: 0;
}
.card {
margin-bottom: 5px;
}
</style> </style>
<div class="content-page"> <div class="content-page">
<div class="content"> <div class="content">
@ -339,8 +363,7 @@
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer;"
id="saveId" id="saveId">
>
</i> </i>
@ -352,15 +375,81 @@
</form> </form>
<!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<?php
$currentDateInDmY = date('d-m-Y');
?>
<?php
$startDate = DateTime::createFromFormat('M-Y', $month);
if ($startDate) {
$startDate->modify('first day of this month');
$daysInMonth = $startDate->format('t');
$dateArray = [];
for ($i = 0; $i < $daysInMonth; $i++) {
$dateArray[] = $startDate->format('d-m-Y');
$startDate->modify('+1 day');
}
} else {
echo "Invalid date format.";
}
?>
<!-- From Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="fromDateFilter">Select From Date</label>
<select id="fromDateFilter" name="fromDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $index => $date) : ?>
<option value="<?= $date ?>"><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<!-- To Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="toDateFilter">Select Date</label>
<select id="toDateFilter" name="toDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $date) : ?>
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ? "selected" : " " ?>><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- filter modal end -->
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
<table id="gasStockDetailsTableId" class="fht-table"> <table id="gasStockDetailsTableId" class="fht-table">
<thead class="celda_encabezado_general" style="padding: 10px;"> <thead class="celda_encabezado_general" style="padding: 10px;">
<tr> <tr>
<th class="celda_encabezado_general" rowspan="1" colspan="1">RIPL </th> <th class="celda_encabezado_general" rowspan="1" colspan="1">RIPL </th>
<th class="celda_encabezado_general" colspan="6">Gas Stock </th> <th class="celda_encabezado_general" colspan="6">Gas Stock </th>
@ -407,10 +496,10 @@
<?php <?php
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
if ($date === $currentDate) { echo 'style="background: #cef0ad;"'; } if ($date === $currentDate) {
?> echo 'style="background: #cef0ad;"';
}
> ?>>
<!-- td:eq(0) --> <!-- td:eq(0) -->
<td class="celda_normal"><?= $date ?? '-' ?></td> <td class="celda_normal"><?= $date ?? '-' ?></td>
@ -418,10 +507,11 @@
<!-- td:eq(1) --> <!-- td:eq(1) -->
<!-- only setting opening stock editable for first day of the month --> <!-- only setting opening stock editable for first day of the month -->
<td class="celda_normal openingStock" <td class="celda_normal openingStock"
<?php if($index==0){echo"contenteditable='true'";}?> <?php if ($index == 0) {
echo "contenteditable='true'";
} ?>
oninput="openingStockChange(this)" oninput="openingStockChange(this)"
data-id="<?=$gasStockDetail['date']?>" data-id="<?= $gasStockDetail['date'] ?>"><?= $gasStockDetail['opening'] ?? ' ' ?>
><?=$gasStockDetail['opening'] ?? ' '?>
</td> </td>
<!-- td:eq(2) --> <!-- td:eq(2) -->
@ -440,26 +530,22 @@
<!-- td:eq(4) --> <!-- td:eq(4) -->
<td class="celda_normal total" <td class="celda_normal total"
data-id="<?=$gasStockDetail['date']?>" data-id="<?= $gasStockDetail['date'] ?>"><?= $gasStockDetail['total'] ?? ' ' ?>
><?=$gasStockDetail['total'] ?? ' '?>
</td> </td>
<!-- td:eq(5) --> <!-- td:eq(5) -->
<td class="celda_normal consumption" <td class="celda_normal consumption"
data-id="<?=$gasStockDetail['date']?>" data-id="<?= $gasStockDetail['date'] ?>"><?= $gasStockDetail['consumption'] ?? ' ' ?>
><?=$gasStockDetail['consumption'] ?? ' '?>
</td> </td>
<!-- td:eq(6) --> <!-- td:eq(6) -->
<td class="celda_normal balanceStock" <td class="celda_normal balanceStock"
data-id="<?=$gasStockDetail['date']?>" data-id="<?= $gasStockDetail['date'] ?>"><?= $gasStockDetail['balanceStock'] ?? ' ' ?>
><?=$gasStockDetail['balanceStock'] ?? ' '?>
</td> </td>
<!-- td:eq(7) --> <!-- td:eq(7) -->
<td class="celda_normal tenTonGasConsumption" <td class="celda_normal tenTonGasConsumption"
data-id="<?=$gasStockDetail['date']?>" data-id="<?= $gasStockDetail['date'] ?>"><?= $gasStockDetail['drierMachineGasConsumption'] ?? ' ' ?>
><?=$gasStockDetail['drierMachineGasConsumption'] ?? ' '?>
</td> </td>
<!-- td:eq(8) --> <!-- td:eq(8) -->
@ -559,12 +645,6 @@
$summary["trp_sand_production"] += is_numeric($gasStockDetail['trp_sand_production']) ? $gasStockDetail['trp_sand_production'] : 0; $summary["trp_sand_production"] += is_numeric($gasStockDetail['trp_sand_production']) ? $gasStockDetail['trp_sand_production'] : 0;
$summary["rotary_drier_consumption"] += is_numeric($gasStockDetail['rotary_drier_consumption']) ? $gasStockDetail['rotary_drier_consumption'] : 0; $summary["rotary_drier_consumption"] += is_numeric($gasStockDetail['rotary_drier_consumption']) ? $gasStockDetail['rotary_drier_consumption'] : 0;
} ?> } ?>
<tfoot> <tfoot>
@ -628,18 +708,20 @@
<?php <?php
$currentDate = date('d-m-Y'); $currentDate = date('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"'; } if ($dateInMonthDmYFormat === $currentDate) {
?> echo 'style="background: #cef0ad;"';
> }
?>>
<td class="celda_normal"><?= $dateInMonthDmYFormat ?? '-' ?></td> <td class="celda_normal"><?= $dateInMonthDmYFormat ?? '-' ?></td>
<!-- only setting opening stock editable for first day of the month --> <!-- only setting opening stock editable for first day of the month -->
<td class="celda_normal openingStock" <td class="celda_normal openingStock"
<?php if($datesInMonthIndex==0){echo"contenteditable='true'";}?> <?php if ($datesInMonthIndex == 0) {
echo "contenteditable='true'";
} ?>
oninput="openingStockChange(this)" oninput="openingStockChange(this)"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"><?= $previousMonthGasStockDetails[0]['balanceStock'] ?? ' ' ?></td>
><?= $previousMonthGasStockDetails[0]['balanceStock'] ?? ' ' ?></td>
<td class="celda_normal purchaseBharath" <td class="celda_normal purchaseBharath"
oninput="purchaseBharathStockChange(this)" oninput="purchaseBharathStockChange(this)"
data-id="<?= $dateInMonth ?>" data-id="<?= $dateInMonth ?>"
@ -651,27 +733,20 @@
contenteditable="true"> </td> contenteditable="true"> </td>
<td class="celda_normal total" <td class="celda_normal total"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal consumption" <td class="celda_normal consumption"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal balanceStock" <td class="celda_normal balanceStock"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"><?= $previousMonthGasStockDetails[0]['balanceStock'] ?? ' ' ?></td>
><?= $previousMonthGasStockDetails[0]['balanceStock'] ?? ' ' ?></td>
<td class="celda_normal tenTonGasConsumption" <td class="celda_normal tenTonGasConsumption"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal sandDried" <td class="celda_normal sandDried"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal coatingGasConsumption" <td class="celda_normal coatingGasConsumption"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal coatedSand" <td class="celda_normal coatedSand"
data-id="<?=$dateInMonth?>" data-id="<?= $dateInMonth ?>"> </td>
> </td>
<td class="celda_normal trpPanelGasConsumption" <td class="celda_normal trpPanelGasConsumption"
data-id="<?= $dateInMonth ?>" data-id="<?= $dateInMonth ?>"
@ -731,72 +806,6 @@
<!-- Modal --> <!-- Modal -->
<!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<?php
$currentDateInDmY = date('d-m-Y');
?>
<?php
$startDate = DateTime::createFromFormat('M-Y', $month);
if ($startDate) {
$startDate->modify('first day of this month');
$daysInMonth = $startDate->format('t');
$dateArray = [];
for ($i = 0; $i < $daysInMonth; $i++) {
$dateArray[] = $startDate->format('d-m-Y');
$startDate->modify('+1 day');
}
} else {
echo "Invalid date format.";
}
?>
<!-- From Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="fromDateFilter">Select From Date</label>
<select id="fromDateFilter" name="fromDateFilter" class="form-control">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $index => $date) : ?>
<option value="<?= $date ?>" ><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<!-- To Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="toDateFilter">Select Date</label>
<select id="toDateFilter" name="toDateFilter" class="form-control">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $date) : ?>
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ?"selected" :" " ?> ><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- filter modal end -->
@ -807,8 +816,6 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#saveId').click(function() { $('#saveId').click(function() {
@ -853,7 +860,6 @@
}); });
}); });
</script> </script>
<script> <script>
@ -887,11 +893,9 @@
return JSON.stringify(rows, null, 2); return JSON.stringify(rows, null, 2);
} }
</script> </script>
<script> <script>
function openingStockChange(tdElement) { function openingStockChange(tdElement) {
try { try {
@ -979,8 +983,8 @@
let trpPhysicalGasConsumption = validateInput(document.querySelector(`td.trpPhysicalGasConsumption[data-id="${dataId}"]`).innerText); let trpPhysicalGasConsumption = validateInput(document.querySelector(`td.trpPhysicalGasConsumption[data-id="${dataId}"]`).innerText);
let rotaryGasConsumption = validateInput(document.querySelector(`td.rotaryGasConsumption[data-id="${dataId}"]`).innerText); let rotaryGasConsumption = validateInput(document.querySelector(`td.rotaryGasConsumption[data-id="${dataId}"]`).innerText);
let toatalGasConsumption = Number(tenTonGasConsumption) + Number (coatingGasConsumption) + Number(trpPhysicalGasConsumption) let toatalGasConsumption = Number(tenTonGasConsumption) + Number(coatingGasConsumption) + Number(trpPhysicalGasConsumption) +
+ Number(trpPanelGasConsumption) + Number(rotaryGasConsumption) ; Number(trpPanelGasConsumption) + Number(rotaryGasConsumption);
//total gas purchase and opening addition //total gas purchase and opening addition
@ -1003,15 +1007,9 @@
} }
} }
</script> </script>
<script> <script>
function updateStockValue(date, currentBalanceStock) { function updateStockValue(date, currentBalanceStock) {
const table = $('#gasStockDetailsTableId'); const table = $('#gasStockDetailsTableId');
@ -1048,14 +1046,10 @@
} }
}) })
} }
</script> </script>
<script> <script>
function customFilterDate() { function customFilterDate() {
let fromDate = $('#fromDateFilter').val(); //01-12-2024 let fromDate = $('#fromDateFilter').val(); //01-12-2024
@ -1093,7 +1087,6 @@ function convertToDate(dateString) {
let parts = dateString.split('-'); let parts = dateString.split('-');
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
} }
</script> </script>
@ -1150,12 +1143,10 @@ function convertToDate(dateString) {
return input; return input;
} }
</script> </script>
<!-- excel export --> <!-- excel export -->
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
@ -1210,9 +1201,6 @@ function convertToDate(dateString) {
}) })
</script> </script>
<script> <script>
@ -1250,7 +1238,6 @@ function convertToDate(dateString) {
} }
} }
}); });
</script> </script>
<script> <script>
@ -1299,6 +1286,52 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#filterModalId,').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#filterModalId').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script> </script>

File diff suppressed because it is too large Load Diff

View File

@ -474,6 +474,54 @@ foreach ($period as $day) {
</form> </form>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="powerDropdown">Select Machine</label>
<select id="powerDropdown" class="form-control select2">
<option value="">Select Electric Machines</option>
<?php foreach ($electricMachines as $powerMachine): ?>
<option value=" <?= $powerMachine['machine_name'] ?>">
<?= $powerMachine['machine_name'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToPower()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
@ -934,55 +982,9 @@ foreach ($period as $day) {
</div> </div>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="powerDropdown">Select Machine</label>
<select id="powerDropdown" class="form-control select2">
<option value="">Select Electric Machines</option>
<?php foreach ($electricMachines as $powerMachine): ?>
<option value=" <?= $powerMachine['machine_name'] ?>">
<?= $powerMachine['machine_name'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToPower()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.select2').select2(); $('.select2').select2();
@ -1527,8 +1529,7 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect(); const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2; const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset ? return offset < 0 && offset > closest.offset ? {
{
offset, offset,
element: child element: child
} : } :
@ -1635,6 +1636,58 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script> </script>

View File

@ -416,7 +416,7 @@ foreach ($period as $day) {
<div class="col"> <div class="col">
<div class="form-group"> <div class="form-group">
<label for="customizeHeader"> Add For This Month </label> <label for="customizeHeader"> Add For This Month </label>
<select id="customizeHeader" class="form-control" onchange="addBackToList()"> <select id="customizeHeader" class="form-control select2" onchange="addBackToList()">
<option value="">Select</option> <option value="">Select</option>
<?php <?php
foreach($activeResinMaterials as $index => $activeResinMaterial){ ?> foreach($activeResinMaterials as $index => $activeResinMaterial){ ?>
@ -472,12 +472,60 @@ foreach ($period as $day) {
</div> </div>
<!-- hidden fields --> <!-- hidden fields -->
<input type="hidden" name="month" id="month" value="<?php echo "$month" ?>" <input type="hidden" name="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker" class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1"> data-date-format="M-yyyy" data-date-min-view-mode="1">
</form> </form>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="resinDropdown">Select Machine</label>
<select id="resinDropdown" class="form-control select2">
<option value="">Select Resin</option>
<?php foreach ($resinMaterials as $resinMaterial): ?>
<option value=" <?= $resinMaterial['MaterialName'] ?>">
<?= $resinMaterial['MaterialName'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToResin()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
@ -758,72 +806,10 @@ foreach ($period as $day) {
</div> </div>
<div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myLargeModalLabel">Navigation Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<!-- bag Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="resinDropdown">Select Machine</label>
<select id="resinDropdown" class="form-control select2">
<option value="">Select Resin</option>
<?php foreach ($resinMaterials as $resinMaterial): ?>
<option value=" <?= $resinMaterial['MaterialName'] ?>">
<?= $resinMaterial['MaterialName'] ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Date Dropdown -->
<div class="col-md-6">
<div class="form-group">
<label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control select2">
<?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="navigateToResin()">Navigate</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<!-- modal section ends -->
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
@ -1347,3 +1333,58 @@ $("#searchInput").on("keyup", function () {
</script> </script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#bs-example-modal-lg').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
$('#customizeModalId').on('shown.bs.modal', function () {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#bs-example-modal-lg, #customizeModalId').on('show.bs.modal', function () {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script>

View File

@ -455,6 +455,82 @@ $timeOtions[] = "12:00 AM";
</form> </form>
<!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<div class="row">
<?php
$currentDateInDmY = date('d-m-Y');
?>
<?php
$startDate = DateTime::createFromFormat('M-Y', $month);
if ($startDate) {
$startDate->modify('first day of this month');
$daysInMonth = $startDate->format('t');
$dateArray = [];
for ($i = 0; $i < $daysInMonth; $i++) {
$dateArray[] = $startDate->format('d-m-Y');
$startDate->modify('+1 day');
}
} else {
echo "Invalid date format.";
}
?>
<!-- From Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="fromDateFilter">Select From Date</label>
<select id="fromDateFilter" name="fromDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $index => $date) : ?>
<option value="<?= $date ?>"><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
<!-- To Date Filter -->
<div class="col-md-6">
<div class="form-group">
<label for="toDateFilter">Select Date</label>
<select id="toDateFilter" name="toDateFilter" class="form-control select2">
<?php if (!empty($dateArray)) : ?>
<?php foreach ($dateArray as $date) : ?>
<option value="<?= $date ?>" <?= ($date == $currentDateInDmY) || ($date == $dateArray[9]) ? "selected" : " " ?>><?= $date ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
</div>
</div>
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<!-- end modal section -->
<div class="table-responsive" id="table-responsive"> <div class="table-responsive" id="table-responsive">
@ -643,7 +719,7 @@ $timeOtions[] = "12:00 AM";
<td class="celda_normal trpProductionStock openingTime" <td class="celda_normal trpProductionStock openingTime"
data-id="<?= $trpProductionDetail['date'] ?> openingTime"> data-id="<?= $trpProductionDetail['date'] ?> openingTime">
<select class="timeDropdown trp_on_time" style="width: 150px;"> <select class="timeDropdown trp_on_time select2" style="width: 150px;">
<?php <?php
foreach ($timeOptions as $timeOption) { foreach ($timeOptions as $timeOption) {
?> ?>
@ -663,7 +739,7 @@ $timeOtions[] = "12:00 AM";
<td class="celda_normal trpProductionStock closingTime" <td class="celda_normal trpProductionStock closingTime"
data-id="<?= $trpProductionDetail['date'] ?> closingTime"> data-id="<?= $trpProductionDetail['date'] ?> closingTime">
<select class="timeDropdown trp_off_time" style="width: 150px;"> <select class="timeDropdown trp_off_time select2" style="width: 150px;">
<?php <?php
foreach ($timeOptions as $timeOption) { foreach ($timeOptions as $timeOption) {
?> ?>
@ -1790,6 +1866,8 @@ $timeOtions[] = "12:00 AM";
</div> </div>
<!-- navigation to trp production is in hold -->
<div> <div>
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-md"> <div class="modal-dialog modal-md">
@ -1805,7 +1883,7 @@ $timeOtions[] = "12:00 AM";
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="dateDropdown">Select Date</label> <label for="dateDropdown">Select Date</label>
<select id="dateDropdown" class="form-control"> <select id="dateDropdown select2" class="form-control">
<?php foreach ($datesInMonth as $selectDate): ?> <?php foreach ($datesInMonth as $selectDate): ?>
<?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?> <?php $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option> <option value="<?= $selectDate ?>"><?= $selectDate ?></option>
@ -2130,7 +2208,7 @@ $timeOtions[] = "12:00 AM";
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.timeDropdown').select2({ $('.select2').select2({
placeholder: "Select", placeholder: "Select",
}); });
@ -2507,3 +2585,88 @@ $timeOtions[] = "12:00 AM";
}); });
}); });
</script> </script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#filterModalId,').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#filterModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script>
<script>
function customFilterDate() {
let fromDate = $('#fromDateFilter').val(); //01-12-2024
let toDate = $('#toDateFilter').val(); //05-12-2024
$('#trpProductionStockDetailsTableId').find('tbody tr').each(function() {
const rowCells = $(this).find('td');
let tableDate = rowCells.eq(0).text();
let result = checkDateRange(fromDate, toDate, tableDate);
if (result) {
$(this).show();
} else {
$(this).hide();
}
});
$('#filterModalId').modal('hide');
}
function checkDateRange(fromDate, toDate, tableDate) {
// Convert the dates to a comparable format (YYYY-MM-DD)
let from = convertToDate(fromDate);
let to = convertToDate(toDate);
let table = convertToDate(tableDate);
// Return true if the table date is within the range
return table >= from && table <= to;
}
function convertToDate(dateString) {
// Convert from DD-MM-YYYY to YYYY-MM-DD for comparison
let parts = dateString.split('-');
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
}
</script>

View File

@ -20,8 +20,10 @@
.fht-table td:hover { .fht-table td:hover {
background-color: rgb(170, 222, 167); background-color: rgb(170, 222, 167);
color: rgb(2, 2, 2); color: rgb(2, 2, 2);
transform: scale(1.25); /* Increases size by 25% */ transform: scale(1.25);
transition: transform 0.5s ease-in-out; /* Smooth scaling effect */ /* Increases size by 25% */
transition: transform 0.5s ease-in-out;
/* Smooth scaling effect */
} }
.fht-table tr:hover { .fht-table tr:hover {
@ -226,20 +228,36 @@
} }
/* Adjust heights based on screen zoom */ /* Adjust heights based on screen zoom */
@media only screen and (min-height: 1400px) { /* Approximate Zoom < 100% */ @media only screen and (min-height: 1400px) {
.table-responsive { max-height: 425px; }
/* Approximate Zoom < 100% */
.table-responsive {
max-height: 425px;
}
} }
@media only screen and (min-height: 1200px) { /* Approximate Zoom ~ 90% */ @media only screen and (min-height: 1200px) {
.table-responsive { max-height: 500px; }
/* Approximate Zoom ~ 90% */
.table-responsive {
max-height: 500px;
}
} }
@media only screen and (min-height: 1000px) { /* Approximate Zoom ~ 80% */ @media only screen and (min-height: 1000px) {
.table-responsive { max-height: 600px; }
/* Approximate Zoom ~ 80% */
.table-responsive {
max-height: 600px;
}
} }
@media only screen and (min-height: 800px) { /* Approximate Zoom ~ 75% */ @media only screen and (min-height: 800px) {
.table-responsive { max-height: 650px; }
/* Approximate Zoom ~ 75% */
.table-responsive {
max-height: 650px;
}
} }
td { td {
@ -262,10 +280,9 @@
padding-bottom: 0; padding-bottom: 0;
} }
.card{ margin-bottom: 5px;} .card {
margin-bottom: 5px;
}
</style> </style>
@ -297,13 +314,13 @@
<div class="row" align="center"> <div class="row" >
<div class="col-12"> <div class="col-12">
<div class="card" id="fullscreenDiv"> <div class="card" id="fullscreenDiv">
<div class="card-body"> <div class="card-body">
<form id="changeMonthForm" action="<?= base_url('trpSandUseStockDetails'); ?>" method="post"> <form align="center" id="changeMonthForm" action="<?= base_url('trpSandUseStockDetails'); ?>" method="post">
<div class="row"> <div class="row">
@ -356,8 +373,7 @@
<i class="fa fa-save btn-lg mt-2" <i class="fa fa-save btn-lg mt-2"
title="Save" title="Save"
style="font-size: x-large; cursor:pointer;" style="font-size: x-large; cursor:pointer;"
id="saveId" id="saveId">
>
</i> </i>
@ -372,216 +388,6 @@
</form> </form>
<div class="table-responsive" id="table-responsive">
<table style="width: 700px;" id="trpSandUseStockDetailsTableId" class="fht-table ">
<thead class="celda_encabezado_general" >
<tr>
<th class="celda_encabezado_general" colspan="5" >Trp Sand To Use Coating Sand </th>
</tr>
<tr>
<th
style="width: 100px;"
class="celda_encabezado_general" >Date </th>
<th class="celda_encabezado_general" >Rough Kgs </th>
<th class="celda_encabezado_general" >Fine Kgs </th>
<th class="celda_encabezado_general" >Total Kgs </th>
<th class="celda_encabezado_general" >Customer Name</th>
</tr>
</thead>
<tbody style="background-color: #fff;" >
<?php
if(!empty($trpSandUseStockDetails)){
$summary = [] ;
foreach($trpSandUseStockDetails as $trpSandUseStockDetailsIndex => $trpSandUseStockDetail){
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat=DateTime::createFromFormat('Y-m-d', $trpSandUseStockDetail['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';}
?>
>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($trpSandUseStockDetail['date']));
?>
</td>
<td class="celda_normal rough"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
oninput="roughStockChange(this)"
contenteditable="true"
><?= $trpSandUseStockDetail['rough_kgs'] ?? " " ?></td>
<td class="celda_normal fine"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
oninput="fineStockChange(this)"
contenteditable="true"
><?= $trpSandUseStockDetail['fine_kgs'] ?? " " ?></td>
<td class="celda_normal total"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
><?= $trpSandUseStockDetail['total_kgs'] ?? " " ?></td>
<td class="celda_normal customerName"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
contenteditable="true"
><?= $trpSandUseStockDetail['customer_name'] ?? " " ?></td>
<td style="display:none"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
><?= $trpSandUseStockDetail['id'] ?? " " ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['rough_kgs'])) {
$summary['rough_kgs'] = 0 ;
$summary['fine_kgs'] = 0 ;
$summary['total_kgs'] = 0 ;
}
$summary['rough_kgs'] += $trpSandUseStockDetail['rough_kgs'] == "-" ? 0 : (float) $trpSandUseStockDetail['rough_kgs'] ;
$summary['fine_kgs'] += $trpSandUseStockDetail['fine_kgs'] == "-" ? 0 : (float) $trpSandUseStockDetail['fine_kgs'] ;
$summary['total_kgs'] += $trpSandUseStockDetail['total_kgs'] == "-" ? 0 :(float) $trpSandUseStockDetail['total_kgs'] ;
} ?>
<tfoot>
<tr class="total_row">
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td class="celda_normal "><b><?=$summary['rough_kgs']?></b></td>
<td class="celda_normal "><b><?=$summary['fine_kgs']?></b></td>
<td class="celda_normal "><b><?=$summary['total_kgs']?></b></td>
<td class="celda_normal "> </td>
</tr>
</tfoot>
</div>
<?php }else{
$date = DateTime::createFromFormat('M-Y', $month);
$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 = [];
$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($datesInMonth as $datesInMonthIndex => $dateInMonth){
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat=date("d-m-Y", strtotime($dateInMonth));
if ($dateInMonthDmYFormat === $currentDate) { echo 'style="background: #cef0ad;"';}
?>
>
<!-- td:eq(0) -->
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dateInMonth));
?>
</td>
<!-- td:eq(1) -->
<td class="celda_normal rough"
data-id="<?= $dateInMonth ?>"
oninput="roughStockChange(this)"
contenteditable="true"
><?= " " ?></td>
<!-- td:eq(2) -->
<td class="celda_normal fine"
data-id="<?= $dateInMonth ?>"
oninput="fineStockChange(this)"
contenteditable="true"
><?= " " ?></td>
<!-- td:eq(3) -->
<td class="celda_normal total"
data-id="<?= $dateInMonth ?>"
><?= " " ?></td>
<!-- td:eq(4) -->
<td class="celda_normal customer"
data-id="<?= $dateInMonth ?>"
contenteditable="true"
><?= " " ?></td>
<!-- td:eq(5) -->
<td style="display:none"
data-id="<?= $dateInMonth ?>"
contenteditable="true"
><?= " " ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div> <!-- End card-body -->
</div> <!-- End card -->
</div> <!-- End col -->
</div> <!-- End row -->
</div>
</div> <!-- End container-fluid -->
</div>
</div>
<!-- modal section -->
<!-- filter modal --> <!-- filter modal -->
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true"> <div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
<div class="modal-dialog modal-md"> <div class="modal-dialog modal-md">
@ -659,6 +465,209 @@
<!-- end modal section --> <!-- end modal section -->
<div class="table-responsive" id="table-responsive" align="center">
<table style="width: 700px;" id="trpSandUseStockDetailsTableId" class="fht-table ">
<thead class="celda_encabezado_general">
<tr>
<th class="celda_encabezado_general" colspan="5">Trp Sand To Use Coating Sand </th>
</tr>
<tr>
<th
style="width: 100px;"
class="celda_encabezado_general">Date </th>
<th class="celda_encabezado_general">Rough Kgs </th>
<th class="celda_encabezado_general">Fine Kgs </th>
<th class="celda_encabezado_general">Total Kgs </th>
<th class="celda_encabezado_general">Customer Name</th>
</tr>
</thead>
<tbody style="background-color: #fff;">
<?php
if (!empty($trpSandUseStockDetails)) {
$summary = [];
foreach ($trpSandUseStockDetails as $trpSandUseStockDetailsIndex => $trpSandUseStockDetail) {
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = DateTime::createFromFormat('Y-m-d', $trpSandUseStockDetail['date'])->format('d-m-Y');
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($trpSandUseStockDetail['date']));
?>
</td>
<td class="celda_normal rough"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
oninput="roughStockChange(this)"
contenteditable="true"><?= $trpSandUseStockDetail['rough_kgs'] ?? " " ?></td>
<td class="celda_normal fine"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
oninput="fineStockChange(this)"
contenteditable="true"><?= $trpSandUseStockDetail['fine_kgs'] ?? " " ?></td>
<td class="celda_normal total"
data-id="<?= $trpSandUseStockDetail['date'] ?>"><?= $trpSandUseStockDetail['total_kgs'] ?? " " ?></td>
<td class="celda_normal customerName"
data-id="<?= $trpSandUseStockDetail['date'] ?>"
contenteditable="true"><?= $trpSandUseStockDetail['customer_name'] ?? " " ?></td>
<td style="display:none"
data-id="<?= $trpSandUseStockDetail['date'] ?>"><?= $trpSandUseStockDetail['id'] ?? " " ?></td>
</tr>
<?php
//before closing inner loop
if (!isset($summary['rough_kgs'])) {
$summary['rough_kgs'] = 0;
$summary['fine_kgs'] = 0;
$summary['total_kgs'] = 0;
}
$summary['rough_kgs'] += $trpSandUseStockDetail['rough_kgs'] == "-" ? 0 : (float) $trpSandUseStockDetail['rough_kgs'];
$summary['fine_kgs'] += $trpSandUseStockDetail['fine_kgs'] == "-" ? 0 : (float) $trpSandUseStockDetail['fine_kgs'];
$summary['total_kgs'] += $trpSandUseStockDetail['total_kgs'] == "-" ? 0 : (float) $trpSandUseStockDetail['total_kgs'];
} ?>
<tfoot>
<tr class="total_row">
<td style="background-color:rgb(189, 9, 6); color:#ffff;">
<b> Total </b>
</td>
<td class="celda_normal "><b><?= $summary['rough_kgs'] ?></b></td>
<td class="celda_normal "><b><?= $summary['fine_kgs'] ?></b></td>
<td class="celda_normal "><b><?= $summary['total_kgs'] ?></b></td>
<td class="celda_normal "> </td>
</tr>
</tfoot>
</div>
<?php } else {
$date = DateTime::createFromFormat('M-Y', $month);
$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 = [];
$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 ($datesInMonth as $datesInMonthIndex => $dateInMonth) {
?>
<tr
<?php
$currentDate = date('d-m-Y');
$dateInMonthDmYFormat = date("d-m-Y", strtotime($dateInMonth));
if ($dateInMonthDmYFormat === $currentDate) {
echo 'style="background: #cef0ad;"';
}
?>>
<!-- td:eq(0) -->
<td class="celda_normal">
<?php
echo date("d-m-Y", strtotime($dateInMonth));
?>
</td>
<!-- td:eq(1) -->
<td class="celda_normal rough"
data-id="<?= $dateInMonth ?>"
oninput="roughStockChange(this)"
contenteditable="true"><?= " " ?></td>
<!-- td:eq(2) -->
<td class="celda_normal fine"
data-id="<?= $dateInMonth ?>"
oninput="fineStockChange(this)"
contenteditable="true"><?= " " ?></td>
<!-- td:eq(3) -->
<td class="celda_normal total"
data-id="<?= $dateInMonth ?>"><?= " " ?></td>
<!-- td:eq(4) -->
<td class="celda_normal customer"
data-id="<?= $dateInMonth ?>"
contenteditable="true"><?= " " ?></td>
<!-- td:eq(5) -->
<td style="display:none"
data-id="<?= $dateInMonth ?>"
contenteditable="true"><?= " " ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</div> <!-- End card-body -->
</div> <!-- End card -->
</div> <!-- End col -->
</div> <!-- End row -->
</div>
</div> <!-- End container-fluid -->
</div>
</div>
<!-- modal section -->
<script> <script>
function customFilterDate() { function customFilterDate() {
@ -699,7 +708,6 @@
let parts = dateString.split('-'); let parts = dateString.split('-');
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
} }
</script> </script>
<script> <script>
@ -712,8 +720,6 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('#saveId').click(function() { $('#saveId').click(function() {
@ -756,7 +762,6 @@
}); });
}); });
</script> </script>
<script> <script>
@ -784,11 +789,9 @@
return JSON.stringify(rows, null, 2); return JSON.stringify(rows, null, 2);
} }
</script> </script>
<script> <script>
function roughStockChange(tdElement) { function roughStockChange(tdElement) {
try { try {
@ -848,10 +851,6 @@
return input; return input;
} }
</script> </script>
@ -859,7 +858,6 @@
<script> <script>
$(document).ready(function() { $(document).ready(function() {
function exportTableToExcel(tableID, filename = '') { function exportTableToExcel(tableID, filename = '') {
@ -914,9 +912,6 @@
}) })
</script> </script>
@ -956,11 +951,9 @@
} }
} }
}); });
</script> </script>
<script> <script>
$('#month').change(function() { $('#month').change(function() {
$('#changeMonthForm').submit(); $('#changeMonthForm').submit();
}) })
@ -1019,6 +1012,47 @@ $("#searchInput").on("keyup", function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
}); });
}); });
</script> </script>
<script>
$(document).ready(function() {
$('.select2').select2({
dropdownParent: $('#fullscreenDiv')
});
// Initialize Select2 when the modal is shown inside full screen
$('#filterModalId,').on('shown.bs.modal', function() {
$('.select2').select2({
dropdownParent: $(this) // This ensures Select2 works in the modal
});
});
});
</script>
<script>
//getting modal backdrop inside full screen
$(document).ready(function() {
function moveModalBackdropToFullscreen() {
setTimeout(() => {
$('.modal-backdrop').appendTo('#fullscreenDiv'); // Move backdrop inside fullscreen
}, 10); // Small delay ensures backdrop is created first
}
// Move the modal backdrop when a modal opens
$('#filterModalId').on('show.bs.modal', function() {
moveModalBackdropToFullscreen();
});
// Ensure modals work properly in fullscreen mode
document.addEventListener("fullscreenchange", function() {
setTimeout(() => {
$('.modal-backdrop').remove(); // Remove any existing backdrops
moveModalBackdropToFullscreen();
}, 200);
});
});
</script>