CHANGE_DATE_PICKER_CHECK_FULL
This commit is contained in:
parent
7b798f54e9
commit
a1be08cf7f
@ -129,7 +129,7 @@
|
||||
<?php echo 'From Date'; ?>
|
||||
</label>
|
||||
<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>
|
||||
@ -138,7 +138,7 @@
|
||||
<?php echo 'To Date'; ?>
|
||||
</label>
|
||||
<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>
|
||||
|
||||
@ -999,7 +999,7 @@
|
||||
<li class="previous list-inline-item"><a href="javascript: void(0);" class="btn btn-secondary">Previous</a>
|
||||
</li>
|
||||
<!-- <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> -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -414,8 +414,8 @@
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -5925,6 +5925,10 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#Deliverydt').attr({
|
||||
'data-provide': 'datepicker',
|
||||
'data-date-format': 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
// Initialize the DataTable
|
||||
var table = $('#serviceTax').DataTable({
|
||||
@ -6753,7 +6757,7 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
populateValueMainFormForEditServiceTax();
|
||||
|
||||
}else{
|
||||
} else {
|
||||
console.log("in else part...");
|
||||
}
|
||||
|
||||
|
||||
@ -403,16 +403,32 @@ function ValidateUA() {
|
||||
var mindt = year-70;
|
||||
var maxdt = year-15;
|
||||
|
||||
$("#financialstart").datepicker({
|
||||
maxDate :'now',
|
||||
//maxDate : new Date(maxdt,1,1),
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-1:+1'
|
||||
// $("#financialstart").datepicker({
|
||||
// maxDate :'now',
|
||||
// //maxDate : new Date(maxdt,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>
|
||||
@ -523,14 +539,19 @@ function ValidateUA() {
|
||||
<input type="text" name="companywebsite" id="companywebsite" maxlength="100" class="form-control" value="<?php echo $companywebsite ;?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$financialstartFormatted = date('Y-m-d', strtotime($financialstart));
|
||||
$financialendFormatted = date('Y-m-d', strtotime($financialend));
|
||||
?>
|
||||
|
||||
<div class="form-row" >
|
||||
<div class="col-md-3" style="margin-top:20px">
|
||||
<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 class="col-md-3" style="margin-top:20px">
|
||||
<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>
|
||||
@ -753,7 +774,8 @@ function ValidateUA() {
|
||||
</div>
|
||||
<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="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>
|
||||
</form>
|
||||
|
||||
@ -1000,7 +1000,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<label>Delivery Date<span class="text-danger">*</span></label>
|
||||
<div>
|
||||
<?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);
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -792,7 +792,7 @@ foreach ($PaymentTerms as $TER) {
|
||||
<input type="hidden" name="beforeDeliverydt" value="<?php echo $Deliverydt ?>">
|
||||
<div class="form-group">
|
||||
<?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);
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -101,24 +101,12 @@
|
||||
<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" class="table table-hover table-bordered" style="background-color:#fff;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Created Date</th>
|
||||
<th >Emp ID</th>
|
||||
<th>Employee Name</th>
|
||||
<th>Contact Number</th>
|
||||
@ -138,7 +126,6 @@
|
||||
} else {
|
||||
$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><?php echo $record->FirstName; ?></td>
|
||||
<td><?php echo $record->ContactNumber ?></td>
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<label class="col-form-label">Invoice Date<span class="text-danger">*</span></label>
|
||||
<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"> -->
|
||||
<!-- <div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
@ -161,7 +161,7 @@
|
||||
<div class="form-group col-md-4">
|
||||
<label class="col-form-label">Material Received Date<span class="text-danger">*</span></label>
|
||||
<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">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
|
||||
@ -1,38 +1,55 @@
|
||||
<script>
|
||||
<!-- Editable table-->
|
||||
$(function () {
|
||||
$("td").dblclick(function () {
|
||||
var OriginalContent = $(this).text();
|
||||
<!-- Editable table
|
||||
-->
|
||||
$(function
|
||||
()
|
||||
{
|
||||
$("td").dblclick(function
|
||||
()
|
||||
{
|
||||
var
|
||||
OriginalContent
|
||||
=
|
||||
$(this).text();
|
||||
$(this).addClass("cellEditing");
|
||||
$(this).html("<input type='text' value='" + OriginalContent + "' />");
|
||||
$(this).children().first().focus();
|
||||
$(this).children().first().keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
var newContent = $(this).val();
|
||||
$(this).parent().text(newContent);
|
||||
$(this).parent().removeClass("cellEditing");
|
||||
} });
|
||||
$(this).children().first().blur(function(){
|
||||
$(this).parent().text(OriginalContent);
|
||||
$(this).parent().removeClass("cellEditing");
|
||||
});
|
||||
});
|
||||
});
|
||||
$(this).html("
|
||||
<input type='text' value='" + OriginalContent + "' />");
|
||||
$(this).children().first().focus();
|
||||
$(this).children().first().keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
var newContent = $(this).val();
|
||||
$(this).parent().text(newContent);
|
||||
$(this).parent().removeClass("cellEditing");
|
||||
} });
|
||||
$(this).children().first().blur(function(){
|
||||
$(this).parent().text(OriginalContent);
|
||||
$(this).parent().removeClass("cellEditing");
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<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;}
|
||||
|
||||
</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;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left RequisitionList ','name' => 'RequisitionList','id' => 'RequisitionList','method' => 'post','role' => 'form' );
|
||||
$attributes = array('class' => 'form-label-left RequisitionList ', 'name' => 'RequisitionList', 'id' => 'RequisitionList', 'method' => 'post', 'role' => 'form');
|
||||
|
||||
echo form_open(base_url().'purchaseorderform/purchaseorder',$attributes); ?>
|
||||
echo form_open(base_url() . 'purchaseorderform/purchaseorder', $attributes); ?>
|
||||
|
||||
<section class="content">
|
||||
|
||||
<div>
|
||||
<center><b><h2>Requisition List </h2></b></center>
|
||||
<center><b>
|
||||
<h2>Requisition List </h2>
|
||||
</b></center>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@ -40,20 +57,19 @@
|
||||
<label>Department Name</label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("0"=>'Select Department Name');
|
||||
$options = array("0" => 'Select Department Name');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($POType))
|
||||
{
|
||||
if (!empty($POType)) {
|
||||
foreach ($SupplierName as $SID):
|
||||
|
||||
|
||||
$options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName;
|
||||
$options[$SID->SupplierID] = $SID->SupplierID . ' ' . ' - ' . ' ' . $SID->SupplierName;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('SupplierID', $options,set_value('SupplierID'),'id="SupplierID"' ,'class = "form-control required"','required="true"');
|
||||
echo form_dropdown('SupplierID', $options, set_value('SupplierID'), 'id="SupplierID"', 'class = "form-control required"', 'required="true"');
|
||||
|
||||
?>
|
||||
|
||||
@ -63,20 +79,19 @@
|
||||
<label>Status</label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("0"=>'Select Status');
|
||||
$options = array("0" => 'Select Status');
|
||||
//print_r( $options);
|
||||
|
||||
if(!empty($POType))
|
||||
{
|
||||
if (!empty($POType)) {
|
||||
foreach ($SupplierName as $SID):
|
||||
|
||||
|
||||
$options[$SID->SupplierID] = $SID->SupplierID.' '.' - '.' '.$SID->SupplierName;
|
||||
$options[$SID->SupplierID] = $SID->SupplierID . ' ' . ' - ' . ' ' . $SID->SupplierName;
|
||||
|
||||
endforeach;
|
||||
}
|
||||
|
||||
echo form_dropdown('SupplierID', $options,set_value('SupplierID'),'id="SupplierID"' ,'class = "form-control required"','required="true"');
|
||||
echo form_dropdown('SupplierID', $options, set_value('SupplierID'), 'id="SupplierID"', 'class = "form-control required"', 'required="true"');
|
||||
|
||||
?>
|
||||
|
||||
@ -107,7 +122,7 @@
|
||||
|
||||
<button type="button" class="btn btn-success">Search</button>
|
||||
<button type="button" class="btn btn-success">Clear</button>
|
||||
</div><br/>
|
||||
</div><br />
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal" role="dialog">
|
||||
@ -117,7 +132,9 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4> Requisition Details - REQ No</h4></center>
|
||||
<center>
|
||||
<h4> Requisition Details - REQ No</h4>
|
||||
</center>
|
||||
</div>
|
||||
<div align="left">
|
||||
|
||||
@ -126,7 +143,7 @@
|
||||
<label>Req Type</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RequestType','value' => set_value('RequestType'),'id'=>'RequestType', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'RequestType', 'value' => set_value('RequestType'), 'id' => 'RequestType', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -136,7 +153,7 @@
|
||||
<label>Req By</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RequestedBy','value' => set_value('RequestedBy'),'id'=>'RequestedBy', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'RequestedBy', 'value' => set_value('RequestedBy'), 'id' => 'RequestedBy', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -145,7 +162,7 @@
|
||||
<label>Dep Name</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'DeptName','value' => set_value('DeptName'),'id'=>'DeptName', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'DeptName', 'value' => set_value('DeptName'), 'id' => 'DeptName', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -154,7 +171,7 @@
|
||||
<label>Desigination</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -168,7 +185,7 @@
|
||||
<label>Req Dt</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'RequisitionDt','value' => set_value('RequisitionDt'),'id'=>'RequisitionDt', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'RequisitionDt', 'value' => set_value('RequisitionDt'), 'id' => 'RequisitionDt', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -178,7 +195,7 @@
|
||||
<label>Cost Center Name</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'CostCenterName','value' => set_value('CostCenterName'),'id'=>'CostCenterName', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'CostCenterName', 'value' => set_value('CostCenterName'), 'id' => 'CostCenterName', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -187,7 +204,7 @@
|
||||
<label>Avl Budget Amt</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'AvailableBudment','value' => set_value('AvailableBudment'),'id'=>'AvailableBudment', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'AvailableBudment', 'value' => set_value('AvailableBudment'), 'id' => 'AvailableBudment', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -196,7 +213,7 @@
|
||||
<label>Status</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Status','value' => set_value('Status'),'id'=>'Status', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
$data = array('name' => 'Status', 'value' => set_value('Status'), 'id' => 'Status', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
@ -280,7 +297,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="chk1" id="chk1"/> </td>
|
||||
<td><input type="checkbox" name="chk1" id="chk1" /> </td>
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000001</u></a></td>
|
||||
<td>2/3/2017</td>
|
||||
<td data-name="sel">
|
||||
@ -308,7 +325,7 @@
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="chk3" id="chk3"/> </td>
|
||||
<td><input type="checkbox" name="chk3" id="chk3" /> </td>
|
||||
<td><a data-toggle="modal" data-target="#myModal"><u>REQ000001</u></a></td>
|
||||
<td>9/4/2017</td>
|
||||
<td data-name="sel">
|
||||
@ -338,7 +355,7 @@
|
||||
</section>
|
||||
</div>
|
||||
<script>
|
||||
var baseurl = "<?php print base_url(); ?>";
|
||||
var baseurl = "<?php print base_url(); ?>";
|
||||
$(".RequisitionList").submit(function(e) {
|
||||
|
||||
|
||||
@ -348,27 +365,21 @@ var baseurl = "<?php print base_url(); ?>";
|
||||
var chk1 = $('#chk1').val();
|
||||
var chk2 = $('#chk2').val();
|
||||
var chk3 = $('#chk3').val();
|
||||
if( $('#chk1').is(":checked"))
|
||||
{
|
||||
if ($('#chk1').is(":checked")) {
|
||||
id = '';
|
||||
}
|
||||
else if($('#chk2').is(":checked"))
|
||||
{
|
||||
} else if ($('#chk2').is(":checked")) {
|
||||
id = '';
|
||||
}
|
||||
else if($('#chk3').is(":checked"))
|
||||
{
|
||||
} else if ($('#chk3').is(":checked")) {
|
||||
id = '';
|
||||
}
|
||||
// alert(chk1);
|
||||
// alert(chk2);
|
||||
// alert(chk3);
|
||||
|
||||
window.location = baseurl +'purchaseorderform/purchaseorder';
|
||||
window.location = baseurl + 'purchaseorderform/purchaseorder';
|
||||
|
||||
|
||||
});
|
||||
//Date range picker
|
||||
$('#reservation').daterangepicker();
|
||||
</script>
|
||||
|
||||
</script>
|
||||
@ -1625,6 +1625,60 @@ function appendExistingFilesFileds(data){
|
||||
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>
|
||||
Loading…
Reference in New Issue
Block a user