ADsEdit.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:7k
- <HTML>
- <HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <TITLE>编辑广告</TITLE>
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../skweb/JS/Admin.js"></script>
- </HEAD>
- <!--#include file="../skweb/ConnSiteData.asp" -->
- <!--#include file="../skweb/Const.asp" -->
- <!--#include file="../skweb/Md5.asp"-->
- <!--#include file="CheckAdmin.asp"-->
- <%
- if Instr(session("AdminPurview"),"|91,")=0 then
- response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
- response.end
- end if
- '========判断是否具有管理权限
- %>
- <BODY>
- <%
- dim Result
- Result=request.QueryString("Result")
- dim ID,ADsName,ViewFlag,Content,FiewFlag
- dim ADsWidth,ADsHeight,Adurl,BigPic
- ID=request.QueryString("ID")
- call ADsEdit()
- %>
- <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td height="29" nowrap background="Images/menutitle.gif"> <strong>广告:添加,修改广告相关的内容</strong></td>
- </tr>
- <tr>
- <td height="24" align="center" nowrap bgcolor="#EBF2F9"><a href="ADsEdit.asp?Result=Add" onClick='changeAdminFlag("添加广告")'>添加广告 </a><font color="#0000FF"> </font>|<font color="#0000FF"> </font><a href="ADsList.asp" onClick='changeAdminFlag("广告列表")'> 查看广告</a></td>
- </tr>
- </table>
- <br>
- <table width="100%" border="0" cellpadding="3" >
- <form name="editForm" method="post" action="ADsEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
- <tr>
- <td height="24" nowrap bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" id=editProduct idth="100%">
- <tr>
- <td width="120" height="20" align="right" bgcolor="#FFFFFF"> </td>
- <td bgcolor="#FFFFFF"> </td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">广告标题:</td>
- <td bgcolor="#FFFFFF"><input name="ADsName" type="text" class="textfield" id="ADsName" style="WIDTH: 240;" value="<%=ADsName%>" maxlength="100"> 发布:<input name="ViewFlag" type="checkbox" style='HEIGHT: 13px;WIDTH: 13px;' value="1" <%if ViewFlag then response.write ("checked")%>>
- * 不少于3个字符</td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">广告类别:</td>
- <td bgcolor="#FFFFFF"><input name="fiewFlag" type="checkbox" style='HEIGHT: 13px;WIDTH: 13px;' value="1" <%if fiewFlag then response.write ("checked")%>>
- * 勾选为FLASH/不勾选为图片格式</td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">尺寸:</td>
- <td bgcolor="#FFFFFF"><input name="ADsWidth" type="text" class="textfield" id="ADsWidth" style="WIDTH: 60;" value="<%=ADsWidth%>" maxlength="4" onKeyDown="if(event.keyCode==13)event.returnValue=false" onChange="if(/D/.test(this.value)){alert('宽度和高度只能输入整数!');this.value='150';}"> 宽×高 <input name="ADsHeight" type="text" class="textfield" id="ADsHeight" style="WIDTH: 60;" value="<%=ADsHeight%>" maxlength="4" onKeyDown="if(event.keyCode==13)event.returnValue=false" onChange="if(/D/.test(this.value)){alert('宽度和高度只能输入整数!');this.value='100';}"> * 至少150×100像素</td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">广告图片:</td>
- <td bgcolor="#FFFFFF"><input name="BigPic" type="text" class="textfield" style="WIDTH: 240;" value="<%=BigPic%>" maxlength="100"> <a href="javaScript:OpenScript('UpFileForm.asp?Result=BigPic',460,180)"><img src="Images/Upload.gif" width="30" height="16" border="0" align="absmiddle"></a></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">广告链接:</td>
- <td bgcolor="#FFFFFF"><input name="Adurl" type="text" class="textfield" id="Adurl" style="WIDTH: 240;" value="<%=Adurl%>" maxlength="100">
- 请输入绝对路径如:http://www.skcms.net/index.asp</td>
- </tr>
- <tr>
- <td height="20" align="right" valign="top" bgcolor="#FFFFFF">信息内容:<br>
- <td bgcolor="#FFFFFF"><textarea name="Content" rows="12" class="textfield" id="Content" style="WIDTH: 86%;" ><%=Content%></textarea></td>
- </tr>
- <tr>
- <td height="30" align="right" bgcolor="#FFFFFF"> </td>
- <td valign="bottom" bgcolor="#FFFFFF"><input name="submitSaveEdit" type="submit" class="button" id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
- </tr>
- </table></td>
- </tr>
- </form>
- </table>
- </BODY>
- </HTML>
- <%
- sub ADsEdit()
- dim Action,rsCheckAdd,rs,sql
- Action=request.QueryString("Action")
- if Action="SaveEdit" then '保存编辑管理员信息
- set rs = server.createobject("adodb.recordset")
- if len(trim(request.Form("ADsName")))<3 then
- response.write ("<script language=javascript> alert('广告标题为必填项目!');history.back(-1);</script>")
- response.end
- end if
- if trim(request.Form("ADsWidth"))="" or trim(request.Form("ADsHeight"))="" then
- response.write ("<script language=javascript> alert('广告规格必须为150×100像素以上!');history.back(-1);</script>")
- response.end
- end if
- if trim(request.Form("ADsWidth"))<10 or trim(request.Form("ADsHeight"))<10 then
- response.write ("<script language=javascript> alert('广告规格必须为150×100像素以上!');history.back(-1);</script>")
- response.end
- end if
- if Result="Add" then '创建网站管理员
- sql="select * from sk_ADs"
- rs.open sql,conn,1,3
- rs.addnew
- rs("BigPic")=trim(Request.Form("BigPic"))
- rs("Adurl")=trim(Request.Form("Adurl"))
- rs("ADsName")=trim(Request.Form("ADsName"))
- rs("Content")=Request.Form("Content")
- if Request.Form("FiewFlag")=1 then
- rs("FiewFlag")=Request.Form("FiewFlag")
- else
- rs("FiewFlag")=0
- end if
- if Request.Form("ViewFlag")=1 then
- rs("ViewFlag")=Request.Form("ViewFlag")
- else
- rs("ViewFlag")=0
- end if
- rs("Content")=Request.Form("Content")
- rs("ADsWidth")=trim(Request.Form("ADsWidth"))
- rs("ADsHeight")=trim(Request.Form("ADsHeight"))
- rs("AddTime")=now()
- end if
- if Result="Modify" then '修改网站管理员
- sql="select * from sk_ADs where ID="&ID
- rs.open sql,conn,1,3
- rs("BigPic")=trim(Request.Form("BigPic"))
- rs("Adurl")=trim(Request.Form("Adurl"))
- rs("ADsName")=trim(Request.Form("ADsName"))
- if Request.Form("FiewFlag")=1 then
- rs("FiewFlag")=Request.Form("FiewFlag")
- else
- rs("FiewFlag")=0
- end if
- if Request.Form("ViewFlag")=1 then
- rs("ViewFlag")=Request.Form("ViewFlag")
- else
- rs("ViewFlag")=0
- end if
- rs("Content")=Request.Form("Content")
- rs("ADsWidth")=trim(Request.Form("ADsWidth"))
- rs("ADsHeight")=trim(Request.Form("ADsHeight"))
- end if
- rs.update
- rs.close
- set rs=nothing
- Response.Redirect("Tips/ads.asp")
- else '提取管理员信息
- if Result="Modify" then
- set rs = server.createobject("adodb.recordset")
- sql="select * from sk_ADs where ID="& ID
- rs.open sql,conn,1,1
- BigPic=rs("BigPic")
- Adurl=rs("Adurl")
- ADsName=rs("ADsName")
- FiewFlag=rs("FiewFlag")
- ViewFlag=rs("ViewFlag")
- ADsWidth=rs("ADsWidth")
- ADsHeight=rs("ADsHeight")
- Content=rs("Content")
- rs.close
- set rs=nothing
- end if
- end if
- end sub
- %>