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

📄 system_setup.asp

📁 本系统适用于选择题(单选和多选)的练习和考试.主要有七大模块:学习信息、经验交流、学生练习、学生考试、试卷管理、题库操作、身份 资料、成绩查询、系统帮助。超级管理员还可进行系统设置
💻 ASP
字号:
<!--#include file="open.asp" -->
<!--#include file="inc/md5.inc" -->
<%path_name=request.servervariables("SCRIPT_NAME")
strnum=len(path_name)-instrrev(path_name,"/")
self_name=right(path_name,strnum)%>
<%
  doing=request.querystring("doing")
  if doing="login" then  '用户登录
      user_id=trim(request.form("user_id"))
	  pass=trim(request.form("pass"))
	  if user_id<>"" and pass<>"" and instr(user_id,"'")=0 and instr(user_id,"&")=0 then
	      pass=ucase(md5(pass))
		  str="select * from user_teacher where teacher_user='"&user_id&"' and teacher_pass='"&pass&"'"
		  set rs=conn.execute(str)
		  if not rs.eof then
		      session("zzteacher")=true
			  session("name")=rs("teacher_name")
			  if rs("teacher_class")="超级管理员" then session("zzadmin")=true end if
		  else
		      str="select * from user_student where 学籍号='"&user_id&"' and 密码='"&pass&"'"
		      set rs=conn.execute(str)
			  if not rs.eof then
			     session("zzstudent")=true
				 session("student_id")=user_id
				 session("name")=rs("姓名")
				 session("student_bj")=rs("班级")
			  end if
		  end if
	  end if
  end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><!--#include file="inc/css.css" -->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留溪在线考试</title>
</head>

<body topmargin="1">
<!--#include file="top.asp" -->
<!--#include file="menu.asp" -->
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
<%if session("zzteacher")=true or session("zzstudent")=true then%>
  <tr> 
    <td height="20" class="unnamed12"><div align="center">用户已登录 用户类别:
	<%if session("zzstudent")=true then%>学生 学籍号:<%=session("student_id")%> 姓名:<%=session("name")%> 班级:<%=session("student_bj")%><%end if%>
	<%if session("zzteacher")=true then%>教师 姓名:<%=session("name")%><%end if%>
	 <%if session("zzadmin")=true then%><a href=system_setup.asp>系统设置</a><%end if%>
		 <a href="quit.asp?back=<%=self_name%>">退出</a></div></td>
  </tr>
<%else%>
  <tr> 
    <td height="20" class="unnamed12"> <form name="form1" method="post" action="<%=self_name%>?doing=login">
        <div align="center">用户登录 输入学籍号或用户名: 
          <input name="user_id" type="text" id="user_id" value=<%=id_disp%> size="20">
           密码: 
          <input name="pass" type="password" id="pass" size="16">
            
          <input type="submit" name="Submit" class="unnamed12" value="登录">
            
          <input type="reset" name="Submit2" class="unnamed12" value="重填">
            <a href="reg.asp?back=<%=self_name%>">注册</a> <a href="rereg.asp">忘记密码</a></div>
      </td></form>
  </tr>
<%end if%>
</table>
<table width="770" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="unnamed4"> </td>
  </tr>
</table>

<%if session("zzadmin")=true then%>
<%   '基本设置
  if doing="basic" then
     link_add=trim(request.form("link_add"))
	   if link_add="" then link_add="index.asp" end if
     student_lx=request.form("student_lx")
     student_id=trim(request.form("student_id"))
	   if student_id="" then student_id="1" end if
     file_ex=trim(request.form("file_ex"))
	 if file_ex<>"" then
         str="update config set homelink='"&link_add&"',lxlink="&student_lx&",student_id='"&student_id&"',upfile_type='"&file_ex&"'"
		 conn.execute(str)
     end if
  end if
%>
<%   '删除班级编号
  if doing="delebj" then
      bj=request.querystring("bj")
	  str="delete from bj where bj_name='"&bj&"'"
	  conn.execute(str)
  end if
%>
<%   '删除班级及该班学生
   if doing="delbjst" then
        bj=request.querystring("bj")
        str="delete from bj where bj_name='"&bj&"'"
		conn.execute(str)
		str="delete from user_student where 班级='"&bj&"'"
		conn.execute(str)
   end if
%>
<%   '增加班级编号
   if doing="insert_bj" then
        bj_insert=trim(request.form("bj_insert"))
		if bj_insert<>"" then
		    str="select * from bj where bj_name='"&bj_insert&"'"
			set rs=conn.execute(str)
			if rs.eof then
		        str="insert into bj(bj_name) values('"&bj_insert&"')"
			    conn.execute(str)
			end if
		end if
   end if
%>
<%  '增加考试科目
  if doing="insert_km" then
      insert_km_name=trim(request.form("insert_km_name"))
	  str="select * from tk_name where 科目名称='"&insert_km_name&"'"
	  set rs=conn.execute(str)
	  if rs.eof then
	        str="insert into tk_name(科目名称,题库表名) values('"&insert_km_name&"','"&insert_km_name&"')"
	        conn.execute(str)
            str="select id,tm_text,img_name,da_a,da_b,da_c,da_d,da_e,da_f,da,select_only into "&insert_km_name&" from tm_model"
		    conn.execute(str)
	  end if
  end if
%>
<%  '删除考试科目
  if doing="dele_km" then
      del_kmname=request.querystring("del_kmname")
	  str="delete from tk_name where 题库表名='"&del_kmname&"'"
	  conn.execute(str)
      str="DROP TABLE "&del_kmname&""
      conn.execute(str)
  end if
%>
<table width="770" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ff99cc" bgcolor="#edebdb">
  <tr>
    <td valign="top">
<div align="center"> 
        <table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="unnamed6"> </td>
          </tr>
        </table>
<%
   str="select * from config"
   set rs=conn.execute(str)
%>
        <table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><form name="form2" method="post" action="system_setup.asp?doing=basic">
                <table width="600" border="1" align="center" cellpadding="2" cellspacing="0">
                  <tr bgcolor="#999999"> 
                    <td height="40" colspan="2"><div align="center" class="unnamed18"><strong>系 
                        统 基 本 设 置</strong></div></td>
                  </tr>
                  <tr> 
                    <td width="30%" height="30" class="unnamed14"> 
                      <div align="right">首页链接地址:</div></td>
                    <td width="70%" height="30"> 
                      <input name="link_add" type="text" id="link_add" value="<%=rs("homelink")%>" size="50"></td>
                  </tr>
                  <tr> 
                    <td width="30%" height="30" class="unnamed14"> 
                      <div align="right">链接学生练习:</div></td>
                    <td width="70%" height="30">  <select name="student_lx" id="student_lx">
                        <option value="1" <%if rs("lxlink")=1 then%>selected<%end if%>>出现</option>
                        <option value="0" <%if rs("lxlink")=0 then%>selected<%end if%>>关闭</option>
                      </select></td>
                  </tr>
                  <tr> 
                    <td width="30%" height="30" class="unnamed14"> 
                      <div align="right">默认学籍卡号:</div></td>
                    <td width="70%" height="30"> 
                      <input name="student_id" type="text" id="student_id" value="<%=rs("student_id")%>" size="50"></td>
                  </tr>
                  <tr> 
                    <td width="30%" height="30" class="unnamed14"> 
                      <div align="right">上传文件类型:</div></td>
                    <td width="70%" height="30"> 
                      <input name="file_ex" type="text" id="file_ex" value="<%=rs("upfile_type")%>" size="50"></td>
                  </tr>
                  <tr> 
                    <td colspan="2"><div align="center">
                        <input type="submit" name="Submit3" class="unnamed14" value=" 提 交 ">
                             
                        <input type="reset" name="Submit4" class="unnamed14" value=" 重 置 ">
                      </div></td>
                  </tr>
                </table>
              </form></td>
          </tr>
        </table>
<%
   str="select * from bj"
   set rs=conn.execute(str)
%>
        <table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
        </table>
        <table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><form name="form3" method="post" action="system_setup.asp?doing=insert_bj">
                <table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
                  <tr> 
                    <td height="40" colspan="2" bgcolor="#999999"><div align="center" class="unnamed18"><strong>班 
                        级 设 置</strong></div></td>
                  </tr>
                  <%if rs.eof then%>
                  <tr> 
                    <td height="30" colspan="2" class="unnamed14"><div align="center"><font color="#FF0000">目前数据库中没有班级</font></div></td>
                  </tr>
                  <%else%>
                  <tr class="unnamed14"> 
                    <td width="30%" height="30"> <div align="center">班   级</div></td>
                    <td width="70%"> <div align="center">操    作</div></td>
                  </tr>
                  <%do while not rs.eof%>
                  <tr class="unnamed14"> 
                    <td height="30"> <div align="center"><%=rs("bj_name")%></div></td>
                    <td> <div align="center"><a href="system_setup.asp?doing=delebj&bj=<%=rs("bj_name")%>">只删除班级编号</a>   <a href="system_setup.asp?doing=delbjst&bj=<%=rs("bj_name")%>">删除班级及该班学生</a></div></td>
                  </tr>
                  <%rs.movenext
		     loop%>
                  <%end if%>
                </table>
                <table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="30%" height="40">
<div align="center" class="unnamed14">增加班级</div></td>
                    <td width="70%"><div align="center">
                        <input name="bj_insert" type="text" id="bj_insert" size="15">
                           
                        <input type="submit" name="Submit5" class="unnamed14" value=" 增 加 ">
                      </div></td>
                  </tr>
                </table>
              </form></td>
          </tr>
        </table>
        <table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
        </table>
        <table width="700" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><form name="form4" method="post" action="system_setup.asp?doing=insert_km">
                <table width="600" border="1" align="center" cellpadding="0" cellspacing="0">
                  <tr> 
                    <td height="40" colspan="3" bgcolor="#999999"><div align="center" class="unnamed18"><strong>考 试 科 目</strong></div></td>
                  </tr>
      <% str="select * from tk_name"
      set rs=conn.execute(str)
	  if rs.eof then%>
                  <tr> 
                    <td height="40" colspan="3" bgcolor="#FF0000" class="unnamed16"><div align="center"><font color="#FFFFFF">现在题库中没有任何考试科目</font></div></td>
                  </tr>
                  <tr class="unnamed14"> 
                    <td height="30"> 
                      <div align="center">科目名称</div></td>
                    <td height="30"> 
                      <div align="center">操作</div></td>
                    <td width="53%" height="30"> 
                      <div align="center">备注</div></td>
                  </tr>
                  <%else%>
				  <%do while not rs.eof%>
                  <tr class="unnamed14"> 
                    <td width="33%" height="26"> 
                      <div align="center"><%=rs("科目名称")%></div></td>
                    <td width="10%" height="26"> 
                      <div align="center"><a href=system_setup.asp?doing=dele_km&del_kmname=<%=rs("题库表名")%>>删除</a></div></td>
                    <td width="53%" height="26"> 
                      <div align="center" class="unnamed12wu"><font color="#FF0000">删除该科目后试题也会全部删除且不能恢复</font></div></td>
                  </tr>
				  <%rs.movenext
				    loop%>
                  <%end if%>
                  <tr> 
                    <td colspan="3"><div align="center" class="unnamed14">新加考试科目: 
                        <input name="insert_km_name" type="text" id="insert_km_name" size="18">
                           
                        <input type="submit" name="Submit6" value=" 增 加 ">
                      </div></td>
                  </tr>
                </table>
              </form></td>
          </tr>
        </table>
        <table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td class="unnamed6"> </td>
          </tr>
        </table>
      </div></td>
  </tr>
</table>

<%else%>

<!--#include file="index01.asp" -->

<%end if%>

<!--#include file="inc/bottom.asp" -->
<%conn.close%>
</body>
</html>

⌨️ 快捷键说明

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