<?php
	include("../include/global.php");
	include("ZC_Check_admin.php");
	
	//表单提交时修改站点参数
	if(isset($_POST['submit'])){
		global $db;
		$sql="update `".PRE."system` set `name`='".htmldecode($_POST['name'])."',`title`='".htmldecode($_POST['title'])."',`keywords`='".htmldecode($_POST['keywords'])."',`smalltext`='".htmldecode($_POST['smalltext'])."',`url`='".htmldecode($_POST['url'])."',`copyright`='".htmldecode($_POST['elm1'])."' where id=1";
		$db->query($sql) or die ("修改系统参数出现错误");
	}
		
		//显示站点参数
		$name="";
		$title="";
		$keywords="";
		$smalltext="";
		$url="";
		$copyright="";
		$sql2="select * from `".PRE."system`";
		$rs=$db->query($sql2) or die ("显示系统参数出现错误");		
		while($row=$db->fetch_array($rs)){
			$name=$row['name'];
			$title=$row['title'];
			$keywords=$row['keywords'];
			$smalltext=$row['smalltext'];
			$url=$row['url'];
			$copyright=$row['copyright'];
		}
?>
<!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>系统参数修改</title>
		<link href="css/Admin.css" rel="stylesheet" type="text/css" />
       <script type="text/javascript" src="../xheditor/jquery/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="../xheditor/xheditor-zh-cn.js"></script>
	</head>

	<body>	
		<form action="" method="post" name="zzcms" id="zzcms">
			<table align=center border=0 cellspacing=1 cellpadding=5 width="95%"
				class="AdminTable">
				<tr>
					<th colspan="2" align="center">系统参数修改</th>
				</tr>
                	
				<tr>
					<td class="td">
						网站名称：
					</td>
					<td>
						<input name="name" type="text" id="name" style="width: 350px;" value="<?php echo $name?>" />
						(请填写网站的名字)</td>
				</tr>
                <tr>
				  <td class="td">网站标题：
					</td>
			    <td>
						<input name="title" type="text" id="title" style="width: 350px;" value="<?php echo $title?>" />
					(请填写网站标题) </td>
				</tr>
                <tr>
					<td class="td">关键字：
					</td>
			    <td>
						<input name="keywords" type="text" id="keywords" style="width: 350px;" value="<?php echo $keywords?>" />
					(请填写关键字) </td>
				</tr>
                <tr>
				  <td class="td">网站描述：
					</td>
			    <td>
						<input name="smalltext" type="text" id="smalltext" style="width: 350px;" value="<?php echo $smalltext?>" />
					(请填写网站描述：200字以内) </td>
				</tr>
				<tr>
					<td class="td">
						URL：
					</td>
					<td>
						<input name="url" type="text" id="url"
							style="width: 350px;" value="<?php echo $url?>" />
						(网站域名 如：http://www.wa86.com)</td>
				</tr>
				<tr>
					<td align="left" valign="top" class="td" style="padding-top: 7px;">
						版权信息：
					</td>
					<td>
						<textarea id="elm1" name="elm1" class="xheditor" rows="25" cols="80" style="width: 100%; height:180px;"><?php echo $copyright?></textarea>
					</td>
				</tr>
                
                
				<tr>
					<td class="td" width="11%">&nbsp;
						
					</td>
					<td width="89%">
						<input name="submit" type="submit" class="button" id="submit" value="提交" />
						<input name="Reset" type="reset" class="button" id="Reset"
							value="重置" />
					</td>
				</tr>
                
			</table>
</form>
     	</body>
</html>
