-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (71 loc) · 2.19 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
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1" content="text/html"/>
<title>Whatodo</title>
<?PHP
include 'classes/session.inc';
include 'components/Css.php';
echo Css::MATERIALIZE;
echo Css::MAIN;
?>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<?php include 'components/navbar.php'; ?>
<main>
<div class="container">
<div class="row">
<?php
function displayContent($condition = null)
{
include 'classes/Event.php';
$connection = Connection::get();
$sentenceSQL = "select * from Events";
if($condition != null) $sentenceSQL .= " where category = " . $condition ;
$sentenceSQL .= " limit 30";
$results = $connection->select($sentenceSQL);
while ($evt = $results->fetch_assoc()) {
$event = new Event(
$evt['id'],
$evt['user'],
$evt['category'],
$evt['name'],
$evt['address'],
$evt['city'],
$evt['description'],
$evt['dateStart'],
$evt['dateEnd'],
$evt['img'],
$evt['public'],
$evt['offer']
);
echo '<div class="col s12 m4">';
$event->paintEvent();
echo '</div>';
}
}
if (!empty($_GET)) {
displayContent($_GET['category']);
} else {
displayContent();
}
?>
</div>
</div>
</main>
<?php
include 'components/Footer.php';
?>
<?php
include 'components/Script.php';
echo Script::JQUERY;
echo Script::MATERIALIZE;
?>
<script type="application/javascript">
console.log("hi");
</script>
</body>
</html>