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


class ExportKursdokumente extends ExportBasis
{
  
  public function initiate()
  {
    ExportBasis::initiate();
    $this->dboperations = new DBWorkDokumenteWeb();
  }

  
  public function export()
  {
    $this->clearResult();
    for ($i = 0; $i < count($this->exportsets); $i++) {
      $tmp = $this->dboperations->getDokument($this->exportsets[$i]->id);
      if (isset($tmp->id)) {
        array_push($this->exportresults, $tmp);
      }
    }
  }

  
  public function getVarValue($varname)
  {
    switch ($this->getVarCategory($varname)) {
      default: return ExportBasis::getVarValue($varname);
      case 'kd_': return $this->expCalculation->getVarValue4Kursdokument($this->getVarName($varname), $this->exportresults[$this->actualset]);
    }
  }
}