<?php
if (isset($_SESSION['backend'][$session_name]) && $_SESSION['backend'][$session_name]){
	$user_id = $_SESSION['backend']['id_session'];
} else {
	print "
<div class='container login'>
	<p></p>
	<div class='form'>
		<div class='form-head'><i class='material-icons md-24'>login</i>".HEADLINE_LOGIN."</div>
		<div class='form-content'>
			<form action='index.php' method='post' enctype='multipart/form-data'>
				<input type='hidden' name='csrf_token' value='".htmlspecialchars(csrf_token())."'>
				<input type='hidden' name='url' value='".$_SERVER['SCRIPT_NAME']."?".$_SERVER['QUERY_STRING']."' />
				
				<div class='form-row'>
					<label for='login' class='form-label'>* ".LABEL_LOGINNAME."</label>
					<div class='form-cols'>
						<div class='form-col form-full'>
							<div class='form-controls'>
								<input type='text' class='field' id='login' name='login' value=''>
							</div><!-- /.form-controls -->
						</div><!-- /.form-col -->
					</div><!-- /.form-cols -->
				</div><!-- /.form-row -->
				
				<div class='form-row'>
					<label for='password' class='form-label'>* ".LABEL_PASSWORD."</label>
					<div class='form-cols'>
						<div class='form-col form-full'>
							<div class='form-controls'>
								<input type='password' class='field' id='password' name='password' value=''>
							</div><!-- /.form-controls -->
						</div><!-- /.form-col -->
					</div><!-- /.form-cols -->
				</div><!-- /.form-row -->
				
				<hr/>";
				
	if (isset($_GET['login_error'])){
		print "
				<div class='alert error'>
					<strong>".LABEL_ERROR."</strong>
					".LABEL_ERROR_LOGIN."
				</div>
				
				<hr/>";
	}

	print "			
				<div class='form-action'>
					<button type='submit' class='btn login' name='cmd_login' title='".LABEL_LOGIN."'><i class='material-icons md-24'>login</i>".LABEL_LOGIN."</button>
				</div><!-- /.form-action -->
				
			</form>
		</div><!-- /.form-content -->
	</div><!-- /.form -->
	<p>".LABEL_IMPRINT."</p>
</div><!-- /.container -->";
}