📄 limit_mod.asp
字号:
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<%
response.Clear()
id=testdb(request.QueryString("id"))
ManagerName=testdb(request.querystring("ManagerName"))
if session("LoginType")<>"系统管理员" then
response.write("<script>alert('对不起,只有系统管理员才有此权限!');window.history.back();</script>")
response.end
end if
myActionStr="添加"
if id<>"" then
usql="select * from limit where id="&id
set urs=server.CreateObject("adodb.recordset")
urs.open usql,conn,1,1
if not urs.eof then
id=urs("id")
ManagerName=urs("ManagerName")
ManagerType=urs("ManagerType")
limit=urs("limit")
Pasd=urs("Pasd")
updatetime=now()
end if
urs.close
set urs=nothing
myActionStr="更新"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理机票系统</title>
<link href="include/css.css" rel="stylesheet" type="text/css">
</head>
<SCRIPT language=javascript>
<!--
function checkinput()
{
if (ZXLform.ManagerName.value=="")
{
alert("管理员名称不能为空!");
ZXLform.ManagerName.focus();
return false;
}
if (ZXLform.Pasd.value=="")
{
alert("管理员密码不能为空!");
ZXLform.Pasd.focus();
return false;
}
return true;
//-->
}
</SCRIPT>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<table width="770" height="203" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<TABLE width=100% border=0 align="center" cellPadding=0 cellSpacing=1 bgcolor="#999999" id=TABLE1 style="FONT-SIZE: 9pt">
<form name="ZXLform" action="limit_mod.asp" method="post" onsubmit="return checkinput();">
<TR bgColor=#C3E7F9>
<TH width="177" height="30" bgcolor="#C3E7F9">管理员名</TH>
<TH width="120" height="30"> 管理员类型</TH>
<TH width="132">密码</TH>
<TH width="170">更新时间</TH>
</TR>
<TR bgcolor="#FFFFFF" >
<TD height="25" align=center>
<%if id="" then%>
<input type="hidden" name="MyAction" value="AddNew">
<%end if%>
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="myActionStr" value="<%=myActionStr%>">
<input name="ManagerName" type="text" id="ManagerName" value="<%=ManagerName%>" size="12" maxlength="12"> </TD>
<TD height="25"><div align="center">
<%if id=6 then%>
<font color='red'>系统管理员</font>
<%else%>
<select name="ManagerType">
<option value="超级管理员" <%if ManagerType="超级管理员" then response.write "selected"%>>超级管理员</option>
<option value="一般管理员" <%if ManagerType="一般管理员" then response.write "selected"%>>一般管理员</option>
</select>
<%end if%>
</div> </TD>
<TD height="25" align="center"><input name="Pasd" type="password" id="Pasd" value="<%=Pasd%>" size="15" maxlength="15"></TD>
<TD height="25" nowrap><div align="center">
<%if id<>"" then%>
<%=Updatetime%>
<input name="Updatetime" type="hidden" value="<%=Updatetime%>" size="10">
<%else%>
<%=date()%>
<input name="Updatetime" type="hidden" value="<%=date()%>" size="10">
<%end if%>
</div></TD>
</TR>
<TR align="center" bgcolor="#C3E7F9" >
<TD height="25" colspan="4"><strong>栏目权限配置</strong></TD>
</TR>
<TR bgcolor="#FFFFFF" >
<TD height="25" colspan="4">
<input name="limit" type="checkbox" id="limit" value="1" <%if instr(limit,"1")>0 then response.write "checked"%>>
航空公司
<input name="limit" type="checkbox" id="limit" value="2" <%if instr(limit,"2")>0 then response.write "checked"%>>
航空城市
<input name="limit" type="checkbox" id="limit" value="3" <%if instr(limit,"3")>0 then response.write "checked"%>>
运价管理
<input name="limit" type="checkbox" id="limit" value="4" <%if instr(limit,"4")>0 then response.write "checked"%>>
常规航位
<input name="limit" type="checkbox" id="limit" value="5" <%if instr(limit,"5")>0 then response.write "checked"%>>
特价(静态)
<input name="limit" type="checkbox" id="limit" value="6" <%if instr(limit,"6")>0 then response.write "checked"%>>
特价(动态)<br>
<input name="limit" type="checkbox" id="limit" value="7" <%if instr(limit,"7")>0 then response.write "checked"%>>
假位管理
<input name="limit" type="checkbox" id="limit" value="8" <%if instr(limit,"8")>0 then response.write "checked"%>>
机型</TD>
</TR>
<TR bgColor=#EEEEEE>
<TH height="30" colspan="5">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="48%" height="25" align="right">
<input type="submit" name="AddNow" value="确认">
<input type="button" value="返回" name="CancelRow" onClick="javascript:window.location.href='limit.asp';">
</td>
</tr>
</table></TH>
</TR>
</form>
</TABLE></td>
</tr>
</table>
</body>
</html>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
set rs=server.createobject("adodb.recordset")
MyAction=request.form("MyAction")'标志变量,判断是更新还是添加
myActionStr=request.form("myActionStr")
id=request.form("id")
ManagerName=request.form("ManagerName")
ManagerType=request.form("ManagerType")
Pasd=request.form("Pasd")
limit=request.form("limit")
updatetime=request.form("updatetime")
'----------------执行更行
if MyAction<>"AddNew" then
'if id=6 then
'response.write("<script>alert('对不起,此管理员不能被修改');window.history.back();<script>")
'response.end
'end if
sql="select * from limit where id="&id
rs.open sql,conn,1,3
rs("ManagerName")=ManagerName
rs("ManagerType")=ManagerType
rs("Pasd")=Pasd
if id=6 then
rs("limit")=limit
end if
rs("updatetime")=updatetime
rs.update
else
sql="select * from limit"
rs.open sql,conn,1,3
rs.addnew
rs("ManagerName")=ManagerName
rs("ManagerType")=ManagerType
rs("limit")=limit
rs("Pasd")=Pasd
rs("updatetime")=updatetime
rs.update
end if
rs.close:set rs=nothing
response.write"<script language=javascript>alert('记录已经"&myActionStr&"成功!\n');window.location.href='limit.asp';</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -