<?php
	if (!isset($fields) || empty ($fields))
	{
		$fields = '<fields>
			<field name="name" size="50" mandatory="true" label="'.GetString('label-input-from-name').'" />
			<field name="email" type="email" size="50" mandatory="true" label="'.GetString('label-input-from-email').'" />
			<field name="subject" size="50" mandatory="true" label="'.GetString('label-input-subject').'" />
			<field name="message" lines="10" size="5000" mandatory="true" label="'.GetString('label-input-message').'" />
		</fields>';
	}

	$action = array_key_exists('SCRIPT_URL', $_SERVER) ? $_SERVER['SCRIPT_URL'] : '';
	$Fields = new SimpleXMLElement($fields);

	// User variables
	if (empty($recipientName))
	//	$recipientName = GetServerValue('HTTP_HOST');
		$recipientName = $websiteName;

	// Form data
	$FormData = [];
	foreach ($_GET as $name => $value)
	{
		$name = htmlspecialchars($name);
		foreach ($Fields->field as $field)
		{
			if ((string)$field['name'] === $name)
			{
				$value = str_replace('{}', "\n", htmlspecialchars($value));
				$FormData["input-$name"] = $value;
				break;
			}
		}
	}
	foreach ($_POST as $name => $value)
	{
		$name = htmlspecialchars($name);
		if (str_starts_with($name, 'input-'))
		{
			$value = htmlspecialchars($value);
			$FormData[$name] = $value;
		}
	}

	// Hidden form data
	$captchaQuestion = htmlspecialchars(GetPostValue('captcha-question'));
	$captchaAnswer = htmlspecialchars(GetPostValue('captcha-answer'));
	$session = htmlspecialchars(GetPostValue('session'));
	$destination = htmlspecialchars(GetPostValue('destination'));
	if (empty($destination)) $destination = GetServerValue('HTTP_REFERER');
	if (empty($destination)) $destination = '/';

	// Form strings
	$subtitle = sprintf(isset($infoText) ? $infoText : GetString('subtitle'), $websiteName);
	$classSubtitle = '';
	$displayError = 'none';
	$displayForm = 'none';
	$displayCaptcha = 'none';
	$displayConfirm = 'none';
	$hasUserData = false;
	$captchaText = '';

	// Error messages
	$ErrorMessages = [];
	$htmlErrorLines = '';

	// Error fields
	$ErrorFields = [];
	$jsErrorFields = '';

	// Main

	if (!empty(htmlspecialchars(GetPostValue('send'))))
	{
		$hasUserData = true;

		// Validate form data

		// Recipient e-mail address must exist
		if (empty($recipientEmail))
			AddErrorMessage(GetString('fatal-missing-recipient-email'));

		$FieldLabels = [];
		foreach ($Fields->field as $field)
		{
			$name = (string)$field['name']; if (!$name) continue;
			$value = GetFormValue("input-$name");
			$mandatory = (string)$field['mandatory'];
			$and = (string)($field['and'] ?? '');
			$or = (string)($field['or'] ?? '');
			$size = (string)($field['size'] ?? '');
			$type = (string)$field['type'];
			$min = (string)($field['min'] ?? '');
			$max = (string)($field['max'] ?? '');
			$fieldName = (string)($field['label'] ?? $name);

			if ($value === '')
			{
				if ($mandatory === 'true')
					AddErrorMessage(sprintf(GetString('error-empty-field'), $fieldName), $name);
				else
				{
					if ($and !== '' && GetFilledAndFields($and))
						AddErrorMessage(sprintf(GetString('error-empty-field'), $fieldName), $name);
					if ($or !== '')
					{
						$fieldNames = GetOrFields($or);
						if ($fieldNames)
							AddErrorMessage(sprintf(GetString('error-empty-field-or'), implode(GetString('Typo.DoubleQuoteClosing').' '.GetString('or').' '.GetString('Typo.DoubleQuoteOpening'), $fieldNames)), $name);
					}
				}
			}
			else if ($size !== '' && strlen(htmlspecialchars_decode($value)) > $size)
				AddErrorMessage(sprintf(GetString('error-length-field'), $fieldName, $size), $name);
			else if ($type === 'email' && !filter_var($value, FILTER_VALIDATE_EMAIL))
				AddErrorMessage(sprintf(GetString('error-syntax-email'), $fieldName), $name);
			else if ($type === 'url' && !filter_var($value, FILTER_VALIDATE_URL))
				AddErrorMessage(sprintf(GetString('error-syntax-url'), $fieldName), $name);
			else if ($type === 'number' && $value !== '')
			{
				if (!is_numeric($value))
					AddErrorMessage(sprintf(GetString('error-not-number'), $fieldName), $name);
				else if ($min !== '' && $value < $min)
					AddErrorMessage(sprintf(GetString('error-min-number'), $fieldName, $min), $name);
				else if ($max !== '' && $value > $max)
					AddErrorMessage(sprintf(GetString('error-max-number'), $fieldName, $max), $name);
			}
		}

		// Session-Daten (muss sinnvollen Inhalt enthalten, wenn mit dem Formular interagiert wurde; andernfalls wurde es wahrscheinlich von einem Spambot abgesendet)
		if (!preg_match('/^ms=/', $session))
			AddErrorMessage(GetString('error-missing-session'));

		// Captcha
		if ($captchaEnabled)
		{
			if (empty($captchaQuestion) || empty($captchaAnswer) || $captchaQuestion !== md5($captchaSecret . $captchaAnswer))
			{
				AddErrorMessage(GetString('error-wrong-captcha-answer'));
				sleep(5); # zur Erschwerung von Brute-Force-Atacken
			}
		}

		if (!HasErrors())
		{
			// Compose e-mail
			$name = htmlspecialchars_decode(GetFormValue('input-name'));
			$email = htmlspecialchars_decode(GetFormValue('input-email', $recipientEmail));
			$sender = EncodeHeaderText($name)." <$email>";
			if ($name === '') $sender = "$email";

			$mailHeader = <<<EOM
From: $sender
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit

EOM;

			$mailBody = <<<EOM
<html>
<head>
	<style>
		body {
			font-family: sans-serif;
		}
	</style>
</head>
<body>
EOM;

			// Ausgabe der Nachricht
			if (!isset($mailTemplate) || empty ($mailTemplate))
			{
				// Kein Mail-Template angegeben: Standard-Template erstellen
				$mailTemplate = '';
				$prevName = '';
				foreach ($Fields->field as $field)
				{
					$name = (string)$field['name'];
					$type = (string)$field['type'];

					if (!$name)
					{
						$text = (string)$field;
						$mailTemplate .= "<b>$text</b>\n\n";
						continue;
					}

					// Die bereits verwendeten / ausgegebenen / mehrfach vorhandenen Felder ignorieren:
					if ($name === 'name') continue;
					if ($name === 'email') continue;
					if ($name === 'subject') continue;
					if ($name === $prevName) continue;

					if ($type !== 'radio' && !($name === 'message' && $prevName === ''))
						$mailTemplate .= "<b>%$name%</b>\n\n";
					$mailTemplate .= "!$name!\n\n";

					$prevName = $name;
				}
			}

			// Template-Variablen ersetzen
			foreach ($Fields->field as $field)
			{
				$name = (string)$field['name'];
				if (!$name) continue;

				$label = (string)($field['label'] ?? $name);
				$input = htmlspecialchars_decode(GetFormValue("input-$name"));

				$mailTemplate = str_replace("%$name%", $label, $mailTemplate);
				$mailTemplate = str_replace("!$name!", $input === '' ? '('.GetString('no-input').')' : $input, $mailTemplate);
				$mailTemplate = str_replace("\n?$name?\n", $input === '' ? "\n" : "\n$input\n", $mailTemplate);
				$mailTemplate = str_replace("?$name?", $input === '' ? '' : "$input", $mailTemplate);
			}

			// Ausgabe des Mailtextes
			$mailBody .= "<p>" . implode("<br>\n", explode("\n", $mailTemplate)) . "</p>\n";

			if ($adminDataEnabled)
			{
				$headingAdminData = GetString('AdministrativeInformation');

				$labelIpAddress = GetString('IpAddress');
				$labelReferrer = GetString('Referrer');
				$labelDestination = GetString('TargetUrl');
				$labelLanguage = GetString('Language');
				$labelBrowser = GetString('Browser');

				$ipAddress = GetServerValue('REMOTE_ADDR');
				$referrer = GetServerValue('HTTP_REFERER');
				$language = GetServerValue('HTTP_ACCEPT_LANGUAGE');
				$userAgent = GetServerValue('HTTP_USER_AGENT');

				$mailBody .= <<<EOM

-- 

<p><details><summary>Administrative Angaben</summary>
<pre>
$labelIpAddress: $ipAddress
$labelReferrer: $referrer
$labelDestination: $destination
$labelLanguage: $language
$labelBrowser: $userAgent

EOM;
			}

			if ($sessionLogEnabled)
			{
				$headingSessionLog = GetString('SessionLog');

				$sessionLog = FormatSessionData($session);
				$mailBody .= <<<EOM

---- $headingSessionLog ----

$sessionLog
</pre>
</details></p>
EOM;
			}

			$mailBody .= "</body>\n</html>\n";

			# Mail senden

			$recipient = EncodeHeaderText($recipientName) . " <$recipientEmail>";
			$subject = htmlspecialchars_decode(GetFormValue('input-subject', GetString('default-subject')));
			$subject = EncodeHeaderText(trim("$subjectPrefix $subject"));

			if (mail($recipient, $subject, $mailBody, $mailHeader))
			{
				$subtitle = sprintf(GetString('subtitle-confirm'), $websiteName);
				$displayConfirm = 'block';
			}
			else
			{
				AddErrorMessage(GetString('error-sending-mail') . error_get_last()['message']);
			}
		}

		if (HasErrors())
		{
			ReportErrors();

			// Display form
			InitCaptcha();
			$displayForm = 'block';
		}
	}
	else
	{
		// Display form
		InitCaptcha();
		$displayForm = 'block';
	}

	// Functions

	function GetFormValue($name, $default = '')
	{
		global $FormData;
		return array_key_exists($name, $FormData) ? $FormData[$name] : $default;
	}

	function GetFilledAndFields($arg_and)
	{
		global $Fields;
		$fieldNames = [];
		foreach ($Fields->field as $field)
		{
			$name = (string)$field['name']; if (!$name) continue;
			$value = GetFormValue("input-$name");
			$and = (string)($field['and'] ?? '');

			if ($value !== '' && $and === $arg_and)
			{
				$fieldName = (string)($field['label'] ?? $name);
				$fieldNames[$fieldName] = $fieldName;
			}
		}
		return $fieldNames;
	}

	function GetOrFields($arg_or)
	{
		global $Fields;
		$fieldNames = [];
		$allFieldsEmpty = true;
		foreach ($Fields->field as $field)
		{
			$name = (string)$field['name']; if (!$name) continue;
			$value = GetFormValue("input-$name");
			$or = (string)($field['or'] ?? '');

			if ($or === $arg_or)
			{
				$fieldName = (string)($field['label'] ?? $name);
				$fieldNames[$fieldName] = $fieldName;
				if ($value !== '') $allFieldsEmpty = false;
			}
		}
		return $allFieldsEmpty ? $fieldNames : [];
	}

	function InitCaptcha()
	{
		global $captchaEnabled;
		global $displayCaptcha;
		global $captchaText;
		global $captchaQuestion;
		global $captchaSecret;

		if (!$captchaEnabled) return;
		$displayCaptcha = true;

		$buchstabenWoerter = explode(' ', GetString('captcha-letter-words'));
		$zahlWoerter = explode(' ', GetString('captcha-number-words'));

		$buchstaben = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];
		$zahlen = ['1', '2', '3', '4', '5', '6', '7', '8'];

		$h1 = mt_rand(0, 7); $v1 = mt_rand(0, 7);
		$h2 = mt_rand(0, 7); $v2 = mt_rand(0, 7);

		while ("$h1$v1" === "$h2$v2") { $h2 = mt_rand(0, 7); $v2 = mt_rand(0, 7); }

		$captchaText = sprintf(
			GetString('captcha-text'),
			$buchstabenWoerter[$h1] . ' ' . $zahlWoerter[$v1],
			$buchstabenWoerter[$h2] . ' ' . $zahlWoerter[$v2]
		);

		$CaptchaQuestion = [$buchstaben[$h1] . $zahlen[$v1], $buchstaben[$h2] . $zahlen[$v2]];
		sort($CaptchaQuestion);
		$captchaQuestion = md5($captchaSecret . implode(' ', $CaptchaQuestion));
	}

	function AddErrorMessage($text, $name)
	{
		global $ErrorMessages;
		global $ErrorFields;
		$ErrorMessages[$text] = $text;
		if ($name) array_push($ErrorFields, $name);
	}

	function HasErrors()
	{
		global $ErrorMessages;
		return count($ErrorMessages) > 0;
	}


	function ReportErrors($text = '')
	{
		global $subtitle;
		global $classSubtitle;
		global $ErrorMessages;
		global $htmlErrorLines;
		global $ErrorFields;
		global $jsErrorFields;
		global $displayError;

		if (!empty($text))
			AddErrorMessage($text);

		if (!HasErrors())
			return;

		// Show error heading
		$subtitle = GetString('subtitle-error');
		$classSubtitle = 'error';

		// Show error message
		foreach ($ErrorMessages as $text)
			$htmlErrorLines .= "<li class=\"error\">$text</li>";

		// Mark error fields
		foreach ($ErrorFields as $name)
			$jsErrorFields .= "ContactForm_SetErrorField('input-$name');";

		$displayError = 'block';
	}

	// Codiert den Mail-Betreff standardkonform
	function EncodeHeaderText($text)
	{
		// Nur codieren, wenn Zeichen mit Wert > 127 enthalten sind
		if (preg_match('/[\x80-\xFF]/', $text))
		{
			# "=" codieren
			$text = preg_replace_callback('/(=)/', 'EncodeByte', $text);

			# "_" und "?" codieren
			$text = preg_replace_callback('/([_?])/', 'EncodeByte', $text);

			// " " durch "_" ersetzen
			$text = str_replace(' ', '_', $text);

			# alle Zeichen mit Wert > 127 codieren
			$text = preg_replace_callback('/([\x80-\xFF])/', 'EncodeByte', $text);

			# "=?utf-8?Q?" voranstellen und "?=" anhängen
			$text = '=?utf-8?Q?' . $text . '?=';
		}

		return $text;
	}

	function EncodeByte($matches)
	{
		return sprintf('=%02X', ord($matches[1]));
	}

	// Bereitet den über das Formular übergebenen String mit den Session-Daten in lesbarer Form auf.
	function FormatSessionData($session)
	{
		$result = '';
		if (!empty($session))
		{
			$msStart = '';
			$msPrev = '';
			$SessionLines = explode('|', $session);
			foreach ($SessionLines as $sessionLine)
			{
				$line = '';
				$pairs = explode('&', $sessionLine);
				foreach ($pairs as $pair)
				{
					list($name, $value) = explode('=', $pair);
					$value = urldecode($value);

					if ($name === 'ms')
					{
						$msDiff = '-';
						if (!empty($value))
						{
							if (empty($msStart))
							{
								$msStart = $value;
								$msDiff = 0;
							}
							else
							{
								$msDiff = $value - $msStart;
							}
							if (!empty($msPrev) && $value - $msPrev > 1000) $line .= "\n";
							$line .= "$value ($msDiff): ";

							$msPrev = $value;
						}
					}
					else
					{
						if ($name === 'data' && !empty($value))
						{
							$value = str_replace('Tag=', '', $value);
							$value = str_replace('; Name=', ' ', $value);
							$value = str_replace('; Value=', '=', $value);
						}
						$line .= "$value ";
					}
				}
				if (!empty($result)) $result .= "\n";
				$result .= $line;
			}
		}
		return $result;
	}

?>

<style>
	<?php include 'lib/contact.css' ?>
	<?php include 'lib/captcha.css' ?>
</style>

<script>
	//var g_noPrettify = true;
	<?php include 'lib/contact.js'; ?>
	<?php include 'lib/captcha.js'; ?>
</script>

<p class="<?php echo $classSubtitle; ?>"><?php echo $subtitle; ?></p>

<div id="error" style="display: <?php echo $displayError; ?>;">
	<ul>
		<?php echo $htmlErrorLines;?>
	</ul>
	<script>
		document.addEventListener('DOMContentLoaded', function() { <?php echo $jsErrorFields;?> });
	</script>
</div>

<div id="form" style="display: <?php echo $displayForm; ?>;">
	<form class="contact" method="post" action="<?php echo $action;?>">
		<div class="fields">
		<?php
			$controlCount = 0;
			$hasMandatoryFields = false;
			$prevType = ''; $prevName = ''; $prevLabelStart = ''; $prevLabelEnd = ''; $prevLineUp = '';
			foreach ($Fields->field as $field)
			{
				$align = (string)($field['align'] ?? '');
				$class = $align !== '' ? ' class="'.$align.'"' : '';

				$type = (string)$field['type'];
				if ($prevType === 'dropdown' && $type !== 'dropdown')
					echo "\t\t\t</select>$label_end$lineup_end\n";

				$name = (string)$field['name'];
				if (!$name)
				{
					$text = (string)$field;
					echo "\t\t\t<p$class>$text</p>\n";
					$prevType = $type; $prevName = $name;
					continue;
				}

				$value = GetFormValue("input-$name");
				if (!$hasUserData && $value === '') $value = (string)($field['content'] ?? '');

				$placeholder = (string)($field['label'] ?? '');
				$mandatory = (string)$field['mandatory'];
				$and = (string)($field['and'] ?? '');
				$or = (string)($field['or'] ?? '');

				if ($mandatory === 'true' || ($value === '' && ($or !== '' && GetOrFields($or)) || ($and !== '' && GetFilledAndFields($and))))
				{
					$placeholder .= '*';
					$hasMandatoryFields = true;
				};

				$controlId = "input-$name-" . ++$controlCount; // wg. Radiobutton
				$size = (string)($field['size'] ?? ''); $maxlength = $size !== '' ? ' maxlength="'.$size.'"' : '';
				$width = (string)($field['width'] ?? ''); $style = $width !== '' ? ' style="width: '.$width.'; max-width: 100%;"' : ' style="width: 100%;"';
				$readonly = (string)$field['readonly'] === 'true' ? ' readonly' : ''; 
				$lines = (string)$field['lines'] ?? '';
				$preset = (string)$field['preset'] === 'true';

				$labelpos = (string)($field['labelpos'] ?? ''); if ($labelpos === '') if ($type === 'dropdown') $labelpos = 'before'; else if ($type === 'check' || $type === 'radio') $labelpos = 'after';
				$label = ''; if ($labelpos !== '') { $label = '<label for="'.$controlId.'">'.$placeholder.'</label>'; $placeholder = ''; }
				$label_start = $labelpos === 'before' ? "<p$class><span>$label</span> " : ($labelpos === 'above' ? "<p$class>$label<br>" : ($labelpos === 'left' ? "<table class=\"nostyle field\"><tr><td><p$class><span>$label</span></p> </td><td>" : ($labelpos === 'right' ? "<table class=\"nostyle field\"><tr><td$class>" : '<p>')));
				$label_end = $labelpos === 'after' ? " <span>$label</span></p>" : ($labelpos === 'below' ? "<br>$label</p>" : ($labelpos === 'left' ? '</td></tr></table>' : ($labelpos === 'right' ? "</td><td><p><span>$label</span></p></td></tr></table>" : '</p>')));

				$lineup = (string)$field['lineup'] ?? '';
				if ($lineup === 'true' && $prevLineUp !== 'true') echo "\t\t\t<table class=\"nostyle lineup\"><tr>\n";
				$lineup_start = $lineup === 'true' || $prevLineUp === 'true' ? ($width !== '' ? '<td style="width: 0;">' : '<td>') : '';
				$lineup_end = $lineup_start !== '' ? '</td>' : '';

				$EditTypes = [
					'number' => 'type="text" inputmode="numeric"',
					'date' => 'type="date"',
					'email' => 'type="text" inputmode="email" autocomplete="email"', 
					'tel' => 'type="tel" inputmode="tel" autocomplete="tel"',
					'url' => 'type="text" inputmode="url"', // kein autocomplete, da sonst keine Vorschläge (mglw. weil die vom Browser verwalteten Adressen keine URL enthalten)
					'org' => 'type="text" autocomplete="organization"',
					'name' => 'type="text" autocomplete="name"',
					'address' => 'type="text" autocomplete="street-address"',
					'street' => 'type="text" autocomplete="address-line1"',
					'addition' => 'type="text" autocomplete="address-line2"',
					'postcode' => 'type="text" autocomplete="postal-code"',
					'city' => 'type="text" autocomplete="address-level2"',
					'country' => 'type="text" autocomplete="country-name"',
				];

				if (!$type || $type === '' || $type === 'text' || array_key_exists($type, $EditTypes))
				{
					$attr = array_key_exists($type, $EditTypes) ? $EditTypes[$type] : 'type="text"';
					if ($lines === '')
						echo "\t\t\t$lineup_start$label_start<input id=\"$controlId\" $attr placeholder=\"$placeholder\" name=\"input-$name\" value=\"$value\"$maxlength$style$readonly>$label_end$lineup_end\n";
					else
						echo "\t\t\t$lineup_start$label_start<textarea id=\"$controlId\" $attr rows=\"$lines\" placeholder=\"$placeholder\" name=\"input-$name\"$maxlength$style$readonly>$value</textarea>$label_end$lineup_end\n";
				}
				else if ($type === 'check')
				{
					if ($value === '') $value = GetString('checkbox-default-value');
					$checked = $hasUserData ? (array_key_exists("input-$name", $FormData) ? ' checked' : '') : ($preset ? ' checked' : '');
					echo "\t\t\t$lineup_start$label_start<input id=\"$controlId\" type=\"checkbox\" name=\"input-$name\" value=\"$value\"$checked$readonly>$label_end$lineup_end\n";
				}
				else if ($type === 'radio')
				{
					$value = (string)($field['content'] ?? $field['label'] ?? '');
					$checked = $hasUserData ? (GetFormValue("input-$name") === $value ? ' checked' : '') : ($preset ? ' checked' : '');
					echo "\t\t\t$lineup_start$label_start<input id=\"$controlId\" type=\"radio\" name=\"input-$name\" value=\"$value\"$checked$readonly>$label_end$lineup_end\n";
				}
				else if ($type === 'dropdown')
				{
					if ($prevType === 'dropdown' && $name === $prevName) { $label_start = $prevLabelStart; $label_end = $prevLabelEnd; }
					if ($prevType === 'dropdown' && $name !== $prevName) echo "\t\t\t</select>$prevLabelEnd\n";
					if ($prevType !== 'dropdown' || $name !== $prevName) echo "\t\t\t$lineup_start$label_start<select id=\"$controlId\" name=\"input-$name\"$readonly>\n";
					$optionValue = $optionDisplay = (string)($field['content'] ?? '');
					if (!ctype_alnum(substr($optionValue, 0, 1))) $optionValue = '';
					$selected = $hasUserData ? (GetFormValue("input-$name") === $optionValue ? ' selected' : '') : ($preset ? ' selected' : '');
					echo "\t\t\t\t<option value=\"$optionValue\"$selected>$optionDisplay</option>\n";
						
				}
				if ($lineup !== 'true' && $prevLineUp === 'true') echo "\t\t\t</tr></table>\n";
				$prevType = $type; $prevName = $name; $prevLabelStart = $label_start; $prevLabelEnd = $label_end; $prevLineUp = $lineup;
			}
			if ($prevType === 'dropdown') echo "\t\t\t</select>$label_end$lineup_end\n";
			if ($lineup !== 'true' && $prevLineUp === 'true') echo "\t\t\t</tr></table>\n";
			if ($hasMandatoryFields) echo "\t\t\t<p>".GetString('has-mandatory-fields')."</p>\n";
		?>
		</div>
		<div id="captcha" style="display: <?php echo $displayCaptcha; ?>;">
			<p style="text-align: center;"><?php echo $captchaText; ?></p>
			<table id="captcha-game" class="nostyle"></table>
			<input type="hidden" name="captcha-question" value="<?php echo $captchaQuestion; ?>">
			<input type="hidden" id="captcha-answer" name="captcha-answer">
		</div>
		<p style="text-align: center;"><input id="button-send" type="submit" name="send" value="<?php echo GetString('label-button-send');?>"><input id="button-discard" type="button" value="<?php echo GetString('label-button-discard');?>" onclick="window.location.assign('<?php echo $destination; ?>');"></p>
		<input type="hidden" id="session" name="session" value="<?php echo $session; ?>">
		<input type="hidden" name="destination" value="<?php echo $destination; ?>">
		<input type="hidden" name="token" value="<?php echo htmlspecialchars(GetPostValue('token')); ?>">
	</form>
</div>

<div id="confirm" style="display: <?php echo $displayConfirm; ?>;">
	<p style="text-align: center;"><input id="button-confirm" type="button" value="<?php echo GetString('label-button-confirm');?>" onclick="window.location.assign('<?php echo $destination; ?>');"></p>
</div>
