📄 admin_common.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../../inc/CommonFunction.asp"-->
<!--#include file="../checkvalid.asp"-->
<%
'**********************************************************
'
' Software name: Finereason HRCMS 6.0
' 软件名称:嘉缘人才网站内容管理系统 V6.0
' Email: service@finereason.com QQ:109530926
' Web: http://www.finereason.com http://www.yjys.net
' Copyright (C) FineSincere Inc. All Rights Reserved.
' 版权所有 嘉挚科技 未经嘉挚公司授权不得用于任何商业用途
'
' 文件名称:Admin_Common.asp
' 作 用:通用页面参数管理
' 最后更新:Fine Sincere (Mr.Hou)
' 最后日期:2007-5-11
'
'************************************************************
If Not FRAdminLevel(309) Then
Call ErrorMsg()
End If
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.ExpiresAbsolute = Now() - 1
Dim Action
Dim FoundErr,ErrMsg
Dim page,i
Dim totalPut
const MaxPerpage=20
Const strFileName="Admin_common.asp"
sUploadDir=UpFilesPath("Common")
page=Trim(Request("page"))
If page<>"" And IsNumeric(page) Then
If page<1 Or Len(page)>10 Then
page=1
Else
page=CLng(page)
End If
Else
page=1
End If
%>
<%
sub SaveData()
On Error Resume Next
id=request.form("commonid")
if id<>"" And IsNumeric(id)=False then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误!</li>"
Exit Sub
id=CLng(id)
end if
titles=Replace_Text(request.form("title"))
htmlname=Replace_Text(request.form("htmlname"))
templateid=request.form("templateid")
content=request.form("content")
IsShow=request.form("IsShow")
if titles="" then
response.write"<SCRIPT language=JavaScript>alert('您没有填写自定义页面标题,请返回重新填写!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
if htmlname="" then
response.write"<SCRIPT language=JavaScript>alert('您没有填写html文件名,请返回重新填写!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
if templateid="" then
response.write"<SCRIPT language=JavaScript>alert('您没有选择模板,请返回重新选择!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
if templateid=0 then
response.write"<SCRIPT language=JavaScript>alert('系统暂无通用模板,请进入模板管理添加!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
if content="" then
response.write"<SCRIPT language=JavaScript>alert('您没有填写自定义页面内容,请返回重新填写!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
set rs=server.CreateObject (FR_HR_RS)
'检测页面名称是否存在
if id<>"" then
sql="select * from job_common where title='"&titles&"' and id<>"&id&""
else
sql="select * from job_common where title='"&titles&"'"
end if
rs.open sql,conn,1,1
if not rs.eof then
response.write"<SCRIPT language=JavaScript>alert('对不起,自定义页面名称重复!');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
rs.close
if id<>"" then
sql="select * from job_common where id="&id
rs.open sql,conn,1,3
else
sql="select * from job_common"
rs.open sql,conn,1,3
rs.addnew
rs("IsDefault")=FR_HR_False
end if
rs("title")=titles
rs("htmlname")=htmlname&".html"
rs("templateid")=templateid
rs("content")=content
rs("IsShow")=IsShow
rs("dateandtime")=now()
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('操作成功,继续添加!');location.href='admin_common.asp';</script>"
Response.end()
end sub
sub Del()
id=trim(Request("id"))
if id="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
exit sub
end if
sql="select * from job_common where id In("& id &")"
set rs=server.CreateObject ("Adodb.recordset")
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>页面不存在或者已被删除!</li>"
exit sub
else
Do While Not(rs.Eof)
rs.delete
rs.update
rs.MoveNext
Loop
end if
rs.close
set rs=nothing
response.redirect strFileName
response.End()
end sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=../css/style.css rel=stylesheet type="text/css">
</head>
<script LANGUAGE="JavaScript">
function check()
{
if (document.form.title.value=="")
{
alert("请输入自定义页面标题!")
document.form.title.focus()
document.form.title.select()
return
}
if (document.form.htmlname.value=="")
{
alert("请输入html文件名!")
document.form.htmlname.focus()
document.form.htmlname.select()
return
}
document.form.submit()
}
</script><script language="JavaScript" type="text/JavaScript">
function ConfirmDel(ID,Name)
{
if(confirm("您确定要删除自定义页面【"+Name+"】吗?\n\n警告:此操作不可恢复,请慎重操作!"))
location.href="<%=strFileName%>?Action=Del&id="+ID
}
function unSelectAll()
{
if(document.form1.chkAll.checked){
document.form1.chkAll.checked = document.form1.chkAll.checked&0;
}
}
function SelectAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled!=true&&e.zzz!=1)
e.checked = form.chkAll.checked;
}
}
</script><body>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
<tr>
<th height=22 class="tableHeaderText">通用页面管理 </th>
</tr>
<tr>
<td height="22"><font color="ff6600"><b class="style1"> 管理选项</b></font>:<a href="Admin_Common.asp">管理首页</a> | <a href="Admin_Common.asp?Action=Add">添加自定义页面</a> [<a href="javascript:location.reload()">刷新页面</a>]</td>
</tr>
<tr>
<td height="22"><font color="ff6600"><b class="style1"> 通用页面</b></font>:<%Call CommonPage()%>
<a href="Admin_Common.asp?Action=Create&IsDefault=<%=FR_HR_True%>">生成页面</a></td>
</tr>
<tr>
<td height="22"><font color="ff6600"><b class="style1">自定义页面</b></font>:<%Call CustomPage()%>
<a href="Admin_Common.asp?Action=Create&IsDefault=<%=FR_HR_False%>"> 生成页面</a></td>
</tr>
</table>
<%
Action=trim(Request("Action"))
Select Case Action
Case "Add"
Call ShowData()
Case "Modify"
Call ShowData()
Case "SaveData"
Call SaveData()
Case "Del"
Call Del()
Case "Create"
Call Createcommonhtml()
Case Else
Call main()
End Select
if FoundErr=True then
call Show_Err()
end if
Conn.Close
Set Conn=Nothing
%>
<%
sub main()
Set rs= Server.CreateObject(FR_HR_RS)
sql="select * from JOB_common order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>暂无自定义页面,请添加后再进行管理!</li>"
exit sub
else
totalPut=rs.recordcount
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -