📄 clubtopicloginfo.java
字号:
/*
* Created on 2005-5-29
* Made In GamVan.com
* 显示主题文章相关日至详细信息
*/
package com.gamvan.club.topic;
import com.gamvan.conn.ConnClub;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.ResultSet;
import com.gamvan.sql.PageableResultSet2;
import com.gamvan.sql.Pageable;
public class ClubTopicLogInfo {
private int userID=0, topicID=0, topicLogID=0;
private double userCredit=0, userMoney=0, userMark=0; //用户信誉、金币、积分变量
private int topicLogByUserID=0; //操作人员ID
private String userName = "";
private String topic = ""; //主题内容
private String topicLogTxt = ""; //日志备注,日志产生原因
private String topicLogSo = ""; //日志结果,日志产生的内容
private String topicLogByUserName = ""; //操作人员
private String topicLogByUserIP = "" ;//操作人员IP
private String topicLogByDateTime = ""; //操作时间
private String message = ""; //收集信息
private int topicLogList = 0, topicLogByUserList=0; //日志信息是否显示在网页底部
private String prtHtml = ""; //输出在页面上的信息
ConnClub bridge = new ConnClub();
public boolean pageLogInfoList(int tid) throws SQLException{
boolean bea = false;
Connection con = bridge.getConnection();
String sqlCommand = new String("");
Pageable rs;
PreparedStatement pps;
StringBuffer temp = new StringBuffer("");
try{
sqlCommand = "Select * From GVclubTopicLog where topicID=? and topicLogList=1 order by topicLogID desc";
pps = con.prepareStatement(sqlCommand, ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
pps.setInt(1,tid);
rs = new PageableResultSet2(pps.executeQuery());
rs.setPageSize(20); //设置一共显示前20条日志
int pageRows = rs.getPageRowsCount();
rs.gotoPage(1);
if(pageRows>0){
for(int i=0; i<pageRows; i++){
topicLogTxt = rs.getString(6);
topicLogByUserID = rs.getInt(7);
topicLogByUserName = rs.getString(8);
userCredit = rs.getDouble(11);
userMark = rs.getDouble(12);
userMoney = rs.getDouble(13);
topicLogSo = rs.getString(14);
topicLogByUserList = rs.getInt(15);
//if(userCredit==0 && userMark==0 && userMoney==0){
temp.append("<UL>");
temp.append("<li><strong>"+ topicLogSo +"</strong></li>");
temp.append("<br/>");
temp.append("<li>信誉:<span style=\"color:green; font-weight: bold;\">");
if(userCredit>0){temp.append("+");}
temp.append(String.valueOf(userCredit));
temp.append("</span> 积分:<span style=\"color:blue; font-weight: bold;\">");
if(userMark>0){temp.append("+");}
temp.append(String.valueOf(userMark));
temp.append("</span> 金币:<span style=\"color:#bb0000; font-weight: bold;\">");
if(userMoney>0){temp.append("+");}
temp.append(String.valueOf(userMoney));
temp.append("</span></li>");
if(topicLogTxt!=null && !topicLogTxt.equals("")){
temp.append("<li>");
temp.append(topicLogTxt);
if(topicLogByUserList>0){
temp.append("<em> By:</em>"+topicLogByUserName);
}
temp.append("</li>");
}else{
if(topicLogByUserList>0){
temp.append("<li>");
temp.append("<em> By:</em>"+topicLogByUserName);
temp.append("</li>");
}
}
temp.append("</UL>");
//}
rs.next();
}
prtHtml = temp.toString();
bea = true;
}else{
bea = false;
}
rs.close();
pps.close();
}catch(SQLException e){
message = e.toString();
prtHtml = "日志打印错误";
}finally{
con.close();
}
return bea;
}
public String getMessage(){
return this.message;
}
public String getPrtHtml(){
return this.prtHtml;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -