<?
session_start();
require_once "../init.php";
require_once "../security_s.inc.php";
require_once "../authority.inc.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>增加产品--选择子类产品</title>
<LINK href="../share/style.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<script>
  function ok(form){
     var ref=null;
	 for(i=0;i<form.length;i++){
	    if(form[i].name=='SubClassInfo'){
		  if(form[i].checked){
		     ref=form[i].value;
			 break;
		  }
		}
	 }
	 window.returnValue=ref;
	 window.close();
  }
</script>
</head>
<body>
<table width="100%" border=0>
<tr height="30"><td align="center" colspan='3' bgcolor='#555555'><font color="#FFFFFF">选择产品子类</font></td></tr>
<? if($IDClass>0){
    $sql="select ID,ClassName from product_class where ParentID=$IDClass";
	$result=$DB->query($sql);
	$nums=$DB->num_rows($result);
	if(!$nums){
	   echo "<tr height='30'><td align='center' colspan='3'>没有子类<br><br><br><input type='button' value='关闭窗口' class='button' onclick='window.close()'></td></tr>";
	}
    if($nums){
		echo "<table width='100%' border='0' cellspacing=1 cellpadding=1 bgcolor='#EEEEEE'>";
		echo "<form>";
		echo "<tr height='20'>";
		$i=0;
		while($Info=$DB->fetch_array($result)){
			$i++;
			echo "<td bgcolor='#FFFFFF' width='33%'><input type='radio' name='SubClassInfo' value='$Info[ClassName]@$Info[ID]'>".$Info[ClassName]."</td>";
		    if($i%3==0)echo "</tr><tr height='20'>";
		}
		if($i%3!=0){
		   $tm=3-($i%3);
		   echo "<td colspan='$tm'></td>";
		}
		echo "<tr><td colspan='3' align='center'><input value='确定' type='button' class='button' onclick='ok(this.form)'>&nbsp;<input value='取消' type='button' class='button' onclick='window.close()'></td></tr>";
		echo "</form>";
		echo "</table>";
   }
}
?>
</table>
<? $DB->close()?>
</body>
</html>