<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>千纸鹤-脑筋急转弯!</title>
<style type="text/css">
<!-- 
td           { font-size: 12px; line-height: 17px }
body         { font-size: 12px; line-height: 17px }
p            { margin-top: 1px; margin-bottom: 1px }
a:link       { text-decoration: none; color: black }
a:visited    { text-decoration: none; color: black }
a:active     { text-decoration: none }
a:hover      { text-decoration: underline; color: red }
body,p,td    { font-family:Verdana, Arial, Helvetica, sans-serif; }
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//-->
</script>
</head>
<BASE onmouseover="window.status=' 欢迎您光临千纸鹤网络-脑筋急转弯,请将本站推荐给你网上的朋友，谢谢！千纸鹤 ';return true">
<body background="images/bg.gif" topmargin="0">
<div align="center">
  <center>
    <table width="758" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#c8e485" bordercolordark="#FFFFFF" bgcolor="#c8e485">
      <tr>
      <td width="10%" height="25" bgcolor="#c8e485" align="center"><img border="0" src="images/num.gif"></td>
      <td width="75%" height="25" bgcolor="#c8e485" align="center"><img border="0" src="images/question.gif"></td>
      <td width="15%" height="25" bgcolor="#c8e485" align="center"><img border="0" src="images/key.gif"></td>
    </tr>
<%              
sql="select * from data order by id desc"              
set rs=server.createobject("adodb.recordset")              
rs.open sql,connstr,1,1              
if rs.eof then              
response.write "<font color=#FF0000>暂时没有任何题目！</font>"                          
else              
const maxperpage=50              
dim currentpage              
rs.pagesize=maxperpage              
currentpage=request.querystring("pageid")              
if currentpage="" then              
currentpage=1              
elseif currentpage<1 then              
currentpage=1              
else              
currentpage=clng(currentpage)              
	if currentpage > rs.pagecount then              
	currentpage=rs.pagecount              
	end if              
end if              
              
if not isnumeric(currentpage) then              
currentpage=1              
end if              
dim totalput,n              
totalput=rs.recordcount              
if totalput mod maxperpage=0 then              
n=totalput\maxperpage              
else              
n=totalput\maxperpage+1              
end if              
if n=0 then              
n=1              
end if              
rs.move(currentpage-1)*maxperpage              
i=0     
w=1         
do while i< maxperpage and not rs.eof               
%>
    <tr>
      <td width="81" bgcolor="#c8e485">
        <p align="center"><font color="#800000"><%=w%></font></p>
      </td>
      <td width="655" bgcolor="#c8e485">&nbsp;<font color="#008080"><%=rs("question")%></font>    
      <%if session("admin")<>"" then%>                                                                          
    &nbsp;<a href="edit.asp?id=<%=rs("id")%>"><font color="#008000">编辑</font></a>&nbsp;<a href="del.asp?id=<%=rs("id")%>"><font color="red">删除</font></a>     
        <%end if%>     
      </td>     
      <td width="126" bgcolor="#c8e485">  
      <p align="center"> 
      <INPUT onClick="MM_popupMsg('答案：<%=rs("key")%>')" type=button value=答案 name=button<%=rs("id")%> style="font-size: 12px"></p> 
      </td>    
    </tr>    
    <%                                                                                          
    i=i+1      
    w=w+1                                                                      
    rs.movenext                                                                             
    loop                                                                                                  
    end if        
    rs.close                                                   
    %>     
    <tr>    
      <td height="25" bgcolor="#c8e485" colspan="3">    
      <p align="center">页数：<%=currentpage%>/<% =n%>                                                                      
   	<%k=currentpage                                                                                              
   	if k<>1 then%>                                                                         
   	<a href="index.asp?pageid=1">首页</a>                                                                                              
   	<a href="index.asp?pageid=<%=k-1%>">上一页</a>                                                                                              
   	<%else%>                                                                          
   	首页&nbsp;上一页                                                                                              
   	<%end if%>                                                                         
   	<%if k<>n then%>                                                                                              
   	<a href="index.asp?pageid=<%=k+1%>">下一页</a>                                                                                              
   	<a href="index.asp?pageid=<%=n%>">尾页</a>                                                                                              
   	<%else%>                                                                          
   	下一页&nbsp;尾页                                                                                              
   	<%end if%>                                                                         
        共有<%=totalput%>道题目</p>     
      </td>     
    </tr> 
       
  </table>    
  </center>    
</div>                                                                  
</body>                                                                          
</html>                                                                          