<?php
define('EmpireCMSAdmin','1');
$stime=microtime(true);
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require LoadLang("pub/fun.php");
require("../class/delpath.php");
require("../class/copypath.php");
require("../class/t_functions.php");
require("../data/dbcache/class.php");
require("../data/dbcache/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
$enews=$_POST['enews'];
if(empty($enews))
{
	$enews=$_GET['enews'];
}
//验证用户
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];
$incftp=0;
if($public_r['phpmode'])
{
	include("../class/ftp.php");
	$incftp=1;
}
//会员
require("../member/class/user.php");
require("../class/dpfun.php");
require("../class/hbookfun.php");
require("../class/writer.php");
require("../class/rebookname.php");
if($enews=="AddNews")//增加信息 ok?
{
	$navtheid=(int)$_POST['filepass'];
	AddNews($_POST,$logininid,$loginin);
}
elseif($enews=="EditNews")//修改信息 ok?
{
	$navtheid=(int)$_POST['id'];
	EditNews($_POST,$logininid,$loginin);
}
elseif($enews=="DelNews")//删除信息 ok?
{
	$id=$_GET['id'];
	$classid=$_GET['classid'];
	$bclassid=$_GET['bclassid'];
	DelNews($id,$classid,$logininid,$loginin);
}
elseif($enews=="DelNews_all")//批量删除信息 ok?
{
	$id=$_POST['id'];
	$classid=$_POST['classid'];
	$bclassid=$_POST['bclassid'];
	$ecms=$_POST['ecmscheck']?2:1;
	DelNews_all($id,$classid,$logininid,$loginin,$ecms);
}
elseif($enews=="EditMoreInfoTime")//批量修改信息时间 ok
{
	EditMoreInfoTime($_POST,$logininid,$loginin);
}
elseif($enews=='AddInfoToReHtml')//刷新页面 ok
{
	AddInfoToReHtml($_GET['classid'],$_GET['dore']);
}
elseif($enews=='ReSingleInfo')//单条书籍刷新 ok
{
	ReSingleBook($logininid,$loginin);
}
elseif($enews=="CheckNews_all")//审核信息 ok?
{
	$bclassid=$_POST['bclassid'];
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	CheckNews_all($classid,$id,$logininid,$loginin);
}
elseif($enews=="NoCheckNews_all")//取消审核信息 ok?
{
	$bclassid=$_POST['bclassid'];
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	NoCheckNews_all($classid,$id,$logininid,$loginin);
}
elseif($enews=="MoveNews_all")//移动信息 ok?
{
	$bclassid=$_POST['bclassid'];
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	$to_classid=$_POST['to_classid'];
	MoveNews_all($classid,$id,$to_classid,$logininid,$loginin);
}
elseif($enews=="GoodInfo_all")//批量推荐/头条信息 ok
{
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	$doing=$_POST['doing'];
	$isgood=empty($doing)?$_POST['isgood']:$_POST['firsttitle'];
	GoodInfo_all($classid,$id,$isgood,$doing,$logininid,$loginin);
}
elseif($enews=="SetAllCheckInfo")//本栏目信息全部审核 ok
{
	$classid=$_GET['classid'];
	SetAllCheckInfo($classid,$logininid,$loginin);
}
elseif($enews=="ReBooksHtml")//批量刷新书籍
{
	$start=$_GET['start'];
	$classid=$_GET['classid'];
	$from=$_GET['from'];
	$startid=$_GET['startid'];
	$endid=$_GET['endid'];
	$havehtml=$_GET['havehtml'];
	ReBooksHtml($start,$classid,$from,$startid,$endid,$havehtml,$stime);
}
else
{
	printerror("ErrorUrl","history.go(-1)");
}
db_close();
$empire=null;
?>