📄 clubaffiche.java
字号:
package com.gamvan.club;import com.gamvan.conn.*;import com.gamvan.tools.*;import com.gamvan.sql.*;import java.sql.*;import java.util.*;public class ClubAffiche{ private String caTopic = new String(""); private String caContent = new String(""); private String caAddTime = new String(""); private String caByUser = new String(""); private String caByip = new String(""); private String message = new String(""); private int caID = 0; private int ccID = 0; private int caDays = 0; Gb clubgb = new Gb(); //中文编码 //格式化当前时间 java.text.SimpleDateFormat isNow = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private String now = isNow.format(new java.util.Date()); ConnClub bridge = new ConnClub(); public String afficheMarquee(int ccid, int num) throws Exception{ String temp = new String(); String sqlCommand = new String(); Pageable rs; temp = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" ><tr>"; temp += "<td width=\"38\"><span style=\"font-weight: bold\">公告:</span></td><td>"; Connection con = bridge.getConnection(); try{ String temp2 = ""; sqlCommand = "Select * From GVclubAffiche "; if(ccid!=-1){sqlCommand += " where ccID = ? or ccID=-1";} sqlCommand += " order by caID desc"; PreparedStatement pps = con.prepareStatement(sqlCommand, ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); if(ccid!=-1){pps.setInt(1, ccid);} rs = new PageableResultSet2(pps.executeQuery()); int i = 0; int pageRows = rs.getPageRowsCount(); temp2 = "\n<script language=\"javascript\">\n"; temp2 += "var marqueeContent=new Array();\n"; if(pageRows>0){ while(rs.next()){ temp2 += "marqueeContent["+i+"]='<a href=clubAfficheInfo.jsp?ccID="+ ccid + "&caID="+ rs.getInt(1); temp2 += " target=_self>" + rs.getString(3).trim() +"</a> "; temp2 += "<span style=\"color:#990066 \">"+ rs.getDate(5) + "</span><br>';\n"; i++; } if(pageRows==1){ temp2 += "marqueeContent[1]='欢迎诸君莅临<a href=\"http://club.gamvan.com\" target=\"_blank\">今晚在线</a><br>';\n"; } temp2 += "</script><script language=\"javascript\" src=\"./GVscript/marquee.js\"></script>"; }else{ temp2 = "欢迎诸君莅临<a href=\"http://club.gamvan.com\" target=\"_blank\">今晚在线</a>"; } rs.close(); pps.close(); temp += temp2; }catch(Exception e){ temp += "暂无公告!"; con.close(); }finally{ con.close(); } temp += "</td></tr></table>"; return temp; } public String afficheList(int ccid, int num) throws Exception{ String temp = new String(); String sqlCommand = new String(); Pageable rs; temp = "<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\" ><tr>"; temp += "<td>"; Connection con = bridge.getConnection(); try{ String temp2 = ""; sqlCommand = "Select * From GVclubAffiche "; if(ccid!=-1){sqlCommand += " where ccID = ? or ccID=-1";} sqlCommand += " order by caID desc"; PreparedStatement pps = con.prepareStatement(sqlCommand, ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE); if(ccid!=-1){pps.setInt(1, ccid);} rs = new PageableResultSet2(pps.executeQuery()); int pageRows = rs.getPageRowsCount(); if(pageRows>0){ while(rs.next()){ temp2 += "<img src=\"GVimgs/GamVanMood/1.gif\" align=\"absmiddle\" /><a href=clubAfficheInfo.jsp?ccID="+ ccid + "&caID="+ rs.getInt(1); temp2 += " target=_self>" + rs.getString(3).trim() +"</a> "; temp2 += "<span class=\"smallTxt\" style=\"color:#990066 \">"+ rs.getDate(5) + "</span><br>\n"; } }else{ temp2 = "欢迎诸君莅临<a href=\"http://club.gamvan.com\" target=\"_blank\">今晚在线</a>"; } rs.close(); pps.close(); temp += temp2; }catch(Exception e){ con.close(); temp += "暂无公告!"; }finally{ con.close(); } temp += "</td></tr></table>"; return temp; } public boolean afficheInfo(int caid) throws Exception{ boolean bea = false; String sqlCommand = new String(); ResultSet rs; Connection con = bridge.getConnection(); try{ sqlCommand = "Select * From GVclubAffiche where caID=?"; PreparedStatement pps = con.prepareStatement(sqlCommand); pps.setInt(1, caid); rs = pps.executeQuery(); if(rs.next()){ ccID = rs.getInt(2); caTopic = rs.getString(3).trim(); caContent = rs.getString(4).trim(); caAddTime = rs.getString(5); caDays = rs.getInt(6); caByUser = rs.getString(7); caByip = rs.getString(8); } rs.close(); pps.close(); bea = true; }catch(Exception e){ con.close(); bea = false; message= "系统发生意外错误,指令将不被执行,请重新尝试!"; }finally{ con.close(); } return bea; } public String getMessage(){ return this.message; } public void setCCID(int ccID){ this.ccID=ccID; } public int getDay(){ return 112; } public int getDays(){ return this.caDays; } public String getByUser(){ return this.caByUser; } public String getByip(){ return this.caByip; } public String getTopic(){ return this.caTopic; } public String getContent(){ return this.caContent; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -