<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */






class KurseSight extends NormalSight
{
  public $dbwkurse;
  public $kurs;
  public $kursnr;

  
  public function initiate()
  {
    parent::initiate();
    unset($this->kurs);
    $this->kursnr = '';
    

    $this->dbwkurse = new DBWorkKurseWT();
  }

  
  public function getData()
  {
    if ($this->kursnr != '') {
      $this->kurs = $this->dbwkurse->getKurs($this->kursnr);
      if ($this->kurs->id != '') {
        $this->dataary = array($this->kurs);
      }
    }
  }

  
  public function getTitle()
  {
    return "<font id='text_titel'>Details für Kurs: " . CleanOperations::cleanStringForHtml($this->kurs->kurzbez) . ' (Nr. ' . CleanOperations::cleanStringForHtml($this->kursnr) . ')</font>';
  }

  
  public function getMaxLength($varname)
  {
    switch (StringOperations::strtolower($varname)) { case 'beginn_dat': return 10;
      case 'ende_dat': return 10;
      default: return NormalSight::getMaxLength($varname);

    }
  }
}