<table width="100%" border="1" cellspacing="0" cellpadding="0">
   <tr class="row1">
   <td class="tabledata" >S No.</td>
   <td class="tabledata" >Date & Time</td> 
   <td class="tabledata" >Pick List No</td>
   <td class="tabledata" >SOI No</td>
   <td class="tabledata" >Dispatch Date.</td>
    <td class="tabledata" >Delivery Date.</td>
   <td class="tabledata"> Customer</td> 
    <td class="tabledata" >Aganist Enquiry No</td>
   <td class="tabledata">Actions</td> 
  
   </tr>
   <?php 
      // LIMIT $startpoint,$perpage
	if(isset($_SESSION['dealerid']))
	$GetRecord = "Select * from dbl_dealer_dispatch where dealer='".$_SESSION['dealerid']."' and company='".$_SESSION['ACGCompanyId']."' order by id DESC";
	else
	$GetRecord = "Select * from dbl_dealer_dispatch where  company='".$_SESSION['ACGCompanyId']."' order by id DESC";
   $ResultData = DB_query($GetRecord,$db);
   $i=1;
   if(DB_num_rows($ResultData)==0)
   echo "<td colspan='9'>--No Record--</td>";   
   while($RowData = DB_fetch_array($ResultData))
   {?>
 <tr class="row1"> <td ><div align="center"><?php echo $i; ?></div></td>
 <td><?php echo ConvertSQLDate($RowData['date']).":".$RowData['time'];  ?></td>
 <td><?php echo $RowData['pick_list_no']; ?> </td>
 <td><?php echo  $s->getField('dbl_process_sale_order','id',$RowData['SOI_no'],'SOI_no');  ?></td>
 <td><?php echo ConvertSQLDate($RowData['dispatch_date']);?></td>
 <td><?php echo ConvertSQLDate($RowData['delivery_date']);?></td>
<td><?php echo $Companyname= $s->getField('clientmaster','id',$RowData['customer'],'c_name');  ?></td>
<td><?php echo $Companyname= $s->getField('dbl_enquiry_form','id',$RowData['enquiry_no'],'form_no'); ?></td>
<td><a href="<?php echo $targetpage?>&amp;action=Edit&amp;id=<?php echo $RowData['id']; ?>"><img src="images/icon-edit.png"  width="10" height="10"  title="Edit"/></a>&nbsp;&nbsp;<a href="<?php echo $targetpage1?>&amp;action=Delete&amp;id=<?php echo $RowData['id']; ?>"><img src="images/delete1.gif"  width="10" height="10" title="Delete"/></a>

<a href="" onclick="javascript:popup('pick_list1.php?modid=<?php echo $_REQUEST['modid']; ?>&frmid=<?php echo $_REQUEST['frmid']; ?>&id=<?php echo $RowData['id']; ?>','toolbar=0,status=0,menubar=0,fullscreen=no,width=900,height=600')" ><img src="images/print.png" width="20" height="15"  title="Print" /></a>

</td>
</tr>
 
	<?php $i++;}   
   ?> 
	
   </table>

  