📄 clubclasslist.java
字号:
/* * Made in GamVan */package com.gamvan.club;import com.gamvan.conn.*;import com.gamvan.tools.*;import java.sql.*;public class ClubClassList{ private Statement sta; private String sqlCommand = new String(); private String tempString = new String(""); private String ccName; private int ccOrder, ccStyle, ccHidden, ccPro, ccType, ccID, ccIDD, ccTopic, ccReply; ClubClassList2 ccl2 = new ClubClassList2(); //建立数据库联接 ConnClub bridge = new ConnClub(); public String classSelect(int ccID, int layer, int ccid) throws SQLException{ Connection con = bridge.getConnection(); try{ sta = con.createStatement(); ResultSet rs; if(ccID>0){ sqlCommand = "Select * From GVclubClass where ccIDD = " + ccID + " order by ccOrder desc"; }else{ sqlCommand = "Select * From GVclubClass where ccIDD = 0 order by ccOrder desc " ; } rs = sta.executeQuery(sqlCommand); tempString = ""; while(rs.next()){ ccID = rs.getInt("ccID"); ccName = rs.getString("ccName"); ccType = rs.getInt("ccType"); tempString += "<option value=\""+ String.valueOf(ccID) +"\""; if(ccID==ccid){ tempString += " selected"; } tempString += ">"; for(int i = 0; i < layer; i++){ tempString += " "; } if(ccType==0){ tempString += "[分类] "; }else{ tempString += "[版面] "; } tempString += ccName +"</option>"; tempString += ccl2.classSelectOpt(ccID, layer+2, ccid); //ccl2.finalString(); } rs.close(); sta.close(); }catch(Exception e){ con.close(); }finally { con.close(); } return tempString; } public String classListTab(int ccID, int layer) throws Exception{ Connection con = bridge.getConnection(); try{ sta = con.createStatement(); ResultSet rs; if(ccID>0){ sqlCommand = "Select * From GVclubClass where ccIDD = " + ccID + " order by ccOrder desc"; }else{ sqlCommand = "Select * From GVclubClass where ccIDD = 0 order by ccOrder desc " ; } rs = sta.executeQuery(sqlCommand); tempString = ""; while(rs.next()){ ccID = rs.getInt("ccID"); ccName = rs.getString("ccName"); ccType = rs.getInt("ccType"); ccStyle = rs.getInt("ccStyle"); ccPro = rs.getInt("ccPro"); ccHidden = rs.getInt("ccHidden"); ccTopic = rs.getInt("ccTopic"); ccReply = rs.getInt("ccReply"); tempString += "<tr bgcolor=\"#f6f6f6\"><td height=\"22\" align=\"center\" bgcolor=\"#f6f6f6\">"; tempString += "<input name=\"ccID\" type=\"checkbox\" id=\"ccID\" value=\"" + ccID + "\" /></td><td>"; for(int i = 0; i < layer; i++){ tempString += " "; } tempString += ccName + "</td><td align=\"center\">"; if(ccType==0){ tempString += "<font color=#bb0000>分类</font>"; }else{ tempString += "<font color=#000099>版面</font>"; } tempString += "</td><td align=\"center\">"; if(ccHidden==0){ tempString += "不隐藏" ; }else{ tempString += "隐藏" ; } tempString += "</td><td align=\"center\">" ; switch(ccPro){ case 0: tempString += ("开放的"); break; case 1: tempString += ("主题的"); break; case 2: tempString += ("锁定的"); break; case 3: tempString += ("认证的"); break; } tempString += "</td><td align=\"center\">" ; if(ccStyle==0){ tempString += ("BBS风格"); }else{ tempString += ("讨论区风格"); } tempString += "</td><td align=\"center\">" ; tempString += "" + ccTopic + "</td><td align=\"center\">" ; tempString += ccReply + "</td><td align=\"center\">" ; tempString += "<img src=\"../GVimgs/up.gif\">" ; tempString += " <img src=\"../GVimgs/down.gif\"></td>" ; tempString += "<td align=\"center\"><a href=\"clubClassEdit.jsp?ccID=" + ccID + "\">配置</a></td></tr>" ; tempString += ccl2.classListTab(ccID, layer+2); ccl2.finalString(); } rs.close(); sta.close(); }catch(Exception e){ con.close(); }finally { con.close(); } return tempString; } public void finalString(){ this.tempString = ""; }}////////////////////////////////////////////////////class ClubClassList2 { private Statement sta; private String sqlCommand = new String(); private String tempString = new String(); private String ccName; private int ccOrder, ccStyle, ccHidden, ccPro, ccType, ccID, ccIDD, ccTopic, ccReply; //建立数据库联接 ConnClub bridge = new ConnClub(); public String classSelectOpt(int ccID, int layer, int ccid) throws Exception{ Connection con = bridge.getConnection(); try{ sta = con.createStatement(); ResultSet rs; if(ccID>0){ sqlCommand = "Select * From GVclubClass where ccIDD = " + ccID + " order by ccOrder desc"; }else{ sqlCommand = "Select * From GVclubClass where ccIDD = 0 order by ccOrder desc " ; } rs = sta.executeQuery(sqlCommand); tempString = ""; while(rs.next()){ ccID = rs.getInt("ccID"); ccName = rs.getString("ccName"); ccType = rs.getInt("ccType"); tempString += "<option value=\""+ String.valueOf(ccID) +"\""; if(ccID==ccid){ tempString += " selected"; } tempString += ">"; for(int i = 0; i < layer; i++){ tempString += " "; } if(ccType==0){ tempString += " [分类] "; }else{ tempString += " [版面] "; } tempString += ccName +"</option>"; } rs.close(); sta.close(); }catch(Exception e){ con.close(); }finally{ con.close(); } return tempString; } ////////////////////////////////////////////////////////////// public String classListTab(int ccID, int layer) throws Exception{ Connection con = bridge.getConnection(); try{ sta = con.createStatement(); ResultSet rs; if(ccID>0){ sqlCommand = "Select * From GVclubClass where ccIDD = " + ccID + " order by ccOrder desc"; }else{ sqlCommand = "Select * From GVclubClass where ccIDD = 0 order by ccOrder desc " ; } rs = sta.executeQuery(sqlCommand); tempString = ""; while(rs.next()){ ccID = rs.getInt("ccID"); ccName = rs.getString("ccName"); ccType = rs.getInt("ccType"); ccStyle = rs.getInt("ccStyle"); ccPro = rs.getInt("ccPro"); ccHidden = rs.getInt("ccHidden"); ccTopic = rs.getInt("ccTopic"); ccReply = rs.getInt("ccReply"); tempString += "<tr bgcolor=\"#f6f6f6\"><td height=\"22\" align=\"center\" bgcolor=\"#f6f6f6\">"; tempString += "<input name=\"ccID\" type=\"checkbox\" id=\"ccID\" value=\"" + ccID + "\" /></td><td>"; for(int i = 0; i < layer; i++){ tempString += " "; } tempString += ccName + "</td><td align=\"center\">"; if(ccType==0){ tempString += "<font color=#bb0000>分类</font>"; }else{ tempString += "<font color=#000099>版面</font>"; } tempString += "</td><td align=\"center\">"; if(ccHidden==0){ tempString += "不隐藏" ; }else{ tempString += "隐藏" ; } tempString += "</td><td align=\"center\">" ; switch(ccPro){ case 0: tempString += ("开放的"); break; case 1: tempString += ("主题的"); break; case 2: tempString += ("锁定的"); break; case 3: tempString += ("认证的"); break; } tempString += "</td><td align=\"center\">" ; if(ccStyle==0){ tempString += ("BBS风格"); }else{ tempString += ("讨论区风格"); } tempString += "</td><td align=\"center\">" ; tempString += "" + ccTopic + "</td><td align=\"center\">" ; tempString += ccReply + "</td><td align=\"center\">" ; tempString += "<img src=\"../GVimgs/up.gif\">" ; tempString += " <img src=\"../GVimgs/down.gif\"></td>" ; tempString += "<td align=\"center\"><a href=\"clubClassEdit.jsp?ccID=" + ccID + "\">配置</a></td></tr>" ; //tempString += ccl.classListTab(ccID, layer+2); //ccl.finalString(); } rs.close(); sta.close(); }catch(Exception e){ con.close(); }finally{ con.close(); } return tempString; } public void finalString(){ this.tempString = ""; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -