<!--#include file="../siteconfig/conn.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_ClassFunction.asp"-->
<HTML>
<HEAD>
<TITLE>广告管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />

</HEAD>

<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<h3>广告管理</h3>
<%rs.open"select * from IndexAd",conn,1,3
dim ClassCount,pn
pn=Request("pn")
if pn="" then pn=1
ClassCount = int(rs.recordcount)
redim ClassArray(ClassCount,4)
dim j,i
j=0
while not rs.eof and not rs.bof
   ClassArray(j,0)=rs("IndexAd_Id")
   ClassArray(j,1)=Left(rs("IndexAd_Title"),6)
   ClassArray(j,2)=rs("IndexAd_StartTime")
   ClassArray(j,3)=rs("IndexAd_EndTime")
   ClassArray(j,4)=rs("IndexAd_Label")
   j=j+1
rs.movenext
wend
rs.close%>
<table width="96%" border="0" cellspacing="1" cellpadding="8" align="center" class="tb tb2 fixpadding">
  <tr>
    <td class="partition">ID</td>
    <td class="partition">广告名称</td>
    <td class="partition">起始时间</td>
    <td class="partition">结束时间</td>
    <td class="partition">广告标签</td>
    <td class="partition">编辑</td>
    <td class="partition">删除</td>
  </tr>
<%dim ClassPageCount,ClassPageSize
ClassPageSize=15
ClassPageCount=int(ClassCount/ClassPageSize)+1
if pn=1 then 
  i=0
else
  i=ClassPageSize*pn-ClassPageSize
end if
for i=i to int(pn*ClassPageSize)-1
if i=ClassCount then exit for
%>
  <tr>
    <td class="vtop lineheight"><%=ClassArray(i,0)%></td>
    <td class="vtop lineheight" title="<%=ClassArray(i,1)%>"><%=Left(ClassArray(i,1),6)%></td>
    <td class="vtop lineheight"><%=ClassArray(i,2)%></td>
    <td class="vtop lineheight"><%=ClassArray(i,3)%></td>
    <td class="vtop lineheight"><%=ClassArray(i,4)%></td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_Ad_IndexUp.asp?IndexAd_Id=<%=ClassArray(i,0)%>',1,450,350);return false">编辑</a></td>
    <td class="vtop lineheight"><a href="#" onClick="javascript:DivOpenClose('Admin_Ad_IndexDel.asp?IndexAd_Id=<%=ClassArray(i,0)%>',1,400,200);return false">删除</a></td>
  </tr>
<%
next%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center"><a href="#" onClick="javascript:DivOpenClose('Admin_Ad_IndexAdd.asp',1,450,500);return false"><font color="#669900">添加广告</font></a> 
  <%if pn=1 then%>
<font color="#999999">首页</font> <font color="#999999">上一页</font> <a href='?pn=2'>下一页</a> <a href='?pn=<%=ClassPageCount%>'>未页</a>
<%else
   if ClassPageCount<>int(pn) then%>
      <a href='?pn=1'>首页</a> <a href='?pn=<%=pn-1%>'>上一页</a> <a href='?pn=<%=pn+1%>'>下一页</a> <a href='?pn=<%=ClassPageCount%>'>未页</a>
     <%else%>
      <a href='?pn=1'>首页</a> <a href='?pn=<%=ClassPageCount-1%>'>上一页</a> <font color="#999999">下一页</font> <font color="#999999">未页</font>
     <%end if
end if%>
每页<%=ClassPageSize%>条 当前第<%=pn%>页 共<%=ClassPageCount%>页
</div></td>
    <td><form name="GoFrom" method="post" action="?" id="GoFrom" onSubmit="return GoCheck();" style="margin-bottom:0px;"><input name="pn" type="text" value="<%=pn%>" size="3" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px"><input name="submit" type="submit" value="跳到" style="color: #669900;    background-color: #FFFFFF; border: #006699; border-style: dashed; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px">
</form></td>
  </tr>
</table>

<div id="DivMenu" style="position:absolute; width:100%; height:100%; z-index:1; left: 0px; top: 0px; filter:Alpha(opacity=50); background-color: #E8E8E8; layer-background-color: #E8E8E8; border: 1px none #000000; visibility: hidden;"></div>
<div id="DivIframe" style="position:absolute; width:0px; height:0px; z-index:1; visibility: hidden; overflow: visible; filter:Alpha(opacity=80);"><iframe id=OpenIframe name=OpenIframe src=londing.html width=100% height=100% frameborder=0 scrolling=no>修改分类</iframe>
</div>
</BODY>
</HTML>

