-
Notifications
You must be signed in to change notification settings - Fork 1
/
usermenu.php
79 lines (66 loc) · 1.88 KB
/
usermenu.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
<?php
require_once __DIR__ . "/Users.php";
require_once __DIR__ . "/utils.php";
require_once __DIR__ . "/sportsData.php";
session_start();
$email = $_SESSION['email'];
$userData = User::retrieveByEmail($email);
$fullname = $userData["firstName"] . " " . $userData["lastName"];
$phone = $userData["phone"];
$sports = findByUser($email);
$sportsData = array();
// print_r($sports);
foreach ($sports as $x) {
// print_r($x);
$data = findSport($x["sport"])[0];
$sportsData[] = $data;
}
if (count($sportsData) == 0) {
$head = "REGISTER YOUR FIRST SPORT";
} else {
$head = "REGISTERED SPORTS";
}
// print_r($sportsData);
?>
<!DOCTYPE html>
<html>
<head>
<title><?=htmlentities($fullname)?> Menu </title>
<link rel="stylesheet" type="text/css" href="./public/css/usermenu.css" />
</head>
<body>
<div>
<img src="/public/images/demo.jpg" id="profile">
<div id="participantDescription">
<h2><?=htmlentities($fullname)?></h2>
<h2><?=htmlentities($email)?></h2>
<h2 style="color: black;"><?=htmlentities($phone)?></h2>
</div>
<button id="logoutButton">
<a href="logout.php">Logout</a>
</button>
</div>
<div>
<h1><?=htmlentities($head)?></h1>
<?php
if (count($sportsData) > 0) {
echo "<table>";
foreach ($sportsData as $x) {
echo "<tr>";
echo "<td>";
echo "<img id='sportPhoto' src=." . htmlentities($x["imgPath"]) . ">";
echo "</td>";
echo "<td>";
echo "<h2>Name:" . htmlentities($x["nameVal"]) . "</h2>";
echo "<h2>Start Date:" . htmlentities($x["startDate"]) . "</h2>";
echo "<h2>End Date:" . htmlentities($x["endDate"]) . "</h2>";
echo "<h2>Venue:" . htmlentities($x["venue"]) . "</h2>";
echo "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
</div>
</body>
</html>