sort.asp

来自「教育管理系统」· ASP 代码 · 共 592 行 · 第 1/2 页

ASP
592
字号
                        <td><%
sql="SELECT * FROM type WHERE zhuid='"&zhuid&"' Order By zhuid DESC"
Set rs2=Conn.Execute(sql)%> <%
do while not rs2.bof and not rs2.eof
%>
                      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                        <tr align="center"> 
                              <td background="tian/dh-di.jpg"> 
                                &nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>&nbsp;<%if not RS2.EOF then%><a href="sort.asp?typeid=<%=RS2("typeID")%>&zhuid=<%=zhuid%>"><font color=#ffffff><%=rs2("type")%></font></a><%RS2.MoveNext%><%end if%>
                              </td>
                            </tr>
                          <%RS2.MoveNext%></table>
                          <br>
                          <%rs2.movenext
loop
rs2.close
set rs2=nothing%> </td>
                      </tr>
                    </table>
                    
                <table width="90%" border="0" cellspacing="0" cellpadding="0" bgcolor="#333333" align="center" class="sx">
                  <tr> 
                        <td background="tian/lm2.jpg"> 
                          <%
   MaxPerPage=rs1("duo")
   dim totalPut,CurrentPage,TotalPages,i,j,page
   if not isempty(request("page")) then
      currentPage=cint(request("page"))
   else
      currentPage=1
   end if
sql="select * from learning where zhuid="&zhuid&" and typeid="&typeid&" order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
 if rs.eof and rs.bof then
       response.write "<p align='center'> 还 没 有 任 何 软 件</p>"
   else
	  totalPut=rs.recordcount
      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
           showpage totalput,MaxPerPage,"SORT.ASP"
            showContent
            showpage1 totalput,MaxPerPage,"SORT.ASP"
       else
          if (currentPage-1)*MaxPerPage<totalPut then
            rs.move  (currentPage-1)*MaxPerPage
            dim bookmark
            bookmark=rs.bookmark
           showpage totalput,MaxPerPage,"SORT.ASP"
            showContent
            showpage1 totalput,MaxPerPage,"SORT.ASP"
        else
	        currentPage=1
          showpage totalput,MaxPerPage,"SORT.ASP"
           showContent
           showpage1 totalput,MaxPerPage,"SORT.ASP"
	      end if
	   end if
   rs.close
   end if
   set rs=nothing
   sub showContent
       dim i
	   i=0
          do while not rs.eof%>
                        </td>
                      </tr>
                    </table>
                <br>
                <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" class="y">
                  <tr>
                    <td height="172"> 
                      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="sx" height="20">
                        <tr > 
                          <td colspan="2" background="tian/lm2.jpg">&nbsp;□<a href="soft.asp?id=<%=rs("articleid")%>&typeid=<%=rs("typeid")%>&zhuid=<%=rs("zhuid")%>"> 
                            <%=rs("title")%></a> </td>
                        </tr>
                      </table>
                      <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center" bordercolorlight="#000000" bgcolor="#333333">
                        <tr> 
                          <td> 
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                              <tr> 
                                <td width="41%" align="center" height="147"> 
                                  <table border="0" cellspacing="0" cellpadding="0" class="bk">
                                    <tr> 
                                      <td> 
                                        <%if rs("images")<>"" then%>
                                        <img src="<%=rs("images")%>" width="150"> 
                                        <%end if%>
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                                <td width="59%" height="147"> 
                                  <table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bgcolor="#333333" bordercolorlight="#000000">
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="right"><font 
                  color=#808080>□</font> 文件名称:</div>
                                      </td>
                                      <td width="67%"><a href="soft.asp?id=<%=rs("articleid")%>&typeid=<%=rs("typeid")%>&zhuid=<%=rs("zhuid")%>"><%=rs("title")%></a> 
                                        <%if RS("dateandtime")>=date() then response.write("&nbsp;&nbsp;<image src=images/new.gif>")%> 
                                      </td>
                                    </tr>
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="right"><font 
                  color=#808080>□</font> 推荐程度:</div>
                                      </td>
                                      <td width="67%"><%=rs("softlevel")%> &nbsp;&nbsp;&nbsp;&nbsp;<%if RS("best") = true then response.write("<font color=#ffffff>&nbsp;&nbsp;&nbsp;强烈推荐</font>")%></td>
                                    </tr>
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="right"><font 
                  color=#808080>□</font> 加入时间:</div>
                                      </td>
                                      <td height="20" width="67%"><%=rs("dateandtime")%></td>
                                    </tr>
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="right"><font 
                  color=#808080>□</font> 文件大小:</div>
                                      </td>
                                      <td width="67%"><%=rs("dog")%></td>
                                    </tr>
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="right"><font 
                  color=#808080>□</font> 下载次数:</div>
                                      </td>
                                      <td width="67%"><%=rs("hits")%></td>
                                    </tr>
                                    <tr> 
                                      <td width="33%"> 
                                        <div align="center"><font 
                  color=#808080>□</font> 文件简介</div>
                                      </td>
                                      <td width="67%"><%=cutstr(rs("content"),150)%></td>
                                    </tr>
                                    <tr> 
                                      
                                    </tr>
                                  </table>
                                </td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                </table>
                <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
                  <tr>
                    <td><% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
 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 border=""0"" cellspacing=""1"" width=""100%"">"
  response.write "<tr><td width=""38%"">"
  Response.Write "<FONT COLOR=""#c0c0c0"">共有文件:</FONT><font face=""arial"" color=""red"">"&totalnumber&"</font><FONT COLOR=""#c0c0c0"">个</FONT> <font face=""arial"" color=""red"">"&CurrentPage&"/"&n&"</font><FONT COLOR=""#c0c0c0"">页</FONT></td>"
  response.write "<td width=""36%""><div align=""right"">"
  if CurrentPage<2 then
    response.write "<font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</font></a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页</font>"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>"
  end if
  Response.Write "</div></td></tr></table>"
end function 
function showpage1(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
   Response.Write "<table border=""0"" cellspacing=""1"" width=""100%"">"
  response.write "<tr><td align=""left""><td width=""64%"">"
  gotopage
  response.write "<td width=""36%"" bgcolor=""#333333""><div align=""right"">"
  if CurrentPage<2 then
    response.write "<font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页&nbsp;</font>"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>&nbsp;"
  end if
  Response.Write "</div></td></tr></table>"
end function 
sub gotopage%></td>
                  </tr>
                </table>
                <br>
                <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#333333" class="sx">
                  <tr> 
                    <td height="30"> &nbsp;转到 
                      <input type="Text" name="page" value="<%if request("page")="" then%>1<%else%><%=request("page")%><%end if%>" size="1" maxlength="4" style="font-size:9pt;background-color:#666666;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000">
                      <input type="Image" src="images/go.gif" tppabs="" width="20" height="20" align="absmiddle" title="执行" name="Image">
                      <%end sub
function showpage2(totalnumber,maxperpage,filename)

  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<form method=Post action="&filename&"?typeid="&typeid&"&zhuid="&zhuid&">"
  response.write "<p align='center'>&gt;&gt;分页&nbsp;"
  if CurrentPage<2 then
    response.write "><font color='999966'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page=1&>首页</a>&nbsp;"
    response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='999966'>下一页 尾页</font>"
  else
       response.write "<a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&(CurrentPage+1)
    response.write ">下一页</a> <a href="&filename&"?typeid="&typeid&"&zhuid="&zhuid&"&page="&n&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
    response.write "&nbsp;共<b>"&totalnumber&"</b>个软件<b>"&maxperpage&"</b>个软件/页 "
   response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=smallInput value="&currentpage&">"
   response.write "<input class=buttonface type='submit'  value=' 确定 '  name='cndok'></span></p></form>"
end function 
%> </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table></form>
              
        <%end if%> 
        <table width="770" border="0" cellspacing="1" cellpadding="1">
          <tr bgcolor="#303430"> 
            <td>
              <div align="center">版权所有 丽都大酒店 DREAM工作室 </div>
            </td>
          </tr>
        </table>
      </td>
          </tr>
        </table>
        
      <tr> 
      
    <td>&nbsp;</td>
  </tr>
</center>
</body></html>

<%end if
rs1.close
set rs1=nothing
conn.close
set conn=nothing
function cutstr(tempstr,tempwid) 
if len(tempstr)>tempwid then 
cutstr=left(tempstr,tempwid)&" ......" 
else 
cutstr=tempstr 
end if 
end function %>

⌨️ 快捷键说明

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