⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gg.asp

📁 wap建站
💻 ASP
字号:
<%
if session("admin")="" then
  response.redirect "admin.asp"
end if
%>
<!--#include file="conn.asp"-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>广 告 管 理</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<br><br>
<div align="center"><center>
<table cellspacing="0" width="80%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20">
<font color="#FFFFFF"><center><p><b>广 告 管 理</b></font>
</td>
</tr>
<tr align="center">
<td width="100%">
<%
p=cint(request.QueryString("p"))
if p="" or p<1 then p=1

set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from [ad] order by id"
rs.open rsstr,conn,1,2

maxpage=int((rs.recordcount-1)/10)+1
if p>maxpage then p=maxpage
%>
<table border="0" cellspacing="1" width="100%">
<tr>
<form name="show" method="POST" action="adadd.asp">
<td><input type="submit" value="添 加 广 告" name="title">
</td></form>
</tr>
<tr>
<td width="15%" align="center" height="30">
广告标题
</td>
<td width="15%" height="30">
所属栏目
</td>
<td width="30%" height="30">
广告地址
</td>
<td>
广告操作
</td>
</tr>
<%
if rs.recordcount = 0 then response.write("<tr><td>暂无广告信息!</td><form name='show' method='POST' action='adadd.asp'><td><input type='submit' value='添 加' name='title'></td></form></tr>")
if rs.recordcount > 0 then
rs.Move((p-1)*10)
dim j
j=1
do while ((not rs.EOF) and j<=10)
%>

<%
set rsc=Server.CreateObject("ADODB.Recordset")
rscstr="select * from [class] where [ClassID]="& rs("classid")
rsc.open rscstr,conn,1,2
%>

<tr>
<td width="25%" align="center" height="30">
<%=rs("adtitle")%>
</td>
<td width="10%" height="30">
<%if rs("classid")=0 then%>
网站首页
<%else%>
<%=rsc("ClassName")%>栏目
<%end if%>
</td>
<td width="30%" align="center" height="30">
<%=rs("adurl")%><br/>
</td>
<form name="show" method="POST" action="adedit.asp?ids=<%=rs("classid")%>&amp;id=<%=rs("id")%>">
<td><input type="submit" value="修 改" name="title">
</td></form>
<form name="show" method="POST" action="adok.asp?ids=<%=rs("classid")%>&amp;id=<%=rs("id")%>">
<td><input type="submit" value="删 除" name="title">
</td></form>
</tr>
<%
rs.MoveNext
j=j+1
loop
end if

if p*10<rs.recordcount then response.write("<a href='?ids=" & ids & "&amp;p=" & p+1 & "'>[下一页]</a>&nbsp;")
if p>1 then response.write("<a href='?ids=" & ids & "&amp;p=" & p-1 & "'>[上一页]</a>&nbsp;")
if p*10<rs.recordcount or p>1 then response.write("[第" & p & "页/共" & (int((rs.recordcount-1)/10)+1) & "页]<br/>")
%>
<%if p*10<rs.recordcount or p>1 then%>
<form name="show" method="POST" action="index.asp">
<input name="p" type="text" emptyok="true" size="3" value="<%if p>=maxpage then response.write(p-1) else response.write(p+1)%>"/>
<input type="submit" value="[跳转页面]" name="title">
</form>
<%end if%>
</table>
</table>
</center>
</div>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -