Source for file class.BESTAETIGUNG.php

Documentation is available at class.BESTAETIGUNG.php

  1. <?php
  2.  
  3. /**
  4.  * Erstellt einen Link zur Bestätigung bzw. zum Löschen der Anmeldung
  5.  *
  6.  * @author Kay Koch
  7.  * @package src
  8.  * @since 15.12.04
  9.  * @subpackage foundation_user
  10.  * @version 1
  11.  */
  12.  
  13. if (version_compare(PHP_VERSION'5'))
  14. {
  15.     die('This file was generated for PHP 5');
  16. }
  17.  
  18. /**
  19.  * Basisklasse der ausführenden Klassen
  20.  * Stellt Methoden und Eigenschaften zur Ein- und Ausgabe über das Webinterface
  21.  * Verfügung
  22.  *
  23.  * @author Kay Koch
  24.  * @since 15.12.04
  25.  * @version 1
  26.  */
  27. require_once ('src/foundation/user/class.PARENTUSER.php');
  28.  
  29. /* user defined includes */
  30. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fd1-includes begin
  31. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fd1-includes end
  32.  
  33. /* user defined constants */
  34. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fd1-constants begin
  35. // section -64--88-122--2-1328c7a:100b87cbb1c:-7fd1-constants end
  36.  
  37. /**
  38.  * Erstellt einen Link zur Bestätigung bzw. zum Löschen der Anmeldung
  39.  *
  40.  * @access public
  41.  * @author Kay Koch
  42.  * @package src
  43.  * @since 15.12.04
  44.  * @subpackage foundation_user
  45.  * @version 1
  46.  */
  47. {
  48.     // --- ATTRIBUTES ---
  49.  
  50.     
  51.     /**
  52.      * Array mit den Feldnamen der aktuellen Datebank
  53.      *
  54.      * @access protected
  55.      * @var array 
  56.      */
  57.     protected $arrKeys = array ();
  58.  
  59.     /**
  60.      * Array mit Übergabewerten
  61.      *
  62.      * @access public
  63.      * @var array 
  64.      */
  65.     public $data = array ();
  66.  
  67.     /**
  68.      * Objekt der Tabellenkalsse BUCHUNGEN
  69.      *
  70.      * @access private
  71.      * @var BUCHUNGEN 
  72.      */
  73.     private $oBuchung null;
  74.  
  75.     // --- OPERATIONS ---
  76.  
  77.     
  78.     /**
  79.      * Erstellt eine HTML-Seite zur Bestätigung bzw. zum Löschen der Anmeldung
  80.      *
  81.      * @access private
  82.      * @author Kay Koch, <kay.koch@gmx.de>
  83.      * @param string 
  84.      * @return void 
  85.      */
  86.     private function makePage($control)
  87.     {
  88.         // section -64--88-122--2-1328c7a:100b87cbb1c:-7fa6 begin
  89.         $tpl $this->confirmBuchung($control);
  90.         // Formatieren der Ausgabe
  91.         $content src_tools_TEMPLATE :: getTemplate($tpl$this);
  92.         // Ausgabe der Seite
  93.         $this->printPage($content);
  94.         // section -64--88-122--2-1328c7a:100b87cbb1c:-7fa6 end
  95.     }
  96.  
  97.     /**
  98.      * Konstruktor
  99.      *
  100.      * überprüft die übergebenen Werte auf Vollständigkeit
  101.      * und initialisiert den Seitenaufbau
  102.      *
  103.      * @access public
  104.      * @author Kay Koch, <kay.koch@gmx.de>
  105.      * @param int 
  106.      * @param string 
  107.      * @param string 
  108.      * @return void 
  109.      */
  110.     public function __construct($buch_id$pwd ''$control '')
  111.     {
  112.         // section -64--88-122--2-1328c7a:101ce91d1f9:-7fef begin
  113.         src_tools_CHECK :: checkID($buch_idtrue);
  114.         src_tools_CHECK :: checkPWD($pwdtrue);
  115.         src_tools_CHECK :: checkConfirm($controltrue);
  116.         parent :: __construct();
  117.         $this->oBuchung new src_foundation_tables_BUCHUNGEN;
  118.         $this->arrKeys = $this->oBuchung->getArrKeys();
  119.         $this->setInputVariables($buch_id$pwd);
  120.         $this->makePage($control);
  121.         // section -64--88-122--2-1328c7a:101ce91d1f9:-7fef end
  122.     }
  123.  
  124.     /**
  125.      * Führt eine Änderung des Status der Buchung durch
  126.      *
  127.      * (bestätigt/nicht bestätigt/gelöscht) und liefert den Namen des Templates
  128.      * dass auf diese Änderung folgt
  129.      *
  130.      * @access private
  131.      * @author Kay Koch, <kay.koch@gmx.de>
  132.      * @param string 
  133.      * @return string 
  134.      */
  135.     private function confirmBuchung($control)
  136.     {
  137.         $returnValue = (string) '';
  138.  
  139.         // section -64--88-122--2-1328c7a:10292f82497:-7fee begin
  140.         try
  141.         {
  142.             switch ($control)
  143.             {
  144.                 case "c" // Buchung bestätigen (confirm)
  145.                     if (!$this->oBuchung->setAsTaken($this->data['buch_id']$this->data['pwd']))
  146.                         throw new Exception(13);
  147.                     $this->pdflink $this->oBuchung->getPDFLink($this->data['buch_id'$this->data['pwd']);
  148.                     $returnValue "bestaetigung_ok";
  149.                     break;
  150.                 case "d" // Buchung löschen (delete)
  151.                     if (!$this->oBuchung->deleteBuchung($this->data['buch_id']$this->data['pwd']))
  152.                         throw new Exception(14);
  153.                     $returnValue "bestaetigung_geloescht";
  154.                     break;
  155.                 default // Startbildschirm /Bestätigung
  156.                     $returnValue "bestaetigung";
  157.             // switch
  158.         catch (Exception $e)
  159.         {
  160.             src_tools_ERROR :: setError($e__METHOD__);
  161.         }
  162.         // section -64--88-122--2-1328c7a:10292f82497:-7fee end
  163.  
  164.         return (string) $returnValue;
  165.     }
  166.  
  167.     /**
  168.      * wandelt die Daten in das notwendige Format zur Ausgabe um
  169.      *
  170.      * @access private
  171.      * @author Kay Koch, <kay.koch@gmx.de>
  172.      * @param int 
  173.      * @param string 
  174.      * @return void 
  175.      */
  176.     private function setInputVariables($buch_id$pwd)
  177.     {
  178.         // section -64--88-122--2-5a4368f4:103efc100ac:-7faa begin
  179.         try
  180.         {
  181.             $this->data = $this->oBuchung->getBuchung($buch_id$pwd);
  182.             if (empty ($this->data))
  183.                 throw new Exception(12);
  184.             src_foundation_tables_PARENTTABLES:: setSea($this->data['see_id']);
  185.             $oVerein new src_foundation_tables_VEREINE();
  186.             $oVerein->setParams($this->data['verein_nr']);
  187.             $this->data['verein'$oVerein->name;
  188.             $this->data['seename'src_foundation_tables_PARENTTABLES:: getSea()->name;
  189.             $this->data['realdatum'src_tools_TIME :: sqlT2realT($this->data['datum']"%A - %d. %B %Y")// Datum in normaler Form
  190.             $this->data['realstunde'(src_foundation_tables_PARENTTABLES:: getSea()->buchbarProTag"ganztägig" $this->data['stunde'" h";
  191.             if ($this->data['istAbgeholt'== 1)
  192.             // ist bereits bestätigt
  193.                 $this->data['status'"bestätigt";
  194.                 $this->data['conform'"";
  195.                 $this->data['pdflink'$this->oBuchung->getPDFLink($this->data['buch_id'$this->data['pwd'])// Link des pdf-Dokumentes
  196.             else
  197.             // noch nicht bestätigt
  198.                 $this->data['buch_id'$buch_id;
  199.                 $this->data['pwd'$pwd;
  200.                 $this->data['status'"nicht bestätigt";
  201.                 $this->data['conform'"<input type=\"submit\" name=\"submit\" onClick=\"return setConfirm(this.form,'c')\" value=\"Bestätigen\">";
  202.                 $this->data['pdflink'"";
  203.             }
  204.         catch (Exception $e)
  205.         {
  206.             die(src_tools_ERROR :: getErrTxt($e->getMessage()));
  207.         }
  208.         // section -64--88-122--2-5a4368f4:103efc100ac:-7faa end
  209.     }
  210.  
  211. /* end of class src_foundation_user_BESTAETIGUNG */
  212. ?>

Documentation generated on Sat, 24 Mar 2007 09:58:54 +0100 by phpDocumentor 1.3.1