Implementing a tree structure with a sort string field (routines--display tree)

Source: Internet
Author: User
Tags rowcount sort
Sort | Display program index.asp
Features: Displaying directory trees

<!--#include file= "Lybcon.inc"--><%
Pageno=request ("PageNo")
Searchtype=request ("SearchType")
Searchnr=rtrim (Request ("Searchnr"))
Set Guestconn=server.createobject ("Adodb.connection")
Guestconn. Open Lybstr
Set Guestrs=server.createobject ("Adodb.recordset")
Sqlstr= "SELECT * FROM Guestbook"
If searchnr<> "" Then sqlstr=sqlstr& "where" &searchtype& "like '%" &replace (Searchnr, "'", "" ") & "%%"
sqlstr=sqlstr& "ORDER by rootid+ (1-sign (Rootid)) *lybid desc,orderstr,lybid"
Guestrs.open sqlstr,guestconn,1,1
Rowcount=25
If pageno= "" then pageno=1
If not guestrs.eof then
If IsNumeric (PageNo) Then
Guestrs.pagesize=rowcount
If Pageno+1>guestrs.pagecount+1 then Pageno=guestrs.pagecount
Else
Pageno=1
End If
Guestrs. Absolutepage=pageno
Else
Pageno=1
End If
%><style type= "Text/css" >
<!--
a {Text-decoration:none}
Body {line-height:18px;font-size:9pt;font-family: XXFarEastFont-Arial}
a:hover {color: #FF0000; Text-decoration:none}
. Submit {line-height:9pt;font-size:9pt;font-family: Song body}
. submit1 {line-height:8pt;font-size:8pt;font-family: Song body}
. selectform {font-family: Song body; font-size:9pt;background-color:ffe4e4}
TD {Font-family: Song body; font-size:9pt;background-color:ecf7ff}
. TD1 {font-family: Song body; Font-size:9pt;background-color:a2c8f2}
. td2 {font-family: Song body; font-size:9pt;background-color:e9ede0}
. small1 {font-family: Song body; font-size:9pt;background-color:ffffff;line-height:9pt}
-->
</style>
<script language= "JavaScript1.2" >
function d (SP,T,A,D,TI,L,ID,RID,PN)
{
document.write ("<tr><td>" +sp+ "<a href= ' disprec.asp?keyid=" +id+ "&rootid=" +rid+ "&pageno=" + pn+ "' >" +t+ "</a></td>");
document.write ("<td align=right>" +a+ "</td>");
document.write ("<td nowrap align=center>" +d+ "+ti+" "</td>");
document.write ("<td align=right>" +l+ "</td>");
document.write ("<td align=right>" +id+ "</td>");
document.write ("</tr>");
}
</script>
<body topmargin=16>
<form name= ' index ' method= ' POST ' action= ' index.asp ' >
<table width=100% align=center>
<tr>
&LT;TD align=center style= ' font-size:16px;background-color:ffffff;color:red ' height=35 valign=top> software use message thin </ Td>
&LT;TD align=center colspan=3 style= ' font-size:13px;background-color:ffffff ' valign= ' bottom ' > A total <font ' style= ' Font-size:16px;color:red ' ><% =guestrs.recordcount%></font> message <font style= ' Font-size:16px;color : Red ' ><% =guestrs.pagecount%></font> page currently <font style= ' font-size:16px;color:red ' ><% =pageno %></font> page </td>
&LT;TD style= ' background-color:ffffff ' valign=bottom><a href= '/wen/swuselyb/index.asp ' > Old message book </a> </td></tr>
<tr>
&LT;TD class= ' td2 ' align= ' center ' > Search Posts
<select name= ' searchtype ' class= ' small1 ' >
<option value= ' guestname ' <% if searchtype= "Guestname" Then Response.Write ("selected")%>> posts author </opion >
<option value= ' Guestcomm ' <% if searchtype= "Guestcomm" Then Response.Write ("selected")%>> posts </opion >
</select> <input type= ' text ' name= ' searchnr ' size=14 class= ' small1 ' ' value= ' <% =searchnr '%> ' > <a Href= ' Javascript:document.index.submit (); ' > Start Search </a>
</td>
&LT;TD colspan=3 class= ' td2 ' align= ' center ' ><% if Pageno+1>2 then ' javascript: document.index.pageno.value--;d ocument.index.submit (); ' > Previous </a><% Else%> last page <% End If%> <% if pageno+1<guestrs.pagecount+1 then%><a href= ' JAV ascript:document.index.pageno.value++;d ocument.index.submit (); ' > Next </a><% Else%> next page <% End If%>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.