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

class ExportFreifelder extends ExportBasis
{
  public $pflichtfeldFehler = array();

  public function getVarValue($varname)
  {
    $kurs = $this->exportresults[$this->actualset];
    switch ($this->getVarCategory($varname)) {
      default: return ExportBasis::getVarValue($varname);
      case 'k_': return $this->expCalculation->getVarValue4Kurs($this->getVarName($varname), $kurs);
      case 'b_': return $this->expCalculation->getVarValue4Belegung($this->getVarName($varname), $kurs);
      case 'bbest_': return $this->expCalculation->getVarValue4BelegungBest($this->getVarName($varname), $kurs);
      case 'bedit_': return $this->expCalculation->getVarValue4BelegungEdit($this->getVarName($varname), $kurs);
      case 'beditmehr_': return $this->expCalculation->getVarValue4BelegungMehrfachEdit($this->getVarName($varname), $kurs);
      case 'beditma_': return $this->expCalculation->getVarValue4BelegungMitarbeiterEdit($this->getVarName($varname), $kurs);
      case 'beditpa_': return $this->expCalculation->getVarValue4BelegungPartnerEdit($this->getVarName($varname), $kurs);
      case 'pflicht_': if (is_array($this->pflichtfeldFehler) && array_key_exists('input_' . $this->getVarName($varname) . '_' . $kurs->id, $this->pflichtfeldFehler)) {
        return ' pflicht';
      } else {
        return '';
      }
    }
  }
}