<?php
	// INCLUDE HEADER IN PAGE
	include('other_header.php');
	// GET CURRENT DATE AND TIME
	$date = date('Y-m-d H:i:s');
	// Generate CSRF token to use in form hidden field
	$token = NoCSRF::generate( 'csrf_token' );
?>
  <div class="container">
    <div class="text-center">
      <h1><?php echo $title; ?>
      	<small>/Logging into: Admin account
			</small>
		</h1>
 	 </div>
		</br>
	 <div class="row">
      <div class="col-md-8 col-md-offset-2">
		<div class="row">
			<div class="col-md-8 col-md-offset-2">
			<?php
				// WHEN USER ALREADY SUBMITTED CONTACT FORM
				if(mysql_real_escape_string($_POST['submit'])) {
					// GET DATA FROM FORM
					$name = mysql_real_escape_string($_POST['name']);
					$title1 = mysql_real_escape_string($_POST['title']);
					$message = mysql_real_escape_string($_POST['message']);
					$email = mysql_real_escape_string($_POST['email']);
					// IF ALL DATA ARE OK
					if($name&&$title1&&$message&&$email) {
						// IMPORT MESSAGE TO DB
						$addmsg = mysql_query("INSERT INTO support VALUES('','$name','$email','$date','$uip','$title1','$message','0')");
						?>
							<div class="alert alert-success">
								<button type="button" class="close" data-dismiss="alert">×</button>
								<strong><i class="fa fa-check"></i></strong> <?php echo $a232; ?>
							</div>
						<?php
					}
					// WHEN COULDN'T IMPORT MESSAGE TO DB PRINT ERROR INFO
					else{
					?>
						<div class="alert alert-danger">
							<button type="button" class="close" data-dismiss="alert">×</button>
							<strong><i class="fa fa-frown-o"></i></strong> <?php echo $a238; ?>
						</div>
					<?php
					}
				}
			?>
			<form name="csrf_form" method="POST">
				<div class="input-group">
					<span style="width: 100px;" class="input-group-addon">Username</span>
					<input style="width: 350px;" type="text" class="form-control" name="username">
					<input type="hidden" name="csrf_token" value="<?php echo $token; ?>">
				</div>
				<div class="input-group">
					<span style="width: 100px;" class="input-group-addon">Password</span>
					<input style="width: 350px;" type="password" class="form-control" name="password">
				</div>
				<div class="input-group">
					<span style="width: 100px;" class="input-group-addon">PIN</span>
					<input type="number" style="margin: 0px; width: 50px; overflow: hidden; white-space: nowrap; margin-right: 5px;" class="form-control" min="0" max="9" step="1" name="pin1">
					<input type="number" style="margin: 0px; width: 50px; overflow: hidden; white-space: nowrap; margin-right: 5px;" class="form-control" min="0" max="9" step="1" name="pin2">
					<input type="number" style="margin: 0px; width: 50px; overflow: hidden; white-space: nowrap; margin-right: 5px;" class="form-control" min="0" max="9" step="1" name="pin3">
					<input type="number" style="margin: 0px; width: 50px; overflow: hidden; white-space: nowrap; margin-right: 5px;" class="form-control" min="0" max="9" step="1" name="pin4">
				</div>
				<div class="input-group">
					<input name="submit" value="<?php echo"$a094"; ?>" class="btn btn-info btn-block btn-lg" type="submit">
				</div>
			</form>
			</div>
			</br>
			</br>
			</br>
        </div>
      </div>
    </div>
	</div>

<?php
include('other_footer.php');
?>