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

<script language="JavaScript" src="../jscript/gen_validatorv4.js"  type="text/javascript" xml:space="preserve"></script>
<script language="javascript" src="../jscript/chainedselects.js"></script>
<script language="javascript"  src="../jscript/chainedselectconfig.js"></script>

<style>
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>

<?php


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


$store_item_id = $_GET['store_item_id'];
$table_name = $_SESSION['db_prefix']."_store_items";
$categoryQuery = "SELECT category, subCategory FROM $table_name WHERE store_item_id ='". $store_item_id. "' ";
$categoryResult = execsql($categoryQuery);
$category = mysql_result($categoryResult, 0, "category");
$sub_category = mysql_result($categoryResult, 0, "subCategory");

?>

<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 onLoad="initListGroup('Direct materials', document.forms[0].category, document.forms[0].sub_category)">
    

<form action="../store/store_item_edit.php" method="get" name="form1" target="_top" id="form1">
  <table width="290" border="0" align="left" cellpadding="0" cellspacing="0" class="list2">
  <tr>
    <td width="290" align="center"><label class="std">Select store and department:&nbsp;</label></td>
      </tr>
      <tr>
      <td height="29" align="center"><select name="category" style="width:160px;" >
        
      </select></td>
      </tr>
      <tr>
      <td height="38" 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','../store/store_item_edit.php?store_item_id=<?php echo $store_item_id ?>&edit=0');return document.MM_returnValue" value="Cancel" />
      <input name="edit" type="hidden" id="edit" value="2"  />
  <input name="store_item_id" type="hidden" id="store_item_id" value="<?php echo $store_item_id ?>" />
      </td>
    </tr>
  </table>
</form>
<script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
  frmvalidator.addValidation("category","req","Please select a store.");
  frmvalidator.addValidation("sub_category","req","Please select a department.");
</script>   
</div>


  

</body>
</html>