-
-
-
-
- Asset Details
-
+
+
+
+
+
+
-
-
-
-
-
+
+
-
-
+
| Created Date | @@ -122,13 +128,15 @@ ?>
|---|
-
-
+
+
@@ -171,77 +171,78 @@
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
+
// Initialize the DataTable
- var table = $('#configtable').DataTable({
- "paging": true,
- "lengthChange": true,
- "searching": true,
- "ordering": true,
- "columnDefs": [{
- "targets": 0,
- "type": "date-eu"
- }],
- "aaSorting": [
- [0, "desc"]
- ],
- "info": true,
- "autoWidth": true,
- "pageLength": 10,
- "lengthMenu": [10, 25, 50, 100],
-
+ var table = $('#config_list_table').DataTable({
+ dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
+ buttons: [
+ 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
+ ],
+ pageLength: 10, // Default rows per page
+ lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options
+ responsive: true, // Responsive table
+ order: [[0, 'desc']], // Default ordering (column index 0, descending)
+ language: {
+ paginate: {
+ next: '', // Next button icon
+ previous: '' // Previous button icon
+ }
+ }
});
- // Initialize the datepickers
- $("#fromDate").datepicker({
- dateFormat: 'dd-mm-yy',
- onSelect: function(selectedDate) {
- var minDate = $(this).datepicker("getDate");
- $("#toDate").datepicker("option", "minDate", minDate);
- }
- });
+ // Date range filter function
+ $.fn.dataTable.ext.search.push(
+ function(settings, data, dataIndex) {
+ var fromDate = $('#fromDate').val();
+ var toDate = $('#toDate').val();
+
+ if (!fromDate || !toDate) {
+ return true; // If no dates selected, don't filter
+ }
+
+ var dateStr = data[0]; // Assuming the date is in the first column
+ var dateParts = dateStr.split("-");
+ var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
+
+ var startDate = new Date(fromDate);
+ var endDate = new Date(toDate);
+
+ // Adjust startDate to include the day before the selected fromDate
+ 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);
- $("#toDate").datepicker({
- dateFormat: 'dd-mm-yy',
- onSelect: function(selectedDate) {
- var maxDate = $(this).datepicker("getDate");
- $("#fromDate").datepicker("option", "maxDate", maxDate);
- }
+ // Return true if the date is within the range
+ return date >= startDate && date <= endDate;
+ }
+ );
+
+ // Handle form submission for the date range filter
+ $("#DateRangeFilter").submit(function(e) {
+ e.preventDefault();
+ table.draw(); // Redraw the table to apply the filter
});
// 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();
+ $("#fromDate").val('');
+ $("#toDate").val('');
+ table.draw(); // Redraw the table to clear the filter
});
- // Date range filter
- $.fn.dataTable.ext.search.push(
+ // Automatically focus and open the To Date picker when From Date is selected
+ document.getElementById('fromDate').addEventListener('change', function() {
+ var fromDate = this.value;
+ var toDateInput = document.getElementById('toDate');
+
+ // Set the min attribute of the To Date input to the selected From Date
+ toDateInput.min = fromDate;
- 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
+ // Optionally reset the To Date input if the current value is before the new min date
+ if (toDateInput.value < fromDate) {
+ toDateInput.value = fromDate;
}
-
- return date >= fromDate && date <= toDate;
- }
- );
-
- // Handle form submission
- $("#DateRangeFilter").submit(function(e) {
- e.preventDefault();
- table.draw();
});
- });
+});
\ No newline at end of file
diff --git a/app/Views/costListing.php b/app/Views/costListing.php
index 565966f0..83679e4b 100644
--- a/app/Views/costListing.php
+++ b/app/Views/costListing.php
@@ -29,92 +29,9 @@
color: #0056b3;
}
-
-
+
-
-
-
- Configuration Details
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+
+ getFlashdata('error');
if ($error) {
@@ -87,26 +74,34 @@
+
+
+
+
+ Configuration Details
+
-
-
- listErrors('
- ', '
');
- ?>
-
+
-
-
-
+
+ | Create Date | Configuration ID | Configuration Name | Description | Action |
|---|
-
-
-
+
+
-
-
-
- Cost Details
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/Views/departmentListing.php b/app/Views/departmentListing.php
index 33525d93..2a58196a 100644
--- a/app/Views/departmentListing.php
+++ b/app/Views/departmentListing.php
@@ -41,13 +41,26 @@
color: #0056b3;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
\ No newline at end of file
diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php
index c354edc5..fe85699d 100644
--- a/app/Views/rawmaterialListing.php
+++ b/app/Views/rawmaterialListing.php
@@ -35,65 +35,59 @@
color: #0056b3;
}
-
-
+
-
-
-
+
+
-
+
+
-
+
-
+
+ getFlashdata('error');
if ($error) {
@@ -67,190 +80,153 @@
+
+
+
+
+ Department Details
+
-
-
- listErrors('
- ', '
');
- ?>
-
-
-
-
+
- Department Details
-
+
-
+
-
+
-
-
-
-
-
+
-
+
+
+
+
+
+
+ | Create Date | +Department Code | +Department Name | +Head Department | +IsActive | + +
|---|---|---|---|---|
| + | DEPCode; ?> | +DepartmentName ?> | +HeadDept ?> | +IsActive == 1) { + echo "Active"; + } else { + echo "In Active"; + } ?> | + +
-
-
-
-
-
-
- | Create Date | -Department Code | -Department Name | -Head Department | -IsActive | - -
|---|---|---|---|---|
| - | DEPCode; ?> | -DepartmentName ?> | -HeadDept ?> | -IsActive == 1) { - echo "Active"; - } else { - echo "In Active"; - } ?> | - -
-
-
+
-
-
- getFlashdata('error');
- if ($error) {
- $type = "error";
- echo show_alert($type, $error);
- }
- $success = session()->getFlashdata('success');
- if ($success) {
- $type = "success";
- echo show_alert($type, $success);
- }
- ?>
-
-
-
-
- listErrors('
- ', '
');
- ?>
-
+
-
-
-
- Material Master Details
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
+
+ | Created Date | Material Code | Material Description | @@ -133,14 +127,18 @@ } } ?> - -
|---|
+
+
+
+
+
+
-
+
+ Supplier Listing
+
-
-
-
+
+
| Create Date | @@ -77,8 +136,8 @@ $time = $createdat->format('h:i A'); ?>||||||
|---|---|---|---|---|---|---|
| - | + | + | id ?> | name ?> | FirstName ?> | @@ -106,9 +165,11 @@ + +