%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/field_manager/include/manager_head.jsp"%>
<%
String c_home = r_call(request.getParameter("c_home"));
String c_maker = r_call(request.getParameter("c_maker"));
String board_no = r_call(request.getParameter("board_no"));
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();
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;
%>
No |
Title |
Wirter |
Click |
Date |
<%if(totalRecord==0) {%>
No data.
|
|
<%}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%>
|
&nowPage=<%=nowPage%>"><%=rst.getString("c_title")%>
|
<%=rst.getString("c_name")%>
|
<%=rst.getString("c_click")%>
|
<%=rst.getString("c_date").substring(0,10)%>
|
|
<%
c_number=c_number-1;
}
rst.close();
%>
<%} %>
|
<%if(pfirst > 1){ %>
〈〈
|
〈
|
<%}%>
<% for(int i=pfirst;i
<% if(i==nowPage){%>
<%=i%>
<%}else{%>
<%=i%>
<%}%>
|
<%}%>
<%if(plast < plast_org){ %>
〉
|
〉〉
|
<%}%>
|
|
|
Insert
|
|
<%}%>
<%@ include file="/field_manager/include/manager_bottom.jsp"%>