<?php session_start();?>
<?php ob_start(); ?>
<?php include("Header.php");include('open_connection.php'); ?>

<style type="text/css">
table.gridtable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}

table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}
table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}
</style>
<form  method="post">	
<h3 align="center">FOOD AND BEVERAGE QUOTATION</h3>
	<?php
       $quotation_id = $_GET['quotation_id'];

echo $quotation_id;

       $customer= "SELECT * FROM tbl_dir_fnb_customer WHERE cust_id ='$cust_id'";
																		
				$result = mysql_query($customer);
				// $row = mysql_fetch_array($result, MYSQL_ASSOC);			
				$row=mysql_fetch_array($result);
			    $cust_id=$row['cust_id'];
			
		?>
		<?php  $quotation= "SELECT * FROM tbl_dir_fnb_quotation WHERE cust_id ='$cust_id'";
																		
				$result1 = mysql_query($quotation);
				// $row = mysql_fetch_array($result, MYSQL_ASSOC);			
				$row1=mysql_fetch_array($result1);
			    $cust_id=$row['cust_id'];
			?>
<table width="100%" border="1">  
  <tr>
    <td width="100%">
			<table width="99%" height="42%" border="0" align="center">
  				<tr>
    				<th width="54%" scope="col"><table width="106%" height="100%" border="1" align="center">
      			<tr>
        		<th scope="col" align="center">Attention to: </th>
        		<th scope="col" align="left"><?php echo $row['cust_salutation']?> <label><?php echo $row['cust_name']?></label></th>
      			</tr>
      			<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_position']?></label></td>
      			</tr>
      			<tr>
        		<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_company']?></label></td>
      			</tr>
     	 		<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_address1']?></label><!--input type="text" size="80" maxlength="80" 		                    value="<!?php echo $row['cust_address1']?>"--></td>
     			</tr>
	  			<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_address2']?></label></td>
      			</tr>
	  			<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_address3']?></label></td>
      			</tr>
	  			<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_address4']?></label></td>
      			</tr>
	 	 		<tr>
        			<td>&nbsp;</td>
        			<td align="left"><label><?php echo $row['cust_postcode'] .",". $row['cust_city']?></label>
					<!--input type="text" size="5" maxlength="5" value="<!?php echo $row['cust_postcode']?>">
				<input type="text" size="60" maxlength="60" value="<!?php echo $row['cust_city']?>"--></td>
      			</tr>
	  			<tr>
                   <td>&nbsp;</td>
                    <td align="left"><label><?php echo $row['cust_state']?></label></td>
                 </tr>
                <tr>
                   <td>&nbsp;</td>
                      <td>
					       <table width="360" height="58" border="0">
                                      <tr>
                                        <th width="43" scope="col">Tel:</th>
                                      <th align="left"><label><?php echo $row['cust_contact']?></label><!--input type="text" size="50"                                       maxlength="50" name="cust_contact" value="<!?php echo $row['cust_contact']?>"--></th>
                                      </tr>
                                      <tr>
                                      <th width="43" scope="col">Email:</th>
                                        <td><label><?php echo $row['cust_email']?></label><!--input type="text" size="80"                                      maxlength="80" name="cust_email" value="<!?php echo $row['cust_email']?>"--></td>
                                     </tr>
                            </table>
					</td>
                   </tr>
             </table></th>
                <th width="46%" scope="col">
	                  <table width="94%" height="30%" border="0" align="right">
                               <tr>
                                <th width="50%"><table width="100%" height="100%" border="1">
                                      <tr>
                                         <th scope="col">Date: </th>
			                               <th scope="col">Quotation No: </th>
                                           <th scope="col">Customer ID: </th>
                                      </tr>
                                      <tr> 
                                      <td><label><?php echo $row1['quotation_date_from']; ?>-<?php echo $row1['quotation_date_to']; ?></label></td> 
			                          <td>Cafe@picc<label><?php echo $row1['quotation_id']?></label></td>
                                      <td><label><?php echo $row['cust_id']?></label></td> 
          </tr>
        </table></th>
      </tr>
      <tr>
        <td><p align="center"><br>PLEASE QUOTE THE ABOVE PROFORMA INVOICE NUMBER<br> WHEN MAKING THE PAYMENT.</p>
          <p>&nbsp;</p></td>
      </tr>
    </table></th>
  </tr>
</table>
</form></td>
  </tr>
  <tr>
    <td> <table width="100%" border="1">
	<?php
			$rowsPerPage =10; 
				$pageNum = $_REQUEST['page']; 
				if(empty($pageNum))
						{
					$offset =0;
					$pageNum=1;
						}
				else
						{
					$offset = ($pageNum - 1) * $rowsPerPage;
						}	
					$result3=mysql_query("SELECT * from tbl_dir_fnb_quotation WHERE cust_id='$cust_id' AND quotation_id='$quotation_id' ORDER BY quotation_id DESC LIMIT $offset, $rowsPerPage");
		
		  $i=$offset;
					echo "<center><table border=1 align=center >";
					echo"<tr><th  width=100>No</th><th  width=500>Description</th><th  width=100>Qty</th><th width=100>Unit Price</th>
						<th  width=100>Total</th><th  width=200>ACTION</th></tr>";
					while(@$row=mysql_fetch_array($result3))
						{
					$quotation_id=$row['quotation_id'];
				   		$item_id = $row['item_id']; 
		 		 $quotation_desc = $row['quotation_desc'];
		     	  $quotation_qty = $row['quotation_qty'];
		   $quotation_unit_price = $row['quotation_unit_price'];
			 	$quotation_total = $row['quotation_total'];
			 	 
			$i++;
					echo"<tr>";
					echo "<td align= center >".$i."</td>";
					echo "<td align=center width=500>".$row['quotation_id']."</td>";
					echo "<td align=center width=500>".$row['quotation_desc']."</td>";
					echo "<td align=center width=100>".$row['quotation_qty']."</td>";
					echo "<td align=center width=100>".$row['quotation_unit_price']."</td>";
					echo "<td align=center width=100>".$row['quotation_total']."</td>";
					echo"<td align=center width=200> <a href='edit_currentquotation.php?quotation_id=".$row['quotation_id']."'>EDIT</a>
						<a href='del_quotation.php?quotation_id=".$row['quotation_id']."'>DELETE</a></td>";
					echo"</tr>";
						}
					echo "</table>";
				
 ?>
      <!--tr>
        <td>Bil</td>
        <td>Description</td>
        <td>Qty</td>
        <td>Unit Price</td>
        <td>Total</td>
        <th colspan="3">Action<!/td>
      <!--/tr>
      <tr>
        <td><input type="text" size="4" maxlength="4" name="quotation_bil"></td>
        <td><input type="text" size="100" maxlength="100" name="quotation_desc"></td>
        <td><input type="text" size="4" maxlength="4" name="quotation_qty"></td>
        <td><input type="text" size="4" maxlength="4" name="quotation_unit_price"></td>
        <td><input type="text" size="4" maxlength="4" name="quotation_total"></td>
        <td align=center><!--a href='vendor_FinanceAdmin_update.php?vendor_id=$vendor_id'>Edit<!--/a></td>
        <td align=center><!--a href='vendor_FinanceAdmin_update.php?vendor_id=$vendor_id'>Delete<!--/a></td>
        <!--td align=center><!--a href='vendor_FinanceAdmin_update.php?vendor_id=$vendor_id'>Add</a></td-->
      <!--/tr>
    </table--></td> 
  </tr> 
</table>

