-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
52 lines (45 loc) · 1.69 KB
/
index.php
File metadata and controls
52 lines (45 loc) · 1.69 KB
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
<?php
include_once(__DIR__ . "/classes/Buddy.php");
session_start();
$email = $_SESSION["user"];
if (!isset($_SESSION['user'])) {
header("Location: login.php");
}
$user = new Buddy();
$user->setId($_SESSION["id"]);
$userData = $user->allUserData();
$pendingMatch = $user->pendingMatch();
$countUsers = $user->countUsers();
$countBuddies = $user->countBuddies();
if (empty($userData['class']) || empty($userData['interests']) || empty($userData['hobbies']) || empty($userData['beverage']) || empty($userData['pet'])) {
header('location: profileCompletion.php');
} elseif ($userData['buddySearching']) {
header('location: buddySearch.php');
} elseif (!empty($pendingMatch) && $pendingMatch['userId2'] == $user->getId()) {
header('location: buddyRequest.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Homepagina</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<?php include_once('nav.inc.php'); ?>
<div class="index__data">
<?php foreach ($countUsers as $countUser): ?>
<h2>Er zijn <span class="blue"> <?php echo $countUser['COUNT(*)']; ?>
student(en)</span> geregistreerd</h2>
<?php endforeach; ?>
<?php foreach ($countBuddies as $countBuddy): ?>
<h2>Er zijn al <span class="blue"> <?php echo $countBuddy['COUNT(*)']; ?>
buddymatch(es)</span> gebeurd</h2>
<?php endforeach; ?>
</div>
<?php include_once('footer.inc.php'); ?>
</body>
</html>