📄 limit.asp
字号:
<!--#include file="include/conn.asp"-->
<%
if trim(request("action"))="delete" then
if trim(session("LoginType"))="系统管理员" then
k=request("deleteid")
deleteid=split(request("deleteid"))
for i=0 to ubound(deleteid)
deleteid(i)=replace(deleteid(i),",","")
if deleteid(i)=6 then
response.write("<script>alert('对不起,此管理员不能被删除');window.history.back();</script>")
response.end
end if
sql="delete from Limit where id = "&deleteid(i)
conn.execute(sql)
next
action=""
msg_ok="群组删除成功!id共"&i&"个,分别是"&k
else
response.write("<script>alert('对不起,只有系统理员才有此权限');window.history.back();</script>")
response.end
end if
end if
'-----------------以上是册除代码
%>
<%
SearchFiled=request("SearchFiled")
SearchKey1=request("SearchKey1")
'----------------以上是搜索代码
%>
<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>
function call(){
//添加记录或修改记录时所跳转的页面
window.location.href="limit_mod.asp";
return false;
}
function dele(){
//删除记录所用的函数
if(!confirm('已经确认需要删除选中的信息吗?')) return false;
ZXLform.submit();
}
function sltall(){
var nn=self.document.all.item("deleteid");
for(j=0;j<nn.length;j++){
self.document.all.item("deleteid",j).checked=true;
}
}
function escall(){
var nn=self.document.all.item("deleteid");
for(j=0;j<nn.length;j++){
self.document.all.item("deleteid",j).checked=false;
}
}
function CheckSearchForm()
{
//检索记录所用的验证函数
if(FrmSearch.SearchFiled.value=="ManagerName" || FrmSearch.SearchFiled.value=="ManagerType"){
if(FrmSearch.SearchKey1.value==""){
alert('对不起,搜索内容不能为空,请重新填写');
return false;
}
}
}
</script>
<body>
<TABLE cellPadding=0 cellSpacing="1" >
<form name="FrmSearch" action="limit.asp" method="post">
<TR align="left" bgColor=#C3E7F9>
<td height="30" colspan="4"> 检索: <select name="SearchFiled">
<option value="ManagerName">按姓名</option>
<option value="ManagerType">按管理员类型</option>
</select>
<input type="text" style="width:100px" name="SearchKey1" value='<%=SearchKey1%>'>
<input name="Submit" type="submit" value="搜索"></td>
</TR>
</form>
<form name="ZXLform" action="limit.asp" method="post">
<TR bgColor="#C3E7F9">
<TH width="94" height="30"> 管理员名 </TH>
<TH>管理员类型 </TH>
<TH width="421">管理员权限</TH>
<TH>操作</TH>
</TR>
<%
dim szSQL
set oRst=Server.CreateObject("AdoDb.recordset")
szSQL="select * from limit order by id desc"
if SearchFiled="ManagerName" and SearchKey1<>"" then
szSQL="select * from limit where ManagerName like '%"&SearchKey1&"%' order by id desc"
end if
if SearchFiled="ManagerType" and SearchKey1<>"" then
szSQL="select * from limit where ManagerType like '%"&SearchKey1&"%' order by id desc"
end if
'----------------以上是搜索代码
oRst.Open szSQL,conn,1,1
'--------------------分页
if oRst.eof then
response.write("当前没有记录,请单击<a href=limit_mod.asp>[添加]</a>")
response.end
else
if request.QueryString("pageno")="" then
pageno=1
else
pageno=cint(request.QueryString("pageno"))
end if
recordcounts=oRst.recordcount
pagesiz=15
oRst.pagesize=15
pagecounts=oRst.pagecount
if pageno<1 then
pageno=1
end if
if pageno>pagecounts-1 then
pageno=pagecounts
end if
oRst.absolutepage=pageno
i=0
while not oRst.eof and pagesiz>0
i=i+1
bc="bgcolor='#eff3f7'"
if i mod 2=0 then bc="bgcolor='#FFFFFF'"
id=oRst("id")
ManagerName=oRst("ManagerName")
ManagerType=oRst("ManagerType")
limit=oRst("limit")
times=oRst("times")
IpAddress=oRst("IpAddress")
%>
<TR <%=bc%> >
<TD height="25" align=center><a href="limit_mod.asp?id=<%=id%>"><%=ManagerName%></a> </TD>
<TD width="94" height="25" align="center" style="padding-left:3px"><%=ManagerType%></TD>
<TD height="25" nowrap><%
if instr(limit,"1")>0 then
response.write "航空公司"
end if
if instr(limit,"2")>0 then
response.write " 航空城市"
end if
if instr(limit,"3")>0 then
response.write " 运价管理"
end if
if instr(limit,"4")>0 then
response.write " 常规航位"
end if
if instr(limit,"5")>0 then
response.write " 特价(静态)"
end if
if instr(limit,"6")>0 then
response.write " 特价(动态)"
end if
if instr(limit,"7")>0 then
response.write " 假位管理"
end if
if instr(limit,"8")>0 then
response.write " 机型"
end if
%></TD>
<TD width="50" align="center"><input name="deleteid" type="checkbox" id="deleteid" value="<%=id%>">
</TD>
</TR>
<%
oRst.MoveNext
pagesiz=pagesiz-1
wend
end if
%>
<TR bgColor=#EEEEEE>
<TD height="30" colspan="5">
<input type="button" name="AddnewBunk" onClick="javascript:call();" value="添加管理员">
<input type="hidden" name="action" value="delete">
<input name="button" type="button" onClick="return dele()" value="删除">
<a href onClick="sltall()" onMouseDown="sltall()">全选</a><a href onClick="escall()" onMouseDown="escall()">/全不选</a> 共有<span style="color:red;"><%=recordcounts%></span>条;每页显示<font style="color:red;">15</font>条;转到第
<select name="select" id="pa" onChange="window.location.href='limit.asp?SearchFiled=<%=SearchFiled%>&SearchKey1=<%=SearchKey1%>&pageno='+document.all.pa.value;">
<% for i=1 to pagecounts
if i=pageno then
response.write("<option value="&i&" selected>"&i&"</option>")
else
response.write("<option value="&i&">"&i&"</option>")
end if
next
%>
</select>
页</TD>
</TR>
</form>
</TABLE>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -