<%@ 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 http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body >
<h2 style = " text-align : center; ">회 원 정 보 수 정</h2>
<hr>
<%
String id = (String) session.getAttribute("id");
String password = "";
String name = "";
String birth = "";
String zipcode = "";
String addadd = "";
String addemail = "";
String job = "";

Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;

try {
	
Class.forName("oracle.jdbc.driver.OracleDriver");
conn=DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl","20162513","970709");
pstmt=conn.prepareStatement("select * from member_20190514 where id = ?");
pstmt.setString(1, id);
rs=pstmt.executeQuery();

if (rs.next()) {
	password = rs.getString("password");
	name = rs.getString("name");
	birth = rs.getString("yyyymmdd");
	zipcode = rs.getString("zipcode");
	addadd = rs.getString("address");
	addemail = rs.getString("email");
	job = rs.getString("job");

}

if (id != null) {
	%><p style="text-align : center;">
	<%=id %>님 개인정보수정 페이지입니다. <br>
	수정할 정보를 입력해주세요.</p>
	<%
}
}catch(Exception e){
	e.printStackTrace();
}finally{
	
}
%>
<form action="editPro.jsp" method="post">
<table width="580px" border="2" style = "margin: 0 auto;">
<tr>
<th bgcolor="#FFFF88" width="100">사용자 ID</th>
<td colspan="3" width="150" ><%=session.getAttribute("id")%></td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">전비밀번호</th>
<td width="150"><input type="password" name="password" ></td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">후비밀번호</th>
<td width="150"><input type="password" name="repassword" ></td>
</tr>


<tr>
<th bgcolor="#FFFF88" width="100">사용자이름</th>
<td colspan="3" width="150"><input type="text" name="name" value="<%= name %>"></td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">생년월일</th>
<td colspan="3" width="150">
<input type="text" name="year">년
<select name="month">
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>월
<select name="day" >
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="09">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>일
</td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">우편번호</th>
<td colspan="3" width="150"><input type="text" name="zipcode" value="<%=zipcode%>" > <button>우편번호검색</button></td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">주소</th>
<td colspan="3"><input type="text" name="address" value="<%=addadd%>" size="60"></td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">E-Mail</th>
<td colspan="3" width="500"><input type="text" name="email" value="<%=addemail%>">
</td>
</tr>

<tr>
<th bgcolor="#FFFF88" width="100">직업</th>
<td colspan="3">
<select name="job" >
<option value="it관련">it관련</option>
<option value="교육관련">교육관련</option>
<option value="학생">학생</option>
<option value="직장인">직장인</option>
</select>
</td>
</tr>

<tr>
<th colspan="4">
<input type="submit" value="등  록"><input type="reset" value="취  소">
</th>
</tr>
</table>
</form>
<p style = "text-align : center;">
<A href="http://localhost:8080/woo/main.jsp">메인페이지로</p>
</body>
</html>