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

class DataMenuStandortliste extends DataMenuMainTopLeft
{
  public function __construct($urlparameter)
  {
    parent::__construct($urlparameter);
  }

  public function mainmenu()
  {
    $this->prepareMainmenu();
    if ($this->toolsettings->showClickpfad) {
      echo $this->getClickPath();
    }

    $this->exportadapter = new ExpAdresse();

    echo '<div class="hauptseite">' . "\n" . $this->getContentAnker();

    $hlgrundsys = new DBWorkHLGrundSys();
    $kennzVon = $hlgrundsys->getFeldWert('E546_KENNZVON', '-1');
    $kennzBis = $hlgrundsys->getFeldWert('E546_KENNZBIS', '-1');
    $zuordnung = $hlgrundsys->getFeldWert('E546_ZUORDNUNG', '-1');
    if ($zuordnung != 0 || $kennzVon < 0 || $kennzBis < 0) {
      $this->shownodata();
    } else {
      $this->dataarrayheader = $this->dataarraybody = $this->dataarrayfooter = array('');
      $this->showheader();
      #$kennzVon - $kennzBis
      $dbwa = new DBWorkAdresse();
      $this->dataarraybody = $dbwa->getAdressenBundeslaenderForStandorte();
      $this->showbody();
      $this->showfooter();
    }
    echo "</div>\n\n";
  }

  

  public function getsight($pSightId = 737)
  {
    parent::getsight($pSightId);
  }

  
  public function statusmenu($pPHP53DummyParam = '')
  {
    $tagnameFuerStatusmeldung = $this->getTagnameFuerStatusmeldung();
    $beginTag = '';
    $endTag = '';
    if ($tagnameFuerStatusmeldung != '') {
      $beginTag = "   <$tagnameFuerStatusmeldung class='statusmeldung'>";
      $endTag = "</$tagnameFuerStatusmeldung>";
    }
    if ($this->status1 == '' && $this->status2 == '') {
      return;
    }
    echo "  <div class='hauptseite_status'>\n";
    if ($this->status1 != '') {
      echo "   <h2 class='statusadresse'>" . $this->addfstring->getfilledStr($this->status1, BR) . "</h2>\n";
    }
    echo $beginTag . $this->addfstring->getfilledStr(CleanOperations::cleanStringContainingHtml($this->status2), BR) . $endTag . "\n";
    echo "  </div>\n\n";
  }

  public function getClickPath($pName = 'Standorte')
  {
    $this->clickpfad = '';
    DataMenuMainTopLeft::getClickPath();

    $this->clickpfad .= '<div class="hauptseite_clickpfad"><span class="clickpfad">' . "\n";
    if ($this->toolsettings->titleKursBereich != '') {
      $this->clickpfad .= '<span class="clickadresse"> ' . CleanOperations::cleanStringForHtml(stripslashes($this->toolsettings->titleKursBereich)) . ' </span>' . PHP_EOL;
      $this->clickpfad .= '<span class="trennzeichen"> ' . CleanOperations::cleanStringContainingHtml($this->toolsettings->trennzeichenKategorie) . ' </span>' . PHP_EOL;
    }

    $name = 'Standortliste';
    $this->clickpfad .= $this->getClickPathStep($this->urlparameter->getEmptyStreamWith(
      array('kathaupt'),
      array('425')
    ), $name . ' öffnen', $name);

    if ($this->toolsettings->titleKursBereich != '') {
      $this->clickpfad .= '<span class="clickadresse"> ' . $pName . ' </span>' . PHP_EOL;
    }

    $this->clickpfad .= "</span></div>\n";

    return $this->clickpfad;
  }
}