clubAd.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:4k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

Java

  1. <%@ page language="java" contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="../GVinc/gvInclude.jsp" %>
  3. <%@ include file="clubMasterPass.jsp" %>
  4. <jsp:useBean id="fo" scope="page" class="com.gamvan.tools.FileOperate" />
  5. <jsp:useBean id="ca" scope="page" class="com.gamvan.club.manage.ClubAd" />
  6. <% 
  7. //权限判断共享代码
  8. boolean ispass = false;
  9. //ArrayEdit ae = new ArrayEdit();
  10. ispass = ae.txtsArray(gvcmgTxt,6,"|");
  11. if(!ispass){
  12. out.print(prtCenter2("您无权进行此项操作!","",2));
  13. out.close();
  14. }
  15. short type = 0;
  16. type = TypeChange.stringToShort(request.getParameter("type"));
  17. int adID = TypeChange.stringToInt(request.getParameter("adID"));
  18. String adObj = "";
  19. String adTxt = "";
  20. String adUrl = "";
  21. short adWidth = 10;
  22. short adHeight = 10;
  23. short adType = 0;
  24. String ads = "";
  25. String message = "";
  26. String act = null;
  27. if(request.getParameter("act")!=null){
  28. act = request.getParameter("act");
  29. }else{
  30. act = "";
  31. }
  32. if(act.equals("del")&&adID>0){
  33. ca.setAdID(adID);
  34. ca.adDel();
  35. out.print(prtCenter2(ca.getMessage(),"./clubAd.jsp?type="+type+"",1));
  36. out.close();
  37. if(true)return;
  38. }
  39. if(request.getMethod().equals("POST")){
  40. StringBuffer adContent = new StringBuffer("");
  41. adContent.append("//this ad code Made In GamVanrn");
  42. adContent.append("var a = "+ request.getParameter("adCount")+";rn");
  43. adContent.append("var slump = Math.random();n");
  44. adContent.append("var talet = Math.round(slump * (a-1)+1);rn");
  45. adContent.append("b = new Array();rn");
  46. adContent.append("u = new Array();rn");
  47. adContent.append("w = new Array();rn");
  48. adContent.append("h = new Array();rn");
  49. adContent.append(request.getParameter("ads"));
  50. adContent.append("showad(b[talet], u[talet], w[talet], h[talet]);n");
  51. String filePathAndName=request.getRealPath("") + "\club\GVscriptInc\GVad_"+type+".js";  //绝对路径
  52. fo.createFile(filePathAndName,(adContent.toString()),"UTF-8");
  53. out.print(prtCenter2("广告代码更新成功!","./clubAd.jsp?type="+type+"",1));
  54. out.close();
  55. if(true)return;
  56. }
  57. %>
  58. <html>
  59. <head>
  60. <title>今晚在线-社区管理</title>
  61. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  62. <link href="css.css" rel="stylesheet" type="text/css">
  63. </head>
  64. <body>
  65. <script language="javascript" type="text/javascript" src="../GVscript/GVad.js"></script>
  66. <table width="99%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  67.   <tr>
  68.     <td align="center"><strong>社区随机广告管理</strong></td>
  69.   </tr>
  70.   <tr>
  71.     <td bgcolor="#e6e6e6"><strong><a href="clubAdEdit.jsp?act=add" target="_self">点击这里添加广告>>></a></strong></td>
  72.   </tr>
  73. </table>
  74. <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#DDDDDD">
  75.   <tr align="center" bgcolor="#e6e6e6">
  76.     <td><strong>广告效果</strong></td>
  77.   <td width="60"><strong>编辑</strong></td>
  78.   <td width="60"><strong>删除</strong></td>
  79.   </tr>
  80. <%
  81. int i = 0;
  82. int totalPage = 0;
  83. int iPage  = TypeChange.stringToInt(request.getParameter("iPage"));
  84. if(iPage<1){
  85. iPage=1;
  86. }
  87. totalPage = ca.adCount();
  88. %>
  89. <c:forEach var="a" items="<%=ca.adList(iPage,10)%>">
  90. <tr align="center">
  91. <td bgcolor="#f6f6f6">
  92. <club:ad type="showad" idIs="${a.adWidth}" linkId="${a.adHeight}" value="${a.adObj}" property="${a.adUrl}" />
  93. </td>
  94. <td bgcolor="#f6f6f6">
  95. <a href="clubAdEdit.jsp?act=edit&adID=<c:out value="${a.adID}"/>&type=<c:out value="${a.adType}"/>" target="_self">编辑</a>
  96. </td>
  97. <td bgcolor="#f6f6f6">
  98. <a href="clubAd.jsp?act=del&adID=<c:out value="${a.adID}"/>&type=<c:out value="${a.adType}"/>">删</a>
  99. </td>
  100. </tr>
  101. </c:forEach>
  102. <%
  103. ads = ca.getAds();
  104. %>
  105. <form name="Gforms" method="post" action="">
  106. <tr><td align="center" bgcolor="#f6f6f6" colspan="4">
  107. <input name="adCount" type="hidden" value="<%=totalPage%>">
  108. <input name="ads" type="hidden" value="<%=ads%>">
  109. <input name="gvSubmit" type="submit" value="更新广告代码"></td>
  110. </tr></form>
  111. </table>
  112. </body>
  113. </html>