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



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

  public function fetchData(){
    if(isset($this->urlParameter['nr'])){
      $this->dbwork->fromobject->ausfall = $this->toolSettings->ktstatus;
      $this->dbwork->toobject->ausfall   = $this->toolSettings->ktstatus;
      $this->dbwork->orderby = 'datum';
      $this->dbwork->orderbyasc = ($this->toolSettings->sortktasc === "1");
		
      $this->data = $this->dbwork->getKurstagebyKursNR($this->urlParameter['nr']);
    } else {
      $this->data = NULL;
    }
    $this->getColorKtStatus();
    $this->dataCount = count($this->data);
  }

  public function getMobileHtml(){
    $retour =  '<ul data-role="listview" data-filter="true">'."\n";
    $retour .= $this->getListHTML($columnsary);
    $retour .= '</ul>'."\n";

    return $retour;
  }
}
?>