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

📄 admindatabase1.asp

📁 该系统测试用户信息主要由数据库直接输入
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
  if session("adminname")="" then
  response.redirect "relogin.asp"
  end if
  
dim typename    	
subjectview=request("subjectview")
typeadd=request("typeadd")

 
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统管理 | 题库管理</title>
<script language="javascript">
function editit(id)
{ 
  page="admindatabaseedit.asp?tmid="+id
  window.open (page,'查看编辑题目','width=570,height=450,resizable=1,scrollbars=1')
}

function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
  {
  var e = form.elements[i];
  if (e.name != 'chkall')
     e.checked = form.chkall.checked;
  }
}

function viewit(myform)
{
if (document.viewaddform.subjectview.value!="")
  subject=document.viewaddform.subjectview.value;
else
  subject="所有";
if (document.viewaddform.typeadd.value!="")
  type=document.viewaddform.typeadd.value;
else
  type="所有";

 
    myform.action="admindatabase.asp";
    myform.submit();
 
}

function searchit(myform)
{
if (document.viewaddform.subjectview.value!="")
  subject=document.viewaddform.subjectview.value;
else
  subject="所有";
if (document.viewaddform.typeadd.value!="")
  type=document.viewaddform.typeadd.value;
else
  type="所有";
if (document.viewaddform.mykey.value!="--关键字--")
  mykey=document.viewaddform.mykey.value;
else
  mykey="";
result="在<"+subject+">题库中<"+type+">题目中搜索关键字<"+mykey+">?"
 
    myform.action="admindatabase1.asp";
    myform.submit();
 
}

function addit(myform)
{
if (document.viewaddform.subjectview.value!="" & document.viewaddform.typeadd.value!=""){
  result="添加"+document.viewaddform.typeadd.value+"题目到"+document.viewaddform.subjectview.value+"题库?"
 
    myform.action="admindatabaseadd.asp";
    myform.submit();
  
}
else
alert("请首先选择科目和题目类型!")
}

 function delit(myform)
{
  result="是否从题库中删除所选项?"
  if (confirm(result))
  {
    myform.action="admindatabasedel.asp?subjectview="+<%=subjectview%>;
    myform.submit();
  }
}

function FanAll(form){
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i];
if (e.checked == false){ e.checked = true; }
else { e.checked = false;}
}}

</script>
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>

<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
  <tr>
    <td width="100%">当前位置: 系统管理 &gt; 题库管理</td>
  </tr>
</table>
<table border="1" cellspacing="1" style="border-collapse: collapse" id="AutoNumber2" bgcolor="#99CCFF" width="100%" background="images/admin_bg_1.gif" bordercolor="#799AE1">
  <form name="viewaddform" method="POST" action="admindatabase1.asp?mykey=<%=request("mykey")%>">
    <tr>
      <td><center><select size="1" name="subjectview">
        <% 
      '-----------------权限设定
      power=session("power")
      	 
			dim arr,id1
	 if instr(power,",")>0 then
			Arr=split(power)
		    for i = 0 to ubound(arr)
	       		id1=clng(arr(i))
	       		
	       	 sql="select * from tbkc where kcid="&id1
      set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,3,2	
	       		
	       		 if not rs.eof then %>
	  <option value="<%=rs("kcid")%>" <%if cint(rs("kcid"))=cint(subjectview)  then %>selected <%end if %>><%=rs("kcm")%></option>
	  <% end if
	  
         next
	  else  
	   
	      if    power<=0  and power<>"-2"  then 
	      
	      
	  	 sql="select * from tbkc"
      set rs=server.createobject("adodb.recordset")
      rs.open sql,conn,3,2	
       
       do while not rs.eof %>
      <option value="<%=rs("kcid")%>" <%if cint(rs("kcid"))=cint(subjectview)  then %>selected <%end if %>><%=rs("kcm")%></option>
      <% rs.movenext
      loop
      
            else
			   sql3="select * from tbkc where kcid="&power
               set rs3=server.createobject("adodb.recordset")
              rs3.open sql3,conn,3,2	
	       		
	       		 if not rs3.eof then
	       		  %>
	  <option value="<%=rs3("kcid")%>" <%if cint(rs3("kcid"))=cint(subjectview)  then %>selected <%end if %>><%=rs3("kcm")%></option>
	  <%    end  if
             end if
      

	  end if

        %></select><span lang="en-us">&nbsp; </span><select size="1" name="typeadd">
       		<option value="1" 
   		<%if typeadd=1 then 
   		typename="名词解释" 
   		%>selected <%
   		end if %> selected>名词解释</option>
   
      <option value="2" <%if typeadd=2 then  
      typename="填空题"
      %>selected <%
      end if %>>填空题</option>
      
      <option value="3" <%if  typeadd=3 then
       typename="判断题"
       %>selected <%
       end if %>>判断题</option>
      <option value="4" <%if typeadd=4 then 
      typename="单选题"
      %>selected <%
      end if %>>单选题</option>
      <option value="5" <%if  typeadd=5 then 
      typename="多选题"
      %>selected <%
      end if %>>多选题</option>
      <option value="6" <%if typeadd=6 then 
      typename="简答题"
      %>selected <%
      end if %>>简答题</option>
      <option value="7" <%if typeadd=7 then 
      typename="论述题"
      %>selected <%
      end if %>>论述题</option>
      <option value="8" <%if typeadd=8 then 
      typename="阅读理解"
      %>selected <%
      end if %>>阅读理解</option>
		<% 
		if typeadd="" then 
		typename="名词解释"
		end if
		%>      </select><span lang="en-us"> </span><input type="submit" value="浏 览" name="I3" onclick="viewit(this.form)" class="s02">
      <span lang="en-us">&nbsp;<img border="0" src="images/arrow1.gif">&nbsp; </span>
      <input type="submit" value="添加<%=typename%>" name="I6" onclick="addit(viewaddform)" class="s02">
      <span lang="en-us">&nbsp;&nbsp; </span>
      <input type="text" name="mykey" size="10" value="--关键字--" onfocus="this.select()"  class="s01">
      <input type="submit" value="查 询" name="I7" onclick="searchit(this.form)" class="s02"></center>
</td>
    </tr>

</table>
<%


response.write "<br><center>"+request("success")+"</center>"



mykey=request("mykey")
if subjectview="--选择科目--" or subjectview="" then
  subjectview= rs("kcid")
end if
if typeadd="--题型--" or typeadd="" then
  typeadd="1"
end if
if mykey= "--关键字--" or mykey="" then


 %><br><br>

<center>

<h1>没有输入关键字</h1></center>
 <%
 else


sql="select tbtk.tmid,tbtk.title,tbkc.kcm,tbtk.category,tbtk.chapter,tbtk.kao,tbtk.level  from tbtk,tbkc  where tbtk.kcid=tbkc.kcid  and title like  '%"& mykey &"%' order by tbtk.kcid ,tbtk.chapter,category,tbtk.tmid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
on error resume next
rs.PageSize = 10
Page = CLng(Request("Page"))
If Page < 1 Then Page = 1
If Page > rs.PageCount Then Page = rs.PageCount
i=page+(page-1)*9
rs.AbsolutePage = Page

%><% 


if rs.eof then

%><p>
<br>

</p>

<center>

<h1>没有试题</h1></center>

<%
else%><center><h5>关键字<font color=red><%=mykey%></font>&nbsp;&nbsp;(共<%=rs.recordcount%>题) <h5></center>
<center>
<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#799AE1" width="100%" id="AutoNumber1">
  <tr class="trh">
    <td width="44" align="center"   height="20" style="background-color: #799AE1">
 <input type="submit" value="删除" name="del" onclick="delit(viewaddform)"     class="s02"></td>
    <td width="42" align="center" bgcolor="#799AE1"><font color="#FFFFFF"><b>序号</b></font></td>
    <td align="left" bgcolor="#799AE1" width="123">
    <p align="center"><font color="#FFFFFF"><b>科目名称</b></font></td>
        <td align="left"  width="55" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>章</b></font></td>
    <td align="left"   width="75" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>题型</b></font></td>

    <td align="left"   width="226" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>题目内容</b></font></td>

    <td align="left"   width="47" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>类型</b></font></td>

    <td align="left"   width="52" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>难度</b></font></td>
    <td align="left"   width="50" style="background-color: #799AE1">
    <p align="center"><font color="#FFFFFF"><b>操作</b></font></td>
  </tr>
<%


For iPage = 1 To rs.PageSize
%>
  <tr class="trh1">
    <td align="center"   width="44">
    <input type="checkbox" name='selAnnounce' value="<%=rs("tmid")%>"></td>
    <td align="center" width="42"><%=i%></td>
    <td align="center" width="123"><%=rs("kcm")%></td>
        <td align="center" width="55">第<%=rs("chapter")%>章</td>
    <td align="center" width="75"><% 
          if rs("category")=1 then
    response.write "名词解释"
    end if
          if rs("category")=2 then
    response.write "填空题"
    end if
          if rs("category")=3 then
    response.write "判断题"
    end if
    
    if rs("category")=4 then
    response.write "单选题"
    end if
    
      if rs("category")=5 then
    response.write "多选题"
    end if

      if rs("category")=6 then
    response.write "简答题"
    end if
          if rs("category")=7 then
    response.write "论述题"
    end if
           if rs("category")=8 then
    response.write "阅读理解"
    end if
    %></td>

    <td align="left" width="226"><a href="javascript:editit(<%=rs("tmid")%>)"><%=replace(cuter(rs("title"),12),""&mykey&"","<font color=red>"&mykey&"</font>")%></a></td>

    <td align="center" width="47"><% 
          if rs("kao")=1 then
    response.write "<font color=#0000FF>考试</font>"
else
    response.write "练习"
    end if

    
    %></td>

    <td align="center" width="52"><% 
          if rs("level")="1" then
    response.write "容易" 
    end if
          if rs("level")="2" then
    response.write "中等" 
    end if
              if rs("level")="3" then
    response.write "较难" 
    end if
              if rs("level")="4" then
    response.write "最难" 
    end if
    
    %></td>
    <td align="left" width="50">
	<p align="center"><a href="javascript:editit(<%=rs("tmid")%>)">
    <img border="0" src="images/edit.gif" alt="查看/编辑"></a></td>
  </tr>
  <% 
rs.MoveNext
If rs.EOF Then Exit For
i=i+1
Next





%>
  <caption></caption>
</table>
</center>
  </form>

 
<div ALIGN="right">
  <table>
    <form ACTION="<%=Myself%>?subjectview=<%=subjectview%>&typeadd=<%=typeadd%>&mykey=<%=mykey%>%&gt;" METHOD="GET">
      <tr>
        <td>
        <p ALIGN="right">  <input type=checkbox name=del_all1 value=1 onclick=FanAll(viewaddform)>全选<span lang="en-us"> </span>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%If Page <> 1 Then ' 如果不是位于第一页%>
        <a href="<%=Myself%>?Page=1&subjectview=<%=subjectview%>&typeadd=<%=typeadd%>&mykey=<%=mykey%>">
        第一页</a>
        <a HREF="<%=Myself%>?Page=<%=(Page-1)%>&subjectview=<%=subjectview%>&typeadd=<%=typeadd%>&mykey=<%=mykey%>">
        上一页</a>
        <%                                      
End If   
                              
If Page <> rs.PageCount Then ' 如果不是位于最后一页                                         
%> <a HREF="<%=Myself%>?Page=<%=(Page+1)%>&subjectview=<%=subjectview%>&typeadd=<%=typeadd%>&mykey=<%=mykey%>">
        下一页</a>
        <a HREF="<%=Myself%>?Page=<%=rs.PageCount%>&subjectview=<%=subjectview%>&typeadd=<%=typeadd%>&mykey=<%=mykey%>">
        最后一页</a> <% End If %>&nbsp;
        <font SIZE="2">页次:</font><font COLOR="Red" SIZE="2"><%=Page%>/<%=rs.PageCount%></font></p>
        <p> </td>
      </tr>
    </form>
  </table>
  
  <%end if        
  end if
  
  
 
  %></div>
</div>
</td>
</tr>
</table>

</h4>

</h5>

</body>

</html>

⌨️ 快捷键说明

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