<?php
$PageSecurity = 5;
?>
<style>
.bod {
	border: 1px double #666666;
	}
.style1 {font-weight: bold}
.style2 {font-weight: bold}
</style>
<h2>View Comparation List</h2>
<?php

$title = ('Comparative Vendor Quotation');
include('includes/SQL_CommonFunctions.inc');
$id = $_REQUEST['id'];
$RequisitionNo = $_REQUEST['RequisitionNo'];
	   
	  $SQL_Query = "select A.*,B.site,B.vendername ,B.vendercode,B.sitecode As SiteCode ,B.date1 ,B.vernder_quotation ,B.basis from comprative_detail A,venderquotations B where A.comprative_id='".$id."' and A.Vendor_Quot_No =B.id "; 
	   $Result = DB_query($SQL_Query,$db);
	   $com_row = DB_fetch_array($Result);

		$comprative_no = $com_row['comprative_no'];
		$mst_product_list = $com_row['mst_product_list'];
		$Vendor_Quot_No = $com_row['Vendor_Quot_No'];
		$Comprative_date = ConvertSQLDate($com_row['Comprative_date']);
  ?>
 <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
             
           </tr>

   <tr>
     <td valign="top" align="center"><table width="100%" border="0" cellpadding="0" cellspacing="0">
       <tr>
         <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="bod">
          
           <tr bgcolor="#666666"  style="color:#FFFFFF">
             <td height="30" colspan="10" align="right" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
                   
                   <td   bgcolor="#666666"  style="color:#FFFFFF"><strong>&nbsp;&nbsp;
                    Comparative No.: <?php echo  $comprative_no; ?>
                   </strong></td>
                   <td  height="30"  bgcolor="#666666"  style="color:#FFFFFF"><strong>Date</strong>:<?php echo $Comprative_date; ?></td>
                   
                 </tr>
             </table></td>
           </tr>
           <tr>
             <td colspan="2">&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
             <td width="10%">&nbsp;</td>
             <td width="10%">&nbsp;</td>
             <td width="9%">&nbsp;</td>
             <td>&nbsp;</td>
           </tr>
           <tr bgcolor="#666666"  style="color:#FFFFFF">
             <td height="30" colspan="11">
			 <table width="100%" border="1" cellpadding="0" cellspacing="0" >
               <tr>
                 <td width="20%" height="30" bgcolor="#666666"  style="color:#FFFFFF"><strong>Site Code:<?php echo $com_row['SiteCode'] ; ?></strong></td>
                  
                 <td width="15%" bgcolor="#666666"  style="color:#FFFFFF"> <strong>Site Name:<?php echo $com_row['site']; ?></strong></td>
                 
                 <td width="25%" bgcolor="#666666"  style="color:#FFFFFF"><strong>Requisition No.:<?php
				  echo  $s->GetFieldValue('materialrequisitions',"requisitionno='".$com_row['RequisitionNo']."'" ,'Reqno');?></strong></td>
                 
				 <td width="20%" bgcolor="#666666"  style="color:#FFFFFF"><strong>Requisition Date:</strong><?php echo ConvertSQLDate($prdate); ?></td>
                  
             </table></td>
			 </tr>
 


<tr>
<td colspan="2">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="12">
 
 <table width="100%" border="0"  >
 <tr bgcolor="#666666" style="color:#FFFFFF">
<td width="2%">&nbsp;</td>
<td width="20%"><strong>Vendor Quot. No</strong></td>
<td width="9%"><strong>Quot. Date</strong></td>
<td width="10%" height="30"><strong>Vendor Code</strong></td>
<td width="13%"><strong>Vendor Name </strong></td>
 <td width="5%"><strong>Basis</strong></td>
</tr>
 
 <tr >
<td width="2%">&nbsp;</td>
<td width="20%"><?php echo  $com_row['vernder_quotation'];?></td>
<td width="9%"><?php echo  ConvertSQLDate($com_row['date1']);?></td>
<td width="10%" height="30"><?php echo  $com_row['vendercode'];?></td>
<td width="13%"><strong><?php echo  $com_row['vendername'];?></strong></td>
 <td width="5%"><?php echo  $com_row['basis'];?></strong></td>
</tr>
 


 
<tr>
  <td colspan="6">
  
  
  
  
  <table width="100%"border="0" cellpadding="3" cellspacing="3" bgcolor="#CCCCCC">
 <tr>
<td><strong>Product Code</strong></td>
<td colspan="2"><strong>Product Name</strong></td>
<td><strong>Quantity</strong></td>
<td><strong>Rate</strong></td>
<td><strong>Discount<br />Amount</strong></td>
<td><strong> Total </strong></td>
 </tr>
 <?php 
    $sql="SELECT  * from  vendorquotationdetails where quotation_no='".$Vendor_Quot_No."' ";

$result=DB_query($sql,$db);
$j = 1;
$k=0; //row colour counter
while($myrow=DB_fetch_array($result))
{	

if ($k==1){ /*alternate bgcolour of row for highlighting */
echo '<tr class="OddTableRows">';
$k=0;
} else {
echo '<tr class="EvenTableRows">';
$k++;
}
?>
<tr>
<td> <?php echo $myrow['prod_id'] ;?></td>
<td colspan="2"><?php echo $myrow['prod_dec']; ?>
<input type="hidden" name="prod_id"  value="<?php echo $myrow['prod_id']; ?>" /></td>
<td><?php echo $myrow['quantity']; ?></td>
<td><?php echo $myrow['rate']; ?></td>
<td><?php echo $myrow['discount_amount']; ?></td>
<td><?php echo $myrow['sub_total']; ?>
  </td>
<!--<td><?php 
//$tax_sql=DB_query("Select tax_code from sales_tax_master where salestax_id='".$myrow['taxnameid']."'",$db);
//$tax_row=DB_fetch_array($tax_sql);
//echo $tax_row['tax_code']; ?></td>  
<td><?php //echo $myrow['taxvalue']; ?></td>
<td><?php //echo $myrow['taxamount']; ?></td>
<td colspan="2"><?php //echo $myrow['totalamountwithtax']; ?></td>-->
</tr>
<?php }  ?>
 </table>
  </td>
</tr>
</table>

</td>
 
</tr>



<tr>
<td colspan="10" valign="top" align="center">


 
 </td>
</tr>



 
 
 
</table></td>
</tr>
</table></td>
</tr>
</table>