📄 sort_list.asp
字号:
<!--#include file="conn.asp"-->
<%
if session("username")="" then
response.write "<table><tr><td>你还未登陆,或登陆已超时,请重新登陆!</td></tr>"
response.write "<tr><td><a href='login.htm' target=_parent>返回</a></td></tr></table>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link rel="stylesheet" href="../style.css" type="text/css">
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="0">
<tr>
<td align="center">商品类别列表</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<%
sql="select * from Net008_productsort where sortlevel='1'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,2
if rs.recordcount<1 then
response.write "<font color=#ff0000>无类别!</font></br></br></br></br>"
response.end
end if
for i=1 to rs.recordcount
sortid_temp=rs("sortid")
'判断该类别下是否有商品开始
sql_temp="select * from Net008_productlist where left(sortid,3)='"&sortid_temp&"'"
set rs_temp=server.createobject("adodb.recordset")
rs_temp.open sql_temp,conn,1,2
if rs_temp.recordcount<1 then
sortid_P=1
else
sortid_P=2
end if
'判断该类别下是否有商品结束
'取小类
sql_in="select * from Net008_productsort where sortlevel='2' and left(sortid,3)='"&sortid_temp&"'"
set rs_in=server.createobject("adodb.recordset")
rs_in.open sql_in,conn,1,2
if rs_in.recordcount<1 then
sortid_X=1
else
sortid_X=2
end if
%>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="lefttitle"><img src="../images/img_03.gif" width="12" height="12"><%=rs("sortname")%> <a href=sort_modi.asp?id=<%=rs("id")%> class="LeftTypeLink">【修改】</a>
<%if sortid_X=1 and sortid_P=1 then%>
<a href="sort_del.asp?id=<%=rs("id")%>" class="LeftTypeLink">【删除】</a>
<%else%>
<font color=cccccc size=2>【删除】</font>
<%end if%>
<script language=Javascript>
function deleteMe_D(){
if(confirm("删除了将不可以恢复,确定删除吗?")==1){
window.location="sort_del.asp?id=<%=rs("id")%>"
}
}
</script>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../images/dot.gif" height="3"></td>
</tr>
<tr>
<td height="2"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="table1">
<tr class="th1">
<td width="30"><strong>序号</strong></td>
<td align="center"><b>类别名称</b></td>
<td width="80" align="center"><b>修改</b></td>
<td width="80" align="center"><b>删除</b></td>
<td width="80" align="center"><b>添加时间</b></td>
</tr>
<%
if rs_in.recordcount<1 then
response.write "<font color=#ff0000>无子类别!</font></br>"
else
for j=1 to rs_in.recordcount
%>
<tr class="th2">
<td width="30" align="center"><%=j%></td>
<td> <%
response.write "<a href='sort_modi.asp?id="&rs_in("id")&"' class=LeftTypeLink>"&rs_in("sortname")
response.write "</a> "
response.write "</td>"
%>
<td align="center"><a href=sort_modi.asp?id=<%=rs_in("id")%> class="LeftTypeLink">修改</a></td>
<td align="center">
<%
sql_temp="select * from Net008_productlist where sortid='"&rs_in("sortid")&"'"
set rs_temp=server.createobject("adodb.recordset")
rs_temp.open sql_temp,conn,1,2
if rs_temp.recordcount=0 then
%>
<script language=Javascript>
function deleteMe(){
if(confirm("删除了将不可以恢复,确定删除吗?")==1){
window.location="sort_del.asp?id="&rs_in("id")
}
}
</script>
<a href="sort_del.asp?id=<%=rs_in("id")%>" class="LeftTypeLink">删除</a>
<%else%>
<font color=cccccc>---</font>
<%end if%>
</td>
<td align="center"><%=FormatDateTime(rs_in("adddate"),2)%></td>
</tr>
<%
rs_in.MoveNext
If rs_in.EOF Then Exit For
next
end if
%>
</table>
<%
rs.MoveNext
If rs.EOF Then Exit For
next
rs.close
set rs=nothing
%>
</td>
</tr>
</table>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -