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

if (!defined('BASEDIR')) {
  include_once '..' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'constants.php';
}

session_start();

define('ISKUFERTOOLS', true);

CodingOperations::encodeEingaben();
CodingOperations::setObStartIfInternalAndExternalEncodingAreDiffrent();
CodingOperations::setEncodingResponseHeader();

if (!SessionOperations::isWtUserLoggedIn()) {
  header('Location: index.php?sessionfail=1');
  die();
}

SecurityOperations::PurgeInput(true);

echo
  '<?xml version="1.0" ?>'
  . '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"'
  . ' "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
  . '<html xmlns="http://www.w3.org/1999/xhtml">'
  . '<head>'
  . '<link rel="stylesheet" href="css/webtools.css" type="text/css" />'
  . '<link rel="stylesheet" href="css/skin.css" type="text/css" />'
  . '<title>Hinterlegung</title>';
if (GetOperations::isDefined('mitJQ')) {
  echo '<script type="text/javascript" src="../jquery/jquery-1.12.4.min.js"></script>';
}
echo
  '</head>'
  . '<body>';


if (GetOperations::isDefined('type')) {
  $type = GetOperations::getVarValue('type');
  $field = GetOperations::getVarValue('field');

  $hinterlegung = HLDispatcher::GetHinterlegungClass($type);
  $hinterlegung->fields = explode(':', $field);

  echo $hinterlegung->CreateTable(GetOperations::isDefined('mitJQ'));
}

echo
  '</body>'
  . '</html>';

CodingOperations::encodeAnzeige();