<!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=gb2312'>
<title>圈子分类管理</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="main.js"></script>
<script language="javascript" src="../include/dedeajax2.js"></script>
<script type="text/javascript">
<!--

function ShowAddCatalog(){
	$Obj('addCatalog').style.display='block';
}

function CloseAddCatalog(){
	$Obj('addCatalog').style.display='none';
}

function CloseEditCatalog(){
	$Obj('editCatalog').style.display='none';
}

function DelCatalog(cid){
	if(window.confirm("你确实要删除这个分类么？"))
	{
		location.href='group_store.php?action=del&ID='+cid;
	}
}


function EditCatalog(cid){
	$Obj('editCatalog').style.display='block';
	var myajax = new DedeAjax($Obj('editCatalogBody'),false,true,"","","请稍候，正在载入...");
	myajax.SendGet2('group_store.php?catid='+cid+'&action=editload');
	DedeXHTTP = null;
}

-->
</script>
<style type="text/css">
<!--
#addCatalog {
	position:absolute;
	left:455px;
	top:64px;
	width:325px;
	height:238px;
	z-index:1;
	background-color: #F2FDDB;
	border:1px solid #889D8F;
	padding:6px;
	display:none
}
#editCatalog {
	position:absolute;
	left:455px;
	top:64px;
	width:325px;
	height:238px;
	z-index:1;
	background-color: #F2FDDB;
	border:1px solid #889D8F;
	padding:6px;
	display:none
}
-->
</style>
</head>
<body leftmargin='8' topmargin='8'>

<div class="bodytitle">
	<div class="bodytitleleft"></div>
	<div class="bodytitletxt">圈子管理</div>
</div>

<table width="96%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="	background:#E2F5BC;">
		<tr>
				<td class="tbtitletxt">  <table width='96%' cellpadding='0' cellspacing='0'>
                  <tr>
                    <td width='30%' class="tbtitletxt"><strong>分类列表</strong></td>
                    <td align='right'> [<a href="javascript:ShowAddCatalog();"><u>新增分类</u></a>] </td>
                  </tr>
                </table></td>
  </tr>
</table>
			
<table width="96%" border="0" cellpadding="5" cellspacing="1" align="center" style=" border:1px solid #E2F5BC;line-height:31px;margin:auto;">
<tr>
	<td style="background:#F9FFE6;padding:7px 6px 6px 10px;" >
	<font color='red'><?php echo $msg?></font>
	</td>
 </tr>
<tr>
<td height="116" bgcolor="#FFFFFF" style="padding:7px 6px 6px 10px;" >
<table width='98%' border='0' cellpadding='0' cellspacing='0'>
<tr><td width='1%' height='1'></td><td width='70%'></td><td></td></tr>
<form name='frank' id='frank' action='group_store.php' method='post'>
<input type='hidden' name='action' value='uprank' />
<?php  
$mylist = $dlist->GetDataList();
while($row = $mylist->GetArray('dm'))
{
?>
<tr height='24' bgcolor='#FDFEF1'>
<td><input type='text' size='2' name='rank_<?php echo $row['storeid']?>' value='<?php echo $row['orders']?>'></td>
<td style='padding-left:3px'>·<?php echo $row['storename']?> (ID = <?php echo $row['storeid']?>)</td>
<td align='right' style='padding-right:8px;'>
<a href='javascript:EditCatalog(<?php echo $row['storeid']?>);'>修改</a> | <a href='javascript:DelCatalog(<?php echo $row['storeid']?>);'>删除</a></td></tr>
<?php
$db->SetQuery("SELECT * FROM #@__store_groups WHERE tops='".$row['storeid']."' ORDER BY orders ASC");
$db->Execute();
while($rs = $db->GetArray()){
?>
<tr height='24'>
<td><input type='text' size='2' name='rank_<?php echo $rs['storeid']?>' value='<?php echo $rs['orders']?>'></td>
<td style='padding-left:18px'>·<?php echo $rs['storename']?> (ID = <?php echo $rs['storeid']?>)</td>
<td align='right' style='padding-right:8px;'><a href='javascript:EditCatalog(<?php echo $rs['storeid']?>);'>修改</a> | <a href='javascript:DelCatalog(<?php echo $rs['storeid']?>);'>删除</a> 
</td></tr>
<?php

}?>


<?php 
}
?>  
<tr>
<td height="30" colspan="3" >
<input type='Submit' name='Submit' value='更新排序' style='width:80px' class="inputbut"/></td>
</tr>
</form>
<tr bgcolor="#F8FBFB">
    <td height="26" colspan="3" align="center" bgcolor="#F9FFE6"> <?php echo $dlist->GetPageList(7);?> </td>
</tr>
</table>

</td>
</tr>
</table>
<div id="editCatalog">
<span id='editCatalogBody'>请稍候，正在载入...</span>
</div>
<!--  下面是隐藏的栏目增加／修改表单  -->
<div id="addCatalog">
<form name='addform' id='addform' action='group_store.php?action=add' method='post'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="90" height="28">分类名称：</td>
              <td width="101"><input name="storename" type="text" id="storename" /></td>
              <td width="20" align="right" valign="top"><a href="javascript:CloseAddCatalog()"><img src="images/close.gif" width="12" height="12" border="0" /></a></td>
            </tr>
            <tr>
              <td height="28">隶属分类：</td>
              <td colspan="2">
              <select name="tops" id="tops">
                <option value="0">新建顶级分类</option>
                <?php echo $options?>
              </select> 
              </td>
            </tr>
            <tr>
              <td height="28">排序级别：</td>
              <td colspan="2"><input name="orders" type="text" id="orders" size="5" value="0" />
                （数值小靠前）</td>
            </tr>
            <tr>
              <td height="43">&nbsp;</td>
              <td colspan="2"><input type="submit" name="Submit" value="增加分类" style="width:80px"/></td>
            </tr>
  </table>
 </form>
</div>
</body>
</html>