-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
78 lines (59 loc) · 1.91 KB
/
test.php
File metadata and controls
78 lines (59 loc) · 1.91 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<div class="navLinkDiv">
<div class="ulNav">
<form action="test.php" class="firstLink"><button class="logButton">Events</button></form>
<?php
session_start();
if (!isset($_SESSION['user'])){ ?>
<form action="inlog.php"><button class="logButton">Inloggning</button></form>
<?php } else if ($_SESSION['user']=='inloggad'){ ?>
<form action="admin.php" class="secondLink"><button class="logButton">Admin</button></form>
<form action="utlog.php"><button class="logButton">Utloggning</button></form>
<?php } ?>
</div>
</div>
<div class="clubName">Ljungby <br> boxningsningsklubb</div>
</div><!-- End of header-->
<?php
$db=mysqli_connect('localhost', '***', '***', "***") or die('Error connecting to database server');
$db -> set_charset("utf8");
$dagens = date("Y-m-d");
$sql = "SELECT * FROM forening WHERE datum >='$dagens' ORDER BY datum ASC";
$result = mysqli_query($db,$sql) or die('Kunde inte läsa från tabellen');
?><div class="mainContnent">
<div class="eventsH">Events</div> <?php
$i=0;
while ($row = mysqli_fetch_array($result)) { $i++; ?>
<div class="event1">
<div class="rubrik">
<?php echo $row["rubrik"]; ?>
</div>
<div class="event">
<?php echo $row["tillStallning"]; ?>
</div>
<div class="info">
<?php echo "Ansvarig: " .$row["Info"]; ?>
</div>
<div class="datum">
<?php echo $row["datum"]; ?>
</div>
</div><!-- End of event1-->
<?php if ($i == 5) {
break;
} } ?>
</div><!-- End of mainContnent-->
<?php
mysqli_close($db);
?>
</body>
</html>