📄 admin_common.asp
字号:
if (page-1)*MaxPerpage>totalput then
if (totalPut mod MaxPerpage)=0 then
page= totalPut \ MaxPerpage
else
page= totalPut \ MaxPerpage + 1
end if
end if
if page=1 then
Call MainInfo()
else
if (page-1)*MaxPerpage<totalPut then
rs.move (page-1)*MaxPerpage
dim bookmark
bookmark=rs.bookmark
Call MainInfo()
else
page=1
Call MainInfo()
end if
end if
end if
rs.close
set rs=nothing
End Sub
%>
<%Sub MainInfo()%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<form name="form1" method="Post" action="<%=strFileName%>">
<tr class="title" align="center">
<th height="22" colspan="7">自定义页面管理</th>
</tr>
<tr class="title" align="center">
<td width="6%" height="22"><strong>编号</strong></td>
<td width="25%"><strong>页面标题</strong></td>
<td width="22%"><strong>HTML文件名</strong></td>
<td width="10%"><strong>页尾显示</strong></td>
<td width="19%"><strong>最后修改时间</strong></td>
<td width="12%"><strong>操作选项</strong></td>
<td width="6%"><strong>选中</strong></td>
</tr>
<%
do while not rs.eof
ID=Rs("id")
Titles=Rs("Title")
htmlname=Rs("htmlname")
DateAndTime=Rs("DateAndTime")
IsShow=Rs("IsShow")
IsDefault=Rs("IsDefault")
%>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'" align="center">
<td align="center"><%=ID%></td>
<td align="left"><%=Titles%></td>
<td align="left"><%=htmlname%></td>
<td align="center"><%if IsShow = True Then:Response.Write("是"):else:Response.Write("否"):end if%></td>
<td align="center"><%=DateAndTime%></td>
<td align="center">
<a href="<%=strFileName%>?Action=Modify&ID=<%=ID%>">
修改</a><%if IsDefault = False then%>
<a href="javascript:ConfirmDel(<%=ID%>,'<%=Titles%>');">删除</a><%end if%></td>
<td align="center"><input name="ID" type="checkbox" class="checkbox" value="<%=ID%>" /></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'" align="center">
<td colspan="7" align="right"><input name="chkAll" type="checkbox" class="checkbox" onClick="SelectAll(this.form)" value="checkbox" />
<input name="Action" type="hidden" value="Del" />
选中所有项目 将选定的项目:
<input name="submit" type="submit" class="inputs" value="批量删除" /></td>
</tr>
<tr class="tdbg" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#BFDFFF'" align="center">
<td colspan="7"><%If totalput>0 Then
Call Showpage(strFileName,totalput,MaxPerPage,false,true,"个页面")
End If%></td>
</tr>
</form>
</table>
<%End Sub%>
<%
Sub ShowData()
id=trim(request.QueryString("id"))
If id<>"" Then
If IsNumeric(id)=False Then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数错误!</li>"
Exit Sub
End If
sql="select * from job_common where id=" & id
set rs=server.CreateObject (FR_HR_RS)
rs.open sql,conn,1,1
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>此页面不存在或者已经删除!</li>"
Exit Sub
else
titles=rs("title")
htmlname=rs("htmlname")
htmlname=replace(htmlname, ".html", "")
templateid=rs("templateid")
content=rs("content")
IsShow=rs("IsShow")
end if
rs.Close
Set rs=Nothing
End If
%>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
<tr>
<th height=22 colspan="2" class="tableHeaderText"><%if id<>"" then%>修改<%else%>添加<%end if%>页面 </th>
</tr>
<form action="admin_common.asp?Action=SaveData" method="post" name="form">
<tr>
<td width="88"><div align="right">页面标题:</div></td>
<td width="841"><label>
<input type="text" name="title" value="<%=titles%>" /><input type="hidden" name="commonid" value="<%=id%>">
</label><span class="00f">如:关于我们</span></td>
</tr>
<tr>
<td><div align="right">HTML文件名:</div></td>
<td><label>
<input type="text" name="htmlname" value="<%=htmlname%>" />
</label>
.html <span class="f00">注意:文件名称请勿重复</span></td>
</tr>
<tr>
<td><div align="right">选择模板:</div></td>
<td><label>
<select name="templateid">
<option value="" selected>请选择模板</option>
<%set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from JOB_Template where ChannelID=9999 and typeid=9 order by TemplateID desc"
rsc.open sqlc,conn,1,1
if not rsc.eof then
do while not rsc.eof
if templateid = rsc("TemplateID") then
response.write "<option value="&rsc("TemplateID")&" selected>"&rsc("TemplateName")&"</option>"
else
response.write "<option value="&rsc("TemplateID")&">"&rsc("TemplateName")&"</option>"
end if
rsc.movenext
loop
else
response.write "<option value=0>暂无模板</option>"
end if
rsc.close
set rsc=nothing%>
</select>
</label></td>
</tr>
<tr>
<td><div align="right">页面内容:</div></td>
<td><textarea name="content" style="display:none"><%=content%></textarea><iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="100%" height="390"></iframe></td>
</tr>
<tr>
<td><div align="right">页尾显示:</div></td>
<td><input name="IsShow" type="radio" class="checkbox" value="<%=FR_HR_True%>"<%If IsShow = True Then%> checked="checked"<%End If%> />
是
<input name="IsShow" type="radio" class="checkbox" value="<%=FR_HR_False%>"<%If IsShow = False Then%> checked="checked"<%End If%> />
否 选择“是”显示出来。</td>
</tr>
<tr>
<td><div align="right"> </div></td>
<td><label>
<input name="Submit" type="submit" class="inputs" onClick="check()" value=" 提 交 " />
</label>
<label>
<input name="Submit3" type="reset" class="inputs" value=" 重 置 " />
</label></td>
</tr>
</form>
</table>
<%end sub%>
<%sub Createcommonhtml()
IsDefault=Trim(Request("IsDefault"))
if IsDefault<>"" then
set rs=conn.execute("select * from JOB_common where IsDefault = "&IsDefault&" order by id asc")
else
Response.Write("参数错误!")
Response.end()
end if
do while not rs.eof
set rst=conn.execute("select * from JOB_Template where TemplateID="&rs("templateid")&"")
if rst.eof then
Response.Write("模板不存在,请指定后生成!")
Response.end()
else
htm=""&rst("TemplateContent")&""
end if
htm=replace(htm,"{$FR_通用页面内容}",""&rs("content")&"")
htm=replace(htm,"{$FR_通用标题}",""&rs("title")&"")
htm=ReplaceLableFlag(ReplaceAllLabel(htm))
Set fso = Server.CreateObject("Scripting.FileSystemObject")
HtmlFileName=Server.MapPath(InstallDir&HTMLPath&"/"&rs("htmlname")&"")
Set fout = fso.CreateTextFile(HtmlFileName)
fout.WriteLine CreateHTMLReplace(htm)
fout.close
set fout = nothing
rs.movenext
loop
rst.close
set rst=nothing
rs.close
set rs=nothing
Response.Write("生成完成,完成时间:"&now()&"")
Response.end()
end sub
%>
</body>
</html>
<%
'通用页面
Sub CommonPage()
Set rs= Server.CreateObject(FR_HR_RS)
sql="select * from JOB_common where IsDefault = "&FR_HR_True&" order by ID desc"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
Response.Write("<a href='admin_common.asp?Action=Modify&id="&rs("id")&"'>"&rs("title")&"</a> | ")
if rs.eof then exit do
rs.movenext
loop
else
Response.Write("暂无页面!")
end if
rs.close
set rs=nothing
End Sub
'自定义页面
Sub CustomPage()
Set rs= Server.CreateObject(FR_HR_RS)
sql="select * from JOB_common where IsDefault = "&FR_HR_False&" order by ID desc"
rs.open sql,conn,1,1
if not rs.eof then
do while not rs.eof
Response.Write("<a href='admin_common.asp?Action=Modify&id="&rs("id")&"'>"&rs("title")&"</a> | ")
if rs.eof then exit do
rs.movenext
loop
else
Response.Write("暂无页面!")
end if
rs.close
set rs=nothing
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -