<?php 
print("\n");
print("\n");
////// filters value/////
//// extract all encoded variables

$username=base64_decode($_REQUEST['user']);
$fdate1=date_format(date_create($_REQUEST['fdate']), "Y-m-d");
$tdate1=date_format(date_create($_REQUEST['tdate']), "Y-m-d");

 if($username!=""){
			$sql1 = "SELECT distinct(eng_id), address,update_date,travel_date FROM lead_user_track where eng_id='$username'  and travel_date BETWEEN '".$fdate1."' and '".$tdate1."'  order by travel_date,travel_time desc";
			}else{
			$sql1 = "SELECT distinct(eng_id), address,update_date,travel_date FROM lead_user_track where travel_date BETWEEN '".$fdate1."' and '".$tdate1."' order by travel_date,travel_time desc ";
				}
?>
<table width="100%" border="1" cellpadding="2" cellspacing="1" bordercolor="#000000">
<tr align="left" style="background-color:#396; color:#FFFFFF;font-size:13px;font-family:Verdana, Arial, Helvetica, sans-serif;font-weight:normal;vertical-align:central">
<td height="25"><strong>S.No.</strong></td>
<td><strong>Eng Id</strong></td>
<td><strong>Address</strong></td>
<td><strong>Travel Date</strong></td>
<td><strong>Travel Time</strong></td>
</tr>
<?php
$i=1;
$rs1 = mysqli_query($link1,$sql1) or die(mysqli_error($link1));
 while($row1=mysqli_fetch_assoc($rs1)) {
  $datetime = $row1[update_date];
		  $t = explode(" ",$datetime);
?>
<tr>
<td align="left"><?=$i?></td>
<td align="left"><?=$row1['eng_id']?></td>
<td align="left"><?=$row1['address']?></td>
<td><?php  echo $t[0];?></td>
<td><?php echo $t[1];?></td>
</tr>
<?php
$i+=1;		
}
?>
</table>