Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
5a97a6ebeb
@ -1322,8 +1322,7 @@ class StockController extends BaseController
|
||||
$consumption = $row['Tot Gas Consumption'];
|
||||
$dateToBeInserted = $data['date'];
|
||||
$this->updateGasStockConsumption($dateToBeInserted, $consumption);
|
||||
|
||||
|
||||
|
||||
$inserts[] = $data;
|
||||
}
|
||||
|
||||
|
||||
@ -447,34 +447,58 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
|
||||
<!-- Date Filter -->
|
||||
<?php
|
||||
$currentDateInDmY = date('d-m-Y');
|
||||
?>
|
||||
|
||||
<?php
|
||||
$startDate = DateTime::createFromFormat('M-Y', $datefordropdown);
|
||||
|
||||
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 Date</label>
|
||||
<select id="fromDateFilter" name="fromDateFilter" class="form-control">
|
||||
<?php foreach ($drierDetails as $a) :
|
||||
$selectDate = DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?>
|
||||
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||
<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>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Date Filter -->
|
||||
<!-- 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 foreach ($drierDetails as $a) :
|
||||
$selectDate = DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?>
|
||||
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?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="filterDate()">Filter</button>
|
||||
<button class="btn btn-primary float-right" onclick="customFilterDate()">Filter</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
@ -621,17 +645,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
var alldata = $("#drierTable").tableToJSON();
|
||||
|
||||
$('#drierTable tbody tr').each(function(index) {
|
||||
console.log('alldata', alldata);
|
||||
|
||||
$('#drierTable tbody tr:visible').each(function(index) {
|
||||
|
||||
if (alldata[index]) {
|
||||
let row = alldata[index];
|
||||
|
||||
// Get the selected values from dropdowns
|
||||
row['Drier On Time'] = $(this).find('.drier_on_time').val();
|
||||
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
|
||||
row['Supplier Name'] = $(this).find('.supplier_name').val();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
alldata = JSON.stringify(alldata);
|
||||
@ -911,7 +940,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
<script>
|
||||
|
||||
function filterDate(){
|
||||
function customFilterDate(){
|
||||
|
||||
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||
@ -932,6 +961,31 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
initialFilterDate();
|
||||
});
|
||||
|
||||
function initialFilterDate(){
|
||||
|
||||
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||
|
||||
console.log("from Date and to date ..!!")
|
||||
console.log(fromDate,toDate);
|
||||
|
||||
$('#drierTable').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();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function checkDateRange(fromDate, toDate, tableDate) {
|
||||
// Convert the dates to a comparable format (YYYY-MM-DD)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user