📄 menutree.asp
字号:
<%
dim adoRS1,adoRS2,adoRS3
dim strSQL
dim i,j,k,n
set adoRS1=server.CreateObject("ADODB.RECORDSET")
set adoRS2=server.CreateObject("ADODB.RECORDSET")
set adoRS3=server.CreateObject("ADODB.RECORDSET")
strSQL = "select CatalogID,CatalogName from ys_product2_Catalog where CatalogID=parentID and version='"&m_ver&"' order by orderid,CatalogID"
'Response.Write strSQL & "<HR>"
adoRS1.Open strSQL,conn,1,1
'Response.Write adoRS1.RecordCount
'i=adoRS1.RecordCount
function repSquote(srcstr)
if srcstr="" then
repSquote=""
exit function
end if
dim targetstr
targetstr=trim(srcstr)
targetstr=replace(targetstr,"'","\'")
repSquote=targetstr
end function
%>
<SCRIPT language="JavaScript">
function display1(Q_subtree,Q_img){
if (Q_subtree.style.display=="none"){
Q_subtree.style.display="";
Q_img.src="../images/tree_collapse.gif";
}
else
{
Q_subtree.style.display="none";
Q_img.src="../images/tree_expand.gif";
}
}
function del_sort(temp,tag){
if(tag=="Yes"){
var msg=window.confirm ("该类别下的产品也会被删除,\n你真的要删除该类别吗?");
if(msg==true){
document.delform.hidCatalogID.value=temp;
document.delform.submit();
}
}
else
alert("该类别下还有子类别,不能删除!");
}
function chang_news_sort(id,sort_name){
document.frm_edit.hidCatalogID.value=id;
document.frm_edit.sort_name.value=sort_name;
document.frm_edit.old_boardname.value=sort_name;
document.nextnum.location.href = "nextnum.asp?ver=<%=m_ver%>&cid=" + id
}
</SCRIPT>
<TABLE cellSpacing=0 cols=5 cellPadding=0 width=210 border=0 style="font-size: 9pt">
<TBODY>
<form name="delform" action="sort_ok.asp" method="post">
<TR>
<TD style="line-height:16px" width=16></TD>
<TD style="line-height:16px" width=16></TD>
<TD style="line-height:16px" width=15></TD>
<TD style="line-height:16px" width="200"></TD>
<TD style="line-height:16px" width=23></TD>
</TR>
<TR>
<TD style="line-height:16px" width="16"><IMG src="../images/tree_collapse.gif" border=no></TD>
<TD style="line-height:16px" colSpan=4><A href="#here" onclick="javascript:chang_news_sort('','');">总目录</a> 删除</TD>
</TR>
<%n=1
'----------第二级目录开始---------
for i=1 to adoRS1.RecordCount
strSQL = "select CatalogID,CatalogName from ys_product2_Catalog where CatalogID<>parentID AND ParentID=" & adoRS1("CatalogID") & " order by orderid,CatalogID"
'Response.Write strSQL & "<HR>"
adoRS2.Open strSQL,conn,1,1
if adoRS2.RecordCount=0 then
%>
<TR>
<TD style="line-height:16px" width="16"><IMG src="../images/<%if i=adoRS1.RecordCount then%>tree_end.gif<%else%>tree_split.gif<%end if%>"></TD>
<TD style="line-height:16px" width="16"><IMG src="../images/tree_leaf.gif" border=0 width="15" height="16"></TD>
<TD style="line-height:16px" colSpan=2><A href="#here" onclick="javascript:chang_news_sort('<%=adoRS1("CatalogID")%>','<%=repSquote(adoRS1("CatalogName"))%>');"><%=adoRS1("CatalogName")%></A></TD>
<TD style="line-height:16px" width="23"><a href="javascript:del_sort('<%=adoRS1("CatalogID")%>','Yes')"><b>×</b></a></TD>
</TR>
<%else%>
<TR>
<TD style="line-height:16px" width="16"><img src="../images/<%if i=adoRS1.RecordCount then%>tree_end.gif<%else%>tree_split.gif<%end if%>" border=no width="16" height="16"></TD>
<TD style="line-height:16px" width="16"><SPAN id=zhugan<%=n%> style="CURSOR: hand;" onclick="javascript:display1(document.all.subtree<%=n%>,document.all.img<%=n%>);"><IMG src="../images/tree_collapse.gif" border=no name=img<%=n%>></SPAN></TD>
<TD style="line-height:16px" colSpan=2><A href="#here" onclick="javascript:chang_news_sort('<%=adoRS1("CatalogID")%>','<%=repSquote(adoRS1("CatalogName"))%>');"><%=adoRS1("CatalogName")%></A></TD>
<TD style="line-height:16px" width="23"><a href="javascript:del_sort('<%=adoRS1("CatalogID")%>','No')"><b>×</b></a></TD>
</TR>
<TR id="subtree<%=n%>"><TD style="line-height:16px" colspan=5>
<TABLE cellSpacing=0 cols=5 cellPadding=0 width=100% border=0 style="font-size: 9pt">
<tbody>
<%
'----------第二级目录开始---------
n=n+1
for j=1 to adoRS2.RecordCount
strSQL = "select CatalogID,CatalogName from ys_product2_Catalog where CatalogID<>parentID AND ParentID=" & adoRS2("CatalogID") & " order by orderid,CatalogID"
adoRS3.Open strSQL,conn,1,1
if adoRS3.RecordCount=0 then
%>
<TR>
<TD style="line-height:16px" width="16"><%if i=adoRS1.RecordCount then%> <%else%><img src="../../images/tree_vertline.gif" border=0><%end if%></TD>
<TD style="line-height:16px" width="16"><IMG src="../images/<%if j=adoRS2.RecordCount then%>tree_end.gif<%else%>tree_split.gif<%end if%>"></TD>
<TD style="line-height:16px" width="15"><img src="../images/tree_leaf.gif" border=0 width="15" height="16"></TD>
<TD style="line-height:16px" width="200"><A href="#here" onclick="javascript:chang_news_sort('<%=adoRS2("CatalogID")%>','<%=repSquote(adoRS2("CatalogName"))%>');"><%=adoRS2("CatalogName")%></a></TD>
<TD style="line-height:16px" width="23"><a href="javascript:del_sort('<%=adoRS2("CatalogID")%>','Yes')"><b>×</b></a></TD>
</TR>
<%else%>
<TR>
<TD style="line-height:16px" width="16"><%if i=adoRS1.RecordCount then%> <%else%><img src="../../images/tree_vertline.gif" border=0><%end if%></TD>
<TD style="line-height:16px" width="16"><img src="../images/<%if j=adoRS2.RecordCount then%>tree_end.gif<%else%>tree_split.gif<%end if%>" border=no width="16" height="16"></TD>
<TD style="line-height:16px" width="15"><SPAN id=zhugan<%=n%> style="CURSOR: hand;" onclick="javascript:display1(document.all.subtree<%=n%>,document.all.img<%=n%>);"><IMG src="../images/tree_collapse.gif" border=no name=img<%=n%>></SPAN></TD>
<TD style="line-height:16px" width="200"><A href="#here" onclick="javascript:chang_news_sort('<%=adoRS2("CatalogID")%>','<%=repSquote(adoRS2("CatalogName"))%>');"><%=adoRS2("CatalogName")%></A></TD>
<TD style="line-height:16px" width="23"><a href="javascript:del_sort('<%=adoRS2("CatalogID")%>','No')"><b>×</b></a></TD>
</TR>
<TR id="subtree<%=n%>"><TD style="line-height:16px" colspan=5>
<TABLE cellSpacing=0 cols=5 cellPadding=0 width=100% border=0 style="font-size: 9pt">
<tbody><%
'----------第三级目录开始---------
for k=1 to adoRS3.RecordCount%>
<TR>
<TD style="line-height:16px" width="16"><%if i=adoRS1.RecordCount then%> <%else%><img src="../../images/tree_vertline.gif" border=0><%end if%></TD>
<TD style="line-height:16px" width="16"><%if j=adoRS2.RecordCount then%> <%else%><img src="../../images/tree_vertline.gif" border=0><%end if%></TD>
<TD style="line-height:16px" width="16"><IMG src="../images/<%if k=adoRS3.RecordCount then%>tree_end.gif<%else%>tree_split.gif<%end if%>"></TD>
<TD style="line-height:16px" width="15"><img src="../images/tree_leaf.gif" border=0 width="15" height="16"></TD>
<TD style="line-height:16px" width="184"><A href="#here" onclick="javascript:chang_news_sort('<%=adoRS3("CatalogID")%>','<%=repSquote(adoRS3("CatalogName"))%>');"><%=adoRS3("CatalogName")%></a></TD>
<TD style="line-height:16px" width="23"><a href="javascript:del_sort('<%=adoRS3("CatalogID")%>','Yes')"><b>×</b></a></TD>
</TR>
<%adoRS3.MoveNext
if adoRS3.EOF then exit for
next
'----------第三级目录结束---------
%>
</tbody>
</TABLE></TD>
</TR>
<%
end if
adoRS3.Close
adoRS2.MoveNext
if adoRS2.EOF then exit for
n=n+1
next
'----------第二级目录结束---------
%>
</tbody>
</TABLE></TD>
</TR>
<%end if%>
<% adoRS2.Close
adoRS1.MoveNext
if adoRS1.EOF then exit for
n=n+1
next
'----------第一级目录结束---------
adoRS1.Close
set adoRS1=nothing
set adoRS2=nothing
set adoRS3=nothing
%>
<input type="hidden" name="hidCatalogID">
<input type="hidden" name="sort_action" value="del">
<input type="hidden" name="ver" value="<%=m_ver%>">
</form>
</TBODY>
</TABLE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -