<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<% request.setCharacterEncoding("utf-8");%>
<%
String id = (String)session.getAttribute("id");
String password = (String)session.getAttribute("password");
String authority= (String)session.getAttribute("authority");

String dbpassword="";
String dbname="";
String dbyear="";
String dbmonth="";
String dbday="";
String dbemail="";
String dbmail="";
String dbphone_number="";

ResultSet rs=null;

String sql=null;
try{
	   Class.forName("oracle.jdbc.driver.OracleDriver");
	   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20161505","961120");
	   sql="select * from log_member where id=? ";
	   PreparedStatement pstmt=conn.prepareStatement(sql);
	   pstmt.setString(1, id);
	   
	   rs=pstmt.executeQuery(); //결과 가져옴
	  
	  if(rs.next()){
		dbpassword=rs.getString("password");
		dbname=rs.getString("name");
		dbyear=rs.getString("year");
		dbmonth=rs.getString("month");
		dbday=rs.getString("day");
		dbemail=rs.getString("email");
		dbmail=rs.getString("mail");
		dbphone_number=rs.getString("phone_number");
		}
	}catch(Exception e){
e.printStackTrace();
out.print("오류");
}finally{
}
%>
<!-- ----------------------------------------------------------- -->

<!DOCTYPE html>
<html>
<link rel="stylesheet" href="../../visual.css">
<head>
<meta charset="UTF-8">
<title>회원정보</title>
</head>
<body>
<table border=1>
  <tr>
    <td colspan=4 span style="color:white; text-align:center; font-size:55px; width:450px">회원정보</td>
  </tr>
  <tr>
    <td colspan=1>아이디</td>
    <td colspan=3> <%= id %></td>
  </tr>
  <tr>
    <td colspan=1>비밀번호</td>
    <td colspan=3> <%= dbpassword %></td>
  </tr>
  <tr>
    <td colspan=1>이름</td>
    <td colspan=3> <%= dbname %></td>
  </tr>
  <tr>
    <td colspan=1>생년월일</td>
    <td  colspan=3> <%= dbyear %>년 <%= dbmonth %>월 <%= dbday %>일</td>
  </tr>
    <tr>
    <td colspan=1>이메일</td>
    <td colspan=3 > <%= dbemail %>@<%= dbmail %></td>
  </tr>
  <tr>
    <td colspan=1>휴대전화</td>
    <td colspan=3> <%= dbphone_number %></td>
  </tr>
</table>

<p style="text-align:center;">
<a href="editForm.jsp"><input type="button" value="정보수정" style="font-size:20px" class="button"></a>
</p>
	

</body>
</html>
