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


class DataMenuAussenstelle extends DataMenu
{
  
  public function __construct($param)
  {
    parent::__construct($param);
    $this->exportadapter = new ExpAussenstellen();
  }

  
  public function content()
  {
    echo $this->getcontent();
  }

  
  public function getcontent()
  {
    $this->urlparameter->explodeSettingStream();


    $sight = SightsAPI::getSight(148);
    $this->exportadapter->export->initiate();
    $this->exportadapter->export->add($this->addfstring->getfilledStr($this->urlparameter->aussenst, '-1'));
    $this->exportadapter->export->export();
    $this->exportadapter->filestream = $sight->header;
    $this->exportadapter->replaceVarNames();

    $html
      = "<div class='ansichtaussenst'>\n"
      . $this->exportadapter->resultlist[0];
    $this->exportadapter->filestream = $sight->body;
    $this->exportadapter->replaceVarNames();
    if ($this->exportadapter->export->resultCount() > 0) {
      for ($i = 0;$i < $this->exportadapter->export->resultCount();$i++) {
        $html .= $this->exportadapter->resultlist[$i];
      }
    } else {
      
      $this->exportadapter->export->initiate();
      $this->exportadapter->export->exportresults = array(new Datamodul());
      $this->exportadapter->filestream = $sight->nodata;
      $this->exportadapter->replaceVarNames();
      
      $html .= $this->exportadapter->resultlist[0];
    }

    
    $this->exportadapter->export->initiate();
    $this->exportadapter->export->add($this->addfstring->getfilledStr($this->urlparameter->aussenst, '-1'));
    $this->exportadapter->export->export();
    $this->exportadapter->filestream = $sight->footer;
    $this->exportadapter->replaceVarNames();
    $html .= $this->exportadapter->resultlist[0];

    $html .= "</div>\n";

    return $html;
  }
}