-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (61 loc) · 1.8 KB
/
index.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
<?php
include("conf/config.php");
include("incl/header.php");
$text=mysqli_fetch_object(mysqli_query($conn,"SELECT text FROM Seiten WHERE seitenID=1"));
print <<<html
<div class="grid-x grid-margin-x">
<div class="cell small-9">
html;
print $text->text;
if(!logged_in()){
print <<<html
</div>
<div class="cell medium-3 sticky">
<form class="log-in-form" method="POST" action="index.php">
<h4 class="text-center">Melde dich mit deiner Kennung an</h4>
<label>Benutzername
<input type="text" placeholder="Nickname" name="username">
</label>
<label>Passwort
<input type="password" placeholder="Password" name="userpass">
</label>
<p><button type="submit" class="button expanded" value="Einloggen" name="login">Einloggen</button></p>
</form>
<p></p>
<form class="log-in-form" action="index.php" method="POST">
<h4 class="text-center">Passwort vergessen?</h4>
<label>Email-Adresse </label><input name="email" type="email" placeholder="somebody@pfmgp.de"><br>
<input name="lostpassword" type="submit" value="anfordern" class="button expanded">
</form>
</div>
</div>
html;
}
else {
print <<<html
</div></div>
<div class="grid-x cell small-8">
html;
$sql="SELECT * FROM News
LEFT JOIN Teilnahme USING (wettbewerbsID)
LEFT JOIN Wettbewerb USING (wettbewerbsID)
WHERE userID=".$_SESSION["UserID"]." OR News.wettbewerbsID is NULL
ORDER BY Datum DESC
LIMIT 10";
$result=mysqli_query($conn,$sql);
while($erg=mysqli_fetch_object($result)){
print <<<html
<div class="blog-post">
<h3>$erg->betreff <small>$erg->datum</small></h3>
$erg->text
<div class="callout">
<ul class="menu simple">
<li><a href="auswertung.php?wett=$erg->wettbewerbsID">Wettbewerb: $erg->wettbewerbsName</a></li>
</ul>
</div>
</div>
html;
}
}
include("incl/footer.php");
?>