<?php 
	session_start(); 
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	require_once('inc/ls_syscode.php');
	require_once('inc/check.php');
	$opendb=new mydb();
	require_once('inc/char_set.php');
	$ls_msg="修改单页操作";
	$id=$_GET['id'];

	$page_sql="select * from ls_singlepages where ID=".$id." ";
	$page_query=$opendb->query($page_sql);
	$page_rows=mysql_fetch_assoc($page_query);
	$selectcate=$_GET['selectcate'];


?>
<!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">
		<link href="css/admin.css" rel="stylesheet" type="text/css">
		<script language="JavaScript" src="js/ls.js"></script>
		<title>无标题文档</title>
		<link rel="stylesheet" href="kindeditor-4.1.10/themes/default/default.css" />
<link rel="stylesheet" href="kindeditor-4.1.10/plugins/code/prettify.css" />
<script charset="utf-8" src="kindeditor-4.1.10/kindeditor.js"></script>
<script charset="utf-8" src="kindeditor-4.1.10/lang/zh_CN.js"></script>
<script charset="utf-8" src="kindeditor-4.1.10/plugins/code/prettify.js"></script>
<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="pageText"]', {
            cssPath : 'kindeditor-4.1.10/plugins/code/prettify.css',
            uploadJson : 'kindeditor-4.1.10/php/upload_json.php',
            fileManagerJson : 'kindeditor-4.1.10/php/file_manager_json.php',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    K('form[name=example]')[0].submit();
                });
            }
        });
        prettyPrint();
    });
</script>
	</head>

	<body>
		<table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6396d6">
			<tr>
				<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#ffffff"><strong>修改单页</strong></font></div>
				</td>
			</tr>
			<tr>
				<td height="213" valign="top" bgcolor="#dee7ff"><br>
				 <form name="pageform" enctype="multipart/form-data" method="post" action="savesinglepage.php" onSubmit="return Checkaddnews()">
					<input type="hidden" value="update" name="ls">
					<input type="hidden" value="<?php echo $id;?>" name="id">
					<table border="0" width="90%" align="center">
						<tr>
							<td>提示：<font color="#FF0000"><?php echo $ls_msg; ?></font></td>
							<td align="right"><img src="images/shao.gif">&nbsp;<a href="singlepage.php?selectcate=<?=$selectcate?>"><u>返回</u></a></td>
					  </tr>
					</table>
					<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
					 
					  <tr bgcolor="#B9DAFF"> 
						<td height="28" colspan="3"></td>
					  </tr>
					  <tr bgcolor="#f4f4f4"> 
						<td style="padding-left:50px;" width="16%">单页标题：</td>
						<td width="41%"><input name="pageTitle" type="text"   value="<?php echo $page_rows['pageTitle'];?>" size="60"></td>
						<td width="43%" style="padding-left:20px;"> 序号：
						  <input name="Num" type="text" style="width:40px;" value="<?php echo $page_rows['Num'];?>" size="6" maxlength="6">
						  日期：						  
						  <input name="pageDate" type="text"  value="<?php echo $page_rows['pageDate'];?>" size="14" maxlength="24" /></td>
					  </tr>
					  <tr bgcolor="#f4f4f4">
						<td style="padding-left:50px;">单页说明：</td>
						<td colspan="2"><input name="pageBrief" type="text" style="width:600px;" value="<?php echo $page_rows['pageBrief'];?>"></td>
					  </tr>
                      <tr bgcolor="#f4f4f4">
						<td style="padding-left:50px;">单页模版：</td>
						<td colspan="2"><input name="tpl" type="text" style="width:200px;" value="<?php echo $page_rows['static_tpl'];?>"></td>
					  </tr>
                      <tr bgcolor="#f4f4f4">
						<td style="padding-left:50px;">生成文件名：</td>
						<td colspan="2"><input name="name" type="text" style="width:200px;" value="<?php echo $page_rows['singlepage_name'];?>"></td>
					  </tr>
					  <tr bgcolor="#f4f4f4"> 
						<td colspan="2" style="padding-left:50px;" >单页内容：</td>
						<td style="padding-left:150px;" ><div align="center">
						  <input type="submit" value="修改单页">
						  <label>
						    <input type="reset" name="button" id="button" value="重置" />
					      </label>
						</div></td>
					  </tr>
					  <tr bgcolor="#f4f4f4"> 
						<td style="padding-left:50px;" colspan="3" ><!--
						<input type="hidden" name="pageText" value="<?php //echo htmlspecialchars($page_rows['pageText']);?>">
						<iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.php?id=pageText&style=coolblue" frameborder="0" scrolling="no" width="100%" HEIGHT="350"></iframe>-->
                        <textarea name="pageText" style="width:100%;height:400px;visibility:hidden;"><?php echo htmlspecialchars($page_rows['pageText']); ?></textarea>
						</td>
						</tr>
					  <tr bgcolor="#B9DAFF"> 
						<td height="25" colspan="3" align="center"><input type="submit" value="修改单页">
					    <input type="reset" name="button2" id="button2" value="重置" /></td>
					  </tr>
					</table>
					<br />
                 </form>
				</td>
			</tr>
		</table>
	</body>
</html>