addads.asp

来自「新闻发布系统」· ASP 代码 · 共 405 行

ASP
405
字号
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file=config.asp -->
<!--#include file="check.asp"-->
<html><head>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<meta http-equiv=Pragma content=no-cache>
<link href=../Fsmanage/css/css.css rel=STYLESHEET type=text/css>
<script language=JavaScript>
<!--

function opw(url,name, width, height) { //v2.0
window.open(url,name,''+'width='+width+',height='+height+',scrollbars=yes'+'');

function checkform00()
{

  if (addadschk.itype.value == "nothingbeselected")
  {
    alert("请选择显示类型!");
    addadschk.itype.focus();
    return (false);
  }
  
  if (addadschk.name.value == "")
  {
    alert("请输入站名!");
    addadschk.name.focus();
    return (false);
  }
  return (true);
}
}
//-->
</script>
<title>广告发布管理系统</title>
</script>
<base target=_top>
</head><body marginwidth=0 marginheight=0>


<%
if session("Name")="" or session("PassWord")="" or session("Userid")=Userid then
Response.Redirect "../admin_index.asp"
else
%>
<div align=center><center>
    <table width=98% border=0 align="center" cellpadding=0 cellspacing=1 bgcolor=#7ED3A7>
      <tr bgcolor=#ffffff align=center valign=top> 
        <td> 
          <!--#include file=menu.asp -->
        </td>
      </tr>
      <tr bgcolor=#ffffff align=center valign=top> 
        <td> <table border=0 width=100% cellspacing=0 cellpadding=0>
            <tr> 
              <td height="26" align=center bgcolor="#7ED3A7">
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="../Fsmanage/images/bg1.gif">
                  <tr> 
                    <td height="26"> <div align="center"><b> 
                        <%
adsconn.open adsdata

%>
                        <font size="3" color=red><b>添加广告</b></font> </b> </div></td>
                  </tr>
                </table></td>
            </tr>
          </table>
          
        </td>
      </tr>
      <tr bgcolor=#ffffff align=center valign=top>
        <td> <form name="addadschk"  method=POST action="addads.asp?job=add" onsubmit="return checkform00()" target="_self">
            <table width=99% border=0 align="center" cellpadding=3 cellspacing=1 bgcolor="#34BD00">
              <%
if request.querystring("job")="add" then
if request.form("name")=" " or Request.form("username")="" or Request.form("gif_url")="" or Request.form("url")="" or Request.form("width")="" or Request.form("height")="" then
Response.write"<script>alert(""带*号必须填写 "");location.href=""javascript:history.back()"";</script>"
Response.end
end if
getname = Trim(Request("name"))
geturl = Trim(Request("url"))
getgif = Trim(Request("gif_url"))
getplace =trim(Request("placeid"))
getwin =trim(Request("window"))
getclass=trim(Request("class"))
gettype=trim(Request("itype"))
getwidth=trim(Request("width"))
getheight=trim(Request("height"))
getnote=trim(Request("note"))
getusername=trim(Request("username"))
getcontact=trim(Request("contact"))

if getclass=0 then
getclicks=0
getshows=0
gettime=date()

elseif getclass=1 then
getclicks=trim(request("clicks1"))
getshows=0
gettime=date()

elseif getclass=2 then
getclicks=0
getshows=trim(request("shows2"))
gettime=date()

elseif getclass=3 then
getclicks=0
getshows=0
gettime=trim(request("time3"))

elseif getclass=4 then
getclicks=trim(request("clicks4"))
getshows=trim(request("shows4"))
gettime=date()

elseif getclass=5 then
getclicks=trim(request("clicks5"))
getshows=0
gettime=trim(request("time5"))

elseif getclass=6 then
getclicks=0
getshows=trim(request("shows6"))
gettime=trim(request("time6"))

elseif getclass=7 then
getclicks=trim(request("clicks7"))
getshows=trim(request("shows7"))
gettime=trim(request("time7"))
end if

set adsrs=server.createobject("adodb.recordset")
adssql="select * from price where price='"&request("price")&"'"
adsrs.open adssql,adsconn,1,1
getpriceid=adsrs("priceid")
adsrs.close

set adsrs=server.createobject("adodb.recordset")
adssql="select * from ads"
adsrs.open adssql,adsconn,1,3
adsrs.AddNew
adsrs("act") = 1
adsrs("sitename") = getname
adsrs("showtype") = gettype
adsrs("url") = geturl
adsrs("gif_url") = getgif
adsrs("window") = getwin
adsrs("width") = getwidth
adsrs("height") = getheight
adsrs("class") = getclass
adsrs("clicks") = getclicks
adsrs("shows") = getshows
adsrs("lasttime") = gettime
adsrs("note") = getnote
adsrs("username") = getusername
adsrs("contact") = getcontact
adsrs("price") = request("price")
adsrs("place") = request("placeid")
adsrs("priceid")=getpriceid
adsrs("regtime") = now()
adsrs("time") = date()

adsrs.update
adsrs.close
set adsrs=nothing
adsconn.close
set adsconn=nothing
response.redirect"addads_place.asp?job=finish"
end if

%>
              <tr bgcolor=#F7FFF4> 
                <td>广告类型</td>
                    
                <td> 
                  <input type="radio" name="itype" value="i" checked>
                      图片 
                      <input type="radio" name="itype" value="f">
                      Flash</td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td width=85>广告具体位置:</td>
                    
                <td width=540>广告位种类:<font color=blue><%=request("price")%></font> 
                  <input type=hidden value="<%=request("price")%>" name="price"> 
                      &nbsp;&nbsp;第 <font color=blue><b><%=request("placeid")%></b></font> 
                      <input type=hidden value="<%=request("placeid")%>" name="placeid">
                      位 <br>
                      (相同广告位如果有多个广告记录,将轮显所有广告。注意:轮显广告的尺寸最好一致。)</td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td width=85>中文站名</td>
                    
                <td width=540> 
                  <input type=text name="name" size=30 maxlength=30>
                  * 不超过15个中文或30个字母数字<font color="#FF0000">必须填写。不然添加出错</font></td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td width=85>客户姓名</td>
                    
                <td width=540> 
                  <input type=text name="username" size=30 maxlength=30>
                  * 不超过15个中文或30个字母数字<font color="#FF0000">必须填写。不然添加出错</font></td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td width=85>联系方式(电话或EMAIL):</td>
                    
                <td width=540> 
                  <input type=text name="contact" size=30 maxlength=30>
                       </td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td width=85>站点URL</td>
                    
                <td width=540> 
                  <input type=text name=url size=40 value="http://">
                  <font color="#FF0000">*必须填写。不然添加出错</font> </td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td>图标URL</td>
                    
                <td> 
                  <input type=text name=gif_url size=40 value="http://">
                  <font color="#FF0000">*必须填写。不然添加出错</font> </td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td>广告条大小</td>
                    
                <td bgcolor="#F7FFF4"> 宽度: 
                  <input type="text" name="width" size="5" maxlength="3">
                  * 高度: 
                  <input type="text" name="height" size="5" maxlength="3">
                  *(一般标准尺寸为468X60或者88X31) <font color="#FF0000">必须填写。不然添加出错</font></td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td>打开方式</td>
                    
                <td> 
                  <select size=1 name=window>
                        <option value=0 selected>新窗口打开</option>
                        <option value=1>原窗口打开</option>
                      </select> </td>
                  </tr>
                  
              <tr bgcolor=#C1FFAA> 
                <td>广告播放条件</td>
                    
                <td> 受多个条件限制的广告,只要有一个条件满足,该广告便自动进入休眠状态,你可以修改限制条件并激活广告。</td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td rowspan=8 valign=top>  </td>
                    
                <td> 
                  <table border=0>
                        <tr> 
                          <td> <input type=radio value=0 name=class checked> </td>
                          <td>无限制循环</td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table border=0>
                        <tr> 
                          <td> <input type=radio value=1 name=class> </td>
                          <td>点击数不超过</td>
                          <td> <input type=text name=clicks1 size=8> </td>
                        </tr>
                      </table>
                </td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table border="0">
                        <tr> 
                          <td> <input type=radio value=2 name=class></td>
                          <td>显示数不超过</td>
                          <td> <input type=text name=shows2 size=8> </td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table width="100%" border="0">
                    <tr> 
                          
                      <td width="26" height="18"> 
                        <input type=radio value=3 name=class> </td>
                          <td width="100">显示截止期为</td>
                          <td width="721"> <input type=text name=time3 size=20>
                         <font color=#FF0000> 格式为yyyy-mm-dd hh:mm:ss或者yyyy-mm-dd</font></td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table width="100%" border="0">
                    <tr> 
                          <td width="25"> <input type=radio value=4 name=class> </td>
                          <td width="99">点击数不超过</td>
                          <td width="723"> <input type=text name=clicks4 size=8> </td>
                        </tr>
                        <tr> 
                          <td></td>
                          <td>显示数不超过</td>
                          <td> <input type=text name=shows4 size=8> </td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table width="100%" border="0">
                    <tr> 
                          <td width="24"> <input type=radio value=5 name=class> </td>
                          <td width="98">点击数不超过</td>
                          <td width="725"> <input type=text name=clicks5 size=8> </td>
                        </tr>
                        <tr> 
                          <td></td>
                          <td>显示截止期为</td>
                          <td> <input type=text name=time5 size=20>
                          <font color=#FF0000>格式为yyyy-mm-dd hh:mm:ss或者yyyy-mm-dd</font></td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table width="100%" border="0">
                    <tr> 
                          <td width="24"> <input type=radio value=6 name=class> </td>
                          <td width="100">显示数不超过</td>
                          <td width="723"> <input type=text name=shows6 size=8> </td>
                        </tr>
                        <tr> 
                          <td></td>
                          <td>显示截止期为</td>
                          <td> <input type=text name=time6 size=20>
                         <font color=#FF0000> 格式为yyyy-mm-dd hh:mm:ss或者yyyy-mm-dd</font></td>
                        </tr>
                      </table></td>
                  </tr>
                  <tr> 
                    
                <td bgcolor=#F7FFF4> 
                  <table width="100%" border="0">
                    <tr> 
                      <td colspan="3"> <input type=radio value=7 name=class> 点击数不超过 
                        <input type=text name=clicks7 size=8> 显示数不超过 <input type=text name=shows7 size=8> 
                      </td>
                    </tr>
                    <tr> 
                      <td></td>
                      <td>显示截止期为</td>
                      <td> <input type=text name=time7 size=20>
                          <font color=#FF0000>格式为yyyy-mm-dd hh:mm:ss或者yyyy-mm-dd</font></td>
                    </tr>
                  </table>
                    </td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td>备注: </td>
                    
                <td bgcolor="#F7FFF4"> 
                  <textarea name="note" cols="40" rows="5"></textarea> 
                    </td>
                  </tr>
                  
              <tr bgcolor=#F7FFF4> 
                <td colspan=2 align=center> 
                  <input type=submit value=提交 name=B1> 
                      <input type=reset value=重写 name=B2> </td>
                  </tr>
                </table>
              </form>
    </table>

</center></div>

<%
end if
%>
</body>
</html>

⌨️ 快捷键说明

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