<!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/db.php');
include('../include/session.php');		


$q = "SELECT productId, productName FROM 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++;
	}

		
$line_no  = $_GET['line_no'];
$i = $line_no;
$quantity = $_SESSION['QuantityText'.$i];
$productId = $_SESSION['ProductSelect'.$i] ;
$productName = 	 $_SESSION['ProductText'.$i];

?>
<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>
<form action="orderWizbase.php" method="get" name="form1" target="_top" id="form1">
<body><table width="290" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="290">
    <p class="wizard3">
<label class="std"> To change select a new product and/or change the quantity.</label><br />
<label class="std"> <font color=red>To remove, make quantity zero. </font></label>
</p>

<p class="wizard3"><label class='std'>product:</label> 
      <select name="ProductSelect">
        <option value="<?php echo $productId?>" selected="selected"><?php echo $productName ?></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" value="<?php echo $quantity ?>" onfocus = "this.select();"/>
    
  </p>
   </td>
  </tr>
  <tr>
    <td align="center"><input name="input" type="submit" value="Change" 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="9" />
      <input name="p" type="hidden" id="p" value="3" />
    <input name="l" type="hidden" id="l" value="<?php echo $line_no ?>" /></td>
  </tr>
</table>
</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>
</body>
</html>