  <h3>  Purchase Order Details</h3><?php 
echo $sql = "select * from purchorders order by orddate DESC";
$PurchOrdersResult = DB_query($sql,$db,$ErrMsg);
?>
<table cellpadding="2" colspan="7" WIDTH="100%">
	<tr>
	<th><strong>Order Number</strong></th>
	<th><strong>Order Date</strong></th>
	<th><strong>Site Name</strong></th>
	<th><strong>Requisition No</strong></th>
	<th><strong>Vendor Code</strong></th>
	<th><strong>Vendor</strong></th>
	<th><strong>Initiated by</strong></th>
	<th><strong>Status</strong></th>
	<th><strong>View</strong></th>
	<th><strong>Edit</strong></th>
	<th><strong>Delete</strong></th>
	<th><strong>Print</strong></th>
	</tr>
	<?php
 
	if(DB_num_rows($PurchOrdersResult)>0)
	{
	while ($myrow=DB_fetch_array($PurchOrdersResult)) 
	{
 		?>
			<tr>
			<td><?php echo $myrow['orderno']; ?></td>
			<td><?php echo ConvertSQLDate($myrow['orddate']); ?></td>
			<td><?php echo $s->GetFieldValue('venderquotations',"id='".$myrow['mst_vendor_quotesid']."'" ,'site');	
			echo '<br>'.$s->GetFieldValue('venderquotations',"id='".$myrow['mst_vendor_quotesid']."'" ,'sitecode');	
			?>
			
			</td>
			<td><?php echo $myrow['mst_reqino']; ?></td>
			<td><?php echo $s->GetFieldValue('venderquotations',"id='".$myrow['mst_vendor_quotesid']."'" ,'vendercode');	?></td>
			<td> <?php echo $s->GetFieldValue('venderquotations',"id='".$myrow['mst_vendor_quotesid']."'" ,'vendername');	?></td>
			<td><?php echo $myrow['initiator']; ?></td>
			<td><?php echo $myrow['Po_recive_status']; ?></td>
			<td> View</td>
			<td>Edit</td>
			<td>Delete</td>
			<td> <a href="#" onclick='popup("PrintPO.php?POID=<?php  echo $myrow['orderno'].$rurl?>",600,600)' >Print</a></td>
			</tr>
<?php
 
	 
	 		
	}
	}
	else
	{?>
		<tr>
		<td colspan="12"><font color="#FF0000"><h2 align="center">No Record Found!</h2></font></td>
		</tr>
	<?php }
	?>
					  
</table>