CHANGE_DATE_PICKER_CHECK_FULL

This commit is contained in:
aadhavan valli 2024-09-03 18:09:14 +05:30
parent 7b798f54e9
commit a1be08cf7f
11 changed files with 690 additions and 612 deletions

View File

@ -129,7 +129,7 @@
<?php echo 'From Date'; ?> <?php echo 'From Date'; ?>
</label> </label>
<div class="input-group"> <div class="input-group">
<input type="date" name="from_date" id="max-date" class="form-control datepicker"> <input name="from_date" id="max-date" class="form-control datepicker">
</div> </div>
</div> </div>
@ -138,7 +138,7 @@
<?php echo 'To Date'; ?> <?php echo 'To Date'; ?>
</label> </label>
<div class="input-group"> <div class="input-group">
<input type="date" name="to_date" id="min-date" class="form-control datepicker"> <input name="to_date" id="min-date" class="form-control datepicker">
</div> </div>
</div> </div>

View File

@ -999,7 +999,7 @@
<li class="previous list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a> <li class="previous list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a>
</li> </li>
<!-- <li class="next list-inline-item float-right"> --> <!-- <li class="next list-inline-item float-right"> -->
<button type="submit" class="btn btn-primary submit">Submit</button> <button type="submit" class="btn btn-primary submit float-right">Submit</button>
<!-- </li> --> <!-- </li> -->
</ul> </ul>
</div> </div>

View File

@ -414,8 +414,8 @@
}); })
;
}); });

View File

@ -5925,6 +5925,10 @@ if (!empty($INRSYMBOL)) {
$(document).ready(function() { $(document).ready(function() {
$('#Deliverydt').attr({
'data-provide': 'datepicker',
'data-date-format': 'dd-mm-yyyy'
});
// Initialize the DataTable // Initialize the DataTable
var table = $('#serviceTax').DataTable({ var table = $('#serviceTax').DataTable({

View File

@ -403,16 +403,32 @@ function ValidateUA() {
var mindt = year-70; var mindt = year-70;
var maxdt = year-15; var maxdt = year-15;
$("#financialstart").datepicker({ // $("#financialstart").datepicker({
maxDate :'now', // maxDate :'now',
//maxDate : new Date(maxdt,1,1), // //maxDate : new Date(maxdt,1,1),
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-1:+1' // dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-1:+1'
}); // });
$("#financialend").datepicker({dateFormat: 'dd-mm-yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-1:+1' // $("#financialend").datepicker({dateFormat: 'dd-mm-yy',minDate :'now',changeMonth: true, changeYear: true,yearRange: '-1:+1'
}); // });
// $("#financialstart").datepicker({
// dateFormat: 'dd-mm-yy',
// onSelect: function(selectedDate) {
// var minDate = $(this).datepicker("getDate");
// $("#toDate").datepicker("option", "minDate", minDate);
// }
// });
// $("#financialend").datepicker({
// dateFormat: 'dd-mm-yy',
// onSelect: function(selectedDate) {
// var maxDate = $(this).datepicker("getDate");
// $("#fromDate").datepicker("option", "maxDate", maxDate);
// }
// });
}); });
</script> </script>
@ -523,14 +539,19 @@ function ValidateUA() {
<input type="text" name="companywebsite" id="companywebsite" maxlength="100" class="form-control" value="<?php echo $companywebsite ;?>" required> <input type="text" name="companywebsite" id="companywebsite" maxlength="100" class="form-control" value="<?php echo $companywebsite ;?>" required>
</div> </div>
</div> </div>
<?php
$financialstartFormatted = date('Y-m-d', strtotime($financialstart));
$financialendFormatted = date('Y-m-d', strtotime($financialend));
?>
<div class="form-row" > <div class="form-row" >
<div class="col-md-3" style="margin-top:20px"> <div class="col-md-3" style="margin-top:20px">
<label for="FinancialYearStartON">Financial Year StartON</label><!--<span class="badge">*</span>--> <label for="FinancialYearStartON">Financial Year StartON</label><!--<span class="badge">*</span>-->
<input name="financialstart" id="financialstart" maxlength="10" class="form-control" value="<?php echo $financialstart ;?>" required> <input type="date" name="financialstart" id="financialstart" class="form-control" value="<?php echo $financialstartFormatted; ?>" required>
</div> </div>
<div class="col-md-3" style="margin-top:20px"> <div class="col-md-3" style="margin-top:20px">
<label for="FinancialYearEndON">Financial Year EndON</label><!--<span class="badge">*</span>--> <label for="FinancialYearEndON">Financial Year EndON</label><!--<span class="badge">*</span>-->
<input name="financialend" id="financialend" maxlength="10" class="form-control" value="<?php echo $financialend ;?>" required> <input type="date" name="financialend" id="financialend" maxlength="10" class="form-control" value="<?php echo $financialendFormatted ;?>" required>
</div> </div>
</div> </div>
</div> </div>
@ -753,7 +774,8 @@ function ValidateUA() {
</div> </div>
<div class="col-md-12 text-right"> <div class="col-md-12 text-right">
<input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" /> <input type="reset" id="reset" class="btn btn-reset" style="background-color: red;color: white; margin-right: 15px;width: 80px;" value="Reset" />
<input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success"> <!-- <input type="submit" onclick="return Validate();" value="Submit" class="btn btn-success"> -->
<input type="submit" value="Submit" class="btn btn-success">
</div> </div>
</div> </div>
</form> </form>

View File

@ -1000,7 +1000,7 @@ if (!empty($INRSYMBOL)) {
<label>Delivery Date<span class="text-danger">*</span></label> <label>Delivery Date<span class="text-danger">*</span></label>
<div> <div>
<?php <?php
$data = array('type' => 'date','name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;','min' => date('d-m-Y'),); $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;','min' => date('d-m-Y'),);
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>

View File

@ -792,7 +792,7 @@ foreach ($PaymentTerms as $TER) {
<input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt ?>"> <input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt ?>">
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('type'=>'date','name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;'); $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>

View File

@ -101,24 +101,12 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <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"> <div class="card-body">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;"> <table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;">
<thead> <thead>
<tr> <tr>
<th>Created Date</th>
<th >Emp ID</th> <th >Emp ID</th>
<th>Employee Name</th> <th>Employee Name</th>
<th>Contact Number</th> <th>Contact Number</th>
@ -138,7 +126,6 @@
} else { } else {
$cdate = date('d-m-Y', strtotime($record->Created_date)); $cdate = date('d-m-Y', strtotime($record->Created_date));
} ?> } ?>
<td align="right"><?php echo $cdate; ?></td>
<td><u><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u></td> <td><u><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u></td>
<td><?php echo $record->FirstName; ?></td> <td><?php echo $record->FirstName; ?></td>
<td><?php echo $record->ContactNumber ?></td> <td><?php echo $record->ContactNumber ?></td>

View File

@ -139,7 +139,7 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label class="col-form-label">Invoice Date<span class="text-danger">*</span></label> <label class="col-form-label">Invoice Date<span class="text-danger">*</span></label>
<div class="input-group"> <div class="input-group">
<input type="date" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> <input class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> --> <!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> -->
<!-- <div class="input-group-append"> <!-- <div class="input-group-append">
<span class="input-group-text"> <span class="input-group-text">
@ -161,7 +161,7 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label class="col-form-label">Material Received Date<span class="text-danger">*</span></label> <label class="col-form-label">Material Received Date<span class="text-danger">*</span></label>
<div class="input-group"> <div class="input-group">
<input type="date" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> <input class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off"> <!-- <input type="text" class="form-control" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off">
<div class="input-group-append"> <div class="input-group-append">
<span class="input-group-text"> <span class="input-group-text">

View File

@ -1,10 +1,19 @@
<script> <script>
<!-- Editable table--> <!-- Editable table
$(function () { -->
$("td").dblclick(function () { $(function
var OriginalContent = $(this).text(); ()
{
$("td").dblclick(function
()
{
var
OriginalContent
=
$(this).text();
$(this).addClass("cellEditing"); $(this).addClass("cellEditing");
$(this).html("<input type='text' value='" + OriginalContent + "' />"); $(this).html("
<input type='text' value='" + OriginalContent + "' />");
$(this).children().first().focus(); $(this).children().first().focus();
$(this).children().first().keypress(function (e) { $(this).children().first().keypress(function (e) {
if (e.which == 13) { if (e.which == 13) {
@ -20,8 +29,14 @@
}); });
</script> </script>
<style> <style>
.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {border: 1px solid #333;} .table-bordered>thead>tr>th,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>tbody>tr>td,
.table-bordered>tfoot>tr>td {
border: 1px solid #333;
}
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<?php <?php
@ -32,7 +47,9 @@
<section class="content"> <section class="content">
<div> <div>
<center><b><h2>Requisition List </h2></b></center> <center><b>
<h2>Requisition List </h2>
</b></center>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@ -43,8 +60,7 @@
$options = array("0" => 'Select Department Name'); $options = array("0" => 'Select Department Name');
//print_r( $options); //print_r( $options);
if(!empty($POType)) if (!empty($POType)) {
{
foreach ($SupplierName as $SID): foreach ($SupplierName as $SID):
@ -66,8 +82,7 @@
$options = array("0" => 'Select Status'); $options = array("0" => 'Select Status');
//print_r( $options); //print_r( $options);
if(!empty($POType)) if (!empty($POType)) {
{
foreach ($SupplierName as $SID): foreach ($SupplierName as $SID):
@ -117,7 +132,9 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4> Requisition Details - REQ No</h4></center> <center>
<h4> Requisition Details - REQ No</h4>
</center>
</div> </div>
<div align="left"> <div align="left">
@ -348,16 +365,11 @@ var baseurl = "<?php print base_url(); ?>";
var chk1 = $('#chk1').val(); var chk1 = $('#chk1').val();
var chk2 = $('#chk2').val(); var chk2 = $('#chk2').val();
var chk3 = $('#chk3').val(); var chk3 = $('#chk3').val();
if( $('#chk1').is(":checked")) if ($('#chk1').is(":checked")) {
{
id = ''; id = '';
} } else if ($('#chk2').is(":checked")) {
else if($('#chk2').is(":checked"))
{
id = ''; id = '';
} } else if ($('#chk3').is(":checked")) {
else if($('#chk3').is(":checked"))
{
id = ''; id = '';
} }
// alert(chk1); // alert(chk1);
@ -371,4 +383,3 @@ var baseurl = "<?php print base_url(); ?>";
//Date range picker //Date range picker
$('#reservation').daterangepicker(); $('#reservation').daterangepicker();
</script> </script>

View File

@ -1625,6 +1625,60 @@ function appendExistingFilesFileds(data){
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
} }
} }
});
// 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>