<?php

namespace Tables;

class Userconfig {
  
  

  
  

    // --- Statische Methoden ---
  
  public static function view1Action() { 
    
    
    // --- BLOCK: access ---
    if(!(((\FOP\User::getAdmin())))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: main ---
    
		header('Location: ' . \TablesRouter\Userconfig::viewURL(1));
	
    
  }

  public static function getDefaults() { 
    
    
    // --- BLOCK: main ---
    
	// erstellt ein leeres Objekt zum Befüllen mit Daten oder als Default fürs Create-Formular
	$data = ['Configuration_Stammdaten_logo' => null,
		'Configuration_Stammdaten_headerText' => '',
		'Configuration_Stammdaten_firmenname' => 'Firmenname',
		'Configuration_Stammdaten_firmenname2' => '',
		'Configuration_Stammdaten_strasse' => 'Straße Nr.',
		'Configuration_Stammdaten_flst' => null,
		'Configuration_Stammdaten_plz' => 'PLZ',
		'Configuration_Stammdaten_ort' => 'Ort',
		'Configuration_Stammdaten_telefon' => '00000/000000',
		'Configuration_Stammdaten_mobil' => '0151/0000000000',
		'Configuration_Stammdaten_fax' => '00000/000000',
		'Configuration_Stammdaten_email' => 'beispiel@mustermann.de',
		'Configuration_Stammdaten_website' => null,
		'Configuration_Stammdaten_iban' => null,
		'Configuration_Stammdaten_bic' => '',
		'Configuration_Stammdaten_bankname' => '',
		'Configuration_Stammdaten_geschaeftsfuehrer1' => 'Name des 1. Geschäftsführers',
		'Configuration_Stammdaten_geschaeftsfuehrer2' => 'Name des 2. Geschäftsführers',
		'Configuration_Stammdaten_registergericht' => 'Registergericht Dresden',
		'Configuration_Stammdaten_handelsregisternummer' => 'HRA oder HRB',
		'Configuration_Stammdaten_finanzamt' => 'Finanzamt Bautzen',
		'Configuration_Stammdaten_steuernr' => 'xxx / xxx / xxxxx',
		'Configuration_Stammdaten_umsatzsteuerid' => 'DE999999999',
		'FOP_AI_token' => 'demo',
		'FOP_AI_precontext' => 'Launix ist ein innovatives Softwareunternehmen, das ERP- und CRM-Systeme entwickelt. Die Stärke ist das modulare System, die Erweiterbarkeit und das Zugriffssystem, mit dem man auch ganze Portale entwickeln kann.',
		'Tables_Doc_defaultDoctype' => \FOP\InitialData::getDocUnclassified(),
		'RevisionEmail_Doc_host' => 'eg. imap.example.com',
		'RevisionEmail_Doc_port' => '993',
		'RevisionEmail_Doc_auth' => 'SSL/TLS',
		'RevisionEmail_Doc_username' => 'max@mustermann.de',
		'RevisionEmail_Doc_password' => 'mysecretpassword',
		'RevisionEmail_Doc_syncdate' => 0,
		'FOP_Index_Impressum' => ''];
	return $data;
	
    
  }

  public static function deleteConfirmAction($id = null ) { 
    
    // Methodenimplementierung überschrieben.
    throw new \FOP\AccessDeniedException();return false;
  }

  public static function createAction() { 
    
    // Methodenimplementierung überschrieben.
    throw new \FOP\AccessDeniedException();return false;
  }

  public static function editAction($id = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!(((\FOP\User::getAdmin())))) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		if ((!isset($_POST['cancel']))) \FOP\Files::validate($_POST['Configuration_Stammdaten_logo']);
		if ((!isset($_POST['cancel']))) \FOP\Validators::iban_checker($_POST['Configuration_Stammdaten_iban']);
		if ((!isset($_POST['cancel']))) \Types\DocType::validate($_POST['Tables_Doc_defaultDoctype']);

		
		/* Sanitizer */

		if ((!isset($_POST['cancel']))) $_POST['Configuration_Stammdaten_logo'] = \FOP\Files::sanitizeUpload($_POST['Configuration_Stammdaten_logo']);
		$_POST['Configuration_Stammdaten_headerText'] = \FOP\Sanitizers::htmlentities_decode($_POST['Configuration_Stammdaten_headerText']);
		$_POST['Configuration_Stammdaten_plz'] = trim($_POST['Configuration_Stammdaten_plz']);
		$_POST['Configuration_Stammdaten_plz'] = \Types\Plz::sanitize($_POST['Configuration_Stammdaten_plz']);
		$_POST['Configuration_Stammdaten_telefon'] = \FOP\Sanitizers::no_phone($_POST['Configuration_Stammdaten_telefon']);
		$_POST['Configuration_Stammdaten_mobil'] = \FOP\Sanitizers::no_phone($_POST['Configuration_Stammdaten_mobil']);
		$_POST['Configuration_Stammdaten_fax'] = \FOP\Sanitizers::no_phone($_POST['Configuration_Stammdaten_fax']);
		$_POST['Configuration_Stammdaten_email'] = \FOP\Sanitizers::no_text($_POST['Configuration_Stammdaten_email']);
		$_POST['Configuration_Stammdaten_website'] = \FOP\Sanitizers::no_text($_POST['Configuration_Stammdaten_website']);
		if ((!isset($_POST['cancel']))) $_POST['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::iban_filter($_POST['Configuration_Stammdaten_iban']);
		if ((!isset($_POST['cancel']))) $_POST['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::no_text($_POST['Configuration_Stammdaten_iban']);
		if ((!isset($_POST['cancel']))) $_POST['Configuration_Stammdaten_iban'] = mb_strtoupper($_POST['Configuration_Stammdaten_iban']);
		if ((!isset($_POST['cancel']))) $_POST['Tables_Doc_defaultDoctype'] = \FOP\Sanitizers::null_filter($_POST['Tables_Doc_defaultDoctype']);
		$_POST['RevisionEmail_Doc_password'] = \Types\Password::encryptSymmetric($_POST['RevisionEmail_Doc_password']);
		$_POST['RevisionEmail_Doc_syncdate'] = \FOP\Sanitizers::convert_date_to_unix_timestamp($_POST['RevisionEmail_Doc_syncdate']);
		$_POST['FOP_Index_Impressum'] = \FOP\Sanitizers::htmlentities_decode($_POST['FOP_Index_Impressum']);

		
	}
	
    // --- BLOCK: access-item-userconfig-edit ---
    
		if ($id !== null && \FOP\Database::query('SELECT ('.\FOP\Database::quote(\FOP\User::getAdmin()).') FROM '.qi('userconfig').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id))->fetchColumn() != 1) {
			throw new \FOP\AccessDeniedException();
		}
	
    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (!isset($_POST['cancel'])) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-clone-prepare ---
    
		$data = self::view($id);
	
    // --- BLOCK: main-2:save-main ---
    
		$data_edit = [];
		$data_edit['Configuration_Stammdaten_headerText'] = $_POST['Configuration_Stammdaten_headerText'];
		$data_edit['Configuration_Stammdaten_firmenname'] = $_POST['Configuration_Stammdaten_firmenname'];
		$data_edit['Configuration_Stammdaten_firmenname2'] = $_POST['Configuration_Stammdaten_firmenname2'];
		$data_edit['Configuration_Stammdaten_strasse'] = $_POST['Configuration_Stammdaten_strasse'];
		$data_edit['Configuration_Stammdaten_flst'] = $_POST['Configuration_Stammdaten_flst'];
		$data_edit['Configuration_Stammdaten_plz'] = $_POST['Configuration_Stammdaten_plz'];
		$data_edit['Configuration_Stammdaten_ort'] = $_POST['Configuration_Stammdaten_ort'];
		$data_edit['Configuration_Stammdaten_telefon'] = $_POST['Configuration_Stammdaten_telefon'];
		$data_edit['Configuration_Stammdaten_mobil'] = $_POST['Configuration_Stammdaten_mobil'];
		$data_edit['Configuration_Stammdaten_fax'] = $_POST['Configuration_Stammdaten_fax'];
		$data_edit['Configuration_Stammdaten_email'] = $_POST['Configuration_Stammdaten_email'];
		$data_edit['Configuration_Stammdaten_website'] = $_POST['Configuration_Stammdaten_website'];
		$data_edit['Configuration_Stammdaten_bic'] = $_POST['Configuration_Stammdaten_bic'];
		$data_edit['Configuration_Stammdaten_bankname'] = $_POST['Configuration_Stammdaten_bankname'];
		$data_edit['Configuration_Stammdaten_geschaeftsfuehrer1'] = $_POST['Configuration_Stammdaten_geschaeftsfuehrer1'];
		$data_edit['Configuration_Stammdaten_geschaeftsfuehrer2'] = $_POST['Configuration_Stammdaten_geschaeftsfuehrer2'];
		$data_edit['Configuration_Stammdaten_registergericht'] = $_POST['Configuration_Stammdaten_registergericht'];
		$data_edit['Configuration_Stammdaten_handelsregisternummer'] = $_POST['Configuration_Stammdaten_handelsregisternummer'];
		$data_edit['Configuration_Stammdaten_finanzamt'] = $_POST['Configuration_Stammdaten_finanzamt'];
		$data_edit['Configuration_Stammdaten_steuernr'] = $_POST['Configuration_Stammdaten_steuernr'];
		$data_edit['Configuration_Stammdaten_umsatzsteuerid'] = $_POST['Configuration_Stammdaten_umsatzsteuerid'];
		$data_edit['FOP_AI_token'] = $_POST['FOP_AI_token'];
		$data_edit['FOP_AI_precontext'] = $_POST['FOP_AI_precontext'];
		$data_edit['RevisionEmail_Doc_host'] = $_POST['RevisionEmail_Doc_host'];
		$data_edit['RevisionEmail_Doc_port'] = $_POST['RevisionEmail_Doc_port'];
		$data_edit['RevisionEmail_Doc_auth'] = $_POST['RevisionEmail_Doc_auth'];
		$data_edit['RevisionEmail_Doc_username'] = $_POST['RevisionEmail_Doc_username'];
		$data_edit['RevisionEmail_Doc_password'] = $_POST['RevisionEmail_Doc_password'];
		$data_edit['RevisionEmail_Doc_syncdate'] = $_POST['RevisionEmail_Doc_syncdate'];
		$data_edit['FOP_Index_Impressum'] = $_POST['FOP_Index_Impressum'];
		if ((!isset($_POST['cancel']))) $data_edit['Configuration_Stammdaten_logo'] = $_POST['Configuration_Stammdaten_logo'];
		if ((!isset($_POST['cancel']))) $data_edit['Configuration_Stammdaten_iban'] = $_POST['Configuration_Stammdaten_iban'];
		if ((!isset($_POST['cancel']))) $data_edit['Tables_Doc_defaultDoctype'] = $_POST['Tables_Doc_defaultDoctype'];
		self::edit($id, $data_edit);
		if (isset($data_edit['ID'])) {
			$id = $data_edit['ID'];
		}
	
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['Tables:Userconfig:edit:id'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from'] && strrpos($_POST['fop-from'], 'insert_param') !== false) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\Userconfig::editURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null, 'from' => $_POST['fop-from'] ?? null]));
			}
			die();
	
		}
		if (isset($_POST['cancel'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\Userconfig::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		if (isset($_POST['save'])) {
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']));
			} else {
				header('Location: ' . \TablesRouter\Userconfig::viewURL2(['id' => $id, 'popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = self::view($id); // TODO: klären, wer die Funktion bereitstellt (momentan crud/view.fop)
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(sprintf(_('edit %s'), _('config'))); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('edit %s'), _('config'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<span class="mdl-layout-title"><?php echo(sprintf(_('edit %s'), _('config'))); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\Userconfig::editURL2(['popup' => $_GET['popup'] ?? null, 'id' => $id]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
									onsubmit="
										if (window.running_uploads) {
											event.preventDefault();
											alert('<?php echo htmlentities(json_encode(_('fileUploadStillActive')));?>');
										}
									"
								 
								id="cardform-wf_userconfig_edit"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_userconfig_edit" ng-init="form = <?php echo htmlentities(json_encode([]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true)) {
									$feature = [
										'id' => 'KI',
										'title' => _('KI'),
										'order' => '200-KI', // 200-KI (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || true || false || false || false || false)) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. (true ? 'true' : '0')
											 .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0'
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || (!isset($_POST['cancel'])) || true || true || true || true || true || true)) {
									$feature = [
										'id' => 'DMS',
										'title' => _('DMS'),
										'order' => '200-DMS', // 200-DMS (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || (!isset($_POST['cancel'])) || true || true || true || true || true || true || true || true || true || true || true || true || (!isset($_POST['cancel'])) || true || true || true || true || true || true || true || true || true)) {
									$feature = [
										'id' => 'Stammdaten',
										'title' => _('Stammdaten'),
										'order' => '200-Stammdaten', // 200-Stammdaten (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. ((!isset($_POST['cancel'])) ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:userconfig:edit\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_userconfig_edit_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'><?php if (true) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="save" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">save</i><?php echo(_('save')); ?></button><?php } ?>
									&nbsp;<?php if (true) { ?><button onclick="$(this).closest('form').find('.mdl-textfield__error:visible').hide();
		$('[required]').removeAttr('required');
	" type="submit" name="cancel" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">cancel</i><?php echo(_('cancel')); ?></button><?php } ?>
									&nbsp;<?php if ((true)&&((\FOP\User::getAdmin()))&&((\FOP\User::getAdmin()))&&((\FOP\User::getAdmin()))) { ?><button onclick="
		var errors = $(this).closest('form').find('.fop-form-error:visible, .is-invalid').filter((i, x) => $(x).parents('.novalidate').length ? false : true);
		if (errors.length) {
			event.preventDefault();
			alert(errors.closest('.fop-form-content').prev('.fop-form-label').text() + ' Es sind noch Fehler im Formular bei Feld');
			return;
		} /* TODO: i18n */
		
	" type="submit" name="Tables:Userconfig:edit:id" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">save</i><?php echo(_('Zwischenspeichern')); ?></button><?php } ?>
									</div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_userconfig_edit_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['KI']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_AI_token" id="column_FOP_AI_token">
		<!-- Feld "Lizenzschlüssel für KI": FOP_AI_token -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_AI_token"><?php echo(_('Lizenzschlüssel für KI')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="FOP_AI_token"  value="<?php echo htmlentities($data['FOP_AI_token']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_AI_precontext" id="column_FOP_AI_precontext">
		<!-- Feld "Vorwissen für die KI": FOP_AI_precontext -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_AI_precontext"><?php echo(_('Vorwissen für die KI')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div style="width: 100%;" class="mdl-textfield mdl-js-textfield"><textarea onkeydown='if (event.keyCode == 13 && event.ctrlKey) { event.preventDefault(); event.stopPropagation(); tabNext(this); return false; }' class="mdl-textfield__input" rows="8" cols="80" name="FOP_AI_precontext" id="FOP_AI_precontext" ><?php echo htmlentities($data['FOP_AI_precontext']); ?></textarea><label class="mdl-textfield__label" for="FOP_AI_precontext"><?php echo(_('text')); ?></label><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['KI']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || true || false || false || false || false)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_Index_Impressum" id="column_FOP_Index_Impressum">
		<!-- Feld "Impressum-Text": FOP_Index_Impressum -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_Index_Impressum"><?php echo(_('Impressum-Text')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<div tinymce-locale="<?php echo \FOP\I18n::getShortLocale(); ?>">
	
	<textarea ng-non-bindable rows="22" cols="50" name="FOP_Index_Impressum" class="html-html"><?php echo htmlentities($data['FOP_Index_Impressum']); ?></textarea>
	</div>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || (!isset($_POST['cancel'])) || true || true || true || true || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['DMS']);
										?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Tables_Doc_defaultDoctype" id="column_Tables_Doc_defaultDoctype">
		<!-- Feld "Dokumenttyp Standardwert neue Dokumente": Tables_Doc_defaultDoctype -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Tables_Doc_defaultDoctype"><?php echo(_('Dokumenttyp Standardwert neue Dokumente')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div style='display: flex; flex-direction: row; align-items: center; width: 100%;'><?php
	\Tables\DocType::renderEditform_wf_userconfig_edit_Tables_Doc_defaultDoctypeAction($data['Tables_Doc_defaultDoctype'], [], '');
?> &nbsp;	<?php if (\TablesRouter\DocType::createAccess()) { ?>  <a tabindex='-1' class='unimportant button' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\DocType::createURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=docType%26colinsert=Tables_Doc_defaultDoctype%26el=" + encodeURIComponent(id) + "%26close%26insert_param=colvalue", "_blank", "width=739, height=395"); return false;'><i class="material-icons">add</i></a> <?php } ?> &nbsp;	<a tabindex='-1' class='unimportant button fop-ddt-search' href="#" onclick='var p = $(this).parent(), id = "x"+Math.round(1000000*Math.random()); p.attr("id", id); window.open_over(<?php
		echo json_encode(\TablesRouter\DocType::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=docType%26colinsert=Tables_Doc_defaultDoctype%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=docType", "_blank", "width=739, height=395"); return false;'><i class="material-icons">search</i></a>
	</div>
	</div>
	</div><?php } ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_host" id="column_RevisionEmail_Doc_host">
		<!-- Feld "IMAP-Host": RevisionEmail_Doc_host -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_host"><?php echo(_('IMAP-Host')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="RevisionEmail_Doc_host"  value="<?php echo htmlentities($data['RevisionEmail_Doc_host']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_port" id="column_RevisionEmail_Doc_port">
		<!-- Feld "IMAP-Port": RevisionEmail_Doc_port -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_port"><?php echo(_('IMAP-Port')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="RevisionEmail_Doc_port"  value="<?php echo htmlentities($data['RevisionEmail_Doc_port']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_auth" id="column_RevisionEmail_Doc_auth">
		<!-- Feld "IMAP-Authentication": RevisionEmail_Doc_auth -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_auth"><?php echo(_('IMAP-Authentication')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdlext-selectfield mdlext-js-selectfield"><select onkeydown='if (event.keyCode == 13) { event.preventDefault(); event.stopPropagation(); tabNext(this); return false; }' class="selectdropdown mdlext-selectfield__select" name='RevisionEmail_Doc_auth' id='RevisionEmail_Doc_auth'><option value='SSL/TLS'<?php if ($data['RevisionEmail_Doc_auth'] == 'SSL/TLS') {echo " selected";}?>><?php echo(_('SSL/TLS')); ?></option><option value='STARTTLS'<?php if ($data['RevisionEmail_Doc_auth'] == 'STARTTLS') {echo " selected";}?>><?php echo(_('StartTLS')); ?></option><option value='NONE'<?php if ($data['RevisionEmail_Doc_auth'] == 'NONE') {echo " selected";}?>><?php echo(_('keine')); ?></option></select></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_username" id="column_RevisionEmail_Doc_username">
		<!-- Feld "IMAP-Username": RevisionEmail_Doc_username -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_username"><?php echo(_('IMAP-Username')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="RevisionEmail_Doc_username"  value="<?php echo htmlentities($data['RevisionEmail_Doc_username']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_password" id="column_RevisionEmail_Doc_password">
		<!-- Feld "IMAP-Password": RevisionEmail_Doc_password -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_password"><?php echo(_('IMAP-Password')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input" type="password" name="RevisionEmail_Doc_password"  id="RevisionEmail_Doc_password" value="<?php echo htmlentities($data['RevisionEmail_Doc_password']); ?>"/><label class="mdl-textfield__label" for="RevisionEmail_Doc_password"><?php echo(_('password')); ?></label><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_syncdate" id="column_RevisionEmail_Doc_syncdate">
		<!-- Feld "IMAP-Synchronisationsdatum": RevisionEmail_Doc_syncdate -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_syncdate"><?php echo(_('IMAP-Synchronisationsdatum')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	" ts-locale='<?php echo (\FOP\I18n::getShortLocale()); ?>' ts-format='<?php echo (_('dateformat_moment')); ?>' class="mdl-textfield__input picker_date" id="RevisionEmail_Doc_syncdate" type="text" name="RevisionEmail_Doc_syncdate" value="<?php echo ($data['RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($data['RevisionEmail_Doc_syncdate'])) : ''; ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['DMS']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || (!isset($_POST['cancel'])) || true || true || true || true || true || true || true || true || true || true || true || true || (!isset($_POST['cancel'])) || true || true || true || true || true || true || true || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['Stammdaten']);
										?><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_logo" id="column_Configuration_Stammdaten_logo">
		<!-- Feld "Firmenlogo": Configuration_Stammdaten_logo -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_logo"><?php echo(_('Firmenlogo')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		

	
		<div>

<?php
       $maxupload =  \FOP\Util::convertIniBytes(ini_get('upload_max_filesize'));

?>
<div class="fop-file-upload dropzone dropzone-image" id="zone<?php echo htmlentities(\FOP\Files::getNextDummyCounter($data['Configuration_Stammdaten_logo'])); ?>"
<?php if ($data['Configuration_Stammdaten_logo']) {
						$fileInfo = \FOP\Database::query('SELECT filename AS name, size FROM fop_files WHERE '.qi('ID').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_logo']))->fetch(\PDO::FETCH_ASSOC);
						$fileInfo['accepted'] = true;
						echo ' data-fileinfo="' . htmlentities(json_encode($fileInfo)) . '"';
}
					?>>
  <div class="dz-message"><?php echo(_('dropfiles')); ?></div>
  <input type="hidden" class="fileinput" name="Configuration_Stammdaten_logo" value="<?php echo htmlentities(\FOP\Files::getLastDummyCounter($data['Configuration_Stammdaten_logo'])); ?>">
</div>

	<?php if ((\FOP\User::getDokument())) { ?>
	<div class="fop-file-upload dms-picker" onclick='var zone = $(this).parent(), id = "x"+Math.round(1000000*Math.random());
		zone.attr("id", id);
		zone[0].dataset.callback = id;
		window[id] = function (docid, title) {
			$.get("Tables/Doc/getFile?id=" + encodeURIComponent(docid)).then(function (file_id) {
				// file_id, title
				
					zone.find(".fileinput").val(file_id);
					zone.find(".fop-file-upload").hide();
					zone.append($("<div class=\"picker-remove\"></div>").text(title));
					zone.append($("<div class=\"picker-remove\" style=\"cursor: pointer;\"><i class=\"material-icons\">delete</i></div>").click(function () {
						// remove-Button -> val(0)
						zone.find(".fileinput").val(0);
						zone.find(".fop-file-upload").show();
						zone.find(".picker-remove").remove();
					}));
				
			});
		};
		window.open_over(<?php
		echo json_encode(\TablesRouter\Doc::indexURL2([
			'popup' => true]
		)); ?> + "&from=<?php echo urlencode(\FOP\Util::getCurrentBaseurl()); ?>jscloser.php?action=popup%26type=doc%26colinsert=Configuration_Stammdaten_logo%26el=" + encodeURIComponent(id) + "%26insert_param=colvalue&select=doc", "_blank", "width=739, height=395"); return false;'>
		<i class="material-icons">search</i> <?php echo(_('Dokumente')); ?>
	</div><?php } ?>
	

<script>
	Dropzone.autoDiscover = false;
   $(function (){
	   $('.dropzone-image').each(function(){
			var dropzoneElement = this;
		   if ($(this).attr('data-dropzone-attached')) return;
		   $(this).attr('data-dropzone-attached', true);

		   let dummycounter = $(dropzoneElement).find('input').val();
		   let zone = this;

		   $(this).dropzone({
				maxFiles: 1,
				addRemoveLinks: true,
				paramName: 'file_' + dummycounter,
				url: 'FOP/Files/upload?x=' + dummycounter,
				maxFilesize: <?php echo \FOP\Util::convertIniBytes(ini_get('upload_max_filesize')); ?> / 1000 / 1000,
				timeout: 30*60*1000,acceptedFiles: 'image/*',

				dictDefaultMessage: '<?php echo(addslashes(_('dropfiles'))) ?>',
				dictFallbackMessage: '<?php echo(addslashes(_('dropfiles_notpossible'))) ?>',
				dictFileTooBig: '<?php echo(addslashes(_('dropfiles_toobig'))) ?>',
				dictInvalidFileType: '<?php echo(addslashes(_('dropfiles_invalidtype'))) ?>',
				dictResponseError: '<?php echo(addslashes(_('dropfiles_responseerror'))) ?>',
				dictCancelUpload: '<?php echo(addslashes(_('dropfiles_cancelupload'))) ?>',
				dictUploadCanceled: '<?php echo(addslashes(_('dropfiles_uploadcanceled'))) ?>',
				dictCancelUploadConfirmation: '<?php echo(addslashes(_('dropfiles_cancelupload_confirmation'))) ?>',
				dictRemoveFile: '<?php echo(addslashes(_('dropfiles_removefile'))) ?>',
				dictRemoveFileConfirmation: '<?php echo(addslashes(_('dropfiles_removefile_confirmation'))) ?>',

				init: function(){
					let prevfile = null;
					let self = this;

					// Datei anzeigen, die schon hochgeladen wurde
					if (dropzoneElement.dataset['fileinfo']) {
						let f = JSON.parse(dropzoneElement.dataset['fileinfo']);
						self.files.push(f);
						self.emit('addedfile', f);
						self.emit('complete', f);
						prevfile = f;
					}

					/* keep track of uploads */
					this.on('sending', function () {
						window.running_uploads = (window.running_uploads || 0) + 1;
					});
					this.on('complete', function () {
						window.running_uploads = (window.running_uploads || 0) - 1;
					});
					
					
						this.on('addedfile', function() {
							if (prevfile) self.removeFile(prevfile);
						});

						this.on('success', function(file, file_id) {
							prevfile = file;
							file.file_id = file_id;
							$(zone).find('.fileinput').val(file_id);
						});

						this.on('removedfile', function(file) {
							$(zone).find('.fileinput').val('0');
						});
					
				}
		   });
	   });
    });
				</script>
		</div>
		
	</div>
	</div><?php } ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_headerText" id="column_Configuration_Stammdaten_headerText">
		<!-- Feld "Text unter dem Header": Configuration_Stammdaten_headerText -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_headerText"><?php echo(_('Text unter dem Header')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<div tinymce-locale="<?php echo \FOP\I18n::getShortLocale(); ?>">
	
	<textarea ng-non-bindable rows="22" cols="50" name="Configuration_Stammdaten_headerText" class="html-html"><?php echo htmlentities($data['Configuration_Stammdaten_headerText']); ?></textarea>
	</div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_firmenname" id="column_Configuration_Stammdaten_firmenname">
		<!-- Feld "Firmenname": Configuration_Stammdaten_firmenname -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_firmenname"><?php echo(_('Firmenname')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_firmenname"  value="<?php echo htmlentities($data['Configuration_Stammdaten_firmenname']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_firmenname2" id="column_Configuration_Stammdaten_firmenname2">
		<!-- Feld "Firmenname Zusatz": Configuration_Stammdaten_firmenname2 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_firmenname2"><?php echo(_('Firmenname Zusatz')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_firmenname2"  value="<?php echo htmlentities($data['Configuration_Stammdaten_firmenname2']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_strasse" id="column_Configuration_Stammdaten_strasse">
		<!-- Feld "Straße Nr.": Configuration_Stammdaten_strasse -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_strasse"><?php echo(_('Straße Nr.')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_strasse"  value="<?php echo htmlentities($data['Configuration_Stammdaten_strasse']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_flst" id="column_Configuration_Stammdaten_flst">
		<!-- Feld "Flurstück": Configuration_Stammdaten_flst -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_flst"><?php echo(_('Flurstück')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_flst"  value="<?php echo htmlentities($data['Configuration_Stammdaten_flst']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_plz" id="column_Configuration_Stammdaten_plz">
		<!-- Feld "PLZ": Configuration_Stammdaten_plz -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_plz"><?php echo(_('PLZ')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_plz" list='list_plz' value="<?php echo htmlentities($data['Configuration_Stammdaten_plz']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
			<datalist id='list_plz'>
				<?php
					$q = \FOP\Database::query('SELECT '.qi('PLZ').'.'.qi('PLZ').' AS value, CONCAT('.qi('PLZ').'.'.qi('PLZ').', \' - \', '.qi('PLZ').'.'.qi('Ort').') AS '.qi('desc').' FROM '.qi('PLZ').' WHERE TRUE');
					while ($v = $q->fetch(\PDO::FETCH_ASSOC)) {
						echo '<option value="'.htmlentities($v['value']).'" label="'.htmlentities($v['desc']).'">';
					}
				?>
			</datalist>
		
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_ort" id="column_Configuration_Stammdaten_ort">
		<!-- Feld "Ort": Configuration_Stammdaten_ort -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_ort"><?php echo(_('Ort')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_ort"  value="<?php echo htmlentities($data['Configuration_Stammdaten_ort']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_telefon" id="column_Configuration_Stammdaten_telefon">
		<!-- Feld "Telefon": Configuration_Stammdaten_telefon -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_telefon"><?php echo(_('Telefon')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input" type="text"  name="Configuration_Stammdaten_telefon" value="<?php echo htmlentities($data['Configuration_Stammdaten_telefon']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_mobil" id="column_Configuration_Stammdaten_mobil">
		<!-- Feld "Mobil": Configuration_Stammdaten_mobil -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_mobil"><?php echo(_('Mobil')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input" type="text"  name="Configuration_Stammdaten_mobil" value="<?php echo htmlentities($data['Configuration_Stammdaten_mobil']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_fax" id="column_Configuration_Stammdaten_fax">
		<!-- Feld "Fax": Configuration_Stammdaten_fax -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_fax"><?php echo(_('Fax')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input" type="text"  name="Configuration_Stammdaten_fax" value="<?php echo htmlentities($data['Configuration_Stammdaten_fax']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_email" id="column_Configuration_Stammdaten_email">
		<!-- Feld "E-Mail": Configuration_Stammdaten_email -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_email"><?php echo(_('E-Mail')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input" type="email" name="Configuration_Stammdaten_email"  id="Configuration_Stammdaten_email" value="<?php echo htmlentities($data['Configuration_Stammdaten_email']); ?>"/><label class="mdl-textfield__label" for="Configuration_Stammdaten_email"><?php echo(_('email')); ?></label>  <span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_website" id="column_Configuration_Stammdaten_website">
		<!-- Feld "Homepage": Configuration_Stammdaten_website -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_website"><?php echo(_('Homepage')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_website" id="Configuration_Stammdaten_website" value="<?php echo htmlentities($data['Configuration_Stammdaten_website']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div><?php if ((!isset($_POST['cancel']))) { ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_iban" id="column_Configuration_Stammdaten_iban">
		<!-- Feld "IBAN": Configuration_Stammdaten_iban -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_iban"><?php echo(_('IBAN')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	" style="text-transform: uppercase;" class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_iban" pattern="[A-Z]{2}[0-9 \-]{12,26}" value="<?php echo htmlentities($data['Configuration_Stammdaten_iban']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div><?php } ?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_bic" id="column_Configuration_Stammdaten_bic">
		<!-- Feld "BIC/Swift": Configuration_Stammdaten_bic -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_bic"><?php echo(_('BIC/Swift')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_bic"  value="<?php echo htmlentities($data['Configuration_Stammdaten_bic']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_bankname" id="column_Configuration_Stammdaten_bankname">
		<!-- Feld "Name der Bank": Configuration_Stammdaten_bankname -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_bankname"><?php echo(_('Name der Bank')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_bankname"  value="<?php echo htmlentities($data['Configuration_Stammdaten_bankname']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_geschaeftsfuehrer1" id="column_Configuration_Stammdaten_geschaeftsfuehrer1">
		<!-- Feld "1. Geschäftsführer": Configuration_Stammdaten_geschaeftsfuehrer1 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_geschaeftsfuehrer1"><?php echo(_('1. Geschäftsführer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_geschaeftsfuehrer1"  value="<?php echo htmlentities($data['Configuration_Stammdaten_geschaeftsfuehrer1']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_geschaeftsfuehrer2" id="column_Configuration_Stammdaten_geschaeftsfuehrer2">
		<!-- Feld "2. Geschäftsführer": Configuration_Stammdaten_geschaeftsfuehrer2 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_geschaeftsfuehrer2"><?php echo(_('2. Geschäftsführer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_geschaeftsfuehrer2"  value="<?php echo htmlentities($data['Configuration_Stammdaten_geschaeftsfuehrer2']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_registergericht" id="column_Configuration_Stammdaten_registergericht">
		<!-- Feld "Registergericht": Configuration_Stammdaten_registergericht -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_registergericht"><?php echo(_('Registergericht')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_registergericht"  value="<?php echo htmlentities($data['Configuration_Stammdaten_registergericht']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_handelsregisternummer" id="column_Configuration_Stammdaten_handelsregisternummer">
		<!-- Feld "Handelsregisternummer": Configuration_Stammdaten_handelsregisternummer -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_handelsregisternummer"><?php echo(_('Handelsregisternummer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_handelsregisternummer"  value="<?php echo htmlentities($data['Configuration_Stammdaten_handelsregisternummer']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_finanzamt" id="column_Configuration_Stammdaten_finanzamt">
		<!-- Feld "Finanzamt": Configuration_Stammdaten_finanzamt -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_finanzamt"><?php echo(_('Finanzamt')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_finanzamt"  value="<?php echo htmlentities($data['Configuration_Stammdaten_finanzamt']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_steuernr" id="column_Configuration_Stammdaten_steuernr">
		<!-- Feld "Steuernr.": Configuration_Stammdaten_steuernr -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_steuernr"><?php echo(_('Steuernr.')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_steuernr"  value="<?php echo htmlentities($data['Configuration_Stammdaten_steuernr']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_umsatzsteuerid" id="column_Configuration_Stammdaten_umsatzsteuerid">
		<!-- Feld "Umsatzsteuer-ID": Configuration_Stammdaten_umsatzsteuerid -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_umsatzsteuerid"><?php echo(_('Umsatzsteuer-ID')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div class="mdl-textfield mdl-js-textfield"><input onkeydown="
		if (event.keyCode == 13) {
			event.preventDefault();
			event.stopPropagation();
			tabNext(this);
			return false;
		}
	"  class="mdl-textfield__input"  type="text" name="Configuration_Stammdaten_umsatzsteuerid"  value="<?php echo htmlentities($data['Configuration_Stammdaten_umsatzsteuerid']); ?>"/><span class="mdl-textfield__error"><div><?php echo(_('invalidinput')) ?></div></span></div>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['Stammdaten']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										$(function(){
											// bei Änderungen: prüfen, ob Form geändert wurde
											var formData = $('#cardform-wf_userconfig_edit').serialize();
											document.body.onbeforeunload = function () {
												if (formData != $('#cardform-wf_userconfig_edit').serialize()) {
													return 'Form data has changed - are you sure??';
												}
											};
											$('#cardform-wf_userconfig_edit').on('submit', function () {
												document.body.onbeforeunload = undefined;
											});
											<?php if ($upbar_collapsed) {
												?>$('#fop-bar-mainbutton').click();<?php
											} ?>
											$('#fop-bar-mainbutton').click(function () {
												setTimeout(function () {
													setCFF('upbar', 'collapsed', $('#fop-bar-container').is(':visible') ? 0 : 1);
												}, 440); /* perfect timing for fadeOut */
											});
										});
										
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3Auserconfig%3Aedit&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3Auserconfig%3Aedit&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_userconfig_edit')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_userconfig_edit input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function viewAction($id = null ) { 
    
    
    // --- BLOCK: 0_CSRFValidate ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') \FOP\Session::validateCSRFToken(); else \FOP\Session::getCSRFToken();

    // --- BLOCK: 0_CSRF_ensure ---
    
	\FOP\Session::getCSRFToken();
    // --- BLOCK: access ---
    if(!(!\FOP\User::getIsGuest())) throw new \FOP\AccessDeniedException();
    // --- BLOCK: access+validators ---
    
	if ($_SERVER['REQUEST_METHOD'] === 'POST') {
		
		/* Validatoren */
		
		

		
		/* Sanitizer */

		

		
	}
	
    // --- BLOCK: fetch ---
    
	\FOP\I18n::ensureIsLoaded();
	$row = self::view($id);

    // --- BLOCK: main ---
    
		// Main block
	
    // --- BLOCK: main-1 ---
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
		if (!isset($_POST['ok'])) {
			\FOP\Database::beginTransaction();
    // --- BLOCK: main-2:save-clone-prepare ---
    
		$data = self::view($id);
	
    // --- BLOCK: main-2:save-main ---
    /* view */
    // --- BLOCK: main-3 ---
    
			\FOP\Database::commitTransaction();
			
		}
		
		if (isset($_POST['ok'])) {
			
			
			if (isset($_POST['fop-from']) && $_POST['fop-from']) {
				// Redirect zu fop-from
				header('Location: ' . (isset($id) && is_string($id) ? preg_replace('/&insert_param=(.*)$/', '&$1=' . ($id instanceof \FOP\IDList ? $id->toString() : $id), $_POST['fop-from']) : $_POST['fop-from']));
			} else {
				if ($to = (isset($_GET['popup']) ? \FOP\Util::getCurrentBaseurl().'jscloser.php?action=popup' : \FOP\Session::getPayload('dv-userconfig')['from'] ?? null)) {
					header('Location: ' . $to);
					die();
				}
				if (!\TablesRouter\Userconfig::indexAccess()) {
					if (!\FOPRouter\Index::indexAccess()) {
						header('Location: ' . \FOPRouter\Index::indexURL2(['popup' => $_GET['popup'] ?? null]));
						die();
					}
					header('Location: ' . \FOPRouter\Index::indexURL2(['popup' => $_GET['popup'] ?? null]));
					die();
				}
				header('Location: ' . \TablesRouter\Userconfig::indexURL2(['popup' => $_GET['popup'] ?? null]));
			}
			die();
	
		}
		die(json_encode($_POST));
	} else {
    // --- BLOCK: main-4:load-main ---
    
		$data = self::view($id); // TODO: klären, wer die Funktion bereitstellt (momentan crud/view.fop)
	
    // --- BLOCK: main-5 ---
    ?><?php
			header('Content-Type: text/html; charset=UTF-8');
			header('X-XSS-Protection: 1; mode=block');
			header('Strict-Transport-Security: max-age=63072000');
			header('X-Content-Type-Options: nosniff');
			header("Content-Security-Policy: default-src *  data: blob: 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';");


		?><!DOCTYPE html><html><head><title><?php echo(_('view')); ?></title><base href='<?php echo \FOP\Util::getCurrentBaseurl(); ?>'><meta name="google" content="notranslate"><meta http-equiv="Content-Language" content="<?php echo htmlentities(\FOP\I18n::getLocale()); ?>"><meta charset="utf-8"><link rel="stylesheet" type="text/css" href="style_dependencies.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><link rel="stylesheet" type="text/css" href="style.css?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"><script type="text/javascript" src="js/script_dependencies.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="mobile-web-app-capable" content="yes"><link rel="manifest" href="manifest.webmanifest"><script type="text/javascript">moment.locale('<?php echo(\FOP\I18n::getShortLocale()); ?>');</script><script type="text/javascript" src="js/form.js"></script><script type="text/javascript">window.globals = <?php
	echo json_encode(['user:superadmin' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSuperadmin(), 'user:mitglied' => /* TODO: resanitizer später mal */(integer) \FOP\User::getMitglied(), 'user:gruppe' => /* TODO: resanitizer später mal */(integer) \FOP\User::getGruppe(), 'user:campaign' => /* TODO: resanitizer später mal */(integer) \FOP\User::getCampaign(), 'user:sammlung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getSammlung(), 'user:protokoll' => /* TODO: resanitizer später mal */(integer) \FOP\User::getProtokoll(), 'user:ID' => /* TODO: resanitizer später mal */(integer) \FOP\User::getID(), 'user:buchhaltung' => /* TODO: resanitizer später mal */(integer) \FOP\User::getBuchhaltung()]);
?>;</script><script type="text/javascript" src="angular/<?php echo(\FOP\I18n::getShortLocale()); ?>/js/alltypes.js?v=<?php echo(\FOP\Util::getVersionAppendix()); ?>"></script><script type="text/javascript" src="angular/angular-i18n/angular-locale_<?php echo \FOP\I18n::getAngularLocale(); ?>.js"></script><script type="text/javascript" src="js/date-filter.js"></script><script type="text/javascript" src="js/dropdown.js"></script><script type="text/javascript" src="js/numeric.js"></script><script type="text/javascript" src="js/getparam.js"></script><script type="text/javascript" src="js/tables.js"></script>
		<script type="text/javascript" src="js/parsehash.js"></script><script type="text/javascript">
		window.query = <?php echo json_encode($_GET, JSON_FORCE_OBJECT); ?>;
		window.baseurl = <?php echo json_encode(\FOP\Util::getCurrentBaseurl()); ?>;

		window.i18n_weiter = <?php echo json_encode(_('Weiter'));?>;
		//Filter I18n:
		window.i18n_quartal = <?php echo json_encode(_('Quarter'));?>;
		window.i18n_alle = <?php echo json_encode(_('All'));?>;
		window.i18n_leere = <?php echo json_encode(_('Empty'));?>;
		window.i18n_tag = <?php echo json_encode(_('Tag'));?>;
		window.i18n_woche = <?php echo json_encode(_('Woche'));?>;
		window.i18n_zeitraum = <?php echo json_encode(_('Period'));?>;
		window.i18n_monat = <?php echo json_encode(_('Monat'));?>;
		window.i18n_jahr = <?php echo json_encode(_('Jahr'));?>;
		window.i18n_von = <?php echo json_encode(_('filters_from'));?>;
		window.i18n_bis = <?php echo json_encode(_('filters_to'));?>;
		window.i18n_tabButton = <?php echo json_encode(_('open_in_new_tab'));?>;
		window.i18n_closeButton = <?php echo json_encode(_('close'));?>;
		</script></head><script type="text/javascript">const fopPushPublicKey = '<?php echo(addslashes(\FOP\Configuration::getFOPPushPublicKey())); ?>';
        const fopUserID = <?php echo(intval(\FOP\User::getID())); ?>;
        var fopPushDisabled = false;
    </script><script type="text/javascript" src="js/serviceworkersetup.js"></script><body ng-app='app'>
		<div class='mdl-js-snackbar mdl-snackbar' id='snackbar'>
			<div class='mdl-snackbar__text'></div>
			<button class='mdl-snackbar__action' type='button'></button>
		</div>
		<script>
			var snackbar = document.querySelector('#snackbar');
			componentHandler.upgradeElement(snackbar, 'MaterialSnackbar');
			$(function () {
				setTimeout(function () {
					$('.fop-layout').scrollTop(0);
				}, 0);
			});
		</script>

		<?php if (isset($_GET['popup'])) { ?>
		<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<?php
	if ($dv = \FOP\Session::getPayload('dv-userconfig')) { ?>
	<?php if (isset($dv['prev'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['prev'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_left</i>
	</a><?php } ?>
	<a href="<?php echo htmlentities($dv['from']); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">view_list</i>
	</a>
	<?php if (isset($dv['next'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['next'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_right</i>
	</a><?php } ?><?php } ?><span class="mdl-layout-title"><?php echo(_('view')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      	</header>
			<style>
				.content {
					margin-top: 0px !important;
				}
			</style>
			<div id='content' class='popup' >
		<?php } else { ?>
			<div class="fop-layout mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
			<header class="fop-header mdl-layout__header mdl-layout__header mdl-layout__header--scroll">
				<div class="mdl-layout__header-row">
					<?php
	if ($dv = \FOP\Session::getPayload('dv-userconfig')) { ?>
	<?php if (isset($dv['prev'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['prev'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_left</i>
	</a><?php } ?>
	<a href="<?php echo htmlentities($dv['from']); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">view_list</i>
	</a>
	<?php if (isset($dv['next'])) {?><a href="<?php echo htmlentities(str_replace('XXX', urlencode($id), $dv['next'])); ?>" class="mdl-button mdl-js-button mdl-button--icon">
		<i class="material-icons">keyboard_arrow_right</i>
	</a><?php } ?><?php } ?><span class="mdl-layout-title"><?php echo(_('view')); ?></span><div class="mdl-layout-spacer"></div><span class="noprint mdl-layout-title mdl-layout--large-screen-only"><div class="mdl-textfield mdl-js-textfield"><input id="supersearch" accesskey="f" class="mdl-textfield__input" type="text" onkeydown="if (event.keyCode == 13 && this.value) window.location.href = 'FOP/Index/searchURL?q=' + encodeURIComponent(this.value) + '&from=<?php echo htmlentities(urlencode(\FOP\Util::getBackUrl())); ?>';" value="<?php echo htmlentities($_GET['q'] ?? ''); ?>" style="border-bottom: 1px solid white;"/><label class="mdl-textfield__label" style="color: inherit"><?php echo(_('search')); ?> - <?php
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
			// MAC: Control+ davor
			echo 'Control + ';
		}
		if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
			// Firefox
			if (strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false) {
				// MAC: Control + Alt + key
				echo 'Alt + F';
			} else {
				echo 'Alt + Shift + F';
			}
		} else {
			// Internet Explorer, Chrome, Safari, Opera
			echo 'Alt + F';
		}
	?></label></div></span><i onclick='addFav(null)' class='material-icons fop-favorites' id='favorites_button'>star_border</i>
				</div>
      		</header>


				<?php  \EasyEditor\Navigation::render(); ?>
      
				<main class="mdl-layout__content" id="content">
					<div class="fop-content">
						<?php } ?>
						
							<div class="content" id="1">
								

								<form
									
									action="<?php echo \TablesRouter\Userconfig::viewURL2(['popup' => $_GET['popup'] ?? null, 'id' => $id]); ?>"
									method="post"
									enctype="multipart/form-data" ng-submit='submit($event)'
									onsubmit="
										if (window.running_uploads) {
											event.preventDefault();
											alert('<?php echo htmlentities(json_encode(_('fileUploadStillActive')));?>');
										}
									"
								 
								id="cardform-wf_userconfig_view"
								style="width: 100%; height: 100%;"
								class='mdl-grid'
									ng-controller="FormWf_userconfig_view" ng-init="form = <?php echo htmlentities(json_encode([]));
									?>;"
								>
								<?php
								 echo '<input type="hidden" name="csrftoken" value="' . htmlentities(\FOP\Session::getCSRFToken()) . '">';
								 if (isset($_GET['from'])) echo '<input type="hidden" name="fop-from" value="' . htmlentities($_GET['from']) . '">';
								 ?>
								<div id='fop-upbar'></div>
								
									<?php
									$features = [];
									if (true && (true)) {
									$feature = [
										'id' => 'buttons',
										'title' => _('Aktionen'),
										'order' => '300', // 300 (50)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => null
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true)) {
									$feature = [
										'id' => 'Stammdaten',
										'title' => _('Stammdaten'),
										'order' => '200-Stammdaten', // 200-Stammdaten (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true)) {
									$feature = [
										'id' => 'KI',
										'title' => _('KI'),
										'order' => '200-KI', // 200-KI (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || false || false || false || false || false || false || false || false || false || true || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false)) {
									$feature = [
										'id' => 'main',
										'title' => _('Daten'),
										'order' => '100', // 100 (20)
										'mode' => 'area', // 
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. (true ? 'true' : '0')
											 .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0' .'||'. '0'
									];
									$features[$feature['id']] = $feature;
									}
									
									if (true && (false || true || true || true || true || true || true || true)) {
									$feature = [
										'id' => 'DMS',
										'title' => _('DMS'),
										'order' => '200-DMS', // 200-DMS (80)
										'mode' => 'tab', // tab (100)
										'position' => 'full', // 
										'collapsed' => 0, // 
										'canEdit' => !\FOP\User::getIsGuest(),
										'visibility' => '0' .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											 .'||'. (true ? 'true' : '0')
											
									];
									$features[$feature['id']] = $feature;
									}
									

									
									/* load order from database
										schema: fop_form_feature(user, form, subid, key, value)
										key = (order, mode, position, collapsed)
									*/
									$upbar_collapsed = false;
									// default values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', (SELECT '.qi('value').' FROM fop_form_feature b WHERE a.subid = b.subid AND a.'.qi('key').' = b.'.qi('key').' AND '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY '.qi('value').' ORDER BY COUNT(*) DESC LIMIT 1) AS '.qi('value').' FROM fop_form_feature a WHERE '.qi('user').' = '.intval(\FOP\User::getID()).' GROUP BY subid, '.qi('key'))->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										}
									}
									// form specific special values
									foreach (\FOP\Database::query('SELECT subid, '.qi('key').', '.qi('value').' FROM fop_form_feature a WHERE form = \'wf:userconfig:view\' AND '.qi('user').' = '.intval(\FOP\User::getID()).'')->fetchAll(\PDO::FETCH_ASSOC) AS $setting) {
										if (isset($features[$setting['subid']])) {
											$features[$setting['subid']][$setting['key']] = $setting['value'];
										} else if ($setting['subid'] == 'upbar' && $setting['key'] == 'collapsed') {
											$upbar_collapsed = (bool) $setting['value'];
										}
									}

									/* fill in the content of the features */
									if (true && (true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['buttons']);
										?><div id='wf_userconfig_view_buttons' class='mdl-cell mdl-cell--12-col' style='flex-wrap: wrap;'>
		<?php if (true && $data['operation::view'] == 1 && $data['operation::edit'] == 1 && ((\FOP\User::getAdmin())) && ((\FOP\User::getAdmin()))) { ?><a title="<?php echo(_('editbtn')); ?>" class="detailbtn mdl-button mdl-js-button mdl-button--raised mdl-button--colored" href="<?php echo htmlentities(\TablesRouter\Userconfig::editURL2(['id' => $data['ID'], 'popup' => $_GET['popup'] ?? null])); ?>"><i class='material-icons'>mode_edit</i> <?php echo(_('editbtn')); ?></a><?php } ?>&nbsp;<?php if (true) { ?><button onclick="$(this).closest('form').find('.mdl-textfield__error:visible').hide();
		$('[required]').removeAttr('required');
	" type="submit" name="ok" class="mdl-button mdl-js-button mdl-button--colored mdl-button--raised" ><i class="material-icons">check</i><?php echo(_('ok')); ?></button><?php } ?>
									&nbsp;
		<?php if ($data['operation::delete'] == 1 && $data['operation::delete'] == 1 && ((false))) { ?><a title="<?php echo(_('deletebtn')); ?>" class="detailbtn mdl-button mdl-js-button mdl-button--raised mdl-button--colored" href="<?php echo htmlentities(\TablesRouter\Userconfig::deleteConfirmURL2(['id' => $data['ID'], 'popup' => $_GET['popup'] ?? null, 'from' => $_GET['from'] ?? \FOP\Session::getPayload('dv-userconfig')['from'] ?? null])); ?>"><i class='material-icons'>delete</i> <?php echo(_('deletebtn')); ?></a><?php } ?></div><script type='text/javascript'>
		// copy all buttons to #fop-upbar
		$(function () {
    var btn = document.getElementById("fop-bar-mainbutton");
    var upbar = $('#fop-upbar');
    var upbar_buttons = document.getElementById("fop-bar-container");

    // Check if the elements already exist
    if (!btn || !upbar_buttons) {
        if (!btn) {
            btn = $('<div id="fop-bar-mainbutton" class="mdl-button fop-button-half fop-button-margin mdl-button--raised"><i class="material-icons">keyboard_arrow_right</i></div>')
                .click(function () {
                    if (btn.find('i').text() == 'keyboard_arrow_right') {
                        upbar_buttons.fadeOut(400);
                        btn.find('i').text('keyboard_arrow_left');
                    } else {
                        upbar_buttons.fadeIn(400);
                        btn.find('i').text('keyboard_arrow_right');
                    }
                });
            upbar.append(btn);
        }

        if (!upbar_buttons) {
            upbar_buttons = $('<div id="fop-bar-container" style="max-width: 290px"></div>'); //dependant on the mdl-buttons width, caps of upbar buttons at exactly 4 buttons
            upbar.append(upbar_buttons);
        }

        var buttons = $('#wf_userconfig_view_buttons').find('.mdl-button');
        buttons.each(function (i, v) {
            var button = $(v);
            var newbutton = $('<div></div>');
            newbutton.attr('class', button.attr('class'));
            newbutton.attr('title', button.attr('title'));
            newbutton.append(button.find('.material-icons').clone(false));
            newbutton.click(function () {
                button[0].click();
            });
            upbar_buttons.append(newbutton);
        });
    }
});

	</script><?php
										\EasyEditor\FormFeature::pop();
										$features['buttons']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['Stammdaten']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_logo" id="column_Configuration_Stammdaten_logo">
		<!-- Feld "Firmenlogo": Configuration_Stammdaten_logo -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_logo"><?php echo(_('Firmenlogo')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<?php if ($data['Configuration_Stammdaten_logo']) { ?><a href='fop-files/<?php echo urlencode(htmlentities($data['Configuration_Stammdaten_logo'])); ?>/x' target='_blank'><img style='max-width: 100%; max-height: 250px;' src='fop-files/<?php echo urlencode(htmlentities($data['Configuration_Stammdaten_logo'])); ?>/x'></a><?php } else { ?>-<?php } ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_headerText" id="column_Configuration_Stammdaten_headerText">
		<!-- Feld "Text unter dem Header": Configuration_Stammdaten_headerText -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_headerText"><?php echo(_('Text unter dem Header')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
<div ng-non-bindable class='fop-textarea' >
<?php echo \FOP\Util::SanitizeUserHtml($data['Configuration_Stammdaten_headerText']); ?>
</div>

	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_firmenname" id="column_Configuration_Stammdaten_firmenname">
		<!-- Feld "Firmenname": Configuration_Stammdaten_firmenname -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_firmenname"><?php echo(_('Firmenname')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_firmenname']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_firmenname2" id="column_Configuration_Stammdaten_firmenname2">
		<!-- Feld "Firmenname Zusatz": Configuration_Stammdaten_firmenname2 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_firmenname2"><?php echo(_('Firmenname Zusatz')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_firmenname2']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_strasse" id="column_Configuration_Stammdaten_strasse">
		<!-- Feld "Straße Nr.": Configuration_Stammdaten_strasse -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_strasse"><?php echo(_('Straße Nr.')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_strasse']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_flst" id="column_Configuration_Stammdaten_flst">
		<!-- Feld "Flurstück": Configuration_Stammdaten_flst -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_flst"><?php echo(_('Flurstück')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_flst']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_plz" id="column_Configuration_Stammdaten_plz">
		<!-- Feld "PLZ": Configuration_Stammdaten_plz -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_plz"><?php echo(_('PLZ')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_plz']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_ort" id="column_Configuration_Stammdaten_ort">
		<!-- Feld "Ort": Configuration_Stammdaten_ort -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_ort"><?php echo(_('Ort')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_ort']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_telefon" id="column_Configuration_Stammdaten_telefon">
		<!-- Feld "Telefon": Configuration_Stammdaten_telefon -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_telefon"><?php echo(_('Telefon')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<a target='tel' href="tel:<?php echo htmlentities(($data['Configuration_Stammdaten_telefon'])); ?>" onclick="event.stopPropagation(); "><?php echo htmlentities(\FOP\Sanitizers::no_phone($data['Configuration_Stammdaten_telefon'])); ?></a>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_mobil" id="column_Configuration_Stammdaten_mobil">
		<!-- Feld "Mobil": Configuration_Stammdaten_mobil -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_mobil"><?php echo(_('Mobil')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<a target='tel' href="tel:<?php echo htmlentities(($data['Configuration_Stammdaten_mobil'])); ?>" onclick="event.stopPropagation(); "><?php echo htmlentities(\FOP\Sanitizers::no_phone($data['Configuration_Stammdaten_mobil'])); ?></a>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_fax" id="column_Configuration_Stammdaten_fax">
		<!-- Feld "Fax": Configuration_Stammdaten_fax -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_fax"><?php echo(_('Fax')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<a target='tel' href="tel:<?php echo htmlentities(($data['Configuration_Stammdaten_fax'])); ?>" onclick="event.stopPropagation(); "><?php echo htmlentities(\FOP\Sanitizers::no_phone($data['Configuration_Stammdaten_fax'])); ?></a>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_email" id="column_Configuration_Stammdaten_email">
		<!-- Feld "E-Mail": Configuration_Stammdaten_email -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_email"><?php echo(_('E-Mail')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span class='overflow-text'><a onclick="event.stopPropagation();<?php if ((!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest()) && (!\FOP\User::getIsGuest())) { ?>event.preventDefault(); window.open_over(document.baseURI + 'Tables/Fop_mail_host_box_draft/create?to=' + encodeURIComponent(this.href.substr(7)) + '&popup&from=' + encodeURIComponent(document.baseURI + 'jscloser.php?action=popup&close')); <?php } ?>
" href="<?php echo ('mailto:' . htmlentities(($data['Configuration_Stammdaten_email']))); ?>"><?php echo htmlentities($data['Configuration_Stammdaten_email']); ?></a></span>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_website" id="column_Configuration_Stammdaten_website">
		<!-- Feld "Homepage": Configuration_Stammdaten_website -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_website"><?php echo(_('Homepage')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<a target="_blank" onclick="event.stopPropagation();" href="<?php if(!preg_match('/^https:\/\/|http:\/\/*/', $data['Configuration_Stammdaten_website'])) { echo "http://"; }?><?php echo htmlentities($data['Configuration_Stammdaten_website']);?>"><?php echo htmlentities($data['Configuration_Stammdaten_website']);?></a>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_iban" id="column_Configuration_Stammdaten_iban">
		<!-- Feld "IBAN": Configuration_Stammdaten_iban -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_iban"><?php echo(_('IBAN')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_iban']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_bic" id="column_Configuration_Stammdaten_bic">
		<!-- Feld "BIC/Swift": Configuration_Stammdaten_bic -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_bic"><?php echo(_('BIC/Swift')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_bic']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_bankname" id="column_Configuration_Stammdaten_bankname">
		<!-- Feld "Name der Bank": Configuration_Stammdaten_bankname -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_bankname"><?php echo(_('Name der Bank')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_bankname']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_geschaeftsfuehrer1" id="column_Configuration_Stammdaten_geschaeftsfuehrer1">
		<!-- Feld "1. Geschäftsführer": Configuration_Stammdaten_geschaeftsfuehrer1 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_geschaeftsfuehrer1"><?php echo(_('1. Geschäftsführer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_geschaeftsfuehrer1']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_geschaeftsfuehrer2" id="column_Configuration_Stammdaten_geschaeftsfuehrer2">
		<!-- Feld "2. Geschäftsführer": Configuration_Stammdaten_geschaeftsfuehrer2 -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_geschaeftsfuehrer2"><?php echo(_('2. Geschäftsführer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_geschaeftsfuehrer2']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_registergericht" id="column_Configuration_Stammdaten_registergericht">
		<!-- Feld "Registergericht": Configuration_Stammdaten_registergericht -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_registergericht"><?php echo(_('Registergericht')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_registergericht']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_handelsregisternummer" id="column_Configuration_Stammdaten_handelsregisternummer">
		<!-- Feld "Handelsregisternummer": Configuration_Stammdaten_handelsregisternummer -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_handelsregisternummer"><?php echo(_('Handelsregisternummer')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_handelsregisternummer']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_finanzamt" id="column_Configuration_Stammdaten_finanzamt">
		<!-- Feld "Finanzamt": Configuration_Stammdaten_finanzamt -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_finanzamt"><?php echo(_('Finanzamt')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_finanzamt']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_steuernr" id="column_Configuration_Stammdaten_steuernr">
		<!-- Feld "Steuernr.": Configuration_Stammdaten_steuernr -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_steuernr"><?php echo(_('Steuernr.')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_steuernr']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Configuration_Stammdaten_umsatzsteuerid" id="column_Configuration_Stammdaten_umsatzsteuerid">
		<!-- Feld "Umsatzsteuer-ID": Configuration_Stammdaten_umsatzsteuerid -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Configuration_Stammdaten_umsatzsteuerid"><?php echo(_('Umsatzsteuer-ID')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['Configuration_Stammdaten_umsatzsteuerid']); ?>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['Stammdaten']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['KI']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_AI_token" id="column_FOP_AI_token">
		<!-- Feld "Lizenzschlüssel für KI": FOP_AI_token -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_AI_token"><?php echo(_('Lizenzschlüssel für KI')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['FOP_AI_token']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_AI_precontext" id="column_FOP_AI_precontext">
		<!-- Feld "Vorwissen für die KI": FOP_AI_precontext -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_AI_precontext"><?php echo(_('Vorwissen für die KI')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<span><?php echo nl2br(htmlentities($data['FOP_AI_precontext'])); ?></span>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['KI']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || false || false || false || false || false || false || false || false || false || true || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false || false)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['main']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_FOP_Index_Impressum" id="column_FOP_Index_Impressum">
		<!-- Feld "Impressum-Text": FOP_Index_Impressum -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="FOP_Index_Impressum"><?php echo(_('Impressum-Text')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
<div ng-non-bindable class='fop-textarea' >
<?php echo \FOP\Util::SanitizeUserHtml($data['FOP_Index_Impressum']); ?>
</div>

	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['main']['html'] = ob_get_contents();
										ob_end_clean();
									}
									
									if (true && (false || true || true || true || true || true || true || true)) {
										ob_start();
										\EasyEditor\FormFeature::push($features['DMS']);
										?>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_Tables_Doc_defaultDoctype" id="column_Tables_Doc_defaultDoctype">
		<!-- Feld "Dokumenttyp Standardwert neue Dokumente": Tables_Doc_defaultDoctype -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="Tables_Doc_defaultDoctype"><?php echo(_('Dokumenttyp Standardwert neue Dokumente')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<?php
	
	$sql = 'SELECT '.qi('ID').' AS '.qi('ID').', '.qi('docType').'.'.qi('name').' AS description, (('.\FOP\Database::quote(\FOP\User::getDokument()).')) AS '.qi('canView').' FROM '.qi('docType').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($data['Tables_Doc_defaultDoctype']);
	$docType_result = \FOP\Database::query($sql);
	if ($docType_row = $docType_result->fetch(\PDO::FETCH_ASSOC)) {
		if ($docType_row['canView']) echo "<a onclick=\"event.preventDefault(); open_url(this.href, false);\" href=\"" . \TablesRouter\DocType::viewURL($data['Tables_Doc_defaultDoctype'], ['from' => \FOP\Util::getBackURL()]) . "\" class=\"tbl-link\" data-tbl=\"docType\" data-id=\"".htmlentities($docType_row['ID'])."\">";echo htmlentities($docType_row['description']);if ($docType_row['canView']) echo "</a>";
	} else {
		echo htmlentities(_('-') ?: '-');
	}
	
?>

	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_host" id="column_RevisionEmail_Doc_host">
		<!-- Feld "IMAP-Host": RevisionEmail_Doc_host -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_host"><?php echo(_('IMAP-Host')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['RevisionEmail_Doc_host']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_port" id="column_RevisionEmail_Doc_port">
		<!-- Feld "IMAP-Port": RevisionEmail_Doc_port -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_port"><?php echo(_('IMAP-Port')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['RevisionEmail_Doc_port']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_auth" id="column_RevisionEmail_Doc_auth">
		<!-- Feld "IMAP-Authentication": RevisionEmail_Doc_auth -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_auth"><?php echo(_('IMAP-Authentication')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		<div><?php echo htmlentities(\Types\Mail_security::toString($data['RevisionEmail_Doc_auth'])); ?>
		<br></div>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_username" id="column_RevisionEmail_Doc_username">
		<!-- Feld "IMAP-Username": RevisionEmail_Doc_username -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_username"><?php echo(_('IMAP-Username')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities($data['RevisionEmail_Doc_username']); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_password" id="column_RevisionEmail_Doc_password">
		<!-- Feld "IMAP-Password": RevisionEmail_Doc_password -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_password"><?php echo(_('IMAP-Password')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities('*****'); ?>
	</div>
	</div>
	<div class="mdl-cell mdl-cell--12-col mdl-grid grid-card column_RevisionEmail_Doc_syncdate" id="column_RevisionEmail_Doc_syncdate">
		<!-- Feld "IMAP-Synchronisationsdatum": RevisionEmail_Doc_syncdate -->
	<div	class="mdl-cell mdl-cell--3-col mdl-cell--4-col-phone fop-form-label">
		<label for="RevisionEmail_Doc_syncdate"><?php echo(_('IMAP-Synchronisationsdatum')); ?>: </label>
	</div>
	<div	class="mdl-cell mdl-cell--9-col mdl-cell--4-col-phone fop-form-content">
		
	<?php echo htmlentities(($data['RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($data['RevisionEmail_Doc_syncdate'])) : ''); ?>
	</div>
	</div><?php
										\EasyEditor\FormFeature::pop();
										$features['DMS']['html'] = ob_get_contents();
										ob_end_clean();
									}
									

									uasort($features, function ($a, $b) {
										return strnatcmp($a['order'], $b['order']);
									});
									foreach ($features AS $feature) {
										\EasyEditor\FormFeature::render($feature);
									}
									?><script type='text/javascript'>
										function setCFF(id, key, value) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFF?form=wf%3Auserconfig%3Aview&subid=' + encodeURIComponent(id) + '&key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value)).then(function () {
												if (key == 'reset') {
													location.reload();
												}
											});
											<?php } /* EditAccess */ ?>
										}
										function setCFFOrder(fids) {
											<?php if(!\FOP\User::getIsGuest()) { ?>
											$.get('FOP/Index/setCFFOrder?form=wf%3Auserconfig%3Aview&fids=' + encodeURIComponent(JSON.stringify(fids)));
											<?php } /* EditAccess */ ?>
										}
										$(function () {
											refreshTabHeaders($('#cardform-wf_userconfig_view')); /* provided in js/form.js */
											// preselection
											if (location.hash.startsWith('#select:')) {
												$('[name="' + window.location.hash.slice(8) + '"]').focus().select();
											} else {
												$('#cardform-wf_userconfig_view input[type!="hidden"],textarea,select[tabindex!="-1"]').not('.fop-disabled *').filter(':visible:first').focus().select();
											}
										});

										$(window).keydown(function(event) {
											 if (event.ctrlKey && String.fromCharCode(event.which).toLowerCase() == 's') {
												 event.preventDefault();
												 $('button[type=submit]').click();
												 return false;
											 }
										});

										
										$(document).on('keyup',function(evt) {
										   if (evt.keyCode == 27) {
												if (window.parent) {
													window.close(); // iframe:close
												} else {
													window.history.back();
												}
											}
												});
										
									</script>

							</form>
							

							</div>
							<div class="content" id="focus-supersearch">
							</div>
							<div class="content" id="focus-supersearch">
		<script type='text/javascript'>
			$(function () {
				var focusfield = $('#supersearch');
				if (focusfield.length) {
					focusfield[0].focus();
					focusfield[0].select();
				}
			});
		</script>
	
							</div>
							<div class="content" id="~spacer"><?php if (!isset($_GET['popup'])) { ?><div style="padding-bottom: 10cm;"></div><?php } ?>
							</div>
						<?php if (!isset($_GET['popup'])) { ?>
					</div>
				</main>
				
			</div>
		<?php } else { ?></div><?php } ?>
<?php if (!isset($_GET['popup'])) { ?><div class='fop-seal'></div><?php } ?></body></html><?php
    // --- BLOCK: main-6 ---
    }
    
  }

  public static function delete($id, $disregardPermissions = false ) { 
    
    
    // --- BLOCK: main ---
    
			$sql = 'SELECT ' . ($disregardPermissions ? 1 : '(FALSE)') . ' FROM '.qi('userconfig').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id);
			if (\FOP\Database::query($sql)->fetchColumn() != 1) {
				return false;
			}
			
			$sql = 'DELETE FROM  '.qi('userconfig').'  WHERE '.qi('ID').' = ' . \FOP\Database::quote($id);
			$result = \FOP\Database::query($sql);
			
			return true;
	
    
  }

  public static function create($data, $disregardPermissions = false , $updateOnDuplicate = false ) { 
    
    
    // --- BLOCK: main ---
    
				$sql = 'INSERT INTO '.qi('userconfig').'(';
				
				$set = [];
				
					
					$set[qi('Configuration_Stammdaten_logo')] = \FOP\Database::quote($data['Configuration_Stammdaten_logo']);
					
				
					
					$set[qi('Configuration_Stammdaten_headerText')] = \FOP\Database::quote($data['Configuration_Stammdaten_headerText']);
					
				
					
					$set[qi('Configuration_Stammdaten_firmenname')] = \FOP\Database::quote($data['Configuration_Stammdaten_firmenname']);
					
				
					
					$set[qi('Configuration_Stammdaten_firmenname2')] = \FOP\Database::quote($data['Configuration_Stammdaten_firmenname2']);
					
				
					
					$set[qi('Configuration_Stammdaten_strasse')] = \FOP\Database::quote($data['Configuration_Stammdaten_strasse']);
					
				
					
					$set[qi('Configuration_Stammdaten_flst')] = \FOP\Database::quote($data['Configuration_Stammdaten_flst']);
					
				
					
					$set[qi('Configuration_Stammdaten_plz')] = \FOP\Database::quote($data['Configuration_Stammdaten_plz']);
					
				
					
					$set[qi('Configuration_Stammdaten_ort')] = \FOP\Database::quote($data['Configuration_Stammdaten_ort']);
					
				
					
					$set[qi('Configuration_Stammdaten_telefon')] = \FOP\Database::quote($data['Configuration_Stammdaten_telefon']);
					
				
					
					$set[qi('Configuration_Stammdaten_mobil')] = \FOP\Database::quote($data['Configuration_Stammdaten_mobil']);
					
				
					
					$set[qi('Configuration_Stammdaten_fax')] = \FOP\Database::quote($data['Configuration_Stammdaten_fax']);
					
				
					
					$set[qi('Configuration_Stammdaten_email')] = \FOP\Database::quote($data['Configuration_Stammdaten_email']);
					
				
					
					$set[qi('Configuration_Stammdaten_website')] = \FOP\Database::quote($data['Configuration_Stammdaten_website']);
					
				
					
					$set[qi('Configuration_Stammdaten_iban')] = \FOP\Database::quote($data['Configuration_Stammdaten_iban']);
					
				
					
					$set[qi('Configuration_Stammdaten_bic')] = \FOP\Database::quote($data['Configuration_Stammdaten_bic']);
					
				
					
					$set[qi('Configuration_Stammdaten_bankname')] = \FOP\Database::quote($data['Configuration_Stammdaten_bankname']);
					
				
					
					$set[qi('Configuration_Stammdaten_geschaeftsfuehrer1')] = \FOP\Database::quote($data['Configuration_Stammdaten_geschaeftsfuehrer1']);
					
				
					
					$set[qi('Configuration_Stammdaten_geschaeftsfuehrer2')] = \FOP\Database::quote($data['Configuration_Stammdaten_geschaeftsfuehrer2']);
					
				
					
					$set[qi('Configuration_Stammdaten_registergericht')] = \FOP\Database::quote($data['Configuration_Stammdaten_registergericht']);
					
				
					
					$set[qi('Configuration_Stammdaten_handelsregisternummer')] = \FOP\Database::quote($data['Configuration_Stammdaten_handelsregisternummer']);
					
				
					
					$set[qi('Configuration_Stammdaten_finanzamt')] = \FOP\Database::quote($data['Configuration_Stammdaten_finanzamt']);
					
				
					
					$set[qi('Configuration_Stammdaten_steuernr')] = \FOP\Database::quote($data['Configuration_Stammdaten_steuernr']);
					
				
					
					$set[qi('Configuration_Stammdaten_umsatzsteuerid')] = \FOP\Database::quote($data['Configuration_Stammdaten_umsatzsteuerid']);
					
				
					
					$set[qi('FOP_AI_token')] = \FOP\Database::quote($data['FOP_AI_token']);
					
				
					
					$set[qi('FOP_AI_precontext')] = \FOP\Database::quote($data['FOP_AI_precontext']);
					
				
					
					$set[qi('Tables_Doc_defaultDoctype')] = \FOP\Database::quote($data['Tables_Doc_defaultDoctype']);
					
				
					
					$set[qi('RevisionEmail_Doc_host')] = \FOP\Database::quote($data['RevisionEmail_Doc_host']);
					
				
					
					$set[qi('RevisionEmail_Doc_port')] = \FOP\Database::quote($data['RevisionEmail_Doc_port']);
					
				
					
					$set[qi('RevisionEmail_Doc_auth')] = \FOP\Database::quote($data['RevisionEmail_Doc_auth']);
					
				
					
					$set[qi('RevisionEmail_Doc_username')] = \FOP\Database::quote($data['RevisionEmail_Doc_username']);
					
				
					
					$set[qi('RevisionEmail_Doc_password')] = \FOP\Database::quote($data['RevisionEmail_Doc_password']);
					
				
					
					$set[qi('RevisionEmail_Doc_syncdate')] = \FOP\Database::quote($data['RevisionEmail_Doc_syncdate']);
					
				
					
					$set[qi('FOP_Index_Impressum')] = \FOP\Database::quote($data['FOP_Index_Impressum']);
					
				
				$id = 0;

				$sql = $sql . implode(', ', array_keys($set)) . ') VALUES (' . implode(', ', array_values($set)) . ')';
				if ($updateOnDuplicate){
					// TODO: Postgres ON CONFLICT(...) DO UPDATE SET ...
					$set2 = [];
					foreach ($set AS $k => $v) {
						array_push($set2, "$k = $v");
					}
					if (\FOP\Database::getDriver() == 'mysql') {
						$sql .= ' ON DUPLICATE KEY UPDATE ' . implode(', ', $set2);
					} else {
						
					}
				}

				try {
					\FOP\Database::query($sql);
					$id = \FOP\Database::getLastInsertId();
				} catch (\PDOException $e) {
					if ($e->errorInfo[1] == 1062) {
						throw new \FOP\AccessDeniedException('duplicateinsert');
					}
                    throw $e; // weiterwerfen
				}
				$data['fop-id'] = $id; // für Hooks
				
				return $id;

    
  }

  public static function view($id, $snippet = false , $ignoreAccess = false ) { 
    
    
    // --- BLOCK: main ---
    
		$sql = 'SELECT /* Configuration_Stammdaten_bankname */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_bankname').' AS '.qi('Configuration_Stammdaten_bankname').',
									/* Configuration_Stammdaten_bic */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_bic').' AS '.qi('Configuration_Stammdaten_bic').',
									/* Configuration_Stammdaten_email */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_email').' AS '.qi('Configuration_Stammdaten_email').',
									/* Configuration_Stammdaten_fax */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_fax').' AS '.qi('Configuration_Stammdaten_fax').',
									/* Configuration_Stammdaten_finanzamt */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_finanzamt').' AS '.qi('Configuration_Stammdaten_finanzamt').',
									/* Configuration_Stammdaten_firmenname */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_firmenname').' AS '.qi('Configuration_Stammdaten_firmenname').',
									/* Configuration_Stammdaten_firmenname2 */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_firmenname2').' AS '.qi('Configuration_Stammdaten_firmenname2').',
									/* Configuration_Stammdaten_flst */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_flst').' AS '.qi('Configuration_Stammdaten_flst').',
									/* Configuration_Stammdaten_geschaeftsfuehrer1 */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_geschaeftsfuehrer1').' AS '.qi('Configuration_Stammdaten_geschaeftsfuehrer1').',
									/* Configuration_Stammdaten_geschaeftsfuehrer2 */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_geschaeftsfuehrer2').' AS '.qi('Configuration_Stammdaten_geschaeftsfuehrer2').',
									/* Configuration_Stammdaten_handelsregisternummer */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_handelsregisternummer').' AS '.qi('Configuration_Stammdaten_handelsregisternummer').',
									/* Configuration_Stammdaten_headerText */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_headerText').' AS '.qi('Configuration_Stammdaten_headerText').',
									/* Configuration_Stammdaten_iban */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_iban').' AS '.qi('Configuration_Stammdaten_iban').',
									/* Configuration_Stammdaten_logo */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_logo').' AS '.qi('Configuration_Stammdaten_logo').',
									/* Configuration_Stammdaten_mobil */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_mobil').' AS '.qi('Configuration_Stammdaten_mobil').',
									/* Configuration_Stammdaten_ort */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_ort').' AS '.qi('Configuration_Stammdaten_ort').',
									/* Configuration_Stammdaten_plz */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_plz').' AS '.qi('Configuration_Stammdaten_plz').',
									/* Configuration_Stammdaten_registergericht */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_registergericht').' AS '.qi('Configuration_Stammdaten_registergericht').',
									/* Configuration_Stammdaten_steuernr */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_steuernr').' AS '.qi('Configuration_Stammdaten_steuernr').',
									/* Configuration_Stammdaten_strasse */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_strasse').' AS '.qi('Configuration_Stammdaten_strasse').',
									/* Configuration_Stammdaten_telefon */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_telefon').' AS '.qi('Configuration_Stammdaten_telefon').',
									/* Configuration_Stammdaten_umsatzsteuerid */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_umsatzsteuerid').' AS '.qi('Configuration_Stammdaten_umsatzsteuerid').',
									/* Configuration_Stammdaten_website */ '.qi('userconfig').'.'.qi('Configuration_Stammdaten_website').' AS '.qi('Configuration_Stammdaten_website').',
									/* FOP_AI_precontext */ '.qi('userconfig').'.'.qi('FOP_AI_precontext').' AS '.qi('FOP_AI_precontext').',
									/* FOP_AI_token */ '.qi('userconfig').'.'.qi('FOP_AI_token').' AS '.qi('FOP_AI_token').',
									/* FOP_Index_Impressum */ '.qi('userconfig').'.'.qi('FOP_Index_Impressum').' AS '.qi('FOP_Index_Impressum').',
									/* ID */ '.qi('ID').' AS '.qi('ID').',
									/* ID */ '.qi('userconfig').'.'.qi('ID').' AS '.qi('ID').',
									/* RevisionEmail_Doc_auth */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_auth').' AS '.qi('RevisionEmail_Doc_auth').',
									/* RevisionEmail_Doc_host */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_host').' AS '.qi('RevisionEmail_Doc_host').',
									/* RevisionEmail_Doc_password */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_password').' AS '.qi('RevisionEmail_Doc_password').',
									/* RevisionEmail_Doc_port */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_port').' AS '.qi('RevisionEmail_Doc_port').',
									/* RevisionEmail_Doc_syncdate */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_syncdate').' AS '.qi('RevisionEmail_Doc_syncdate').',
									/* RevisionEmail_Doc_username */ '.qi('userconfig').'.'.qi('RevisionEmail_Doc_username').' AS '.qi('RevisionEmail_Doc_username').',
									/* Tables_Doc_defaultDoctype */ '.qi('userconfig').'.'.qi('Tables_Doc_defaultDoctype').' AS '.qi('Tables_Doc_defaultDoctype').',
									/* Tables_Doc_defaultDoctype::canView */ '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:canView').' AS '.qi('Tables_Doc_defaultDoctype::canView').',
									/* Tables_Doc_defaultDoctype::description */ '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:description').' AS '.qi('Tables_Doc_defaultDoctype::description').',
									/* operation::create */ ' . ((false) ? 1 : 0) . ' AS '.qi('operation::create').',
									/* operation::delete */ (FALSE) AS '.qi('operation::delete').',
									/* operation::edit */ ('.\FOP\Database::quote(\FOP\User::getAdmin()).') AS '.qi('operation::edit').',
									/* operation::index */ ' . ((false) ? 1 : 0) . ' AS '.qi('operation::index').',
									/* operation::view */ ('.\FOP\Database::quote(\FOP\User::getAdmin()).') AS '.qi('operation::view').',
									1
								FROM '.qi('userconfig').' '.qi('userconfig').'
								LEFT JOIN (SELECT '.qi('ID').' AS '.qi('Tables_Doc_defaultDoctype:ID').', '.qi('docType').'.'.qi('name').' AS '.qi('Tables_Doc_defaultDoctype:description').', (('.\FOP\Database::quote(\FOP\User::getDokument()).')) AS '.qi('Tables_Doc_defaultDoctype:canView').' FROM '.qi('docType').') '.qi('ref:Tables_Doc_defaultDoctype').' ON '.qi('ref:Tables_Doc_defaultDoctype').'.'.qi('Tables_Doc_defaultDoctype:ID').' = '.qi('userconfig').'.'.qi('Tables_Doc_defaultDoctype').'
								WHERE ('.qi('ID').' = ' . \FOP\Database::quote($id) . ')';
		$result = \FOP\Database::query($sql);
		if (!$row = $result->fetch(\PDO::FETCH_ASSOC)) {
			throw new \FOP\AccessDeniedException('notfoundread');
		} else if (!$ignoreAccess && !$row['operation::view']) {
			throw new \FOP\AccessDeniedException('accessdeniedread');
		}
		
		$row['Configuration_Stammdaten_logo'] = intval($row['Configuration_Stammdaten_logo']);
		$row['Configuration_Stammdaten_telefon'] = \FOP\Sanitizers::a_phone($row['Configuration_Stammdaten_telefon']);
		$row['Configuration_Stammdaten_mobil'] = \FOP\Sanitizers::a_phone($row['Configuration_Stammdaten_mobil']);
		$row['Configuration_Stammdaten_fax'] = \FOP\Sanitizers::a_phone($row['Configuration_Stammdaten_fax']);
		$row['Configuration_Stammdaten_email'] = \FOP\Sanitizers::a_text($row['Configuration_Stammdaten_email']);
		$row['Configuration_Stammdaten_website'] = \FOP\Sanitizers::a_text($row['Configuration_Stammdaten_website']);
		$row['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::a_text($row['Configuration_Stammdaten_iban']);
		$row['Tables_Doc_defaultDoctype'] = \FOP\Sanitizers::null_converter($row['Tables_Doc_defaultDoctype']);
		$row['RevisionEmail_Doc_password'] = \Types\Password::decryptSymmetric($row['RevisionEmail_Doc_password']);
		$row['RevisionEmail_Doc_syncdate'] = intval($row['RevisionEmail_Doc_syncdate']);
		

		if($snippet){
			$row['Configuration_Stammdaten_logo'] = (\FOP\Database::query('SELECT filename FROM fop_files WHERE '.qi('ID').' = ' . intval($row['Configuration_Stammdaten_logo']))->fetchColumn());
			$row['Configuration_Stammdaten_headerText'] = (mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($row['Configuration_Stammdaten_headerText'])))), 0, 20) . (strlen($row['Configuration_Stammdaten_headerText']) >= 20 ? '...' : ''));
			$row['Configuration_Stammdaten_firmenname'] = ($row['Configuration_Stammdaten_firmenname']);
			$row['Configuration_Stammdaten_firmenname2'] = ($row['Configuration_Stammdaten_firmenname2']);
			$row['Configuration_Stammdaten_strasse'] = ($row['Configuration_Stammdaten_strasse']);
			$row['Configuration_Stammdaten_flst'] = ($row['Configuration_Stammdaten_flst']);
			$row['Configuration_Stammdaten_plz'] = ($row['Configuration_Stammdaten_plz']);
			$row['Configuration_Stammdaten_ort'] = ($row['Configuration_Stammdaten_ort']);
			$row['Configuration_Stammdaten_telefon'] = ($row['Configuration_Stammdaten_telefon']);
			$row['Configuration_Stammdaten_mobil'] = ($row['Configuration_Stammdaten_mobil']);
			$row['Configuration_Stammdaten_fax'] = ($row['Configuration_Stammdaten_fax']);
			$row['Configuration_Stammdaten_email'] = ($row['Configuration_Stammdaten_email']);
			$row['Configuration_Stammdaten_website'] = ($row['Configuration_Stammdaten_website']);
			$row['Configuration_Stammdaten_iban'] = ($row['Configuration_Stammdaten_iban']);
			$row['Configuration_Stammdaten_bic'] = ($row['Configuration_Stammdaten_bic']);
			$row['Configuration_Stammdaten_bankname'] = ($row['Configuration_Stammdaten_bankname']);
			$row['Configuration_Stammdaten_geschaeftsfuehrer1'] = ($row['Configuration_Stammdaten_geschaeftsfuehrer1']);
			$row['Configuration_Stammdaten_geschaeftsfuehrer2'] = ($row['Configuration_Stammdaten_geschaeftsfuehrer2']);
			$row['Configuration_Stammdaten_registergericht'] = ($row['Configuration_Stammdaten_registergericht']);
			$row['Configuration_Stammdaten_handelsregisternummer'] = ($row['Configuration_Stammdaten_handelsregisternummer']);
			$row['Configuration_Stammdaten_finanzamt'] = ($row['Configuration_Stammdaten_finanzamt']);
			$row['Configuration_Stammdaten_steuernr'] = ($row['Configuration_Stammdaten_steuernr']);
			$row['Configuration_Stammdaten_umsatzsteuerid'] = ($row['Configuration_Stammdaten_umsatzsteuerid']);
			$row['FOP_AI_token'] = ($row['FOP_AI_token']);
			$row['FOP_AI_precontext'] = ($row['FOP_AI_precontext']);
			$row['Tables_Doc_defaultDoctype'] = (
  \FOP\Database::query('SELECT '.qi('docType').'.'.qi('name').' AS description FROM '.qi('docType').' WHERE '.qi('ID').' = ' . \FOP\Database::quote($row['Tables_Doc_defaultDoctype']))->fetchColumn() ?: _('-')
);
			$row['RevisionEmail_Doc_host'] = ($row['RevisionEmail_Doc_host']);
			$row['RevisionEmail_Doc_port'] = ($row['RevisionEmail_Doc_port']);
			$row['RevisionEmail_Doc_auth'] = (\Types\Mail_security::toString($row['RevisionEmail_Doc_auth']));
			$row['RevisionEmail_Doc_username'] = ($row['RevisionEmail_Doc_username']);
			$row['RevisionEmail_Doc_password'] = ('*****');
			$row['RevisionEmail_Doc_syncdate'] = (($row['RevisionEmail_Doc_syncdate']) ? strftime(_('dateformat_php2'), intval($row['RevisionEmail_Doc_syncdate'])) : '');
			$row['FOP_Index_Impressum'] = (mb_substr(preg_replace('/[ \t\r\n]+/', ' ', strip_tags(preg_replace('/<style.*?\/style>/s', '', html_entity_decode($row['FOP_Index_Impressum'])))), 0, 20) . (strlen($row['FOP_Index_Impressum']) >= 20 ? '...' : ''));
			
		}


		return $row;

    
  }

  public static function sanitizeDefaults(&$data, $sanitizeForForms, $refcol = null , $parentdata = null ) { 
    
    
    // --- BLOCK: main ---
    
		$virginData = self::getDefaults();
		// column: Configuration_Stammdaten_bankname
		
		// column: Configuration_Stammdaten_bic
		
		// column: Configuration_Stammdaten_email
		
		// column: Configuration_Stammdaten_fax
		
		// column: Configuration_Stammdaten_finanzamt
		
		// column: Configuration_Stammdaten_firmenname
		
		// column: Configuration_Stammdaten_firmenname2
		
		// column: Configuration_Stammdaten_flst
		
		// column: Configuration_Stammdaten_geschaeftsfuehrer1
		
		// column: Configuration_Stammdaten_geschaeftsfuehrer2
		
		// column: Configuration_Stammdaten_handelsregisternummer
		
		// column: Configuration_Stammdaten_headerText
		
		// column: Configuration_Stammdaten_iban
		
		// column: Configuration_Stammdaten_logo
		
		// column: Configuration_Stammdaten_mobil
		
		// column: Configuration_Stammdaten_ort
		
		// column: Configuration_Stammdaten_plz
		
		// column: Configuration_Stammdaten_registergericht
		
		// column: Configuration_Stammdaten_steuernr
		
		// column: Configuration_Stammdaten_strasse
		
		// column: Configuration_Stammdaten_telefon
		
		// column: Configuration_Stammdaten_umsatzsteuerid
		
		// column: Configuration_Stammdaten_website
		
		// column: FOP_AI_precontext
		
		// column: FOP_AI_token
		
		// column: FOP_Index_Impressum
		
		// column: RevisionEmail_Doc_auth
		
		// column: RevisionEmail_Doc_host
		
		// column: RevisionEmail_Doc_password
		
		// column: RevisionEmail_Doc_port
		
		// column: RevisionEmail_Doc_syncdate
		
		// column: RevisionEmail_Doc_username
		
		// column: Tables_Doc_defaultDoctype
			if (!$data['Tables_Doc_defaultDoctype']) {
				$data['Tables_Doc_defaultDoctype'] = $sanitizeForForms ? '0' : null;
			}
		
		if ($sanitizeForForms) {
			
			$data['Configuration_Stammdaten_logo'] = intval($data['Configuration_Stammdaten_logo']);
			$data['Configuration_Stammdaten_telefon'] = \FOP\Sanitizers::a_phone($data['Configuration_Stammdaten_telefon']);
			$data['Configuration_Stammdaten_mobil'] = \FOP\Sanitizers::a_phone($data['Configuration_Stammdaten_mobil']);
			$data['Configuration_Stammdaten_fax'] = \FOP\Sanitizers::a_phone($data['Configuration_Stammdaten_fax']);
			$data['Configuration_Stammdaten_email'] = \FOP\Sanitizers::a_text($data['Configuration_Stammdaten_email']);
			$data['Configuration_Stammdaten_website'] = \FOP\Sanitizers::a_text($data['Configuration_Stammdaten_website']);
			$data['Configuration_Stammdaten_iban'] = \FOP\Sanitizers::a_text($data['Configuration_Stammdaten_iban']);
			$data['Tables_Doc_defaultDoctype'] = \FOP\Sanitizers::null_converter($data['Tables_Doc_defaultDoctype']);
			$data['RevisionEmail_Doc_password'] = \Types\Password::decryptSymmetric($data['RevisionEmail_Doc_password']);
			$data['RevisionEmail_Doc_syncdate'] = intval($data['RevisionEmail_Doc_syncdate']);
		}
	
    
  }

  public static function edit($id, $data, $ignoreUniqueConstraints = false , $disregardPermissions = false ) { 
    
    
    // --- BLOCK: main ---
    
				
				$set = [];
				
					
					if (array_key_exists('Configuration_Stammdaten_logo', $data)) {
						array_push($set, qi('Configuration_Stammdaten_logo').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_logo']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_headerText', $data)) {
						array_push($set, qi('Configuration_Stammdaten_headerText').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_headerText']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_firmenname', $data)) {
						array_push($set, qi('Configuration_Stammdaten_firmenname').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_firmenname']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_firmenname2', $data)) {
						array_push($set, qi('Configuration_Stammdaten_firmenname2').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_firmenname2']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_strasse', $data)) {
						array_push($set, qi('Configuration_Stammdaten_strasse').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_strasse']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_flst', $data)) {
						array_push($set, qi('Configuration_Stammdaten_flst').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_flst']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_plz', $data)) {
						array_push($set, qi('Configuration_Stammdaten_plz').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_plz']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_ort', $data)) {
						array_push($set, qi('Configuration_Stammdaten_ort').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_ort']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_telefon', $data)) {
						array_push($set, qi('Configuration_Stammdaten_telefon').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_telefon']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_mobil', $data)) {
						array_push($set, qi('Configuration_Stammdaten_mobil').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_mobil']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_fax', $data)) {
						array_push($set, qi('Configuration_Stammdaten_fax').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_fax']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_email', $data)) {
						array_push($set, qi('Configuration_Stammdaten_email').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_email']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_website', $data)) {
						array_push($set, qi('Configuration_Stammdaten_website').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_website']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_iban', $data)) {
						array_push($set, qi('Configuration_Stammdaten_iban').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_iban']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_bic', $data)) {
						array_push($set, qi('Configuration_Stammdaten_bic').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_bic']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_bankname', $data)) {
						array_push($set, qi('Configuration_Stammdaten_bankname').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_bankname']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_geschaeftsfuehrer1', $data)) {
						array_push($set, qi('Configuration_Stammdaten_geschaeftsfuehrer1').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_geschaeftsfuehrer1']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_geschaeftsfuehrer2', $data)) {
						array_push($set, qi('Configuration_Stammdaten_geschaeftsfuehrer2').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_geschaeftsfuehrer2']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_registergericht', $data)) {
						array_push($set, qi('Configuration_Stammdaten_registergericht').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_registergericht']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_handelsregisternummer', $data)) {
						array_push($set, qi('Configuration_Stammdaten_handelsregisternummer').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_handelsregisternummer']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_finanzamt', $data)) {
						array_push($set, qi('Configuration_Stammdaten_finanzamt').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_finanzamt']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_steuernr', $data)) {
						array_push($set, qi('Configuration_Stammdaten_steuernr').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_steuernr']));
					}
				
					
					if (array_key_exists('Configuration_Stammdaten_umsatzsteuerid', $data)) {
						array_push($set, qi('Configuration_Stammdaten_umsatzsteuerid').' = ' . \FOP\Database::quote($data['Configuration_Stammdaten_umsatzsteuerid']));
					}
				
					
					if (array_key_exists('FOP_AI_token', $data)) {
						array_push($set, qi('FOP_AI_token').' = ' . \FOP\Database::quote($data['FOP_AI_token']));
					}
				
					
					if (array_key_exists('FOP_AI_precontext', $data)) {
						array_push($set, qi('FOP_AI_precontext').' = ' . \FOP\Database::quote($data['FOP_AI_precontext']));
					}
				
					
					if (array_key_exists('Tables_Doc_defaultDoctype', $data)) {
						array_push($set, qi('Tables_Doc_defaultDoctype').' = ' . \FOP\Database::quote($data['Tables_Doc_defaultDoctype']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_host', $data)) {
						array_push($set, qi('RevisionEmail_Doc_host').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_host']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_port', $data)) {
						array_push($set, qi('RevisionEmail_Doc_port').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_port']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_auth', $data)) {
						array_push($set, qi('RevisionEmail_Doc_auth').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_auth']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_username', $data)) {
						array_push($set, qi('RevisionEmail_Doc_username').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_username']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_password', $data)) {
						array_push($set, qi('RevisionEmail_Doc_password').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_password']));
					}
				
					
					if (array_key_exists('RevisionEmail_Doc_syncdate', $data)) {
						array_push($set, qi('RevisionEmail_Doc_syncdate').' = ' . \FOP\Database::quote($data['RevisionEmail_Doc_syncdate']));
					}
				
					
					if (array_key_exists('FOP_Index_Impressum', $data)) {
						array_push($set, qi('FOP_Index_Impressum').' = ' . \FOP\Database::quote($data['FOP_Index_Impressum']));
					}
				;
				
				if (count($set)) {
					try {
						\FOP\Database::query('UPDATE '.qi('userconfig').' SET ' . implode(', ', $set) . ' WHERE '.qi('ID').' = ' . \FOP\Database::quote($id));
						if (isset($data['ID'])) {
							$id = $data['ID'];
						}
					} catch (\PDOException $e) {
						if ($e->errorInfo[1] == 1062) {
							if ($ignoreUniqueConstraints) {
								return false;
							}
							throw new \FOP\AccessDeniedException('duplicateupdate');
						}
						throw $e; // weiterwerfen
					}
				}
				$data['fop-id'] = $id; // für Hooks
				
				return true;

    
  }

  public static function deleteAction($id) { 
    
    // Methodenimplementierung überschrieben.
    throw new \FOP\AccessDeniedException();return false;
  }

  public static function indexAction() { 
    
    // Methodenimplementierung überschrieben.
    throw new \FOP\AccessDeniedException();return false;
  }


  
  

  
  
}



