-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvis_utover.php
More file actions
80 lines (72 loc) · 2.37 KB
/
vis_utover.php
File metadata and controls
80 lines (72 loc) · 2.37 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
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
<?php
session_start();
include "Tilkobling.php";
$erInnlogget = isset($_SESSION["erInnlogget"]);
?>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/app.css">
<title>Vis Publikum</title>
<div class="topnav">
<a href="index.php">Registering</a>
<a href="vis_publikum.php">Vis Publikum</a>
<a class="active" href="vis_utover.php">Vis Utøvere</a>
<a href="vis_ovelse.php">Øvelser</a>
<div class="registert">
<?php
if ($erInnlogget){
echo "<span class = 'bruker'> Innlogget som " . $_SESSION["brukerNavn"] . "</span>";
echo "<a href='Logg_ut.php'>Logg ut</a>";
}
else {
echo '<a href="Logg_inn.php">Logg inn</a>';
echo '<a href="Register.php">Register</a>';
}
?>
</div>
</div>
</head>
<body>
<table>
<tr>
<th>Fornavn</th>
<th>Etternavn</th>
<th>Nasjonalitet</th>
<th>Adresse</th>
<th>PostNr</th>
<th>Poststed</th>
<th>Telefon</th>
<th>Øvelses Informasjon</th>
</tr>
<?php
$ingendata= false;
$foresporring = "select Fornavn, Etternavn, Adresse, PostNum, Poststed, Telefonnr,Type,Sted,Dato, Nasjonalitet ";
$foresporring .= "from Person , Utøver, Øvels WHERE Person.PersonId = Utøver.PersonId ";
$foresporring .= "And Person.ØvelsesId = Øvels.ØvelsId;";
$resultat = $db->query($foresporring);
if ($resultat->num_rows > 0) {
while($rad = $resultat->fetch_assoc()) {
echo "<tr><td>" . $rad["Fornavn"] . "</td>";
echo "<td>" . $rad["Etternavn"] . "</td>";
echo "<td>" . $rad["Nasjonalitet"] . "</td>";
echo "<td>" . $rad["Adresse"] . "</td>";
echo "<td>" . $rad["PostNum"] . "</td>";
echo "<td>" . $rad["Poststed"] . "</td>";
echo "<td>" . $rad["Telefonnr"] . "</td>";
echo "<td>" . $rad["Type"]." ".$rad["Sted"]." ".$rad["Dato"] . "</td></tr>";
}
} else {
$ingendata = true;
$db->close();
}
?>
</table>
<?php
if($ingendata){
echo "<p class='null-resultat'> Fant ingen data! </p>";
}
?>
<script src="js/index.js"></script>
</body>
</html>