CHANGE_ALL_TABLE_FROM_TO_SEARCH_DATE
This commit is contained in:
parent
bb07cb8dbb
commit
3a60759b94
@ -68,9 +68,9 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
<div class="error" id="error"></div>
|
<div class="error" id="error"></div>
|
||||||
@ -237,17 +237,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -255,11 +257,17 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Handle form submission for the date range filter
|
// Handle form submission for the date range filter
|
||||||
$("#DateRangeFilter").submit(function(e) {
|
$("#DateRangeFilter").submit(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@ -100,10 +100,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -282,17 +282,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -300,8 +302,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -58,10 +58,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -180,17 +180,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -198,8 +200,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -98,10 +98,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -217,17 +217,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -235,8 +237,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -56,10 +56,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -238,17 +238,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -256,8 +258,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -273,10 +273,10 @@
|
|||||||
<span class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<span class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="button" class="range_search_button" id="DateRangeFilter"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="button" class="range_search_button" id="DateRangeFilter"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -307,21 +307,21 @@
|
|||||||
foreach ($ReqList as $record) {
|
foreach ($ReqList as $record) {
|
||||||
?>
|
?>
|
||||||
<tr id="<?php echo $index; ?>">
|
<tr id="<?php echo $index; ?>">
|
||||||
<td align="center"><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
<td align="left"><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
||||||
<td align="center">
|
<td align="left">
|
||||||
<?php
|
<?php
|
||||||
$dt = new DateTime($record->ReqDate);
|
$dt = new DateTime($record->ReqDate);
|
||||||
$RequestedDate = $dt->format('d-m-Y');
|
$RequestedDate = $dt->format('d-m-Y');
|
||||||
echo $RequestedDate;
|
echo $RequestedDate;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td align="center"><a data-toggle="modal" data-target="#RequisitionDtlsModal" data-id="<%=index%>" data-userid="<?php echo $record->ReqNo ?>"><u><?php echo $record->ReqNo; ?> </u></a></td>
|
<td align="left"><a data-toggle="modal" data-target="#RequisitionDtlsModal" data-id="<%=index%>" data-userid="<?php echo $record->ReqNo ?>"><u><?php echo $record->ReqNo; ?> </u></a></td>
|
||||||
<td align="center"><?php echo $record->ReqType; ?></td>
|
<td align="left"><?php echo $record->ReqType; ?></td>
|
||||||
<td><?php echo $record->FirstName; ?></td>
|
<td><?php echo $record->FirstName; ?></td>
|
||||||
<td align="center"><?php echo $record->TotalNoofLineItems; ?></td>
|
<td align="left"><?php echo $record->TotalNoofLineItems; ?></td>
|
||||||
<td align="center"><?php echo $record->PolineItems; ?></td>
|
<td align="left"><?php echo $record->PolineItems; ?></td>
|
||||||
<td align="center"><?php echo $record->PartilallyLineItems; ?></td>
|
<td align="left"><?php echo $record->PartilallyLineItems; ?></td>
|
||||||
<td align="center"><?php echo $record->newLineItem; ?></td>
|
<td align="left"><?php echo $record->newLineItem; ?></td>
|
||||||
<td><?php echo $record->StatusName; ?></td>
|
<td><?php echo $record->StatusName; ?></td>
|
||||||
<td><?php echo $record->DepartmentName; ?></td>
|
<td><?php echo $record->DepartmentName; ?></td>
|
||||||
<td><?php echo $record->Designation; ?></td>
|
<td><?php echo $record->Designation; ?></td>
|
||||||
@ -408,17 +408,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[1]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -426,8 +428,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -83,10 +83,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -178,17 +178,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -196,8 +198,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -190,52 +190,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Initialize the datepickers
|
|
||||||
$("#fromDate").datepicker({
|
|
||||||
dateFormat: 'dd-mm-yy',
|
|
||||||
onSelect: function(selectedDate) {
|
|
||||||
var minDate = $(this).datepicker("getDate");
|
|
||||||
$("#toDate").datepicker("option", "minDate", minDate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#toDate").datepicker({
|
|
||||||
dateFormat: 'dd-mm-yy',
|
|
||||||
onSelect: function(selectedDate) {
|
|
||||||
var maxDate = $(this).datepicker("getDate");
|
|
||||||
$("#fromDate").datepicker("option", "maxDate", maxDate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Reset button functionality
|
|
||||||
$("#resetButton").click(function() {
|
|
||||||
$("#fromDate").datepicker("setDate", null);
|
|
||||||
$("#toDate").datepicker("setDate", null);
|
|
||||||
$("#toDate").datepicker("option", "minDate", null);
|
|
||||||
$("#fromDate").datepicker("option", "maxDate", null);
|
|
||||||
table.draw();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Date range filter
|
|
||||||
$.fn.dataTable.ext.search.push(
|
|
||||||
|
|
||||||
function(settings, data, dataIndex) {
|
|
||||||
var fromDate = $("#fromDate").datepicker("getDate");
|
|
||||||
var toDate = $("#toDate").datepicker("getDate");
|
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
|
||||||
|
|
||||||
// Convert dateStr to Date object
|
|
||||||
var dateParts = dateStr.split("-");
|
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
|
||||||
return true; // No filter if dates are not selected
|
|
||||||
}
|
|
||||||
|
|
||||||
return date >= fromDate && date <= toDate;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Handle form submission
|
// Handle form submission
|
||||||
$("#DateRangeFilter").submit(function(e) {
|
$("#DateRangeFilter").submit(function(e) {
|
||||||
|
|||||||
@ -76,10 +76,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -89,16 +89,16 @@
|
|||||||
<table class="table table-bordered table-hover" id="expense_list_table" style="background-color:#fff;">
|
<table class="table table-bordered table-hover" id="expense_list_table" style="background-color:#fff;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="right" style="width: 10%;">Created Date</th>
|
<th align="left" style="width: 10%;">Created Date</th>
|
||||||
<!-- <th align="right">Expense Id</th> -->
|
<!-- <th align="right">Expense Id</th> -->
|
||||||
<th align="right" style="width: 20%;">Supplier Name</th>
|
<th align="left" style="width: 20%;">Supplier Name</th>
|
||||||
<th align="right" style="width: 25%;">Item Description</th>
|
<th align="left" style="width: 25%;">Item Description</th>
|
||||||
<th align="right" style="width: 7%;">Cost</th>
|
<th align="left" style="width: 7%;">Cost</th>
|
||||||
<th align="right" style="width: 5%;">CGST</th>
|
<th align="left" style="width: 5%;">CGST</th>
|
||||||
<th align="right" style="width: 5%;">SGST</th>
|
<th align="left" style="width: 5%;">SGST</th>
|
||||||
<th align="right" style="width: 5%;">IGST</th>
|
<th align="left" style="width: 5%;">IGST</th>
|
||||||
<th align="right" style="width: 7%;">Total</th>
|
<th align="left" style="width: 7%;">Total</th>
|
||||||
<th align="right" style="width: 8%;">Action</th>
|
<th align="left" style="width: 8%;">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -467,22 +467,33 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0];
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
|
|
||||||
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
return date >= startDate && date <= endDate;
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,27 @@
|
|||||||
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/form-wizard.init.js"></script>
|
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/form-wizard.init.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
form = $(".form-date-search")
|
||||||
|
.datepicker({
|
||||||
|
autoclose: true,
|
||||||
|
orientation: 'bottom',
|
||||||
|
format: 'dd-mm-yyyy',
|
||||||
|
todayHighlight: true,
|
||||||
|
endDate: '+0d'
|
||||||
|
})
|
||||||
|
.on("change", function() {
|
||||||
|
to.datepicker("option", "minDate", getDate(this));
|
||||||
|
}),
|
||||||
|
to = $(".to-date-search").datepicker({
|
||||||
|
autoclose: true,
|
||||||
|
orientation: 'bottom',
|
||||||
|
format: 'dd-mm-yyyy',
|
||||||
|
todayHighlight: true,
|
||||||
|
endDate: '+0d'
|
||||||
|
})
|
||||||
|
.on("change", function() {
|
||||||
|
from.datepicker("option", "maxDate", getDate(this));
|
||||||
|
});
|
||||||
var table = $('.ria_data_table').DataTable({
|
var table = $('.ria_data_table').DataTable({
|
||||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||||
buttons: [
|
buttons: [
|
||||||
|
|||||||
@ -140,10 +140,10 @@ if (empty($Status)) {
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -572,17 +572,19 @@ if (empty($Status)) {
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -590,8 +592,13 @@ if (empty($Status)) {
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -233,9 +233,11 @@ if (!empty($INRSYMBOL)) {
|
|||||||
});
|
});
|
||||||
if (PaymentID != 'PT08') {
|
if (PaymentID != 'PT08') {
|
||||||
$('#otheroptiondiv').hide();
|
$('#otheroptiondiv').hide();
|
||||||
|
$('#Otherpayment').prop('required', false);
|
||||||
$('#Otherpayment').val('');
|
$('#Otherpayment').val('');
|
||||||
} else if (PaymentID == 'PT08') {
|
} else if (PaymentID == 'PT08') {
|
||||||
$('#otheroptiondiv').show();
|
$('#otheroptiondiv').show();
|
||||||
|
$('#Otherpayment').prop('required', true);
|
||||||
}
|
}
|
||||||
$.each(Payment, function(pay, payobj) {
|
$.each(Payment, function(pay, payobj) {
|
||||||
if (payobj.PaymentID == PaymentID) {
|
if (payobj.PaymentID == PaymentID) {
|
||||||
@ -2018,7 +2020,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
<label>Description of Payable Terms<span class="badge mandatory">*</span></label>
|
<label>Description of Payable Terms<span class="badge mandatory">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control', 'required' => 'true');
|
$data = array('name' => 'Otherpayment', 'Otherpayment' => set_value('Otherpayment'), 'id' => 'Otherpayment', 'class' => 'form-control');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -4048,8 +4050,10 @@ if (!empty($INRSYMBOL)) {
|
|||||||
$("#PaymentTerms").change(function() {
|
$("#PaymentTerms").change(function() {
|
||||||
if ($('#PaymentTerms').val().trim() == 'PT08') {
|
if ($('#PaymentTerms').val().trim() == 'PT08') {
|
||||||
$('#otheroptiondiv').show();
|
$('#otheroptiondiv').show();
|
||||||
|
$('#Otherpayment').prop('required', true);
|
||||||
} else {
|
} else {
|
||||||
$('#otheroptiondiv').hide();
|
$('#otheroptiondiv').hide();
|
||||||
|
$('#Otherpayment').prop('required', false);
|
||||||
$('#Otherpayment').val('');
|
$('#Otherpayment').val('');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -70,10 +70,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -184,17 +184,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -202,8 +204,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -2,10 +2,8 @@
|
|||||||
|
|
||||||
$DraftCount = '';
|
$DraftCount = '';
|
||||||
$ReqNo = '';
|
$ReqNo = '';
|
||||||
if(!empty($Status))
|
if (!empty($Status)) {
|
||||||
{
|
foreach ($Status as $St) {
|
||||||
foreach ($Status as $St)
|
|
||||||
{
|
|
||||||
$DraftCount = $St->cnt;
|
$DraftCount = $St->cnt;
|
||||||
$ReqNo = $St->ReqNo;
|
$ReqNo = $St->ReqNo;
|
||||||
}
|
}
|
||||||
@ -49,21 +47,27 @@ span.highlight {
|
|||||||
.Date-filter-form {
|
.Date-filter-form {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px; /* Adjust the gap as needed */
|
gap: 10px;
|
||||||
|
/* Adjust the gap as needed */
|
||||||
}
|
}
|
||||||
.Date-filter-form input, .Date-filter-form button {
|
|
||||||
|
.Date-filter-form input,
|
||||||
|
.Date-filter-form button {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Date-filter-form button {
|
.Date-filter-form button {
|
||||||
background-color: #007bff;
|
background-color: #007bff;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.Date-filter-form button:hover {
|
.Date-filter-form button:hover {
|
||||||
background-color: #0056b3;
|
background-color: #0056b3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button {
|
.icon-button {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
@ -71,6 +75,7 @@ span.highlight {
|
|||||||
color: #007bff;
|
color: #007bff;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button:hover {
|
.icon-button:hover {
|
||||||
color: #0056b3;
|
color: #0056b3;
|
||||||
}
|
}
|
||||||
@ -105,10 +110,10 @@ span.highlight {
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -131,10 +136,8 @@ span.highlight {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
if(!empty($TotNoOfLine))
|
if (!empty($TotNoOfLine)) {
|
||||||
{
|
foreach ($TotNoOfLine as $record) { //print_r($record);
|
||||||
foreach($TotNoOfLine as $record)
|
|
||||||
{ //print_r($record);
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td> <?php $Pdt = new DateTime($record->CreatedDate);
|
<td> <?php $Pdt = new DateTime($record->CreatedDate);
|
||||||
@ -216,7 +219,10 @@ $(document).ready(function() {
|
|||||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||||
],
|
],
|
||||||
pageLength: 10, // Default rows per page
|
pageLength: 10, // Default rows per page
|
||||||
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
|
lengthMenu: [
|
||||||
|
[10, 20, 30, 50, -1],
|
||||||
|
[10, 20, 30, 50, "All"]
|
||||||
|
], // Rows per page options
|
||||||
responsive: true, // Responsive table
|
responsive: true, // Responsive table
|
||||||
order: [], // Default ordering (column index 0, descending)
|
order: [], // Default ordering (column index 0, descending)
|
||||||
language: {
|
language: {
|
||||||
@ -232,17 +238,19 @@ $(document).ready(function() {
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -250,8 +258,13 @@ $(document).ready(function() {
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -283,8 +296,3 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -127,10 +127,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button" title="Search"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button" title="Search"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -295,17 +295,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -313,8 +315,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -71,10 +71,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -215,17 +215,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -233,11 +235,17 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Handle form submission for the date range filter
|
// Handle form submission for the date range filter
|
||||||
$("#DateRangeFilter").submit(function(e) {
|
$("#DateRangeFilter").submit(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@ -94,10 +94,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -270,17 +270,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -288,8 +290,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -69,10 +69,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -210,17 +210,19 @@
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -228,8 +230,13 @@
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -163,10 +163,10 @@
|
|||||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||||
<input type="hidden" name="table" value="requisition">
|
<input type="hidden" name="table" value="requisition">
|
||||||
<label for="fromDate">From:</label>
|
<label for="fromDate">From:</label>
|
||||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
<input class="form-control date_range form-date-search" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||||
|
|
||||||
<label for="toDate">To:</label>
|
<label for="toDate">To:</label>
|
||||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
<input class="form-control date_range to-date-search" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||||
|
|
||||||
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
<button type="submit" class="range_search_button"><i class="fe-search" aria-hidden="true" class="icon-button" title="Search"></i></button>
|
||||||
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||||
@ -1631,17 +1631,19 @@ function appendExistingFilesFileds(data){
|
|||||||
function(settings, data, dataIndex) {
|
function(settings, data, dataIndex) {
|
||||||
var fromDate = $('#fromDate').val();
|
var fromDate = $('#fromDate').val();
|
||||||
var toDate = $('#toDate').val();
|
var toDate = $('#toDate').val();
|
||||||
|
console.log(fromDate); // e.g., 01-09-2024
|
||||||
|
console.log(toDate); // e.g., 08-09-2024
|
||||||
|
|
||||||
if (!fromDate || !toDate) {
|
if (!fromDate || !toDate) {
|
||||||
return true; // If no dates selected, don't filter
|
return true; // If no dates selected, don't filter
|
||||||
}
|
}
|
||||||
|
|
||||||
var dateStr = data[0]; // Assuming the date is in the first column
|
// Convert the fromDate and toDate from dd-mm-yyyy to Date objects
|
||||||
var dateParts = dateStr.split("-");
|
var fromParts = fromDate.split("-");
|
||||||
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
|
var toParts = toDate.split("-");
|
||||||
|
|
||||||
var startDate = new Date(fromDate);
|
var startDate = new Date(fromParts[2], fromParts[1] - 1, fromParts[0]); // Year, month (0-based), day
|
||||||
var endDate = new Date(toDate);
|
var endDate = new Date(toParts[2], toParts[1] - 1, toParts[0]);
|
||||||
|
|
||||||
// Adjust startDate to include the day before the selected fromDate
|
// Adjust startDate to include the day before the selected fromDate
|
||||||
startDate.setDate(startDate.getDate() - 1);
|
startDate.setDate(startDate.getDate() - 1);
|
||||||
@ -1649,8 +1651,13 @@ function appendExistingFilesFileds(data){
|
|||||||
// Ensure endDate includes the entire end date by setting time to the end of the day
|
// Ensure endDate includes the entire end date by setting time to the end of the day
|
||||||
endDate.setHours(23, 59, 59, 999);
|
endDate.setHours(23, 59, 59, 999);
|
||||||
|
|
||||||
// Return true if the date is within the range
|
// Get the date from the DataTable row (assuming it's in the first column in dd-mm-yyyy format)
|
||||||
return date >= startDate && date <= endDate;
|
var dateStr = data[0];
|
||||||
|
var dateParts = dateStr.split("-");
|
||||||
|
var rowDate = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]);
|
||||||
|
|
||||||
|
// Return true if the row date is within the range
|
||||||
|
return rowDate >= startDate && rowDate <= endDate;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user