<!--#include file="../Include/Head.asp"-->

<%call getValidform("pageform",0,1,1)%>
<%Call Kindeditor("editor","Content","Article",1)%>
<%Call KindeditorPic("editorPic","Article",0,"upload","Pic")%>
<%
'初始化显示字段
Web_DyField="DY01,DY04"
%>


	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="../Main/Right.asp">首页</a></li>
    <li><a href="#">单页管理</a></li>
    </ul>
    </div>
	
    <!------Flash添加-------------------------------------->
  	<div id="tab1" class="tabson">
    <%
	SysID=replace(trim(Request.QueryString("SysID")) ,"'","")
	action=replace(trim(Request.QueryString("action")) ,"'","")
	If action="edit" then
		Set Rs=server.createobject("adodb.recordSet")
		Sql="select * from Jin_Page where SysID="&SysID
		Rs.Open Sql,Conn,1,1
		sysID=Rs("sysID")
		PageName=Rs("PageName")
		Title=Rs("Title")
		Title_a=Rs("Title_a")
		PageBg=Rs("PageBg")
		Pic=Rs("Pic")
		Pic_a=Rs("Pic_a")
		Content=Rs("Content")
		Keywords=Rs("Keywords")
		Descriptions=Rs("Descriptions")
		Remark=Rs("Remark")
		Rs.close
		Set Rs=nothing
	End If
	%>
    <ul class="forminfo">
    
    <%If action="edit" then%>
    <form name="form1" class="pageform" action="?Action=editgo&SysID=<%=SysID%>" method="post">
    <%else%>
    <form name="form1" class="pageform" action="?Action=add" method="post">
    <%end if%>
    
        <li><label>标题<b>*</b></label><input name="Title" type="text" class="newinput450" value="<%=Title%>"  style="width:521px;" datatype="*" nullmsg="页面标题不能为空！" />
        <i class="Validform_checktip"></i>
        </li>
        
        <li <%If not IsDyField("DY01") Then%>class="hidden"<%End If%>><label>页面名<b>*</b></label><input name="PageName" type="text" class="newinput200" value="<%=PageName%>"  style="width:145px;" datatype="*" nullmsg="页面名不能为空！"/><i class="Validform_checktip"></i></li>
    
        <li <%If not IsDyField("DY02") Then%>class="hidden"<%End If%>><label>略缩图<b>*</b></label><input name="Pic" id="Pic" type="text" class="newinput450" value="<%=Pic%>"  style="width:410px;"/>
        <i><a href="javascript:;" id="upload">上传</a></i> 
        </li>
    
        <li <%If not IsDyField("DY03") Then%>class="hidden"<%End If%>><label>背景图<b>*</b></label><input name="PageBg" id="PageBg" type="text" class="newinput450" value="<%=PageBg%>"  style="width:410px;"/>
        <i><a href="javascript:;" id="upload1">上传</a></i> 
        </li>
        
        <li <%If not IsDyField("DY04") Then%>class="hidden"<%End If%>><label>关键词<b></b></label><input name="Keywords" type="text" class="newinput450" value="<%=Keywords%>" style="width:521px;"/>
        <i>多个关键词用英文逗号隔开；关键词3到4个为最佳</i></li>
        
        <li <%If not IsDyField("DY05") Then%>class="hidden"<%End If%>><label>描述<b></b></label><textarea name="Descriptions" cols="" rows="" class="textinput" style="width:680px;height:58px;"><%=Descriptions%></textarea></li>
        
        <li><label class="left">内容<b>*</b></label><textarea name="Content" id="Content" cols="" rows="" class="textinput" style="width:700px;height:420px;"><%=Content%></textarea></li>
        
        <li><label>&nbsp;</label><input name="submit" type="submit" class="btn" value="<%If action="edit" then%>提交修改<%else%>确认添加<%end if%>"/>
        <input name="submit" type="button" class="btn" onClick="location.href='<%=session("SinglePage1")%>'"  value="返回列表"/>
        </li>
        
    </form>
    </ul>
    </div> 
    </div> 

    
<%
'添加文章
If replace(trim(Request.QueryString("Action")) ,"'","")="add" then
	PageBg = sub_str(Trim(request_Form("PageBg")),"Upload")
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Pic_a = sub_str(Trim(request_Form("Pic_a")),"Upload")
	Set Rs=server.createobject("adodb.recordSet")
	Sql="select * from Jin_Page where PageName='"&request_Form("PageName")&"'"
	Rs.open Sql,conn,1,3
	If Rs.eof then
	Rs.Addnew
	Rs("SortID")=999
	Rs("PageName")=request_Form("PageName")
	Rs("Title")=request_Form("Title")
	Rs("Title_a")=request_Form("Title_a")
	Rs("PageBg")=PageBg
	Rs("Pic")=Pic
	Rs("Pic_a")=Pic_a
	Rs("Content")=request_Form("Content")
	Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
	Rs("Descriptions")=request_Form("Descriptions")
	Rs("Remark")=request_Form("Remark")
	Rs("Addtime")=getDate(Now(),"Y-M-D H:M:S")
	Rs("Edittime")=getDate(Now(),"Y-M-D H:M:S")
	Rs.Update
	Else 
		Call ShowMsg("该页面名已存在，不可重复！",1)
	End If
	Rs.close
	Set Rs=nothing
	
	response.Redirect session("ListPage")
End If
'修改文章
If replace(trim(Request.QueryString("Action")) ,"'","")="editgo" then
	PageBg = sub_str(Trim(request_Form("PageBg")),"Upload")
	Pic = sub_str(Trim(request_Form("Pic")),"Upload")
	Pic_a = sub_str(Trim(request_Form("Pic_a")),"Upload")
	
	Set Rsa=server.createobject("adodb.recordSet")
	Sqla="select * from Jin_Page where PageName='"&request_Form("PageName")&"' And sysID<>"&request_QueryString("SysID")
	Rsa.open Sqla,conn,1,3
	If Rsa.eof then
		Set Rs=server.createobject("adodb.recordSet")
		Sql="select * from Jin_Page where SysID="&request_QueryString("SysID")
		Rs.open Sql,conn,1,3
		Rs("PageName")=request_Form("PageName")
		Rs("Title")=request_Form("Title")
		Rs("Title_a")=request_Form("Title_a")
		Rs("PageBg")=PageBg
		Rs("Pic")=Pic
		Rs("Pic_a")=Pic_a
		Rs("Content")=request_Form("Content")
		Rs("Keywords")=replace(replace(request_Form("Keywords"),"，",",")," ",",")
		Rs("Descriptions")=request_Form("Descriptions")
		Rs("Remark")=request_Form("Remark")
		Rs("Edittime")=getDate(Now(),"Y-M-D H:M:S")
		Rs.Update
		Rs.close
		Set Rs=nothing
		response.Redirect session("ListPage")
	Else 
		Call ShowMsg("该页面名已存在，不可重复！",1)
	End If
	Rsa.close
	Set Rsa=nothing
	
End If
%>


<%Call BackFoot()%>
