📄 index.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../../conn/conn.asp" -->
<!--#include file="../../Inc/Commoncode.asp" -->
<!--#include file="../checkvalid.asp" -->
<%
If Not FRAdminLevel(307) Then
Call ErrorMsg()
End If
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.ExpiresAbsolute = Now() - 1
wid=request("wid")
keywords=replace_text(request("keywords"))
if request("typeid")<>"" then
if Chkrequest(request("typeid")) then
typeid=request("typeid")
end if
end if
Dim Action
Dim FoundErr,ErrMsg
Dim page,i
Dim totalPut
const MaxPerpage=20
strFileName="index.asp?wid="&wid&"&typeid="&typeid&"&keyword="&keyword&""
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
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<script language="javascript" src="../Inc/Admin.js"></script><SCRIPT LANGUAGE='JavaScript' SRC='../../js/search.js' TYPE='text/javascript'></script><script language="JavaScript" type="text/JavaScript">
function ConfirmDel(ID,Name)
{
if(confirm("您确定要删除文章【"+Name+"】吗?\n\n警告:此操作不可恢复,请慎重操作!"))
location.href="<%=strFileName%>?Action=Del&JOB_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><title>HR资讯管理</title>
<style type="text/css">
<!--
.style11 {color: #0066CC;
font-weight: bold;
}
-->
</style>
<table width="98%" border="0" cellspacing="1" cellpadding="2" align=center class="tableBorder">
<tr>
<th height=25 class="tableHeaderText"><%call ChannelNametitle()%>管理</th>
</tr>
<tr>
<td height=25><font color="ff6600"><b class="style11"> 管理选项</b></font>: <a href="addinfo.asp?wid=<%=wid%>">添加
<%call ChannelNametitle()%>
</a> | <a href="index.asp?wid=<%=wid%>">管理
<%call ChannelNametitle()%>
</a> | <a href="Class_Ok.asp?action=add_class_1&wid=<%=wid%>">添加信息类别</a> | <a href="type.asp?wid=<%=wid%>">管理信息类别</a> | <a href="Admin_AddTemp.asp?wid=<%=wid%>">添加模板</a> | <a href="Admin_Template.asp?wid=<%=wid%>">模板管理</a> | [<a href="javascript:location.reload()">刷新页面</a>] </td>
</tr>
<tr>
<td height=25><font color="ff6600"><b class="style11"> 二级栏目</b></font>:<span class="forumRowHighlight">
<% set rs6=conn.execute("select typeid,type from job_hrnewstype where type_fid="&wid&"")
do while not rs6.eof %>
<a href="index.asp?typeid=<%=rs6("typeid")%>&wid=<%=wid%>"><%=rs6("type")%></a> |
<%rs6.movenext
loop
rs6.close
set rs6=nothing
%>
</span></td>
</tr>
<tr><FORM name=searchForm action="index.asp?wid=<%=wid%>" method=post onSubmit="javascript:if(doSearch()==false) return false;">
<td height=25> 关键字:<input name="keywords" type="text" value="<%=keywords%>">
所属类别:
<select name="typeid" size="1">
<%
set rs1=conn.execute("select * from job_hrnewsType where type_fid="&wid&"")
do while not rs1.eof
response.write "<option value='"&rs1("typeid")&"'>"&rs1("type")&" 类信息</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
%>
</select> <input name=submit type="submit" class="inputs" id=submit value="立刻查找"></td></form>
</tr>
</table>
<%Action=trim(Request("Action"))
Select Case Action
Case "Del"
Call Del()
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("adodb.recordset")
sql="select * from job_hrnews"
if typeid>"" then sql=sql&" where typeid="&typeid&""
if keywords>"" then sql=sql&" and title like '%"&keywords&"%'"
if wid<>"" then
if typeid>"" then
sql=sql&" and type_fid="&wid&""
else
sql=sql&" where type_fid="&wid&""
end if
end if
sql=sql&" order by newsid desc"
set rs=server.createobject("adodb.recordset")
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
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 wnewsidth="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="tableBorder">
<Form name="form1" method="POST" action="<%=strFileName%>">
<tr>
<th class="tableHeaderText" height=25 colspan="5"><%call ChannelNametitle()%>信息列表</th>
</tr>
<tr height=25>
<td width="54%" align="left" class="tdbg2" wnewsidth="446"><b>信息标题</b></td>
<td width="13%" align="center" class="tdbg2" wnewsidth="263"><b>所属类别</b></td>
<td width="17%" align="center" class="tdbg2" wnewsidth="113"><b>发布日期</b></td>
<td width="11%" align="center" class="tdbg2" wnewsidth="62"><b>操作</b></td>
<td width="5%" align="center" class="tdbg2" wnewsidth="57"><b>删除</b></td>
</tr>
<%do while not rs.eof%>
<tr height="20">
<td align="left"> <a href="<%=FormatLink(rs("dateandtime"),wid,rs("typeid"),rs("newsid"),0)%>" target="_blank"><%=replace(rs("title"),keywords,"<font color=red>"&keywords&"</font>")%></a> <%if rs("tjnews")=1 or rs("tjhome")=1 or rs("homepic")=1 or rs("homehot")=1 then%><img src="../images/thanx.gif" alt="此条信息已设置推荐,点击修改可重新设置推荐属性!" width="19" height="19" align="absmiddle"><%end if%> <%if rs("picture")<>"nopicture.gif" then%><img src="../images/haveimg.gif" alt="此条信息为图片标题:<br><img src='<%=rs("picture")%>' border=1 width=220 height=150 width="12" height="12" border="0">
<%end if%></td>
<td align="center">
<%
set rs5=conn.execute("select typeid,type from job_hrnewstype where typeid="&rs("typeid")&"")
if not rs5.eof then
response.write"<a href='index.asp?typeid="&rs5("typeid")&"&wid="&wid&"'>"&rs5("type")&"</a>"
else
response.write"未分类"
end if
%></td>
<td wnewsidth="113" align="center"><%=rs("dateandtime")%> </td>
<td align="center"><a href="../websys/admin_comment.asp?newsid=<%=rs("newsid")%>&wid=<%=wid%>"> 评论</a> <a href="edit.asp?newsid=<%=rs("newsid")%>&wid=<%=wid%>">修改</a></td>
<td wnewsidth="57" align="center"><input name='Newsid' type='checkbox' class="checkbox" value='<%=rs("newsid")%>'></td>
</tr>
<%i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop%>
<tr height="20" bgcolor="#ffffff">
<td colspan="5" align="left"><div 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="删除" />
</div></td>
</tr>
<tr height="20" bgcolor="#ffffff">
<td class=forumrowHighLight align="center" colspan="5"><%If totalput>0 Then
Call Showpage(strFileName,totalput,MaxPerPage,false,true,"篇文章")
End If%></td>
</tr></form>
</table>
<%end sub%>
<!--#include file="../inc/copy.asp" -->
</body>
</html>
<%sub Del()
Newsid=trim(Request("Newsid"))
if Newsid="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>参数不足!</li>"
exit sub
end if
sql="select * from job_hrnews where newsid In("& Newsid &")"
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%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -