<%
response.expires=0
dim action,ss
Sub LastNextPage(pagecount,page,resultcount,ss)
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
if not isobject(Session("connection")) then
Response.write "<a href=""../default.asp"" target=_top>超时或登录不正确,请重新登录!</a>"
Response.End
end if
Dim strSQL,strField,strScriptName
Dim cnn, rst
Set cnn = Session("connection")
if instr(ucase(request.ServerVariables("HTTP_REFERER")),"NEWS_VIEW")=0 then
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
dim c_type,PubTime,vacancy
c_type=trim(request("com_key"))
c_type1=request.querystring("com_key1")
PubTime=trim(request("news_date"))
vacancy=trim(request("zw_key"))
response.write c_type1
'按公司查询条件
if c_type="全部" then
strSQL = "where 1=1 "
else
strSQL = "select * from tblVacancy where c_type='"&c_type&"' "
end if
'按职位查询
if vacancy <>"" then
strSQL = strSQL & " and vacancy like '%"&vacancy&"%' "
end if
'按时间查询条件
select case PubTime
case "0"
strSQL = strSQL & " and PubTime = '" & date() & "'"
case "3"
strSQL = strSQL & " and PubTime > '" & DateAdd("d","-3",date()) & "'"
case "7"
strSQL = strSQL &" and PubTime > '" & DateAdd("d","-7",date()) & "'"
case "30"
strSQL = strSQL &" and PubTime > '" & Dateadd("d","-30",date()) & "'"
case "365"
strSQL = strSQL & " and PubTime > '" & Dateadd("d","-365",date()) & "'"
case ""
strSQL = strSQL
end select
'按排序查询条件
if request.form("sort") =0 then
strSQL = strSQL &" order by PubTime desc"
else
strSQL = strSQL &" order by PubTime asc"
end if
end if
end if
%>
<%
dim rs,thesql,page,pp
set rs=server.createobject("adodb.recordset")
thesql="select * from tblVacancy "
thesql=thesql &strSQL
response.write thesql
'response.end
if c_type="全部" and vacancy<>""then
pp=""&sql&""
else
pp="com_key1="& c_type &"&zw_key="&vacancy &""&sql&" "
end if
rs.open thesql,cnn,3,1
if rs.eof then
%>
<script language=javascript>
<!--
//window.alert("没有任何记录!")
//history.go(-1)
-->
</script>
<%
'response.end
end if
if not rs.eof then
rs.PageSize =1 '每页记录条数
result_num=rs.RecordCount '记录总数
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
else
result_num=0
maxpage=0
page=0
end if
%>