Merged
This commit is contained in:
commit
5126e8b3b7
@ -60,11 +60,11 @@
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
@ -188,87 +188,15 @@
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
// Initialize the DataTable
|
||||
var table = $('#example1').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],
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>$(document).ready(function() {
|
||||
$('#amend_po_list').DataTable({
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#amend_po_list').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -276,7 +204,7 @@ $(document).ready(function() {
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -284,6 +212,60 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -39,20 +39,20 @@
|
||||
align-items: center;
|
||||
}
|
||||
.dataTables_wrapper .dataTables_length {
|
||||
float: left;
|
||||
/* float: left; */
|
||||
}
|
||||
.dataTables_wrapper .dt-buttons,
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
/* float: right; */
|
||||
/* margin-left: 10px; */
|
||||
}
|
||||
.dataTables_wrapper .dt-buttons {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
/* margin-top: 10px; */
|
||||
/* margin-bottom: 10px; */
|
||||
}
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
/* margin-top: 10px; */
|
||||
/* margin-bottom: 10px; */
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -88,14 +88,13 @@
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
<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> <div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="po_list" class="table dt-responsive nowrap w-100">
|
||||
@ -202,146 +201,12 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
// Initialize the DataTable
|
||||
var table = $('#dataTableHistoriek').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"scrollCollapse": 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],
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Purchase Order',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Purchase Order',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}]
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- <script>
|
||||
$(function () {
|
||||
$.fn.dataTable.moment('DD-MM-YYYY');
|
||||
$('#dataTableHistoriek').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"scrollCollapse": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"scrollX": true,
|
||||
"autoWidth": true,
|
||||
"pageLength": 10,
|
||||
"order": [[0, "desc"]], // Assuming the "Created Date" is the first column and you want to order by it in descending order
|
||||
"dom": '<"top"lBf>rt<"bottom"ip><"clear">', // Custom layout
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Purchase Order',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Purchase Order',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script> -->
|
||||
|
||||
<script>$(document).ready(function() {
|
||||
$('#po_list').DataTable({
|
||||
var table = $('#po_list').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -349,7 +214,7 @@ $(document).ready(function() {
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -357,6 +222,60 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -35,43 +35,49 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<CENTER>
|
||||
<h3 class="box-title"> Asset Details</h3>
|
||||
</CENTER>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addasset">Add New Asset</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportasset">Export Asset Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Asset Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addasset">Add New Asset</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportasset">Export Asset Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="view_inward_gate_register" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered table-hover" id="asset_list_table" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th>Created Date</th>
|
||||
@ -122,13 +128,15 @@
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<!-- <script type="text/javascript">
|
||||
@ -150,83 +158,81 @@
|
||||
|
||||
</script> -->
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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],
|
||||
|
||||
});
|
||||
|
||||
// Initialize the datepickers
|
||||
$("#fromDate").datepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
onSelect: function(selectedDate) {
|
||||
var minDate = $(this).datepicker("getDate");
|
||||
$("#toDate").datepicker("option", "minDate", minDate);
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#asset_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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
}
|
||||
});
|
||||
|
||||
$("#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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -35,39 +35,26 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<CENTER>
|
||||
<h3 class="box-title"> Configuration Details</h3>
|
||||
</CENTER>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addconfig">Add New Configuration</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Configuration Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addconfig">Add New Configuration</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
@ -87,26 +74,34 @@
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table id="configtable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="config_list_table" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Configuration ID</th>
|
||||
<th>Configuration Name</th>
|
||||
<th>Description</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($userRecords)) {
|
||||
foreach ($userRecords as $record) {
|
||||
?>
|
||||
@ -137,12 +132,17 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
@ -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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // 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();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -29,92 +29,9 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<CENTER>
|
||||
<h3 class="box-title"> Cost Details</h3>
|
||||
</CENTER>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" >
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a data-toggle="modal" href="#ccwizard" data-id="0" data-name="" class="btn btn-success">Add New Cost List</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportcost">Export Cost Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table id="datatable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Create Time</th>
|
||||
<th>Cost Center Code</th>
|
||||
<th>Cost Center Name</th>
|
||||
<th>Created By</th>
|
||||
<th>Active</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($userRecords)) {
|
||||
foreach ($userRecords as $record) {
|
||||
$createdat = new DateTime($record->CreatedDate);
|
||||
$date = $createdat->format('d-m-Y');
|
||||
$time = $createdat->format('h:i A');
|
||||
?>
|
||||
<tr>
|
||||
<td align="right"><?php echo $date; ?></td>
|
||||
<td align="right"><?php echo $time; ?></td>
|
||||
<td><?php echo $record->code ?></td>
|
||||
<td><?php echo $record->CostCenterName ?></td>
|
||||
<!-- <td><?php echo $record->ApprovedBy ?></td> -->
|
||||
<td><?php echo $record->FirstName ?></td>
|
||||
<td><?php
|
||||
$R = '';
|
||||
$record->IsActive == 1 ? $R = 'ACTIVE' : $R = 'INACTIVE';
|
||||
echo $R;
|
||||
?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($record->DeletedBy == '') {
|
||||
?>
|
||||
<a data-toggle="modal" href="#ccwizard" data-id="<?php echo $record->id; ?>" data-name="<?php echo $record->CostCenterName; ?>" ><i class="fa fa-pencil"></i></a>
|
||||
<a href="<?php echo base_url() . 'deleteCostCenter?CostCode=' . $record->code; ?>"><i class="fa fa-trash"></i> </a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- for Add and edit Modal -->
|
||||
<div class="modal fade" id="ccwizard" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="ccwizard" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
@ -153,13 +70,96 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Cost Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a data-toggle="modal" href="#ccwizard" data-id="0" data-name="" class="btn btn-success">Add New Cost List</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportcost">Export Cost Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
|
||||
<table id="cost_listing" class="table dt-responsive nowrap w-100">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Create Time</th>
|
||||
<th>Cost Center Code</th>
|
||||
<th>Cost Center Name</th>
|
||||
<th>Created By</th>
|
||||
<th>Active</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($userRecords)) {
|
||||
foreach ($userRecords as $record) {
|
||||
$createdat = new DateTime($record->CreatedDate);
|
||||
$date = $createdat->format('d-m-Y');
|
||||
$time = $createdat->format('h:i A');
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $date; ?></td>
|
||||
<td><?php echo $time; ?></td>
|
||||
<td><?php echo $record->code ?></td>
|
||||
<td><?php echo $record->CostCenterName ?></td>
|
||||
<!-- <td><?php echo $record->ApprovedBy ?></td> -->
|
||||
<td><?php echo $record->FirstName ?></td>
|
||||
<td><?php
|
||||
$R = '';
|
||||
$record->IsActive == 1 ? $R = 'ACTIVE' : $R = 'INACTIVE';
|
||||
echo $R;
|
||||
?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($record->DeletedBy == '') {
|
||||
?>
|
||||
<a data-toggle="modal" href="#ccwizard" data-id="<?php echo $record->id; ?>" data-name="<?php echo $record->CostCenterName; ?>" ><i class="fas fa-pencil-alt"></i></a>
|
||||
<a href="<?php echo base_url() . 'deleteCostCenter?CostCode=' . $record->code; ?>"><i class="fa fa-trash"></i> </a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||
<script type="text/javascript">
|
||||
@ -230,82 +230,82 @@
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"columnDefs": [{
|
||||
"targets": 0,
|
||||
"type": "date-eu"
|
||||
}],
|
||||
"aaSorting": [
|
||||
[0, "desc"]
|
||||
var table = $('#cost_listing').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
],
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
"pageLength": 10,
|
||||
"lengthMenu": [10, 25, 50, 100],
|
||||
|
||||
});
|
||||
|
||||
// Initialize the datepickers
|
||||
$("#fromDate").datepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
onSelect: function(selectedDate) {
|
||||
var minDate = $(this).datepicker("getDate");
|
||||
$("#toDate").datepicker("option", "minDate", minDate);
|
||||
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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("#toDate").datepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
onSelect: function(selectedDate) {
|
||||
var maxDate = $(this).datepicker("getDate");
|
||||
$("#fromDate").datepicker("option", "maxDate", maxDate);
|
||||
// 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);
|
||||
|
||||
// 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(
|
||||
|
||||
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
|
||||
// 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;
|
||||
|
||||
if (!fromDate || !toDate) {
|
||||
return true; // No filter if dates are not selected
|
||||
}
|
||||
|
||||
return date >= fromDate && date <= toDate;
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
);
|
||||
|
||||
// Handle form submission
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
|
||||
</script>
|
||||
@ -37,261 +37,330 @@
|
||||
float: inline-end;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
#Requisition_filter {
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
#Requisition_wrapper .row .col-sm-4 {
|
||||
flex-basis: 50%;
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
#Requisition_paginate .pagination {
|
||||
flex-basis: 50%;
|
||||
float: inline-end;
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
#Requisition_wrapper .row:nth-child(3),
|
||||
#Requisition_wrapper .row:nth-child(1) {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
#Requisition_info {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
span.highlight {
|
||||
background-color: yellow;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.Date-filter-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
.Date-filter-form input, .Date-filter-form button {
|
||||
padding: 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.Date-filter-form button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Date-filter-form button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.icon-button {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: #007bff;
|
||||
font-size: 18px;
|
||||
}
|
||||
.icon-button:hover {
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<?php $attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO', 'method' => 'post', 'role' => 'form');
|
||||
<?php $attributes = array('class' => 'form-label-left CreatePO ', 'name' => 'CreatePO', 'id' => 'CreatePO', 'method' => 'post', 'role' => 'form');
|
||||
echo form_open(base_url() . 'purchaseOrder', $attributes); ?>
|
||||
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Create Purchase Order from Requistion</h4>
|
||||
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Create Purchase Order from Requistion</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4">
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
?>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('error'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
$success = session()->getFlashdata('success');
|
||||
if ($success) {
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('success'); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('error'); ?>
|
||||
</div>
|
||||
<?php
|
||||
$listErrors = session()->getFlashdata('listErrors');
|
||||
if ($listErrors) {
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('listErrors'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-12" style="margin-top: -79px;">
|
||||
<!-- <div class="col-md-3 col-md-offset-9"> -->
|
||||
<p>
|
||||
<div align="right" style="padding-right:0px">
|
||||
<!--<a href="<?php echo base_url(); ?>purchaseorderform/purchaseorder"> -->
|
||||
<!--<button type="button" class="btn btn-success">Create PO</button></a> -->
|
||||
<!--<input type="submit" class="btn btn-success" onclick="return Validate();" value="Create Purchase Order"> -->
|
||||
<a class="btn btn-success" onclick="Validate();">Create Purchase Order</a>
|
||||
<input type="hidden" name="txtReqNo" id="txtReqNo" />
|
||||
<input type="hidden" name="txtReqType" id="txtReqType" />
|
||||
</div>
|
||||
</p>
|
||||
<!-- </div> -->
|
||||
<?php
|
||||
$success = session()->getFlashdata('success');
|
||||
if ($success) {
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('success'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="modal fade" id="RequisitionDtlsModal" role="dialog">
|
||||
<div class="modal-dialog" style="vertical-align: middle;width: fit-content">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:800px">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center>
|
||||
<h4> Requisition Details - <label id="SelReqNo" name="SelReqNo"></label> </h4>
|
||||
</center>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Request Type</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ReqType', 'value' => set_value('ReqType'), 'id' => 'ReqType', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Requested By</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ReqBy', 'value' => set_value('ReqBy'), 'id' => 'ReqBy', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Designation</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Requested Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RequistionDate', 'value' => set_value('RequistionDate'), 'id' => 'RequistionDate', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Cost Center Code</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Avl Budget Amt</label> <img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none" />
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table table-bordered editableTable" style="border:1px solid #fff">
|
||||
<thead style="background-color: #ddd !important;">
|
||||
<tr>
|
||||
<th style="white-space: nowrap;">SNo</th>
|
||||
<th style="white-space: nowrap;">Item Code</th>
|
||||
<th style="white-space: nowrap;">Item Description</th>
|
||||
<th style="white-space: nowrap;">UOM</th>
|
||||
<th style="white-space: nowrap;">Requested Quantity</th>
|
||||
<th style="white-space: nowrap;">Ordered Quantity</th>
|
||||
<th style="white-space: nowrap;">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleAppend"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table id="create_po_from_requistion" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Select</th>
|
||||
<th>Requested Date</th>
|
||||
<th>Requistion Number</th>
|
||||
<th>Requistion Type </th>
|
||||
<th>Requested By</th>
|
||||
<th>Tot. No. Of Line Items</th>
|
||||
<th>Po Created Line Items</th>
|
||||
<th>Partial PO Created Line Items</th>
|
||||
<th>New Line Items</th>
|
||||
<th>Status</th>
|
||||
<th>Department</th>
|
||||
<th>Designation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($ReqList)) { //alert($ReqList);
|
||||
$index = 1;
|
||||
foreach ($ReqList as $record) {
|
||||
?>
|
||||
<tr id="<?php echo $index; ?>">
|
||||
<td><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
||||
<td align="right">
|
||||
<?php
|
||||
$dt = new DateTime($record->ReqDate);
|
||||
$RequestedDate = $dt->format('d-m-Y');
|
||||
echo $RequestedDate;
|
||||
?>
|
||||
</td>
|
||||
<td><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><?php echo $record->ReqType; ?></td>
|
||||
<td><?php echo $record->FirstName; ?></td>
|
||||
<td align="right"><?php echo $record->TotalNoofLineItems; ?></td>
|
||||
<td align="right"><?php echo $record->PolineItems; ?></td>
|
||||
<td align="right"><?php echo $record->PartilallyLineItems; ?></td>
|
||||
<td align="right"><?php echo $record->newLineItem; ?></td>
|
||||
<td><?php echo $record->StatusName; ?></td>
|
||||
<td><?php echo $record->DepartmentName; ?></td>
|
||||
<td><?php echo $record->Designation; ?></td>
|
||||
</tr>
|
||||
<?php $index = $index + 1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal fade" id="ImportPOCheck" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content modal-content-custom-width">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Do You want to create Import PO for this Requistion?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="optImport" value="0" id="optImport">YES</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="optImport" value="1" id="optImport" checked="checked">NO</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!--<a class="btn btn-success" ID="Import" onclick="SetImportPO();" style="margin-top: -24px;">-->
|
||||
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
<input type="submit" class="btn btn-success" onclick="SetImportPO();" value="OK" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$listErrors = session()->getFlashdata('listErrors');
|
||||
if ($listErrors) { ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-danger alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<?php echo session()->getFlashdata('listErrors'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-12" style="margin-top: -79px;">
|
||||
<!-- <div class="col-md-3 col-md-offset-9"> -->
|
||||
<p>
|
||||
<div align="right" style="padding-right:0px">
|
||||
<!--<a href="<?php echo base_url(); ?>purchaseorderform/purchaseorder"> -->
|
||||
<!--<button type="button" class="btn btn-success">Create PO</button></a> -->
|
||||
<!--<input type="submit" class="btn btn-success" onclick="return Validate();" value="Create Purchase Order"> -->
|
||||
<a class="btn btn-success" onclick="Validate();">Create Purchase Order</a>
|
||||
<input type="hidden" name="txtReqNo" id="txtReqNo" />
|
||||
<input type="hidden" name="txtReqType" id="txtReqType" />
|
||||
</div>
|
||||
</p>
|
||||
<!-- </div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="card">
|
||||
<span class="Date-filter-form" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" type="date" 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>
|
||||
<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>
|
||||
</span>
|
||||
<div class="card-body">
|
||||
<div class="modal fade" id="RequisitionDtlsModal" role="dialog">
|
||||
<div class="modal-dialog" style="vertical-align: middle;width: fit-content">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:800px">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center>
|
||||
<h4> Requisition Details - <label id="SelReqNo" name="SelReqNo"></label> </h4>
|
||||
</center>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Request Type</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ReqType', 'value' => set_value('ReqType'), 'id' => 'ReqType', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Requested By</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ReqBy', 'value' => set_value('ReqBy'), 'id' => 'ReqBy', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Designation</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<label>Requested Date</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RequistionDate', 'value' => set_value('RequistionDate'), 'id' => 'RequistionDate', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Cost Center Code</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label>Avl Budget Amt</label> <img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none" />
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table table-bordered editableTable" style="border:1px solid #fff">
|
||||
<thead style="background-color: #ddd !important;">
|
||||
<tr>
|
||||
<th style="white-space: nowrap;">SNo</th>
|
||||
<th style="white-space: nowrap;">Item Code</th>
|
||||
<th style="white-space: nowrap;">Item Description</th>
|
||||
<th style="white-space: nowrap;">UOM</th>
|
||||
<th style="white-space: nowrap;">Requested Quantity</th>
|
||||
<th style="white-space: nowrap;">Ordered Quantity</th>
|
||||
<th style="white-space: nowrap;">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleAppend"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<table id="create_po_from_requistion" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Select</th>
|
||||
<th>Requested Date</th>
|
||||
<th>Requistion Number</th>
|
||||
<th>Requistion Type </th>
|
||||
<th>Requested By</th>
|
||||
<th>Tot. No. Of Line Items</th>
|
||||
<th>Po Created Line Items</th>
|
||||
<th>Partial PO Created Line Items</th>
|
||||
<th>New Line Items</th>
|
||||
<th>Status</th>
|
||||
<th>Department</th>
|
||||
<th>Designation</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (!empty($ReqList)) { //alert($ReqList);
|
||||
$index = 1;
|
||||
foreach ($ReqList as $record) {
|
||||
?>
|
||||
<tr id="<?php echo $index; ?>">
|
||||
<td><input type="checkbox" name="chk<?php echo $index; ?>" id="chk<?php echo $index; ?>" onclick="selectReqNo(<?php echo $index; ?>)" /> </td>
|
||||
<td align="right">
|
||||
<?php
|
||||
$dt = new DateTime($record->ReqDate);
|
||||
$RequestedDate = $dt->format('d-m-Y');
|
||||
echo $RequestedDate;
|
||||
?>
|
||||
</td>
|
||||
<td><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><?php echo $record->ReqType; ?></td>
|
||||
<td><?php echo $record->FirstName; ?></td>
|
||||
<td align="right"><?php echo $record->TotalNoofLineItems; ?></td>
|
||||
<td align="right"><?php echo $record->PolineItems; ?></td>
|
||||
<td align="right"><?php echo $record->PartilallyLineItems; ?></td>
|
||||
<td align="right"><?php echo $record->newLineItem; ?></td>
|
||||
<td><?php echo $record->StatusName; ?></td>
|
||||
<td><?php echo $record->DepartmentName; ?></td>
|
||||
<td><?php echo $record->Designation; ?></td>
|
||||
</tr>
|
||||
<?php $index = $index + 1;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="modal fade" id="ImportPOCheck" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content modal-content-custom-width">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Do You want to create Import PO for this Requistion?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="optImport" value="0" id="optImport">YES</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="optImport" value="1" id="optImport" checked="checked">NO</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<!--<a class="btn btn-success" ID="Import" onclick="SetImportPO();" style="margin-top: -24px;">-->
|
||||
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
<input type="submit" class="btn btn-success" onclick="SetImportPO();" value="OK" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
@ -326,9 +395,13 @@
|
||||
|
||||
|
||||
function selectReqNo(rowId) {
|
||||
|
||||
console.log("entered");
|
||||
|
||||
ckb = $('#chk' + rowId).is(':checked');
|
||||
var tr = document.getElementById(rowId);
|
||||
var cellval = tr.cells;
|
||||
console.log(cellval)
|
||||
//coo/kie_value_add = {};
|
||||
if (!ckb) {
|
||||
var removeItem = cellval[2].innerText;
|
||||
@ -340,22 +413,28 @@
|
||||
} else {
|
||||
var tr = document.getElementById(rowId);
|
||||
var cellval = tr.cells;
|
||||
|
||||
|
||||
//alert(RequistionList.Req.length);
|
||||
if (RequistionList.Req.length > 0) {
|
||||
|
||||
console.log("111111111");
|
||||
|
||||
if (Type == cellval[3].innerText) {
|
||||
|
||||
RequistionList.Req.push({
|
||||
"ReqNo": cellval[2].innerText,
|
||||
"ReqType": cellval[3].innerText,
|
||||
"ReqBy": cellval[4].innerText,
|
||||
});
|
||||
} else {
|
||||
console.log("333333333");
|
||||
|
||||
alert('Same type of Requistion only can be together.')
|
||||
$('#chk' + rowId).attr('checked', false);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
RequistionList.Req.push({
|
||||
"ReqNo": cellval[2].innerText,
|
||||
"ReqType": cellval[3].innerText,
|
||||
@ -366,6 +445,9 @@
|
||||
}
|
||||
i = i + 1;
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(RequistionList));
|
||||
|
||||
$('#txtReqNo').val(JSON.stringify(RequistionList));
|
||||
}
|
||||
|
||||
@ -396,6 +478,10 @@
|
||||
|
||||
function Validate() {
|
||||
var ReqNo = $('#txtReqNo').val();
|
||||
console.log("--------------");
|
||||
|
||||
console.log(ReqNo);
|
||||
|
||||
if (ReqNo.length <= 0) {
|
||||
alert('Please select the Requisition Number to Create Purchase Order');
|
||||
return false;
|
||||
@ -425,8 +511,12 @@
|
||||
});
|
||||
</script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
|
||||
<script>$(document).ready(function() {
|
||||
$('#create_po_from_requistion').DataTable({
|
||||
<script>
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#create_po_from_requistion').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -434,7 +524,7 @@
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -442,6 +532,61 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
// 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[1]; // 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);
|
||||
|
||||
// Return true if the date is within the range
|
||||
return date >= startDate && date <= endDate;
|
||||
}
|
||||
);
|
||||
|
||||
// Handle form submission for the date range filter
|
||||
$("#DateRangeFilter").click(function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
table.draw(); // Redraw the table to apply the filter
|
||||
});
|
||||
|
||||
// Reset button functionality
|
||||
$("#resetButton").click(function() {
|
||||
$("#fromDate").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -41,13 +41,26 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<!-- <section class="content-header"> -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Department Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>adddepartment">Add New department</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportdepartment">Export department details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
@ -67,190 +80,153 @@
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<center>
|
||||
<h3 class="box-title">Department Details</h3>
|
||||
</center>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<!-- </section> -->
|
||||
<!-- <section class="content"> -->
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="department_list_table" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Department Code</th>
|
||||
<th>Department Name</th>
|
||||
<th>Head Department</th>
|
||||
<th>IsActive</th>
|
||||
<!-- <th>Action</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($userRecords)) {
|
||||
foreach ($userRecords as $record) {
|
||||
?>
|
||||
<tr>
|
||||
<!-- <td title=" - Click here to view department details"> </td> -->
|
||||
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
|
||||
$cdate = '00-00-0000';
|
||||
} else {
|
||||
$cdate = date('d-m-Y', strtotime($record->CreatedDt));
|
||||
} ?>
|
||||
<td align="right"><?php echo $cdate; ?> </td>
|
||||
<td><u><a href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>" data-toggle="tooltip" title="<?php echo $record->DEPCode ?> - Click here to view Department details"><?php echo $record->DEPCode; ?></a></u></td>
|
||||
<td><?php echo $record->DepartmentName ?></td>
|
||||
<td><?php echo $record->HeadDept ?></td>
|
||||
<td><?php if ($record->IsActive == 1) {
|
||||
echo "Active";
|
||||
} else {
|
||||
echo "In Active";
|
||||
} ?></td>
|
||||
<!-- <td><a data-toggle="tooltip" "><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the department details"></i> </a></td> -->
|
||||
</tr>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>adddepartment">Add New department</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportdepartment">Export department details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Department Code</th>
|
||||
<th>Department Name</th>
|
||||
<th>Head Department</th>
|
||||
<th>IsActive</th>
|
||||
<!-- <th>Action</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if (!empty($userRecords)) {
|
||||
foreach ($userRecords as $record) {
|
||||
?>
|
||||
<tr>
|
||||
<!-- <td title=" - Click here to view department details"> </td> -->
|
||||
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
|
||||
$cdate = '00-00-0000';
|
||||
} else {
|
||||
$cdate = date('d-m-Y', strtotime($record->CreatedDt));
|
||||
} ?>
|
||||
<td align="right"><?php echo $cdate; ?> </td>
|
||||
<td><u><a href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>" data-toggle="tooltip" title="<?php echo $record->DEPCode ?> - Click here to view Department details"><?php echo $record->DEPCode; ?></a></u></td>
|
||||
<td><?php echo $record->DepartmentName ?></td>
|
||||
<td><?php echo $record->HeadDept ?></td>
|
||||
<td><?php if ($record->IsActive == 1) {
|
||||
echo "Active";
|
||||
} else {
|
||||
echo "In Active";
|
||||
} ?></td>
|
||||
<!-- <td><a data-toggle="tooltip" "><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the department details"></i> </a></td> -->
|
||||
</tr>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- colsxs12 div closed-->
|
||||
</div><!-- row div closed -->
|
||||
</div><!-- containerfluid div closed -->
|
||||
</div><!-- box div closed -->
|
||||
</section>
|
||||
|
||||
</div><!-- content wrapper div closed -->
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<!-- <script type="text/javascript">
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#datatable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script> -->
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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 = $('#department_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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // 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();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -62,6 +62,11 @@
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/js/pages/c3.init.js"></script>
|
||||
|
||||
<script src="<?php echo base_url(); ?>public/new_assets/libs/select2/js/select2.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -59,8 +59,25 @@
|
||||
<link href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css" rel="stylesheet">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<style>
|
||||
|
||||
.date_range{
|
||||
width:auto;
|
||||
}
|
||||
.range_search_button{
|
||||
background-color: blue;
|
||||
color: #fff;
|
||||
width: 55px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.range_reset_button{
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
width: 55px;
|
||||
border-radius: 5px;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.content-page {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
@ -110,13 +110,13 @@ if (empty($Status)) {
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<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>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
@ -507,104 +507,13 @@ if (empty($Status)) {
|
||||
var dateSplit = date.split('/');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#Requisition').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],
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Approve Purchase Order List',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Approve Purchase Order List',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}]
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>$(document).ready(function() {
|
||||
$('#po_release').DataTable({
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#po_release').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -612,7 +521,7 @@ if (empty($Status)) {
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -620,6 +529,60 @@ if (empty($Status)) {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -35,65 +35,59 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
$type = "error";
|
||||
echo show_alert($type, $error);
|
||||
}
|
||||
$success = session()->getFlashdata('success');
|
||||
if ($success) {
|
||||
$type = "success";
|
||||
echo show_alert($type, $success);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section class="content">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<CENTER>
|
||||
<h3 class="box-title"> Material Master Details</h3>
|
||||
</CENTER>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportmaterial">Export Material Master <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Material Master Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportmaterial">Export Material Master <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
$type = "error";
|
||||
echo show_alert($type, $error);
|
||||
}
|
||||
$success = session()->getFlashdata('success');
|
||||
if ($success) {
|
||||
$type = "success";
|
||||
echo show_alert($type, $success);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="raw_material_list_table" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
<th>Created Date</th>
|
||||
<th>Material Code</th>
|
||||
<th>Material Description</th>
|
||||
@ -133,14 +127,18 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<!-- <script type="text/javascript">
|
||||
|
||||
@ -166,76 +164,76 @@
|
||||
};
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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 = $('#raw_material_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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // 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();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -115,13 +115,13 @@ span.highlight {
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<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>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
@ -217,92 +217,10 @@ function DeleteRow(rowid) {
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#Requisition').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"columnDefs": [{
|
||||
"targets": 0,
|
||||
"type": "date-eu"
|
||||
}],
|
||||
"aaSorting": [
|
||||
[1, "desc"]
|
||||
],
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
"pageLength": 10,
|
||||
"lengthMenu": [10, 25, 50, 100],
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>$(document).ready(function() {
|
||||
$('#requisition_listing').DataTable({
|
||||
var table = $('#requisition_listing').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -310,7 +228,7 @@ $(document).ready(function() {
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -318,6 +236,65 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -36,45 +36,118 @@
|
||||
}
|
||||
|
||||
</style>
|
||||
<style>
|
||||
#Requisition_filter {
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
#Requisition_wrapper .row .col-sm-4 {
|
||||
flex-basis: 50%;
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
#Requisition_paginate .pagination {
|
||||
flex-basis: 50%;
|
||||
float: inline-end;
|
||||
margin: 0 0 15px;
|
||||
}
|
||||
|
||||
#Requisition_wrapper .row:nth-child(3),
|
||||
#Requisition_wrapper .row:nth-child(1) {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
#Requisition_info {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
span.highlight {
|
||||
background-color: yellow;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.Date-filter-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
.Date-filter-form input, .Date-filter-form button {
|
||||
padding: 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.Date-filter-form button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Date-filter-form button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.icon-button {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: #007bff;
|
||||
font-size: 18px;
|
||||
}
|
||||
.icon-button:hover {
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Invoices Table</h4>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th >Invoice Date</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Client Name</th>
|
||||
<th >Product</th>
|
||||
<th>Rate</th>
|
||||
<th>Quantity</th>
|
||||
<th>Sub Total</th>
|
||||
<th>GST</th>
|
||||
<th>Total</th>
|
||||
<th>Status</th>
|
||||
<th >E-Invoice Number</th>
|
||||
<th >Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<input type="text" id="invoice_id_set" name="invoice_id_set" hidden>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" type="date" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="datatable-buttosns" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th >Invoice Date</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Client Name</th>
|
||||
<th >Product</th>
|
||||
<th>Rate</th>
|
||||
<th>Quantity</th>
|
||||
<th>Sub Total</th>
|
||||
<th>GST</th>
|
||||
<th>Total</th>
|
||||
<th>Status</th>
|
||||
<th >E-Invoice Number</th>
|
||||
<th >Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<input type="text" id="invoice_id_set" name="invoice_id_set" hidden>
|
||||
<?php if(!empty($sales_invoice)){ foreach($sales_invoice as $invoice){
|
||||
|
||||
$subtotal = $invoice->item_price * $invoice->item_quantity;
|
||||
@ -83,39 +156,38 @@
|
||||
$sgst_amount = ($subtotal * $invoice->sgst) / 100;
|
||||
$total = $subtotal + $cgst_amount + $sgst_amount;?>
|
||||
<!-- Main invoice row -->
|
||||
<tr >
|
||||
<td ><?php echo date('d-m-Y', strtotime($invoice->invoice_date_created)); ?></td>
|
||||
<td >
|
||||
<?php if(!empty($invoice->invoice_url)){ ?>
|
||||
<a href="<?php echo $invoice->invoice_url; ?>" target="_blank" class="invoice-link">
|
||||
<?php } ?>
|
||||
<?php echo $invoice->invoice_number; ?>
|
||||
<?php if(!empty($invoice->invoice_url)){ ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td ><?php echo $invoice->client_name ?></td>
|
||||
<td ><?php echo $invoice->item_name ?></td>
|
||||
<td ><?php echo $invoice->item_price ?></td>
|
||||
<td ><?php echo number_format($invoice->item_quantity, 2 ,'.', ',' ) ?></td>
|
||||
<td ><?php echo number_format($subtotal, 2, '.', ',') ?></td>
|
||||
<td ><?php echo number_format($cgst_amount+$sgst_amount, 2, '.', ',') ?></td>
|
||||
<td ><?php echo number_format($total, 2, '.', ',') ?></td>
|
||||
<td ><?php echo $invoice->status ?></td>
|
||||
<td ><?php echo $invoice->e_invoice_number; ?></td>
|
||||
<td >
|
||||
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
|
||||
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td ><?php echo date('d-m-Y', strtotime($invoice->invoice_date_created)); ?></td>
|
||||
<td >
|
||||
<?php if(!empty($invoice->invoice_url)){ ?>
|
||||
<a href="<?php echo $invoice->invoice_url; ?>" target="_blank" class="invoice-link">
|
||||
<?php } ?>
|
||||
<?php echo $invoice->invoice_number; ?>
|
||||
<?php if(!empty($invoice->invoice_url)){ ?>
|
||||
</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td ><?php echo $invoice->client_name ?></td>
|
||||
<td ><?php echo $invoice->item_name ?></td>
|
||||
<td ><?php echo $invoice->item_price ?></td>
|
||||
<td ><?php echo number_format($invoice->item_quantity, 2 ,'.', ',' ) ?></td>
|
||||
<td ><?php echo number_format($subtotal, 2, '.', ',') ?></td>
|
||||
<td ><?php echo number_format($cgst_amount+$sgst_amount, 2, '.', ',') ?></td>
|
||||
<td ><?php echo number_format($total, 2, '.', ',') ?></td>
|
||||
<td ><?php echo $invoice->status ?></td>
|
||||
<td ><?php echo $invoice->e_invoice_number; ?></td>
|
||||
<td >
|
||||
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
|
||||
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
@ -123,8 +195,10 @@
|
||||
</div>
|
||||
|
||||
|
||||
<script>$(document).ready(function() {
|
||||
$('#datatable-buttosns').DataTable({
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable-buttosns').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -132,7 +206,7 @@
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -140,7 +214,60 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
@ -35,12 +35,11 @@
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
if ($error) {
|
||||
@ -54,47 +53,41 @@
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<center><b>
|
||||
<h3 class="box-title">Supplier Listing</h3>
|
||||
</b></center>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Supplier Listing</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addsupplier">Add New Supplier</a>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>exportsupplier">Export Supplier Details <i class="fa fa-download" aira-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:11px !important;">
|
||||
<thead style="background-color: #ddd;">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table class="table dt-responsive nowrap w-100" id="datatable" >
|
||||
<thead >
|
||||
<tr>
|
||||
<th style="width:75px">Created Date</th>
|
||||
<th>Supplier ID</th>
|
||||
@ -131,7 +124,7 @@
|
||||
<td><?php if ($record->IsActive == 0) {
|
||||
echo "Deactived";
|
||||
} else { ?>
|
||||
<a onclick="deletesupplier('<?php echo $record->SupplierID; ?>')"><i class="fa fa-trash"></i> </a>
|
||||
<a onclick="deletesupplier('<?php echo $record->SupplierID; ?>')"><i class="fa fa-trash" style="color:#02a8b5;"></i> </a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -141,13 +134,15 @@
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
// $(function () {
|
||||
@ -189,77 +184,78 @@
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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],
|
||||
|
||||
});
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // 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;
|
||||
}
|
||||
);
|
||||
|
||||
// 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();
|
||||
});
|
||||
// Handle form submission for the date range filter
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw(); // Redraw the table to apply the filter
|
||||
});
|
||||
|
||||
// Date range filter
|
||||
$.fn.dataTable.ext.search.push(
|
||||
// Reset button functionality
|
||||
$("#resetButton").click(function() {
|
||||
$("#fromDate").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
function(settings, data, dataIndex) {
|
||||
var fromDate = $("#fromDate").datepicker("getDate");
|
||||
var toDate = $("#toDate").datepicker("getDate");
|
||||
// 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;
|
||||
|
||||
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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -37,26 +37,85 @@
|
||||
color: rgb(173, 3, 23);
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
.modal-content
|
||||
{
|
||||
width: 800px ! important;
|
||||
}
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.Date-filter-form {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px; /* Adjust the gap as needed */
|
||||
}
|
||||
.Date-filter-form input, .Date-filter-form button {
|
||||
padding: 5px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.Date-filter-form button {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.Date-filter-form button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.icon-button {
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: #007bff;
|
||||
font-size: 18px;
|
||||
}
|
||||
.icon-button:hover {
|
||||
color: #0056b3;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4><?= "Transporter Details"; ?></h4>
|
||||
<a data-toggle="modal" href="#transporterwizard" data-id="0" data-name="" class="btn btn-success">Add New Transporter</a> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<!-- Form row -->
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Transporter Details</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a data-toggle="modal" href="#transporterwizard" data-id="0" data-name="" class="btn btn-success">Add New Transporter</a> </div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" 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>
|
||||
<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>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="datatable-buttons" class="table dt-responsive nowrap w-100">
|
||||
<table id="transporter_list" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
@ -77,8 +136,8 @@
|
||||
$time = $createdat->format('h:i A');
|
||||
?>
|
||||
<tr>
|
||||
<td align="right"><?php echo $date; ?></td>
|
||||
<td align="right"><?php echo $time; ?></td>
|
||||
<td><?php echo $date; ?></td>
|
||||
<td><?php echo $time; ?></td>
|
||||
<td><?php echo $record->id ?></td>
|
||||
<td><?php echo $record->name ?></td>
|
||||
<td><?php echo $record->FirstName ?></td>
|
||||
@ -106,9 +165,11 @@
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<!-- for Add and edit Modal -->
|
||||
<div id="transporterwizard" class="modal fade" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
@ -191,9 +252,10 @@
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$('#datatable-buttons').DataTable({
|
||||
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#transporter_list').DataTable({
|
||||
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
|
||||
@ -201,7 +263,7 @@
|
||||
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, ascending)
|
||||
order: [[0, 'desc']], // Default ordering (column index 0, descending)
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
@ -209,4 +271,60 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -36,11 +36,23 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-wrapper">
|
||||
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">User Listing</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6 text-right">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addNew">Add New User</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
helper('form');
|
||||
$error = session()->getFlashdata('error');
|
||||
@ -54,48 +66,25 @@
|
||||
echo show_alert($type, $success);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<?php // \Config\Services::validation()->listErrors('<div class="alert alert-danger alert-dismissable">', ' <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>');
|
||||
?> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<center><b>
|
||||
<h3 class="box-title">User Listing</h3>
|
||||
</b></center>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<form class="Date-filter-form" id="DateRangeFilter">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-right">
|
||||
<div class="form-group">
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addNew">Add New User</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<table class="table table-hover table-bordered" id="datatable" style="background-color:#fff;font-size:12px;">
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th>Created Date</th>
|
||||
<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>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="user_list_table" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr> <th>Created Date</th>
|
||||
<!-- <th>User Id</th> -->
|
||||
<th>User Name</th>
|
||||
<th>Email</th>
|
||||
@ -126,7 +115,7 @@
|
||||
<td><?php echo $record->DepartmentName ?></td>
|
||||
<td><?php echo $record->role ?></td>
|
||||
<td>
|
||||
<a href="<?php echo base_url() . 'user/editOld?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>"><i class="fa fa-pencil"></i> </a>
|
||||
<a href="<?php echo base_url() . 'user/editOld?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>"><i class="fas fa-pencil-alt"></i> </a>
|
||||
|
||||
<a onclick="deleteUser(<?php echo $record->userId; ?>)"><i class="fa fa-trash"></i> </a>
|
||||
</td>
|
||||
@ -135,15 +124,18 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div> <!-- container -->
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
// $(function () {
|
||||
@ -192,78 +184,78 @@
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#datatable').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],
|
||||
|
||||
});
|
||||
|
||||
// Initialize the datepickers
|
||||
$("#fromDate").datepicker({
|
||||
dateFormat: 'dd-mm-yy',
|
||||
onSelect: function(selectedDate) {
|
||||
var minDate = $(this).datepicker("getDate");
|
||||
$("#toDate").datepicker("option", "minDate", minDate);
|
||||
$(document).ready(function() {
|
||||
// Initialize the DataTable
|
||||
var table = $('#user_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: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
|
||||
}
|
||||
});
|
||||
|
||||
$("#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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 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);
|
||||
|
||||
// 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").val('');
|
||||
$("#toDate").val('');
|
||||
table.draw(); // Redraw the table to clear the filter
|
||||
});
|
||||
|
||||
// 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;
|
||||
|
||||
// Optionally reset the To Date input if the current value is before the new min date
|
||||
if (toDateInput.value < fromDate) {
|
||||
toDateInput.value = fromDate;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@ -145,36 +145,36 @@
|
||||
|
||||
|
||||
<div class="content-page">
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">View Inward Gate Register </h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
<div class="content">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
<!-- start page title -->
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">View Inward Gate Register </h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
|
||||
<input type="hidden" name="table" value="requisition">
|
||||
<label for="fromDate">From:</label>
|
||||
<input class="form-control date_range" type="date" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
|
||||
|
||||
<label for="toDate">To:</label>
|
||||
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
<label for="toDate">To:</label>
|
||||
<input class="form-control date_range" type="date" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
|
||||
|
||||
<button type="submit">Search</button>
|
||||
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="view_inward_gate_register" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<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>
|
||||
<div class="error" id="error"></div>
|
||||
</form>
|
||||
<div class="card-body">
|
||||
<table id="view_inward_gate_register" class="table dt-responsive nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Create time</th>
|
||||
@ -199,32 +199,40 @@
|
||||
$date = $createddate->format('d-m-Y');
|
||||
$time = $createddate->format('h:i A');
|
||||
?>
|
||||
<tr id="<?php echo $index ?>">
|
||||
<td align="right"><?php echo $date; ?></td>
|
||||
<td align="right"><?php echo $time; ?></td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index; ?>" data-inx="<?php echo $index; ?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>"> <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
<td><a data-toggle="modal" data-target="#CostCentershow" data-id="<?php echo $index; ?>" data-igno="<?php echo $record->IGRNO; ?>" data-pono="<?php echo $record->PONO ?>" target="_blank"> <u><?php echo $record->PONO ?></u></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td align="right"><?php
|
||||
$date = new DateTime($record->DeliveryChellanDate);
|
||||
echo $date->format('d-m-Y'); ?></td>
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?></td>
|
||||
<td>
|
||||
<a target="_blank" href="<?php echo base_url('download-files/' . $record->IGRNO); ?>">
|
||||
<i class="fa fa-download" style="text-align: center;"></i>
|
||||
</a>
|
||||
|
||||
<a target="_blank" data-toggle="modal" data-target="#Historyshow" data-id="<%=index%>" title="IGR History" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>">
|
||||
<i class="fa fa-history" style="text-align: center;"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<!-- <a class="a_tag_for_mrir" href="<?php echo base_url() . 'MRIRcontroller/igrdatavalues?IGRNO=' . $record->IGRNO; ?>" target="_blank" data-id="<%=index%>" title="Generate MRIR"><i class="fa fa-external-link" style="text-align: center;"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<td align="right"><?php echo $date; ?></td>
|
||||
<td align="right"><?php echo $time; ?></td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>"> <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
<td><a data-toggle="modal" data-target="#CostCentershow" data-id="<?php echo $index;?>" data-igno="<?php echo $record->IGRNO;?>" data-pono="<?php echo $record->PONO ?>" target="_blank"> <u><?php echo $record->PONO ?></u></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td align="right"><?php
|
||||
$date = new DateTime($record->DeliveryChellanDate);
|
||||
echo $date->format('d-m-Y'); ?></td>
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?></td>
|
||||
<td>
|
||||
<a target="_blank" href="<?php echo base_url('download-files/' . $record->IGRNO); ?>">
|
||||
<i class="fa fa-download" style="text-align: center;"></i>
|
||||
</a>
|
||||
|
||||
<?php if (!empty($record->FilePath)) { ?>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } else if (!empty($record->file)) { ?>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } else { ?>
|
||||
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
|
||||
<?php } ?>
|
||||
|
||||
<a target="_blank" data-toggle="modal" data-target="#Historyshow" data-id="<%=index%>" title="IGR History" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>">
|
||||
<i class="fa fa-history" style="text-align: center;color:#02a8b5"></i>
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<!-- <a class="a_tag_for_mrir" href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO; ?>" target="_blank" data-id="<%=index%>" title="Generate MRIR"><i class="fa fa-external-link" style="text-align: center;"></i></a> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -1479,109 +1487,14 @@
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
// Initialize the DataTable
|
||||
var table = $('#Inwardgateregistertable').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],
|
||||
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
||||
"<'row'<'col-md-6'><'col-md-6'>>" +
|
||||
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
||||
"buttons": [{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Inward Gate Register',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Inward Gate Register',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
// 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
|
||||
$("#DateRangeFilter").submit(function(e) {
|
||||
e.preventDefault();
|
||||
table.draw();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
function appendExistingFilesFileds(data) {
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
|
||||
var dateSplit = date.split('-');
|
||||
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
|
||||
};
|
||||
});
|
||||
|
||||
function appendExistingFilesFileds(data){
|
||||
const base_url = '<?php echo base_url(); ?>';
|
||||
var filePath = data != null && data != '' ? data.FilePath : '';
|
||||
var fileName = data != null && data != '' ? data.Remarks : '';
|
||||
|
||||
|
Before Width: | Height: | Size: 157 KiB After Width: | Height: | Size: 157 KiB |
Loading…
Reference in New Issue
Block a user