<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<?php
include('../include/session.php');

$quote_no = $_GET['quote_no'];

$table_name2 = $_SESSION['db_prefix']."_quotations";
$quote_query = "SELECT * FROM $table_name2 WHERE quote_no ='".$quote_no."' ";
$quote_result = mySQL_query($quote_query);
$quote_num = mysql_num_rows($quote_result);
$cust_id  = mysql_result($quote_result, 0, "cust_id");
$quotation_date  = mysql_result($quote_result, 0, "quotation_date");
$job_card_no  = mysql_result($quote_result, 0, "job_card_no");
$valid_days   = mysql_result($quote_result, 0, "valid_days");
$delivery_days   = mysql_result($quote_result, 0, "delivery_days");
$terms   = mysql_result($quote_result, 0, "terms");
$vat   = mysql_result($quote_result, 0, "vat_text");
$re_title   = mysql_result($quote_result, 0, "re_title");
$sales_rep =  mysql_result($quote_result, 0, "seller");
$picture =  mysql_result($quote_result, 0, "picture");

$table_name = $_SESSION['db_prefix']."_quotation_lines";
$height_query = "SELECT quote_option_text FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = 1; ";
$height_result = mySQL_query($height_query);
$height_num = mysql_num_rows($height_result);
$height =  mysql_result($height_result, 0, "quote_option_text");

$table_name = $_SESSION['db_prefix']."_quotation_lines";
$line_query = "SELECT quote_item_text, quote_item_price FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = 11; ";
$line_result = mySQL_query($line_query);
$line_num = mysql_num_rows($line_result);


//$table_name = $_SESSION['db_prefix']."_quotation_lines";
//$line2_query = "SELECT quote_item_text, quote_item_price  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '21' ";
//$line2_result = mySQL_query($line2_query);
//$line2_num = mysql_num_rows($line2_result);


$table_name3 = $_SESSION['db_prefix']."_customer";
$customer_query = "SELECT account_type, comp_name, name_2, title, bag_box, box_no, postal_place, phone, contact_1, email_1, cell_1, status FROM $table_name3 WHERE cust_id = '".$cust_id."' ";
$customer_result = mySQL_query($customer_query);
$c0 = mysql_result($customer_result, 0, "account_type");
if ($c0=="corporate") { $c1 = mysql_result($customer_result, 0, "comp_name"); } else { $c1 = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name"); }

$c2 = mysql_result($customer_result, 0, "bag_box");
$c3 = mysql_result($customer_result, 0, "box_no");
$c4 = mysql_result($customer_result, 0, "postal_place");
$c5 = mysql_result($customer_result, 0, "phone");
$c6 = mysql_result($customer_result, 0, "contact_1");
$c7 = mysql_result($customer_result, 0, "email_1");
$c8 = mysql_result($customer_result, 0, "status");
$c9 = mysql_result($customer_result, 0, "cell_1");

?>

<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/print.css" />

<title>Quotation <?php echo $quote_no ?> for <?php echo $c1 ?></title>
<style>
body {
	font-family:Arial, Helvetica, sans-serif;
	font-size:12px;
}
</style>
</head>

<body  onload="window.print(); window.close();" >
<div style="width:800px;">
<?php include('../include/print_header.php'); ?>


<div style="width:650px; margin-left:50px; ">
  <br>
<br>
    
<?php 
echo $c1.'<br>';
if ($c3!='') { echo $c2.' '.$c3.'<br>'; }
if ($c4!='') { echo $c4; }
if ($c7!='') { echo '<br>email: '.$c7; }
?>
  <br>
<br>
  <br>
    Date: <?php echo date("d-m-Y", strtotime($quotation_date)); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ref: <?php echo 'Q'.$quote_no?>
  <br>
<br>
  <br>
  <b>Re: <?php echo $re_title ?></b>
  <br>
<br>
  <br>
    Dear Sir / Madam,
  <br>
  <br>
  Thank  you for choosing Manase Palisade. Manase palisade is a fully modular, bolted  palisade system, thus easily maintainable, and having no welding will out last  any welded system.<br><br>

<div align="center" style="margin:0px;"><img src="../images/palisade_1.png" width="231" height="194"></div><br>
<br>
All our palisade is fully manufactured in Botswana to the highest quality. Existing examples include; Botswana Bureau of Standards, Motor Centre, NCC & Cable yard for BPC, Game city & many more.
<br><br><br>
<div align="center" style="margin:0px;"><img src="../images/palisade_2.png" width="358" height="189"></div>
<br />
<br>
<br>
</div>
</div>

<div style="width:800px; page-break-before:always;">
<br>
<br>
<?php include('../include/print_header.php'); ?>
</div>
<br>
<br>
<div style="width:650px; margin-left:50px; ">
<b>Manase steel palisade fencing specification</b>
<table width="600" border="1" cellspacing="0" cellpadding="2">
  <tr>
    <td>Product </td>
    <td align="right">Silhouette steel palisade</td>
  </tr>
  <tr>
    <td>Height (A)</td>
    <td align="right"><?php echo $height ?>mm</td>
  </tr>
  <tr>
    <td>Ground clearance (F) </td>
    <td align="right">100mm</td>
  </tr>
  <tr>
    <td> Pale top</td>
    <td align="right">Diamond Tip</td>
  </tr>
  <tr>
    <td> Style</td>
    <td align="right"> Alto</td>
  </tr>
  <tr>
    <td>Pale profile</td>
    <td align="right">40x25x2mm</td>
  </tr>
  <tr>
    <td> Rail profile (G)</td>
    <td align="right"> 50x40x2mm</td>
  </tr>
  <tr>
    <td>Post profile (H) </td>
    <td align="right">80x40x2mm</td>
  </tr>
  <tr>
    <td>Concrete base at posts (I) </td>
    <td align="right"> 300x300x600mm</td>
  </tr>
  <tr>
    <td> Opening between pales</td>
    <td align="right"> 122mm</td>
  </tr>
  <tr>
    <td>Post centres (D)</td>
    <td align="right">2425mm</td>
  </tr>
  <tr>
    <td> Fixing</td>
    <td align="right">No welding / 8mm one-way anti-vandal screws to tie plate</td>
  </tr>
  <tr>
    <td>Material</td>
    <td align="right">Commercial quality hot rolled mild steel</td>
  </tr>
  <tr>
    <td>Cleaning</td>
    <td align="right"> 4 Stage degreasing and priming</td>
  </tr>
  <tr>
    <td> Finish</td>
    <td align="right">Factory dipped red oxide primer with QD enamel sprayed on before shipping</td>
  </tr>
  <tr>
    <td>Touch up</td>
    <td align="right">To be supplied for final touch up</td>
  </tr>
  <tr>
    <td>Colour</td>
    <td align="right">To be Finalised</td>
  </tr>
  <tr>
    <td>Warrantee</td>
    <td align="right"> 1 year</td>
  </tr>
</table>
<br>
<table width="602" border=0 style="border-collapse:collapse;"><br>
<?php
$i=0;
while ($i<$line_num) {
	$d1 = mysql_result($line_result, $i, "quote_item_text");
	$d2 = mysql_result($line_result, $i, "quote_item_price");

?>
   <tr>
    <td height="33" colspan="2" valign="bottom" style="border-bottom:solid; border-bottom-width:2px;"><b><?php echo $d1 ?></b></td>
    <td width="183" valign="bottom" style="border-bottom:solid; border-bottom-width:2px;"><div align="right"><b>P
      <?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?>
    </b></div></td>
  </tr>
  <?php
  $i++;
  }
  ?>
</table>
<br>
<br>
<u><b>Terms</b></u><br>
Main Contractor to clear, compact & de-markate fence line<br>
Prices subject to re-measure upon completion of works<br>
Payment: <?php echo $terms ?>.<br>
Delivery: <?php echo $delivery_days ?> days.<br>
Price valid for: <?php echo $valid_days ?> days.<br>
Prices <?php echo $vat ?> 12% VAT<br>
<br>
<br>
Hoping that the above meets with your approval, we will be able to commence as soon as instructed. Please issue a site layout drawing with order and colour requirements.
<br>
<br>
Yours faithfully
<br>
<br>
<br>
<?php echo $sales_rep ?>
</div>
</div>

</body>
</html>