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

📄 admtype.asp

📁 8款下载系统源代码 2003-3-11 21:37:45 433 949k · 都很常见: 猛虎山庄、燕衔泥(飞扬的软件第二版用的就是他
💻 ASP
字号:
<!--#include file="admcheck.asp"-->
<!--#include file="dbpath.asp"-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css"><!--
td       {font-size: 9pt;line-height: 13pt}
a:link   {color:#0000FF ;text-decoration:none}
a:visited{color:#0000FF ;text-decoration:none}
a:hover  {color: #FF0000;text-decoration:underline}
--></style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
'### 增加分类 #######################
if request("type")="add" then
if request("add")="" then
    response.write("<script>alert('请填写要增加的分类!');history.go(-1)</script>")
    response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from type where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("type")=request("add")
rs.update
rs.close
end if
'### 修改分类 #######################
if request("type")="edit" then
  if request("edit")="" then
  response.write("<script>alert('分类名不能为空!');history.go(-1)</script>")
  response.end
  end if
set rs=server.createobject("adodb.recordset")
sql="select * from type where id="&request("id")
rs.open sql,conn,1,3
rs("type")=request("edit")
rs.Update
rs.close 
set rs=nothing
sql="select * from down where type='"&request("old_type")&"'"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,3
do while not rs.eof
rs("type")=request("edit")
rs.update
rs.movenext
loop
end if
'### 删除分类#################
if request("type")="del" then
sql="delete from type where type='"&request("tid")&"'"
conn.execute sql
sqld="delete from down where type='"&request("tid")&"'"
conn.execute sqld
end if
%> 
<table border="0" width="100%" bgcolor="#EFEFEF" cellspacing="1">
  <tr>
    <td width="50%"><a href="admlist.asp">源码下载</a>>> 栏目管理</td>  
  </tr> 
  <tr> 
    <td width="50%" bgcolor="#FFFFFF" valign="top">  
<table border="0" width="100%" cellspacing="0" cellpadding="0">                                                                                                                                                                                                                                                                                                                                                                             
 <tr>                                                                                                                                                                                                              
    <td width="236">                                                                                                                                                                                                              
    </td>                                                                                                                                                                                                                 
 </tr> 
<form action="admtype.asp?type=add" method=post>                                                                                                                                                                                                             
  <tr>                                                                                                                                                                                                             
    <td width="236"><b>增加类别:</b><input name="add" size="13">                                                                                                                                                                                                                 
  <input name="Submit2" type="submit" value="增加">                                                                                                                                                                                                                                                                                                                      
    </td>                                                                                                                                                                                                                   
  </tr> 
 </form>                                                                                                                                                                                                               
 <tr>                                                                                                                                                                                                               
    <td width="236">                                                                                                                                                                                                               
    </td>                                                                                                                                                                                                                  
 </tr>                                                                                                                                                                                                              
<tr>                                                                                                                                                                                                               
    <td width="236"><b>增加类别:</b></td>                                                                                                                                                                                                                 
</tr>                                                                                                                                                                                      
<%sql_type="select * from type" 
Set rs_type= Server.CreateObject("ADODB.Recordset") 
rs_type.open sql_type,conn,1,1 
 
if rs_type.eof then%> 
<tr>                                                                              
    <td width="100%">没有类别</td>                                                                                                                                                                                                                             
 </tr> 
<%else 
do while not rs_type.eof%> 
<tr><form action="admtype.asp?type=edit&old_type=<%=rs_type("type")%>&id=<%=rs_type("id")%>" method=post>                                                                              
    <td width="100%"><input name="edit" size="13" value="<%=rs_type("type")%>">                                                                                                                                                                                                               
  <input type="submit" value="修改">&nbsp;(<%                                
set rs_c=server.createobject("adodb.recordset") 
sql_c="select * from down where type='"&rs_type("type")&"'" 
rs_c.open sql_c,conn,1,1 
%>                            
<%if not rs_c.eof then%><%=rs_c.recordcount%><%else%>0<%end if%>个程序)&nbsp;&nbsp;&nbsp; 
      <a href="admtype.asp?type=del&tid=<%=rs_type("type")%>"><font color="#FF0000">删除</font></a><font color="#FF0000"> 
      </font>(删除分类将会同时删除所属分类下的程序!) </td></form>                                                                                                                                                                                                                             
 </tr> 
<%rs_type.movenext                                                                                                  
loop%> 
 <%end if%> 
 <tr>                                                                                                                                                                
    <td width="236">                                                                                                                                                                                                                    
  </td>                                                                                                                                                                                                                     
 </tr>      
</table>      
</td>
  </tr> 
</table> 
<%rs_type.close  
set rs_type=nothing                              
conn.close                              
set conn=nothing%>                        
</body></html>





⌨️ 快捷键说明

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