?? list.asp
字號(hào):
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<%
if Request.Cookies("globalec")("globalecmaster")="" or Request.Cookies("globalec")("masterflag")="" then
response.write "<script language='javascript'>"
response.write"this.location.href='../login.asp';</SCRIPT>"
response.end
end if
if instr(Request.Cookies("globalec")("masterflag"),"113")=0 then
response.redirect "../err.asp"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>GlobalEC 廣告管理</title>
<SCRIPT LANGUAGE="JavaScript">
function delad(){
if (confirm("確定要?jiǎng)h除這則廣告么?刪除后不可以再恢復(fù)哦!?")){return true;}
return false;
}
</SCRIPT>
<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
Dim pagesize,rs,sql,curpage,strcate,i
Dim id,ADID,ADViews,ADHits,ADType,ADSrc,ADLink,ADAlt,ADWidth,ADHeight,ADNote,ADStopViews,ADStopHits,ADStopDate
pagesize=5 '設(shè)置每頁顯示廣告樹目
If Request.QueryString("page")="" Then
curpage = 1
Else
curpage = cint(Request.QueryString("page"))
End If
Set rs = Server.CreateObject("ADODB.Recordset")
if Request.QueryString("action")="stop" then
sql = "SELECT * FROM [ad] where ( ADStopViews <> 0 and ADViews > ADStopViews) or ( ADStopHits <> 0 and ADHits > ADStopHits) or ( ADStopDate < getdate() ) ORDER BY id DESC"
Else
sql = "SELECT * FROM [ad] ORDER BY id DESC"
end If
rs.open sql, conn, 1, 1
'監(jiān)測(cè)是否存在錯(cuò)誤
If err.number <> 0 Then
Response.Write "出現(xiàn)意外錯(cuò)誤"
Response.End
End If
If rs.bof or rs.eof Then
rs.Close
if Request.QueryString("action")="stop" Then
%>
<table width="760" height="200" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height="22" colspan="2" class="tableHeaderText" align="center">廣 告 列 表 管 理</th>
</tr>
<tr>
<td align="center" class="forumRow"><font color="#990000">暫時(shí)沒有過期廣告!</font></td>
</tr>
</table>
<br>
<!--#include file="../copy.asp" -->
<%Else%>>
<table width="760" height="200" border="0" align="center" cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height="22" colspan="2" class="tableHeaderText" align="center">廣 告 列 表 管 理</th>
</tr>
<tr>
<td align="center" class="forumRow">暫時(shí)沒有任何廣告!-- <a href=add.asp>立即添加新廣告</a></td>
</tr>
</table>
<br>
<!--#include file="../copy.asp" --> <%
End If
Response.End
End If
rs.pagesize = pagesize
rs.absolutepage = curpage
%>
<table width='760' height="22" border=0 align=center cellpadding=0 cellspacing=0 class="tableBorder">
<tr>
<th width="60" height="22" align="center" class="tableHeaderText"><a href="?page=<%=cstr(curpage)%>&pagesize=<%=pagesize%>"><font color="#FFFFFF">[刷新]</font></a></th>
<th width="700" height="22" align=right class="tableHeaderText">
<%If curpage = 1 Then%>
[首頁] [上一頁]
<%Else%>
[<a href='?page=1'>首頁</a>] [<a href='?page=<%=cstr(curpage-1)%>'>上一頁</a>]
<%End If
If curpage = rs.pagecount Then%>
[下一頁] [尾頁]
<%Else%>
[<a href='?page=<%=cstr(curpage+1)%>'>下一頁</a>] [<a href='?page=<%=cstr(rs.pagecount)%>'>尾頁</a>]
<%End If%> </th>
</tr>
</table>
<table width='760' border="0" align=center cellpadding=3 cellspacing=1 class="tableBorder">
<% Do While NOT rs.eof
id=rs("id")
ADID=rs("ADID")
ADViews=rs("ADViews")
ADHits=rs("ADHits")
ADType=rs("ADType")
ADSrc=rs("ADSrc")
ADLink=rs("ADLink")
ADAlt=rs("ADAlt")
ADSrc=rs("ADSrc")
ADWidth=rs("ADWidth")
ADHeight=rs("ADHeight")
ADNote=rs("ADNote")
ADStopViews=rs("ADStopViews")
ADStopHits=rs("ADStopHits")
ADStopDate=rs("ADStopDate")%>
<tr>
<td width="25%" height="25" class="forumRowHighlight">名稱:<%=ADID%> <%if IsStop(ADViews,ADStopViews,ADStopHits,ADHits,ADStopDate) Then Response.Write(" <font color=red>(已過期)") End If%></td>
<td width="25%" class="forumRowHighlight">顯示:<%=ADViews%></td>
<td width="25%" class="forumRowHighlight">點(diǎn)擊:<%=ADHits%></td>
<td width="25%" class="forumRowHighlight">管理:<a href="edit.asp?id=<%=id%>">編輯</a> <a href="createjs.asp?id=<%=ADID%>">生成JS</a> <a href="del.asp?id=<%=id%>" onclick='return delad();'>刪除</a></td>
</tr>
<tr>
<td width="50%" height="25" colspan=2 class="forumRow">廣告類型:<%=ShowAdType(ADType,rs("ADSrc"))%></td>
<td colspan=2 width="50%" class="forumRow">顯示地址:
<%If ADType<>6 Then%><a href=<%=ADSrc%> target=_blank><font color="#000000"><%=ADSrc%></a><%else%>不顯示<%end if%></td>
</tr>
<tr>
<td height="25" colspan=2 class="forumRow">鏈接地址:<a href=<%=ADLink%> target=_blank><font color="#000000"><%=ADLink%></a></td>
<td colspan=2 class="forumRow">提示文字:<%=ADAlt%></td>
</tr>
<tr>
<td height="25" colspan=2 class="forumRow">廣告規(guī)格:<%=ADWidth%>×<%=ADHeight%></td>
<td colspan=2 class="forumRow">備 注:<%=ADNote%></td>
</tr>
<%
i=i+1
rs.movenext
If i>=rs.PageSize Then Exit Do
Loop
%>
<tr align="center">
<td height="25" colspan=6 class="forumRowHighlight"> <center> 第<%=cstr(curpage)%>頁 總<%=cstr(rs.pagecount)%>頁 本頁<%=cstr(i-1)%>條 總<%=cstr(rs.recordcount)%>條 </td>
</tr>
</table>
<br>
<!--#include file="../copy.asp" -->
<p></p>
</body>
</html>
<%
rs.close
set rs=nothing
conn.Close
set conn=nothing
'檢測(cè)是否過期
function IsStop(ADViews,ADStopViews,ADStopHits,ADHits,ADStopDate)
IsStop=false
If ( ADStopViews <> 0 and ADViews > ADStopViews) Then
IsStop=true
Exit function
ElseIf ( ADStopHits <> 0 and ADHits > ADStopHits) Then
IsStop=true
Exit function
ElseIf ( DateDiff("d",Now(),ADStopDate)<1 ) Then
IsStop=true
Exit function
End If
end function
'判斷廣告類型
function ShowAdType(ADType,ADSrc)
Dim ADExt
ADExt="圖片"
If InStr(1,ADSrc,".swf",1)>0 Then ADExt="FLASH"
Select Case ADType
Case 1
ShowAdType="普通"&ADExt
Case 2
ShowAdType="全屏浮動(dòng)"&ADExt
Case 3
ShowAdType="上下浮動(dòng) - 右"&ADExt
Case 4
ShowAdType="上下浮動(dòng) - 左"&ADExt
Case 5
ShowAdType="漸隱消失"&ADExt
Case 6
ShowAdType="網(wǎng)頁對(duì)話框"
Case 7
ShowAdType="移動(dòng)透明對(duì)話框"
Case 8
ShowAdType="打開新窗口"
Case 9
ShowAdType="彈出新窗口"
Case 10
ShowAdType="對(duì)聯(lián)式廣告"
Case else
ShowAdType="<font color=red><b>錯(cuò)誤!將不能正確顯示</b>"
End Select
end function
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -