<?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 = "singlepage";
$Type = $_GET["Type"];
$id = intval($_REQUEST["id"]);
 
if($Type=="up"){
	if($_POST["title"]==""){
		OutErrorBack("标题不能够为空!");
	}
	
	$sqlup = "update ".DB_TablePre.$infoTable." set title='".$_POST["title"]."',content='".$_POST["d_content"]."',Content_img='".RequestImg(stripslashes($_POST["d_content"]))."' where id = '$id'";
	mysql_query($sqlup);
	if($_POST["Content_img_Old"] != $_POST["d_content"]){
		ImgDel($_POST["Content_img_Old"],$_POST["d_content"],"..");
	}else{
		echo "更新失败";
		exit;
	}
	OutErrorGo("修改成功!","diyPageList.php");
}
?><!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>
<script type="text/javascript" src="../apps/_8816a37faf9597de8c595dbf8ff9d628$/ckeditor.js"></script>
<script type="text/javascript" src="../lib/validform/source.js"></script>
<link type="text/css" rel="stylesheet" href="../lib/validform/validform.css">
</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 * from ".DB_TablePre.$infoTable." where id = '$id'");
$rs = mysql_fetch_array($db);
if($rs){
?>
<form action="?Type=up" method="post" name="formAdmin" target="_parent" id="formAdmin">
<input type="hidden" name="id" value="<?php echo $id?>" />
<table cellspacing="1" class="adminTableV0">
<tr>
<td class="tw_1">名称：</td>
<td class="tw_2"><input name="title" type="text" class="moduleBorderA moduleInputA iW_400" id="title" value="<?php echo $rs["title"]?>" datatype="*" nullmsg="请输入标题！" errormsg="标题不能为空！"></td>
</tr>
<tr>
<td class="tw_1">内容：</td>
<td class="tw_2"><textarea name="d_content" id="d_content"><?php echo $rs["content"]?></textarea><input name="Content_img_Old" type="hidden" value="<?php echo $rs["Content_img"]?>"></td>
</tr>
<tr>
<td colspan="2" class="tw_3"><input name="Submit" type="submit" value="确认修改" class="btn_2"></td>
</tr>	
</table>
</form>
<?
}
?>
</div>
<div class="clearfix"></div>
</div>
<?php
include("./admin_footer.php")
?>
<script type="text/javascript" src="js/init.js"></script>
</body>
</html>