c-innovacion2/resoft/field_manager/process/member/list.jsp

205 lines
6.4 KiB
Plaintext

<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/field_manager/include/manager_head.jsp"%>
<%
int col_no = 10;
String c_home = r_call(request.getParameter("c_home"));
if(c_home.equals("")){
%>
alert("Wrong Connection.")
location.href="/"
<% }else{
%>
<center>
<table width="1024" cellSpacing="0" cellPadding="0" border="0">
<tr >
<td >
<table width="100%" cellSpacing="0" cellPadding="0" border="0" bgcolor=ffffff>
<tr >
<td height="60" style="font-weight:bold;">
Member List -
<%if(c_home.equals("t")){%>
Entire
<%}%>
<%if(c_home.equals("0")){%>
From BMC
<%}%>
<%if(!c_home.equals("0") && !c_home.equals("t")){
String sql_home=" SELECT * from tbl_field where c_no = " + c_home;
ResultSet rs_home = stmt.executeQuery(sql_home);
if(rs_home.next()) {
%>
From [ <%=rs_home.getString("c_name")%>(<%=rs_home.getString("c_eng_name")%>) ] Member
<%
}
rs_home.close();
%>
<%}%>
</td>
</tr>
</table>
<!---------------------------------------------------------------------------------------->
<table width="100%" cellSpacing="0" cellPadding="0" border="0" bgcolor=ffffff>
<form name="s_bcb" action="list.jsp" method="post" target="_self">
<tr >
<td align=right valign=bottom style="line-height:120%;padding-bottom:3px">
<font color=green>
* Member information is personal information. Care must be taken in handling.
</font>
</td>
</tr>
</form>
</table>
<table width="1024" cellSpacing="1" cellPadding="0" border="0" bgcolor=cdcdcd>
<tr bgcolor=ededed style="font-weight:bold;">
<td width="40" height="20" align=center >No</td>
<td width="90" align=center>Name</td>
<td align=center>ID</td>
<td width="100" align=center>Phonr</td>
<td width="150" align=center>Homepage</td>
<td width="150" align=center>Photo</td>
<td width="100" align=center>Status</td>
<td width="120" align=center>Joined</td>
<td width="120" align=center>From..</td>
</tr>
<%
String para_t = "&c_home=" + c_home;
String where_t = "";
if(c_home.equals("t")){
where_t = " c_use = 0 ";
}else{
where_t = " c_use = 0 and c_from = "+ c_home +" ";
}
int totalRecord = 0; //총레코드개수
int numPerPage = 20; //한페이지당 보여줄레코드개수
int totalPage = 0; //총페이지수
int pagePerBlock = 10; //블록당페이지수
int nowPage = 1; //현재페이지
String sql1 = "";
sql1 = " select count(a.c_no) ";
sql1 = sql1 + " from tbl_member a ";
sql1 = sql1 + " where "+ where_t +" ";
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;
sql1="";
sql1 = "SELECT a.* ";
sql1 = sql1 + ",(select c_name from tbl_field where c_no = a.c_from ) as home_name ";
sql1 = sql1 + " from tbl_member a ";
sql1 = sql1 + " where " + where_t +" order by c_rand asc";
rst = stmt.executeQuery(sql1);
int i_no = 0;
while (rst.next()) {
i_no = i_no + 1;
%>
<tr bgcolor=ffffff>
<td height="24" align="center"><%=i_no%></td>
<td align=center style="font-weight:bold;"><%=rst.getString("c_name")%></a></td>
<td align=center><%=rst.getString("c_id")%></td>
<td align=center><%=rst.getString("c_phone")%></td>
<td align=center><%=rst.getString("c_home")%></td>
<td align=center style="padding:3px">
<%if(!rst.getString("c_photo").equals("")){%>
<img src="/upload/photo/<%=rst.getString("c_photo")%>" width=80>
<%}%>
</td>
<td align=center>
<%if(rst.getInt("c_rand") == 0){%>
Registration completed
<%}else{%>
Waiting to join
<%}%>
</td>
<td align=center><%=rst.getString("c_date").substring(0,10)%></td>
<td align=center>
<%if(rst.getInt("c_from") == 0){%>
BMC
<%}else{%>
<%=rst.getString("home_name")%>
<%}%>
</td>
</tr>
<%
}
if(i_no == 0){
%>
<tr bgcolor=ffffff>
<td colspan="<%=col_no%>" height="60" align="center">There is no data.</td>
</tr>
<% }
rst.close();
%>
</table>
<!---------------------------------------------------------------------------------------->
<br>
<table width="100%" cellSpacing="0" cellPadding="0" border="0" bgcolor=ffffff>
<tr>
<td height="35" align="center" colspan="9" style="padding-bottom:10px;padding-top:10px">
<table align=center border=0 cellspacing=0 cellpadding=0>
<tr>
<%if(pfirst > 1){ %>
<td align=center width="32" style='padding=0,4,0,4'>
<a href="list.jsp?nowPage=1&<%=para_t%>">〈〈</a>
</td>
<td align=center width="32" style='padding=0,4,0,0'>
<a href="list.jsp?nowPage=<%=pfirst-1%>&<%=para_t%>">〈</a>
</td>
<%}%>
<% for(int i=pfirst;i<plast+1;i=i+1){%>
<td align=center width="32" style='padding=0,0,0,0' valign=top>
<% if(i==nowPage){%>
<font color=#4D9ACF size=3><b><%=i%>
<%}else{%>
<a href="list.jsp?nowPage=<%=i%>&<%=para_t%>"><font color=#787878 size=3><b><%=i%></b></a>
<%}%>
</td>
<%}%>
<%if(plast < plast_org){ %>
<td align=center width="32" style='padding=0,4,0,4'>
<a href="list.jsp?nowPage=<%=plast+1%>&<%=para_t%>">〉</a>
</td>
<td align=center width="32" style='padding=0,4,0,0'>
<a href="list.jsp?nowPage=<%=plast_org%>&<%=para_t%>">〉〉</a>
</td>
<%}%>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%}%>
<%@include file="/field_manager/include/manager_bottom.jsp"%>