<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$lur=is_login();
$logininid=(int)$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];

$user_r=$empire->fetch1("select adminclass,groupid from {$dbtbpre}enewsuser where userid='$logininid'");
//用户组权限
$gr=$empire->fetch1("select doall from {$dbtbpre}enewsgroup where groupid='$user_r[groupid]'");




//显示无限级栏目列表
function ClassList($adminclass,$doall,$mid,$addminfocid,$oldmid,$oldaddminfocid,$userid){
	global $empire,$fun_r,$dbtbpre,$public_r;
		$bclassid=0;
		$exp='';
		$expjs='|-';
		$expmodjs='|-';
	$sql=$empire->query("select classid,classname,classpath,classurl,tbname,modid,myorder from {$dbtbpre}enewsclass where is_zt=0 order by myorder,classid");
	$returnr='';
	$num=$empire->num1($sql);
	if($num==0)
	{
		return '请先<a href="AddBookClass.php?enews=AddClass" target="main"><u>添加书籍栏目</u></a>';
	}
	$returnr.='<table border=0 cellspacing=0 cellpadding=0 width=100%>';
	$i=1;
	while($r=$empire->fetch($sql))
	{
		$classurl=sys_ReturnBqClassUrl($r);
		//------ 管理信息页面 ------
		//链接地址
		$infoclassurl='';
		//终级栏目

			//最后一个子栏目
			$menutype="file1";
			$infoclassname="<a href='ListBook.php?classid=".$r[classid]."' target='main'>".$r[classname]."</a>";
			$onmouseup="";

		$returnr.='<tr><td id="pr'.$r[classid].'" class="'.$menutype.'" onclick="'.$onmouseup.'">'.$infoclassname.'</td></tr>';

		$i+=1;
	}
	$returnr.='</table>';
	return $returnr;
}

$cacher=ClassList($user_r['adminclass'],$gr['doall'],$mid,$addminfocid,$oldmid,$oldaddminfocid,$userid);




//数据表
$changetbs='';
$dh='';
$tbi=0;
$tbsql=$empire->query("select tbname,tname from {$dbtbpre}enewstable order by tid");
while($tbr=$empire->fetch($tbsql))
{
	$tbi++;
	$changetbs.=$dh.'new ContextItem("'.$tbr['tname'].'",function(){ parent.document.main.location="ListAllInfo.php?tbname='.$tbr['tbname'].'"; })';
	if($tbi%3==0)
	{
		$changetbs.=',new ContextSeperator()';
	}
	$dh=',';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>管理信息</title>
<link href="../data/menu/menu.css" rel="stylesheet" type="text/css">

</head>
<body onLoad="initialize();ContextMenu.intializeContextMenu();" bgcolor="#FFCFAD">
<?php
echo $cacher;
?>
</body>
</html>
<?php
db_close();
$empire=null;
?>