<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<center>
<jsp:useBean id="lecdb" class="com.heeeun.member.DBconnection" scope="page"/>
<%
String loginId = (String)session.getAttribute("id");
String loginName =(String)session.getAttribute("name");
boolean login=(loginId == null) ? false : true;

if(login){
	out.println(loginName + "님 로그인하셨습니다.");
	out.println("<a href='logout.jsp'> 로그아웃</a>");
}
else
{
	out.println("로그인 하지 않았습니다.");
    out.println("<a href='loginform.jsp'> 로그인</a>");
}
%>	

<%
String[] selcetCourse = request.getParameterValues("selcetCourse");
lecdb.updateEnrollLecture(selcetCourse);
/*lecdb는 DB구성후 연결할 변수*/
%>
<h1>수강신청 결과</h1>
<form name="dataOutput">
<table align="center" border="1">
<tr>
<td>아 이 디 :</td>
<td> 
<%if(session.getAttribute("id") != null){
	out.println(session.getAttribute("id"));
}else{
%>
<input tpye="text" name="setName" size="50"/>
<%} %>
</td> 
</tr>


<tr>
<td>이     름 :</td>
<td> 
<%if(session.getAttribute("name") != null){
	out.println(session.getAttribute("name"));
}else{
%>
<input type="text" name="setName" size="50"/>
<%} %>
</td> 
</tr>


<tr>
<td>과목</td>
<td>
<%
for(int i=0; i<selcetCourse.length;i++){
	out.print(selcetCourse[i]+" ");
	if(i != selcetCourse.length)
	{
		out.print("/");
	}
}

%>
</td>
</tr>
</table>
</form>

<a href="dataInput.jsp">수강신청하러가기</a><p>
<a href="resultView.jsp">전체 수강신청 인원 현황</a>
</center>
</body>
</html>











