<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../jscript/calendar.js"></script>

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



?>
</head>
<?php

date_default_timezone_set('Africa/Gaborone');
$entry_date = date("Y-m-d H:i:s", time());
  
$quote_no = $_GET['quote_no'];

$table_name = $_SESSION['db_prefix']."_quotations";
$quote_query = "SELECT * FROM $table_name WHERE  quote_no = '".$quote_no."' ";
$quote_result = mySQL_query($quote_query);
$a1 = mysql_result($quote_result, 0, "cust_id");
$a2 = mysql_result($quote_result, 0, "request_date");
$a3 = mysql_result($quote_result, 0, "project_no");
$a4 = mysql_result($quote_result, 0, "project_description");
$a5 = mysql_result($quote_result, 0, "company_contact");
$a6 = mysql_result($quote_result, 0, "contact_phone");
$a7 = mysql_result($quote_result, 0, "project_place");
$project = mysql_result($quote_result, 0, "project");
$quotation_date = mysql_result($quote_result, 0, "quotation_date");
$terms = mysql_result($quote_result, 0, "terms");
$vat = mysql_result($quote_result, 0, "vat_text");
$valid_days = mysql_result($quote_result, 0, "valid_days");
$delivery_days = mysql_result($quote_result, 0, "delivery_days");
$picture = mysql_result($quote_result, 0, "picture");

$d = date("d", strtotime($quotation_date));
$m = date("m", strtotime($quotation_date));
$y = date("Y", strtotime($quotation_date));

$_SESSION['seller'] = mysql_result($quote_result, 0, "seller");  

if  ($project=='Electric fencing') {
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$lines_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."'  ";
$lines_result = mySQL_query($lines_query);
$lines_num = mysql_num_rows($lines_result);
}

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') ) {
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$lines_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND (quote_option = '1' OR quote_option = '11') ORDER BY quote_option ASC ";
$lines_result = mySQL_query($lines_query);
$lines_num = mysql_num_rows($lines_result);
$quote_option_text = mysql_result($lines_result, 0, "quote_option_text");

$lines2_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND (quote_option = '2' OR quote_option = '22')  ORDER BY quote_option ASC ";
$lines2_result = mySQL_query($lines2_query);
$lines2_num = mysql_num_rows($lines2_result);
if ($lines2_num!=0) {
$quote_option2_text = mysql_result($lines2_result, 0, "quote_option_text");
}
else {
  $quote_option2_text='';
}
}

if ($project=='Diamond mesh') {
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$lines_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND (quote_option = '1' OR quote_option = '11')  ORDER BY quote_option ASC ";
$lines_result = mySQL_query($lines_query);
$lines_num = mysql_num_rows($lines_result);
$quote_option_text = mysql_result($lines_result, 0, "quote_option_text");
}

if ($project=='Palisade standard') {
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$lines_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND (quote_option = '1' OR quote_option = '11')  ORDER BY quote_option ASC ";
$lines_result = mySQL_query($lines_query);
$lines_num = mysql_num_rows($lines_result);
$quote_option_text = mysql_result($lines_result, 0, "quote_option_text");
}

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=='Angle iron 40x40x3') {$price1 = $price;}
        if ($option_text=='Devils fork')  {$price2 = $price;}
        if ($option_text=='Alto') {$price3 = $price;}
        if ($option_text=='Bermuda') {$price4 = $price;}
        if ($option_text=='Carmel') {$price5 = $price;}
        if ($option_text=='Devon') {$price6 = $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++;
        }
        
} 

if ( ($project=='Gate motor') OR ($project=='Pool fence') ) {
$table_name = $_SESSION['db_prefix']."_quotation_lines";
$lines_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '1' ";
$lines_result = mySQL_query($lines_query);
$lines_num = mysql_num_rows($lines_result);
$quote_option_text = mysql_result($lines_result, 0, "quote_option_text");

$lines2_query = "SELECT * FROM $table_name WHERE quote_number = '".$quote_no."' AND quote_option = '2' ";
$lines2_result = mySQL_query($lines2_query);
$lines2_num = mysql_num_rows($lines2_result);
$quote_option2_text = mysql_result($lines2_result, 0, "quote_option_text");
}


$table_name = $_SESSION['db_prefix']."_customer";
$customer_query = "SELECT account_type, status, comp_name,name_2, title, bag_box, box_no, postal_place, phone, cell_1  FROM $table_name WHERE cust_id = '".$a1."' ";
$customer_result = mySQL_query($customer_query);
$b0 = mysql_result($customer_result, 0, "account_type");
if ($b0=="corporate") { $b1 = mysql_result($customer_result, 0, "comp_name"); } else { $b1 = mysql_result($customer_result, 0, "title")." ".mysql_result($customer_result, 0, "name_2")." ".mysql_result($customer_result, 0, "comp_name"); }
$b2 = mysql_result($customer_result, 0, "bag_box");
$b3 = mysql_result($customer_result, 0, "box_no");
$b4 = mysql_result($customer_result, 0, "postal_place");
$b5 = mysql_result($customer_result, 0, "phone");
$b6 = mysql_result($customer_result, 0, "cell_1");
$b7 = mysql_result($customer_result, 0, "status");

?>
<!--style sheets-->
<link href="../css/main.css" rel="stylesheet" type="text/css">
<!--jscript-->
<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script>  

</head>

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

if ($permission_num==1) {
  include ("../navigation/sales_sidebar.php");
  ?>
<div class="main_frame">
<div class="page_head_frame">
        
        <table width="809" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="463"><label class="label_page_head">Edit quotation details</label></td>
            <td width="217"><label class="label_quote_no"><?php echo "Q".$quote_no ?></label></td>
            </tr>
        </table>
      </div>
<div class="page_middle_frame">
<form id="feedbackform" method="post" action="quotation_details_edit_save.php">
 <div class="page_inside_frame">
           <table width="641" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="147" height="40">Quotation date:
              </td>
              <td><?php 
          //instantiate class and set properties
    $myCalendar = new tc_calendar("quotation_date", true);
    $myCalendar->setIcon("../images/iconCalendar.gif");
    $myCalendar->setDate($d, $m, $y);
    $myCalendar->setYearInterval(2010, 2099);
    //output the calendar
    $myCalendar->writeScript();
?></td>
              </tr>
            <tr>
              <td valign="top">Terms:</td>
              <td><input type="radio" name="terms_radio_group" value="In full with order" id="terms_radio_group_0" <?php if ($terms=='In full with order') {?> checked="checked" <?php } ?>/>
                    In full with order
                  <br />
              <input type="radio" name="terms_radio_group" value="60% deposit with order, balance on completion" id="terms_radio_group_1" <?php if ($terms=='60% deposit with order, balance on completion') {?> checked="checked" <?php } ?>/>
                    60% deposit with order, balance on completion
                  <br />
                  
                    <input type="radio" name="terms_radio_group" value="COD on collection" id="terms_radio_group_2" <?php if ($terms=='COD on collection') {?> checked="checked" <?php } ?>/>
                    COD on collection
                  <br />
                  
                    <input type="radio" name="terms_radio_group" value="COD on delivery" id="terms_radio_group_3" <?php if ($terms=='COD on delivery') {?> checked="checked" <?php } ?>/>
                    COD on delivery
                  </td>
              </tr>
            <tr>
              <td height="37">VAT 12%</td>
              <td> 
              <input type="radio" name="vat_radio_group" value="inclusive" id="vat_radio_group_0" <?php if ($vat=='inclusive') {?> checked='checked' <?php } ?>/>
                  Inclusive
                  <input type="radio" name="vat_radio_group" value="exclusive" id="vat_radio_group_1" <?php if ($vat=='exclusive') {?> checked='checked' <?php } ?>/>
                  Exclusive</td>
            </tr>
            <tr>
              <td height="37">Prices valid for:</td>
              <td><select name="valid_days_select" id="valid_days_select">
                <option value="5">5</option>
                <option value="7">7</option>
                <option value="10">10</option>
                <option value="14">14</option>
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="90">90</option>
                <option value="<?php echo $valid_days?>" selected="selected"><?php echo $valid_days?></option>
              </select> 
                &nbsp;days</td>
             </tr>
            <tr>
              <td>Delivery:</td>
              <td><select name="delivery_days_select" id="delivery_days_select">
                <option value="5">5</option>
                <option value="7">7</option>
                <option value="10">10</option>
                <option value="14">14</option>
                <option value="30">30</option>
                <option value="60">60</option>
                <option value="90">90</option>
                <option value="<?php echo $delivery_days?>" selected="selected"><?php echo $delivery_days?></option>
              </select> 
                &nbsp;days</td>
            </tr>
           </table>
          </div>
<br />

<div class="page_inside_frame">
  <table width="671" border="0">
    <tr>
      <td width="143">Sales representative:</td>
      <td width="193"><?php echo $_SESSION['seller']?></td>
      <td><?php if  ($project=='Diamond mesh') {?> <input name="picture_checkbox" type="checkbox" <?php if ($picture=='yes') { ?>  checked="checked" <?php } ?> />Show picture on printed quotation <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Diamond Mesh only) <?php } ?></td>
      </tr>
</table>
</div>

<div class="page_inside_frame">
       <table width="666" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="112" height="29"><label class="label_std">Quote no: </label></td>
                <td width="184">Q<?php echo $quote_no;?></td>
                <td>Date:</td>
                <td><?php  echo date("d-m-Y", strtotime($a2)) ?></td>
              </tr>
              <tr>
                <td height="29">Project no:&nbsp;</td>
                <td height="29"><?php echo $a3 ?></td>
                <td width="114">Customer:</td>
                <td width="256"><?php echo $b1?></td>
              </tr>
              <tr>
                <td valign="top">Place:</td>
                <td valign="top"><?php echo $a7 ?></td>
                <td height="22" valign="top">Contact:</td>
                <td valign="top"><?php echo $a5?></td>
              </tr>
              <tr>
                <td valign="top">Project:</td>
                <td valign="top"><?php echo $project ?></td>
                <td height="26" valign="top">Cell/phone:</td>
                <td valign="top"><?php echo $a6?></td>
              </tr>
              <tr>
                <td valign="top">Description:</td>
                <td height="26" colspan="3" valign="top"><?php echo $a4 ?></td>
              </tr>
        </table>
            
      </div>
            <br>
<?php if ($project=='Electric fencing') { ?>
<div class="page_inside_frame">
  <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
                <td>&nbsp;</td>
                <td align="center" valign="bottom">Price</td>
          </tr>
              <?php
        $i=0;
        while ($i<$lines_num) {
          $d1 = mysql_result($lines_result, $i, "line_id");
          $d2 = mysql_result($lines_result, $i, "quote_item_text");
          $d3 = mysql_result($lines_result, $i, "quote_item_price");
         ?>
              <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line_text<?php echo $i?>" type="text" class="text_box" id="quote_line_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" readonly onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td width="170" align="center" valign="middle"><input type="text" name="quote_price_text<?php echo $i?>" id="quote_price_text<?php echo $i?>" style="text-align:right" value="<?php echo $d3 ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" ></td>
              </tr>
              <?php
        $i++;
        }
        ?>
        </table>
            <br>
      </div>
<?php } ?>            

<?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') ) {  ?>
<div class="page_inside_frame">
Option 1:            
        <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input name="quote_option_text" type="text" id="quote_option_text" size="65" value="<?php echo $quote_option_text ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td align="center" valign="bottom">Price</td>
              </tr>
              <?php
        $i=0;
        while ($i<$lines_num) {
          $d1 = mysql_result($lines_result, $i, "line_id");
          $d2 = mysql_result($lines_result, $i, "quote_item_text");
          $d3 = mysql_result($lines_result, $i, "quote_item_price");
          $quote_option = mysql_result($lines_result, $i, "quote_option");
         ?>
              <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line_text<?php echo $i?>" type="text" class="text_box" id="quote_line_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td width="170" align="center" valign="middle"><?php if ($quote_option=='11') { ?><input type="text" name="quote_price_text<?php echo $i?>" id="quote_price_text<?php echo $i?>" style="text-align:right" value="<?php echo $d3 ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" ><?php } ?></td>
              </tr>
              <?php
        $i++;
        }
        ?>
        </table>
        <br />
<?php if ($quote_option2_text!='') { ?>        
        Option 2: <input name="option2" type="hidden" value="yes" />
<table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
          <tr>
                <td><input name="quote_option2_text" type="text" id="quote_option2_text" size="65" value="<?php echo $quote_option2_text ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/>
          </td>
          <td align="center"> Price </td>
          </tr>
          <?php
        $i=0;
        while ($i<$lines2_num) {
          $d1 = mysql_result($lines2_result, $i, "line_id");
          $d2 = mysql_result($lines2_result, $i, "quote_item_text");
          $d3 = mysql_result($lines2_result, $i, "quote_item_price");
          $quote_option = mysql_result($lines2_result, $i, "quote_option");
          
         ?>
          <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line2_text<?php echo $i?>" type="text" class="text_box" id="quote_line2_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
            <td width="170" align="center" valign="middle"><?php if ($quote_option=='22') { ?><input type="text" name="quote_price2_text<?php echo $i?>" id="quote_price2_text<?php echo $i?>" style="text-align:right" value="<?php echo $d3 ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" ><?php } ?></td>
          </tr>
              <?php
        $i++;
        }
        ?>
        </table>
<?php } ?>           
            <br>
      </div>
<?php } ?>

<?php
if  ($project=='Diamond mesh') {  ?>
<div class="page_inside_frame">
        <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input name="quote_option_text" type="text" id="quote_option_text" size="65" value="<?php echo $quote_option_text ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td align="center" valign="bottom">Price </td>
              </tr>
              <?php
        $i=0;
        while ($i<$lines_num) {
          $d1 = mysql_result($lines_result, $i, "line_id");
          $d2 = mysql_result($lines_result, $i, "quote_item_text");
          $d3 = mysql_result($lines_result, $i, "quote_item_price");
          $quote_option = mysql_result($lines_result, $i, "quote_option");
        ?>
              <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line_text<?php echo $i?>" type="text" class="text_box" id="quote_line_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td width="170" align="center" valign="middle"><?php if ($quote_option=='11') {?> <input name="price_text<?php echo $i?>" id="price_text<?php echo $i?>" type="text" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $d3 ?>"/><?php } ?></td>
              </tr>
              <?php
        $i++;
        }
        ?>
        </table>
        <br />
          
      </div>
<?php } ?>

<?php
if  ($project=='Palisade standard') {  ?>
<div class="page_inside_frame">
        <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td align="center" valign="bottom">Price </td>
              </tr>
              <?php
        $i=0;
        while ($i<$lines_num) {
          $d1 = mysql_result($lines_result, $i, "line_id");
          $d2 = mysql_result($lines_result, $i, "quote_item_text");
          $d3 = mysql_result($lines_result, $i, "quote_item_price");
          $d4 = mysql_result($lines_result, $i, "quote_option_text");
          $quote_option = mysql_result($lines_result, $i, "quote_option");
        ?>
              <tr>
                <td width="430" height="36" valign="middle"><input name="quote_line_text<?php echo $i?>" type="text" <?php if ($quote_option==1) {?> size="30"  readonly="readonly" <?php } else {?>size="60" <?php } ?> class="text_box" id="quote_line_text<?php echo $i?>" value="<?php echo $d2 ?>"  onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/><?php if ($quote_option==1) {?>&nbsp;&nbsp;&nbsp;Change height: <select name="height_select" id="height_select">
                  <option value="1500">1500</option>
                  <option value="1800">1800</option>
                  <option value="2100">2100</option>
                  <option value="2400">2400</option>
                  <option value="<?php echo $d4 ?>" selected="selected"><?php echo $d4 ?></option>
                <?php } ?></select></td>
                <td width="170" align="center" valign="middle"><?php if ($quote_option=='11') {?> <input name="price_text<?php echo $i?>" id="price_text<?php echo $i?>" type="text" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $d3 ?>"/><?php } ?></td>
              </tr>
              <?php
        $i++;
        }
        ?>
        </table>
        <br />
          
      </div>
<?php } ?>

<?php
if ( ($project=='Gate motor') OR ($project=='Pool fence') ) {  ?>
<div class="page_inside_frame">
<?php if ($project=='Gate motor') { echo 'Gate automation:'; } else { echo 'Pool fence:'; } ?>            
        <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
           <?php
        $i=0;
        while ($i<$lines_num) {
          $d1 = mysql_result($lines_result, $i, "line_id");
          $d2 = mysql_result($lines_result, $i, "quote_item_text");
          $d3 = mysql_result($lines_result, $i, "quote_item_price");
         ?>
              <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line_text<?php echo $i?>" type="text" class="text_box" id="quote_line_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
                <td width="170" align="center" valign="middle"><input type="text" name="quote_price_text<?php echo $i?>" id="quote_price_text<?php echo $i?>" style="text-align:right" value="<?php echo $d3 ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" ></td>
              </tr>
              <?php
        $i++;
        }
        ?>
        </table>
        <br />
        
        Optional extras: 
        <table  id="table_resume" width="600" border="0" cellspacing="0" cellpadding="0">
          <?php
        $i=0;
        while ($i<$lines2_num) {
          $d1 = mysql_result($lines2_result, $i, "line_id");
          $d2 = mysql_result($lines2_result, $i, "quote_item_text");
          $d3 = mysql_result($lines2_result, $i, "quote_item_price");
         ?>
          <tr>
                <td width="430" height="36" align="right" valign="middle"><input name="quote_line2_text<?php echo $i?>" type="text" class="text_box" id="quote_line2_text<?php echo $i?>" value="<?php echo $d2 ?>" size="60" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"/></td>
            <td width="170" align="center" valign="middle"><input type="text" name="quote_price2_text<?php echo $i?>" id="quote_price2_text<?php echo $i?>" style="text-align:right" value="<?php echo $d3 ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" ></td>
          </tr>
              <?php
        $i++;
        }
        ?>
        </table>
           
            <br>
      </div>
<?php } ?>

<?php 

if ($project=='Palisade fencing') { ?>
<div class="page_inside_frame">      
<div class="wizard_frame" id="palisade_option2_div" > 
      <table id="dataTable5" width="590" border="1" style="border-collapse:collapse;">
        <tr>
          <td width="408" valign="middle"></textarea>Devils fork</td>
          <td width="140" align="right" valign="middle"><input  name="price2_text" id="price2_text" type="text" class="text100" value="<?php if ($price2!='') { echo $price2; } ?>" onKeyPress="return isNumberKey(event)" onKeyUp=" this.value = this.value.replace (/(\...).*/, '$1')"   style="text-align:right" onfocus = "this.select();"/>
          </td>
          
        </tr>
</table>
</div> 


<div class="wizard_frame" id="palisade_gate_div" >  
      Gates:&nbsp;<br>
      <table id="dataTable5" width="590" border="1" style="border-collapse:collapse;">
        <tr>
          <td width="408" valign="middle"><input type="text" name="gate7_text" id="gate7_text" class="text400" value="<?php if ($text7!='') { echo $text7; } ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');" ></td>
          <td width="140" align="right" valign="middle"><input  name="price7_text" id="price7_text" type="text" class="text100" value="<?php if ($price7!='') { echo $price7; } ?>" onKeyPress="return isNumberKey(event)" onKeyUp=" this.value = this.value.replace (/(\...).*/, '$1')"   style="text-align:right"  onfocus = "this.select();"/>
          </td>
        </tr>
      <tr>
        <td valign="middle"><input type="text" name="gate8_text" id="gate8_text" class="text400" value="<?php if ($text8!='') { echo $text8; } ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"></td>
        <td align="right" valign="middle"><input  name="price8_text" id="price8_text" type="text" class="text100" value="<?php if ($price8!='') { echo $price8; } ?>" onKeyPress="return isNumberKey(event)" onKeyUp=" this.value = this.value.replace (/(\...).*/, '$1')"   style="text-align:right"  onfocus = "this.select();"/></td>
      </tr>
      <tr>
        <td valign="middle"><input type="text" name="gate9_text" id="gate9_text" class="text400" value="<?php if ($text9!='') { echo $text9; } ?>" onKeyUp="this.value=this.value.replace(/[',&quot;]/g,'`');"></td>
        <td align="right" valign="middle"><input  name="price9_text" id="price9_text" type="text" class="text100" value="<?php if ($price9!='') { echo $price9; } ?>" onKeyPress="return isNumberKey(event)" onKeyUp=" this.value = this.value.replace (/(\...).*/, '$1')"   style="text-align:right"  onfocus = "this.select();"/></td>
      </tr>
      </table>
</div> 
</div>  
<?php
}
?>

<br />

<div class="page_inside_frame">
  <table width="645" border="0">
    <tr>
      <td width="20"></td>
      <td width="615" align="right">
        <input type="hidden" name="project_text" id="project_text" value="<?php echo $project ?>"/>
<input type="hidden" name="cust_id_text" id="cust_id_text" value="<?php echo $a1 ?>" />
        <input type="hidden" name="quote_no_text" id="quote_no_text" value="<?php echo $quote_no ?>" />
        <input name="button2" type="button" class="imagebutton" id="button2" onclick="cancel_confirmation(3, '../sales/sales_main.php?date=0');" value="Close"/>
        <input name="save_button"  id="save_button" type="submit" class="imagebutton" value="Save" onclick="needToConfirm = false; confirmRefresh();" />
        <input name="save_close_button"  id="save_close_button" type="submit" class="imagebutton" value="Save &amp; Close" onclick="needToConfirm = false; confirmRefresh();" /></td>
    </tr>
  </table>
</div>
</form>
</div>
<!--form validation-->
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("feedbackform");
  //frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("quote_line_1_text","req","At least one item is required. Use the top box for the first item");
  frmvalidator.addValidation("quote_price_1_text","req","At least one quote price is required. Use the top box for the first pricing");
  </script>

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