<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link href="images/style.css" rel=stylesheet type=text/css>
<script language=javascript>
function chkform()
{
	if(document.form.catname.value=="")
	{
		alert('请输入信息标题！');
		document.form.catname.focus();
		return false;
	}
	if(document.form.catname.value.length>50 || document.form.catname.value.length<2)
	{
		alert('信息标题请控制在2~30字之间!');
		document.form.catname.focus();
		return false;
	}
	if(document.form.cat.value=="")
	{
		alert('请选择分类！');
		document.form.province.focus();
		return false;
	}
}
</script>
</head>
<body>
<h3><span><a href="<?=$_SERVER[PHP_SELF]?>">返回</a></span></h3>
<table width=100% border=0 align=center cellpadding=3 cellspacing=1 class=tableborder>
<form method=post onSubmit="return chkform()" name="form" action="">
<tr>
  <td width="22%" align="right">分类名称： </td>
  <td width="78%"><div align="left">
    <input name="catname" type="text" id="catname" value="<?=$cat[catname]?>" size="30">
    *</div></td>
</tr>
<tr>
  <td align="right">分类选择： </td>
  <td><select name="parentid" id="parentid" >
    <option value="0">作为根分类</option>
<?php
foreach ($cats AS $cats)
{
    if($cats['catid'] == $cat['parentid'])
	{
		echo "<option value='$cats[catid]' selected>$cats[catname]</option>\n";
	}else{
		echo "<option value='$cats[catid]'>$cats[catname]</option>\n";
	}
}
?>
  </select>  </td>
</tr>
<tr>
  <td align="right">分类排序： </td>
  <td><input name="catorder" type="text" id="catorder" value="<?=$cat[catorder]?>" size="13"></td>
</tr>
<tr>
  <td align="right">关键词(keywords)： </td>
  <td><textarea name="keywords" cols="65" rows="5" id="keywords"><?=$cat[keywords]?></textarea></td>
</tr>
<tr>
  <td align="right">介绍(description)： </td>
  <td><textarea name="desc" cols="65" rows="5" id="desc"><?=$cat[description]?></textarea></td>
</tr>
<tr><td colspan="2" align="center">
<input type="submit" name="submit" value=" 提 交 " />
<input type="hidden" name="catid" value="<?=$catid?>">
<input type="hidden" name="act" value="update" />
&nbsp;&nbsp; 
<input type="reset" value=" 重 置 " > 
</td></tr>
</form>
</table>
</body>
</html>