Source for file class.ADMINMAXFREI.php
Documentation is available at class.ADMINMAXFREI.php
* Verwaltet die Adminitration der Datenbanktabelle 'maxfrei'
* @author Kay Koch, <kay.koch@gmx.de>
* @subpackage foundation_admin
die('This file was generated for PHP 5');
* Parentklasse zur Administration der Tabellen
* @author Kay Koch, <kay.koch@gmx.de>
require_once('src/foundation/admin/class.PARENTADMIN.php');
* Interface zur Administration der Datenbank
require_once('src/interfaces/interface.ADMININTERFACE.php');
/* user defined includes */
// section -64--88-122--2-556c3468:1044bd6a64b:-7fd5-includes begin
// section -64--88-122--2-556c3468:1044bd6a64b:-7fd5-includes end
/* user defined constants */
// section -64--88-122--2-556c3468:1044bd6a64b:-7fd5-constants begin
// section -64--88-122--2-556c3468:1044bd6a64b:-7fd5-constants end
* Verwaltet die Adminitration der Datenbanktabelle 'maxfrei'
* @author Kay Koch, <kay.koch@gmx.de>
* @subpackage foundation_admin
* Objekt der aktellen Datenbankklasse
private $oMaxfrei =
null;
* Array mit den Feldnamen der aktuellen Datebank
* Name des Haupttemplates
* zeigt alle Einträge einer Tabelle
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--6176e79b:103fa06a375:-7fad begin
$this->oMaxfrei->unsetParams();
$arrTmp =
$this->oMaxfrei->getRow();
$arrTimeRange =
$this->oSeen->getTimeRanges();
$this->timeHeader =
$this->prepareTimeHeader($arrTimeRange);
foreach ($arrTmp as $see_id =>
$arrSee) { // alle Seen
$oSee =
$this->oSeen-> $see_id;
$this->seename =
$oSee->name;
foreach($arrSee as $this->data) { // alle Wochentage
$this->timeRows =
$this->prepareTimeRows("admin_time_row", $oSee, $arrTimeRange);
// section -64--88-122--2--6176e79b:103fa06a375:-7fad end
* liefert ein Formular zur Änderung bzw. Neueingabe eines Datensatzes
* Wenn die Tabellenspezifischen Parameter vorhergesetzt wurden wird der
* Datensatz ausgegeben. Ansonsten erscheint ein leeres Formular
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--6176e79b:103fa06a375:-7fa9 begin
if ((!empty($this->oMaxfrei->see_id))) {
$this->data =
$this->oMaxfrei->getRow();
$oSee =
new src_foundation_tables_EINSEE($this->oMaxfrei->see_id);
$this->seename =
$oSee->name;
$this->timeRows =
$this->prepareTimeRows("admin_time_input", $oSee);
// section -64--88-122--2--6176e79b:103fa06a375:-7fa9 end
* Aktualisieet den vorher durch setzen der Parameter ausgewählten
* Die Neuen Daten befinden sich im Übergabefeld $data
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--6176e79b:103fa06a375:-7f83 begin
$this->oMaxfrei->updateRow($data);
// section -64--88-122--2--6176e79b:103fa06a375:-7f83 end
* Löscht den Datensatz der vorher durch Parameter ausgewählt wurde
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--6176e79b:103fa06a375:-7f7f begin
$this->oMaxfrei->deleteRow();
// section -64--88-122--2--6176e79b:103fa06a375:-7f7f end
* Fügt einen neuen datensatz mit den Werten des Übergabeparameter $data
* @author Kay Koch, <kay.koch@gmx.de>
// section -64--88-122--2--6176e79b:103fa06a375:-7f7d begin
// section -64--88-122--2--6176e79b:103fa06a375:-7f7d end
* überprüft die Korrektheit der eingebenen bzw. geänderten Daten
* @author Kay Koch, <kay.koch@gmx.de>
$returnValue = (bool)
false;
// section -64--88-122--2--62c31de:1048594e50f:-7fef begin
if (isset
($data['sumTag'])) {
throw
new Exception ("55,Gesamt");
foreach($data as $key =>
$anzahl) {
throw
new Exception ("55,$key");
$message =
explode(",", $e->getMessage());
// section -64--88-122--2--62c31de:1048594e50f:-7fef end
return (bool)
$returnValue;
* erstellt ein Obejkt der zu beabeitenden Klassen
* list alle erlaubten Datenbankschlüssel ein
* @author Kay Koch, <kay.koch@gmx.de>
public function __construct($token, $see_id =
0, $wochentag =
0)
// section -64--88-122--2-556c3468:1044bd6a64b:-7fca begin
$this->oMaxfrei->setParams($see_id, "", $wochentag);
$this->wochentag =
$wochentag;
// section -64--88-122--2-556c3468:1044bd6a64b:-7fca end
* estellt aus den Zeitdaten HTML Reihen
* @author Kay Koch, <kay.koch@gmx.de>
private function prepareTimeRows($tpl, $oSee, $arrTimeRange =
null)
$returnValue = (string)
'';
// section -64--88-122--2-556c3468:1044bd6a64b:-7fbb begin
$isInput =
(isset
($arrTimeRange))?
false :
true;
if ($oSee->buchbarProTag) { // ganzer Tag buchbar
if ($isInput) { // Eingabeformular
$this->readonly =
""; // Gesamtanzahl kann editiert werden
$this->sumKey =
"data[sumTag]";
} else { // Gesamtdarstellung
$nr = (int)
$arrTimeRange[1] - (int)
$arrTimeRange[0];
for ($i =
1;$i <=
$nr +
1;$i++
) $returnValue .=
sprintf($rowTpl, "");
} else { // stundenweise Anmeldung
$this->readonly =
"readonly"; // Gesamtanzahl kann nicht editiert werden
$startTime =
$oSee->getStartTime("", $this->data['wochentag']); // erste angezeigte Uhrzeit
$endTime =
$oSee->getEndTime("", $this->data['wochentag']); // letzte angezeigt Uhrzeit
foreach ($this->arrKeys as $key) { // alle Datenbankfelder durchlaufen
if ($isInput) { // Eingabeformular
if ($key >=
$startTime AND $key <=
$endTime) { // erlaubte Uhrzeit und Eingabeformular
$returnValue .=
sprintf($rowTpl, $key , $key, $this->data[$key]);
} else { // Gesamtdarstellung
if ((int)
$key < (int)
$arrTimeRange[0] OR (int)
$key > (int)
$arrTimeRange[1]) { // außerhalb jeder Tauchzeit
} else if ($key <
$startTime OR $key >
$endTime or $this->data[$key] ==
0) { // außerhalb der Tauchzeit für diesen See
$returnValue .=
sprintf($rowTpl, "");
$returnValue .=
sprintf($rowTpl, $this->data[$key]);
// section -64--88-122--2-556c3468:1044bd6a64b:-7fbb end
return (string)
$returnValue;
* estellt aus den Zeitdaten HTML überschriften für eine Tabelle
* @author Kay Koch, <kay.koch@gmx.de>
private function prepareTimeHeader($arrTimeRange)
$returnValue = (string)
'';
// section -64--88-122--2-556c3468:1044bd6a64b:-7faa begin
list
($min, $max) =
$arrTimeRange;
for($hour = (int)
$min; $hour <= (int)
$max; $hour++
) {
$returnValue .=
"<th>" .
$hour .
":00 h</th>\n";
// section -64--88-122--2-556c3468:1044bd6a64b:-7faa end
return (string)
$returnValue;
} /* end of class src_foundation_admin_ADMINMAXFREI */
Documentation generated on Sat, 24 Mar 2007 09:58:41 +0100 by phpDocumentor 1.3.1