📄 fenlei.asp
字号:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim rs,sql,class1,i,k
if request("cnmai")="class1" then
call add()
response.end
end if
if request("cnmai")="del" then
call del()
response.end
end if
k=1
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [class1] order by paixu desc"
rs.open sql,conn,1,1
%>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<div align="center">
<center>
<form method="POST" action="fenlei.asp?cnmai=class1">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#808000" width="400" height="68">
<tr>
<td height="25" width="322" bgcolor="#FFCC00">
<p align="center">分类总数:<font color="#666666"><b><%=rs.Recordcount%></b></font></td>
</tr>
<tr>
<td width="322" height="21" align="left" style="border-bottom-style: none; border-bottom-width: medium">
<p> 增加大类:<input type="text" name="class1" size="20" value=""> </p>
</td>
</tr>
<tr>
<td width="322" height="25" align="left" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<p> 排序数字:<input type="text" name="paixu" size="20" value="0"></td>
</tr>
<tr>
<td width="100%" height="25" align="left" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
<span lang="zh-cn"> </span> <span lang="zh-cn">添加信息页</span>:<input type="text" name="addpage" size="31" >(<span lang="zh-cn">绝对路径</span>)</td>
</tr>
<tr>
<td width="100%" height="25" align="left" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
信息显示页:<input type="text" name="memopage" size="31">(<span lang="zh-cn">绝对路径</span>)</td>
</tr>
<tr>
<td width="100%" height="25" align="left" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
会员修改信息页:<input type="text" name="editpage" size="31">(<span lang="zh-cn">绝对路径</span>)</td>
</tr>
<tr>
<td width="100%" height="25" align="left" style="border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
管理员修改信息页:<input type="text" name="adminpage" size="31">(<span lang="zh-cn">绝对路径</span>)</td>
</tr>
<tr>
<td width="100%" height="25" style="border-top-style: none; border-top-width: medium">
<p align="center">
<input type="submit" value="提交" name="B1" style="color: #000000; border: 0px solid #000000; background-color: #FFCC00"></td>
</tr>
</table>
</form>
</center>
</div>
<p align="center"> </p>
<div align="center">
<center>
<table width="100%" style="border-collapse: collapse" cellpadding="0" border="1" background="img/bg.gif">
<tr>
<td width="6%" height="20" valign="bottom" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium">
<p align="center">编号</td>
<td height="20" valign="bottom" width="15%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium" align="center">
名称</td>
<td height="20" valign="bottom" width="15%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium" align="center">
<span lang="zh-cn">添加信息页</span></td>
<td height="20" valign="bottom" width="15%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium" align="center">
信息显示页</td>
<td height="20" valign="bottom" width="15%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium" align="center">
会员修改信息页</td>
<td height="20" valign="bottom" width="15%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium" align="center">
管理员修改信息页</td>
<td style="border-bottom-style: none; border-bottom-width: medium" height="20" valign="bottom" width="13%" colspan="2" bgcolor="#FFCC00">
<p align="center">操作</td>
<td height="20" valign="bottom" width="6%" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium">
<p align="center">排序</td>
</tr>
<%do while not rs.eof%>
<tr>
<td width="6%" style="border-bottom-style: none; border-bottom-width: medium; border-left-style:none; border-left-width:medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom">
<div align="center">
<font color="#000000"><b><%=k%></b></font></div>
</td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="15%">
<p align="left">
<font color="#FF0000">
<span id="followImg<%=k%>" ><%=rs("class1")%></span></font></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="15%">
<%=rs("addpage")%></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="15%">
<%=rs("memopage")%></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="15%">
<%=rs("editpage")%></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="15%">
<%=rs("adminpage")%></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="33">
<p align="center">
<font color="#800000"><span style="text-decoration: none"><a href="fenlei.asp?id=<%=rs("id")%>&cnmai=del">
<font color="#FF0000">[删]</font></a></span></font></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="47">
<p align="center">
<font color="#800000"><span style="text-decoration: none"><a href="#" ONCLICK="window.open('fenleiedit.asp?id=<%=rs("id")%>','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=500,height=200,left=100,top=100')">
<font color="#FF0000">[修]</font></a></span></font></td>
<td style="border-bottom-style: none; border-bottom-width: medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" height="20" valign="bottom" width="6%">
<p align="center"><font color="#FF0000"><%=rs("paixu")%></font></td>
</tr>
<%
k=k+1
rs.movenext
loop
%>
</table>
</center>
</div>
<p align="center"><font color="#666666">说明:排序数字越大越靠前显示</font></p>
<%
rs.close
set rs=nothing
%>
<%
sub add()
class1=trim(request("class1"))
if class1="" then
response.write "<li>错误,类别为空!"
response.write "<meta http-equiv=refresh content=""2;URL=fenlei.asp"">"
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [class1] where class1='"&trim(request("class1"))&"'"
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("class1")=trim(request("class1"))
rs("paixu")=trim(request("paixu"))
rs.update
response.write "<li>添加大类成功。"
response.write "<meta http-equiv=refresh content=""1;URL=fenlei.asp"">"
rs.close
set rs=nothing
else
response.write "<li>错误,名称已经存在!"
rs.close
set rs=nothing
response.write "<meta http-equiv=refresh content=""2;URL=fenlei.asp"">"
response.end
end if
end sub
sub del()
dim rs,sql1,sql2,id,username,str2,str3,i,strid,xinxiclass
id=trim(request("id"))
if not isnumeric(id) or id="" then
response.write "<li>参数错误!"
response.end
end if
set rs=server.createobject("adodb.recordset")
'取id
sql="select * from [xinxi] where class1="&id&" "
rs.open sql,conn,1,1
do while not rs.eof
xinxiclass=xinxiclass +","+cstr(rs("id"))
rs.movenext
loop
rs.close
str2=split(xinxiclass,",")
for i=1 to ubound(str2)
'删shoucang
sql1="delete from [shoucang] where scid="&str2(i)&""
rs.open sql1,conn,1,3
'删hf
sql2="delete from [hf] where xxid="&str2(i)&" "
rs.open sql2,conn,1,3
next
'删class1
sql1="delete from [class1] where id="&cstr(id)
rs.open sql1,conn,1,3
sql2="delete from [xinxi] where class1="&request("id")&" "
rs.open sql2,conn,1,3
response.write "<font size=2>删除大类成功!</font><br>"
response.write "<meta http-equiv=refresh content=""1;URL=fenlei.asp"">"
end sub
closedb
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -