adminknowlege.asp

来自「网络考试系统最终备份」· ASP 代码 · 共 245 行

ASP
245
字号
<!--#include file="conn.inc"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>知识点管理</title>
<script language="javascript">

function submitit(myform)
{
}
function addit(myform)
{  if ((myform.subid.value=="选择科目")||(myform.subid.value==""))
   {
      alert("请选择科目!");
	  return false;
   }
   if ((myform.subject_knowledge.value == "请输入知识点名称") || (myform. subject_knowledge.value == ""))
   {
     alert("请输入知识点名称!知识点不能为空");
    return false;
    } 
    else
	{
	
	return true
	}
	   
}
function saveit(myform)
{
  if (confirm("是否保存所有修改?"))
  {
    myform.action="adminknowlegesaveedit.asp";
    myform.submit();
  }
}

function delit(myform)
{
  if (confirm("将删除此科目下的所有数据?"))
  {
    myform.action="adminknowlegedel.asp";
    myform.submit();
  }
}//删除和修改前的系统提示
</script>

<style type="text/css">
<!--
.style2 {font-size: 9pt}
.style3 {
	font-size: 10pt;
	font-weight: bold;
}
.STYLE4 {
	font-family: "宋体";
	font-weight: bold;
	font-size: 10pt;
}
.STYLE5 {
	font-family: "宋体";
	font-size: 10pt;
}
.STYLE6 {
	font-family: "宋体";
	font-weight: bold;
	font-size: 9pt;
}
.STYLE7 {
	font-family: "宋体";
	font-size: 9pt;
}
-->
</style>
</head>

<body>
<table width="100%"  border="0" bgcolor="#ecf4ff">
  <tr>
    <td><span class="style2">&nbsp;当前位置:<a href="news.asp">系统管理</a> &gt; <a href="admindatabaseselect.asp">题库管理</a></span> &gt;<span class="style2"> 知识点管理</span></td>
  </tr>
</table>

<p>&nbsp;</p>
<table width="100%" height="40" border="1" cellpadding="0" cellspacing="1" bordercolor="#c9def3" bgcolor="#ecf4ff" id="AutoNumber1" style="border-collapse: collapse">
  <form method="POST" action="adminknowlege.asp" name="firstform" >
    <tr nowrap bgcolor="#ecf4ff" height="30">
      <th  height="15" colspan="5" align="center" valign="middle"  nowrap style="font-size: 9pt; color: #000000"><p align="center" class="STYLE4">登陆教师信息</th>
    </tr>
    <tr  nowrap  bgcolor="#EFEFEF" height="20">
      <td  width="13%" height="15" align="center"  nowrap bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000"><div align="center" class="style3">教师姓名</div></td>
      <td  width="25%" align="center"  nowrap bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000"><span class="style3">所属学院</span></td>
      <td  height="15" colspan="2" align="center"  nowrap bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000"><div align="center" class="style3">所属系别</div>
      <div align="center" class="style3"></div></td>
      <td  width="30%" height="15"  nowrap bgcolor="#FFFFFF" style="font-size: 9pt; color: #000000"><div align="center" class="style3">选择科目</div></td>
    </tr>
    <tr  nowrap   height="20">
      <td  nowrap  width="13%" height="21" align="center" bgcolor="#ecf4ff" style="font-size: 9pt; color: #000000"><div align="center"> &nbsp;
              <%
		     n_UserID=request.Cookies("userid")
			 sql="select UserRName from user_info where UserID="&n_UserID&""
             set rs=server.createobject("adodb.recordset")
             rs.open sql,conn,3,2
         
			 Response.Write rs("UserRName")
	  	  %>
      </div></td>
      <td  nowrap  width="25%" height="21" align="center" bgcolor="#ecf4ff" style="font-size: 9pt; color: #000000"><%
		     c_UserID=request.Cookies("userid")
			 sql="select * from college_info where CollegeID in (select College_ID from user_info where UserID="&c_UserID&")"
             set rs=server.createobject("adodb.recordset")
             rs.open sql,conn,3,2
         
			 Response.Write rs("CollegeName")
	  	  %>
&nbsp;</td>
      <td  nowrap  height="21" colspan="2" align="center" bgcolor="#ecf4ff" style="font-size: 9pt; color: #000000"><div align="center">
          <%d_UserID=request.Cookies("userid")
			 sql="select * from department_info where DepID in (select Dep_ID from user_info where UserID="&d_UserID&")"
             set rs=server.createobject("adodb.recordset")
             rs.open sql,conn,3,2
         
			 Response.Write rs("DepName")

	  %>
        </div>
      <div align="center"> </div></td>
      <td  nowrap width="30%" height="21" bgcolor="#ecf4ff" style="font-size: 9pt; color: #000000"><div align="center">
          <select size="1" name="subject" onchange="submit();">
            <option value="选择科目" selected>选择科目</option>
            <% s_UserID=request.Cookies("userid")
			  v_subID = trim(request("subject"))
	 

	  if v_subID = "选择科目" or v_subID = ""  then
			    sql="select * from subject_info where SubID in (select Sub_ID from teacher_subject where Teacher_ID="&s_UserID&")"

     else
	 	  	  sql="select * from subject_info where SubID <> "&v_subID&" and SubID in (select Sub_ID from teacher_subject where Teacher_ID="&s_UserID&")"

	  end if
      set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,3,2
      do while not rs.eof 
	  %>
            <option value="<%=rs("SubID")%>"><%=rs("SubName")%></option>
            <% rs.movenext
      loop
      rs.close
	  set rs = nothing
		%>
	  
	  
	  <%
     if v_subID <> "选择科目" and  v_subID<>""  then	
      sql="select * from subject_info where SubID = "&v_subID&" and SubID in (select Sub_ID from teacher_subject where Teacher_ID="&s_UserID&")"
	
	  set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,3,2
	
	   %>
	    <option selected value="<%=rs("SubID")%>"><%=rs("SubName")%></option>
          <%
		rs.close
		set rs = nothing
		end if
	%>
		  </select>
		
  
      </div></td>
    </tr>
  </form>
</table>
<p>&nbsp;</p>


<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#c9def3" width="100%" id="AutoNumber3" height="5%">
  <form method="POST"   name="addknow" action="knowledgesave.asp" onSubmit="return addit(addknow);">
    <tr  nowrap  >
      <td  nowrap  width="120" height="26" bgcolor="#ecf4ff">
      <p align="center" class="STYLE5">知识点名称</td>
      <td  nowrap  >
      <p align="left">
      <input type="text" name="subject_knowledge" size="50" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal" value="请输入知识点名称">
      <input type="hidden" name="subid" value="<%=v_subID%>">      
      </td>
      <td  nowrap  width="59">
      <p align="center">
      <input border="0" value="添 加" name="I1" type="submit"  class="s02"></td>
    </tr>
  </form>
</table>
<p><br>
</p>
<table border="1" cellpadding="0" cellspacing="1" style="border-collapse: collapse" bordercolor="#c9def3" width="100%" id="AutoNumber1">
  <form name="knowledge" method="get" onSubmit="return submitit(this)">
    <tr>
      <td  nowrap="nowrap" width="26" align="center" bgcolor="#ecf4ff" height="15"> </td>
      <td width="59" height="15" align="center" bgcolor="#ecf4ff"><span class="STYLE6">序号</span></td>
      <th width="653" height="15" align="center" nowrap bgcolor="#ecf4ff">&nbsp;
        <span class="STYLE6">知识点名称</span></th>
    </tr>
  <%
  v_subID = trim(request("subject"))
  if (v_subID <> "") and (v_subID <> "选择科目") then
  
  sql = "select * from knowledge_info where Sub_ID="&v_subID
  set rs = server.CreateObject("adodb.recordset")
  rs.open sql,conn,3,2
  i = 1
  do while not rs.eof
  %>
    <tr>
      <td  nowrap="nowrap" align="center" bgcolor="#ecf4ff">
      <input type="checkbox" name="id" value="<%=rs("KnowID")%>"></td>
      <td   nowrap="nowrap" align="center"><span class="STYLE7"><%=i%> </span></td>
      <td  nowrap="nowrap"  align="left">&nbsp;<input type="text" name="subject_knowledge" size="40" value="<%=rs("KnowName")%>" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" class="inputnormal">
      <input type="hidden" name="knowID" value="<%=rs("KnowID")%>"></td>
    </tr>
 <%
 i = i + 1
 rs.movenext
 loop
 end if
 %>

    <caption>
    <p align="right">
    <input type="submit" value="删除所选项" name="del" onClick="delit(knowledge)" class="s02">&nbsp;<input type="submit" value="保 存" name="button" onClick="saveit(knowledge)" class="s02"></p>
    </caption>
  </form>
</table>

<p>
<div ALIGN="right"></div>
</div>
</td>
</tr>
</table></p>
</body>
</html>

⌨️ 快捷键说明

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