<?php
echo '<div id="MessageContainerFoot">';

if (isset($Messages) and count($Messages) > 0) {
	foreach ($Messages as $Message) {
		$Prefix = '';
		switch ($Message[1]) {
			case 'error':
				$Class = 'danger';
				$Prefix = $Prefix ? $Prefix : _('ERROR') . ' ' . _('Report');
				if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity'] > 3) {
					fwrite($LogFile, date('Y-m-d h-m-s') . ',' . $Type . ',' . $_SESSION['UserID'] . ',' . trim($Msg, ',') . "\n");
				}
				echo '<div class="alert alert-dismissible alert-' . $Class . ' noPrint">
				<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
				<b>' . $Prefix . '</b> : ' . $Message[0] . '</div>';
				break;
			case 'warn':
			case 'warning':	 
				$Class = 'warning';
				$Prefix = $Prefix ? $Prefix : _('WARNING') . ' ' . _('Report');
				if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity'] > 3) {
					fwrite($LogFile, date('Y-m-d h-m-s') . ',' . $Type . ',' . $_SESSION['UserID'] . ',' . trim($Msg, ',') . "\n");
				}
				echo '<div class="alert alert-dismissible alert-' . $Class . ' noPrint">
				<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
				<b>' . $Prefix . '</b> : ' . $Message[0] . '</div>';
				break;
			case 'success':
				$Class = 'success';
				$Prefix = $Prefix ? $Prefix : _('SUCCESS') . ' ' . _('Report');
				if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity'] > 3) {
					fwrite($LogFile, date('Y-m-d h-m-s') . ',' . $Type . ',' . $_SESSION['UserID'] . ',' . trim($Msg, ',') . "\n");
				}
				echo '<div class="alert alert-dismissible alert-' . $Class . ' noPrint">
				<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
				<b>' . $Prefix . '</b> : ' . $Message[0] . '</div>';
				break;
			case 'info':
			default:
				$Prefix = $Prefix ? $Prefix : _('INFORMATION') . ' ' . _('Message');
				$Class = 'info';
				if (isset($_SESSION['LogSeverity']) and $_SESSION['LogSeverity'] > 2) {
					fwrite($LogFile, date('Y-m-d h-m-s') . ',' . $Type . ',' . $_SESSION['UserID'] . ',' . trim($Msg, ',') . "\n");
				}
				echo '<div class="alert alert-dismissible alert-' . $Class . ' noPrint">
				<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
				<b>' . $Prefix . '</b> : ' . $Message[0] . '</div>';
		}
	}
}
echo '</div>'; // eof MessageContainer div

echo '</br>';

echo '<div>
	<form action="' . htmlspecialchars($_SERVER['PHP_SELF']) . '" method="post">
	<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />
	<input type="hidden" name="ScriptName" value="' . htmlspecialchars($ScriptName,ENT_QUOTES,'UTF-8') . '" />
	<input type="hidden" name="Title" value="' . $Title . '" />
	' . $ShowAdd . $ShowDel . '
        
	
		</form>
	</div>
';
echo '</div>';

echo '<hr>';
echo '<footer class="container text-right">';
echo '<label><small>' . _('Version') .' ' . $_SESSION['VersionNumber'] . ' | ' . DisplayDateTime() . '</small></label>';
echo '</footer>';
echo '<hr>';

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