forked from CS6083-DB-Project/LiveVibe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
show_recomList.php
229 lines (205 loc) · 9 KB
/
show_recomList.php
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!-- Project: LiveVibe
Author: Xun Gong, Wei Yu
Date: Dec 4th, 2014 -->
<!-- PHP and manipulate with livevibe database -->
<?php
require ("connectdb.php");
if (isset($_SESSION["username"])) {
// Set local var
$username_up = $_SESSION["username"];
$login_type = $_SESSION["login_type"];
$listname_IN = $_GET["link"];
// Update lastaccesstime when page load
$stmtLAT = $mysqli->prepare("CALL update_LAT(?,?,?)");
$LAT = date("Y-m-d H:i:s");
$stmtLAT->bind_param('sss', $username_up, $LAT, $login_type);
$stmtLAT->execute();
$mysqli->next_result();
// Grab All Concert from Recommend List User Just Clicked
$recomList = array();
$stmtRL = $mysqli->prepare("CALL show_recomList(?)");
$stmtRL->bind_param('s', $listname_IN);
$stmtRL->execute();
$stmtRL->bind_result($username, $cid, $rm_time, $artistname, $start_time, $vname, $city);
while ($stmtRL->fetch()) {
$one_concert = array("username" => $username,
"cid" => $cid,
"rm_time" => $rm_time,
"artistname" => $artistname,
"start_time" => $start_time,
"vname" => $vname,
"city" => $city,
);
$recomList[] = $one_concert;
}
$mysqli->next_result();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Xun Gong + Wei Yu">
<title>LiveVibe | CS6083 Database Project</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link href="css/bootstrap-select.css" rel="stylesheet">
<link href="css/animate.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
</head><!--/head-->
<body>
<header id="header" role="banner">
<div class="main-nav">
<div class="container">
<div class="row">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">
<img class="img-responsive" src="images/logo.png" alt="logo">
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li class="scroll"><a href="index.php">Home</a></li>
<li class="scroll"><a href="#">Trend</a></li>
<li class="scroll"><a href="all_genre.php">Genre</a></li>
<li class="scroll"><a href="search.php">Search</a></li>
<li class="scroll"><a href="logout.php">Log out</a></li>
</ul>
</div>
</div>
</div>
</div>
</header>
<!--/#header-->
<section id="user_panel">
<!-- Recommendation List Page -->
<!-- Display Recommend List He Made-->
<div class="row">
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-body">
<div class="concert-brief">
<div class="panel panel-info">
<div class="panel-heading text-center">
<h2>
<?php echo "<strong>".$listname_IN."</strong>";?>
</h2>
</div>
<table class="table" class="text-center">
<tr>
<th>
<h2>Date Time</h2>
</th>
<th>
<h2>Performer</h2>
</th>
<th>
<h2>Venue</h2>
</th>
<th>
<h2>Added Time</h2>
</th>
<th>
<h2>By</h2>
</th>
</tr>
<!-- php loop concert -->
<?php
foreach ($recomList as $con) {
echo "<tr>";
echo "<div class=\"container-fluid\"><div class=\"row\"><div class=\"col-md-10\">";
echo "<td>";
echo "<h4><span class=\"fa fa-calendar fa-lg\"></span> ".$con["start_time"]."</h4>";
echo "</td>";
echo "<td>";
echo "<h4><a href=\"artist_public.php?link=", urlencode($con["artistname"]), "\">".$con["artistname"]."</a></h4>";
echo "</td>";
echo "<td>";
echo "<div class=\"location\"><h4>".$con["vname"]."</h4><p>";
echo "<span class=\"addr\">";
echo "<span class=\"city\"> ".$con["city"]."</span>";
echo "<a href=concert_info.php?link=".$con["cid"]."><h4>Concert Details</h4></a>";
echo "</span></p></div></td>";
echo "<td><h4>".$con["start_time"]."</h4></td>";
echo "<td><a href=\"user_public.php?link=", urlencode($con["username"]), "\">".$con["username"]."</a>";
echo "</td>";
echo "</div></div></div></tr>";
echo "<br>";
}
?>
</table><!-- table -->
</div><!-- concert-brief -->
</div><!--/panel-body-->
</div><!--/panel-->
</div><!--/col-->
</div><!--/row-->
<!-- SHOW Recommend List -->
</section>
<style>
body {
background-image: url("./images/bg/register_bg.png");
background-color: #A30000;
background-repeat:no-repeat;
background-size:cover;
background-position: top center !important;
background-repeat: no-repeat !important;
background-attachment: fixed;
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
#user_panel {
padding-top: 100px;
color: #03695E;
padding-left: 140px;
}
.navbar-brand {
background-color: #A30000;
height: 80px;
margin-bottom: 20px;
position: relative;
width: 628px;
opacity: .95
}
.panel {
opacity: 0.9;
}
.fa-star {
color: #FFD700;
}
.fa-calendar {
color: #A30000;
}
#user_panel .row {
margin-right: auto;
margin-left: auto;
}
.navbar-collapse {
padding-left: 0px;
padding-right: 0px;
}
.table {
font-size: 14px;
}
</style>
</section>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-select.js"></script>
<script type="text/javascript" src="js/smoothscroll.js"></script>
<script type="text/javascript" src="js/jquery.parallax.js"></script>
<script type="text/javascript" src="js/jquery.scrollTo.js"></script>
<script type="text/javascript" src="js/jquery.nav.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>