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

📄 channelmanage.asp

📁 这个就是受到众人喜爱的许愿墙了
💻 ASP
字号:
<%
option explicit
response.buffer=true
Dim Rs,Sql,action,ErrMsg,channelid,channelname,channelinfo,classid
%>
<!--#include file="inc/conn.asp"-->
<html>
<head>
<title>通用信息采集系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
<!--
.STYLE1 {
	color: #000000;
	font-weight: bold;
}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr> 
    <th height="22" colspan="2" align="center"><span class="STYLE1">本 地 数 据 分 类 管 理</span></th>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
  <tr> 
    <td width="65" height="30"><strong>管理导航:</strong></td>
    <td height="30"><a href="channelmanage.asp">管理首页</a> 
	| <a href="channelmanage.asp?action=add">添加新频道</a></td>
  </tr>
</table>
<br>
<% 
action =request("action")
select case action
case "del"
		channelid=request("channelid")
		if channelid <> "" then
			sql = "delete from channel where channelid=" & channelid 
			Conn.execute(sql)
			response.redirect("channelmanage.asp")
			response.end
		end if	
case "edit"
	if request("editok")<>"" and request("editok")<>0 then
		if request.form("ChannelName")="" or request.form("ChannelInfo")="" then
			ErrMsg="<font color=red>请填写完整!</font>"
		else
			sql = "update Channel set ChannelName='" & request.form("ChannelName") & "',ChannelInfo='" & request.form(	"ChannelInfo") &"' where ChannelID=" & request.form("ChannelID")
			conn.execute(sql)
			Call CloseConn()
			Call CloseConnHistroy()
			response.redirect("channelmanage.asp")
			response.end
		end if	
		call edit()
	else
		call edit()
	end if
case "add"
	if request("addok")<>"" and request("addok")<>0 then
		if request.form("ChannelName")="" or request.form("channelinfo")="" then
			ErrMsg="<font color=red>请填写完整!</font>"
		else
			sql = "insert into Channel (ChannelName,channelinfo) values ('" & request.form("ChannelName") & "','" & request.form("channelinfo") &"')"
			conn.execute(sql)
			Call CloseConn()
			Call CloseConnHistroy()
			response.redirect("channelmanage.asp")
			response.end
		end if
		call add()
	else
		call add()
	end if
case else
	call main()
end select

sub main()
 %>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
    <tr>
      <td height="22" colspan="2" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
        <TR>
		  <TD width="20%" height=22  align=center bgcolor="#F2F2F2">编号</TD>
          <TD width="30%" height=22  align=center bgcolor="#F2F2F2">频道(点击进入栏目管理)</TD>
          <TD width="40%" height=22  align=center bgcolor="#F2F2F2">说明</TD>
          <TD width="10%" height=22  align=center bgcolor="#F2F2F2">操作</TD>
        </TR>
<%   
set Rs=server.createobject("adodb.recordset")         
Sql="select * from Channel order by ChannelID DESC"         
Rs.open Sql,Conn,1,1
do while not rs.eof
%>
        <TR class="tdbg">
          <TD class=tdbg width="20%" height=22  align=center>
            <%=rs("ChannelID")%></TD>
          <TD class=tdbg width="30%" height=22  align=center>
            <A href=classmanage.asp?channelid=<%=rs("ChannelID")%>><%=rs("ChannelName")%></a></TD>
          <TD class=tdbg width="40%" height=22  align=center>
            <%=rs("ChannelInfo")%></TD>
          <TD class=tdbg width="10%" height=22  align=center>
            <a href=channelmanage.asp?action=edit&ChannelID=<%=rs("ChannelID")%>>修改</a> <a href=channelmanage.asp?action=del&channelid=<%=rs("ChannelID")%>>删除</a></TD>
           </TR>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</TABLE>
<% end sub %>
<% sub add() %>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><b></b></div></td>
    </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
    <TR> 
      <TD height=22  align=center >请输入以下项目</TD>
    </TR>
</TABLE>
  <form name="myform" method="POST" action="?action=add&addok=1">
<div align="center"> 
	<%=ErrMsg%>
  <p>频道名称:<strong>
    <input name="ChannelName" type="text" size="50" maxlength="50">
    </strong></p>
  <p>频道说明: 
    <input name="ChannelInfo" type="text" size="50" maxlength="250">
  </p>
  <p> 
    <input name="action" type="submit" id="action" value="添加">&nbsp;&nbsp;
    <input name="action" type="reset" id="action" value="返回">
  </p>
</div>
  </form>
<% end sub %>
<% sub edit
		set Rs=server.createobject("adodb.recordset")         
		Sql="select * from channel where channelID=" & request("channelID") 
		Rs.open Sql,Conn,1,1
		ChannelID= request("channelID")  
		channelname=rs("channelName")
		channelinfo=rs("channelinfo")
		rs.close
		set rs=nothing
%>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="border" >
    <tr> 
      <td height="22" colspan="2" class="title"> <div align="center"><b></b></div></td>
    </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
    <TR> 
      <TD height=22  align=center>请修改以下项目</TD>
    </TR>
</TABLE>
  <form name="myform" method="POST" action="?action=edit&editok=1">
<div align="center"> <%=ErrMsg%>
	<input name="ChannelID" type="hidden" size="50" maxlength="50" value="<%=ChannelID%>">
  <p>栏目名称:<strong>
    <input name="channelname" type="text" size="50" maxlength="50" value="<%=channelname%>">
    </strong></p>
  <p>栏目说明: 
    <input name="channelinfo" type="text" size="50" maxlength="250" value="<%=channelinfo%>">
  </p>
  <p> 
    <input name="action" type="submit" id="action" value="确认修改">&nbsp;&nbsp;
    <input name="action" type="submit" id="action" value="返回">
  </p>
</div>
  </form>
<% end sub %>
</body>
</html>
<%
Call CloseConn()
Call CloseConnHistroy()
%>

⌨️ 快捷键说明

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