<!--#include file="conn.asp"-->
<!--#include file="conntest.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!--#include file=inc/theme.asp -->
<!--#include file="inc/char.asp"-->
<meta http-equiv="Content-Language" content="zh-cn">
<%
dim usern,ars
set rs=server.createobject("adodb.recordset")
sql="select username from [admin] where username='"&membername&"'"
rs.open sql,conn,1,1
if not rs.eof then
usern=rs(0)
rs.close
else
rs.close
end if
if membername="" then
response.write "<script>location.href='login.asp'</script>"
elseif usern="" then
response.write "<script>alert('你没有权限执行此操作！')</script>"
response.write "<script>location.href='index.asp'</script>"
else
stats="管理开心词典"
call nav()
call headline(1)

if request("xz")="sz" then
  call sz()
  elseif request("xz")="xglb" then
  call xglb()
  elseif request("xz")="sclb" then
  call sclb()
  elseif request("xz")="addlb" then
  call addlb()
  else
set ars=server.createobject("adodb.recordset")
sql="select dttime,ts,userjl,userp,userc,usere from [config]"
ars.open sql,aconn,1,1
%>
  
<table border=0 width="600" align=center cellspacing=1 bgcolor="<%=tablebackcolor%>" cellpadding="4">
  <tr bgcolor="<%=tabletitlecolor%>">
          <td width="236">
          
      <p align="center"><b>参数设置</b>
    </td>
      <td width="357" colspan="2">  
      <p align="center"><b>题目类别设置</b>
    </td>
    </tr>
    <tr bgcolor="<%=tablebodycolor%>">

      
    <td width="236" valign="top"><br>
      <form method="POST" action="admin_test.asp?xz=sz">
        <span lang="en-us">&nbsp;</span>框内为当前执行的参数：
<p><span lang="en-us">&nbsp;</span>每次答题增减<br>
      　<span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>　体力值：<input type="text" name="t4" size="7" value='<%=ars(3)%>'><br>
      　<span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>　魅力值：<input type="text" name="t5" size="7" value='<%=ars(4)%>'><br>
      　<span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>　经验值：<input type="text" name="t6" size="7" value='<%=ars(5)%>'><span lang="en-us"><br>
      &nbsp;</span>用户上传题目奖励：<input type="text" name="t3" size="7" value='<%=ars(2)%>'><span lang="en-us"><br>
      &nbsp;</span>每次答题间隔时间：<input type="text" name="t1" size="7" value='<%=ars(0)%>'>分钟 
      <br>
      　<span lang="en-us"> </span>　　最多答题数：<input type="text" name="t2" size="7" value='<%=ars(1)%>'>题</p>
  <p>　　　　<input type="submit" value="设置" name="B1"><span lang="en-us">&nbsp; </span><input type="reset" value="重置" name="B2"></p>
      <p><span lang="en-us">&nbsp;</span>注：答题间隔时间设为零时，则为答题不限制间隔时间。</form></td>
      <td width="240" valign="top"><br>
<% 
set ars=server.createobject("adodb.recordset")
sql="select lb,id from [testlb]"
ars.open sql,aconn,1,1
if ars.eof then
response.write "<br>你没有设置题库类别！<br>"
else
while not ars.eof
  response.write "&nbsp;序号：<font color='#FF0000'>"&ars(1)&"</font>&nbsp;&nbsp;&nbsp;名称："&ars(0)
  response.write "&nbsp;&nbsp;&nbsp;<a href='admin_test.asp?xz=sclb&id="&ars(1)&"'"&"><font color='#FF0000'>删除此类别</a></font><br><br>"
  ars.movenext
wend
%><form method="POST" action="admin_test.asp?xz=xglb">　
序号<input type="text" name="T4" size="2"><span lang="en-us"> </span>类别名称<input type="text" name="T5" size="8"><span lang="en-us">
        </span><input type="submit" value="修改" name="B3"></form>
      </td>
      
    <td width="114" valign="top"> <b><font color="#FF0000"><br>
      <span lang="en-us">&nbsp;</span></font>删除类别</b>操作将连同提库内此类别的题同时删除，请慎重！ 
      <p> <span lang="en-us">&nbsp;</span>修改类别名称可直接在下面框内输入与序号相对应的类别名称后点击<b>修改</b>即可。<br>
<br>
        <span lang="en-us">&nbsp;</span><b>新增类别</b>在下框内输入类别名称即可。
      <form method="POST" action="admin_test.asp?xz=addlb">
  <p align="center">类别名称<input type="text" name="T6" size="8"><br><input type="submit" value="增加新类别" name="B4"></p>
</form></td>
    </tr>
    
  <tr bgcolor="<%=tabletitlecolor%>" align="center"> 
    <td width="596" colspan="3"> 
      <p><b><a href="admin_iitest.asp">管理上传题目</a> <a href="test.asp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返 
        回<b></b></a></b>
    </td>
    </tr>
  </table>



<%
end if
end if
end if

sub sz()
aconn.execute("update config set dttime='"&request("t1")&"',ts='"&request("t2")&"',userjl='"&request("t3")&"',userp='"&request("t4")&"',usere='"&request("t6")&"',userc='"&request("t5")&"'")
response.write "<script>alert('已设置完毕！')</script>"
response.write "<script>location.href='admin_test.asp'</script>"
end sub

sub xglb()
aconn.execute("update testlb set lb='"&request("t5")&"' where id="&request("t4"))
response.write "<script>alert('已修改完毕！')</script>"
response.write "<script>location.href='admin_test.asp'</script>"
end sub

sub sclb()
b=request("id")
aconn.execute ("delete from testlb where id="&request("id"))
aconn.execute ("delete from test where lb="&request("id"))
response.write "<script>alert('已删除完毕！')</script>"
response.write "<script>location.href='admin_test.asp'</script>"
end sub

sub addlb()
set ars=server.createobject("adodb.recordset")
sql="select lb from [testlb]"
ars.open sql,aconn,1,3

ars.addnew
ars(0)=request("t6")
ars.update
ars.close
response.write "<script>alert('增加新类别完毕！')</script>"
response.write "<script>location.href='admin_test.asp'</script>"
end sub

call endline()
%><!--#include file="footer.asp"-->