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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -474,6 +474,54 @@ foreach ($period as $day) {
</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">
@ -934,55 +982,9 @@ foreach ($period as $day) {
</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>
$(document).ready(function() {
$('.select2').select2();
@ -1527,8 +1529,7 @@ foreach ($period as $day) {
const box = child.getBoundingClientRect();
const offset = y - box.top - box.height / 2;
return offset < 0 && offset > closest.offset ?
{
return offset < 0 && offset > closest.offset ? {
offset,
element: child
} :
@ -1599,42 +1600,94 @@ foreach ($period as $day) {
<script>
function toggleDivFullscreen() {
let div = document.getElementById("fullscreenDiv");
let tableResponsive = document.getElementById("table-responsive"); // Select the table container inside div
let div = document.getElementById("fullscreenDiv");
let tableResponsive = document.getElementById("table-responsive"); // Select the table container inside div
if (!document.fullscreenElement) {
div.requestFullscreen().then(() => {
div.style.width = "100vw"; // Full viewport width
div.style.height = "100vh"; // Full viewport height
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "90vh";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error enabling fullscreen:", err));
} else {
document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
if (!document.fullscreenElement) {
div.requestFullscreen().then(() => {
div.style.width = "100vw"; // Full viewport width
div.style.height = "100vh"; // Full viewport height
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
}
}).catch(err => console.log("Error exiting fullscreen:", err));
// If .table-responsive exists, set its height to 90vh
if (tableResponsive) {
tableResponsive.style.maxHeight = "90vh";
tableResponsive.style.overflowY = "auto"; // Allow scrolling if needed
}
}).catch(err => console.log("Error enabling fullscreen:", err));
} else {
document.exitFullscreen().then(() => {
div.style.width = "100%";
div.style.height = "100%";
// Reset .table-responsive height when exiting fullscreen
if (tableResponsive) {
tableResponsive.style.height = "auto";
}
}).catch(err => console.log("Error exiting fullscreen:", err));
}
}
}
$("#searchInput").on("keyup", function () {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$("#searchInput").on("keyup", function() {
let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search
$(".table-responsive tbody tr").filter(function () {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
$(".table-responsive tbody tr").filter(function() {
$(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="form-group">
<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>
<?php
foreach($activeResinMaterials as $index => $activeResinMaterial){ ?>
@ -472,12 +472,60 @@ foreach ($period as $day) {
</div>
<!-- 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"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</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">
@ -758,72 +806,10 @@ foreach ($period as $day) {
</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>
$(document).ready(function(){
@ -1346,4 +1332,59 @@ $("#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>
<!-- 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">
@ -643,7 +719,7 @@ $timeOtions[] = "12:00 AM";
<td class="celda_normal trpProductionStock 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
foreach ($timeOptions as $timeOption) {
?>
@ -663,7 +739,7 @@ $timeOtions[] = "12:00 AM";
<td class="celda_normal trpProductionStock 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
foreach ($timeOptions as $timeOption) {
?>
@ -1790,6 +1866,8 @@ $timeOtions[] = "12:00 AM";
</div>
<!-- navigation to trp production is in hold -->
<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">
@ -1805,7 +1883,7 @@ $timeOtions[] = "12:00 AM";
<div class="col-md-6">
<div class="form-group">
<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 $selectDate = DateTime::createFromFormat('Y-m-d', $selectDate)->format('d-m-Y'); ?>
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
@ -2130,7 +2208,7 @@ $timeOtions[] = "12:00 AM";
<script>
$(document).ready(function() {
$('.timeDropdown').select2({
$('.select2').select2({
placeholder: "Select",
});
@ -2506,4 +2584,89 @@ $timeOtions[] = "12:00 AM";
$(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>
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>

File diff suppressed because it is too large Load Diff