<?php include('open_connection.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css/gridtable.css" rel="stylesheet" type="text/css" />

<script language="JavaScript">
function printPage() {
if(document.all) {
document.all.divButtons.style.visibility = 'hidden';
window.print();
document.all.divButtons.style.visibility = 'visible';
} else {
document.getElementById('divButtons').style.visibility = 'hidden';
window.print();
document.getElementById('divButtons').style.visibility = 'visible';
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Quotation Display</title>
</head>
<?php
$username=$_SESSION['username'];
//echo 'Welcome: '.$username;
?>
 <?php
                    $userid=mysql_query("select * from tbl_dir_user where user_name='$username'")or die(mysql_errno());
                    $row2=mysql_fetch_array($userid);
                    $user_id=$row2['user_id'];
					$user_fullname=$row2['user_fullname'];
					
					

					
                ?>
<?php
       $quotation_id = $_GET['quotation_id'];
						//echo $quotation_id;?>
						
		<?php  $quotation= "SELECT * FROM tbl_dir_fnb_quotation left join tbl_dir_fnb_customer
		                    ON tbl_dir_fnb_quotation.cust_id=tbl_dir_fnb_customer.cust_id
							
		                    WHERE tbl_dir_fnb_quotation.quotation_id ='$quotation_id'";
				
																		
				$result= mysql_query($quotation);
				// $row = mysql_fetch_array($result, MYSQL_ASSOC);			
				$row=mysql_fetch_array($result);
			    $cust_id=$row['cust_id'];
				$quotation_remarks=$row['quotation_remarks'];
			?>
			
<body>
<div align="center">
  <table width="861" class="gridtable">
    <tr>
      <td colspan="9" ><img src="images/co-X.png" width="25%" height="35%"/><font face="Geneva, Arial, Helvetica, sans-serif" size="3">
	  <div align="left"><b>FOOD AND BEVERAGE QUOTATION</b></div>
       </td>
    </tr>
    <tr>
      <td width="170">Attention to</td>
      <td width="294"><?php echo $row['cust_salutation']?> &nbsp;<?php echo $row['cust_name']?></td>
      
      <td width="168">Date</td>
      <td width="209"><?php echo $row['quotation_date_from']; ?> <strong>to</strong> <?php echo $row['quotation_date_to']; ?></td>
    </tr>
    <tr>
      <td>Position</td>
      <td><?php echo $row['cust_position']?></td>
      <td>Quotation</td>
      <td>Pot &amp; Pan /<?php echo date("Y"); ?>/<?php echo date("m"); ?>/
        <label><strong><?php echo $quotation_id?></strong></label></td>
    </tr>
    <tr>
      <td>Company</td>
      <td><?php echo $row['cust_company']?></td>
      <td>Customer ID </td>
      <td><?php echo $row['cust_id']?></td>
    </tr>
    <tr>
      <td>Address</td>
      <td><?php echo $row['cust_address1'].",".  $row['cust_address2']?></td>
      <td colspan="2" rowspan="6"><p align="center">PLEASE QUOTE THE ABOVE PROFORMA INVOICE NUMBER<br />
        WHEN MAKING THE PAYMENT.</p>
      <p></p></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><?php echo $row['cust_address3'].",".$row['cust_address4']?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><?php echo $row['cust_postcode'] .",". $row['cust_city']?></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><?php echo $row['state_name']?></td>
    </tr>
    <tr>
      <td>Contact No </td>
      <td><?php echo $row['cust_contact']?></td>
    </tr>
    <tr>
      <td>Email</td>
      <td><?php echo $row['cust_email']?></td>
    </tr>
    <tr>
      <td colspan="4"><?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_item left join tbl_dir_user on tbl_dir_fnb_item.user_id=tbl_dir_user.user_id 
					                      LEFT JOIN tbl_dir_staff on tbl_dir_staff.staff_name=tbl_dir_user.user_fullname 
					                      WHERE tbl_dir_fnb_item.quotation_id='$quotation_id' ORDER BY item_id DESC  LIMIT $offset, $rowsPerPage");
			  
			
		            $i=$offset;
					echo "<center><table border=1 width=100%  align=center class=gridtable >";
					echo"<tr><th  width=100>No</th><th  width=600>Description</th><th  width=100>Quantity</th><th width=100>Unit Price</th>
						<th  width=100>Total</th></tr>";
					$sum=0;	
					while(@$row3=mysql_fetch_array($result3))
						{
				        $item_id = $row3['item_id']; 
			    $user_salutation = $row3['user_salutation'];
			      $user_fullname = $row3['user_fullname'];
			   $designation_name = $row3['designation_name'];
		 	   $item_description = $row3['item_description'];
		               $item_qty = $row3['item_qty'];
		        $item_unit_price = $row3['item_unit_price'];
			         $item_total = $row3['item_total'];
					  $staff_ext = $row3['staff_ext'];
		        
			       $sum   += $item_total;				   
				   $rgtotal=number_format((float)$sum, 2, '.', '');  
			$i++;
					echo"<tr>";
					echo "<td align= center >".$i."</td>";
					echo "<td align=center width=600>".$row3['item_description']."</td>";
					echo "<td align=center width=100>".$row3['item_qty']."</td>";
					echo "<td align=center width=100>"."RM ".$row3['item_unit_price']."</td>";
					echo "<td align=left width=100>"."RM ".$row3['item_total']."</td>";
					echo "</tr>";	
				}	
				echo"<tr>";
				    echo "<td colspan=4 align= right>"."Total "."</td>";
					echo "<td colspan=2 align=left>"."RM ".$rgtotal."</td>";
					
				echo "</tr>";
				
					echo "</table>";
					
					
 ?></td>
    </tr>
    <tr>
      <td>Remarks</td>
      <td colspan="3"><?php echo $quotation_remarks?></td>
    </tr>
    <tr>
      <td colspan="4"> ALL PAYMENT BY CHEQUE/BANK DRAFT/ELECTRONIC FUND TRANSFER (EFT) PAYABLE TO: </td>
    </tr>
    <tr>
      <td colspan="4"><table width="829" border="0" class="test" >
        <tr>
          <td width="150" ><strong>Name</strong></td>
          <td width="667" ><strong>:&nbsp;CONVENTION &amp; EXHIBITION (PUTRAJAYA) SDN BHD</strong></td>
        </tr>
        <tr>
          <td><strong>Bank</strong></td>
          <td><strong>:&nbsp;Malayan Banking Berhad</strong></td>
        </tr>
        <tr>
          <td><strong>Account No.</strong></td>
          <td><strong>:&nbsp;566010605563</strong></td>
        </tr>
        <tr>
          <td valign="top"><strong>Bank Address</strong></td>
          <td><p><strong>: R16 &amp;  R15 Bangunan Annexe, Dewan  Persidangan,<br />
: Kompleks Perbadanan Putrajaya, Precint 3,<br />
: 62675, Wilayah Persekutuan Putrajaya.</strong></p>            </td>
        </tr>
        <tr>
          <td><strong>Branch</strong></td>
          <td><strong>: Putrajaya  </strong></td>
        </tr>

      </table>      
     </td>
    </tr>
	
    <tr>
      <td height="115" colspan="4"><p><strong>CONFIRMATION  &amp; DEPOSIT PAYMENTS</strong></p>
        <ul>
          <li>50% deposits required to  confirm the booking <strong>(Non Refundable)</strong>.</li>
          <li>Balance payment will be  collected upon arrival.</li>
        </ul>
        <p><strong>CHANGES  &amp; CANCELLATION</strong></p>
        <ul>
          <li>All cancellation has to be made  within Three (03) working days before the actual function date.</li>
          <li>All changes and cancellations has to be advised by the client in  writing.</li>
          <li>Deposit collected must be  utilized within Seven (07) working days from the original date.</li>
        </ul>
		 <p><strong>ALCOHOLIC BEVERAGES</strong></p>

        <ul>

          <li>Alcoholic beverages are not allowed from being taken into the restaurant /premises. <br/>
“Minuman beralkohol adalah dilarang dibawa masuk ke dalam restoran/premis”
</li>

         
        </ul>
      <p>We trust the above is in order and meets  your requirements. Should you require any further assistance, please do not  hesitate to contact us at <strong>03 8887 6000</strong> extension <strong><?php echo $staff_ext;?></strong>.</p></td>
    </tr>
    <tr>

      <td height="109" colspan="4"><p>Prepared  by:</p>
        <h3><?php echo $user_fullname?>(<?php echo $user_salutation?>) </h3>
      <?php echo $designation_name?></br>
      <br/><br />
        <strong>Convention &amp; Exhibition (Putrajaya) Sdn Bhd (Co-  X)</strong></td>
    </tr>
	<tr>
      <td colspan="9" style="padding:0;" ><img src="images/CI_header.jpg"  class="unborder1" width="100%" height="26%" /></td>
    </tr>
  </table>
  <div id="divButtons" name="divButtons">
<input type="button" value = "Print " onclick="printPage()" style="font:bold 11px verdana;color:#FF0000;background-color:#FFFFFF;"> &nbsp;
<input type="button" value = "Back" onClick="history.go(-1);return true;" style="font:bold 11px verdana;color:#FF0000;background-color:#FFFFFF;">

</div>
</div>
</body>
</html>
