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



<!--jscript-->  
<script type="text/javascript" src="../jscript/jquery.1.4.2.js"></script>
<script language="JavaScript" src="../jscript/gen_validatorv4_2.js"  type="text/javascript" xml:space="preserve"></script>
<script language="JavaScript" src="../jscript/numbers_only.js"  type="text/javascript"></script>  
<script language="JavaScript" src="../jscript/go_to_url.js"  type="text/javascript"></script> 

<link rel="stylesheet" href="../window/dhtmlwindow.css" type="text/css" />
<link rel="stylesheet" href="../window/modal.css" type="text/css" />

<script type="text/javascript" src="../window/dhtmlwindow.js"></script>
<script type="text/javascript" src="../window/modal.js"></script>
<?php


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

$job_no = $_GET['job_no'];
$sub_category = $_GET['sub_category'];
$bill_id = $_GET['bill_id'];

$table_name = $_SESSION['db_prefix']."_list_truss_type_1"; 
$type_1_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
$arrId1 = array ();
$arrName1 = array ();
$type_1_result = execsql($type_1_query);
$type_1_num = mysql_num_rows($type_1_result);
$a = 0;
while ($a < $type_1_num) {
		$arrId1[$a] = mysql_result($type_1_result, $a, "item_name");
		$arrName1[$a] = mysql_result($type_1_result, $a, "item_name");
		$a++;
	}
	
$table_name = $_SESSION['db_prefix']."_list_truss_type_2"; 
$type_2_query = "SELECT item_name FROM $table_name";
$arrId2 = array ();
$arrName2 = array ();
$type_2_result = execsql($type_2_query);
$type_2_num = mysql_num_rows($type_2_result);
$a = 0;
while ($a < $type_2_num) {
		$arrId2[$a] = mysql_result($type_2_result, $a, "item_name");
		$arrName2[$a] = mysql_result($type_2_result, $a, "item_name");
		$a++;
	}
	
$table_name = $_SESSION['db_prefix']."_list_truss_type_3"; 
$type_3_query = "SELECT item_name FROM $table_name ORDER BY item_name ASC";
$arrId3 = array ();
$arrName3 = array ();
$type_3_result = execsql($type_3_query);
$type_3_num = mysql_num_rows($type_3_result);
$a = 0;
while ($a < $type_3_num) {
		$arrId3[$a] = mysql_result($type_3_result, $a, "item_name");
		$arrName3[$a] = mysql_result($type_3_result, $a, "item_name");
		$a++;
	}
	

?>
<style>
label.label_std{
	margin-left:5px;
    line-height:20px;
	padding-top:6px;
    color:#000;
    text-shadow:1px 1px 1px #fff;
    font:bold 12px Arial;
}

input.imagebutton{
	background-color:#E1E1E1;
	width: 100px;
	height: 24px;
	border:solid;
	border-width:1px;
	border-color:#FB6808;
	cursor:pointer;
	color:#000000;
	font:bold 12px Arial;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-box-shadow:0px 0px 0px #CCC;
	-webkit-box-shadow:0px 0px 0px #CCC;
	box-shadow:0px 0px 0px #CCC;
	
}

input.imagebutton:hover{
	background-color:#E4E4E4;
	width: 100px;
	height: 24px;
	border:solid;
	border-width:2px;
	border-color:#FB6808;
	cursor:pointer;
	color:#000000;
	font:bold 12px Arial;
	-moz-border-radius: 5px;
	-webkit-border-radius: 5px;
	border-radius: 5px;
	-moz-box-shadow:5px 5px 5px #666;
	-webkit-box-shadow:5px 5px 5px #666;
	box-shadow:5px 5px 5px #666;
	
}
</style>


</head>
<body >
<form action="truss_edit_add_save.php" method="get" name="form1" target="_top" id="form1">

<table width="470" border="0" align="center" cellpadding="0" cellspacing="0" class="list2">
  <tr>
    <td align="center">     
      <table width="462" border="0">
        <tr>
          <td height="46" colspan="4"><label class="label_std">Truss type:</label>
            &nbsp;&nbsp;
            <label class="star">*</label>
<select name="type_1_text" id="type_1_text" class="select200" autofocus>
  <option value=""></option>
              <?php
    	for ($i = 0; $i < count($arrId1); $i++) {
		echo "<option value=" . "\"" . $arrId1[$i] . "\"" . ">" . $arrName1[$i] . "</option>";
		
		}
     ?>
    </select>
            
            <label for="select2"></label>
            <label for="select3">
              <select name="type_2_text" id="type_2_text" class="select200" >
                <option value=""></option>
                <?php
    	for ($i = 0; $i < count($arrId2); $i++) {
		echo "<option value=" . "\"" . $arrId2[$i] . "\"" . ">" . $arrName2[$i] . "</option>";
		
		}
     ?>
              </select>
              <select name="type_3_text" id="type_3_text" class="select200" >
                <option value=""></option>
                <?php
    	for ($i = 0; $i < count($arrId3); $i++) {
		echo "<option value=" . "\"" . $arrId3[$i] . "\"" . ">" . $arrName3[$i] . "</option>";
		
		}
     ?>
              </select>
            </label></td>
          </tr>
        <tr>
          <td width="116" height="31"><label class="label_std">No of trusses: </label>
            <label class="star">*</label></td>
          <td width="99"><label for="textfield"></label>
            <input name="qty_text" type="text" id="qty_text" size="10" onkeypress="return numbersonly(this, event)" autocomplete="off"/></td>
          <td width="124"><label class="label_std">No of FT</label>&nbsp;
            <label class="star">*</label></td>
          <td width="105"><input name="press_points_text" type="text" id="press_points_text" size="10" onkeypress="return numbersonly(this, event)" autocomplete="off" /></td>
        </tr>
        <tr>
          <td height="24">&nbsp;</td>
          <td>&nbsp;</td>
          <td><label class="label_std">Span: </label>
            <label class="star">*</label></td>
          <td><input name="span_text" type="text" id="span_text" size="10" onkeypress="return numbersonly(this, event)" autocomplete="off"/></td>
        </tr>
        </table>
      
      <!--<input name="line_no" type="hidden" value="<?php echo $line_no+1?>" />  -->    
      <input name="job_no" type="hidden" value="<?php echo $job_no?>" />
      <input name="sub_category" type="hidden" value="<?php echo $sub_category?>" />
      <input name="bill_id" type="hidden" value="<?php echo $bill_id?>" />
      </td>
  </tr>
  <tr>
    <td height="45" align="center"><br />
      <input name="next_add_button" type="submit" id="next_add_button" value="Next" class="imagebutton"  hidden="hidden" />
      <input name="finish_add_button" type="submit" id="finish_add_button" value="Add" class="imagebutton"  />
      <input name="cancel_button" type="button" class="imagebutton" id="cancel_button" onclick="needToConfirm = false; MM_goToURL('parent','../production/cutting_bill_edit.php?&job_no=<?php echo $job_no?>&screen=0&sub_category=&edit=1');return document.MM_returnValue"  value="Cancel" />      
    </td>
  </tr>
</table>
</form>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("type_1_text","req","Please enter truss type.");
  frmvalidator.addValidation("type_2_text","req","Please enter truss type.");
  frmvalidator.addValidation("qty_text","req","Please enter number of trusses."); 
  frmvalidator.addValidation("press_points_text","req","Please enter number of FT."); 
  frmvalidator.addValidation("span_text","req","Please enter span.");    
</script>
</body>
</html>