Ads_add.asp
Upload User: jisenq
Upload Date: 2014-06-29
Package Size: 7216k
Code Size: 30k
Category:

ADO-ODBC

Development Platform:

ASP/ASPX

  1. <!--#include file="../../FS_Inc/Const.asp" -->
  2. <!--#include file="../../FS_Inc/Function.asp"-->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  5. <!--#include file="Cls_Ads.asp"-->
  6. <%'Copyright (c) 2006 Foosun Inc. Code by 邓西
  7. response.buffer=true
  8. Response.CacheControl = "no-cache"
  9. Dim Conn,User_Conn
  10. MF_Default_Conn
  11. MF_Session_TF 
  12. if not MF_Check_Pop_TF("AS_site") then Err_Show
  13. if not MF_Check_Pop_TF("AS001") then Err_Show
  14. Dim int_RPP,int_Start,int_showNumberLink_,str_nonLinkColor_,toF_,toP10_,toP1_,toN1_,toN10_,toL_,showMorePageGo_Type_
  15. Dim Page,cPageNo,str_CurrPath,sRootDir,str_AdOpType,str_ShowType,str_AdsType
  16. str_AdOpType=Request.QueryString("OpType")
  17. Dim o_Ad_Rs,strShowErr,o_Crs,strLock,lng_TempAdID,lng_TempLoopAdID
  18. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  19. if Session("Admin_Is_Super") = 1 then
  20. str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
  21. Else
  22. str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&Session("Admin_Name"),"//","/")
  23. End if
  24. If str_AdOpType="Add" Then
  25. str_AdOpType="Add"
  26. str_ShowType="<a href=""javascript:if (Ad_Flag()==true){Ad_Save();}"">保存</a>"
  27. Else
  28. str_AdOpType="Update"
  29. str_ShowType="<a href=""javascript:if (Ad_Flag()==true){Ad_Update();}"">修改</a>"
  30. Dim AdId
  31. AdId=Request.QueryString("ID")
  32. If AdId="" or IsNull(AdId) Then
  33. If IsNumeric(AdId)=False Then
  34. strShowErr = "<li>参数错误!</li>"
  35. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  36. Response.end
  37. End If
  38. Else
  39. AdId=Clng(AdId)
  40. Set o_Ad_Rs=Conn.execute("Select * from FS_AD_Info Where AdID="&AdID&"")
  41. If Not o_Ad_Rs.Eof Then
  42. Dim temp_Adname,temp_adType,temp_adloopadname,temp_adloop,temp_adloopfollow,temp_adloopspeed,temp_adloopic,temp_adloopRpic,temp_picH,temp_picW,temp_adlink,temp_adcaptiontxt,temp_loopfactor,temp_loopenddate,temp_maxclicknum,temp_maxshownum,temp_adremarks,Temp_AdID,temp_Txtcontentstr,temp_Txt_Rs,temp_Txt_i,temp_AdTxtColNum
  43. Temp_AdID=o_Ad_Rs("AdID")
  44. temp_Adname=o_Ad_Rs("AdName")
  45. temp_adType=o_Ad_Rs("AdType")
  46. temp_adloop=o_Ad_Rs("AdLoop")
  47. temp_adloopadname=o_Ad_Rs("AdLoopAdID")
  48. temp_adloopfollow=o_Ad_Rs("AdLoopFollow")
  49. temp_adloopspeed=o_Ad_Rs("AdLoopSpeed")
  50. temp_adloopic=o_Ad_Rs("AdPicPath")
  51. temp_adloopRpic=o_Ad_Rs("AdRightPicPath")
  52. temp_picH=o_Ad_Rs("AdPicHeight")
  53. temp_picW=o_Ad_Rs("AdPicWidth")
  54. temp_adlink=o_Ad_Rs("AdLinkAdress")
  55. temp_adcaptiontxt=o_Ad_Rs("AdCaptionTxt")
  56. temp_loopfactor=o_Ad_Rs("AdLoopFactor")
  57. temp_loopenddate=o_Ad_Rs("AdEndDate")
  58. temp_maxclicknum=o_Ad_Rs("AdMaxClickNum")
  59. temp_maxshownum=o_Ad_Rs("AdMaxShowNum")
  60. temp_adremarks=o_Ad_Rs("AdRemarks")
  61. temp_AdTxtColNum=o_Ad_Rs("AdTxtColNum")
  62. Else
  63. strShowErr = "<li>参数错误!</li>"
  64. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  65. Response.end
  66. End If
  67. Set o_Ad_Rs=Nothing
  68. End If
  69. End If
  70. Dim str_AdName,str_AdType,str_AdLoopAdName,str_AdLoopFollow,str_AdLoopSpeed,str_AdLoopPicAdress,str_AdLoopRPicAdress,str_AdPicHeight,str_AdPicWidth,str_AdLinkUrl,str_AdCaptionTxt,str_LoopFactor,str_LoopEndDate,str_AdClickNum,str_AdShowNum,str_AdRemarks,str_IsLoopvalue,str_AdClassID,int_Txt_i,int_AdTxtColNum
  71. str_AdName=Request.Form("AdName")
  72. str_AdType=Clng(Request.Form("AdType"))
  73. str_IsLoopvalue=Request.Form("IsLoopvalue")
  74. str_AdLoopAdName=Request.Form("LoopAdName")
  75. str_AdLoopFollow=Clng(Request.Form("LoopFollow"))
  76. str_AdLoopSpeed=Request.Form("LoopSpeed")
  77. str_AdLoopPicAdress=Request.Form("LoopPicAdress")
  78. str_AdLoopRPicAdress=Request.Form("LoopRPicAdress")
  79. str_AdPicHeight=Request.Form("AdPicHeight")
  80. str_AdPicWidth=Request.Form("AdPicWidth")
  81. str_AdLinkUrl=Request.Form("AdLinkUrl")
  82. str_AdCaptionTxt=Request.Form("AdCaptionTxt")
  83. str_LoopFactor=Clng(Request.Form("LoopFactor"))
  84. str_LoopEndDate=Request.Form("LoopEndDate")
  85. str_AdClickNum=Request.Form("AdMaxClickNum")
  86. str_AdShowNum=Request.Form("AdMaxShowNum")
  87. str_AdRemarks=Request.Form("AdRemarks")
  88. str_AdClassID=Request.Form("AdClassID")
  89. int_AdTxtColNum=Request.Form("AdTxtColNum")
  90. If int_AdTxtColNum="" or IsNull(int_AdTxtColNum) Then
  91. int_AdTxtColNum=0
  92. Else
  93. int_AdTxtColNum=Cint(int_AdTxtColNum)
  94. End If
  95. Dim SubUp,UpRs,ID
  96. SubUp=Request.QueryString("Submit")
  97. If SubUp="SubUp" Then
  98. ID=Request.QueryString("ID")
  99. Set UpRs=CreateObject(G_FS_RS)
  100. UpRs.open "Select * from FS_AD_Info Where AdID="&Clng(ID)&"",Conn,3,3
  101. Set o_Crs=Conn.execute("Select Lock From FS_AD_Class Where AdClassID="&str_AdClassID&"")
  102. If Not o_Crs.Eof Then
  103. strLock=o_Crs("Lock")
  104. Else
  105. strLock=0
  106. End If
  107. UpRs("AdName")=str_AdName
  108. UpRs("AdType")=Clng(str_AdType)
  109. UpRs("AdLoop")=Clng(str_IsLoopvalue)
  110. UpRs("AdLoopAdID")=Clng(str_AdLoopAdName)
  111. UpRs("AdLoopFollow")=Clng(str_AdLoopFollow)
  112. UpRs("AdLoopSpeed")=Clng(str_AdLoopSpeed)
  113. UpRs("AdPicPath")=str_AdLoopPicAdress
  114. UpRs("AdRightPicPath")=str_AdLoopRPicAdress
  115. UpRs("AdPicHeight")=Clng(str_AdPicHeight)
  116. UpRs("AdPicWidth")=Clng(str_AdPicWidth)
  117. UpRs("AdLinkAdress")=str_AdLinkUrl
  118. UpRs("AdCaptionTxt")=str_AdCaptionTxt
  119. UpRs("AdLoopFactor")=Clng(str_LoopFactor)
  120. UpRs("AdEndDate")=str_LoopEndDate
  121. UpRs("AdMaxClickNum")=Clng(str_AdClickNum)
  122. UpRs("AdMaxShowNum")=Clng(str_AdShowNum)
  123. UpRs("AdRemarks")=str_AdRemarks
  124. UpRs("AdClassID")=str_AdClassID
  125. UpRs("AdTxtColNum")=int_AdTxtColNum
  126. If strLock=0 Then
  127. UpRs("AdLock")=0
  128. Else
  129. UpRs("AdLock")=1
  130. End If
  131. UpRs.Update
  132. UpRs.Close
  133. Set UpRs=Nothing
  134. Conn.execute("Delete * From FS_AD_TxtInfo Where AdID="&Clng(ID)&"")
  135. For int_Txt_i=1 to Request.Form("AdTxtContent").Count
  136. Conn.execute("insert into FS_AD_TxtInfo(AdID,AdTxtContent,Css,LinkUrl) values("&Clng(ID)&",'"&Request.Form("AdTxtContent")(int_Txt_i)&"','"&Request.Form("AdTxtCss")(int_Txt_i)&"','"&Request.Form("AdTxtLink")(int_Txt_i)&"')")
  137. Next
  138. Set o_Ad_Rs=Conn.execute("Select AdLoopAdID From FS_AD_Info Where AdID="&ID&"")
  139. If Not o_Ad_Rs.Eof Then 
  140. lng_TempLoopAdID=o_Ad_Rs("AdLoopAdID")
  141. Else
  142. lng_TempLoopAdID=0
  143. End If
  144. Set o_Ad_Rs=Nothing
  145. Select Case Clng(str_AdType)
  146. Case 0 call ShowAds(ID)
  147. Case 1 call NewWindow(ID)
  148. Case 2 call OpenWindow(ID)
  149. Case 3 call FilterAway(ID)
  150. Case 4 call DialogBox(ID)
  151. Case 5 call ClarityBox(ID)
  152. Case 6 call DriftBox(ID)
  153. Case 7 call LeftBottom(ID)
  154. Case 8 call RightBottom(ID)
  155. Case 9 call Couplet(ID)
  156. Case 10 call Cycle(ID,lng_TempLoopAdID)
  157. Case 11 call AdTxt(ID)
  158. End Select
  159. strShowErr = "<li>修改成功!</li>"
  160. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_Manage.asp&Page="&Request.QueryString("OpPage")&"")
  161. Response.end
  162. End If
  163. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  164. if Session("Admin_Is_Super") = 1 then
  165. str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
  166. Else
  167. str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&Session("Admin_Name"),"//","/")
  168. End if
  169. str_AdsType=Request.Form("Type")
  170. If str_AdsType<>"" Then
  171. Set o_Ad_Rs= CreateObject(G_FS_RS)
  172. o_Ad_Rs.open"select * from FS_AD_Info where 1=0",Conn,3,3
  173. If str_AdsType="Add" Then
  174. Set o_Crs=Conn.execute("Select Lock From FS_AD_Class Where AdClassID="&str_AdClassID&"")
  175. If Not o_Crs.Eof Then
  176. strLock=o_Crs("Lock")
  177. Else
  178. strLock=0
  179. End If
  180. Set o_Crs=Nothing
  181. o_Ad_Rs.addnew
  182. o_Ad_Rs("AdName")=str_AdName
  183. o_Ad_Rs("AdType")=Clng(str_AdType)
  184. o_Ad_Rs("AdLoop")=Clng(str_IsLoopvalue)
  185. o_Ad_Rs("AdLoopAdID")=Clng(str_AdLoopAdName)
  186. o_Ad_Rs("AdLoopFollow")=Clng(str_AdLoopFollow)
  187. o_Ad_Rs("AdLoopSpeed")=Clng(str_AdLoopSpeed)
  188. o_Ad_Rs("AdPicPath")=str_AdLoopPicAdress
  189. o_Ad_Rs("AdRightPicPath")=str_AdLoopRPicAdress
  190. If str_AdPicHeight="" or IsNull(str_AdPicHeight) Then
  191. o_Ad_Rs("AdPicHeight")=0
  192. Else
  193. o_Ad_Rs("AdPicHeight")=str_AdPicHeight
  194. End If
  195. If str_AdPicWidth="" Or IsNull(str_AdPicWidth) Then
  196. o_Ad_Rs("AdPicWidth")=0
  197. Else
  198. o_Ad_Rs("AdPicWidth")=str_AdPicWidth
  199. End If
  200. 'if left(Cstr(str_AdLinkUrl),len("Http://"))=0 then str_AdLinkUrl = "Http://"&str_AdLinkUrl
  201. o_Ad_Rs("AdLinkAdress")=str_AdLinkUrl
  202. o_Ad_Rs("AdCaptionTxt")=str_AdCaptionTxt
  203. o_Ad_Rs("AdLoopFactor")=Clng(str_LoopFactor)
  204. o_Ad_Rs("AdEndDate")=str_LoopEndDate
  205. o_Ad_Rs("AdMaxClickNum")=Clng(str_AdClickNum)
  206. o_Ad_Rs("AdMaxShowNum")=Clng(str_AdShowNum)
  207. o_Ad_Rs("AdRemarks")=str_AdRemarks
  208. o_Ad_Rs("AdAddDate")=Now()
  209. o_Ad_Rs("AdClickNum")=0
  210. o_Ad_Rs("AdClassID")=str_AdClassID
  211. If strLock=0 Then
  212. o_Ad_Rs("AdLock")=0
  213. Else
  214. o_Ad_Rs("AdLock")=1
  215. End If
  216. o_Ad_Rs("AdTxtColNum")=int_AdTxtColNum
  217. o_Ad_Rs.Update
  218. o_Ad_Rs.Close
  219. Set o_Ad_Rs=Nothing
  220. Set o_Ad_Rs=Conn.execute("Select Top 1 AdID,AdLoopAdID From FS_AD_Info Order By AdID Desc")
  221. lng_TempAdID=o_Ad_Rs("AdID")
  222. lng_TempLoopAdID=o_Ad_Rs("AdLoopAdID")
  223. Set o_Ad_Rs=Nothing
  224. For int_Txt_i=1 to Request.Form("AdTxtContent").Count
  225. Conn.execute("insert into FS_AD_TxtInfo(AdID,AdTxtContent,Css,LinkUrl) values("&lng_TempAdID&",'"&Request.Form("AdTxtContent")(int_Txt_i)&"','"&Request.Form("AdTxtCss")(int_Txt_i)&"','"&Request.Form("AdTxtLink")(int_Txt_i)&"')")
  226. Next
  227. Select Case Clng(str_AdType)
  228. Case 0 call ShowAds(lng_TempAdID)
  229. Case 1 call NewWindow(lng_TempAdID)
  230. Case 2 call OpenWindow(lng_TempAdID)
  231. Case 3 call FilterAway(lng_TempAdID)
  232. Case 4 call DialogBox(lng_TempAdID)
  233. Case 5 call ClarityBox(lng_TempAdID)
  234. Case 6 call DriftBox(lng_TempAdID)
  235. Case 7 call LeftBottom(lng_TempAdID)
  236. Case 8 call RightBottom(lng_TempAdID)
  237. Case 9 call Couplet(lng_TempAdID)
  238. Case 10 call Cycle(lng_TempAdID,lng_TempLoopAdID)
  239. Case 11 call AdTxt(lng_TempAdID)
  240. End Select
  241. If Clng(str_IsLoopvalue) = 1 then
  242. Call Cycle(AdID,TempLocation)
  243. End if
  244. strShowErr = "<li>添加成功!</li>"
  245. Response.Redirect("lib/Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=AdminAdsAds_Manage.asp")
  246. Response.end
  247. End If
  248. End If
  249. %>
  250. <html>
  251. <head>
  252. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  253. <title>广告管理___Powered by foosun Inc.</title>
  254. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  255. </head>
  256. <script src="../../FS_Inc/PublicJS.js" language="JavaScript"></script>
  257. <body>
  258. <form action="" name="AddAds" method="post">
  259. <%
  260. Dim str_AdClass_Sql,o_AdClass_Rs,str_AdClass_str,str_Selected,str_ClassType
  261. str_ClassType=Request.QueryString("AdClassID")
  262. str_AdClass_Sql="Select AdClassID,AdClassName,Lock from FS_AD_Class"
  263. Set o_AdClass_Rs=Conn.execute(str_AdClass_Sql)
  264. If Not o_AdClass_Rs.Eof Then
  265. While Not o_AdClass_Rs.Eof
  266. If Clng(str_ClassType)=Clng(o_AdClass_Rs("AdClassID")) Then
  267. str_Selected=" selected"
  268. End If
  269. str_AdClass_str=str_AdClass_str&"<option value="&o_AdClass_Rs("AdClassID")&str_Selected&">"&o_AdClass_Rs("AdClassName")&"</option>"
  270. o_AdClass_Rs.MoveNext
  271. Wend
  272. End If
  273. Set o_AdClass_Rs=Nothing
  274. %>
  275. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  276.   <tr class="hback"> 
  277.     <td colspan="4" class="xingmu">添加广告</td>
  278.   </tr>
  279.   <tr> 
  280.       <td height="8" colspan="4" class="hback"><%=str_ShowType%> | <a href="javascript:history.go(-1);">返回上级</a></td>
  281.   </tr>
  282.   <tr>
  283.     <td height="4" colspan="4" class="hback"><input type="hidden" name="Type" value="<%=str_AdOpType%>"></td>
  284.   </tr>
  285.   <tr>
  286.     <td height="4" align="right" class="hback">广告分类</td>
  287.     <td height="4" colspan="3" class="hback"><select name="AdClassID" size="1" style="width:600px" o>
  288.       <option value="-1">请选择广告栏目,如果不选择(默认不把此广告加入栏目)</option>
  289.       <%=str_AdClass_str%>
  290.     </select></td>
  291.     </tr>
  292.   <tr>
  293.     <td width="12%" height="20" align="right" class="hback">广告名称</td>
  294.     <td width="38%" height="20" align="left" class="hback"><input name="AdName" type="text" id="AdName" size="32" maxlength="20" title="广告名称,必填" value="<%=temp_Adname%>">
  295.       <font color="#FF0000">*必须填写项目</font></td>
  296.     <td width="12%" height="20" align="right" class="hback">广告类型</td>
  297.     <td width="38%" align="left" class="hback"><select name="AdType" id="AdType" style="width:200" onChange="javascript:ChooseType(this.value);">
  298.       <option value="0" <%if Clng(temp_adType)=0 Then Response.write "selected"%>>普通显示广告</option>
  299.       <option value="1" <%if Clng(temp_adType)=1 Then Response.write "selected"%>>弹出新窗口</option>
  300.       <option value="2" <%if Clng(temp_adType)=2 Then Response.write "selected"%>>打开新窗口</option>
  301.       <option value="3" <%if Clng(temp_adType)=3 Then Response.write "selected"%>>渐隐消失</option>
  302.       <option value="4" <%if Clng(temp_adType)=4 Then Response.write "selected"%>>网页对话框</option>
  303.       <option value="5" <%if Clng(temp_adType)=5 Then Response.write "selected"%>>透明对话框</option>
  304.       <option value="6" <%if Clng(temp_adType)=6 Then Response.write "selected"%>>满屏浮动</option>
  305.       <option value="7" <%if Clng(temp_adType)=7 Then Response.write "selected"%>>左下底端</option>
  306.       <option value="8" <%if Clng(temp_adType)=8 Then Response.write "selected"%>>右下底端</option>
  307.       <option value="9" <%if Clng(temp_adType)=9 Then Response.write "selected"%>>对联广告</option>
  308.       <option value="10" <%if Clng(temp_adType)=10 Then Response.write "selected"%>>循环广告</option>      
  309.     </select></td>
  310.   </tr>
  311.   <tr id="tr1">
  312.     <td height="32" align="right" class="hback">循环广告</td>
  313.     <td height="32" align="left" class="hback">
  314.       <input name="IsLoop" type="checkbox" id="IsLoop" value="0" title="将非循环类广告添加到循环广告中循环显示" onClick="javascript:ChooseCycleDis();" <%If temp_adloop=1 Then Response.write "checkend"%>><input type="hidden" name="IsLoopvalue" value="0">
  315.       循环广告位  
  316.     <select name="LoopAdName" title="将非循环广告设置为循环广告后必选" disabled style="width:110">
  317. <%
  318. Dim o_Temp_Loopname
  319. Set o_Temp_Loopname=Conn.execute("select AdID,AdName From FS_AD_Info order by AdID")
  320. If Not o_Temp_Loopname.Eof Then
  321. Response.Write("<option value=""-1""></option>")
  322. While Not o_Temp_Loopname.Eof
  323. Response.Write("<option value="&o_Temp_Loopname("AdID")&">"&o_Temp_Loopname("AdName")&"</option>")
  324. o_Temp_Loopname.MoveNext
  325. Wend
  326. Else
  327. Response.Write("<option value=""-1""></option>")
  328. Response.Write("<option value=""-1"">当前无广告,请添加</option>")
  329. End If
  330. Set o_Temp_Loopname=Nothing
  331. %>
  332.     </select>    </td>
  333.     <td height="32" align="right" class="hback">循环方向</td>
  334.     <td height="32" align="left" class="hback"><select name="LoopFollow" id="select" style="width:70" title="将广告设置为循环广告后必选" disabled>
  335.       <option value="0" <%If temp_adloopfollow=0 Then Response.write "selected"%>>向   上</option>
  336.       <option value="1" <%If temp_adloopfollow=1 Then Response.write "selected"%>>向   下</option>
  337.       <option value="2" <%If temp_adloopfollow=2 Then Response.write "selected"%>>向   左</option>
  338.       <option value="3" <%If temp_adloopfollow=3 Then Response.write "selected"%>>向   右</option>
  339.                         </select>
  340.     循环速度    
  341.     <input name="LoopSpeed" type="text" id="LoopSpeed" size="17" maxlength="20" style="width:70"title="将广告设置为循环广告后必填" disabled value="<%=temp_adloopspeed%>" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')"></td>
  342.   </tr>
  343.   <tr id="tr2">
  344.     <td height="18" align="right" class="hback">图片地址</td>
  345.     <td height="18" align="left" class="hback"><input name="LoopPicAdress" type="text" id="LoopPicAdress" size="19" title="广告图片地址:必选项" value="<%=temp_adloopic%>">
  346.     <input name="SelectPic" type="button" id="SelectPic" value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',400,320,window,document.AddAds.LoopPicAdress);">
  347.     <font color="#FF0000">*必须填写项目</font></td>
  348.     <td height="18" align="right" class="hback">右图地址</td>
  349.     <td height="18" align="left" class="hback"><input name="LoopRPicAdress" type="text" id="LoopRPicAdress" size="19" title="如果广告类型为对联广告,请选择此项,其它类型不用选择" disabled value="<%=temp_adloopRpic%>">
  350.       <input name="SelectRPic" type="button" id="SelectPic2" value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',400,320,window,document.AddAds.LoopRPicAdress);" disabled></td>
  351.   </tr>
  352.   <tr id="tr3">
  353.     <td height="8" align="right" class="hback">图片高度</td>
  354.     <td height="8" align="left" class="hback"><input name="AdPicHeight" type="text" id="AdPicHeight" size="32" maxlength="20" title="图片高度:必选项" value="<%=temp_picH%>" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')">
  355.       <font color="#FF0000">*必须填写项目</font></td>
  356.     <td height="8" align="right" class="hback">图片宽度</td>
  357.     <td height="8" align="left" class="hback"><input name="AdPicWidth" type="text" id="AdPicWidth" size="32" maxlength="20" title="图片宽度:必选项" value="<%=temp_picW%>" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')">
  358.       <font color="#FF0000">*必须填写项目</font></td>
  359.   </tr>
  360.   <tr id="tr4" style="display:none">
  361. <%
  362. If str_AdOpType<>"Add" Then
  363. Dim temp_Ad_TxtID,temp_Content_txt,temp_Css_txt,temp_link_txt
  364. Dim temp_Ad_TxtID1,temp_Content_txt1,temp_Css_txt1,temp_link_txt1
  365. Set temp_Txt_Rs=Conn.execute("select Ad_TxtID,AdID,AdTxtContent,Css,LinkUrl from FS_AD_TxtInfo where AdID="&Temp_AdID&" order by Ad_TxtID")
  366. If Not temp_Txt_Rs.Eof Then
  367. temp_Ad_TxtID1=temp_Txt_Rs("Ad_TxtID")
  368. temp_Content_txt1=temp_Txt_Rs("AdTxtContent")
  369. temp_Css_txt1=temp_Txt_Rs("Css")
  370. temp_link_txt1=temp_Txt_Rs("LinkUrl")
  371. temp_Txt_i=1
  372. temp_Txt_Rs.Movenext
  373. Do While Not temp_Txt_Rs.Eof
  374. temp_Ad_TxtID=temp_Txt_Rs("Ad_TxtID")
  375. temp_Content_txt=temp_Txt_Rs("AdTxtContent")
  376. temp_Css_txt=temp_Txt_Rs("Css")
  377. temp_link_txt=temp_Txt_Rs("LinkUrl")
  378. temp_Txtcontentstr=temp_Txtcontentstr&"<tr><td> 显示文本 <input name=""AdTxtContent"" type=""text"" size=""30"" maxlength=""200"" value="""&temp_Content_txt&"""> 样式 <input name=""AdTxtCss"" type=""text"" size=""7"" maxlength=""40"" value="""&temp_Css_txt&"""> 链接地址 <input name=""AdTxtLink"" type=""text"" value="""&temp_Txt_Rs("LinkUrl")&""" size=""16"" maxlength=""100""><input name=""TxtID"" type=""hidden"" value="""&temp_Ad_TxtID&"""> <a href=""#"" onclick='f_delete(this.parentElement.parentElement)'>删除</a> </td></tr>"
  379. temp_Txt_Rs.Movenext
  380. temp_Txt_i=temp_Txt_i+1
  381. Loop
  382. End If
  383. Set temp_Txt_Rs=Nothing
  384. End If
  385. %>
  386.     <td height="4" align="right" valign="top" class="hback">广告内容<br>
  387.       (<a href=javascript:f_add()><img src="/admin/images/add.gif" border="0" alt="点击添加更多文字广告"></a>)
  388.       </td>
  389.     <td height="4" colspan="3" align="left" class="hback">
  390. <table width="641" id="tb1">
  391.   <tr><td>显示文本
  392.  <input name="AdTxtContent" type="text" size="30" maxlength="200" value="<%=temp_Content_txt1%>">
  393.  样式 
  394.       <input name="AdTxtCss" type="text" size="7" maxlength="40" value="<%=temp_Css_txt1%>">
  395.       链接地址
  396.       <input name="AdTxtLink" type="text" id="AdTxtLink" value="<%=temp_link_txt1%>" size="16" maxlength="100">
  397.       列数
  398.       <input name="AdTxtColNum" type="text" id="AdTxtColNum" value="<%=temp_AdTxtColNum%>" size="4" maxlength="2" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')"></td>
  399.   </tr><%=temp_Txtcontentstr%></table>
  400.       <input name="TxtID" type="hidden" value="<%=temp_Ad_TxtID1%>"></td></tr>
  401.   <tr id="tr6">
  402.     <td height="18" align="right" class="hback">链接地址</td>
  403.     <td height="18" align="left" class="hback"><input name="AdLinkUrl" type="text" id="AdLinkUrl" size="32" maxlength="200" title="广告链接地址,必填项" value="<%=temp_adlink%>">
  404.       <font color="#FF0000">*必须填写项目</font></td>
  405.     <td height="18" align="right" class="hback">说明文字</td>
  406.     <td height="18" align="left" class="hback"><input name="AdCaptionTxt" type="text" size="32" maxlength="100" title="广告说明文字,可选项" value="<%=temp_adcaptiontxt%>"></td>
  407.   </tr>
  408.   <tr>
  409.     <td height="18" align="right" class="hback">显示条件</td>
  410.     <td height="18" align="left" class="hback"><input name="LoopFactor" type="radio" title="将此广告设置为不受任何条件限制而永不过期。选择此项后,最大点击次数、最大显示次数和截止日期不用填写" value="0" onClick="javascript:LoopFactorClick('1');" <%If temp_loopfactor=0 Then Response.write "checked"%>>    
  411.     无条件显示
  412.       <input type="radio" name="LoopFactor" value="1" title="将广告设置为有条件显示后,此广告将在满足最大点击次数、最大显示次数和截止日期中的任何一项后失效" onClick="javascript:LoopFactorClick('2');" <%If temp_loopfactor=1 Then Response.write "checked"%>>
  413. 有条件显示</td>
  414.     <td height="18" align="right" class="hback">截止日期</td>
  415.     <td height="18" align="left" class="hback"><input name="LoopEndDate" type="text" id="LoopEndDate" size="19" disabled value="<%=temp_loopenddate%>" readonly>
  416.       <input name="SelectDate" type="button" id="SelectDate" value="选择时间" onClick="OpenWindowAndSetValue('../CommPages/SelectDate.asp',300,130,window,document.AddAds.LoopEndDate);" disabled></td>
  417.   </tr>
  418.   <tr>
  419.     <td height="8" align="right" class="hback">点击次数</td>
  420.     <td height="8" align="left" class="hback"><input name="AdMaxClickNum" type="text" id="AdClickNum" size="32" maxlength="30" title="设置广告的最大点击数量,广告将在点击次数达到此数量后失效。如果不设置此项,请置空" disabled value="<%=temp_maxclicknum%>" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')"></td>
  421.     <td height="8" align="right" class="hback">显示次数</td>
  422.     <td height="8" align="left" class="hback"><input name="AdMaxShowNum" type="text" id="AdShowNum" size="32" maxlength="30" title="设置广告的最大显示数量,广告将在显示次数达到此数量后失效。如果不设置此项,请置空" disabled value="<%=temp_maxshownum%>" onKeyUp="if(isNaN(value))execCommand('undo')"  onafterpaste="if(isNaN(value))execCommand('undo')"></td>
  423.   </tr>
  424.   <tr>
  425.     <td height="9" align="right" valign="top" class="hback">广告备注</td>
  426.     <td height="9" colspan="3" align="left" class="hback"><textarea name="AdRemarks" cols="98" rows="5" title="广告备注,仅供后台查阅,不做前台调用"><%=temp_adremarks%></textarea></td>
  427.   </tr>
  428. </table>
  429. </form>
  430. </body>
  431. </html>
  432. <script language="javascript">
  433. function Ad_Flag()
  434. {
  435. if (document.AddAds.AdName.value=="")
  436. {
  437. alert("请输入广告名称");
  438. document.AddAds.AdName.focus();
  439. return false;
  440. }
  441. if (parseInt(document.AddAds.AdType.value)==11)
  442. {
  443. var _arr=document.all.AdTxtContent
  444.    if (typeof(_arr.length)=="undefined")
  445.    {
  446. if (_arr.value=="")
  447. {
  448. alert("请输入文字显示内容");
  449. _arr.focus();
  450. return false;
  451. }
  452.    }
  453.    else
  454.    {
  455. for (var j=0;j<_arr.length;j++)
  456. {
  457. if (_arr[j].value=="")
  458. {
  459. alert("请输入文字显示内容");
  460. _arr[j].focus();
  461. return false;
  462. }
  463. }
  464. }
  465. }
  466. else
  467. {
  468. if (document.AddAds.LoopPicAdress.value=="")
  469. {
  470. alert("请输入图片地址");
  471. document.AddAds.LoopPicAdress.focus();
  472. return false;
  473. }
  474. if (parseInt(document.AddAds.AdType.value)==9)
  475. {
  476. if (document.AddAds.LoopRPicAdress.value=="")
  477. {
  478. alert("请输入图片地址");
  479. document.AddAds.LoopRPicAdress.focus();
  480. return false;
  481. }
  482. }
  483. if (parseInt(document.AddAds.IsLoopvalue.value)==1)
  484. {
  485. if (document.AddAds.LoopSpeed.value=="")
  486. {
  487. alert("请输入循环速度");
  488. document.AddAds.LoopSpeed.focus();
  489. return false;
  490. }
  491. else
  492. {
  493. if (isNaN(document.AddAds.LoopSpeed.value))
  494. {
  495. alert("循环速度必须为整数");
  496. document.AddAds.LoopSpeed.value="";
  497. document.AddAds.LoopSpeed.focus();
  498. return false;
  499. }
  500. else
  501. {
  502. if (parseInt(document.AddAds.LoopSpeed.value)<0)
  503. {
  504. alert("循环速度必须为整数");
  505. document.AddAds.LoopSpeed.focus();
  506. document.AddAds.LoopSpeed.value="";
  507. return false;
  508. }
  509. }
  510. }
  511. }
  512. if (document.AddAds.AdPicHeight.value=="")
  513. {
  514. alert("请输入图片高度");
  515. document.AddAds.AdPicHeight.focus();
  516. return false;
  517. }
  518. else
  519. {
  520. if (isNaN(document.AddAds.AdPicHeight.value)==true)
  521. {
  522. alert("图片高度必须为整数");
  523. document.AddAds.AdPicHeight.value="";
  524. document.AddAds.AdPicHeight.focus();
  525. return false;
  526. }
  527. else
  528. {
  529. if (parseInt(document.AddAds.AdPicHeight.value)<0)
  530. {
  531. alert("图片高度必须为整数");
  532. document.AddAds.AdPicHeight.value="";
  533. document.AddAds.AdPicHeight.focus();
  534. return false;
  535. }
  536. }
  537. }
  538. if (document.AddAds.AdPicWidth.value=="")
  539. {
  540. alert("请输入图片宽度");
  541. document.AddAds.AdPicWidth.focus();
  542. return false;
  543. }
  544. else
  545. {
  546. if (isNaN(document.AddAds.AdPicWidth.value)==true)
  547. {
  548. alert("图片宽度必须为整数");
  549. document.AddAds.AdPicWidth.value="";
  550. document.AddAds.AdPicWidth.focus();
  551. return false;
  552. }
  553. else
  554. {
  555. if (parseInt(document.AddAds.AdPicWidth.value)<0)
  556. {
  557. alert("图片宽度必须为整数");
  558. document.AddAds.AdPicWidth.value="";
  559. document.AddAds.AdPicWidth.focus();
  560. return false;
  561. }
  562. }
  563. }
  564. if (document.AddAds.AdLinkUrl.value=="")
  565. {
  566. alert("请输入链接地址");
  567. document.AddAds.AdLinkUrl.focus();
  568. return false;
  569. }
  570. }
  571. if (document.AddAds.AdClickNum.value!="")
  572. {
  573. if (isNaN(document.AddAds.AdClickNum.value)==true)
  574. {
  575. alert("点击次数必须为整数");
  576. document.AddAds.AdClickNum.value="";
  577. document.AddAds.AdClickNum.focus();
  578. return false;
  579. }
  580. else
  581. {
  582. if (parseInt(document.AddAds.AdClickNum.value)<0)
  583. {
  584. alert("点击次数必须为整数");
  585. document.AddAds.AdClickNum.value="";
  586. document.AddAds.AdClickNum.focus();
  587. return false;
  588. }
  589. }
  590. }
  591. if (document.AddAds.AdShowNum.value!="")
  592. {
  593. if (isNaN(document.AddAds.AdShowNum.value)==true)
  594. {
  595. alert("显示次数必须为整数");
  596. document.AddAds.AdShowNum.value="";
  597. document.AddAds.AdShowNum.focus();
  598. return false;
  599. }
  600. else
  601. {
  602. if (parseInt(document.AddAds.AdShowNum.value)<0)
  603. {
  604. alert("显示次数必须为整数");
  605. document.AddAds.AdShowNum.value="";
  606. document.AddAds.AdShowNum.focus();
  607. return false;
  608. }
  609. }
  610. }
  611. return true;
  612. }
  613. function LoopFactorClick(type)
  614. {
  615. if(type==1)
  616. {
  617. document.AddAds.LoopEndDate.disabled=true;
  618. document.AddAds.SelectDate.disabled=true;
  619. document.AddAds.AdClickNum.disabled=true;
  620. document.AddAds.AdShowNum.disabled=true;
  621. document.AddAds.LoopFactor.value=1;
  622. }
  623. else
  624. {
  625. document.AddAds.LoopEndDate.disabled=false;
  626. document.AddAds.SelectDate.disabled=false;
  627. document.AddAds.AdClickNum.disabled=false;
  628. document.AddAds.LoopFactor.value=0;
  629. document.AddAds.AdShowNum.disabled=false;
  630. }
  631. }
  632. function ChooseType(type)
  633. {
  634. switch (parseInt(type))
  635. {
  636. case 9:
  637. document.AddAds.LoopRPicAdress.disabled=false;
  638. document.AddAds.SelectRPic.disabled=false;
  639. show();
  640. break;
  641. case 0:
  642. document.AddAds.LoopRPicAdress.disabled=true;
  643. document.AddAds.SelectRPic.disabled=true;
  644. document.AddAds.IsLoop.disabled=true;
  645. document.AddAds.LoopAdName.disabled=true;
  646. document.AddAds.LoopFollow.disabled=false;
  647. document.AddAds.LoopSpeed.disabled=false;
  648. show();
  649. break;
  650. case 11:
  651. document.all.tr1.style.display="none";
  652. document.all.tr2.style.display="none";
  653. document.all.tr3.style.display="none";
  654. document.all.tr4.style.display="";
  655. document.all.tr6.style.display="none";
  656. break;
  657. default:
  658. document.AddAds.IsLoop.disabled=false;
  659. document.AddAds.LoopAdName.disabled=true;
  660. document.AddAds.LoopFollow.disabled=true;
  661. document.AddAds.LoopSpeed.disabled=true;
  662. document.AddAds.LoopRPicAdress.disabled=true;
  663. document.AddAds.SelectRPic.disabled=true;
  664. document.AddAds.IsLoop.checked=false;
  665. show();
  666. break;
  667. }
  668. }
  669. function ChooseCycleDis()
  670. {
  671. if (document.AddAds.IsLoop.checked==true)
  672. {
  673. document.AddAds.LoopFollow.disabled=false;
  674. document.AddAds.LoopSpeed.disabled=false;
  675. document.AddAds.LoopAdName.disabled=false;
  676. document.AddAds.IsLoopvalue.value=1;
  677. }
  678. else
  679. {
  680. document.AddAds.LoopFollow.disabled=true;
  681. document.AddAds.LoopSpeed.disabled=true;
  682. document.AddAds.LoopAdName.disabled=true;
  683. document.AddAds.IsLoopvalue.value=0;
  684. }
  685. }
  686. function Ad_Save()
  687. {
  688. document.AddAds.submit();
  689. }
  690. function Ad_Update()
  691. {
  692. document.AddAds.action="?Submit=SubUp&ID=<%=Temp_AdID%>&OpPage=<%=Request.QueryString("OpPage")%>";
  693. document.AddAds.submit();
  694. }
  695. function show()
  696. {
  697. document.all.tr1.style.display="";
  698. document.all.tr2.style.display="";
  699. document.all.tr3.style.display="";
  700. document.all.tr4.style.display="none";
  701. document.all.tr6.style.display="";
  702. }
  703. function f_add()
  704. {
  705.     var _tbobj=document.all.tb1
  706. var _trobj=_tbobj.rows
  707. if (_trobj.length>9)
  708. {
  709. return;
  710. var _newRow=_tbobj.insertRow(_tbobj.rows.length)
  711. var _newCell=_newRow.insertCell(0)
  712. _newCell.innerHTML="<tr><td> 显示文本 <input name=AdTxtContent type=text id=AdTxtContent size=30 maxlength=200> 样式 <input name=AdTxtCss type=text size=7 maxlength=40> 链接地址 <input name=AdTxtLink type=text id=AdTxtLink size=16 maxlength=100><a href='#'onclick='f_delete(this.parentElement.parentElement)'> 删除 </a></td></tr>"; 
  713. _newCell=_newRow.insertCell(1) 
  714. }
  715. function f_delete(_aobj)
  716. {
  717. var _tbobj=document.all.tb1
  718. var _trobj=_tbobj.rows
  719. var _deltr=_aobj
  720.    for(var i=0;i<_trobj.length;i++)
  721.    {
  722.     if (_deltr==_trobj[i])
  723. {
  724. _tbobj.deleteRow(i)
  725. break;
  726. }
  727.    }
  728. }
  729. </script>
  730. <%
  731. If temp_loopfactor=1 Then Response.write "<script language=""javascript"">LoopFactorClick('2');</script>"
  732. If Clng(temp_adType)=11 Then Response.write "<script language=""javascript"">ChooseType(11);</script>"
  733. Sub Alert(Msg)
  734. Response.write "<script language=""javascript"">alert('"&Msg&"');history.go(-1);</script>"
  735. End Sub
  736. %>
  737. <%
  738. Set Conn=nothing
  739. %><!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->