<!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" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<script language="JavaScript" src="gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<?php
include('../include/session.php');
include('../include/db.php');
include('../include/formValidations.php');
		


$q = "SELECT productId, productName FROM nam_products WHERE category ='Tiles and Accessories' AND isRemoved != '1' ORDER BY productName ASC";
	$arrId = array ();
	$arrName = array ();
	$result = execsql($q);
	$num = mysql_num_rows($result);
	$a = 0;
	while ($a < $num) {
		$arrId[$a] = mysql_result($result, $a, "productId");
		$arrName[$a] = mysql_result($result, $a, "productName");
		$a++;
	}
?>
<script type="text/javascript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>

 
</head>

<body>
<form action="orderWizbase.php" method="get" name="form1" target="_top" id="form1">
  <table>
  <tr>
  <div align="center">
  
    <p class="wizard3"><label class='std'>product:</label> 
      <select name="ProductSelect">
        <option value=""></option>
        <?php
        	for ($i = 0; $i < count($arrId); $i++) {
    		echo "<option value=" . "\"" . $arrId[$i] . "\"" . ">" . $arrName[$i] . "</option>";
	}
?>
      </select>
    </p>
    <p class="wizard3"><label class='std'>quantity:</label>
      <input name="QuantityText" type="text" id="QuantityText" size="10" onkeypress="return numbersonly(this, event)"/>
    </p>
    <p><br />

      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
      &nbsp;
      <input name="input" type="submit" value="Add" class="imagebutton"  />
      <input name="button" type="button" id="button" class="imagebutton" onclick="MM_goToURL('parent','orderWizbase.php?p=3&s=');return document.MM_returnValue" value="Cancel" />
<input name="s" type="hidden" id="s" value="8" />
      <input name="p" type="hidden" id="p" value="3" />
      <input name="l" type="hidden" id="l" value="<?php echo $_SESSION['line_no'] ?>" />
    </p>
  </p>
</form>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("ProductSelect","req","Please select a product.");
  frmvalidator.addValidation("QuantityText","req","Please enter the quantity.");
  
</script>
</div>
</body>
</html>