<?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/hbookdatafun.php");
require("../class/dpfun.php");
require("../class/volume.php");
require("../class/rebookdata.php");
require("../class/rebookname.php");
if($enews=="AddNews")//增加信息 ok?
{
	$navtheid=(int)$_POST['filepass'];
	AddNews($_POST,$logininid,$loginin);
}
elseif($enews=="AddBDSB")//自动识别bookid模式，新增章节 ok?
{
	AddBDSB($_POST,$logininid,$loginin);
}
elseif($enews=="EditNews")//修改信息 ok?
{
	$navtheid=(int)$_POST['id'];
	EditNews($_POST,$logininid,$loginin);
}
elseif($enews=="DelNews")//删除信息 ok?
{
	$id=$_GET['id'];
	$bookid=$_GET['bookid'];
	$classid=$_GET['classid'];
	DelNews($id,$bookid,$classid,$logininid,$loginin);
}
elseif($enews=="DelNews_all")//批量删除信息 ok?
{
	$id=$_POST['id'];
	$classid=$_POST['classid'];
	$bookid=$_POST['bookid'];
	$ecms=$_POST['ecmscheck']?2:0;
	DelNews_all($id,$bookid,$classid,$logininid,$loginin,$ecms);
}
elseif($enews=='AddInfoToReHtml')//刷新页面 ok
{
	AddInfoToReHtml($_GET['classid'],$_GET['bookid'],$_GET['dore']);
}
elseif($enews=='ReSingleInfo')//单条书籍刷新 ok
{
	ReSingleBookData($logininid,$loginin);
}
elseif($enews=="CheckNews_all")//审核信息 ok?
{
	$bookid=$_POST['bookid'];
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	CheckNews_all($classid,$id,$bookid,$logininid,$loginin);
}
elseif($enews=="NoCheckNews_all")//取消审核信息 ok?
{
	$bookid=$_POST['bookid'];
	$classid=$_POST['classid'];
	$id=$_POST['id'];
	NoCheckNews_all($classid,$id,$bookid,$logininid,$loginin);
}
elseif($enews=="AddVolume")//增加分卷 ok
{
	$bookid=$_POST['bookid'];
	$classid=$_POST['classid'];
	$vname=$_POST['vname'];
	$myorder=$_POST['myorder'];
	AddV($bookid,$vname,$myorder,$logininid,$loginin);
}
elseif($enews=="EditVOrder")//修改分卷顺序 ok
{
	$bookid=$_POST['bookid'];
	$vid=$_POST['vid'];
	$myorder=$_POST['myorder'];
	EditVOrder($vid,$myorder,$bookid,$logininid,$loginin);
}
elseif($enews=="DelVolume")//删除分卷 ok
{
	$bookid=$_GET['bookid'];
	$vid=$_GET['vid'];
	DelVolume($vid,$bookid,$logininid,$loginin);
}
elseif($enews=="EV")//修改分卷
{
	$vname=$_POST['vname'];
	$vid=$_POST['vid'];
	$bookid=$_POST['bookid'];
	$myorder=$_POST['myorder'];
	EV($vid,$vname,$bookid,$myorder,$logininid,$loginin);
}
elseif($enews=="MoveBD")//批量移动到分卷
{
	$bookid=$_POST['bookid'];
	$id=$_POST['id'];
	$vid=$_POST['vid'];
	$ecms=$_POST['ecmscheck']?0:1;
	MoveBD($vid,$id,$bookid,$logininid,$loginin,$ecms);
}
elseif($enews=="ReBNum")//更新本书章节数
{
	$bookid=$_GET['bookid'];
	ReBNum($bookid);
}
elseif($enews=="ReOneBook")//刷新一本书的全部章节
{
	$start=$_GET['start'];
	$bookid=$_GET['bookid'];
	$tid=$_GET['tid'];
	$havehtml=$_GET['havehtml'];
	$type=$_GET['type'];
	$newbookid=$_GET['startbook'];
	$classid=$_GET['classid'];
	$startbookid=$_GET['startbookid'];
	$endbookid=$_GET['endbookid'];
	ReOneBook($start,$bookid,$tid,$havehtml,$type,$classid,$startbookid,$endbookid,$newbookid,$stime);
}
elseif($enews=="ReBookDataHtml")//按书籍批量刷新章节
{
	$startbook=$_GET['startbook'];
	$classid=$_GET['classid'];
	$startbookid=$_GET['startbookid'];
	$endbookid=$_GET['endbookid'];
	$havehtml=$_GET['havehtml'];
	ReBookDataHtml($startbook,$classid,$startbookid,$endbookid,$havehtml,$stime);
}
elseif($enews=="ReBDOne")//刷新一本书
{
	$start=$_GET['start'];
	$bookid=$_GET['bookid'];
	ReBDOne($start,$bookid,$stime);
}
elseif($enews=="mvidtoid")//移动章节顺序
{
	MvIdToId($_POST);
}
elseif($enews=="mvidtov")//移动到分卷
{
	MvIdToV($_POST);
}
else
{
	printerror("ErrorUrl","history.go(-1)");
}
db_close();
$empire=null;
?>