<!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>
<script language="javascript" src="../css/chainedselects.js"></script>
<link rel="stylesheet" type="text/css" href="../css/wizard.css" />
<?php

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


$productId = $_GET['productId'];

$categoryQuery = "SELECT category, subCategory FROM products WHERE productId ='". $productId. "' ";
$categoryResult = execsql($categoryQuery);
$category = mysql_result($categoryResult, 0, "category");
$sub_category = mysql_result($categoryResult, 0, "subCategory");

?>



 

</script>
<script language="javascript" src="../css/chainedselectconfig.js"></script>
<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>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
</head>
<body onLoad="initListGroup('vehicles', document.forms[0].category, document.forms[0].sub_category)">
    

<form action="editStockItem.php" method="get" name="form1" target="_top" id="form1">
  <table align="center">
    <tr>
      <td width="210" align="center"><label class="std">Select category and sub category:&nbsp;</label></td>
      </tr>
      <tr>
      <td align="center"><select name="category" style="width:160px;" >
        
      </select></td>
      </tr>
      <tr>
      <td align="center"><select name="sub_category" style="width:160px;">
      </select></td>
      </tr>
      <tr>
      <td align="center">&nbsp;</td>
      </tr>
      <tr>
      <td align="center"><input name="input" type="submit" value="Edit" class="imagebutton"  />        <input name="button" type="button" id="button" class="imagebutton" onclick="MM_goToURL('parent','editStockItem.php?productId=<?php echo $productId ?>&amp;edit=0');return document.MM_returnValue" value="Cancel" /></td>
    </tr>
  </table>
  <input name="edit" type="hidden" id="edit" value="2"  />
  <input name="productId" type="hidden" id="productId" value="<?php echo $productId ?>" />
</form>
  
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("category","req","Please select a category.");
  frmvalidator.addValidation("sub_category","req","Please select sub category.");
</script>   


  

</body>
</html>