79 lines
1.8 KiB
PHP
79 lines
1.8 KiB
PHP
|
<?PHP include("init.php"); ?>
|
||
|
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<TITLE>NDB - Alle Menschen</TITLE>
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
|
||
|
<?php
|
||
|
|
||
|
/*
|
||
|
ohne Parameter: sortiert nach Vornamen
|
||
|
falls sort=name: sortiert nach Nachnamen
|
||
|
falls sort=tag: sortiert nach Kalendertag des Geburtstags
|
||
|
falls sort=datum: sortiert nach Geburt
|
||
|
*/
|
||
|
|
||
|
require("navi.php");
|
||
|
|
||
|
importGET("sort");
|
||
|
|
||
|
print '<DIV ALIGN="CENTER">';
|
||
|
|
||
|
print '<TABLE BODER="0"><COLGROUP WIDTH="100" SPAN="3"></COLGROUP><TR>';
|
||
|
|
||
|
// ****************** der Tabellenkopf **********************
|
||
|
print '<TH>' . hyperlink("$PHP_SELF","Vorname") . '</TH>';
|
||
|
print '<TH>' . hyperlink("$PHP_SELF?sort=name","Name") . '</TH>';
|
||
|
print '<TH>' . hyperlink("$PHP_SELF?sort=datum","Geburt") . 's' .
|
||
|
hyperlink("$PHP_SELF?sort=tag","tag") . '</TH>';
|
||
|
print '</TR>';
|
||
|
|
||
|
// ************ die Abfrage ***********************
|
||
|
|
||
|
$kriterien = array("vorname" => "Vorname,Name",
|
||
|
"name" => "Name,Vorname",
|
||
|
"datum" => "Geburt,Vorname,Name",
|
||
|
"tag" => "Right(Geburt,5),Geburt,Vorname,Name");
|
||
|
|
||
|
// Defaultwert
|
||
|
if (!isset($kriterien["$sort"])) $sort="vorname";
|
||
|
|
||
|
$daten = mysql_query("SELECT * FROM Menschen ORDER BY $kriterien[$sort]");
|
||
|
|
||
|
|
||
|
|
||
|
// ******************* die Datenzeilen ***********************
|
||
|
while ($zeile = mysql_fetch_array($daten))
|
||
|
{
|
||
|
print "<TR>";
|
||
|
print "<TD>";
|
||
|
print hyperlink("zeige_mensch.php?mensch_id=" . $zeile["mensch_id"],
|
||
|
$zeile["Vorname"]) . "</TD>";
|
||
|
print "<TD>" . $zeile["Name"] . "</TD>";
|
||
|
$geb = isset($zeile["Geburt"])? $zeile["Geburt"] : "";
|
||
|
print '<TD ALIGN="CENTER">'. datumsFormat($geb) . '</TD>';
|
||
|
print "</TR>";
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
</TABLE>
|
||
|
</DIV>
|
||
|
|
||
|
|
||
|
<H4><HR><DIV ALIGN="CENTER"><A NAME="neu">neuer Mensch:</A>
|
||
|
|
||
|
<?PHP
|
||
|
|
||
|
$HTTP_POST_VARS["mensch_id"] = -1;
|
||
|
include("edit_mensch_formular.php");
|
||
|
|
||
|
?>
|
||
|
|
||
|
</DIV></H4>
|
||
|
|
||
|
</BODY>
|
||
|
</HTML>
|