/
find_team.php
57 lines (48 loc) · 1.25 KB
/
find_team.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
<?php
include('includes/functions.php');
if (isset($_GET['setteamid'])) {
setcookie('team', $_GET['setteamid'], 32503680000);
$selectedTeam = $_GET['setteamid'];
} else {
if (isset($_COOKIE['team'])) {
$selectedTeam = $_COOKIE['team'];
} else {
$selectedTeam = "";
}
}
$result = getTeams();
$teams = $result->fetch_all();
?>
<html>
<head>
<title>Find hold</title>
<?php include('includes/header.php'); ?>
</head>
<body>
<?php include('navbar.php'); ?>
<div class="container">
<a href="index.php"><-- Tilbage</a><br>
<a href="">Opret hold</a><br>
<br>
Holdet med fed er det nuværende.<br>
Klik på et hold for at sætte det som nuværende hold:
<ul>
<?php
if (is_array($teams)) {
foreach ($teams as $team) {
$output = "<a href='find_team.php?setteamid=" . $team[0] . "'>" . $team[1] . "</a>";
if ($selectedTeam === $team[0]) {
$output = "<b>" . $output . "</b>";
}
$output = "<li>" . $output . "</li>";
echo $output;
}
} else {
echo "Der er ingen hold :(";
}
?>
</ul>
</div>
<?php include('footer.php'); ?>
</body>
</html>