⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.asp

📁 本源代码为大学生购物网的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<!--#include file="top.asp"--><!--#include file="load.asp"-->  

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="175" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25"> <div align="center">
					<img border="0" src="images/menu5.gif" width="176" height="33"></div></td>
                </tr>
              </table><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25"> <div align="center"> 
					<div align="center">
						<table border="0" cellpadding="0" cellspacing="0" width="96%">
             <tr> 
          <td>
			
  
         </td>
 
          
        </tr>
             <tr> 
                      <td height="42" width="168"> <%
if session("user_id")<>empty then
call load2()
else
call load1()
end if
%></td>

        </tr>

       
      </table>
				</div></td>
                </tr>
              </table>             <%
	  if id <> "" then
	   %>
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25"> <div align="center">
					<img border="0" src="images/menu3.gif" width="176" height="34"></div></td>
                </tr>
              </table><% 
	SqlStr = "Select Unid,Classname from 2s_class where flag = "&id&"   order by orderflag asc"
	set RsStr = conn.execute(SqlStr)

	if not RsStr.eof then
		do while not RsStr.eof
			for i = 1 to 2
			SqlStrs = "SELECT Nclassid, Count(Nclassid)  FROM 2s_list where Nclassid ="& RsStr(0) &" GROUP BY Nclassid"
	set RsStrs = conn.execute(SqlStrs)
	if not RsStrs.eof then
	nclassids="("&RsStrs(1)&")"
	RsStrs.close : set RsStrs = nothing
	else
	nclassids="(0)"
	end if
				Response.write "<a href=index.asp?cid="& RsStr(0) &"&id="& id &">" &RsStr(1) & "</a><font color=#CCCCCC>" &nclassids& "</font>&nbsp;&nbsp;&nbsp;"
				
				RsStr.movenext
				if RsStr.eof then exit for
			next
			Response.write "<br>"
		loop
	else
		Response.write ""
	end if
		RsStr.close
		end if
	%>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="25">
					<img border="0" src="images/menu1.gif" width="176" height="34"></td>
                </tr>
              </table>
              <form name="form1" method="post" action="index.asp">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td>类型: 
                      <select name="lx" id="select4">
                        <option value="">选择</option>
                        <option value="1">出售</option>
                        <option value="2">求购</option>
                        <option value="3">出租</option>
                        <option value="4">求租</option>
                        <option value="5">求职</option>
                        <option value="6">招聘</option>
                      </select> </td>
                  </tr> <tr> 
            <td>地点: 
              <select name="dq" id="select5" size="1">
                <option>选择</option>
                <option value=校内>校内</option><option value=校外>校外</option>              </select></td>
          </tr>
                        <tr> 
                    <td>物品: 
                      <input name="title" type="text" id="title" class=input2 size="15"></td>
                  </tr>
                  <tr> 
                    <td><div align="center"> 
                        <input type=submit value=提交 name=Submit2 class=input2>
                        <input type=reset value=重置 name=Submit3 class=input2>
                      </div></td>
                  </tr>
                </table>
              </form>
              <div align="center"> 
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td height="25"> <div align="center">
					<img border="0" src="images/menu2.gif" width="176" height="34"></div></td>
                  </tr>
                  <tr> 
                    <td> 
                      <%Call Qcdn.Toplist2s("10","hits",id)%>
                    </td>
                  </tr>
                </table>
              </div></td>
          <TD vAlign=top width=2 bgColor=#FFcc66></td>
  <td bgcolor="#FFFFFF" valign="top">
	<div align="center">
		<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFEACA">
              <tr> 
                <td align="center" bgcolor="#FFCC66">状态</td>
                <td align="center" bgcolor="#FFCC66">类型</td>
                <td bgcolor="#FFCC66" width="39%">信息标题</td>
 <td align="center" bgcolor="#FFCC66"><div align="center">所在地点</div></td>
                <td align="center" bgcolor="#FFCC66">发布时间</td>
                <td align="center" bgcolor="#FFCC66">状态</td>
                <td align="center" bgcolor="#FFCC66">人气</td>
              </tr>
			  <%  
		SqlT = "Select top 10 * from 2s_list where sxs = 0 and tops= 1 order by Intime desc,Title"	
	Set Rst = Conn.execute(SqlT)
	if Rst.eof and Rst.bof then
		Response.write ""
	else
		do while not Rst.eof
		
 %>
  <tr> 
                <td width="6%" bgcolor="#FFFFFF"> <div align="center"><img src="2spic/topzong.gif"></div></td>
                <td width="9%" bgcolor="#FFFFFF"> <div align="center"> 
                    <% 
		  Select Case rst("lx")
                Case "1"
                response.write "<font color=""#008000"">[出售]</font>"
                Case "2"
                response.write "<font color=""#FF00FF"">[求购]</font>"
                Case "3"
                response.write "<font color=""#008000"">[出租]</font>"
                Case "4"
                response.write "<font color=""#FF00FF"">[求租]</font>"
                Case "5"
                response.write "<font color=""#ff0000"">[求职]</font>"
                Case "6"
                response.write "<font color=""#ff0000"">[招聘]</font>"
                Case Else
                response.write "<font color=""#FF00FF"">[其它]</font>"
                End Select
		   %>
                  </div></td>
                <td bgcolor="#FFFFFF" width="39%"><a href="show.asp?id=<%= id %>&Unid=<%= rst("s_id") %>"><%= left(rst("title"),16) %></a></td> <td width="16%" bgcolor="#FFFFFF"><div align="center"><%= rst("dq") %></div></td>
                <td width="11%" bgcolor="#FFFFFF"> <div align="center"><%=FormatDateTime(rst("Intime"),vbshortdate)%></div></td>
                <td width="11%" bgcolor="#FFFFFF"> <div align="center"> 
                    <% 
		  Select Case rst("jx")
                Case "0"
                response.write "<font color=""#008000"">[未完]</font>"
                Case "1"
                response.write "<font color=""#FF00FF"">[完成]</font>"
                End Select
		   %>
                  </div></td>
                <td width="5%" bgcolor="#FFFFFF"><div align="center"><%= rst("hits") %></div></td>
 
  </tr>
<%  
Rst.movenext
		loop
	end if
	Rst.close
  %>
<% 
   if id <>"" then
			SqlT = "Select top 10 * from 2s_list where sxs = 0 and classid="& id &" and top1= 1 order by Intime desc,Intime"
	Set Rst = Conn.execute(SqlT)		
	if Rst.eof and Rst.bof then
		Response.write ""
	else
		do while not Rst.eof
		
 %>
  <tr> 
                <td width="6%" bgcolor="#FFFFFF"> <div align="center"><img src="2spic/topclass.gif"></div></td>
                <td width="9%" bgcolor="#FFFFFF"> <div align="center"> 
                    <% 
		  Select Case rst("lx")
                Case "1"
                response.write "<font color=""#008000"">[出售]</font>"
                Case "2"
                response.write "<font color=""#FF00FF"">[求购]</font>"
                Case "3"
                response.write "<font color=""#008000"">[出租]</font>"
                Case "4"
                response.write "<font color=""#FF00FF"">[求租]</font>"
                Case "5"
                response.write "<font color=""#ff0000"">[求职]</font>"
                Case "6"
                response.write "<font color=""#ff0000"">[招聘]</font>"
                Case Else
                response.write "<font color=""#FF00FF"">[其它]</font>"
                End Select
		   %>
                  </div></td>
                <td bgcolor="#FFFFFF" width="39%"><a href="show.asp?id=<%= id %>&Unid=<%= rst("s_id") %>"><%= left(rst("title"),16) %></a></td> <td width="16%" bgcolor="#FFFFFF"><div align="center"><%= rst("dq") %></div></td>
                <td width="11%" bgcolor="#FFFFFF"> <div align="center"><%=FormatDateTime(rst("Intime"),vbshortdate)%></div></td>
                <td width="11%" bgcolor="#FFFFFF"> <div align="center"> 
                    <% 
		  Select Case rst("jx")
                Case "0"
                response.write "<font color=""#008000"">[未完]</font>"
                Case "1"
                response.write "<font color=""#FF00FF"">[完成]</font>"
                End Select
		   %>
                  </div></td>
                <td width="5%" bgcolor="#FFFFFF"><div align="center"><%= rst("hits") %></div></td>
 
  </tr>
<%  
Rst.movenext
		loop
	end if
	Rst.close
	end if
%>
              <%

	set rs=server.createobject("adodb.recordset")
	sql="Select * from 2s_list where sxs =0 "
	if title<>"" then sql=sql & " and title like '%"&title&"%'"
	if author<>"" then sql=sql & " and author LIKE '%"&author&"%'"
	if Nclassid<>"" then sql=sql & " and Nclassid ="&Nclassid&""
	if classid<>"" then sql=sql & " and classid ="&classid&""
	if dq<>"" then sql=sql & " and dq LIKE '%"&dq&"%'"
	if lx<>"" then sql=sql & " and lx ="&lx&""
	if u_id<>"" then sql=sql & " and u_id ="&u_id&""
	sql=sql & " order by s_id desc"
	rs.open sql,conn,1,1
 	if rs.eof and rs.bof then
		Response.Write "<center><font color=red>还没相关信息。</font></center>"
	else
		totalPut=rs.recordcount
      		if currentpage<1 then
          		currentpage=1
      		end if
      		if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     			currentpage= totalPut \ MaxPerPage
	  		else
	      			currentpage= totalPut \ MaxPerPage + 1
	   		end if
      		end if
       		if currentPage=1 then           		
            		showContent
            		showpage totalput,MaxPerPage,"index.asp"
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
            			dim bookmark
            			bookmark=rs.bookmark           			
            			showContent
             			showpage totalput,MaxPerPage,"index.asp"
        		else
	        		currentPage=1                  			
           			showContent
           			showpage totalput,MaxPerPage,"index.asp"
	      		end if
	   		end if
		rs.close
		set rs = nothing	
   	end if 
	sub showContent
	dim i 
	   	i=0
	%>
              
                <%do while not rs.eof%>
                <tr onMouseOver=chc(idfm<%= rs(0) %>) onMouseOut=chb(idfm<%= rs(0) %>) id=idfm<%= rs(0) %>> 
                  <td width="6%" bgcolor="#FFFFFF"> <div align="center"><img src="2spic/1.gif"></div></td>
                  <td width="9%" bgcolor="#FFFFFF"> <div align="center"> 
                      <% 
		  Select Case rs("lx")
                Case "1"
                response.write "<font color=""#008000"">[出售]</font>"
                Case "2"
                response.write "<font color=""#FF00FF"">[求购]</font>"
                Case "3"
                response.write "<font color=""#008000"">[出租]</font>"
                Case "4"
                response.write "<font color=""#FF00FF"">[求租]</font>"
                Case "5"
                response.write "<font color=""#ff0000"">[求职]</font>"
                Case "6"
                response.write "<font color=""#ff0000"">[招聘]</font>"
                Case Else
                response.write "<font color=""#FF00FF"">[其它]</font>"
                End Select
		   %>
                    </div></td>
                  <td bgcolor="#FFFFFF" width="39%"><a href="show.asp?id=<%= id %>&Unid=<%= rs("s_id") %>"><%= left(rs("title"),16) %></a></td> <td width="16%" bgcolor="#FFFFFF"><div align="center"><%= rs("dq") %></div></td>
                  <td width="11%" bgcolor="#FFFFFF"> <div align="center"><%=FormatDateTime(rs("Intime"),vbshortdate)%></div></td>
                  <td width="11%" bgcolor="#FFFFFF"> <div align="center"> 
                      <% 
		  Select Case rs("jx")
                Case "0"
                response.write "<font color=""#008000"">[未完]</font>"
                Case "1"
                response.write "<font color=""#FF00FF"">[完成]</font>"
                End Select
		   %>
                    </div></td>
                  <td width="5%" bgcolor="#FFFFFF"><div align="center"><%= rs("hits") %></div></td>
                </tr>
                <%
  i=i+1
	      if i>=MaxPerPage then exit do
  rs.movenext
  loop
  %>
              
              <tr> 
                <td height="25" colspan="7" bgcolor="#FFFFFF"> 
                  <%
   end sub 

	function showpage(totalnumber,maxperpage,filename)
  	dim n

  	if totalnumber mod maxperpage=0 then
     		n= totalnumber \ maxperpage
  	else
     		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<table cellspacing=1 width='100%' border=0 colspan='23' ><form method=Post action="""&filename&"""><tr><td align=right> "
  	if CurrentPage<2 then
    		response.write "共<b><font color=red>"&totalnumber&"</font></b>条信息&nbsp;首页 上一页&nbsp;"
  	else
    		response.write "共<b><font color=red>"&totalnumber&"</font></b>条信息&nbsp;<a href="&filename&"?page=1>首页</a>&nbsp;"
    		response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
    		response.write "下一页 尾页"
  	else
    		response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    		response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  	end if
   	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    	response.write "&nbsp;<b>"&maxperpage&"</b>条信息/页 "
%>
                  转到: 
                  <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
                    <%for i = 1 to n%>
                    <option value='<%=filename%>?page=<%=i%>'>第<%=i%>页</option>
                    <%next%>
                  </select> 
                  <%   
	response.write "</td></tr></FORM></table>"
end function




%>
                </td>
              </tr>
              </table></div>
	</td>
  </tr>
</table>
<!--#include file="copy.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -