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



class DozentMobilePage extends DefaultMobilePage {
  public function __construct(){
    if(isset($_REQUEST['nr'])){
      parent::__construct(365, TOOL_MOB_KURSDETAILS, RequestOperations::getVarValue('nr'));
    } else {
      parent::__construct(365, TOOL_MOB_KURSDETAILS, 'Dozenten');
    }
    $this->dbwork = new DBWorkDozentenHonorar();
    $this->fetchData();
  }

  public function fetchData(){
    if(isset($this->urlParameter['nr'])){
      $this->dbwork->orderby = 'name, vorname';
      $this->dbwork->orderbyasc = true;
      $this->data = $this->dbwork->getHonorarebyKNR($this->urlParameter['nr']);    
    } else {
      $this->data = NULL;
    }
    $this->dataCount = count($this->data);
  }

  public function getMobileHtml(){
    $retour =  '<ul data-role="listview" data-filter="true">'."\n";
    if($this->dataCount > 0){
      $retour .= $this->getListHTML();
    } else {
      $retour .= ' <li>'."\n";
      $sprachsettings = new SprachSettingsObject();
      $retour .= '   <p class="listKeineDaten">' . $sprachsettings->Dozent['Plural']['Akkusativ'] . '</p>'."\n";
      $retour .= ' </li>'."\n";
    }
    $retour .= '</ul>'."\n";
    return $retour;
  }

}
?>