<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%
	String id = (String) session.getAttribute("id");
	String name = "";
	String birth = "";
	String gender = "";
	String email = "";
	String phone = "";

	Class.forName("oracle.jdbc.driver.OracleDriver");
	Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@168.126.146.45:1521:orcl", "20152488",
			"960504");
	PreparedStatement pstmt = conn.prepareStatement("select * from membership where id = ?");
	pstmt.setString(1, id);
	ResultSet rs = pstmt.executeQuery();

	if (rs.next()) {
		name = rs.getString("name");
		birth = rs.getString("birth");
		gender = rs.getString("gender");
		email = rs.getString("email");
		phone = rs.getString("phone");
	}
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>회원정보수정</title>
<style>
body {
	background-image: url("../image/background.jpg");
	background-repeat: no-repeat;
	background-size: 100%;
}
</style>
</head>
<body>
	<div class="update">
		<style>
.update {
	position: absolute;
	top: 38%;
	left: 50%;
	transform: translate(-50%, -50%);
}

table, tr, td {
	padding: 10px;
	border: 1px solid #000000;
	border-collapse: collapse;
	text-align: center;
}

thead {
	text-align: center;
	font-weight: bold;
}
</style>
		<h2>회원정보수정</h2>
		<hr>
		<p>
		<fieldset style="padding: 30px; border-color: #A0D9E2;">
			<legend>정보수정</legend>
			<table>
				<form method="post" action="updatePro.jsp">
					<tr>
						<th bgcolor="#D4F4FA">아이디</th>
						<td><input type="text" name="id" id="userid"
							value="<%=session.getAttribute("id")%>"></td>
					</tr>
					<tr>
						<th bgcolor="#D4F4FA">비밀번호</th>
						<td><input type="password" name="password" id="userpwd"
							placeholder="비밀번호"></td>
					</tr>
					<tr>
						<th bgcolor="#D4F4FA">이름</th>
						<td><input type="text" name="name" value="<%=name%>"></td>
					</tr>
					<tr>
						<th bgcolor="#D4F4FA">생년월일</th>
						<td><input type="text" name="birth" value="<%=birth%>"></td>
					<tr>
						<th bgcolor="#D4F4FA">성별</th>
						<td><input type="radio" name="gender" value="man"
							<%if (gender.equals("man")) {%> checked <%}%>>남성 <input
							type="radio" name="gender" value="woman"
							<%if (gender.equals("woman")) {%> checked <%}%>>여성</td>
					</tr>
					<tr>
						<th bgcolor="#D4F4FA">이메일</th>
						<td><input type="text" name="email" value="<%=email%>"></td>
					</tr>
					<tr>
						<th bgcolor="#D4F4FA">전화번호</th>
						<td><input type="text" name="phone" value="<%=phone%>"></td>
					</tr>
					<tr>
						<td colspan="2"><input type="submit" value="회원수정"> <input
							type="button" value="회원탈퇴" onclick="location='deleteForm.jsp'"></td>
					</tr>

					<p>
				</form>
			</table>
	</div>
</body>
</html>