<?php
$frmdate11='';
$todate_11='';
$sdate_12='';
$billno='';
$frmdate1='';
$todate_1='';
$todate_12='';
$from='';
$to='';
$sdate='';


if(isset($_REQUEST['user_name'])){
$user_names=$_REQUEST['user_name'];
}
$i=1;
include("../include/config.php");
require_once "../include/Database_functions.php";
?>

 <table width="98%" border="0" cellspacing="0" cellpadding="0">
     <tr>
       <th width="21%" align="center" valign="middle">Name</th>
       <th width="23%" align="center" valign="middle">Email</th>
       <th width="32%" align="center" valign="middle">Delete</th>
      </tr>
<?php
//$array=mysql_query("select * from tbl_trip_sheet order by bill_no asc");
$i=1;
$sq_arr="select * from tbl_trip_sheet where 1 ";
if($billno!=''){
$sq_arr.=" and 	container_no='".$container_no."' ";
}
if($frmdate11!='' && $todate_11!=''){
$sq_arr.=" and date between '$from' and '$to' ";
}
if($frmdate11!='' && $todate_11==''){
$sq_arr.=" and date>='".$from."' ";
}
if($frmdate11=='' && $todate_11!=''){
$sq_arr.=" and date <='".$to."' ";
}
if($sdate_12!=''){
$sq_arr.=" and date='".$sdate."' ";
}
$sq_arr.=" order by id desc ";
$query=$sq_arr;
$function="Searchdate";
include("../paging.php");
$sq_arr.=" LIMIT $start, $limit";
if(isset($_REQUEST['page'])){
$page=$_REQUEST['page'];
}else{
$page=1;
}
$array=mysql_query($sq_arr);
if($array && mysql_num_rows($array)>0){
while($res=mysql_fetch_array($array))
{
$dat_today=$res['date'];
$dat_today=explode("-",$dat_today);
?>	
    <tr>
      <td class="tr_td"><?php echo $res['container_no']; ?></td>
      <td class="tr_td"><?php echo $res['vehicle_no'];?></td>
      <td class="tr_td"><?php echo $res['consignee'];?></td>
     <td class="tr_td"><?php echo $res['date'];?></td>
	 <td class="tr_td" style="border-right:1px solid #000000;"><a href="view_trip_sheet.php?veh_no=<?php echo $res['id'];?>&page=<?php echo $page;?>"><img src="images/icon2.jpg" width="18" height="18" title="Edit"/></a>
	 <a href="trip-sheets.php?del=delete&id=<?php echo $res['id']; ?>&page=<?php echo $page;?>" onclick="return confirm('Do you really want to delete this field?');"><img src="images/icon1.jpg" width="21" height="21" title="Delete"/></a>
	 </td>
    </tr>
<?php
$i++;
}
}else{?>
 <tr>
      <td class="tr_td" colspan="3" ><span class="err_msg"><?php echo $res['bill_no']; ?></span>
	  </td>
	  </tr>
<? }
?>      </table>
 <div align="right" style="padding-top:10px;"><?=$pagination?></div>