Web programming

(22.12.12)MVC ๋ฐฉ์‹ ๊ฐœ๋ฐœ๋ฐฉ๋ฒ•๋ก 2 - SQL์—ฐ๋™ํ•˜์—ฌ ๊ด€๋ฆฌ์ž ์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐ

ํ”„๋กœ๊ทธ๋ž˜๋จธ ์˜ค์›” 2022. 12. 12.

โ—โ—๊ด€๋ฆฌ์ž ์‚ฌ์ดํŠธ ๋งŒ๋“ค๊ธฐโ—โ—

 

์ด์šฉ์ž๊ฐ€ ๋ฌธ์ œ๋ฅผ ํ‘ผ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›์•„ ์ฑ„์ ์„ ํ•˜๊ณ  ๋‹ค์Œ ํ•™์Šต์„ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค€๋‹ค.

์ด์šฉ์ž์˜ ํ•™์Šต ํžˆ์Šคํ† ๋ฆฌ๋ฅผ ๋ฐ›์•„์„œ ๋ณด๊ฒŒ ๋œ๋‹ค.

 

M : AdminVO.java , UserVO.java , HwStatusVO.java , AdminLmsDAO.java 

V :  adminList.jsp , adminDetail.jsp , AdminLoginForm.jsp , userDetail.jsp

C : AdminLmsServlet.java

Service Class : AdminLmsService.java

 

 

AdminLmsServlet.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
 
@WebServlet("/adminlms")
public class AdminLmsServlet extends HttpServlet {
    
    protected void service(HttpServletRequest request, HttpServletResponse response) 
            throws ServletException, IOException 
    {
        HttpSession session = request.getSession();
        String uid = (String)session.getAttribute("adminid");
        if(uid==null) {
            session.setAttribute("url", request.getRequestURL().toString());
            response.sendRedirect("lmslogin?cmd=adminloginform");
            return;
        }
        String view = new AdminLmsService(request, response).exec();
        if(view!=null) {
            getServletContext().getRequestDispatcher(view).forward(request, response);
        }
    }
}
 
cs

 

 

 

AdminVO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
public class AdminVO 
{
    private String adminid;
    private int adminpw;
    private String adminemail;
    private int adminphone;
    
    public AdminVO() {}
    
    public AdminVO(String adminid) {
        this.adminid = adminid;
    }
    public AdminVO(String adminid, int adminpw, String adminemail, int adminphone) {
        this.adminid = adminid;
        this.adminpw = adminpw;
        this.adminemail = adminemail;
        this.adminphone = adminphone;
    }
 
    public String getAdminid() {
        return adminid;
    }
 
    public void setAdminid(String adminid) {
        this.adminid = adminid;
    }
 
    public int getAdminpw() {
        return adminpw;
    }
 
    public void setAdminpw(int adminpw) {
        this.adminpw = adminpw;
    }
 
    public String getAdminemail() {
        return adminemail;
    }
 
    public void setAdminemail(String adminemail) {
        this.adminemail = adminemail;
    }
 
    public int getAdminphone() {
        return adminphone;
    }
 
    public void setAdminphone(int adminphone) {
        this.adminphone = adminphone;
    }
}
cs

 

UserVO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public class UserVO 
{
    private String userid;
    private int userpw;
    private String useremail;
    private String userphone;
    
    public UserVO() {}
    
    public UserVO(String userId) {
        this.userid = userId;
    }
    public UserVO(String userid, int userpw, String useremail, String phone) {
        this.userid = userid;
        this.userpw = userpw;
        this.useremail = useremail;
        this.userphone = phone;
    }
    public String getUserid() {
        return userid;
    }
 
    public void setUserid(String userid) {
        this.userid = userid;
    }
 
    public int getUserpw() {
        return userpw;
    }
 
    public void setUserpw(int userpw) {
        this.userpw = userpw;
    }
 
    public String getUseremail() {
        return useremail;
    }
 
    public void setUseremail(String useremail) {
        this.useremail = useremail;
    }
 
    public String getUserphone() {
        return userphone;
    }
 
    public void setUserphone(String userphone) {
        this.userphone = userphone;
    }
}
cs

 

HwStatusVO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import java.sql.Timestamp;
 
public class HwStatusVO 
{
    private int num;
    private int lvl_code;
    private String userid;
    private java.sql.Timestamp regdate;
    private int answer;
    private int pass;
    private String edustatus;
    
    public HwStatusVO() {}
    
    public HwStatusVO(int num) {
        this.num = num;
    }
    public HwStatusVO(int num, int lvl_code, String userid, Timestamp regdate, int answer, int pass,
            String edustatus) {
        super();
        this.num = num;
        this.lvl_code = lvl_code;
        this.userid = userid;
        this.regdate = regdate;
        this.answer = answer;
        this.pass = pass;
        this.edustatus = edustatus;
    }
 
    public int getNum() {
        return num;
    }
 
    public void setNum(int num) {
        this.num = num;
    }
 
    public int getLvl_code() {
        return lvl_code;
    }
 
    public void setLvl_code(int lvl_code) {
        this.lvl_code = lvl_code;
    }
 
    public String getUserid() {
        return userid;
    }
 
    public void setUserid(String userid) {
        this.userid = userid;
    }
 
    public java.sql.Timestamp getRegdate() {
        return regdate;
    }
 
    public void setRegdate(java.sql.Timestamp regdate) {
        this.regdate = regdate;
    }
 
    public int getAnswer() {
        return answer;
    }
 
    public void setAnswer(int answer) {
        this.answer = answer;
    }
 
    public int getPass() {
        return pass;
    }
 
    public void setPass(int pass) {
        this.pass = pass;
    }
 
    public String getEdustatus() {
        return edustatus;
    }
 
    public void setEdustatus(String edustatus) {
        this.edustatus = edustatus;
    }
}
c

 

 

 AdminLmsService.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.json.simple.JSONObject;
 
public class AdminLmsService 
{
    private HttpServletRequest request;
    private HttpServletResponse response;
    private HttpSession session;
    private String viewPath = "/WEB-INF/jsp/lms";
    
    public AdminLmsService(HttpServletRequest request, HttpServletResponse response) {
        this.request = request;
        this.response = response;
        this.session = request.getSession();
    }
    public String exec() 
    {
        String cmd = request.getParameter("cmd");
        if (cmd==null || cmd.equals("list")) {
            
            List<HwStatusVO> adminList = getlist();
            request.setAttribute("adminList", adminList);
            return viewPath+"/adminList.jsp";
        }
        else if(cmd.equals("detail"))
        {
            int num=Integer.parseInt(request.getParameter("num"));
            HwStatusVO hvo = getDetail(num);
            request.setAttribute("hvo", hvo);
            return viewPath+"/adminDetail.jsp";
        }
        else if(cmd.equals("checked"))
        {
            boolean checked = checked();
            Map<String,Object> map = new HashMap<>();
            map.put("checked", checked);
            sendJSONStr(map);
        }
        else if(cmd.equals("userdetail"))
        {
            int num=Integer.parseInt(request.getParameter("num"));
            String userid = request.getParameter("userid");
            HwStatusVO hvo = getDetail(num);
            
            UserVO uvo = getUser(userid);
            String uid=uvo.getUserid();
            String uph = uvo.getUserphone();
            String uemail = uvo.getUseremail();
            
            request.setAttribute("hvo", hvo);
            request.setAttribute("uid", uid);
            request.setAttribute("uph", uph);
            request.setAttribute("uemail", uemail);
            return viewPath+"/userDetail.jsp";
        }
        
        return null;
    }
    
    private List<HwStatusVO> getlist()
    {
        AdminLmsDAO ado = new AdminLmsDAO();
        List<HwStatusVO> adminList = ado.getAdminList();
        return adminList;
    }
    
    private HwStatusVO getDetail(int num)
    {
        AdminLmsDAO ado = new AdminLmsDAO();
        HwStatusVO hvo = ado.getDetail(num);
        return hvo;
    }
    
    private boolean checked()
    {
        String sNum = request.getParameter("num");
        String sPass = request.getParameter("pass");
        String sEdustatus = request.getParameter("edustatus");
        
        HwStatusVO hvo = new HwStatusVO();
        hvo.setNum(Integer.parseInt(sNum));
        hvo.setPass(Integer.parseInt(sPass));
        hvo.setEdustatus(sEdustatus);
        
        AdminLmsDAO dao = new AdminLmsDAO();
        return dao.checkAnswer(hvo);
    }
    private UserVO getUser(String userid)
    {
        AdminLmsDAO ado = new AdminLmsDAO();
        UserVO uvo= ado.getUser(userid);
        return uvo;
    }
    
    public void sendJSONStr(Map<String, Object> map){
        JSONObject jsobj = new JSONObject(map);
        String jsStr = jsobj.toJSONString();
        PrintWriter out;
        try {
            out = response.getWriter();
            out.print(jsStr);
            out.flush();
            
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
cs

 

 

 

AdminLmsDAO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
import java.security.Timestamp;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
 
public class AdminLmsDAO 
{
    private Connection conn;
    private PreparedStatement pstmt;
    private ResultSet rs;
    
    private Connection getConn()
    {
        try {
            Class.forName("oracle.jdbc.OracleDriver");
            conn = DriverManager.getConnection(
                    "jdbc:oracle:thin:@localhost:1521:xe""SCOTT""TIGER");
            this.conn = conn;
            return conn;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    
    public List<HwStatusVO> getAdminList()
    {
        getConn();
        
        
        try {
            String sql="SELECT * FROM hwstatus ORDER BY regdate";
            this.pstmt=conn.prepareStatement(sql);
            this.rs=pstmt.executeQuery();
            
            List<HwStatusVO> list = new ArrayList<>();
                while(rs.next())
                {
                    HwStatusVO hvo = new HwStatusVO();
                    hvo.setNum(rs.getInt("num"));
                    hvo.setUserid(rs.getString("userid"));
                    hvo.setLvl_code(rs.getInt("lvl_code"));
                    hvo.setRegdate(rs.getTimestamp("regdate"));
                    hvo.setAnswer(rs.getInt("answer"));
                    hvo.setPass(rs.getInt("pass"));
                    hvo.setEdustatus(rs.getString("edustatus"));
                    
                    list.add(hvo);
                    
                }
                return list;
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            closeAll();
        }
        return null;
    }
    
    public HwStatusVO getDetail(int num)
    {
        getConn();
        
        try {
 
            String sql="SELECT * FROM hwstatus WHERE num=?";
            this.pstmt=conn.prepareStatement(sql);
            pstmt.setInt(1, num);
            this.rs=pstmt.executeQuery();
    
            if(rs.next())
            {
                int insertnum = rs.getInt("num");
                int lvl_code = rs.getInt("lvl_code");
                String userId = rs.getString("userid");
                java.sql.Timestamp regDate = rs.getTimestamp("regdate");
                int answer = rs.getInt("answer");
                String pass = rs.getString("pass");
                String edustatus = rs.getString("edustatus");
    
                
                HwStatusVO hvo = new HwStatusVO();
                hvo.setNum(insertnum);
                hvo.setUserid(userId);
                hvo.setLvl_code(lvl_code);
                hvo.setRegdate(regDate);
                hvo.setAnswer(answer);
                hvo.setPass(Integer.parseInt(pass));
                hvo.setEdustatus(edustatus);
                
                return hvo;
            }
            
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            closeAll();
        }
        return null;
    }
    
    public boolean checkAnswer(HwStatusVO hvo)
    {
        getConn();
         try {
        
            String sql1="UPDATE hwstatus SET pass=? , edustatus=? WHERE num=?";
            this.pstmt= conn.prepareStatement(sql1);
            pstmt.setInt(1, hvo.getPass());
            pstmt.setString(2, hvo.getEdustatus());
            pstmt.setInt(3,hvo.getNum());
            
            if(pstmt.executeUpdate()>0)
            {
                String sql2="SELECT pass FROM hwstatus WHERE num=?";
                this.pstmt= conn.prepareStatement(sql2);
                pstmt.setInt(1, hvo.getNum());
                
                
                if(hvo.getPass()==2)
                {
                    String sql3="UPDATE learn_history SET lvl_code=lvl_code+1 WHERE userid=(SELECT userid FROM hwstatus WHERE num=?)";
                    this.pstmt= conn.prepareStatement(sql3);
                    pstmt.setInt(1,hvo.getNum());
                }
            }
            return pstmt.executeUpdate()>0;
                  
         } catch (SQLException e) {
        
        e.printStackTrace();
         }finally {
        closeAll();
        }
         return false;
    }
    public UserVO getUser(String userid)
    {
        getConn();
        try {
 
            String sql="SELECT * FROM lmsuser";
            this.pstmt=conn.prepareStatement(sql);
            this.rs=pstmt.executeQuery();
 
            if(rs.next())
            {
                String insertid = rs.getString("userid");
                String userph = rs.getString("userphone");
                String useremail = rs.getString("useremail");
                
                UserVO uvo = new UserVO();
                uvo.setUserid(insertid);
                uvo.setUserphone(userph);
                uvo.setUseremail(useremail);
                
                return uvo;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            closeAll();
        }
        return null;
    }
    
    private void closeAll()
    {
        try {
            if(rs!=null) rs.close();
            if(pstmt!=null) pstmt.close();
            if(conn!=null) conn.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
cs

 

 

 

adminList.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>์ด์šฉ์ž ๋‹ต์•ˆ ๋ณด๊ธฐ</title>
<script src="https://code.jquery.com/jquery-3.6.1.min.js" 
integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous">
</script>
<script>
  $(document).ready(function(){
      changeColor();
  })
 
  function changeColor(){
      $('#table tr').mouseover(function(){
         $(this).addClass('changeColor');
      }).mouseout(function() {
         $(this).removeClass('changeColor');
      });
  }
</script>
<style type="text/css">
    @import url(//fonts.googleapis.com/earlyaccess/jejumyeongjo.css);
 
    .jm-font{
        font-family: 'Jeju Myeongjo', cursive;
        color: black;
        font-size:3em;
    }
    .main-font{
        font-family: 'Jeju Myeongjo', serif;
        color: black;
        font-size:1.5em;}
    .changeColor {
      background-color: #bff0ff;}
    
    .wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    }
    main { width:fit-content; margin:1em auto; text-align: center;}
    main h1{ text-align: center; }
    table { border:1px solid black; border-spacing:0; border-collapse: collapse; 
        padding:0.5em; }
    td,th { border-bottom:1px dashed black; padding:0.3em 1em; 
        border-right: 1px solid black;}
    th { background-color:rgb(248,242,24);}
    tr {background-color:rgb(255,255,255);}
    div.links { width:fit-content; margin:1em auto; }
</style>
</head>
<body style="background-color: rgb(227,209,254);">
<div class="wrapper">
<main class="main-font">
<h1 class="jm-font">๐Ÿ’‍โ™‚๏ธ์ด์šฉ์ž ํ˜„ํ™ฉ ๋ณด๊ธฐ</h1>
<form id="Check" onsubmit="return CheckAnswer();">
<input type="hidden" id="cmd" name="cmd" value="adminCheck">
<table id="table">
<tr><th>1๏ธโƒฃ์ด์šฉ์žID</th><th>2๏ธโƒฃํ•™์Šต ๋ ˆ๋ฒจ</th><th>3๏ธโƒฃํ•™์Šต์ผ</th><th>4๏ธโƒฃ๋‹ต์•ˆ</th><th>5๏ธโƒฃ๊ฒฐ๊ณผ</th></tr>
<c:forEach var="hvo" items="${adminList}">
 
<tr>
    <td><a href="adminlms?cmd=userdetail&num=${hvo.num}">${hvo.userid}</a> </td>
    <td>${hvo.lvl_code} </td>
    <td>${hvo.regdate} </td>
    <td>${hvo.answer} </td>
    <td><c:choose>
        <c:when test="${hvo.pass==0}"><a href="adminlms?cmd=detail&num=${hvo.num}">์ฑ„์ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ</a></c:when>
        <c:when test="${hvo.pass==1}">โŒ</c:when>    
        <c:when test="${hvo.pass==2}">โญ•</c:when></c:choose></td>
</tr>
</c:forEach>
</table>
</form>
</main>
</div>
</body>
</html>
cs

์‹คํ–‰ ๊ฒฐ๊ณผ :

 

 

adminDetail.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
<script>
function checkAnswer()
{    
    var obj =$('#check').serialize();
    
    $.ajax({
        url:'adminlms',
        method:'post',
        cache:false,
        data:obj,
        dataType:'json',
        success:function(res){
            alert(res.checked? '์ฑ„์ ์™„๋ฃŒ' : '์ฑ„์ ์‹คํŒจ');
            if(res.checked) location.href='adminlms?cmd=list';
        },
        error:function(xhr,status,err){
             alert("์—๋Ÿฌ:" + err);
         }
    });
    return false;
}
 
</script> 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>์ฒดํฌ ํŽ˜์ด์ง€ </title>
 
<style type="text/css">
    @import url(//fonts.googleapis.com/earlyaccess/jejumyeongjo.css);
 
    .jm-font{
        font-family: 'Jeju Myeongjo', serif;
        color: black;
        font-size:2em;
    }
    .main-font{
        font-family: 'Jeju Myeongjo', serif;/*์›น ํฐํŠธ ์ง€์ •*/
        color: black;
        font-size:1.5em;
    }
    .wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    }
    main { width: fit-conent; margin:1em auto;}
    main h3 { text-align: center; }
    label { display:inline-block; margin-right:1em; width:fit-conent;
         text-align:center; padding:0.5em;}
    .container {width:fit-content; padding:1em; border:1px solid black;}
    .contents > label { position:relative;}
    .btn {font-size: 1.5em;}
</style>
</head>
<body style="background-color: rgb(227,209,254);">
<span class="wrapper">
<main class="main-font">
<h3 class="jm-font">๐Ÿ“œ์ฑ„์  ๋ฐ ํ”ผ๋“œ๋ฐฑ</h3>
<form id="check" onsubmit="return checkAnswer();">
<input type="hidden" name="cmd" value="checked">
 <input type="hidden" name="num" value="${hvo.num}">
 <div class="container">
    <div>
        <label>1๏ธโƒฃ์ด์šฉ์žID :</label> 
        ${hvo.userid}
    </div>
    <div>
        <label>2๏ธโƒฃํ•™์Šต ๋ ˆ๋ฒจ :</label> 
        ${hvo.lvl_code}
    </div>
    <div>
        <label>3๏ธโƒฃํ•™์Šต์ผ :</label>
        ${hvo.regdate}
    </div>
    <div>
        <label>4๏ธโƒฃ๋‹ต์•ˆ :</label>
        ${hvo.answer}
    </div>
    <div>
        <label>5๏ธโƒฃ๊ฒฐ๊ณผ :</label>
        <input type="radio" name="pass" value="1">๋ถˆํ†ต๊ณผ
        <input type="radio" name="pass" value="2">ํ†ต๊ณผ
    </div>
    <div class="contents">
        <label>6๏ธโƒฃ์ง€๋„๋‚ด์šฉ ์ž‘์„ฑ</label>
        <div><textarea cols="30" rows="10" id="edustatus" name="edustatus"></textarea></div>
    </div>
</div>
<div class="btn">
<button type="submit">์ฑ„์ ์™„๋ฃŒ</button>
<button type="reset">์ดˆ๊ธฐํ™”</button>
</div>
</form>
</main>
</body>
</span>
</html>
cs

์‹คํ–‰๊ฒฐ๊ณผ : 

๋ฆฌ์ŠคํŠธ์—์„œ ์ฑ„์ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ ๋งํฌ๋ฅผ ๋ˆ„๋ฅด๋ฉด ๋‚˜์˜ค๋Š” ํŽ˜์ด์ง€

 

์ฑ„์ ์™„๋ฃŒ ํ›„

 

 

userDetail.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>   
<%
    String uid = (String) request.getAttribute("uid");
    String uph = (String) request.getAttribute("uph");
    String uemail = (String) request.getAttribute("uemail");
%>
   
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>์œ ์ € ์ •๋ณด ๋ณด๊ธฐ</title>
</head>
<style type="text/css">
    @import url(//fonts.googleapis.com/earlyaccess/jejumyeongjo.css);
 
    .jm-font{
        font-family: 'Jeju Myeongjo', serif;
        color: black;
        font-size:2.5em;
    }
    .main-font{
        font-family: 'Jeju Myeongjo', serif;
        color: black;
        font-size:2em;
    }
    .wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    }
    main { width: fit-conent; margin: auto;}
    main h1 { text-align: center; }
    label { display:inline-block; margin-right:1em; width:fit-conent;
         text-align:center; padding:0.5em;}
    .container {width:fit-content; padding:1em; border:1px solid black;}
    .contents > label { position:relative;}
    a { width: fit-conent; margin:auto;}
</style>
<body style="background-color: rgb(227,209,254);">
<span class="wrapper">
<main class="main-font">
<h1 class="jm-font"> ๐Ÿ™‹‍โ™‚๏ธ์ด์šฉ์ž ์ •๋ณด </h1>
<div class="container">
    <div>
        <label>1๏ธโƒฃ์ด์šฉ์žID :</label> 
        <%=uid%>
    </div>
    <div>
        <label>2๏ธโƒฃ์ „ํ™” ๋ฒˆํ˜ธ :</label> 
        <%=uph %>
    </div>
    <div>
        <label>3๏ธโƒฃ์ด๋ฉ”์ผ :</label>
        <%=uemail%>
    </div>
    <div>
        <label>4๏ธโƒฃ์ฑ„์  ๊ฒฐ๊ณผ :</label>
        <c:choose>
            <c:when test="${hvo.pass==0}"><a href="adminlms?cmd=detail&num=${hvo.num}">์ฑ„์ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ</a></c:when>
            <c:when test="${hvo.pass==1}">๋ถˆํ†ต</c:when>    
            <c:when test="${hvo.pass==2}">ํ†ต๊ณผ</c:when></c:choose>
    </div>
    <div>
        <label>5๏ธโƒฃํ”ผ๋“œ๋ฐฑ :</label>
        ${hvo.edustatus}
    </div>
</div>
 
<a href="adminlms?cmd=detail&num=${hvo.num}">๐Ÿคฆ‍โ™‚๏ธ์ฑ„์ ๊ฒฐ๊ณผ ๋ฐ ํ”ผ๋“œ๋ฐฑ ์ˆ˜์ •ํ•˜๊ธฐ</a>
<p>
<a href="adminlms?cmd=list">โ†ฉ๋ชฉ๋ก ๋Œ์•„๊ฐ€๊ธฐ</a>
</main>
</span>
</body>
</html>
cs

์ด์šฉ์ž์˜  ์ •๋ณด๋ฅผ ๋ณด๊ฑฐ๋‚˜ ์ฑ„์ ๊ฒฐ๊ณผ ๋ฐ ์ง€๋„๋‚ด์šฉ์„ ์ˆ˜์ •ํ•˜๊ธฐ ์œ„ํ•œ ํŽ˜์ด์ง€

 

์ˆ˜์ •ํ•˜๊ธฐ ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์ˆ˜์ • ํŽ˜์ด์ง€๋กœ ๋„˜์–ด๊ฐ„๋‹ค

 

์ˆ˜์ •๊ฒฐ๊ณผ

 

 

 

๋Œ“๊ธ€