-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsp
196 lines (171 loc) · 9.5 KB
/
index.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="teampackage.*"%>
<!doctype html>
<html lang="en">
<head>
<title>UniEvents Home Page</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/navbarstyle.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<link rel="stylesheet" href="css/events.css">
<link rel="stylesheet" href="css/style.css">
<style>
.event-block:hover {
box-shadow: 0px 0px 16px 0px rgba(187, 187, 187, 0.8);
transform: scale(1.03);
}
</style>
</head>
<body>
<%
String username = null;
boolean prefexist = false;
String pref = null;
%>
<!-- Check if there is a logged in user -->
<%
if(session.getAttribute("currentUser") != null) {
User loggeduser = (User) session.getAttribute("currentUser");
username = loggeduser.getUsername();
pref = loggeduser.getPreference();
prefexist = true;
}
request.setAttribute("thisIsIndex", "1");
%>
<!-- Check if there is a logged in user -->
<!-- Navbar -->
<%@ include file="navbar.jsp" %>
<!-- Navbar -->
<section class="bg-dark text-light p-5 p-lg-0 pt-lg-5 text-center text-sm-start">
<div class="container pb-5">
<div class="d-sm-flex align-items-center justify-content-between">
<div>
<h1><b>Βρες το <span class="text-warning"> Event </span> που <br> θα σε <span class="text-warning">εμπνεύσει </b></span></h1>
<p class="lead my-4">
Κάνε τώρα κράτηση στο Φοιτητικό Event του αγαπημένου σου είδους
</p>
<!--SEARCHBOX-->
<form method="post" action="searchresults.jsp">
<div class="row height d-flex align-items-center">
<div class="col-md-8">
<div class="form">
<!-- <i type="submit" class="fa fa-search"></i> -->
<input type="text" name="search" id="search" class="form-control form-input" placeholder="Αναζήτηση Event ή κατηγορίας...">
<!--<span class="left-pan"><button type="submit" class="fa fa-microphone"></button></span>-->
</div>
</div>
</div>
</form>
</div>
<img class="img-fluid w-25 d-none d-sm-block"
src="images/uniwhite.png"
alt="" />
</div>
</div>
</section>
<section class="p-5">
<h1 align="center"><b>Δημοφιλή</b></h1><br>
<div class="container">
<hr>
<!-- start event block -->
<!-- start check for event info-->
<%
EventDAO edao = new EventDAO();
List<Event> events = edao.getEvent();
int counter = 0;
for(Event event: events) {
counter = counter + 1; %>
<!--end check for event info-->
<a href="eventPage.jsp?event_id=<%=event.getEvent_id()%>" style="text-decoration: none;">
<div class="row align-items-center no-gutters margin-40px-bottom event-block">
<div class="col-lg-3 col-sm-12">
<div class="position-relative">
<%
String path = event.getImage();
%>
<img class="eventimg" src="<%=path + event.getEvent_id().toString() +"_logo.jpg" %>" alt="">
<!--<div class="events-date">
<div class="font-size28">10</div>
<div class="font-size14">Mar</div>
</div> -->
</div>
</div>
<div class="col-lg-7 col-sm-12">
<div class="padding-60px-lr md-padding-50px-lr sm-padding-30px-all xs-padding-25px-all" >
<h2 class="margin-15px-bottom md-margin-10px-bottom font-size22 md-font-size20 xs-font-size18 font-weight-500" style="font-weight : 700; font-size:1.4em; position:relative; left:5%"><%=event.getE_name() %></h2>
<ul class="event-time margin-10px-bottom md-margin-5px-bottom">
<li><i class="far fa-clock margin-10px-right"></i> <%=event.getE_time() %></li>
<li><i class="fas fa-map-marker-alt margin-5px-right"></i> <%=event.getE_location() %></li>
<li><i class="fa fa-calendar margin-5px-right"></i> <%=event.getE_date() %></li>
</ul>
</div>
</div>
</div>
</a>
<%
if (counter == 10) {
break;
}
}
if (prefexist == true) { %>
<h1 align="center"><b>Προτεινόμενα για εσένα</b></h1><br>
<div class="container">
<hr>
<!-- start event block -->
<!-- start check for event info-->
<%
EventDAO edao1 = new EventDAO();
List<Event> events1 = edao1.getEvent();
for(Event event: events1) {
if (event.getCategory().equals(pref)) { %>
<!--end check for event info-->
<a href="eventPage.jsp?event_id=<%=event.getEvent_id()%>" style="text-decoration: none;">
<div class="row align-items-center no-gutters margin-40px-bottom event-block">
<div class="col-lg-3 col-sm-12">
<div class="position-relative">
<%
String path = event.getImage();
%>
<img class="eventimg" src="<%=path + event.getEvent_id().toString() +"_logo.jpg" %>" alt="">
<!--<div class="events-date">
<div class="font-size28">10</div>
<div class="font-size14">Mar</div>
</div> -->
</div>
</div>
<div class="col-lg-7 col-sm-12">
<div class="padding-60px-lr md-padding-50px-lr sm-padding-30px-all xs-padding-25px-all" >
<h2 class="margin-15px-bottom md-margin-10px-bottom font-size22 md-font-size20 xs-font-size18 font-weight-500" style="font-weight : 700; font-size:1.4em; position:relative; left:5%"><%=event.getE_name() %></h2>
<ul class="event-time margin-10px-bottom md-margin-5px-bottom">
<li><i class="far fa-clock margin-10px-right"></i> <%=event.getE_time() %></li>
<li><i class="fas fa-map-marker-alt margin-5px-right"></i> <%=event.getE_location() %></li>
<li><i class="fa fa-calendar margin-5px-right"></i> <%=event.getE_date() %></li>
</ul>
</div>
</div>
</div>
</a>
<%
}
}
}
%>
</div>
</section>
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<!-- Option 2: Separate Popper and Bootstrap JS -->
<!--
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
-->
<%@ include file="footer.jsp" %>
</body>
</html>