-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavatarShop.jsp
59 lines (48 loc) · 2.14 KB
/
avatarShop.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
<%@include file="./database/connect.jsp" %>
<%
String query = String.format("SELECT saldo FROM MsUser WHERE userID LIKE %s", session.getAttribute("userID").toString());
ResultSet result = st.executeQuery(query);
result.next();
int saldo = result.getInt("saldo");
query = "SELECT * FROM MsAvatar WHERE avatarID > 4";
result = st.executeQuery(query);
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Avatar Shop</title>
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/home.css">
<link rel="stylesheet" href="./css/avatar.css">
<script src="js/javascript.js"></script>
</head>
<body>
<%@ include file="header.jsp" %>
<section>
<p class="title">Our Avatar Collection</p>
<p style="color:red;text-align: center;font-size: 20px;background-color: white;"><% if(request.getParameter("err") != null) out.println(request.getParameter("err")); %></p>
<p style="color:green;text-align: center;font-size: 20px;background-color: white;"><% if(request.getParameter("msg") != null) out.println(request.getParameter("msg")); %></p>
<div class="cards">
<%
while(result.next()){
%>
<div class="card">
<center>
<img class="avatar-img" src="./assets/avatar/<%= result.getString("avatar") %>" alt="">
<p class="price">PRICE : <%= result.getString("price") %></p>
<div class="button"><a href="./controller/buyAvatarController.jsp?avatarID=<%= result.getString("avatarID") %>">Buy This!</a></div>
<div class="button gift"><a href="./sendGift.jsp?avatarID=<%= result.getString("avatarID") %>">Send this as Gift</a></div>
</center>
</div>
<%
}
%>
</div>
</section>
<%@ include file="footer.jsp" %>
</body>
</html>
<% con.close(); %>