-
Notifications
You must be signed in to change notification settings - Fork 0
/
wahl_view_res.php
80 lines (59 loc) · 2.56 KB
/
wahl_view_res.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
80
<?php
session_start();
if (!isset($_SESSION["email"]) && $_SESSION["level"] >= 1) {
header("Location: index.php");
exit;
}
?>
<!doctype html>
<html lang="de">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- additional CSS -->
<link href="style.css" rel="stylesheet">
<title>Abstimmtool consult.IN</title>
</head>
<body>
<div class="main-content mx-auto">
<?php
require("php/sec/mysql.php");
$id = $_GET['id'];
$db_erg_entry = mysqli_query($db_link, 'SELECT * FROM voting_results_total WHERE WAHL_ID = ' . $id . ' ORDER BY VOTES_TOTAL DESC;');
if (!$db_erg_entry) {
die('Ungültige Abfrage: ' . mysqli_error());
}
echo '<table border="1" class="table" style="margin-top: 15px;">';
echo "<tr>";
echo "<td>" . "" . "</td>";
echo "<td>" . "Name" . "</td>";
echo "<td>" . "Stimmen" . "</td>";
echo "</tr>";
$i = 1;
while ($zeile = mysqli_fetch_array($db_erg_entry, MYSQLI_ASSOC)) {
if($zeile['ITEM'] == "Enthaltungen"){
$enthaltungen = $zeile['VOTES_TOTAL'];
continue;
}
echo "<tr>";
echo "<td>" . $i . ".</td>";
echo "<td>" . $zeile['ITEM'] . "</td>";
echo "<td>" . $zeile['VOTES_TOTAL'] . "</td>";
echo "</tr>";
$i++;
}
echo "</table><br><h4>Enthaltungen: " . $enthaltungen . "</h4>";
?>
<a href="wahlleiter.php" class="btn btn-secondary btn-lg" tabindex="-1" role="button" aria-disabled="true">Zurück</a>
</div>
<!-- Optional JavaScript; choose one of the two! -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous">
</script>
<!-- Option 2: Separate Popper and Bootstrap JS
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js" integrity="sha384-q2kxQ16AaE6UbzuKqyBE9/u/KzioAlnx2maXQHiDX9d4/zp8Ok3f+M7DPm+Ib6IU" crossorigin="anonymous"></script>
<script src="bootstrap-5.0.0-beta1-dist/js/bootstrap.min.js"></script> -->
</body>
</html>