<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@include file="/include/db/db_connect.jsp"%> <%@include file="/include/function/function.jsp"%> Main Management for C-Innovacion <% String c_home = "0"; String c_maker = "0"; String board_no = "0"; if(board_no == null || board_no.equals("")){ %> <% }else{ %>



<% int c_relation = 0; int c_relation2 = 0; String sql_ok2 = "select * from tbl_menu where c_no = " + board_no; ResultSet rss = stmt.executeQuery(sql_ok2); if(rss.next()){ c_relation= rss.getInt("c_relation"); c_relation2= rss.getInt("c_relation2"); %> [ <%=rss.getString("c_name")%> ] board management <% } rss.close(); c_relation = 0; c_relation2 = 1; String para_t = "c_home=" + c_home + "&c_maker=" + c_maker + "&board_no=" + board_no + "&c_relaton=" + c_relation + "&c_relation2=" + c_relation2; %>
<% String where_t = " c_use = 0 and "; int totalRecord = 0; //총레코드개수 int numPerPage = 10; //한페이지당 보여줄레코드개수 int totalPage = 0; //총페이지수 int pagePerBlock = 10; //블록당페이지수 int nowPage = 1; //현재페이지 String sql1 = ""; sql1 = " select count(c_no) "; sql1 = sql1 + " from tbl_board "; sql1 = sql1 + " where "+ where_t +" c_relation = "+ c_relation +" and c_relation2 = "+ c_relation2 +" and c_home = "+ c_home +" and c_maker = "+ c_maker +" and c_board_no = "+ board_no +" "; ResultSet rst = stmt.executeQuery(sql1); if (rst.next()) { totalRecord = rst.getInt(1); } rst.close(); if ( r_call(request.getParameter("nowPage")) != null && !r_call(request.getParameter("nowPage")).equals("")) { nowPage = Integer.parseInt(r_call(request.getParameter("nowPage"))); } //nowPage = 93; //totalRecord =1240; int pfirst = 0; //첫페이지 번호 int plast = 0; // 끝페이지 번호 int plast_org = 0; pfirst = ((nowPage-1)/pagePerBlock)*pagePerBlock + 1; plast = pfirst + pagePerBlock - 1; plast_org = (totalRecord-1)/numPerPage + 1; if(plast > plast_org){ plast = plast_org; } int c_number=totalRecord-(nowPage-1)*numPerPage; int sql_now_page = (nowPage - 1) * numPerPage; %> <%if(totalRecord==0) {%> <%}else{%> <% sql1 = " select t.* from ( select a.* "; sql1 = sql1 + " from tbl_board a "; sql1 = sql1 + " where "+ where_t +" a.c_relation = "+ c_relation +" and a.c_relation2 = "+ c_relation2 +" and a.c_home = "+ c_home +" and a.c_maker = "+ c_maker +" and a.c_board_no = "+ board_no +") t "; sql1 = sql1 + " order by t.c_no desc "; sql1 = sql1 + " limit "+ sql_now_page +" , "+ numPerPage +" "; rst = stmt.executeQuery(sql1); while (rst.next()) { %> <% c_number=c_number-1; } rst.close(); %> <%} %>
No Title Wirter File Clicks Date
No data.
<%=c_number%> &nowPage=<%=nowPage%>"><%=rst.getString("c_title")%> <%=rst.getString("c_name")%> <%if(!rst.getString("c_file").equals("")){%> O <%}%> <%=rst.getString("c_click")%> <%=rst.getString("c_date").substring(0,10)%>
<%if(pfirst > 1){ %> <%}%> <% for(int i=pfirst;i <%}%> <%if(plast < plast_org){ %> <%}%>
〈〈 <% if(i==nowPage){%> <%=i%> <%}else{%> <%=i%> <%}%> 〉〉
Insert
<%}%> <%@include file="/include/db/db_close.jsp"%>