1
0
Fork 0
This repository has been archived on 2024-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
veranstaltung/veranstaltungen.php
2013-12-27 14:56:43 +01:00

50 lines
No EOL
1.8 KiB
PHP

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<title>Veranstaltungen</title>
<meta name="author" content="Lukas" >
<style>
tr:nth-child(2n) td {
background: #EEE8AA;
}
</style>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<?php
// require_once "angemeldet.php";
require_once "verbindungsaufbau.php"; //mit Server verbinden
$ergebnis = $mysqli->query("SELECT * FROM orte, veranstaltungen WHERE orte.ort_id = veranstaltungen.ort_id"); //SQL Befehl ausführen
echo "<table border='1'>\n";
echo "<tr><th>Veranstaltungsname</th><th>Beschreibung</th><th>Zeit</th><th>Ort</th><th>Adresse</th><th>Teinehmen</th><th>Ändern</th><th>Löschen</th>"; //Zeile mit Überschriften
while ($zeile = $ergebnis->fetch_array()) {
echo "<tr><td>" . htmlspecialchars($zeile["name"]) . "</td>"
. "<td>" . htmlspecialchars($zeile['beschreibung']) . "</td>"
. "<td>" . date( 'd.m.Y H:i', strtotime(htmlspecialchars($zeile['zeit'])))
. "<td>" . htmlspecialchars($zeile['ort_name']) . "</td>"
. "<td>" . htmlspecialchars($zeile['plz']) . " " . htmlspecialchars($zeile['stadt']) . "<br /> " . htmlspecialchars($zeile['strasse']) . " " . htmlspecialchars($zeile['hausnummer']) . "</td>"
. "<td><a href='./teilnahme.php?id=" . htmlspecialchars($zeile['veranstaltungs_id']) . "'><b>teilnehmen</b></a></td>"
. "<td><a href='./veranstaltung_aendern.php?id=" . htmlspecialchars($zeile['veranstaltungs_id']) . "'>ändern</a></td>"
. "<td><a href='./veranstaltung_loeschen.php?id=" . htmlspecialchars($zeile['veranstaltungs_id']) . "'>löschen</a></td>"
."</td></tr>\n" ;
}
echo "</table>";
$ergebnis->close();
$mysqli->close();
?>
<a href="veranstaltung_erstellen.php">Veranstaltung erstellen</a>
<br /><a href="orte.php">alle Orte anzeigen</a>
</body>
</html>