<?php
require_once('session.php');
require_once('../fun/funsql.php'); 
require_once('../fun/funlogic.php');
require_once('../fun/funso.php');
if (isset($_GET["rel"])){$rel=$_GET["rel"];}else{$rel="";}
$sostr=new sostr($dbz);
?>
<!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=utf-8" />
<title> Home</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../fun/adminjs.js"></script>
<body>
<?php if ($rel==''){
$version=openfile("../cache/version.txt");
?>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
				<td style="color:#FF6600; line-height:31px;"><strong>欢迎使用C9CMS</strong></td>
  </tr>
</table>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>提示消息</div></div>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr><form name="uploadspider" action="upload_spider.asp" method="post">
		<td height="80" class="main_dnews">
		当前系统版本:C9CMS <font color="#FF0000"><?php echo $version ?></font> 服务器版本:C9CMS <font color="#FF0000"><script src="http://c9cms.csc9.cn/version.js"></script></font>
		<br />
			<script src="http://c9cms.csc9.cn/c9cms.js"></script>
	  </td>
         </form>
	</tr>
</table>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>系统基本信息</div></div>
<table width="96%" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#E2F5BC" style="margin-top:6px;">
		<tr>
				<td align="right" bgcolor="#F9FFE6" class="main_bleft">你的级别：</td>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>
         总管理员</strong></td>
		</tr>
		<tr>
				<td width="22%" rowspan="6" align="right" bgcolor="#F9FFE6" class="main_bleft">系统环境：</td>
		<tr>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>文档路径：</strong><?php echo $_SERVER["PATH_TRANSLATED"]  ?></td>
		</tr>
		<tr>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>执行路径:</strong><?php echo $_SERVER["SCRIPT_FILENAME"] ?></td>
		</tr>
		<tr>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>服务器:</strong><?php echo $_SERVER["SERVER_SIGNATURE"]  ?></td>
		</tr>
		<tr>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>本机IP：</strong><?php echo $_SERVER["REMOTE_ADDR"] ?> </td>
		</tr>
		<tr>
		<td bgcolor="#FFFFFF" class="main_bright"><strong>服务器IP：</strong><?php echo $_SERVER["SERVER_ADDR"]  ?> </td>
		</tr>
		<tr>
				<td align="right" bgcolor="#F9FFE6" class="main_bleft">软件版本信息：</td>
				<td bgcolor="#FFFFFF" class="main_bright"><strong>版本名称：</strong>C9CMS<strong> 版本号：</strong><?php echo $version ?></td>
  </tr>
		<tr>
				<td align="right" bgcolor="#F9FFE6" class="main_bleft">开发团队：</td>
				<td bgcolor="#FFFFFF" class="main_bright">C9 兵者  </td>
  </tr>
  <tr>
				<td align="right" bgcolor="#F9FFE6" class="main_bleft">C9社区交流QQ群：</td>
				<td bgcolor="#FFFFFF" class="main_bright">群一:2748161 群二:22524894 群三:4883547 加群时注明社区ID 社区地址在下面</td>
  </tr>
</table>

<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>使用帮助</div></div>
<table width="96%" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#E2F5BC" style="margin-top:6px;">
		<tr>
				<td width="22%" align="right" bgcolor="#F9FFE6" class="main_bleft">官方社区：</td>
				<td width="78%" bgcolor="#FFFFFF" class="main_bright"><a href="http://www.csc9.cn">http://www.csc9.cn </a></td>
		</tr>
		<tr>
				<td width="22%" align="right" bgcolor="#F9FFE6" class="main_bleft">演示地址：</td>
				<td width="78%" bgcolor="#FFFFFF" class="main_bright"><a href="http://c9page.csc9.cn">http://c9page.csc9.cn </a></td>
		</tr>
		
</table>
<?php }?>
<?php if($rel=='config'){
$fp=openfile('../cache/config.txt');
$fparr=split(",,",$fp);
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>网站参数</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=config">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
<td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;网站参数</b>    &nbsp;&nbsp;</td>
</tr>
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF">变量说明</td>
<td bgcolor="#FFFFFF">变量值</td>
<td width="30%" bgcolor="#FFFFFF">介绍</td>
</tr> 
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站名称:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='title' value='<?php echo $fparr[0] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">网站名称</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站地址:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='site' value='<?php echo $fparr[1] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">网站地址后不可加/</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站关键字:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='keywords' value='<?php echo $fparr[2] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">网站关键字,用半角逗号分割</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站描述:</td>
<td align="left" bgcolor="#FFFFFF">
<textarea name="dis" rows="4" cols="50"><?php echo $fparr[3] ?></textarea></td>
<td align="left" bgcolor="#FFFFFF">详细描述网站</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站风格:</td>
<td align="left" bgcolor="#FFFFFF">
<select name="styles">
<option value="<?php echo $fparr[4] ?>" selected="selected" style="background-color:#0066FF"><?php echo $fparr[4] ?></option>
<?php echo temp();?>
</select>
</td>
<td align="left" bgcolor="#FFFFFF">选择使用的风格</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站状态:</td>
<td align="left" bgcolor="#FFFFFF">
<?php if ($fparr[5]=='1'){?><input type="checkbox" name="html" value="1" checked="checked" /><?php }else{?><input type="checkbox" name="html" value="1" /><?php }?> 静态 <?php if ($fparr[6]=='1'){?><input type="checkbox" name="siteclose" value="1" checked="checked" /><?php }else{?><input type="checkbox" name="siteclose" value="1" /><?php }?> 关闭</td>
<td align="left" bgcolor="#FFFFFF">不选静态时请删除根目录下index.htm<br />
网站关闭时调用网站关闭原因显示.</td>
</tr>

<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站关闭原因:</td>
<td align="left" bgcolor="#FFFFFF">
<textarea name="siteclosemg" rows="4" cols="50"><?php echo $fparr[7] ?></textarea></td>
<td align="left" bgcolor="#FFFFFF">网站关闭原因</td>
</tr>

<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 网站版权:</td>
<td align="left" bgcolor="#FFFFFF">
<textarea name="ends" rows="4" cols="50"><?php echo $fparr[8] ?></textarea></td>
<td align="left" bgcolor="#FFFFFF">将显示于每个页面最下面.</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 第三方统计代码:</td>
<td align="left" bgcolor="#FFFFFF">
<textarea name="tongji" rows="4" cols="50"><?php echo $fparr[9] ?></textarea></td>
<td align="left" bgcolor="#FFFFFF">放置网站统计代码.</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 显示热门关键字数量:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='sokey' value='<?php echo $fparr[10] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">只能为数字</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> JS调用数量:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='js' value='<?php echo $fparr[11] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">只能为数字</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> RSS显示数量:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='rss' value='<?php echo $fparr[12] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">只能为数字</td>
</tr>
<tr align="center" height="24" bgcolor="#FFFFFF"> 
<td height="30" align="left" bgcolor="#FFFFFF"> 搜索显示信息数量:</td>
<td align="left" bgcolor="#FFFFFF">
<input type='text' name='so' value='<?php echo $fparr[13] ?>' style='width:60%'></td>
<td align="left" bgcolor="#FFFFFF">只能为数字</td>
</tr>


</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
  <td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;请按照说明设置.</b></td>
  </tr>
<tr align="center" height="24">
  <td height="30" colspan="3" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="确定" />
    <input type="reset" name="Submit2" value="重置" /></td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }?>
<?php if ($rel=='gao'){
$fp=openfile("../cache/sitegao.txt");
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>网站公告</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=gao">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
  
  <tr align="center">
  <td align="left"> 
  <?php 
include_once("../fck/fckeditor.php") ;
$oFCKeditor = new FCKeditor('FCKeditor1') ;//实例化
$oFCKeditor->BasePath = '../fck/';//这个路径一定要和上面那个引入路径一致，否则会报错:找不到fckeditor.html页面
$oFCKeditor->Value = $fp ;
$oFCKeditor->Width = '100%' ; 
$oFCKeditor->Height = '300' ; 
$oFCKeditor->Create() ;
?>
  </td>
  </tr>
  
<tr align="center" height="24">
  <td height="30" align="center" bgcolor="#FFFFFF">
  <input type="submit" name="Submit" value="确定" />
    <input type="reset" name="Submit2" value="重置" /></td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }?>

<?php if ($rel=='page_add'){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>添加独立页面</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=page_add">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
<td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;添加独立页面</b>    &nbsp;&nbsp;</td>
</tr>
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="names" value="" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">如果设置底部导航显示的话,则显示此名称</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">文件名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="files" value="" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">独立页面生成静态后保存的文件名称,后缀最好用.htm或.html<br />
静态文件保存在根目录下
</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面关键字:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="keywords" value="" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">页面关键字</td>
</tr> 
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面描述:</td>
<td bgcolor="#FFFFFF" align="left"><textarea name="dis" rows="4" cols="50"></textarea></td>
<td width="30%" bgcolor="#FFFFFF" align="left">页面描述</td>
</tr> 
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面属性:</td>
<td bgcolor="#FFFFFF" align="left"><input type="checkbox" name="styles" value="1" />是否使用风格 <input type="checkbox" name="ends" value="1" />底部显示 <input type="checkbox" name="tags" value="1" />是否替换内置标签</td>
<td width="30%" bgcolor="#FFFFFF" align="left"></td>
</tr>
<tr align="center"> 
<td height="25" bgcolor="#FFFFFF" align="left" colspan="3">页面内容:</td>
</tr>
<tr align="center"> 
<td height="25" bgcolor="#FFFFFF" align="left" colspan="3">
<textarea name="mg" cols="100" rows="20"></textarea>
</td>
</tr>
  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }?>

<?php if ($rel=='page_info'){
$id=funstr($_GET["id"]);
$sql=query("select * from ".$dbz."page where id=$id");
  if($row=fetch($sql)){
   $mg=str_replace("\\","",$row["mg"]);
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>独立页面修改</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=page_info">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
<td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;添加独立页面</b>    &nbsp;&nbsp;</td>
</tr>
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="names" value="<?php echo $row["names"]; ?>" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">如果设置底部导航显示的话,则显示此名称</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">文件名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="files" value="<?php echo $row["files"]; ?>" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">独立页面生成静态后保存的文件名称,后缀最好用.htm或.html<br />
静态文件保存在根目录下
</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面关键字:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="keywords" value="<?php echo $row["keywords"]; ?>" maxlength="100" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">页面关键字</td>
</tr> 
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面描述:</td>
<td bgcolor="#FFFFFF" align="left"><textarea name="dis" rows="4" cols="50"><?php echo $row["dis"]; ?></textarea></td>
<td width="30%" bgcolor="#FFFFFF" align="left">页面描述</td>
</tr> 
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">页面属性:</td>
<td bgcolor="#FFFFFF" align="left"><?php if($row["styles"]=='1'){?><input type="checkbox" name="styles" value="1" checked="checked" /><?php }else{?><input type="checkbox" name="styles" value="1"/><?php }?>是否使用风格 <?php if($row["ends"]=='1'){?><input type="checkbox" name="ends" value="1" checked="checked" /><?php }else{?><input type="checkbox" name="ends" value="1"/><?php }?> 底部显示 <?php if($row["tags"]=='1'){?><input type="checkbox" name="tags" value="1" checked="checked" /><?php }else{?><input type="checkbox" name="tags" value="1"/><?php }?> 是否替换内置标签</td>
<td width="30%" bgcolor="#FFFFFF" align="left"></td>
</tr>
<tr align="center"> 
<td height="25" bgcolor="#FFFFFF" align="left" colspan="3">页面内容:</td>
</tr>
<tr align="center"> 
<td height="25" bgcolor="#FFFFFF" align="left" colspan="3">
<textarea name="mg" cols="100" rows="20"><?php echo $mg; ?></textarea>
</td>
</tr>
  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="hidden" name="id" value="<?php echo $row["id"]; ?>" />
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php } }?>
<?php if($rel=='page'){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>页面管理</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">

<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left">ID</td>
<td bgcolor="#FFFFFF" align="left">名称</td>
<td bgcolor="#FFFFFF" align="left">文件</td>
<td bgcolor="#FFFFFF" align="left">显示</td>
<td bgcolor="#FFFFFF" align="left">风格</td>
<td bgcolor="#FFFFFF" align="left">标签</td>
<td bgcolor="#FFFFFF" align="left">时间</td>
<td bgcolor="#FFFFFF" align="left">管理</td>
</tr>
<?php 
$sql=query("select * from ".$dbz."page order by times desc");
while($row=fetch($sql)){
?>
<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left"><?php echo $row["id"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["names"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><a href="../<?php echo $row["files"]; ?>" target="_blank"><?php echo $row["files"]; ?></a></td>
<td bgcolor="#FFFFFF" align="left">
<?php if($row["ends"]=='1'){echo "<a href=\"query.php?rel=page_ends&id=".$row["id"]."&num=0\">是</a>";}else{echo "<a href=\"query.php?rel=page_ends&id=".$row["id"]."&num=1\">否</a>";}?>
</td>
<td bgcolor="#FFFFFF" align="left">
<?php if($row["styles"]=='1'){echo "<a href=\"query.php?rel=page_styles&id=".$row["id"]."&num=0\">是</a>";}else{echo "<a href=\"query.php?rel=page_styles&id=".$row["id"]."&num=1\">否</a>";}?>
</td>
<td bgcolor="#FFFFFF" align="left">
<?php if($row["tags"]=='1'){echo "<a href=\"query.php?rel=page_tags&id=".$row["id"]."&num=0\">是</a>";}else{echo "<a href=\"query.php?rel=page_tags&id=".$row["id"]."&num=1\">否</a>";}?>
</td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["times"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><a href="html.php?rel=page_html&id=<?php echo $row["id"]; ?>">静态</a> <a href="main.php?rel=page_info&id=<?php echo $row["id"]; ?>">修改</a> <a href="query.php?rel=page_del&id=<?php echo $row["id"]; ?>&file=<?php echo $row["files"]; ?>">删除</a></td>
</tr>
<?php }?>
</table>
</td>
</tr>
</table>
<?php }?>

<?php if ($rel=='so_add'){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>添加搜索关键字</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=so_add">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
<td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;添加搜索关键字</b>    &nbsp;&nbsp;</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">搜索关键字:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="keywords" value="" maxlength="100" /> <input type="checkbox" name="hots" value="1" /> 热门</td>
<td width="30%" bgcolor="#FFFFFF" align="left">搜索关键字</td>
</tr> 
  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }?>
<?php if ($rel=='so_info'){
  $id=funstr($_GET["id"]);
  $page=funstr($_GET["page"]);
  $sql=query("select * from ".$dbz."so where id=$id");
  if($row=fetch($sql)){
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>添加搜索关键字</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=so_info">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center" height="24">
<td height="30" colspan="3" align="left" bgcolor="#EDF9D5"><b>&nbsp;添加搜索关键字</b>    &nbsp;&nbsp;</td>
</tr>  
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">搜索关键字:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="keywords" value="<?php echo $row["keywords"] ?>" maxlength="100" /> <?php if($row["hots"]==1){?><input type="checkbox" name="hots" value="1" checked="checked" /> <?php }else{?> <input type="checkbox" name="hots" value="1" /><?php }?> 热门</td>
<td width="30%" bgcolor="#FFFFFF" align="left">搜索关键字</td>
</tr> 
  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="hidden" name="id" value="<?php echo $id; ?>" />
  <input type="hidden" name="page" value="<?php echo $page; ?>" />
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }}?>
<?php if($rel=='so'){
$num=30;
$sqls='';
$page=@funstr($_GET["page"]);
if($page==''){$page=0;}
if($page<0){$page=0;}

$sonum=$sostr->sonum($sqls);
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>关键字管理</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">

<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left">ID</td>
<td bgcolor="#FFFFFF" align="left">关键字</td>
<td bgcolor="#FFFFFF" align="left">热门</td>
<td bgcolor="#FFFFFF" align="left">搜索次数</td>
<td bgcolor="#FFFFFF" align="left">时间</td>
<td bgcolor="#FFFFFF" align="left">管理</td>
</tr>
<?php 
$list=0;
if ($sonum==0){
  echo "<tr><td colspan=\"6\"><strong>暂时没有关键字.</strong></td></tr>";
}
else{
  //总页数
  
  $list=ceil($sonum/$num);
  echo $sostr->solist($num*$page,$num,$page,$sqls);
}

?>
<tr align="center" height="24">
  <td height="30" align="left" bgcolor="#FFFFFF" colspan="6">分页: <?php echo $page+1;?>/<?php echo $list;?> <a href="main.php?rel=so&page=0">首页</a> <?php if ($page==0){echo "上一页"; }else{ echo "<a href=\"main.php?rel=so&page=".($page-1)."\">上一页</a>"; }?> <?php if (($page+1)<$list){echo "<a href=\"main.php?rel=so&page=".($page+1)."\">下一页</a>"; }else{ echo "下一页"; }?> <?php if (($page+1)<>$list){echo "<a href=\"main.php?rel=so&page=".($list-1)."\">尾页</a>"; }else{ echo "尾页"; }?></td>
  </tr>
</table>
</td>
</tr>
</table>
<?php }?>

<?php if($rel=='plug_add'){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>插件安装</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=plug_add">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">插件名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="names" maxlength="20" value="" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr> 

<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">插件作者:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="users" maxlength="20" value="" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr>

<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">启动文件:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="files" maxlength="20" value="" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr>

  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }?>

<?php if($rel=='plug_info'){
$id=funstr($_GET["id"]);
$sql=query("select * from ".$dbz."plug where id=$id");
if($row=fetch($sql)){
?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>插件修改</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" 
	align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<form id="form1" name="form1" method="post" action="query.php?rel=plug_info">
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">插件名称:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="names" maxlength="20" value="<?php echo $row["names"]; ?>" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr> 

<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">插件作者:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="users" maxlength="20" value="<?php echo $row["users"]; ?>" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr>

<tr align="center"> 
<td width="20%" height="25" bgcolor="#FFFFFF" align="left">启动文件:</td>
<td bgcolor="#FFFFFF" align="left"><input type="text" name="files" maxlength="20" value="<?php echo $row["files"]; ?>" /></td>
<td width="30%" bgcolor="#FFFFFF" align="left">20字符内</td>
</tr>

  <tr align="center" height="24">
  <td height="30" bgcolor="#FFFFFF" colspan="3" align="center">
  <input type="hidden" name="id" value="<?php echo $row["id"]; ?>" />
  <input type="submit" name="Submit3" value="确定" />
      <input type="reset" name="Submit2" value="重置" />
  </td>
  </tr>
</table>
</form>
</td>
</tr>
</table>
<?php }}?>
<?php if($rel=='plug'){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'>插件管理</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left">ID</td>
<td bgcolor="#FFFFFF" align="left">名称</td>
<td bgcolor="#FFFFFF" align="left">作者</td>
<td bgcolor="#FFFFFF" align="left">启动文件</td>
<td bgcolor="#FFFFFF" align="left">时间</td>
<td bgcolor="#FFFFFF" align="left">管理</td>
</tr>
<?php 
$sql=query("select * from ".$dbz."plug order by times desc");
while($row=fetch($sql)){
?>
<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left"><?php echo $row["id"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["names"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["users"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["files"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo $row["times"]; ?></td>
<td bgcolor="#FFFFFF" align="left"><a href="main.php?rel=plug_info&id=<?php echo $row["id"]; ?>">修改</a> <a href="query.php?rel=plug_del&id=<?php echo $row["id"]; ?>">删除</a></td>
</tr>
<?php }?>
</table>
</td>
</tr>
</table>

<?php }?>

<?php mysql_close();?>
</body>
</html>