<!--#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"-->
 <% 
dim ars,aup,apass,acount,aokcount,auserjl,ausere,auserc
dim auserans,auserok,auserl,orders,ordername,adttime
dim ats,ars2
if membername="" then
response.write "<script>location.href='login.asp'</script>"
else
stats="开心词典"
call nav()
call headline(1)
set ars=server.createobject("adodb.recordset")
sql="select dttime,ts,userjl,usere,userc from [config]"
ars.open sql,aconn,1,1
adttime=ars(0)
ats=ars(1)
auserjl=ars(2)
ausere=ars(3)
auserc=ars(4)

ars.close
set ars=server.createobject("adodb.recordset")
sql="select username,userup,userpass,userans,userok from [testuser] where username='"&membername&"'"
ars.open sql,aconn,1,3
if ars.eof then
ars.addnew
ars(0)=membername
ars(1)=0
ars(2)=0
ars(3)=0
ars(4)=0
ars.update
ars.close
aup=0
apass=0
auserans=0
auserok=0
auserl=0
else
aup=ars(1)
apass=ars(2)
auserans=ars(3)
auserok=ars(4)
if ars(3)=0 then
auserl=0
else
auserl=round(ars(4)/ars(3),3)*100
end if
ars.close
end if
if not isInteger(request("orders")) or request("orders")="" then
		orders=1
	else
		orders=request("orders")
	end if
	select case orders
	case 1
		orders=1
		ordername="应答题数"
	case 2
		orders=2
		ordername="答对题数"
	case 3
		orders=3
		ordername="上传题数"
	end select
%>
<div align="center">
    <table border=0 width="600" align=center cellspacing=1 bgcolor="<%=tablebackcolor%>" cellpadding="4">
      <tr bgcolor="<%=tabletitlecolor%>"> 
        <td colspan="3" align=center> 
         <b><img  src="images/dir.gif"  >参数设置</b> 
        </td>
      </tr>
      <tr bgcolor="<%=tablebodycolor%>" > 
      <td valign="top"><form name="form1" method="post" action="test.asp"><table border=0 width="100%"   cellspacing=1 bgcolor="#000000"  cellpadding="0" height=260>
				<tr bgcolor="<%=tabletitlecolor%>">
				<td colspan="2" align="center"> 排行榜</td>
				</tr>
                  <tr bgcolor="<%=TableBodyColor%>"> 
                    <td align="center" colspan="2"> 
                     
                        <select name=orders onChange='javascript:submit()'>
                          <option value=1 <%if orders=1 then%>selected<%end if%>>答题排行TOP 
                          10</option>
                          <option value=2 <%if orders=2 then%>selected<%end if%>>答对排行TOP 
                          10</option>
                          <option value=3 <%if orders=3 then%>selected<%end if%>>上传排行TOP 
                          10</option>
                        </select>
                      
                    </td>
                  </tr>
                  <tr bgcolor="<%=tabletitlecolor%>"> 
                    <td align="center" width="50%" height="16"> 姓名</td>
                    <td  align="center" width="50%" height="16"><%=ordername%></td>
                  </tr>
                  　　　　　　　 
                  <%Set ars = Server.CreateObject("ADODB.Recordset")
              select case orders
              case 1
			  sql="select top 10 username,userans from testuser order by userans desc"
              case 2
                 sql="select top 10 username,userok from testuser order by userok desc"
              case 3
			  sql="select top 10 username,userpass from testuser order by userpass desc"
              end select
              ars.open sql,aconn,1,1
              if ars.eof and ars.bof then
%>
                  <tr bgcolor=<%=TableBodyColor%>> 
                    <td colspan=2 height="32"><font color="<%=TableContentColor%>">　　还没有任何用户数据。</font></td>
                  </tr>
                  <%
	else

              i=0
              while not ars.eof and i<=10%>
                  <tr bgcolor="<%=tablebodycolor%>"> 
                    <td align="center" width="50%"><%=ars(0)%></td>
                    <td align="center" width="50%"><%=ars(1)%></td>
                  </tr>
                  <%ars.movenext
              i=i+1
              wend
              end if%>
                </table>
              </form>
          
      </td>
        <td width="240"  valign="top"><br><form name="form2" method="post" action="iitest.asp?action=dt">
                <table cellspacing="1" cellpadding="0" width="100%" border="0" bgcolor="#000000" height=260>
                  <tr > 
                    <td align="center" colspan="4" valign="center" bgcolor="<%=tablebodycolor%>"><img  src="pic/kxcd.jpg" > 
					</td>
					<tr>
					<td colspan="4" align="center"   bgcolor="<%=tablebodycolor%>">
                     
                      <%
		set ars2=server.createobject("adodb.recordset")
		sql="select id from [test]"
		ars2.open sql,aconn,1,1
		response.write "题库总数：<font color='#cc0000'><b>"&ars2.recordcount&"</font></b>"
		ars2.close
		%>
                      &nbsp;&nbsp;未审核上传题：<font color="#FF0000">&nbsp;<b> 
                      <%	set ars2=server.createobject("adodb.recordset")
									sql="select id from [testtemp]"
     								ars2.open sql,aconn,1,1
     								response.write ars2.recordcount
     								ars2.close%>
                      </b></font> 
                      <p> 
                        <select size="1" name="testlb">
                          <%set ars=server.createobject("adodb.recordset")
sql="select lb,id from [testlb]"
ars.open sql,aconn,1,1
while not ars.eof
  response.write "<option value='"&ars(1)&"'"&">"&ars(0)&"</option>"
  ars.movenext
wend
ars.close%>
                        </select>
                        &nbsp; 
                        <input type="submit" value="开始答题" name="btest">
                      </p>
                      
                <p>|&nbsp; <a href="addtest.asp">上载选择题</a>&nbsp;|&nbsp; <a href="addtest.asp?action=addtk">上载填空题</a>&nbsp;|</p>
                      </td>
                  </tr>
                </table>
              </form></td>
        <td width="114" valign="top"><br><table border=0 height=260 width="220" align=center cellspacing=1 bgcolor="#000000" cellpadding="0">
                <tr> 
                  <td align="middle" width="64" bgcolor="<%=tabletitlecolor%>"><b>问答配置</b></td>
                  <td colspan="3" bgcolor="<%=tabletitlecolor%>" align=center><B>相关参数值</B></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">时间间隔</td>
                  <td colspan="3" bgcolor="<%=tablebodycolor%>"><b><span lang="en-us">&nbsp;</span><font color="#FF0000"><%=adttime%></font> 
                    </b>Mins/次</td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">取题目数</td>
                  <td colspan="3" bgcolor="<%=tablebodycolor%>"><b><span lang="en-us">&nbsp;</span><font color="#FF0000"><%=ats%></font> 
                    </b>题/次</td>
                </tr>
                <tr> 
                  <td align="middle" width="64" bgcolor="<%=tabletitlecolor%>"><b>奖励配置</b></td>
                  <td colspan="3" bgcolor="<%=tabletitlecolor%>" align=center><B>相关参数值</B></td>
                </tr>
               
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">经验值</td>
                  <td colspan="3" bgcolor="<%=tablebodycolor%>"><span lang="en-us">&nbsp;</span>对<span lang="en-us"><font color="#FF0000"><b> 
                    +</b></font></span><b><font color="#FF0000"><%=ausere%></font></b>　　错<b><font color="#FF0000"><span lang="en-us"> 
                    -</span><%=ausere%></font></b></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">魅力值</td>
                  <td colspan="3" bgcolor="<%=tablebodycolor%>"><span lang="en-us">&nbsp;</span>对<b><font color="#FF0000"><span lang="en-us"> 
                    +</span><%=auserc%></font></b>　　错<b><font color="#FF0000"><span lang="en-us"> 
                    -</span><%=auserc%></font></b></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">现金</td>
                  <td colspan="3" bgcolor="<%=tablebodycolor%>"><span lang="en-us">&nbsp;</span>按题目不同增减</td>
                </tr>
                <tr> 
                  <td align="middle" width="64" bgcolor="<%=tabletitlecolor%>"><b>上载奖励</b></td>
                  <td colspan="3" bgcolor="<%=tabletitlecolor%>" align=center><b>相关参数值</b></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">成功收录</td>
                  
            <td colspan="3" bgcolor="<%=tablebodycolor%>"><b><font color="#ff0000"><span lang="en-us">&nbsp;</span><%=auserjl%></font></b><span lang="zh-cn"> 
              两银子</span>/题</td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tabletitlecolor%>"> 
                    <p align="center"><b>用户属性</b> 
                  </td>
                  <td colspan="3" bgcolor="<%=tabletitlecolor%>" align=center><b>相关参数值</b></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">上传题数</td>
                  <td width="25" bgcolor="<%=tablebodycolor%>"><font color="#FF0000">&nbsp;<b><%=aup%></b></font></td>
                  <td width="67" bgcolor="<%=tablebodycolor%>"> 
                    <p align="center">审核通过 
                  </td>
                  <td width="32" bgcolor="<%=tablebodycolor%>"><font color="#FF0000">&nbsp;<b><%=apass%></b></font></td>
                </tr>
                <tr> 
                  <td align="right" width="64" bgcolor="<%=tablebodycolor%>">答题数</td>
                  <td width="25" bgcolor="<%=tablebodycolor%>"><font color="#FF0000">&nbsp;<b><%=auserans%></b></font></td>
                  <td width="67" bgcolor="<%=tablebodycolor%>"> 
                    <p align="center">正 确 率 
                  </td>
                  <td width="32" bgcolor="<%=tablebodycolor%>"><font color="#FF0000">&nbsp;<b><%=auserl%>%</b></font></td>
                </tr>
              </table>
            </td>
      </tr>
      <tr bgcolor="<%=tabletitlecolor%>" align="center"> 
        
      <td width="596" colspan="3">&nbsp; </td>
      </tr>
    </table>
    <p>&nbsp;</p>
  </div>
  
<%
end if
call endline()
%>
<!--#include file="footer.asp"-->
