I want to get value from datepicker (only on change without using any button), and compare this date with stored database. My project is for orders and every order has a date, so I want to view old or new orders depending on their dates. Also when opening the website, it should display the current date (today) with its orders. Here's my code:
<input class="datepicker" name="datepicker" id="datepicker" />
<script> //date picker js
$(function() {
$("#datepicker" ).datepicker({
dateFormat : 'dd-mm-yy',
});
});
</script>
$q_customer = $conn->query("SELECT * from orders inner JOIN
customer_order on customer_order.order_no
=orders.order_no inner join driver_order on
driver_order.order_no=orders.order_no LEFT JOIN
customer on customer.phone=customer_order.phone
order by k_time" ) or die(mysqli_error());
$k_time = '';
while($f_customer = $q_customer->fetch_array()){?>
<tr>
<?php
if($k_time == '' || $k_time != $f_customer['k_time']){
$k_time = $f_customer['k_time'];
echo "<td>".$f_customer['k_time']."</td>";
} else{
echo "<td> </td>";
}
?>
<td><?php echo $f_customer['order_no']?></td>
<td><?php echo $f_customer['first_name']?></td>
<td><?php echo $f_customer['last_name']?></td>
<td><?php echo $f_customer['address']?></td>
<td><?php echo $f_customer['driver_no']?></td>
<td><?php echo $f_customer['d_time']?></td>
<td><?php echo $f_customer['no_ofppl']?></td>