<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css" media="screen">
table {border:thin solid #CCC;}
/* tr {border:thin dashed #06F;} */
td { border-bottom:thin #ccc solid;}
tr:hover { background-color:#CCC; }
#button { background-color:#900; border: thin solid #fff; color:#FFF;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<h1>Termine</h1>
<?php
$host = "localhost";
$user = "web84";
$pass = "7r3p7kSH";
$dbase = "usr_web84_6";
$db = mysql_connect($host, $user, $pass) or die ("verbindung fehlgeschlagen");
mysql_select_db($dbase, $db) or die ("verbindung zur datenbank fehlgeschlagen");
$result = mysqli_query($db, "SELECT * FROM termine");
if($result){
echo "<table cellspacing='10'>";
echo "<tr>";
echo "<td>Was?</td>";
echo "<td>Wann?</td>";
echo "<td>Wo?</td>";
echo "<td>Beginn</td>";
echo "<td> </td>";
echo "</tr>";
while($row = mysql_fetch_array($result)){
echo"<tr>";
echo "<td>".$row['veranstaltungsart']."</td>" ;
echo "<td>".date("d.m.Y",$row["veranstaltungsdatum"])."</td>";
echo "<td>".$row['veranstaltungsort']."</td>";
echo "<td>".date("H:i",$row["veranstaltungsdatum"])."</td>";
if(!empty($row['id'])) {
echo "<td>"."<form action='loeschen.php' method='POST'>";
echo "<imput type='hidden' name='loeschid' value=\"$row['id']\">";
echo "<input type='submit' name='löschen' value='löschen' id='button'>";
echo "</form>"."</td>";
}
}
echo "</table>";
}
?>
</body>
</html>