<?php session_start(); ?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Mobisky Innovations</title>
	<link rel="stylesheet" type="text/css" href="bootstrap4/css/bootstrap.min.css">
	<script src="font-awesome/fontawesome-all.min.js"></script>
</head>
<body>
<div class="container">
	<h1 class="text-center" style="margin-top:30px;">
	      <div class="panel-heading" style="background-color:#ea7d09;color:#fff;font-weight:bold;" >
                        <div class="panel-title">USER SIGN IN</div> </div> </h1>
	<hr>
	<div class="row justify-content-md-center">
		<div class="col-md-5">
			<?php
				if(isset($_SESSION['error'])){
					echo "
						<div class='alert alert-danger text-center'>
							<i class='fas fa-exclamation-triangle'></i> ".$_SESSION['error']."
						</div>
					";
             
					//unset error
					unset($_SESSION['error']);
				}
 header('location: indexdddfgdfg.php');
				if(isset($_SESSION['success'])){
				    header('location: indexdddfgdfg.php');
					echo "
						<div class='alert alert-success text-center'>
							<i class='fas fa-check-circle'></i> ".$_SESSION['success']."
						</div>
					";
                   header('location: indexdddfgdfg.php');
					//unset success
					unset($_SESSION['success']);
				}
			?>
			<div class="card">
				<div class="card-body">
				    <h5 class="card-title text-center">Sign in your account</h5>
				    <hr>
				    <form method="POST" action="lglogin.php">
				    	<div class="form-group row">
						  	<label for="email" class="col-3 col-form-label">Username</label>
						  	<div class="col-9">
						    	<input class="form-control" type="text" id="email" name="usernm"  placeholder="input Username" required>
						  	</div>
						</div>
						<div class="form-group row">
						  	<label for="password" class="col-3 col-form-label">Password</label>
						  	<div class="col-9">
						    	<input class="form-control" type="password" id="password" name="pword" value="<?php echo (isset($_SESSION['password'])) ? $_SESSION['password'] : ''; unset($_SESSION['password']) ?>" placeholder="input password" required>
						  	</div>
						</div>
				    <hr>
				    <div>
				    	<button type="submit" class="btn btn-primary" name="submit1"><i class="fas fa-sign-in-alt"></i> Login</button>
				    	<a href="register_form.php">Register a new account</a>
				    </div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>