<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--design only--><link rel="stylesheet" type="text/css" href="../css/main.css" />
<?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");
$project   = mysql_result($quote_result, 0, "project");
$re_title   = mysql_result($quote_result, 0, "re_title");
$vat = mysql_result($quote_result, 0, "vat_text");
$priority = mysql_result($quote_result, 0, "priority");
$seller = mysql_result($quote_result, 0, "seller");


if ($cust_id!='0') {
$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");
$customerTT = "<label class=tip_text_label>".$c1."<br>".$c2." ".$c3."<br>".$c4."<br>".$c5."<br>".$c6."<br><label class=tip_click_label>Click for details</label>";
}

$table_name = $_SESSION['db_prefix']."_quotation_notes";	
$notes_query = "SELECT  *   FROM $table_name WHERE quote_number = '".$quote_no."' ";
$notes_result = mySQL_query($notes_query);
$notes_num = mysql_num_rows($notes_result);

$table_name = $_SESSION['db_prefix']."_quotation_accept";
$accept_query = "SELECT accept_value, receipt_no, order_no FROM $table_name WHERE quote_no = '".$quote_no."' ORDER BY accept_id DESC LIMIT 1 ";
$accept_result = mySQL_query($accept_query);
$accept_num = mysql_num_rows($accept_result);
if ($accept_num!=0) {
		$value = mysql_result($accept_result, 0, "accept_value");
		$receipt_no = mysql_result($accept_result, 0, "receipt_no");
		$order_no = mysql_result($accept_result, 0, "order_no");
		
}
else {
	$value = '';
}
?>
<!--style sheets-->
<link rel="stylesheet" type="text/css" href="../css/tooltip.css" />

<!--jscript-->
<script language="JavaScript" src="../jscript/tooltip.js"  type="text/javascript"></script> 

</head>

<body>
<?php
include ("../navigation/header.php");
$page_name = "Sales-main";
include ("../navigation/access.php");

if ($permission_num==1) {
	include ("../navigation/sales_sidebar.php");
	?>
<div class="main_frame">
<div class="page_head_frame">
          <table width="690" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="556"><label class="label_page_head">Quotation</label><label class="label_page_head_2"> <b><?php echo $c1 ?></b></label></td>
              <td width="124"><label class="label_quote_no"><?php echo $quote_no ?></label>&nbsp;&nbsp;&nbsp;<?php if ($priority=="Hot") { ?>
                <img src="../images/flame_red.png" width="24" height="24"  />
                <?php } ?>
              <?php if ($priority=="Warm") { ?>
                <img src="../images/flame_orange.png" width="24" height="24"  />
                <?php } ?>
              <?php if ($priority=="Cold") { ?>
                <img src="../images/flame_blue.png" width="24" height="24"  />
                <?php } ?></td>
            </tr>
          </table>
        </div>
       
      <div class="page_middle_frame">
       <div class="page_inside_frame"> Quotation details  
              <?php 
			  if ($cust_id!='0') {
		include ('../include/customer_block.php');
			  }
			  else {
				  echo 'Bill of quantity';
			  }
		echo' <br>';
		?>
         <br />
         Priority: <?php if ($priority=="Hot") { ?>
                <img src="../images/flame_red.png" width="16" height="16"  />
                <?php } ?>
              <?php if ($priority=="Warm") { ?>
                <img src="../images/flame_orange.png" width="16" height="16"  />
                <?php } ?>
              <?php if ($priority=="Cold") { ?>
                <img src="../images/flame_blue.png" width="16" height="16"  />
                <?php } ?>
       </div>
      <div class="page_inside_frame">
        <table width="600" id="table_details_display">
          <tr>
            <td width="135">Project:</td>
            <td width="126"><?php echo $project ?>&nbsp;</td>
            <td colspan="2">&nbsp;&nbsp;Re: <?php echo $re_title ?></td>
          </tr>
          <tr>
            <td>Quotation no:</td>
            <td>&nbsp;Q<?php echo $quote_no ?>&nbsp;&nbsp;</td>
            <td width="146">&nbsp;Quotation date:</td>
            <td width="173"><?php echo date("d-m-Y", strtotime($quotation_date)) ?></td>
          </tr>
          <tr>
            <td>Terms:</td>
            <td><?php echo $terms?></td>
            <td colspan="2"><?php if ($vat!='') {echo 'Prices '.$vat.' VAT';} ?></td>
          </tr>
          <tr>
            <td>Valid for:</td>
            <td><?php echo $valid_days?> days&nbsp;</td>
            <td>Delivery:</td>
            <td><?php echo $delivery_days?> days </td>
          </tr>
          <tr>
            <td>Sales rep:</td>
            <td><?php echo $seller ?></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table>
        
      </div> 
        <div class="page_inside_frame"> Pricing details<br />
      <?php if ($project=='Electric fencing') {
		  	$table_name = $_SESSION['db_prefix']."_quotation_lines";
			$line_query = "SELECT quote_item_text, quote_item_price  FROM $table_name WHERE quote_number = '".$quote_no."' ";
			$line_result = mySQL_query($line_query);
			$line_num = mysql_num_rows($line_result); ?>  
       <table width="650" id="table_details_display">
      <?php 
	  $i=0;
	  ?>
	  <tr>
          <td colspan="2"><b>Fence options:</b></td>
         </tr>
            <?php
	  while ($i<4) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		  $d2 = mysql_result($line_result, $i, "quote_item_price");
		  ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
         <tr>
           <td colspan="2" style="border-left:hidden; border-right:hidden;">&nbsp;</td>
         </tr>
         <tr>
          <td colspan="2"><b>Additional options:</b></td>
         </tr>
            <?php
	  while ($i<10) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		  $d2 = mysql_result($line_result, $i, "quote_item_price");
		  ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
       <?php } ?>
       
       <?php if ( ($project=='Manase 358') OR ($project=='Diamond mesh') OR ($project=='Palisade standard') OR ($project=='Gate') OR ($project=='Razor wire') OR ($project=='Wall spikes') OR ($project=='Farm fence') OR ($project=='Free standing electric fence') OR ($project=='Miscelaneous') ) { 
	   	
		$table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_text  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '1' AND quote_item_price = 0 ";
		$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 = '11' AND quote_item_price > 0 ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?>  
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Option 1:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line_num) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		   ?>
            <tr>
              <td colspan="2"><?php echo $d1 ?></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php 
      $table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_text  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '2' AND quote_item_price = 0 ";
		$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 = '22' AND quote_item_price > 0 ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?> <br />
<br />
 <?php if ( $project!='Diamond mesh') { ?>  
       <?php if ($line_num>0) { ?>
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Option 2:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line_num) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		   ?>
            <tr>
              <td colspan="2"><?php echo $d1 ?></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
 		}
	   }
	  
	   ?>
       
<?php 
      $table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_text  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '3' AND quote_item_price = 0 ";
		$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 = '33' AND quote_item_price > 0 ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?> <br />
<br />       
       
 <?php if (($project=='Manase 358') OR ($project=='Miscelaneous')) { ?>  
       <?php if ($line_num>0) { ?>
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Option 3:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line_num) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		   ?>
            <tr>
              <td colspan="2"><?php echo $d1 ?></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
 		}
	   }
	 ?> 
     <br />
<br />
 <?php 
      $table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_text  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '4' AND quote_item_price = 0 ";
		$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 = '44' AND quote_item_price > 0 ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?>
       <?php if ($line_num>0) { ?>
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Option 4:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line_num) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		   ?>
            <tr>
              <td colspan="2"><?php echo $d1 ?></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
 		}
	      
	   }
	   ?> 
       
       <br />
<br />
 <?php 
      $table_name = $_SESSION['db_prefix']."_quotation_lines";
		$line_query = "SELECT quote_item_text  FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '5' AND quote_item_price = 0 ";
		$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 = '55' AND quote_item_price > 0 ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?>
       <?php if ($line_num>0) { ?>
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Option 5:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line_num) {
		  $d1 = mysql_result($line_result, $i, "quote_item_text");
		   ?>
            <tr>
              <td colspan="2"><?php echo $d1 ?></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
 		}

	   ?>         
       
 <?php 

if ($project=='Palisade fencing') { ?>
<?php
$table_name = $_SESSION['db_prefix']."_quotation_lines";
			$line_query = "SELECT quote_option_text, quote_item_text, quote_item_price  FROM $table_name WHERE quote_number = '".$quote_no."' ";
			$line_result = mySQL_query($line_query);
			$line_num = mysql_num_rows($line_result);
			$i=0;
			while ($i<$line_num) {
				$option_text = mysql_result($line_result, $i, "quote_option_text");
				$item_text = mysql_result($line_result, $i, "quote_item_text");
				$price = mysql_result($line_result, $i, "quote_item_price");
				$price = mysql_result($line_result, $i, "quote_item_price");
				
				if ($option_text=='Devils fork') {$price2 = $price; }
				if ($option_text=='Gate 1') {$price7 = $price; $text7 = $item_text; }
				if ($option_text=='Gate 2') {$price8 = $price; $text8 = $item_text; }
				if ($option_text=='Gate 3') {$price9 = $price; $text9 = $item_text; }
				$i++;
				}
			?>  

    <table id="table_details_display" width="635" border="1" style="border-collapse:collapse;">
      <thead>
        <tr>
          <td>&nbsp;</td>
          <td width="155">Price</td>
        </tr>
      </thead>
      <tr>
        <td width="464" valign="middle">Devils fork</td>
        <td align="right" valign="middle"><?php if ($price2!=0) {echo number_format($price2, 2, '.', ','); }?>                
        </tr>
    </table>
<br />
<br />
  Gates:&nbsp;<br>
      <table id="table_details_display" width="635" border="1" style="border-collapse:collapse;">
        <tr>
          <td width="464" valign="middle"><?php echo $text7;  ?></td>
          <td width="155" align="right" valign="middle"><?php if ($price7!=0) {echo number_format($price7, 2, '.', ','); }?></td>
        </tr>
      <tr>
        <td valign="middle"><?php  echo $text8; ?></td>
        <td align="right" valign="middle"><?php if ($price8!=0) {echo number_format($price8, 2, '.', ','); }?></td>
      </tr>
      <tr>
        <td valign="middle"><?php echo $text9; ?></td>
        <td align="right" valign="middle"><?php if ($price9!=0) {echo number_format($price9, 2, '.', ','); }?></td>
      </tr>
      </table>

<?php
}
?>      
       
       
      
       <?php if ($project=='Gate motor') {
	    $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 = '1' ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?>  
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Gate automation:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php 
      	$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 = '2'";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?> <br />
<br />
 
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Optional extras:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
	   } ?>
       
       <?php if ($project=='Pool fence') {
	    $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 = '1' ";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?>  
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Items:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php 
      	$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 = '2'";
		$line2_result = mySQL_query($line2_query);
		$line2_num = mysql_num_rows($line2_result);
	  ?> <br />
<br />
 
       <table width="650" id="table_details_display">
       <tr>
          <td colspan="2"><b>Optional extras:</b></td>
         </tr>
      <?php
	  $i=0;	
	  while ($i<$line2_num) {
		  $d1 = mysql_result($line2_result, $i, "quote_item_text");
		  $d2 = mysql_result($line2_result, $i, "quote_item_price");
		   ?>
            <tr>
              <td width="331"><?php echo $d1 ?></td>
              <td width="104"><div align="right"><?php if($d2!=0) { echo number_format($d2, 2, '.', ',');} else { echo '----'; } ?></div></td>
            </tr>
            <?php
	  $i++;
	  }
	  ?>
      </table>
      <?php
	   } ?>
       
     
</div>

           
			<?php if ($accept_num!=0) { ?>
 <div class="page_inside_frame">           
            <table width="650" id="table_details_display">
            <tr>
              <td colspan="2" align="left">Quotation accepted on: P <?php echo $value ?> </td>
            </tr>
            <tr>
              <td colspan="2" align="left"><?php if ($receipt_no!='') {echo 'Receipt no.: '.$receipt_no;}?><?php if ($order_no!='') {echo 'Order no.: '.$order_no;}?> </td>
            </tr>
            <tr>
              <td colspan="2" align="left">Job card no: <a href="../orders/compiled_job.php?job_card_no=<?php echo $job_card_no ?>" onMouseover="ddrivetip('Click for job card details',120)"; onMouseout="hideddrivetip()"><?php echo $job_card_no ?></a></td>
            </tr>
          </table>
   </div>        
			<?php } ?>
          
          
       
        
       <div class="page_inside_frame"> Notes:
          <table width="650" id="table_details_display">
            <tr>
              <td width="81" height="25">Date:</td>
              <td width="86">&nbsp;Entry by:</td>
              <td width="475">Note:&nbsp;</td>
            </tr>
            <?php
			   $i=0;
			   while ($i<$notes_num) {
				   $c1 = mysql_result($notes_result, $i, "note_date");  
				   $c2 = mysql_result($notes_result, $i, "note_text");  
				   $c3 = mysql_result($notes_result, $i, "seller"); 
				   ?>
            <tr>
              <td height="25"><?php echo date("d-m-Y", strtotime($c1))?></td>
              <td><?php echo $c3 ?></td>
              <td><?php echo $c2 ?></td>
            </tr>
            <?php 
				  $i++;
			   }?>
          </table>
        </div><br />
<br />
<?php if ($project=='Electric fencing') {$print_file = 'print_quotation_EF.php?quote_no='.$quote_no;} ?>
<?php if ( ($project=='Manase 358') OR ($project=='Gate') OR ($project=='Razor wire') OR ($project=='Wall spikes') OR ($project=='Farm fence') OR ($project=='Free standing electric fence') OR ($project=='Miscelaneous') ) {$print_file = 'print_quotation_FF.php?quote_no='.$quote_no;} ?>
<?php if ($project=='Diamond mesh') {$print_file = 'print_quotation_DM.php?quote_no='.$quote_no;} ?>
<?php if ($project=='Palisade standard') {$print_file = 'print_quotation_PA-S.php?quote_no='.$quote_no;} ?>
<?php if ($project=='Palisade fencing') {$print_file = 'print_quotation_PA.php?quote_no='.$quote_no;} ?>
<?php if ($project=='Gate motor') {$print_file = 'print_quotation_GM.php?quote_no='.$quote_no;} ?>
<?php if ($project=='Pool fence') {$print_file = 'print_quotation_PF.php?quote_no='.$quote_no;} ?>
        <div class="page_inside_frame">

        <a href="<?php echo $print_file;?>" target="_blank"><input name="print_button" type="button" class="imagebutton" value="Print customers copy" /></a>
        </div>
  </div>
  <!--end of tableMain--> 
  
</div>
<?php include ('../navigation/side_bar.php'); ?>
</body>
<?php } else {
$_SESSION['denied_return'] = "sales/sales_main.php";	
include ("../navigation/sales_sidebar.php");?>
<body onload="accessdenied(); return false">
</body>
<?php }
?>
</html>