ASP Unlimited class support JS contraction extension

Source: Internet
Author: User

<!--#include file= "adoconn.asp"-->
<style>
. dotted_class{
border-bottom:1px dotted #757575;
}
. Dotted_class a{
Text-decoration:none;
font-size:12px;
}
. td{
font-size:12px;
}
</style>
<script language= "JavaScript Tutorial" >
function $$ (ID)
{
return document.getElementById (ID);
}

function fd (id,num)
{
t=$$ ("D_" +id). Src;
if (T.indexof ("+.gif") >0)
{
t1= "Block";
T2= "Images/-.gif";
}
Else
{
T1= "None";
T2= "Images/+.gif";
}
for (i=1;i<=num;i++)
{
$$ ("C" +id+ "_" +i). Style.display=t1;
$$ ("D_" +id). Src=t2;
}
}

</script>

<%
Catstr= ""
Depath=0
Call cat111 (0,0,2)
%>
<table width= ">"
<TR>
<TD><%=catstr%></TD>
</TR>
</TABLE>
<%
function cat111 (parent_id,tid,stype)
Set Rs1 =server.createobject ("Adodb.recordset")
Sql= "Select cat_name,cat_id,parent_id from category where parent_id=" &parent_id& "and u_id=" &stype& " and is_show=1 ORDER by cat_order ASC "
Set Rs1=conn.execute (SQL)
If rs1.eof Then
Else
if (depath>2) then
Display2= "None"
Else
Display2= "Block"
End If
Dim j
J=1
Do as not rs1.eof
cat_name1 = Rs1 ("Cat_name")
CAT_ID1 = Rs1 ("cat_id")
Parent_id1=rs1 ("parent_id")
' ****************** below is the ****************** you want to show '
M9=0
Sql2= Select COUNT (cat_id) as T from category where parent_id= "&cat_id1&" and u_id= "&stype&"
Set Rs2=server.createobject ("Adodb.recordset")
Set Rs2=conn.execute (SQL2)
If not rs2.eof then
M9=rs2 ("T")
Else
M9=0
End If
Rs2.close

if (depath<=2) then
mgif= "Images/-.gif"
A= "Block"
Else
if (m9>0) then
mgif= "Images/+.gif"
Else
mgif= "Images/-.gif"
End If
if (depath=4) Then
A= "Block"
Else
A= "None"
End If
End If
If cat_id1=8 or cat_id1=10 Then
A= "Block"
mgif= "Images/+.gif"
ElseIf cat_id1>82 Then
A= "None"
mgif= "Images/-.gif"
Else
End If
Catstr=catstr & "<tr id=" "C" &parent_id& "_" &j& "" style= "" Display: &a& "" "><td Width= "5" "align=" "Center" "valign=" "Middle" "class=" "Dotted_class" ">&nbsp;</td><td class=" " Dotted_class leftcatcss Tutorial ">"
For I=1 to Depath
catstr=catstr& "&nbsp;"
Next
catstr=catstr& " &nbsp; "
if (m9>0) then
catstr=catstr& "<a href=" "javascript:void (0);" "Onclick=" "FD (" &cat_id1& "," &m9& ", 0)" ">" &vbnewline
Else
catstr=catstr& "<a href=" "products.asp?id=" &cat_id1& "" > "&vbnewline
End If
If depath=0 Then
cat_name1= "<span style=" "FONT-SIZE:13PX; Font-weight:bold; "" > "&cat_name1&" </span> "
End If
catstr=catstr&cat_name1& "</a></td></tr>" &vbnewline
M9=0

Sql2= ' select cat_name,cat_id from category where parent_id= ' &parent_id1& ' and u_id= ' &stype& ' ORDER by Cat_order ASC "
Set Rs2=server.createobject ("Adodb.recordset")
Set Rs2=conn.execute (SQL2)
If not rs2.eof then
Depath=depath+4
Call cat111 (Cat_id1,tid,stype)
End If
Rs2.close
Set rs2=nothing
Depath=depath-4
' ****************** above is the ****************** you want to show '
J=j+1
Rs1.movenext
Loop


End If
Rs1.close
Set rs1=nothing
End Function
%>

Database Tutorial Connection File adoconn.asp

<% @LANGUAGE = "VBSCRIPT" codepage= "65001"%>
<%
Response. charset= "Utf-8"
Response.codepage= "65001"

db= "Db1.mdb"

Path=server.mappath (DB)
Set Conn=server.createobject ("ADODB. Connection ")
connstr=" Provider=Microsoft.Jet.OLEDB.4.0;Data source= "&path
Conn. The Open connstr
Set rs=server. CreateObject ("Adodb.recordset")
%>

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.