<h2> Comparation List</h2>
<?php $table_name='comprative_detail';


if($_REQUEST['action']=='del')
{
$condition="comprative_id='".$_REQUEST['id']."'";
	$s->DeleteRecord($table_name,  $condition);
	  $s->pageLocation("index.php?route=POModule/ComperitiveList&daction=deleted".$rurl);

}


if($_REQUEST['daction'])
{
   echo "<div class='success'>Record ".$_REQUEST['daction']." Successfully</div>";
}

$condition = "1=1 order by Comprative_date DESC";
 $query=$s->GetRecordById($table_name,  $condition);
 $numrows = DB_num_rows($query);
 if( $numrows>0)
 {


 ?>

<table width="100%" border="1">
  <tr>
    <td><strong>Comparative Number</strong></td>
    <td><strong>Date</strong></td>
    <td><strong>Requisition No.</strong></td>
	<td><strong>Vendor Quotation No</strong></td>
	<td><strong>Vendor Code/Name</strong></td>
	<td><strong>Status</strong></td>
	<td><strong>View</strong></td>
	<td><strong>Delete</strong></td>
  </tr>
  
  <?php 
    while($row=DB_fetch_array($query)){
  ?>
  <tr>
    <td><?php  echo $row['comprative_no']?></td>
     <td><?php  echo ConvertSQLDate($row['Comprative_date'])?></td>
    <td><?php   
	echo $s->GetFieldValue('materialrequisitions',"requisitionno ='".$row['RequisitionNo']."'" ,'Reqno');
	
	?></td>
     <td><?php // echo $row['Vendor_Quot_No'];
	  echo $s->GetFieldValue('venderquotations',"id='".$row['Vendor_Quot_No']."'" ,'vernder_quotation');?></td>
    <td><?php    echo $s->GetFieldValue('venderquotations',"id='".$row['Vendor_Quot_No']."'" ,'vendercode');
	echo '<br>'.$s->GetFieldValue('venderquotations',"id='".$row['Vendor_Quot_No']."'" ,'vendername');
	?></td>
	 <td><?php // echo $row['comprative_no']?></td>
     <td><a href="index.php?route=POModule/DispComperitive<?php echo $rurl;?>&RequisitionNo=<?php echo $row['RequisitionNo']?>&id=<?php  echo $row['comprative_id']?>" >View</a></td>
    <td>
	<a href="index.php?route=POModule/ComperitiveList<?php echo $rurl;?>&action=del&id=<?php  echo $row['comprative_id']?>"><img src="images/Icon_Delete.png" /></a>	</td>
  </tr>
  <?php }?>
</table>
<?php }else{
echo "No Record In Our DataBase";
}?>