<?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":
		$sql = "UPDATE ".DB_TablePre.$infoTable." SET shareCode='".$_POST["shareCode"]."'";
		mysql_query($sql);
		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 echo adminPageLocation($pageTitle)?></div>

<?php
$db = mysql_query("select id,shareCode from ".DB_TablePre.$infoTable."");
$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="130" class="tw_1">百度分享代码：</td>
<td class="tw_2"><textarea name="shareCode" rows="10" wrap="virtual" class="iW_400" id="shareCode"><?php echo $rs["shareCode"]?></textarea><span class="iW_textTips">先从百度分享官网获取代码，点击<a href="http://share.baidu.com/code?type=slide" target="_blank">获取代码</a></span></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>