<?
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();

$s=(int)$_GET['s'];
if($s==1){
	$enews='AddBookName';
	$file='form/1.php';
}elseif($s==2){
	$enews='AddBookData';
	$file='form/2.php';
}elseif($s==3){
	$enews='AddAll';
	$file='form/3.php';
}else{
	$enews='----';
	$file='form/0.php';
}

$writer_sql=$empire->query("select classid,classname from {$dbtbpre}enewsclass where is_zt=0");
while($w_r=$empire->fetch($writer_sql))
{
	$se='';
	if($w_r[classid]==$classid){$se=' selected';}
	$w_class.="<option value='".$w_r[classid]."' ".$se.">".$w_r[classname]."</option>";
}


?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>POST接口测试</title>
<link href="../data/images/qcss.css" rel="stylesheet" type="text/css">
<style type="text/css">
.red{color:red}	
.green{color:green}	
</style>
</head>

<body>
<form method="post" action="do.php" name="add">
<table width="80%%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
	<tr>
		<td class="header" colspan=2>帝国小说管理系统 - POST接口测试</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td>数据类型</td>
		<td>
			<table width='100%' align=center cellpadding=3 cellspacing=1 bgcolor='#ffffff'>
				<tr>
					<td height=25 width='20%'><input type="text" name="enews" value="<? echo $enews;?>" size=20></td>
					<td>
						<select name="s" onchange="if(this.options[this.selectedIndex].value!=''){self.location.href='demo.php?s='+this.options[this.selectedIndex].value}" style="width:200px">
							<option value="0">请选择</option>
							<option value="1"<? if($s==1){echo ' selected';}?> style="background:#ffffcc">书名</option>
							<option value="2"<? if($s==2){echo ' selected';}?> style="background:#99ffff">章节</option>
							<option value="3"<? if($s==3){echo ' selected';}?> style="background:#99ffff">章节+书名</option>
						</select>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td>接口密码</td>
		<td>
			&nbsp;<input type="text" name="password" size=20>
		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td>POST数据</td>
		<td>
			<? include ($file);?>
		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td width=10%>&nbsp;</td>
		<td height=25>
			<input type="submit" value="提交"> <input type="reset" value="重置">
		</td>
	</tr>
</table>
	
</form>
</body>
</html>