<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6 col-xxs-12"> <div class="tm-tours-box-2"> <img src="img/index-0 <?php echo $data['id'];?>.jpg" alt="image" class="img-responsive"> <div class="tm-tours-box-2-info"> <h3 class="margin-bottom-15"><?php echo $data['name']; ?></h3> <p>Rs <?php echo $data['price']; ?>/day</p> </div> <a class="tm-tours-box-2-link" onclick="POP()">Book Now</a> </div> </div> <?php } } ?>
first you should name your variables according to what they store, makes it easier to understand, or remove them if they’re not needed more than once:
$username = $_POST['in']; $Timein= date("Y-m-d H:i:s",strtotime(str_replace('/','-',$username)));
could be changed to
// strtotime is clever enough to handle both `/` and `-` in dates $Timein= date("Y-m-d H:i:s", $_POST['in']);
Next, logic in SQL operands is a tad confusing.
NOT < and NOT >
you can change it to
$q="select * from camera where chkin <= '$Timein' AND chkout >= '$Timeout'";
Finally, do you actually have data in your DB that matches the above conditions?
ps: you should also make sure
$_POST['out'] are not empty