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

📄 sysadmin.asp

📁 东北农业大学教学管理系统
💻 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"> &nbsp;&nbsp;
									<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>
				<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="1" <%if rs("nowused") = 1 then Response.Write "selected"%>>是</option>
										<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"> &nbsp;&nbsp;
									<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 + -