<?php
define('IN_SYS',TRUE);
define('IN_AdminMenu',TRUE);
require './admin_config.php';
require '../config.php';
require '../setup.php';
require("../lib/admin_chk.php");
?>
<?php
$pageTitle="网站基本信息设置";

$infoTable = "setting";
$Type = $_GET["type"];

switch($Type){
	case "up":
		if(empty($_POST["siteTitle"])){
			OutErrorBack("网站名称不能够为空!");
		}
		$sql = "update ".DB_TablePre.$infoTable." set shareCode='".$_POST["shareCode"]."',siteTitle='".$_POST["siteTitle"]."',companyName='".$_POST["companyName"]."',siteKeywords='".trim($_POST["siteKeywords"])."',siteDescription='".trim($_POST["siteDescription"])."',siteHttp='".$_POST["siteHttp"]."'";
		mysql_query($sql);
		//if($_POST["imageUrl"] != $_POST["pic_old"]){
		//	ImgDelpic($_POST["pic_old"],".."); //删除图片
		//}
		OutErrorGo("修改成功!","?");
	break;
}
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<title><?php echo $pageTitle?><?php echo $sysTitle?></title>
<link href="templates/admin.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../lib/jquery/jquery.js"></script>
<script type="text/javascript" src="js/controlPanelMenu.js"></script>
<script type="text/javascript" src="js/commmonAdmin.js"></script>
</head>
<body>
<?php
include("./admin_header.php")
?>
<div id="containerAdmin" class="wrapper_m">
<div id="sidebarAdmin">
<?php
include("./admin_controlPanelDir.php")
?>
</div>
<div id="contentbarAdmin">
<div class="tips_2"><?php adminPageLocation($pageTitle)?></div>

<?php
$db = mysql_query("select * from ".DB_TablePre.$infoTable." where id=1");
$rs = mysql_fetch_array($db);
if($rs){
?>
<form action="?type=up" method="post" name="formAdmin" target="_parent" id="formAdmin">
<table cellspacing="1" class="adminTableV0">
<tr>
<td width="142" class="tw_1">网站Title：</td>
<td width="1218" class="tw_2"><input name="siteTitle" type="text" class="moduleBorderA moduleInputA iW_400" id="siteTitle" value="<?php echo $rs["siteTitle"]?>"></td>
</tr>
<tr>
<td class="tw_1">公司名称：</td>
<td class="tw_2"><input name="companyName" type="text" class="moduleBorderA moduleInputA iW_400" id="companyName" value="<?php echo $rs["companyName"]?>"></td>
</tr>
<tr>
<td class="tw_1">网站Keywords：</td>
<td class="tw_2"><textarea name="siteKeywords" rows="4" wrap="virtual" class="moduleBorderA iW_400" id="siteKeywords"><?php echo $rs["siteKeywords"]?></textarea><span class="iW_textTips">每个词之间用英文半角逗号 , 隔开</span></td>
</tr>
<tr>
<td class="tw_1">网站Description：</td>
<td class="tw_2"><textarea name="siteDescription" rows="6" wrap="virtual" class="moduleBorderA iW_400" id="siteDescription"><?php echo $rs["siteDescription"]?></textarea><span class="iW_textTips">不要多于200个汉字</span></td>
</tr>
<tr>
<td class="tw_1">网址：</td>
<td class="tw_2"><input name="siteHttp" type="text" class="moduleBorderA moduleInputA iW_400" id="siteHttp" value="<?php echo $rs["siteHttp"]?>"></td>
</tr>
<tr>
<td class="tw_1">首页联系电话：</td>
<td class="tw_2"><input name="shareCode" type="text" class="moduleBorderA moduleInputA iW_500" id="shareCode" value="<?php echo $rs["shareCode"]?>"></td>
</tr>
<tr>
<td class="tw_1">&nbsp;</td>
<td class="tw_2"><input name="Submit" type="submit" value="保存设置" class="btn_2"></td>
</tr>
</table>
</form>
<?php
}
?>
</div>
<div class="clearfix"></div>
</div>
<?php
include("./admin_footer.php")
?>
</body>
</html>