admin_ad.asp

来自「安全性好,适用于制作论坛和进行资源下载的个人和大型网站使用!」· ASP 代码 · 共 383 行 · 第 1/2 页

ASP
383
字号
    RS.AbsolutePage=CurPage
    rs.CacheSize = RS.PageSize'设置最大记录数
    Dim Totalcount
    Totalcount =INT(RS.recordcount)
    StartPageNum=1
    do while StartPageNum+10<=CurPage
    StartPageNum=StartPageNum+10
    Loop
    EndPageNum=StartPageNum+9
    If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
  <tr class=Hxcmsqs>
    <td width="5%" height="20" class=Hxcmsqs><div align="center">&nbsp;ID</div></td>
    <td width="17%" height="20" class=Hxcmsqs><div align="center">&nbsp;广告位置</div></td>
    <td width="10%" height="20" class=Hxcmsqs><div align="center">&nbsp;广告宽度</div></td>
    <td width="8%" height="20" class=Hxcmsqs><div align="center">&nbsp;广告高度</div></td>
    <td width="12%" height="20"  align="center">加入时间</td>
    <td width="12%" height="20"  align="center">到期时间</td>
    <td width="16%" height="23" align="center">操 作</td>
    <td width="10%" height="23" align="center">开关状态</td>
    <td width="10%" height="23" align="center">到期状态</td>
  </tr>
  <%I=0
p=RS.PageSize*(Curpage-1)
do while (Not RS.Eof) and (I<RS.PageSize)
p=p+1%>
  <tr class=Hxcmsds>
    <td height="19" align=center>&nbsp;<%=rs("AD_ID")%></td>
    <td height="19" align=left>&nbsp;<img src="img/arrow0.gif">&nbsp;<%=left(rs("AD_Title"),28)%></td>
    <td height="19" align=center>&nbsp;<%=rs("AD_width")%></td>
    <td height="19" align=center>&nbsp;<%=rs("AD_height")%></td>
    <td align="center"><%=rs("AD_AddTime")%></td>
    <td align="center"><%=rs("AD_StopTime")%></td>
    <td height="23" align=middle><div align="center"><a href="Admin_AD.asp?Action=Edit&AD_ID=<%=rs("AD_ID")%>">修改</a> 
        | <a href="Admin_AD.asp?Action=Del&AD_ID=<%=rs("AD_ID")%>">删除</a></div></td>
    <td height="23" align="center"><%If Rs("AD_on")=1 Then%><font color=red>关闭</font></a><%else%>正常<%End If%> </td>
    <td height="23" align="center"><%If Rs("AD_StopTime")-date()<=0 Then%><font color=red>已到期</font></a><%else%>尚有<%=Rs("AD_StopTime")-date()%>天<%End If%></td>
  </tr>
<%
    I=I+1
    RS.MoveNext              
    Loop
%>
  <tr class=Hxcmsds>
    <td height="23" colspan=9 align="center">页次: <font color="#CC0000"><%=CurPage%></font>/<%=TotalPages%> 页数: <a href="Admin_AD.asp?CurPage=<%=StartPageNum-1%>">&lt;&lt;</a> 
      <% For I=StartPageNum to EndPageNum                
      if I<>CurPage then %> <a href="Admin_AD.asp?CurPage=<%=I%>"><%=I%></a> <% else %> <%=I%> <% end if %> <% Next %> <% if EndPageNum<RS.Pagecount then %> <a href="Admin_AD.asp?CurPage=<%=EndPageNum+1%>">下页</a> 
      <%end if%>
      |<a href="Admin_AD.asp">刷 新</a></td>
  </tr>
  <tr class=Hxcmsqs>
    <td height="23" colspan=9 align="center">调用方式:Call
      Hx66_AD(<strong>广告ID</strong>) 
    </td>
  </tr>
</table>
</body>
</html>
<%
    end if
    rs.close
    set rs=nothing
    end if

    function strFilter(str)
		str=Replace(str,"'","''")
		str=replace(str,"|","/")
        str=Replace(str,"' ","'")
		strFilter=str
    end function

    if request("Action")="Save" then
    AD_Title=strFilter(request("AD_Title"))
    AD_Pic=strFilter(request("AD_Pic"))
    AD_Http=strFilter(request("AD_Http"))
    AD_width=strFilter(request("AD_width"))
    AD_height=strFilter(request("AD_height"))
    AD_StopTime=cint(request("AD_StopTime"))
    AD_Note=strFilter(request("AD_Note"))
    AD_Alt=strFilter(request("AD_Alt"))
    If AD_Title="" Then
    Response.Write "<script>alert(""请输广告标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If AD_width="" Then
    Response.Write "<script>alert(""请输广告宽度!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If AD_height="" Then
    Response.Write "<script>alert(""请输广告高度!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    sql="select * from Advertise "
    rs.open sql,conn,3,2
    rs.addnew
    rs("AD_Title")=AD_Title
    rs("AD_Pic")=AD_Pic
    rs("AD_Http")=AD_Http
    rs("AD_width")=AD_width
    rs("AD_height")=AD_height
    if Request("blank")<>"" then
    rs("blank")=Request("blank")
    else 
    rs("blank")=False
    end if
    if Request("ad_flash")<>"" then
    rs("ad_flash")=Request("ad_flash")
    else 
    rs("ad_flash")=False
    end if
    rs("AD_Note")=AD_Note
    rs("AD_AddTime")=Date()
    rs("AD_StopTime")=Date()+AD_StopTime
    rs("AD_AddAdmin")="admin"
    rs("AD_Alt")=AD_Alt
    rs.update
    rs.close 
    response.redirect "Admin_AD.asp"
    end if

    if request("Action")="Modify" then
    AD_ID=request.form("AD_ID")
    AD_Title=strFilter(request("AD_Title"))
    AD_Pic=strFilter(request("AD_Pic"))
    AD_Http=strFilter(request("AD_Http"))
    AD_width=strFilter(request("AD_width"))
    AD_height=strFilter(request("AD_height"))
    AD_news=cint(request("AD_news"))
    AD_StopTime=strFilter(request("AD_StopTime"))
    AD_Note=strFilter(request("AD_Note"))
    AD_on=request.form("AD_on")
    AD_Alt=strFilter(request("AD_Alt"))
    If AD_Title="" Then
    Response.Write "<script>alert(""请输广告标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If AD_width="" Then
    Response.Write "<script>alert(""请输广告宽度!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If AD_height="" Then
    Response.Write "<script>alert(""请输广告高度!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    rs.open "select * from Advertise where AD_ID="&AD_ID,conn,3,2
    rs("AD_Title")=AD_Title
    rs("AD_Pic")=AD_Pic
    rs("AD_Http")=AD_Http
    if Request("blank")<>"" then
    rs("blank")=Request("blank")
    else 
    rs("blank")=False
    end if
    if Request("ad_flash")<>"" then
    rs("ad_flash")=Request("ad_flash")
    else 
    rs("ad_flash")=False
    end if
    rs("ad_on")=cint(AD_on)
    rs("AD_width")=AD_width
    rs("AD_height")=AD_height
    rs("AD_Note")=AD_Note
    if AD_news=1 then
    rs("AD_AddTime")=Date()
    end if
    rs("AD_StopTime")=AD_StopTime
    rs("AD_AddAdmin")="admin"
    rs("AD_Alt")=AD_Alt
    rs.update 
    rs.close 
    response.Redirect("Admin_AD.asp")
    end if 

    if request("Action")="Del" then
    AD_ID=Request.QueryString("AD_ID")
    delsql="delete from Advertise where AD_ID="&AD_ID
    conn.execute(delsql)
    conn.close
    response.redirect"Admin_AD.asp"
    end if
'****************************************************
' Hxcms Ver7.5       Power by Hx66.net
' Web: http://www.Hx66.net,http://www.Hx66.net/home
' Copyright (C) 2006 Hx66.net All Rights Reserved.
'****************************************************
%>
</body>
</html>

⌨️ 快捷键说明

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