<!--<?php
$listname = ($list[name] == "")?"根目录":$list[name];
print <<<EOT
-->
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<style>
td {font-size: 9pt;line-height: 1.5;}
body {font-size: 9pt;line-height: 1.5;}
a:link { font-size: 9pt; color: #000000; text-decoration: none }
a:visited{ font-size: 9pt; color: #000000; text-decoration: none }
a:hover {font-size: 9pt;color: red}
.adminleft {
  height:30px;
  text-align:right;
}
.adminright {
  height:30px;
  padding-left:5px;
}
</style>
<table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#A5D0F1">
  <tr>
    <td background="images/wbg.gif" bgcolor="#F0F3F8" colspan="6">新闻分类</td>
  </tr>
  <tr bgcolor="#F0F3F8" height="25" align="center">
    <td>分类名称</td>
    <td width="50">状态</td>
    <td width="100">添加新闻</td>
    <td width="100">新闻列表</td>
    <td width="50">修改</td>
    <td width="50">删除</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" colspan="6" align="center">上级分类:$listname, <a href="newscat.php">返回分类首页</a></td>
  </tr>
<!--
EOT;
if($lists != ""){
foreach($lists as $lists){
$bgcolor =($bgcolor == '#F0F3F8')?'#FFFFFF':'#F0F3F8';
$txtstatus = ($lists[avail] == 'Y')?"<a href='newscat.php?mode=setavail&listid=$lists[listid]&avail=N'>启用</a>":"<a href='newscat.php?mode=setavail&listid=$lists[listid]&avail=Y'><font color='#FF0000'>禁用</font></a>";
print <<<EOT
-->
  <tr bgcolor="$bgcolor" height="25"  align="center">
    <td align="left">&nbsp;<a href="newscat.php?listid=$lists[listid]">$lists[name]</A></td>
    <td>$txtstatus</td>
    <td><A href="addnews.php?listid=$lists[listid]">添加新闻</A></td>
    <td><A href="news.php?listid=$lists[listid]">查看新闻</A></td>
    <td><a href="newscat.php?listid=$lists[listid]">修改</a></td>
    <td><a href="newscat.php?mode=delcat&listid=$lists[listid]">删除</a></td>
  </tr>
<!--
EOT;
}
}else{print <<<EOT
-->
  <tr>
    <td colspan="6" align="center" bgcolor="#F0F3F8">没有子分类</td>
  </tr>
<!--
EOT;
}print <<<EOT
-->
</table>
<br />
<table width="100%"  border="0" cellpadding="4" cellspacing="1" bgcolor="#A5D0F1">
  <tr>
    <td background="images/wbg.gif" bgcolor="#F0F3F8" colspan="2">管理分类</td>
  </tr>
<FORM action="newscat.php" method="POST">
<INPUT type="hidden" name="mode" value="add">
<INPUT type="hidden" name="listid" value="$listid">
  <tr bgcolor="#FFFFFF">
    <td width="100" height="30">分类名称：<font class="Star">*</font></td>
    <td width="90%"><INPUT type="text" name="name" value="$list[name]" size="30"></td>
  </tr>

  <tr bgcolor="#FFFFFF">
    <td>所属分类：</td>
    <td><select name="parentid">
	<option value="0" selected>根目录</option>
<!--
EOT;
if($newslists){
$pnewslists = $newslists;
foreach($pnewslists as $nl){

if($nl[listid] == $listid)
	continue;

if($nl[parentid] != 0)
	continue;
	
$nlselected = ($nl[listid] == $list[parentid])?"selected":"";
print <<<EOT
-->
<option value="$nl[listid]" $nlselected>$nl[name]</option>
<!--
EOT;
$xnewslists = $newslists;
foreach($xnewslists as $xnl){
if($xnl[parentid] == $nl[listid]){
print <<<EOT
-->
<option value="$xnl[listid]" $nlselected>----$xnl[name]</option>
<!--
EOT;
}}print <<<EOT
-->


<!--
EOT;
}}print <<<EOT
-->
</select>
    </td>
  </tr>
  
  <tr bgcolor="#FFFFFF">
    <td>分类介绍：<font class="Star">*</font></td>
    <td><TEXTAREA name="descr" cols="70" rows="5" style="width:90%">$list[descr]</TEXTAREA></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>分类状态：</td>
    <td>
<!--
EOT;
$yselected = ($list[avail] == "Y")?"selected":"";
$nselected = ($list[avail] == "N")?"selected":"";
print <<<EOT
-->
<SELECT name="avail">
<OPTION value="Y" $yselected>显示</OPTION>
<OPTION value="N" $nselected>隐藏</OPTION>
</SELECT>
    </td>
  </tr>
  <tr bgcolor="#F0F3F8">
    <td></td>
    <td><INPUT type="submit" value=" 提交 "></td>
  </tr>
</FORM>
</table>
<!--
EOT;
?>-->