?? sysadmin.asp
字號:
<!--#include file="Conn.asp"-->
<!--#include file="Inc/CheckUser.asp"-->
<%if Session("Admin") = false then Response.end%>
<HTML>
<HEAD>
<title>工程學院教學管理系統 —— 用戶管理 —— 系統設置 </title>
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<LINK href="Style/style.css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="Jscript/function.js"></script>
</HEAD>
<body background="Images/bg.jpg" topmargin="0" leftmargin="0">
<table class="borderon" id="control" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr align="center">
<td height="20" width="100"></td>
<td class="tbutton" onclick="javascript:location.href='?action=add';">添加系統設置</td>
<td class="tbutton" onclick="javascript:location.href='?action=list';">系統設置列表</td>
<td width="100"></td>
</table>
<form name="index" method="post" action="?action=save" ID="Form1">
<%
dim action,iyear
action = Request.QueryString("action")
select case action
case "list"
call list()
case "add"
call add()
case "change"
call change()
case "save"
call save()
case else
call list()
end select
'學習簡歷列表
sub list()
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "Select * From [config]"
rs.Open sql,conn,1,1
dim i,j
dim page,pagecount,show_str,total,content
%>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" ID="Table1">
<tr>
<td vAlign="top" height="30">
<ol style="line-height:150%">
<li>
管理系統配置的資料</li>
</td>
</tr>
</table>
<input type="hidden" name="act" value="delete" ID="Hidden1">
<table width="95%" border="0" cellpadding="3" cellspacing="1" bgcolor="#000000" align="center" ID="Table2">
<tr>
<td bgcolor="#99A6BF"></td>
<td bgcolor="#99A6BF">
<b>系統配置名</b></td>
<td bgcolor="#99A6BF">
<b>禁止訪問的IP</b></td>
<td bgcolor="#99A6BF">
<b>允許訪問的IP段</b></td>
<td bgcolor="#99A6BF">
<b>是否開發搜索</b></td>
<td bgcolor="#99A6BF">
<b>是否開放系統</b></td>
<td bgcolor="#99A6BF">
<b>管 理</b></td>
</tr>
<%
if rs.BOF or rs.EOF then
total=0
page=0
pagecount=0
for j = 1 to 10
%>
<tr bgcolor="<%=TableBodyColor%>">
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<%
next
else
i = 0
total = rs.RecordCount
rs.pagesize = 10
if request("page") = "" then
page = 1
else
page = request("page")
end if
rs.AbsolutePage = page
pagecount = rs.pagecount
if int(page) >= int(rs.pagecount) then
page = rs.pagecount
end if
if page = 1 then
show_str = ""
else
show_str = " <a href=?page="&page-1&"&action=list>上一頁</a> "
end if
if int(page) >= int(rs.pagecount) then
show_str = show_str&""
else
show_str = show_str&" <a href=?page="&page+1&"&action=list>下一頁</a> "
end if
do while not(rs.EOF or rs.BOF)
%>
<tr bgcolor="<%=TableBodyColor%>" onMouseOver="this.style.backgroundColor='#ffffff'; " onMouseOut="this.style.backgroundColor='';">
<td bgcolor="#FFFFFF">
<input type="checkbox" name="delid" value="<%=rs("id")%>" ID="Checkbox1">
</td>
<td bgcolor="#FFFFFF">
<%=rs("name")%> <%if rs("nowused") = 1 then Response.Write "<font color=red>(默)</font>"%>
</td>
<td bgcolor="#FFFFFF">
<%=rs("refuseIP")%>
</td>
<td bgcolor="#FFFFFF">
<%=rs("refuseIPsect")%>
</td>
<td align="center" bgcolor="#FFFFFF">
<%if rs("isSearch") = 1 then:Response.Write "<font color=red>是</font>":else:Response.Write "否":end if %>
</td>
<td align="center" bgcolor="#FFFFFF">
<%if rs("isOpen") = 1 then:Response.Write "<font color=red>是</font>":else:Response.Write "否":end if %>
</td>
<td align="center" bgcolor="#FFFFFF">
<a href="?action=change&id=<%=rs("id")%>">修改</a></td>
</tr>
<%
i = i + 1
if i = rs.pagesize then exit do
rs.MoveNext
loop
if i < 10 then
for j = 1 to (10 - i)
%>
<tr bgcolor="<%=TableBodyColor%>">
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<%
next
end if
%>
<tr bgcolor="<%=TableLeftColor%>">
<td colspan="9" bgcolor="#FFFFFF">
<table cellSpacing="0" cellPadding="0" border="0" height="80%" width="100%" ID="Table3">
<tr>
<td>
<input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)" ID="chkall"><label for="chkall">選中所有顯示配置</label>
<input type="submit" name="del" value="刪除選中的配置方案" ID="Submit1">
</td>
<td>
每頁顯示
<%=rs.PageSize%>
個配置方案, 共 <font color="red"><b>
<%=page%>
</b></font>/<%=pagecount%>
頁, 共有 <font color="red"><b>
<%=total%>
</b></font>個配置方案,
<%=show_str%>
</td>
</tr>
</table>
</td>
</tr>
<%
end if
%>
</table>
<%
rs.Close()
end sub
'添加學習簡歷
sub add()
%>
<table cellSpacing="0" cellPadding="0" border="0" height="80%" width="100%" ID="Table4">
<tr>
<td vAlign="top" height="50">
<ol style="line-height:150%">
<li>
添加系統配置信息</li>
</td>
</tr>
<tr>
<td align="center" valign="top">
<input type="hidden" name="act" value="add" ID="Hidden2">
<table width="90%" border="0" cellpadding="4" cellspacing="1" bgcolor="#000000" align="center" ID="Table5">
<tr>
<td colspan="2" align="center" bgcolor="#99A6BF"><b>用 戶 管 理 —— 系統配置添加</b></td>
</tr>
<tr>
<td bgcolor="#E7EAEF" width="30%">
<b>配置名稱:</b></td>
<td bgcolor="#FFFFFF">
<input type="text" name="name" class="text" ID="Text1" size="50"></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>禁止訪問的IP:</b></td>
<td bgcolor="#FFFFFF">
<textarea name="refuseIP" class="text" cols="50" rows="5"></textarea><br>格式:用“|”隔開,形如:202.118.164.110</td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>允許訪問的IP段:</b></td>
<td bgcolor="#FFFFFF">
<textarea name="refuseIPsect" class="text" cols="50" rows="5" ID="Textarea1"></textarea><br>格式:用“|”隔開,形如:202.118.164.*</td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否開放搜索:</b></td>
<td bgcolor="#FFFFFF">
<select name="isSearch" ID="Select1">
<option value="1">是</option>
<option value="0">否</option>
</select></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否開放系統:</b></td>
<td bgcolor="#FFFFFF">
<select name="isOpen" ID="Select2">
<option value="1">開放</option>
<option value="0">關閉</option>
</select></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否設置當前配置<br>為系統默認配置:</b></td>
<td bgcolor="#FFFFFF">
<select name="nowused" ID="Select3">
<option value="1">是</option>
<option value="0">否</option>
</select></td>
</tr>
<tr>
<td bgcolor="#99A6BF" align="middle" colspan="2">
<input type="submit" name="submit" value=" 添 加 " onMouseOver="this.className='button1_o';"
onMouseOut="this.className='button1';" class="button1" ID="Submit2">
<input type="reset" name="reset" value=" 重 置 " onMouseOver="this.className='button1_o';"
onMouseOut="this.className='button1';" class="button1" ID="Reset1"></td>
</tr>
</table>
</td>
</tr>
</table>
<%
end sub
'修改學習簡歷
sub change()
Set rs = Server.CreateObject("ADODB.RecordSet")
sql = "Select * From [config] Where id = " & Request.QueryString("id")
rs.Open sql,conn,1,1
if rs.bof or rs.eof then
else
%>
<table cellSpacing="0" cellPadding="0" border="0" height="80%" width="100%" ID="Table6">
<tr>
<td vAlign="top" height="50">
<ol style="line-height:150%">
<li>
修改系統配置信息</li>
</td>
</tr>
<td align="center" valign="top">
<input type="hidden" name="act" value="change" ID="Hidden3"> <input type="hidden" name="id" value="<%=Request.QueryString("id")%>" ID="Hidden4">
<table width="90%" border="0" cellpadding="4" cellspacing="1" bgcolor="#000000" align="center"
ID="Table7">
<tr>
<td colspan="2" align="center" bgcolor="#99A6BF"><b>用 戶 管 理 —— 系統配置修改</b></td>
</tr>
<tr>
<td bgcolor="#E7EAEF" width="30%">
<b>配置名稱:</b></td>
<td bgcolor="#FFFFFF">
<input type="text" name="name" class="text" ID="Text2" size="50" value="<%=rs("name")%>"></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>禁止訪問的IP:</b></td>
<td bgcolor="#FFFFFF">
<textarea name="refuseIP" class="text" cols="50" rows="5" ID="Textarea2"><%=rs("refuseIP")%></textarea><br>格式:用“|”隔開,形如:202.118.164.110</td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>允許訪問的IP段:</b></td>
<td bgcolor="#FFFFFF">
<textarea name="refuseIPsect" class="text" cols="50" rows="5" ID="Textarea3"><%=rs("refuseIPsect")%></textarea><br>格式:用“|”隔開,形如:202.118.164.*</td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否開放搜索:</b></td>
<td bgcolor="#FFFFFF">
<select name="isSearch" ID="Select4">
<option value="1" <%if rs("isSearch") = 1 then Response.Write "selected"%>>是</option>
<option value="0" <%if rs("isSearch") = 0 then Response.Write "selected"%>>否</option>
</select></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否開放系統:</b></td>
<td bgcolor="#FFFFFF">
<select name="isOpen" ID="Select5">
<option value="1" <%if rs("isOpen") = 1 then Response.Write "selected"%>>開放</option>
<option value="0" <%if rs("isOpen") = 0 then Response.Write "selected"%>>關閉</option>
</select></td>
</tr>
<tr>
<td bgcolor="#E7EAEF">
<b>是否設置當前配置<br>為系統默認配置:</b></td>
<td bgcolor="#FFFFFF">
<select name="nowused">
<option value="0" <%if rs("nowused") = 0 then Response.Write "selected"%>>否</option>
</select></td>
</tr>
<tr>
<td bgcolor="#99A6BF" align="middle" colspan="2">
<input type="submit" name="submit" value=" 修 改 " onMouseOver="this.className='button1_o';"
onMouseOut="this.className='button1';" class="button1" ID="Submit3">
<input type="reset" name="reset" value=" 重 置 " onMouseOver="this.className='button1_o';"
onMouseOut="this.className='button1';" class="button1" ID="Reset2"></td>
</tr>
</table>
</td>
</tr>
</table>
<%
end if
rs.close()
end sub
'修改操作
sub save()
if Request.Form("act") = "add" then
if Trim(Request.Form("name")) = "" then
Response.Write("<script>alert('對不起,請填寫系統配置名稱!');window.history.back();</script>")
Response.End()
end if
if Request.Form("nowused") = 1 then
call Clear()
end if
Response.Write("添加配置")
conn.execute("Insert into [config] (name,refuseIP,refuseIPsect,isSearch,isOpen,nowused) Values ('"&Trim(Request.Form("name"))&"','"&Trim(Request.Form("refuseIP"))&"','"&Trim(Request.Form("refuseIPsect"))&"',"&Request.Form("isSearch")&","&Request.Form("isOpen")&","&Request.Form("nowused")&") ")
Response.Write("<script>alert('成功添加系統配置!');location.href='?action=list';</script>")
elseif Request.Form("act") = "change" then
if Trim(Request.Form("name")) = "" then
Response.Write("<script>alert('對不起,請填寫系統配置名稱!');window.history.back();</script>")
Response.End()
end if
if Request.Form("nowused") = 1 then
call Clear()
end if
Response.Write("修改配置")
conn.execute("Update [config] Set name = '"&Trim(Request.Form("name"))&"',refuseIP = '"&Trim(Request.Form("refuseIP"))&"',refuseIPsect = '"&Trim(Request.Form("refuseIPsect"))&"',isSearch = "&Request.Form("isSearch")&",isOpen = "&Request.Form("isOpen")&",nowused = "&Request.Form("nowused")&" Where id = " & Request.Form("id"))
Response.Write("<script>alert('成功修改系統配置!');location.href='?action=list';</script>")
elseif Request.Form("act") = "delete" then
Response.Write("刪除配置")
dim delid
delid = Request.Form("delid")
if delid = "" then
Response.Write("<script>alert('對不起,請選中要刪除的配置!');window.history.back();</script>")
Response.End()
end if
conn.execute("Delete * From [config] where id in ("&delid&")")
Response.Write("<script>alert('成功刪除選定的系統配置!');location.href='?action=list';</script>")
end if
end sub
sub Clear()
conn.execute("Update [config] Set nowused = 0")
end sub
Set rs = nothing
CloseDataBase
%>
</form>
<script language="javascript" src="copyright.htm" type="text/javascript"></script>
</body>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -