⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leixing.asp

📁 信息类网站的不错选择
💻 ASP
字号:
<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<%
dim rs,sql,leixing,i,k
if request("cnmai")="add" 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 [leixing] order by paixu asc" 
rs.open sql,conn,1,1
%>
<link href="inc_style.css" rel="stylesheet" type="text/css">
<div align="center">
  <center>
  <form method="POST" action="leixing.asp?cnmai=add">
  <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="center" style="border-bottom-style: none; border-bottom-width: medium">

<p>增加种类:<input type="text" name="leixing" size="20" value=""> </p>

      </td>
    </tr>
    <tr>
      <td width="322" height="25" align="center" 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="322" height="25" style="border-top-style: none; border-top-width: medium">
      显示颜色:<select name="lxcolor">
                          <option style="COLOR: black" value="#000000" selected>默认黑色
                          </option>
                          <option style="background: #99ccff" value="#99ccff">
                          </option>
                          <option style="background: #66ffff" value="#66ffff">
                          </option>
                          <option style="background: #008800" value="#008800">
                          </option>
                          <option style="background: #002288" value="#002288">
                          </option>
                          <option style="background: #0088ff" value="#0088ff">
                          </option>
                          <option style="background: #00a010" value="#00a010">
                          </option>
                          <option style="background: #1100ff" value="#1100ff">
                          </option>
                          <option style="background: #3ec5e1" value="#3ec5e1">
                          </option>
                          <option style="background: #666666" value="#666666">
                          </option>
                          <option style="background: #50b000" value="#50b000">
                          </option>
                          <option style="background: #880000" value="#880000">
                          </option>
                          <option style="background: #8800ff" value="#8800ff">
                          </option>
                          <option style="background: #888800" value="#888800">
                          </option>
                          <option style="background: #888899" value="#888899">
                          </option>
                          <option style="background: #9999ff" value="#9999ff">
                          </option>
                          <option style="background: #aa00cc" value="#aa00cc">
                          </option>
                          <option style="background: #aaaa00" value="#aaaa00">
                          </option>
                          <option style="background: #ccaa00" value="#ccaa00">
                          </option>
                          <option style="background: #ab99aa" value="#ab99aa">
                          </option>
                          <option style="background: #ff0088" value="#ff0088">
                          </option>
                          <option style="background: #ff00ff" value="#ff00ff">
                          </option>
                          <option style="background: #ff8800" value="#ff8800">
                          </option>
                          <option style="background: #ff0005" value="#ff0005">
                          </option>
                          <option style="background: #ff88ff" value="#ff88ff">
                          </option>
                          <option style="background: #ee0005" value="#ee0005">
                          </option>
                          <option style="background: #ee01ff" value="#ee01ff">
                          </option>
                          <option style="background: #3388aa" value="#3388aa">
                          </option>
                          <option style="background: #000000" value="#000000">
                          </option>
                          </select></td>
    </tr>
    <tr>
      <td width="322" height="25" style="border-top-style: none; border-top-width: medium">
<p align="center"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<input type="submit" value="提交" name="B1" style="color: #000000; border: 0px solid #000000; background-color: #FFCC00"></td>
    </tr>
  </table>
  </form>
  </center>
</div>
             <div align="center">
               <center>
             <table cellspacing="0" width="419" style="border-collapse: collapse" cellpadding="0" border="0" background="img/bg.gif">
           
			  <tr>
              <td width="51" 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="175" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium"> 
                名称</td>

              <td style="border-bottom-style: none; border-bottom-width: medium" height="20"  valign="bottom" width="130" colspan="2" bgcolor="#FFCC00"> 
                <p align="center">操作</td>

              <td height="20"  valign="bottom" width="61" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium">
              <p align="center">显示颜色</td>

              <td height="20"  valign="bottom" width="45" bgcolor="#FFCC00" style="border-bottom-style: none; border-bottom-width: medium">
              <p align="center">排序</td>
             </tr>
             <%do while not rs.eof%>
			  <tr>
              <td width="50" 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="175"> 
              <p align="left"> 
              <font color="#FF0000"> 
              <%=rs("leixing")%></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="31"> 
              <p align="center"> 
              <font color="#800000"><span style="text-decoration: none"><a href="leixing.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="24"> 
              <p align="center"> 
              <font color="#800000"><span style="text-decoration: none"><a href="#" ONCLICK="window.open('leixingedit.asp?id=<%=rs("id")%>','Sample','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=325,height=150,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" bgcolor=<%=rs("lxcolor")%>>
               </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">
              <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()
leixing=trim(request("leixing"))
if leixing="" then
response.write "<li>错误,类别为空!"
response.write "<meta http-equiv=refresh content=""2;URL=leixing.asp"">"
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [leixing] where leixing='"&trim(request("leixing"))&"'"  
rs.open sql,conn,1,3
if rs.eof then
rs.addnew
rs("leixing")=trim(request("leixing"))
rs("paixu")=trim(request("paixu"))
rs("lxcolor")=trim(request("lxcolor"))
rs.update
response.write "<li>添加信息类型成功。"
response.write "<meta http-equiv=refresh content=""1;URL=leixing.asp"">"
rs.close
set rs=nothing
else
response.write "<li>错误,名称已经存在!"
rs.close
set rs=nothing
response.write "<meta http-equiv=refresh content=""2;URL=leixing.asp"">"
response.end
end if
end sub




sub del()
dim rs,sql,id,xinxiid,str2,i
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 id  from [xinxi] where leixing="&id&"  "
rs.open sql,conn,1,1
do while not rs.eof
xinxiid=xinxiid +","&rs("id")&""
rs.movenext
loop
rs.close

str2=split(xinxiid,",")
     
  
for i=1 to ubound(str2) 
    


     '删xinxi
     sql="delete from [xinxi] where id="&cint(str2(i))&"  " 
     rs.open sql,conn,1,3
     '删shoucang
     sql="delete from [shoucang] where scid="&cint(str2(i))&""
     rs.open sql,conn,1,3
     '删hf
     sql2="delete from [hf] where  xxid="&cint(str2(i))&""
     rs.open sql,conn,1,3
      next


'删leixing
sql="delete from [leixing] where id="&cstr(id)
rs.open sql,conn,1,3

response.write "<font size=2>删除信息种类成功!</font><br>"
response.write "<meta http-equiv=refresh content=""1;URL=leixing.asp"">"
end sub
closedb
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -