%@page contentType="text/html; charset=utf-8" %> <%@ include file = "/common/common.jsp"%> <% StringBuffer listHtml = new StringBuffer(); StringBuffer sql = new StringBuffer(); DBManager dbm = null; QueryResult qr = null; QueryResult qr2 = null; List param = new ArrayList(); int fileCnt = 0; StringBuffer attachFiles = new StringBuffer(); try { dbm = new DBManager(); sql.append("SELECT SEQ, SUBJECT, CONTENT, "); sql.append(" (SELECT COUNT(*) FROM T_CM_COMMON_BBS_FILE WHERE BBS_CODE = A.BBS_CODE AND P_SEQ = A.SEQ) AS FILE_COUNT "); sql.append("FROM T_CM_COMMON_BBS A WHERE BBS_CODE = 400 AND IS_NOTICE = 'N' "); sql.append("ORDER BY SEQ DESC"); qr = dbm.executeQuery(sql); int i = 0; String areaExpanded = ""; String callapseShow = ""; while(qr.hasNext()) { attachFiles.delete(0, attachFiles.length()); fileCnt = Integer.parseInt(qr.nextValue("FILE_COUNT")); if(fileCnt > 0) { sql.delete(0, sql.length()); sql.append("SELECT SEQ, NAME, ORI_NAME "); sql.append("FROM T_CM_COMMON_BBS_FILE "); sql.append("WHERE BBS_CODE = 400 AND P_SEQ = ? "); param.clear(); param.add(qr.nextValue("SEQ")); qr2 = dbm.executeQuery(sql, param); while(qr2.hasNext()) { attachFiles.append(" " + qr2.nextValue("ORI_NAME") + ""); } } if(i == 0) { areaExpanded = "false"; callapseShow = ""; } else { areaExpanded = "false"; callapseShow = ""; } listHtml.append("
" + attachFiles + "
"); } listHtml.append("" + qr.nextValue("CONTENT") + "
"); listHtml.append("