<!--#include file="inc/right.asp"--> 
<!--#include file="inc/conn.asp"-->
<script language=Javascript>
<!--
function DoEmpty(params)
{
if (confirm("真的要删除这条记录吗？删除后此记录里的所有内容都将被删除并且无法恢复！"))
window.location = params ;
}
//-->
</script>
<%
if Request("wor")="del" then
sql="delete from Result where id="&Request("id")
Conn.execute(sql)
sql="update Info set xkrs=xkrs-1 where id="&Request("cid")
conn.execute(sql)
Response.Redirect "?action=list"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=sysConfig%></title>
<link href="images/main.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF">
	<BR>
        <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="7" class="optiontitle">选课记录列表</td>
        </tr>	  
		<tr align="center" bgcolor="#ebf0f7">
		  <td width="10%">序号</td>
		  <td>学号</td>
		  <td>姓名</td>
		  <td>课程</td>
		  <td>选课类型</td>
		  <td>提交时间</td>
          <td width="15%">操作</td>
		</tr>
<%
 sql="select * from Result order by id desc"
 set rs=server.createobject("adodb.recordset") 
 rs.open sql,conn,1,1
 IF Not rs.eof Then
 proCount=rs.recordcount
	rs.PageSize=15
		if not IsEmpty(Request("ToPage")) then
	       ToPage=CInt(Request("ToPage"))
		   if ToPage>rs.PageCount then
					rs.AbsolutePage=rs.PageCount
					intCurPage=rs.PageCount
		   elseif ToPage<=0 then
					rs.AbsolutePage=1
					intCurPage=1
				else
					rs.AbsolutePage=ToPage
					intCurPage=ToPage
				end if
			else
			        rs.AbsolutePage=1
					intCurPage=1
		  end if
	intCurPage=CInt(intCurPage)
	For i = 1 to rs.PageSize
	if rs.EOF then     
	Exit For 
	end if
%>
		<tr align="center" bgcolor='#FFFFFF' onmouseover='this.style.background="#F2FDFF"' onmouseout='this.style.background="#FFFFFF"'>
		  <td><%=rs("id")%></td>
          <td><%=rs("sno")%></td>
          <td><%=rs("sname")%></td>
          <td><%=rs("cname")%></td>
          <td>选课</td>
          <td><%=rs("addtime")%></td>
          <td align="center"><img src="images/drop.gif" align="absmiddle"><a href="javascript:DoEmpty('?wor=del&id=<%=rs("id")%>&cid=<%=rs("cid")%>&ToPage=<%=intCurPage%>')">删除</a></td>
		</tr>
<%
rs.MoveNext 
next
%>
		<tr align="center" bgcolor="#ebf0f7">
           <form name="form1" method="post" action="">
		   <td colspan="7">
                <span style="font-size: 9pt;"> 总共：<font color="#ff0000"><%=rs.PageCount%></font>页, <font color="#ff0000"><%=proCount%></font>条记录, 当前页：<font color="#ff0000"> <%=intCurPage%> </font>
                <% if intCurPage<>1 then%>
                <a href="?ToPage=1">首页</a>|<a href="?ToPage=<%=intCurPage-1%>">上一页</a>|
                <% end if
                if intCurPage<>rs.PageCount then %>
                <a href="?ToPage=<%=intCurPage+1%>">下一页</a>|<a href="?ToPage=<%=rs.PageCount%>"> 最后页</a>|
                <% end if%>
                跳转：
                <input name="topage" type="text" size="2" value="<%=intCurPage%>">
                <input type="submit" name="go" value="转到">
                </span>
            </td>
		  </form>
		</tr>
<%
else
%>
          <tr align="center" bgcolor='#FFFFFF'>
            <td colspan="7">对不起！目前库中还没有选课记录信息！</td>
          </tr>
<%
end if
rs.close
set rs=nothing
%>
      </table> 
    </td>
  </tr>
</table>
</body>
</html>