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

📄 typeedit_two.asp

📁 一个综合类整站
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%if session("china_admin")="" then
response.redirect "login.asp"
end if%>
<%dim action,id,dname
twoid=request.QueryString("twoid")
id=request.QueryString("id")
action=request.querystring("action")
dname=trim(request("name"))
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_type where id="&id&" and twoid=0",conn,1,3
mname=rs("name")
rs.close
set rs=nothing

select case action
case "add" 
set rs=server.CreateObject("adodb.recordset")
if dname<>"" then
rs.open "select * from china_type where id="&id&" and twoid<>0 and threeid=0 and name='"&dname&"'",conn,1,3
if rs.eof then
rs.close
rs.open "select * from china_type where id="&id&" order by twoid desc",conn,1,3
two=rs("twoid")+1
 rs.close
   rs.open "china_type",conn,1,3
rs.AddNew
rs("id")=id
rs("name")=dname
rs("indexid")=trim(request("indexid"))
rs("indexshow")=trim(request("indexshow"))
if request("colorshow")="1" then
rs("trcolor")="#ffe8e8"
rs("tdcolor")="#dd91a5"
rs("titlecolor")="#000000"
rs("telcolor")="#ff0000"
end if
if request("colorshow")="2" then
rs("trcolor")="#f7ffe1"
rs("tdcolor")="#92dcb9"
rs("titlecolor")="#ffffff"
rs("telcolor")="#246838"
end if
if request("colorshow")="3" then
rs("trcolor")="#e6faff"
rs("tdcolor")="#91b9dd"
rs("titlecolor")="#0066cc"
rs("telcolor")="#0066cc"
end if
if request("colorshow")="4" then
rs("trcolor")="#ffe1fb"
rs("tdcolor")="#b021c5"
rs("titlecolor")="#cc33cc"
rs("telcolor")="#990099"
end if
rs("twoid")=two
rs.Update
rs.Close
set rs=nothing
end if
end if
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_type where threeid=0 and twoid="&twoid&" and id="&id,conn,1,3
yname=rs("name")
rs("name")=dname
rs("indexid")=trim(request("indexid"))
rs("indexshow")=trim(request("indexshow"))
if request("colorshow")="1" then
rs("trcolor")="#ffe8e8"
rs("tdcolor")="#dd91a5"
rs("titlecolor")="#000000"
rs("telcolor")="#ff0000"
end if
if request("colorshow")="2" then
rs("trcolor")="#f7ffe1"
rs("tdcolor")="#92dcb9"
rs("titlecolor")="#ffffff"
rs("telcolor")="#246838"
end if
if request("colorshow")="3" then
rs("trcolor")="#e6faff"
rs("tdcolor")="#91b9dd"
rs("titlecolor")="#0066cc"
rs("telcolor")="#0066cc"
end if
if request("colorshow")="4" then
rs("trcolor")="#ffe1fb"
rs("tdcolor")="#b021c5"
rs("titlecolor")="#cc33cc"
rs("telcolor")="#990099"
end if
rs.Update
rs.Close
set rs=nothing
sql="update china_data set type_two='"&dname&"' where  type_oneid="&id&" and type_twoid="&twoid&" and type_threeid=0"
conn.execute sql


case "del"
set rs=server.CreateObject("adodb.recordset")
conn.execute ("delete from china_type where id="&id&" and twoid="&twoid&"")
sql="select * from china_data where type_oneid="&id&" and type_twoid="&twoid&""
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
Set fdel = CreateObject("Scripting.FileSystemObject")	
if not rs.eof then
 For iPage = 1 To rs.recordcount
 adid=rs("adid")
  pic=rs("pic")
rs.delete
rs.update
sql1="delete from china_message where adid ="&adid&""    
conn.execute(sql1)
rs.movenext     
   '''''''''''删除html开始''''''''''''''''
              tempImageDir = Server.MapPath("../html/"&adid&".htm")
	             fdel.DeleteFile(tempImageDir)
				 if pic<>"" and lcase(left(pic,7))<>"http://" then
				 fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
				 end if         
'''''''''''删除html结束'''''''''''''''
if rs.eof then exit for
next
set fdel=nothing
rs.close  
set rs=nothing                                 
end if
conn.close   
set conn=nothing
response.Redirect "typeedit_two.asp?id="&id&"" 
end select
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>分类管理</title>
</head>

<body background="images/background.gif">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
  <tr> 
    <td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">二&nbsp;级&nbsp;分 类 栏&nbsp;目&nbsp;管 理</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF"> &nbsp;[<a href="typeedit.asp">首页</a>]-&gt;<%=mname%><br>
	<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="30">编号</td>
          <td>分类名称</td>
          <td>显示顺序</td>
          <td>首页显示</td>
		  <td>首页配色</td>
          <td>管理操作</td>
        </tr>
        <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from china_type where id="&id&" and twoid<>0 and threeid=0 order by twoid",conn,1,1
		  dim follows
		  if rs.EOF and rs.BOF then
          response.write"<tr bgcolor=#FFFFFF><td colspan='6'><p align='center'><font color='red'>暂无分类!</font></td></tr></table><br>"
		  follows=0
		  else
		  do while not rs.EOF
		  i=i+1
		  %>
        <form name="form1" method="post" action="typeedit_two.asp?action=edit&id=<%=int(rs("id"))%>&twoid=<%=int(rs("twoid"))%>">
          <tr bgcolor="#FFFFFF" align="center">
		  <td><%=i%></td>
            <td><input name="name" type="text" size="12" value="<%=trim(rs("name"))%>">
            &nbsp;[<a href="typeedit_three.asp?id=<%=rs("id")%>&twoid=<%=rs("twoid")%>">子目录</a>]</td>
            <td><input name="indexid" type="text" size="2" value="<%=trim(rs("indexid"))%>"></td>
            <td><select name="indexshow">
<option value="yes" <%if rs("indexshow")="yes" then%>selected<%end if%>>显示</option>
<option value="no" <%if rs("indexshow")="no" then%>selected<%end if%>>隐藏</option>
                    </select></td>
            <td><select name="colorshow">
<option value="1" <%if rs("trcolor")="#ffe8e8" then%>selected<%end if%> style="COLOR:#000000;BACKGROUND-COLOR:#ffe8e8;">配色1</option>
<option value="2" <%if rs("trcolor")="#f7ffe1" then%>selected<%end if%> style="COLOR:#ffffff;BACKGROUND-COLOR:#f7ffe1;">配色2</option>
<option value="3" <%if rs("trcolor")="#e6faff" then%>selected<%end if%> style="COLOR:#0066cc;BACKGROUND-COLOR:#e6faff;">配色3</option>
<option value="4" <%if rs("trcolor")="#ffe1fb" then%>selected<%end if%> style="COLOR:#cc33cc;BACKGROUND-COLOR:#ffe1fb;">配色4</option>
                    </select></td>
            <td><input type="submit" name="Submit" value="修 改">
                &nbsp; <input type="button" name="DEL" onclick="{if(confirm('确定要删除这个分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?name=<%=rs("name")%>&action=del&id=<%=rs("id")%>&twoid=<%=rs("twoid")%>';}return false;}" value="删除" >
            </td>
          </tr>
        </form>
        <%
		rs.MoveNext
          loop
          follows=rs.RecordCount
          end if%>
      </table>
	<br></td>
  </tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
  <tr> 
    <td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">添 加 二&nbsp;级&nbsp;分 类 名 称</font></td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">
	<br>
	<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
          <td width="30">编号 </td>
          <td>分类名称</td>
          <td>显示顺序</td>
          <td>首页显示</td>
          <td>首页配色</td>
          <td>确定操作</td>
        </tr>
        <form name="form1" method="post" action="typeedit_two.asp?action=add&id=<%=id%>">
          <tr align="center" bgcolor="#FFFFFF"> 
            <td><%=rs.RecordCount+1%></td>
	        <td><input name="name" type="text" id="name" size="12"></td>
	        <td><input name="indexid" type="text" value="0" size="2"></td>
	        <td><select name="indexshow">
                <option value="yes">显示</option>
                <option value="no" selected>隐藏</option>
              </select></td>
	        <td><select name="colorshow">
                <option value="1" selected style="COLOR:#000000;BACKGROUND-COLOR:#ffe8e8;">配色1</option>
                <option value="2" style="COLOR:#ffffff;BACKGROUND-COLOR:#f7ffe1;">配色2</option>
                <option value="3" style="COLOR:#0066cc;BACKGROUND-COLOR:#e6faff;">配色3</option>
                <option value="4" style="COLOR:#cc33cc;BACKGROUND-COLOR:#ffe1fb;">配色4</option>
            </select></td>
	        <td><input type="submit" name="Submit3" value="添 加"></td>
          </tr>
        </form>
      </table>
	<br></td>
  </tr>
</table>
</body>                                                                                                                          
                                                                                                                          
</html>  

⌨️ 快捷键说明

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