<!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 = "AD-presets";
include ("../navigation/access.php");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'Exchange rate' ";
$preset_result = mySQL_query($preset_query);
$exchange_rate = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'Pallets' ";
$preset_result = mySQL_query($preset_query);
$pallet_price = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'VAT' ";
$preset_result = mySQL_query($preset_query);
$vat_rate = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m1 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m1_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m1 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m1_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m2 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m2_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss m2 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_m2_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote truss no' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_truss_no = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m2 low' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m2_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m2 high' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m2_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m1' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m1 = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote tiles m3' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_tiles_m3 = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'gab install quote inspection' ";
$preset_result = mySQL_query($preset_query);
$gab_install_quote_inspection = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m1 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m1_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m1 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m1_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m2 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m2_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss m2 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_m2_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote truss no' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_truss_no = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m2 low' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m2_low = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m2 high' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m2_high = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m1' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m1 = mysql_result($preset_result, 0, "preset_value");


$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote tiles m3' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_tiles_m3 = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'ftw install quote inspection' ";
$preset_result = mySQL_query($preset_query);
$ftw_install_quote_inspection = mysql_result($preset_result, 0, "preset_value");

$table_name = $_SESSION['db_prefix']."_presets";
$preset_query = "SELECT  preset_value  FROM $table_name WHERE preset_name = 'follow_up' ";
$preset_result = mySQL_query($preset_query);
$follow_up = mysql_result($preset_result, 0, "preset_value");

?>

<!--jscript-->
<script language="JavaScript" src="../jscript/cancel_confirmation.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/confirm_exit.js"  type="text/javascript"></script>
<script language="JavaScript" src="../jscript/numbers_only_decimal.js"  type="text/javascript"></script> 
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>


</head>

<body>
<?php 
if ($permission_num==1) {
	include ("../navigation/admin_sidebar.php");
?>

<div class="main_frame">
<div class="page_head_frame">
    <table width="809" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="385"><label class="label_page_head">Presets</label></td>
        <td align="right">&nbsp;</td>
      </tr>
    </table>
  </div>
  <div class="page_middle_frame">
  <form action="presets_save.php" method="get">
  <div class="page_inside_frame">
  <label class="label_std">Edit values and click Save.</label>
  <br />
<br />

  <table width="402" align="left"  id="table_display">
     <tr>
      <td width="237" align="left">Exchange rate:</td>
      <td width="153"><input type="text" name="exchange_text" id="exchange_text"  value="<?php echo $exchange_rate ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\.....).*/, '$1')" class="text50" onfocus = "this.select();" style="text-align:right"/></td>
    </tr>
    <tr>
      <td width="237" align="left">VAT rate:</td>
      <td width="153"><input name="vat_text" type="text" id="vat_text" value="<?php echo $vat_rate ?>" onkeypress="return numbersonly(this, event)" class="text50" onfocus = "this.select();" style="text-align:right"/></td>
    </tr>
    <tr>
      <td align="left">Pallet price:</td>
      <td><input name="pallets_text" type="text" id="pallets_text" value="<?php echo $pallet_price ?>" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\.....).*/, '$1')" class="text50" onfocus = "this.select();" style="text-align:right"/></td>
    </tr>
    <tr>
      <td align="left">Follow-up period in days:</td>
      <td><input name="follow_up_text" type="text" id="follow_up_text" value="<?php echo $follow_up ?>" onkeypress="return numbersonly(this, event)" class="text50" onfocus = "this.select();" style="text-align:right"/></td>
    </tr>
    <tr>
      <td align="left">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
   </table>
 </div><br /><br /><br />

<br />


 <div class="page_inside_frame">
<div style="float:left;">Truss installation quote prices.&nbsp;&nbsp;</div>
<div align="right">
<img src="../images/info_green.png" width="16" height="16">
<label class="label_info">Enter prices at CPLX factor 2.</label>          
</div>
 <table width="650" id="table_details_display">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2" align="center">Gaborone</td>
    <td colspan="2" align="center">Francistown</td>
    </tr>
  <tr>
    <td width="426">Description</td>
    <td width="46">Unit</td>
    <td width="60" align="center">Price/Unit <br />
      Single storey</td>
    <td width="60" align="center">Price/Unit<br />
      Double storey</td>
    <td width="60" align="center">Price/Unit <br />
      Single storey</td>
    <td width="60" align="center">Price/Unit<br />
      Double storey</td>
    </tr>
  <tr>
    <td>Installation of trusses, inclusive of wall plates, bracing, runners, battens,underlay and valley linings, all as indicated on roof layouts.</td>
    <td align="center">M2</td>
    <td><input type="text" name="gab_install_quote_text_1" id="gab_install_quote_text_1" class="text50" onKeyPress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $gab_install_quote_truss_m2_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="gab_install_quote_text_1d" id="gab_install_quote_text_1d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $gab_install_quote_truss_m2_high ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_1" id="ftw_install_quote_text_1" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $ftw_install_quote_truss_m2_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_1d" id="ftw_install_quote_text_1d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $ftw_install_quote_truss_m2_high ?>" onfocus = "this.select();"/></td>
    </tr>
  <tr>
    <td>Install fascia and barge boards.</td>
    <td align="center">M1</td>
    <td><input type="text" name="gab_install_quote_text_2" id="gab_install_quote_text_2" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $gab_install_quote_truss_m1_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="gab_install_quote_text_2d" id="gab_install_quote_text_2d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $gab_install_quote_truss_m1_high ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_2" id="ftw_install_quote_text_2" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $ftw_install_quote_truss_m1_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_2d" id="ftw_install_quote_text_2d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $ftw_install_quote_truss_m1_high ?>" onfocus = "this.select();"/></td>
    </tr>
  <tr>
    <td>Supply and install truss hangers and rawbolts for trusses fixed to brickwork or concrete.</td>
    <td align="center">NO</td>
    <td><input type="text" name="gab_install_quote_text_3" id="gab_install_quote_text_3" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $gab_install_quote_truss_no ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    <td><input type="text" name="ftw_install_quote_text_3" id="ftw_install_quote_text_3" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right" value="<?php echo $ftw_install_quote_truss_no ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>Installation of concrete roof tiles, incl of cutting for valley- and hip tiles, all as indicated on roof layout</td>
    <td align="center">M2</td>
    <td><input type="text" name="gab_install_quote_text_4" id="gab_install_quote_text_4" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $gab_install_quote_tiles_m2_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="gab_install_quote_text_4d" id="gab_install_quote_text_4d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $gab_install_quote_tiles_m2_high ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_4" id="ftw_install_quote_text_4" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $ftw_install_quote_tiles_m2_low ?>" onfocus = "this.select();"/></td>
    <td><input type="text" name="ftw_install_quote_text_4d" id="ftw_install_quote_text_4d" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $ftw_install_quote_tiles_m2_high ?>" onfocus = "this.select();"/></td>
    </tr>
  <tr>
    <td>Installation of ridge, hip and rake verge tiles (incl. of paint and dpc)</td>
    <td align="center">M1</td>
    <td><input type="text" name="gab_install_quote_text_5" id="gab_install_quote_text_5" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $gab_install_quote_tiles_m1 ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    <td><input type="text" name="ftw_install_quote_text_5" id="ftw_install_quote_text_5" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $ftw_install_quote_tiles_m1 ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>Installation of valley gutters</td>
    <td align="center">M3</td>
    <td><input type="text" name="gab_install_quote_text_6" id="gab_install_quote_text_6" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $gab_install_quote_tiles_m3 ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    <td><input type="text" name="ftw_install_quote_text_6" id="ftw_install_quote_text_6" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $ftw_install_quote_tiles_m3 ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    </tr>
  <tr>
    <td>Engineering Inspection</td>
    <td align="center">NO</td>
    <td><input type="text" name="gab_install_quote_text_7" id="gab_install_quote_text_7" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $gab_install_quote_inspection ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    <td><input type="text" name="ftw_install_quote_text_7" id="ftw_install_quote_text_7" class="text50" onkeypress="return isNumberKey(event)" onkeyup=" this.value = this.value.replace (/(\...).*/, '$1')" style="text-align:right"  value="<?php echo $ftw_install_quote_inspection ?>" onfocus = "this.select();"/></td>
    <td>&nbsp;</td>
    </tr>
 </table>
</div>
 <div class="spacer_frame" style="height:410px;"></div>    
 <div class="page_inside_frame">
      <table width="645" border="0">
        <tr>
          <td width="20"></td>
          <td width="615" align="right">
            <input name="button2" type="button" class="imagebutton" id="button2" onclick="cancel_confirmation(3, '../admin_module/user_list.php');" value="Close"/>
            <input name="save_button"  id="save_button" type="submit" class="imagebutton" value="Save" onclick="needToConfirm = false; " />
            <input name="save_close_button"  id="save_close_button" type="submit" class="imagebutton" value="Save &amp; Close" onclick="needToConfirm = false; " /></td>
        </tr>
      </table>
    </div>  
 </form>
</div> 
</div> 

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

<?php } else {
$_SESSION['denied_return'] = "admin_module/user_list.php";	
include ("../navigation/admin_sidebar.php");
include ('../navigation/side_bar.php');
?>
	<body onload="needToConfirm = false; accessdenied(); return false">
	</body>
<?php }
?>


</html>