<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.DriverManager"%>
<%@ page import="java.sql.PreparedStatement"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page session="true" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body bgcolor="#777777" style="color : #eeeeee; width:750px; margin: 0 auto;">
<%
	if(session.getAttribute("login").equals("0") || !session.getAttribute("id").equals("admin")){
		%> <script>alert('잘못된 접근입니다.'); location.href="http://localhost:8080/Park20162515/Main.jsp"</script><%
	}else {
		%><jsp:include page="Online.jsp" /><%
	}
%>
<hr>
<table border="1" bgcolor="#eeeeee" style="color : #777777">
<tr>
<th></th>
<th>아이디</th>
<th>패스워드</th>
<th>이름</th>
<th>생년월일</th>
<th>우편번호</th>
<th>집 주소</th>
<th>이메일</th>
<th>직업</th>
</tr>
<%
try{
	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162515","970623");
	PreparedStatement pstmt = conn.prepareStatement("select * from member_1");
	ResultSet rs = pstmt.executeQuery();
	int i = 0;
	
	while(rs.next()){
		i++;
		%>
		<tr>
		<th>No.<%=i%></th>
		<td> <%=rs.getString("id")%> </td>
		<td> <%=rs.getString("pw")%> </td>
		<td> <%=rs.getString("name")%> </td>
		<td> <%=rs.getString("birthday")%> </td>
		<td> <%=rs.getString("zipcode")%> </td>
		<td> <%=rs.getString("zip")%> </td>
		<td> <%=rs.getString("email")%> </td>
		<td> <%=rs.getString("job")%> </td>
		</tr>
		<%
	}
	
	pstmt.close();
	conn.close();
	
}catch(Exception e){
	e.printStackTrace();
}
%>
</table>
</body>
</html>