Bug Fix From Ria

This commit is contained in:
vadivelJ96 2025-05-07 12:02:48 +05:30
parent df17649e97
commit 4df671bc3f

View File

@ -1,4 +1,6 @@
<?php
use Faker\Core\DateTime;
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
//echo $datefordropdown;
$attendance = array_merge($attendance, $emppay); // initial step there is no attendance entry so emppay data is merged
@ -14,8 +16,6 @@ $currentday = date('d');
text-align: right;
}
.fht-table,
.fht-table thead,
.fht-table tfoot,
@ -310,6 +310,7 @@ $currentday = date('d');
for ($col = 1; $col <= $monthdays; $col++) {
$flag = 0;
$flag2 = 0;
$todayflag = 0;
@ -338,6 +339,10 @@ $currentday = date('d');
}
}
if($col > $currentday && $datefordropdown == date('M-Y')){
continue;
}
?>
@ -414,6 +419,8 @@ $currentday = date('d');
if ($col == $currentday) {
$todayflag = 1;
}
foreach ($sundayarray as $in) {
if ($in == $col) {
$flag = 1;
@ -434,6 +441,7 @@ $currentday = date('d');
//echo $title;
}
}
$WH = 'WH' . $col;
$OT = 'OT' . $col;
@ -451,9 +459,16 @@ $currentday = date('d');
}
if($col > $currentday && $datefordropdown == date('M-Y')){
continue;
}
// echo "<pre>"."empid = $a->EmpID, date = $col, absent = $absent"."</pre>";
// echo "<pre>"."2) all Flags : flag2 = $flag2, flag = $flag2, absent = $absent"."</pre>";
?>
?>
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
@ -462,7 +477,7 @@ $currentday = date('d');
id="<?php echo $row . 'row' . $col . 'W'; ?>"
<?php if ($flag == 1 or $flag2 == 1) {
echo "style='background: #f5a6a7 ;'";
} else if ($todayflag == 1) {
} else if ($todayflag == 1 && $datefordropdown == date('M-Y')) {
echo "style='background: #cef0ad ;'";
} ?>
<?php if ($absent == 1) {
@ -484,7 +499,7 @@ $currentday = date('d');
id="<?php echo $row . 'row' . $col . 'OT'; ?>"
<?php if ($flag == 1 or $flag2 == 1) {
echo "style='background: #f5a6a7 ;'";
} else if ($todayflag == 1) {
} else if ($todayflag == 1 && $datefordropdown == date('M-Y')) {
echo "style='background: #cef0ad ;'";
} ?>
<?php if ($absent == 1) {
@ -1092,4 +1107,43 @@ $("#searchInput").on("keyup", function () {
});
});
</script>
<!-- on enter key press allowing user to go next line instead of submitting any form here -->
<script>
document.addEventListener("keydown", function(event) {
if (event.key === "Enter") {
let activeElement = document.activeElement;
// Check if the focused element is inside a table
let cell = activeElement.closest("td, th");
let table = activeElement.closest("table");
if (table && cell) {
event.preventDefault(); // Prevent form submission
let columnIndex = cell.cellIndex; // Get the current column index
let currentRow = cell.parentElement; // Get the current row
let nextRow = currentRow.nextElementSibling; // Get the next row
// Move to the same column in the next row if available
if (nextRow) {
let nextCell = nextRow.cells[columnIndex];
if (nextCell) {
nextCell.focus();
}
}
}
}
});
</script>