supplier changes-1 vadivel J 05-12-2024

This commit is contained in:
vadivelJ96 2024-12-05 15:03:16 +05:30
parent c99566fd74
commit a2cb0fe14a
3 changed files with 204 additions and 29 deletions

View File

@ -166,10 +166,35 @@
color: #ffffff;
}
.modal {
padding-right: 30% ! important;
}
</style>
<?php
$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');
}
?>
<div class="content-page">
<div class="content">
<!-- Start Content-->
@ -214,6 +239,19 @@
<div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button>
</div>
<div class="col-md-1"></div>
<div class="col-6">
<div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
aria-expanded="false">
<i class="mdi mdi-dots-vertical m-0 text-muted h3"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
<a class="dropdown-item" href="#">Export</a>
</div>
</div>
</div>
</div>
</form>
@ -232,7 +270,7 @@
<!-- this will loop till materials present -->
<th class="celda_encabezado_general" colspan="4">
<?= $bagMaterial['MaterialName']?>
<!-- (<?= $bagMaterial['MaterialCode']?>) -->
</th>
<?php } ?>
</tr>
@ -348,28 +386,6 @@
with initial values 0 for entire month -->
<?php } else { ?>
<?php
$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');
}
?>
<?php foreach($datesInMonth as $datesInMonthIndex => $dateInMonth){ ?>
<tr
@ -460,9 +476,132 @@
<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="bagDropdown">Select Bag</label>
<select id="bagDropdown" class="form-control">
<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">
<?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>
function navigateToBag() {
$('.close').click();
const bagDropdown = document.getElementById('bagDropdown');
const dateDropdown = document.getElementById('dateDropdown');
const selectedBag = bagDropdown.value;
const selectedDate = dateDropdown.value;
const table = document.getElementById('bagStockDetailsTableId');
const headerCells = table.querySelectorAll('thead tr:nth-child(1) th');
const rows = table.querySelectorAll('tbody tr');
let targetColumnIndex = -1;
headerCells.forEach((header, index) => {
if ((header.innerText.trim()) === selectedBag.trim()) {
targetColumnIndex = index;
return;
}
});
if (targetColumnIndex === -1) {
console.log("Bag column not found.");
return;
}
let targetRow = null;
rows.forEach(row => {
const dateCell = row.querySelector('td:first-child');
if (dateCell && dateCell.textContent.trim() === selectedDate) {
targetRow = row;
}
});
if (!targetRow) {
console.log("Date row not found.");
return;
}
console.log(targetColumnIndex);
console.log(targetRow);
targetColumnIndex = targetColumnIndex * 7;
targetRow.cells[targetColumnIndex].scrollIntoView({
behavior: 'smooth',
inline: 'center',
block: 'center'
});
const highlightDuration = 10000;
for (let i = targetColumnIndex-4 ; i <= targetColumnIndex ; i++) {
const cell = targetRow.cells[i];
if (cell) {
cell.style.transition = "background-color 0.5s";
cell.style.backgroundColor = "#df9675";
setTimeout(() => {
cell.style.backgroundColor = "";
}, highlightDuration);
}
}
}
</script>
<script type="text/javascript">

View File

@ -400,6 +400,11 @@ if (!empty($supplier)) {
pattern="([A-Za-z]){5}([0-9]){4}([A-Za-z]){1}" onkeypress="return alphaNumberic(event)"
style="text-transform:uppercase;">
</div>
</div>
</div>
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="form-row" style="margin-bottom: 20px;">
<div class="col-md-3">
<label style="margin-bottom: 1px !important;" for="Cert_GST">Select GST
Document<br /><small>(only .pdf, .doc, .png, .jpg)</small></label>
@ -417,6 +422,26 @@ if (!empty($supplier)) {
<?php } ?>
</div>
</div>
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="form-row" style="margin-bottom: 20px;">
<div class="col-md-3">
<label style="margin-bottom: 1px !important;" for="Cert_MSME">Select MSME
Document<br /><small>(only .pdf, .doc, .png, .jpg)</small></label>
<input type="file" size="20" accept=".docx,.pdf,.doc,.jpg,.png" id="Cert_MSME"
name="Cert_MSME" />
<input type="hidden" id="hidden_Cert_MSME" name="hidden_Cert_MSME"
value="<?php echo $hidden_Cert_MSME; ?>" />
</div>
<?php if ($hidden_Cert_MSME) { ?>
<div class="col-md-3">
<u><a title="previously uploaded GST Document"
href="<?php echo base_url() . 'public/uploads/images/' . $hidden_Cert_MSME ?>"><span>previously
uploaded MSME Document - </span><small><?= $hidden_Cert_MSME; ?></small></a></u>
</div>
<?php } ?>
</div>
</div>
<legend style="margin-left:-10px;color: #4f7c97;">Bank Details</legend>

View File

@ -167,9 +167,7 @@
color: #ffffff;
}
.modal {
padding-right: 30% ! important;
}
</style>
<div class="content-page">
<div class="content">
@ -214,6 +212,19 @@
<div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button>
</div>
<div class="col-md-1"></div>
<div class="col-6">
<div class="dropdown float-right">
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
aria-expanded="false">
<i class="mdi mdi-dots-vertical m-0 text-muted h3"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" data-toggle="modal" data-target="#bs-example-modal-lg">Navigation</a>
<a class="dropdown-item" href="#">Export</a>
</div>
</div>
</div>
</div>
</form>