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

📄 edit.asp

📁 信息管理系统!很简单的课程设计!类似于城市信息交换的网站!
💻 ASP
字号:
<%

if session("admin_login")<>true then
	response.Write("<html><link href=../style.css rel=stylesheet type=text/css><body><table height=100% width=100% align=center valign=middle><tr><td align=center valign=center><p align=center>您没有登录或者已经超时!!请点击下面的链接,进入登录界面!!</p><p align=center>--&gt;&gt; <a href=../login/login.asp>登录</a> &lt;&lt;--</p></td></tr></table></body></html>")
	response.end
end if
%>

<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/fun.asp"-->
<!--#include file="../../conn/fso.asp"-->
<%
action = request("action")
select case action
	case "change"
		fl_name = trim(request("fl_name"))
		fl_lb = trim(request("fl_lb"))
		fl_id = clng(trim(request("fl_id")))
		select case fl_lb
			case "寻房问屋"
				lbid="1"
			case "跳蚤市场"
				lbid="2"
			case "乐翻天"
				lbid="3"
			case "教育培训"
				lbid="4"
			case "求职招聘"
				lbid="5"
			case "交友约会"
				lbid="6"
			case "综合服务"
				lbid="7"
			case "其他分类"
				lbid="8"
		end select
	
		set rs = server.CreateObject("adodb.recordset")
		SQL = "select * from ad_fl where fl_name='"&fl_name&"' and fl_lb='"&fl_lb&"' and fl_id<>"&fl_id
		rs.open SQL,conn,1,1
		if rs.eof and rs.bof then
			conn.execute("update ad_fl set fl_name='"&fl_name&"',fl_lb='"&fl_lb&"',lbid='"&lbid&"' where fl_id="&fl_id)
			rs.close
			set rs = nothing
			call MakeDaXiao()	
			conn.close
			set conn = nothing
			Response.Write("<script>window.alert(""修改成功!!"");window.opener.location='ad_fl.asp';window.close();</script>")
		else
			response.write("<script>window.alert(""该类别已经存在,请重新选择!!"");history.back();</script>")
			rs.close
			set rs = nothing
			conn.close
			set conn = nothing
			response.end()
		end if
	case "del"
		fl_id = clng(trim(request("fl_id")))
		SQL = "delete from ad_fl where fl_id="&fl_id
		conn.execute(SQL)
		conn.execute("delete from ad_mes where ad_xlb="&fl_id)
		call MakeDaXiao	
		Response.Write("<script>window.alert(""删除成功!!"");window.opener.location='ad_fl.asp';window.close();</script>")
end select

fl_id = clng(trim(request.QueryString("fl_id")))
set rs = conn.execute("select * from ad_fl where fl_id="&fl_id)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet" type="text/css">
<title>修改类别信息</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<script language="javascript">
function delthis()
{
	if(window.confirm("您确实要删除该类别吗?"))
	{
		window.location.href='?action=del&fl_id=<%=rs("fl_id")%>'
	}
}

function check()
{
	if(document.form1.fl_name.value=='')
	{
		alert("请输入小类别名称!!");
		return false;
		document.form1.fl_name.focus();
	}
}
</script>
<body>
<form name="form1" method="post" action="?action=change" onSubmit="return check()">
		<table width="100%" height="100%"  border="0" cellpadding="4" cellspacing="0">
        		<tr>
        				<td width="33%" align="center">小类别名称:</td>
        				<td width="67%"><input name="fl_name" type="text" class="txttable" value="<%=rs("fl_name")%>">
   						<input name="fl_id" type="hidden" value="<%=rs("fl_id")%>"></td>
   				</tr>
        		<tr>
        				<td align="center">大类别名称:</td>
        				<td><select name="fl_lb">
                        		<%
						fl_lb = rs("fl_lb")
						%>
                        		<option value="寻房问屋" <%if fl_lb="寻房问屋" then response.write("selected")%>>寻房问屋</option>
                        		<option value="跳蚤市场" <%if fl_lb="跳蚤市场" then response.write("selected")%>>跳蚤市场</option>
                        		<option value="乐翻天" <%if fl_lb="乐翻天" then response.write("selected")%>>乐翻天</option>
                        		<option value="教育培训" <%if fl_lb="教育培训" then response.write("selected")%>>教育培训</option>
                        		<option value="求职招聘" <%if fl_lb="求职招聘" then response.write("selected")%>>求职招聘</option>
                        		<option value="交友约会" <%if fl_lb="交友约会" then response.write("selected")%>>交友约会</option>
                        		<option value="综合服务" <%if fl_lb="综合服务" then response.write("selected")%>>综合服务</option>
                        		<option value="其他分类" <%if fl_lb="其他分类" then response.write("selected")%>>其他分类</option>
                        		</select></td>
        		</tr>
        		<tr>
        				<td colspan="2" align="center"><input name="Submit" type="submit" class="button01" value="修改"> 
   						<input name="Submit2" type="button" class="button01" value="删除" onClick="delthis()"> 
   						<input name="Submit3" type="button" class="button01" value="关闭" onclick="window.close();"></td>
   				</tr>
   		</table>
</form>
</body>
</html>
<%
rs.close
set rs = nothing
conn.close
set conn = nothing
%>

⌨️ 快捷键说明

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