📄 sub.asp
字号:
end sub
%>
<%
'==========================浏览热门============================
' Lnum 个数
'
'==============================================================
sub showHot(Lnum)
%>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="10"></td>
<td></td>
<td></td>
</tr>
<%
set Lrs=server.CreateObject("adodb.recordset")
Lsql="select top 10 * from J_Product where delflag=false order by hits desc"
Lrs.open Lsql,conn,1,1
if not Lrs.eof or Lrs.bof then
for i=1 to Lnum
if Lrs.eof then exit for
%>
<tr>
<td align="right"><img src="images/dot3.gif"></td>
<td width="10"></td>
<td><a href="productView.asp?bigClass=<%=Lrs("BigClass")%>&id=<%=Lrs("id")%>"><%=NogotTopic(Lrs("ProductName"),20)%></a></td>
</tr>
<%
Lrs.movenext
next
end if
%>
<tr>
<td height="10"></td>
<td></td>
<td></td>
</tr>
</table>
<%
Lrs.close
set Lrs=nothing
end sub
%>
<%
'========================产品分类======================
' Cnum ---- 分页个数
' Row ---- 行数
' Col ---- 列数
' More ----
' FileName ----
'
'======================================================
sub showClass(Row,Col,Cnum,More,FileName)
%>
<table width="85%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="5" colspan="<%=Col%>"></td>
</tr>
<%
CurrentPage=replacebadchar(request("page"))
if CurrentPage="" then
CurrentPage=1
else if not IsNumeric(CurrentPage) then
CurrentPage=1
else if int(CurrentPage)<=0 then
CurrentPage=1
else
CurrentPage=replaceBadchar(request("page"))
end if
end if
end if
strFileName=""&fileName&""
maxperpage=Cnum
set cRs=server.CreateObject("adodb.recordset")
cRs.open "select * from J_ProductSmallClass where DelFlag=false",conn,1,1
if not cRs.eof then
cRs.pagesize=MaxPerpage
totalnumber=cRs.recordcount
if totalnumber mod maxperpage=0 then
MaxPage= totalnumber \ MaxPerpage
else
MaxPage= totalnumber \ MaxPerpage+1
end if
if int(CurrentPage)>int(MaxPage) then
CurrentPage=MaxPage
else
CurrentPage=CurrentPage
end if
cRs.absolutepage=CurrentPage
for ci=1 to row
if cRs.eof then exit for
%>
<tr>
<%
for cj=1 to Col
if cRs.eof then exit for
%>
<td align="left" ><img src="images/fenleiPiont.jpg" width="8" height="13"> <a href="productBigClass.asp?bigClass=<%=Crs("id")%>" title="<%=Crs("ClassName")%>"><%=NogotTopic(Crs("ClassName"),18)%></a></td>
<%
Crs.movenext
next
%>
</tr>
<%
next
end if
%>
<tr>
<td align="center" colspan="<%=Col%>"><% if more then%><% call showpage(strFileName,totalnumber,MaxPerPage,false,true,"个",CurrentPage) %><% else %><a href="product.asp">更多...</a><%end if%></td>
</tr>
</table>
<%
Crs.close
set Crs=nothing
end sub
%>
<%'===========================显示职位空缺---首页调用=============================
'----------------------------------
' num 职位 条数
' newsSql SQL 语句
'--------------------------------------
sub showSomeJob(num,jobSql)%>
<table width="95%" height="98%" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#dfdcd5">
<%
CurrentPage=replacebadchar(request("page"))
if CurrentPage="" then
CurrentPage=1
else if not IsNumeric(CurrentPage) then
CurrentPage=1
else if int(CurrentPage)<=0 then
CurrentPage=1
else
CurrentPage=replaceBadchar(request("page"))
end if
end if
end if
maxperpage=num
set jobRs=server.CreateObject("adodb.recordset")
jobRs.open jobSql,conn,1,1
if not jobRs.eof then
jobRs.pagesize=MaxPerpage
totalnumber=jobRs.recordcount
if totalnumber mod maxperpage=0 then
MaxPage= totalnumber \ MaxPerpage
else
MaxPage= totalnumber \ MaxPerpage+1
end if
if int(CurrentPage)>int(MaxPage) then
CurrentPage=MaxPage
else
CurrentPage=CurrentPage
end if
jobRs.absolutepage=CurrentPage
for ni=1 to MaxPerpage
if jobRs.eof then exit for
%>
<tr valign="bottom" bgcolor="#FFFFFF">
<td height="25" align="left" valign="middle"><img src="images/news_piont.jpg" width="16" height="10"> <a href="jobView.asp?id=<%=jobRs("id")%>" title="<%=jobRs("jobname")%>"><%=gottopic(jobRs("jobname"),48)%></a></td>
</tr>
<%
jobRs.movenext
next
else
%>
<tr><td align="center"><font color="#FF0000"><strong>资料正在整理中……</strong></font></td></tr>
<%end if
jobRs.close
set jobRs=nothing
%>
</table>
<%end sub%>
<%
'======================================================
' 显示职位空缺函数 showJob
' Jnum 显示个数
' more 显示更多还是分页
'
' FileName 分页地址
'
'======================================================
sub showJob(Jnum,more,FileName)
%>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="530" height="23" valign="top"> </td>
</tr>
<tr>
<td height="23" valign="top"><table width="560" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#103C5A">
<tr align="center" bgcolor="#F6DAD6">
<td width="25%" height="30"><strong>岗位</strong></td>
<td width="37%"><strong>部门</strong></td>
<td width="13%"><strong>招聘人数</strong></td>
<td width="14%"><strong>发布时间</strong></td>
</tr>
<%
CurrentPage=replacebadchar(request("page"))
if CurrentPage="" then
CurrentPage=1
else if not IsNumeric(CurrentPage) then
CurrentPage=1
else if int(CurrentPage)<=0 then
CurrentPage=1
else
CurrentPage=replaceBadchar(request("page"))
end if
end if
end if
strfilename=FileName
MaxPerPage=Jnum
set Jrs=server.CreateObject("adodb.recordset")
sqlstr="select * from J_Cjob order by time desc"
Jrs.open sqlstr,conn,1,1
if not Jrs.eof then
Jrs.pagesize=MaxPerpage
totalnumber=Jrs.recordcount
Jrs.absolutepage=CurrentPage
for i=1 to MaxPerPage
if Jrs.eof then exit for
%>
<tr bgcolor="#FFFFFF">
<td height="30"> <a href="jobView.asp?id=<%=Jrs("id")%>"><%=Jrs("jobname")%></a></td>
<td> <%=Jrs("bumen")%></td>
<td align="center"><%=Jrs("num")%></td>
<td align="center"><%=DateValue(Jrs("time"))%></td>
</tr>
<%
Jrs.movenext
next
else %>
<tr><td height="50" align="center"colspan="4" bgcolor="#FFFFFF"><font color="#CC0000">还没有招聘信息</font></td></tr>
<%
end if
%>
</table></td>
</tr>
<tr><td><strong>
<%if totalnumber>0 then call showpage(strFileName,totalnumber,MaxPerPage,true,true,"个岗位",CurrentPage) end if%>
</strong></td></tr>
</table>
<%end sub%>
<%
'=========================================================
' 搜索结果函数
'
'
'=========================================================
sub Showsearch()
%>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
CurrentPage=replacebadchar(request("page"))
if CurrentPage="" then
CurrentPage=1
else if not IsNumeric(CurrentPage) then
CurrentPage=1
else if int(CurrentPage)<=0 then
CurrentPage=1
else
CurrentPage=replacebadchar(request("page"))
end if
end if
end if
selectType=request("selectType")
search=replaceBadchar(request("search"))
strFileName="search.asp?selectType="&selectType&"&search="&search&""
maxperpage=10
if selectType=1 then
SearchSql="select * from J_News where delflag=false and title like '%"&search&"%'"
else if selectType=2 then
SearchSql="select * from J_Product where delflag=false and ProductName like '%"&search&"%'"
else
SearchSql="select * from J_News where delflag=false and title like '%"&search&"%'"
end if
end if
set Srs=server.CreateObject("adodb.recordset")
Srs.open SearchSql,conn,1,1
%>
<tr>
<td height="25" colspan="2" bgcolor="#cccccc"> 搜索到的结果:</td>
</tr>
<%
if not Srs.eof then
Srs.pagesize=MaxPerpage
totalnumber=Srs.recordcount
if totalnumber mod maxperpage=0 then
MaxPage= totalnumber \ MaxPerpage
else
MaxPage= totalnumber \ MaxPerpage+1
end if
if int(CurrentPage)>int(MaxPage) then
CurrentPage=MaxPage
else
CurrentPage=CurrentPage
end if
Srs.absolutepage=CurrentPage
for ni=1 to MaxPerpage
if Srs.eof then exit for
%>
<%
if selectType=2 then
%>
<tr>
<td width="22%" height="25" rowspan="3"><img src="upimg/<%=Srs("Smallpic")%>"></td>
<td width="78%"><a href="productView.asp?id=<%=Srs("id")%>"><%=replace(Srs("productName"),search,"<font color=red>"&search&"</font>")%></a></td>
</tr>
<tr>
<td><font color="#FF9933">发布时间: <%=Srs("saleTime")%> | 浏览次数: <%=Srs("hits")%></font></td>
</tr>
<tr>
<td height="1" colspan="2" background="images/wLine.jpg"></td>
</tr>
<%else%>
<tr>
<td height="25"> <img src="images/esh.gif" width="13" height="13"> <a href="newsView.asp?id=<%=Srs("id")%>"><%=replace(Srs("title"),search,"<font color=red>"&search&"</font>")%></a> <%=Srs("Time")%></td>
</tr>
<tr>
<td height="1" background="images/wLine.jpg"></td>
</tr>
<%end if%>
<% Srs.movenext
next%>
<tr>
<td colspan="2"><%call showpage(strFileName,totalnumber,MaxPerPage,false,true,"个",CurrentPage)%></td>
</tr>
<%
else%><tr>
<td colspan="2" align="center"><font color="#CC3333"><strong>没有搜索到!</strong></font></td>
</tr>
<%end if%>
</table>
<%end sub%>
<%
'******************************************
' 获得 小类 名称
'*******************************************
function smallClass(classid)
temp=classid
set scrs=server.CreateObject("adodb.recordset")
sql="select className from j_productsmallclass where delflag=false and id="&temp&""
scrs.open sql,conn,1,1
response.Write(scrs("classname"))
scrs.close
set scrs=nothing
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -