<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	End If
	sid=ReplaceBadChar(int(Request.Cookies("admin_school_id")))
	if Trim(Request.QueryString("action"))="del" then
		sql_up="delete from smailbox where id="&ReplaceBadChar(Trim(Request.QueryString("id")))&" and sid="&sid&""
		conn.execute sql_up
		response.write"<SCRIPT language=JavaScript>alert('站内信息删除成功，现在为您返回');"
		response.write"this.location.href='mailbox.asp';</SCRIPT>"
		response.end
	end if
%>
<HTML>
<head>
<title><%= homename %>--院校会员中心</title>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link href="images/1.css" rel="stylesheet" type="text/css">
<link href="images/2.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0">
<table width="550"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/m_11.gif" width="550" height="9"></td>
  </tr>
  <tr>
    <td background="images/m_13.gif"><div align="left">
      <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="left"><img src="images/jianli-10.gif" width="136" height="33"></div>
            <TABLE width="100%" border=0 cellPadding=0 cellSpacing=1 bgColor=#83b629 align="center">
              <TBODY>
                <TR>
                  <TD height="116" vAlign=top bgColor=#ffffff>
				  <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                    <TBODY>
                      <TR>
                        <TD vAlign=top width="100%" height="116">
						<TABLE height=24 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                            <TBODY>
                              <TR>
                                <TD bgColor=#83b629 height=21><FONT style="FONT-SIZE: 13px" face=Verdana color=#ffffff><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;站内信箱 </STRONG></FONT></TD>
                              </TR>
                              <TR>
                                <TD bgColor=#e2e2e2 height=2></TD>
                              </TR>
                            </TBODY>
                          </TABLE>
                            <DIV align=center>
                              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table2">
                                <tr>
                                  <td valign="top">
                                        <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
                                          <tr>
                                            <td width="7%" height="30" align="center" bgcolor="#efefef">编号</td>
                                            <td width="15%" align="center" bgcolor="#efefef">发送者姓名</td>
                                            <td width="25%" align="center" bgcolor="#efefef">邮件标题</td>
                                            <td width="28%" align="center" bgcolor="#efefef">邮件简介</td>
                                            <td width="9%" align="center" bgcolor="#efefef">状态</td>
                                            <td width="16%" align="center" bgcolor="#efefef">操作</td>
                                          </tr>
<%
	dim i,intPage,page,pre,last,filepath,searchtype '定义变量
	set rs = server.CreateObject("adodb.recordset")'创建对象
	sql="select * from smailbox where sid="&sid&" order by id desc"'定义SQL语句
	rs.PageSize = 8 '这里设定每页显示的记录数
	rs.CursorLocation = 3
	rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs.PageCount then
				intpage = rs.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs.eof then
		rs.AbsolutePage = intpage
	end if
	if rs.eof then
%>
		<tr>
               <td height="30" align="center" bgcolor="#f9f9f9" colspan="6">暂时还没有您的站内信息</td>
           </tr>
<%
	else
		for i=1 to rs.PageSize
		if rs.EOF or rs.BOF then exit for
%>                                          <tr>
                                            <td height="30" align="center" bgcolor="#f9f9f9"><%= rs("id") %></td>
                                            <td align="center" bgcolor="#f9f9f9"><%= rs("sendname")%></td>
                                            <td align="center" bgcolor="#f9f9f9"><a href="#" onClick="window.open('msnread.asp?id=<%= rs("id") %>','网愿科技','height=310, width=422, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')"><%= rs("title") %></a></td>
                                            <td align="center" bgcolor="#f9f9f9"><a href="#" onClick="window.open('msnread.asp?id=<%= rs("id") %>','网愿科技','height=310, width=422, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')"><%= left(rs("mainbox"),6) %></a></td>
                                            <td align="center" bgcolor="#f9f9f9"><% if rs("newmail")=0 Then Response.Write("<font color='#FF0000'>未阅读</font>") else Response.Write("已阅读")%></td>
                                          <td align="center" bgcolor="#f9f9f9"><A href="#" title="系统信息，无法回复">回复</A> ||<a href="department_edit.asp?id=<%= rs("id") %>"></a> <a href="?action=del&id=<%= rs("id") %>">删除</a></td>
                                          </tr>
<%
		rs.movenext
		next
	End If
%>
<tr bgcolor="#f9f9f9">
<td height=30 colspan=6 valign=bottom>
<table width="99%" border="0" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>"><%=i%></option>
<%
	end if
	next
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	
%>
</select>页</font></td>
</tr>
</table></td>
                                          </tr>
                                        </table>
									</td>
                                </tr>
                             </table>
                           </DIV>
						</TD>
                      </TR>
                    </TBODY>
                  </TABLE>
				  </TD>
                </TR>
              </TBODY>
            </TABLE>
			</td>
        </tr>
      </table>
    </div>
	</td>
  </tr>
  <tr>
    <td background="images/m_13.gif"></td>
  </tr>
  <tr>
    <td><img src="images/m_12.gif" width="550" height="9"></td>
  </tr>
</table>
</body>
</html>