<!--#include file="../include/config.asp"-->
<!--#include file="../include/conn.asp"-->
<!--#include file="inc/check.asp"-->	
<!--#include file="inc/function.asp"-->	
<!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">
<%Call siteconfig %>
<head>
<title>后台-单页内容修改 - powered by jiruinet.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="jiruinet@qq.com,企业建站,极瑞企业网站系统" />
<meta name="robots" content="index,follow" />
<meta name="description" content="<%=site_title%>,极瑞企业网站系统,powered by jiruinet.com"/>
<meta name="keywords" content="<%=site_title%>后台管理,极瑞企业网站系统"/>
<link rel="stylesheet" type="text/css" href="css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="css/admin.css" media="screen" />
<script type="text/javascript" src="js/jquery/1.9.1/jquery.min.js" charset="utf-8"></script> 
<script type="text/javascript" src="js/layer/1.9.3/layer.js" charset="utf-8"></script> 
</head>
<body>
<%
id=request.querystring("id")
If IsNumeric(id)=false Then Call alt(2,"msg","数据读取异常","about.asp",0.5)
If id<>"" Then 
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao where id =" & id
	rs.open sql,conn,1,1
	If Not rs.eof And Not rs.bof Then 
		id=rs("id")
		description=rs("description")
		keyword=rs("keyword")
		about_title=rs("title")
		contents=rs("contents")
		class_id=rs("class_id")
		html=rs("html")
	Else 
		response.redirect "about.asp"
	End If 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing
End If 
%>

<div id="wrap">
<div class="header">
	<div class="top">
		<div class="logo"></div>
		<div class="right">
			<div class="admin"><%=myadminuser%> <a href="passwords.asp">修改密码</a> |&nbsp; <a href="login.asp?action=out"> 退出</a></div>
			<div class="clear"></div>
			<div class="top_ico">
			<ul>
				<li><a href="../" target="_blank">浏览网站</a></li>
				<li><a href="http://www.jiruinet.com/" target="_blank">帮助信息</a></li>
			</ul>
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="menu">
		<ul>
		<%Call menu(3)%>
		</ul>
	</div>
</div>
<div class="main">
	<div class="left">
	<h2>单页内容管理</h2>
		<ul>
			<%If class_id=0 Then current="class=""current"""%>
			<li><a href="about_edit.asp" title="">添加介绍</a></li>
			
			<li><a href="about.asp" title="" <%=current%>>单页管理</a></li>
			
			<li><a href="about_class.asp" title="">单页分类管理</a></li>
			<%
			aboutclass="公司介绍"
			set rs=server.createobject("adodb.recordset")
			sql="select * from "&jrcms_DB_Pre&"jieshao_class order by id"
			rs.open sql,conn,1,1
			Do While Not rs.eof and Not rs.bof 
			If rs("id")=class_id Then
			aboutclass=rs("class")
			End If
			current=""
			If rs("id")=Int(request.querystring("cid")) Then current="current"
			response.write "<li  class="""&current&" about""><a href=""about.asp?cid="&rs("id")&""" title="""">"&Left(rs("class"),8)&"</a></li>"
			rs.movenext
			Loop 
			rs.close
			Set rs=Nothing 
			Set sql=Nothing 
			%>
		</ul>
	</div>
	<div class="right">
	<h2>单页管理 - <%=aboutclass%></h2>
	<div class="pd-10" style="border-left:solid 1px #cdf;border-right:solid 1px #cdf;border-bottom:solid 1px #cdf;">
	<form action="" method="post" class="form form-horizontal" id="form-article-add">
				<div class="row cl">
					<label class="form-label col-2"><span class="c-red">*</span><%=id%>标题：</label>
					<div class="formControls col-4">
						<input type="hidden" name="id" value="<%=id%>">
						<%If id<>"" Then %>
						<input type="hidden" name="action" value="edit_save">
						<%Else %>
						<input type="hidden" name="action" value="new_save">
						<%End If %>
						<input type="hidden" name="class" value="<%=jiedian_id%>">
						<input type="text" class="input-text" placeholder="标题不能为空" id="" name="abouttitle" datatype="*2-20" value="<%=about_title%>">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2"><span class="c-red">*</span>所属分类：</label>
					<div class="formControls col-2">
					<%
					set rs=server.createobject("adodb.recordset")
					sql="select * from "&jrcms_DB_Pre&"jieshao_class order by id"
					rs.open sql,conn,1,1
					%>
					<select name="class_id" class="select" datatype="*">
					<%
					Do While Not rs.eof And Not rs.bof 
					id=rs("id")
					aboutclass=rs("class")
					file=rs("file")
					muban=rs("muban")
					%>
					<option value="<%=id%>" <%If class_id=id Then response.write "selected"%>><%=aboutclass%></option>
					<%
					rs.movenext
					Loop 
					rs.close
					Set rs=Nothing 
					Set sql=Nothing 
					%>
					</select>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">关键词：</label>
					<div class="formControls col-8">
						<input type="text" class="input-text" placeholder="标题不能为空" id="" name="keyword" datatype="*0-70" value="<%=keyword%>">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">页面介绍：</label>
					<div class="formControls col-8">
						<textarea name="description" cols="" rows="" class="textarea"  placeholder="页面内容介绍description" datatype="*0-150" nullmsg="页面描述不能为空！" onKeyUp="textarealength(this,150)" style="height:80px;"><%=description%></textarea>
						<p class="textarea-numberbar"><em class="textarea-length">0</em>/150</p>
					</div>
				</div>
				<div class="row cl hidden">
					<label class="form-label col-2">页面地址：</label>
					<div class="formControls col-2">
						<input type="text" class="input-text" placeholder="留空自动编号" id="" name="html" datatype="*0-30" value="<%=html%>">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-2">文章内容：</label>
					<div class="formControls col-10"> 
						<script id="editor" type="text/plain" style="width:100%;height:300px;" name="contents"><%=contents%></script> 
					</div>
				</div>

				<div class="row cl">
					<div class="col-10 col-offset-2">
						<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit">&nbsp; 保 存 &nbsp;</button>
						<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
					</div>
				</div>
	</form>

	</div>
	</div>
	<div class="clear"></div>
</div>
 <div id="else" class="clearfix">

 </div>
</div>
<div class="bottom" id="footer">
	<div class="content">
		<div class="left"><%=copyright%></div>
		<div class="right"><%=Email%></div>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript" src="js/Validform/5.3.2/Validform.min.js" charset="utf-8"></script> 
<script type="text/javascript" src="../editor/ueditor.config.js"></script> 
<script type="text/javascript" src="../editor/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="../editor/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript" src="js/H-ui.js" charset="utf-8"></script> 
<script type="text/javascript" src="js/H-ui.admin.js" charset="utf-8"></script>
</body>
</html>
<script type="text/javascript">
	window.load=toolbarstyle("changyong","editor")
</script>
<script type="text/javascript">
$(function(){
	$("#form-article-add").Validform({
		tiptype:2,
		callback:function(form){
			form[0].submit();
		}
	});
});
</script>
<%
If request.form("action")="edit_save" Or request.Form("action")="new_save" Then 
	id=request.form("id")
	class_id=request.form("class_id")
	If IsNumeric(class_id)=false Then Call alt(2,"msg","数据读取异常","about.asp",0.5)
	menufile=mainmenu1
	set rs=server.createobject("adodb.recordset")
	sql="select * from "&jrcms_DB_Pre&"jieshao_class where id="&class_id
	rs.open sql,conn,1,1
	If Not rs.eof And Not rs.bof Then 
		menufile=rs("file")
		muban=rs("muban")
	End If 
	rs.close 
	Set rs=Nothing 
	Set sql=Nothing 
	set rs=server.createobject("adodb.recordset")
	html=request.Form("html")
	If html<>"" Then 
		If Right(html,5)<>".html" Then html=html&".html"
	End If 
	If request.form("action")="edit_save" Then 
		sql="select * from "&jrcms_DB_Pre&"jieshao where id ="& id
		rs.open sql,conn,1,3
	ElseIf  request.form("action")="new_save"  Then 
		sql="select * from "&jrcms_DB_Pre&"jieshao"
		rs.open sql,conn,1,3
		rs.addnew
	End If 
	If Not rs.eof And Not rs.bof Then 
		contents=request.Form("contents")
		If instr(contents,"<p>")=0 Then 
			contents="<p>"&contents&"</p>"
		End If 
		If RemoveHTML(request.Form("keyword"))="" Then 
			rs("keyword")=Replace(RemoveHTML(request.Form("abouttitle")),"，",",")&","&sitekeywords
		Else 
			rs("keyword")=Replace(RemoveHTML(request.Form("keyword")),"，",",")
		End If 
		If RemoveHTML(request.Form("description"))="" Then 
			rs("description")=Left(Replace(RemoveHTML(request.Form("contents"))," ",""),250)
		Else 
			rs("description")=RemoveHTML(request.Form("description"))
		End If 
		rs("title")=RemoveHTML(request.Form("abouttitle"))
		rs("contents")=contents
		rs("class_id")=RemoveHTML(request.Form("class_id"))
		rs("file")=menufile
		rs("muban")=muban
		If html="" Then html=rs("id")&".html"
		rs("html")=html
		rs("time")=Now()
		rs.update
	End If 
	rs.close
	Set rs=Nothing 
	Set sql=Nothing 
	'Call html_allabout(0,0,0)
	Call alt(1,"msg","保存成功！","about.asp",0.5)
End If 
%>
