<!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" />

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

if ($permission_num==1) {
	include ("../navigation/sales_sidebar.php");

$quote_no = $_GET['quote_no'];

?>

</head>
<?php

	
$table_name2 = $_SESSION['db_prefix']."_quotations";
$quote_query = "SELECT cust_id, type, seller, designer, status, request_date, company_contact, contact_phone, seller, quote_type, project_no, project_description, required_date, project_place FROM $table_name2 WHERE quote_no ='".$quote_no."' ";
$quote_result = mySQL_query($quote_query);
$quote_num = mysql_num_rows($quote_result);


$a1 = mysql_result($quote_result, 0, "cust_id");
$a2 = mysql_result($quote_result, 0, "type");
$a3 = mysql_result($quote_result, 0, "seller");
$a4 = mysql_result($quote_result, 0, "status");
$a5 = mysql_result($quote_result, 0, "request_date");
$a6 = mysql_result($quote_result, 0, "company_contact");
$a7 = mysql_result($quote_result, 0, "contact_phone");
$a8 = mysql_result($quote_result, 0, "project_no");
$a9 = mysql_result($quote_result, 0, "project_description");
$a10 = mysql_result($quote_result, 0, "quote_type");
$a11 = mysql_result($quote_result, 0, "designer");
$a12 = mysql_result($quote_result, 0, "project_place");

$cust_id = $a1;

$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 = '".$a1."' ";
$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");



?>
<script type="text/javascript" src="../jscript/tablesort.js"></script>

<body>

<div class="main_frame" >
  <table id="tableMain" > <!--begin of tableMain-->
    <tr>
      <td width="700" height="62" valign="top" ><div class="page_head_frame">
        
        <table width="690" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="556"><label class="label_page_head">Enquiry <?php echo $a10 ?><b></b>&nbsp;&nbsp;</label>              
              <label class="label_page_head_2"><?php echo $c1 ?></label></td>
            <td width="124"><label style="font-size:24px; color:#FB6808;"><?php echo "Q".$quote_no ?></label></td>
            </tr>
        </table>
      </div>
        <br />

<br /></td> <!--center of tableMain-->
</tr>
<tr>
<td height="93"> <!--center of tableMain-->

  <div class="page_middle_frame" style="width:680px;"> Quotation details:
    <table width="670" id="table_details_display">
      <tr>
        <td width="123">Sales person:</td>
        <td width="205"><?php echo  $a3 ?></td>
        <td width="109">Designer</td>
        <td width="213"><?php echo  $a11 ?></td>
      </tr>
      <tr>
        <td>Quote no.:</td>
        <td><?php echo "Q".$quote_no ?></td>
        <td>Enquiry  date:</td>
        <td><?php echo date("d-m-Y", strtotime($a5)) ?></td>
      </tr>
    </table>
  </div>
<br /><br />
<br />
<br />
<br />
<br />
<div class="page_middle_frame" style="width:680px;"> Quotation requested by:
<?php 
		include ('../include/customer_block.php');
		?>

</div>


<div class="page_middle_frame" style="width:680px;"> Quotation project
  <table width="670" id="table_details_display">
    <tr>
      <td>Project or cash sale:</td>
      <td><?php echo  $a10 ?></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="123">Enquiry date:</td>
      <td width="205"><strong><span class="wizard"><?php echo date("d-m-Y", strtotime($a5)) ?></span></strong></td>
      <td width="109">&nbsp;</td>
      <td width="213">&nbsp;</td>
    </tr>
    <tr>
      <td>Project no:</td>
      <td><?php echo  $a8 ?></td>
      <td>Place:</td>
      <td><?php echo $a12 ?></td>
    </tr>
    <tr>
      <td>Project description:</td>
      <td><?php echo $a9 ?></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
<br /></td>
</tr>
<tr>
<td><br />
  <br />
<br /></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>  <!--end of tableMain-->

</div>
</body>  
<?php include ('../navigation/side_bar.php'); ?>

<?php } else {
$_SESSION['denied_return'] = "sales/sales_main.php";	
include ("../navigation/sales_sidebar.php");?>
	<body onload="accessdenied(); return false">
	</body>
<?php }
?>
</html>