<%
set conn=server.createobject("adodb.connection")
conn.open "DBQ="&server.mappath("admin/mdb.mdb")&";Driver={Microsoft Access Driver (*.mdb)};"
%>
<%
Set rs=Server.CreateObject("ADODB.Recordset")
sql="Select * from news order by id desc"
rs.open sql,conn,1,1
IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
Page=Int(Abs(Request("page")))
End if
rs.pagesize =8
total  = rs.RecordCount
mypagesize=rs.pagesize
rs.absolutepage = page
%>
<html>
<head>
<title>咖啡設計最新動態</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/css.css" type="text/css">
<SCRIPT LANUGAGE="JavaScript">
<!--
function pop(pageurl) 
{
var
popwin=window.open(pageurl,"popWin","scrollbars=auto,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=350,height=350");
return false;
}
-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" background="images/bg_news.gif" leftmargin="0" topmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="4" height="100%">
  <tr> 
    <td class="td" valign="top"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td valign="top"> 
                  <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <%do while not rs.eof and mypagesize>0%>
                    <tr> 
                      <td height="30" class="td"> 　<img src="images/doc.gif" width="10" height="12"> 
                        <a href=show_news.asp?id=<%=rs("id")%> onClick="return pop(this.href)" target="_blank"><%=rs("theme")%> 
                        [阅读<%=rs("hit")%>次]</a>&nbsp; </td>
                    </tr>
                    <%     
    rs.movenext     
    mypagesize=mypagesize-1     
    loop     
  %>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="td" align="center" height="20">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <form name="form2" method="post" action="newsall.asp">
          <tr> 
            <td align="right">共<font color=#ce0000><b><%=rs.pagecount%></b></font>頁<font color=#ce0000><b><%=total%></b></font>條新聞 
              當前第<font color=#ce0000><b><%=page%></b></font>頁 <a href="newsall.asp?page=1">首頁</a> 
              <%if page>1 then%>
              <a href=newsall.asp?page=<%=page-1%>>上一頁</a> 
              <%else%>
              上一頁 
              <%end if%>
              <%if page<rs.pagecount   then%>
              <a href=newsall.asp?page=<%=page+1%>>下一頁</a> 
              <%else%>
              下一頁 
              <%end if%>
              <a href=newsall.asp?page=<%=rs.pagecount%>>尾頁</a> 
              <select name="page" class="input">
                <%for i=1 to rs.pagecount%>
                <option value=<%=i%>
									  <%
					  if i=page then
					  response.write" selected"
					  end if
					  %>
				>第<%=i%>頁</option>
                <%next%>
              </select>
              <input type="submit" name="Submit2" value="轉向" class="inputbb">
            </td>
          </tr>
        </form>
      </table>
    </td>
  </tr>
  <tr> 
    <td class="td" align="center" height="20"> 
      <input name="Button" type="button" class="inputbb" onclick=javascript:window.close() value="閉閉本窗口">
    </td>
  </tr>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
%>
