clubAd.jsp
上传用户:u_thks
上传日期:2022-07-31
资源大小:1910k
文件大小:4k
- <%@ page language="java" contentType="text/html;charset=UTF-8" %>
- <%@ include file="../GVinc/gvInclude.jsp" %>
- <%@ include file="clubMasterPass.jsp" %>
- <jsp:useBean id="fo" scope="page" class="com.gamvan.tools.FileOperate" />
- <jsp:useBean id="ca" scope="page" class="com.gamvan.club.manage.ClubAd" />
- <%
- //权限判断共享代码
- boolean ispass = false;
- //ArrayEdit ae = new ArrayEdit();
- ispass = ae.txtsArray(gvcmgTxt,6,"|");
- if(!ispass){
- out.print(prtCenter2("您无权进行此项操作!","",2));
- out.close();
- }
- short type = 0;
- type = TypeChange.stringToShort(request.getParameter("type"));
- int adID = TypeChange.stringToInt(request.getParameter("adID"));
- String adObj = "";
- String adTxt = "";
- String adUrl = "";
- short adWidth = 10;
- short adHeight = 10;
- short adType = 0;
- String ads = "";
- String message = "";
- String act = null;
- if(request.getParameter("act")!=null){
- act = request.getParameter("act");
- }else{
- act = "";
- }
- if(act.equals("del")&&adID>0){
- ca.setAdID(adID);
- ca.adDel();
- out.print(prtCenter2(ca.getMessage(),"./clubAd.jsp?type="+type+"",1));
- out.close();
- if(true)return;
- }
- if(request.getMethod().equals("POST")){
- StringBuffer adContent = new StringBuffer("");
- adContent.append("//this ad code Made In GamVanrn");
- adContent.append("var a = "+ request.getParameter("adCount")+";rn");
- adContent.append("var slump = Math.random();n");
- adContent.append("var talet = Math.round(slump * (a-1)+1);rn");
- adContent.append("b = new Array();rn");
- adContent.append("u = new Array();rn");
- adContent.append("w = new Array();rn");
- adContent.append("h = new Array();rn");
- adContent.append(request.getParameter("ads"));
- adContent.append("showad(b[talet], u[talet], w[talet], h[talet]);n");
- String filePathAndName=request.getRealPath("") + "\club\GVscriptInc\GVad_"+type+".js"; //绝对路径
- fo.createFile(filePathAndName,(adContent.toString()),"UTF-8");
- out.print(prtCenter2("广告代码更新成功!","./clubAd.jsp?type="+type+"",1));
- out.close();
- if(true)return;
- }
- %>
- <html>
- <head>
- <title>今晚在线-社区管理</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="css.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <script language="javascript" type="text/javascript" src="../GVscript/GVad.js"></script>
- <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
- <tr>
- <td align="center"><strong>社区随机广告管理</strong></td>
- </tr>
- <tr>
- <td bgcolor="#e6e6e6"><strong><a href="clubAdEdit.jsp?act=add" target="_self">点击这里添加广告>>></a></strong></td>
- </tr>
- </table>
- <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#DDDDDD">
- <tr align="center" bgcolor="#e6e6e6">
- <td><strong>广告效果</strong></td>
- <td width="60"><strong>编辑</strong></td>
- <td width="60"><strong>删除</strong></td>
- </tr>
- <%
- int i = 0;
- int totalPage = 0;
- int iPage = TypeChange.stringToInt(request.getParameter("iPage"));
- if(iPage<1){
- iPage=1;
- }
- totalPage = ca.adCount();
- %>
- <c:forEach var="a" items="<%=ca.adList(iPage,10)%>">
- <tr align="center">
- <td bgcolor="#f6f6f6">
- <club:ad type="showad" idIs="${a.adWidth}" linkId="${a.adHeight}" value="${a.adObj}" property="${a.adUrl}" />
- </td>
- <td bgcolor="#f6f6f6">
- <a href="clubAdEdit.jsp?act=edit&adID=<c:out value="${a.adID}"/>&type=<c:out value="${a.adType}"/>" target="_self">编辑</a>
- </td>
- <td bgcolor="#f6f6f6">
- <a href="clubAd.jsp?act=del&adID=<c:out value="${a.adID}"/>&type=<c:out value="${a.adType}"/>">删</a>
- </td>
- </tr>
- </c:forEach>
- <%
- ads = ca.getAds();
- %>
- <form name="Gforms" method="post" action="">
- <tr><td align="center" bgcolor="#f6f6f6" colspan="4">
- <input name="adCount" type="hidden" value="<%=totalPage%>">
- <input name="ads" type="hidden" value="<%=ads%>">
- <input name="gvSubmit" type="submit" value="更新广告代码"></td>
- </tr></form>
- </table>
- </body>
- </html>