This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
forked from Kleppa/WebProsjekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
171 lines (150 loc) · 7.76 KB
/
index.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
<?php
session_start();
$pagetitle = 'home';
require_once 'vendor/autoload.php';
require_once 'private/phpscripts/functions.php';
require_once 'private/phpscripts/db_connector.php';
require_once 'private/includes/header.php';
?>
<!--Bildekarusell-->
<div id="customCarousel" class="carousel mb-3" data-ride="carousel">
<!-- Bildeindikatorer-->
<ol class="carousel-indicators">
<li data-target="#customCarousel" data-slide-to="0" class="active"></li>
<li data-target="#customCarousel" data-slide-to="1"></li>
<li data-target="#customCarousel" data-slide-to="2"></li>
<li data-target="#customCarousel" data-slide-to="3"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<a class="fillerTag" href="events.php">
<div class="fill">
<img src="<?php echo server_root(1); ?>/img/wenture/pexels-photo-247915.jpg"
alt="Wenture-Info-Page">
</div>
<div class="carousel-caption">
<h2>Wenture</h2>
<h3>Student Handbook For Westerdals</h3>
</div>
</a>
</div>
<div class="carousel-item">
<a class="fillerTag" href="places.php?category=1,5">
<div class="fill">
<img src="<?php
if ($result = $mysqli->query("SELECT * FROM places WHERE category= 1 OR category= 5 ORDER BY score DESC LIMIT 1,1 ;")) {
$row = mysqli_fetch_assoc($result);
echo server_root() . $row['image_path']; ?>" alt="<?php echo $row['title']; ?>">
<?php } ?>
</div>
<div class="carousel-caption">
<h3>Places To Find A Drink!</h3>
</div>
</a>
</div> <!-- carousel-item -->
<div class="carousel-item">
<a class="fillerTag" href="places.php?category=3,6">
<div class="fill">
<img src="<?php
if ($result = $mysqli->query("SELECT * FROM places WHERE category =3 OR category=6 ORDER BY score DESC LIMIT 1,1;")) {
$row = mysqli_fetch_assoc($result);
echo server_root(1) . $row['image_path']; ?>" alt="<?php echo $row['title']; ?>"> <!-- img -->
<?php } ?>
</div>
<div class="carousel-caption">
<h3>Places To Find Something To Eat!</h3>
</div>
</a>
</div> <!-- carousel-item -->
<div class="carousel-item i">
<a class="fillerTag" href="events.php">
<div class="fill">
<img src="<?php
if ($result = $mysqli->query("SELECT * FROM events ORDER BY score DESC LIMIT 1 ;")) {
$row = mysqli_fetch_assoc($result);
echo server_root(1) . $row['image_path']; ?>" alt="<?php echo $row['title']; ?>"> <!-- img -->
<?php } ?>
</div>
<div class="carousel-caption">
<h3>Activities Near Campus!</h3>
</div>
</a>
</div> <!-- carousel-item -->
</div> <!-- Carousel inner box -->
<!-- Controls -->
<a class="carousel-control-prev" href="#customCarousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#customCarousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div> <!-- Carousel -->
<div class="container" id="trending-wrapper">
<div class="row">
<div class="col">
<h2>Trending places right now:</h2>
<p>See the most popular places:</p>
</div>
</div>
<div class="row justify-content-center">
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
<a style="color: black; text-decoration: none;" href="<?php
if ($result = $mysqli->query("SELECT * FROM events ORDER BY score DESC LIMIT 1;")) {
$row = mysqli_fetch_assoc($result);
echo 'info/details.php?id=' . $row['id'] . '&type=' . $row['type']; ?>">
<div class="fill mb-2" style="height:196px;">
<img src="<?php echo server_root(1) . $row['image_path'] ?>"
alt="<?php echo $row['title']; ?>"> <!-- img -->
</div>
<h3><?php echo $row['title']; ?></h3>
<p><?php echo $row['pros']; ?></p>
<?php } ?>
</a>
</div> <!-- trending-place -->
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
<a style="color: black; text-decoration: none;" href="info/details.php<?php
if ($result = $mysqli->query("SELECT * FROM places ORDER BY score DESC LIMIT 1;")) {
$row = mysqli_fetch_assoc($result);
echo '?id=' . $row['id'] . '&type=' . $row['type']; ?>">
<div class="fill mb-2" style="height:196px;">
<img src="<?php echo server_root(1) . $row['image_path']; ?>"
alt="<?php echo $row['title']; ?>">
</div>
<h3><?php echo $row['title']; ?></h3>
<p><?php echo $row['pros']; ?></p>
<?php } ?>
</a>
</div> <!-- trending-place -->
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
<a style="color: black; text-decoration: none;" href="info/details.php<?php
if ($result = $mysqli->query("SELECT * FROM places ORDER BY score DESC LIMIT 1,1;")) {
$row = mysqli_fetch_assoc($result);
echo '?id=' . $row['id'] . '&type=' . $row['type']; ?>">
<div class="fill mb-2" style="height:196px;">
<img src="<?php echo server_root(1) . $row['image_path']; ?>"
alt="<?php echo $row['title']; ?>"> <!-- img -->
</div>
<h3><?php echo $row['title']; ?></h3>
<p><?php echo $row['pros']; ?></p>
<?php } ?>
</a>
</div> <!-- trending-place -->
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-12">
<a style="color: black; text-decoration: none;" href="info/details.php<?php
if ($result = $mysqli->query("SELECT * FROM events ORDER BY score DESC LIMIT 1,1;")) {
$row = mysqli_fetch_assoc($result);
echo '?id=' . $row['id'] . '&type=' . $row['type']; ?>">
<div class="fill mb-2" style="height:196px;">
<img src="<?php echo server_root(1) . $row['image_path']; ?>"
alt="<?php echo $row['title']; ?>">
</div>
<h3><?php echo $row['title']; ?></h3>
<p><?php echo $row['pros']; ?></p>
<?php } ?>
</a>
</div> <!-- trending-place -->
</div> <!-- row -->
</div> <!-- container -->
<?php require_once 'private/includes/footer.php';