<?php 
require_once("../app/config.php");
session_start();
if(isset($_SESSION['offshore_userid']) ){
	redirect($url."/user");
}
$title='Sign in';
require_once("include/user_header.php");
?>
	<div class="page-content bg-white">

		<!-- Main content -->
		<div class="content-wrapper">
			<!-- Content area -->
			<div class="content d-flex justify-content-center align-items-center">
				<!-- Login form -->
				<form class="login-form" action="app/user/login" method="post">
<?php 
if(!empty($_SESSION['offshore_loginerror'])){?>
      	<div class="row">
            <div class="col-lg-12">
              <div class="alert bg-castro alert-dismissible text-castro">
                <button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
                	<span class="text-castro">
						<?php if($_SESSION['offshore_loginerror']=='eruptx') {
						 	echo'Current account session has ended, log in with new password.';
						} else if($_SESSION['offshore_loginerror']=='invaliddetails') {
							echo'Email or password entered is incorrect.';
						}else if($_SESSION['offshore_loginerror']=='success') {
							echo'Password was successfully recovered, login with your new password.';
						}else if($_SESSION['offshore_loginerror']=='email_versent') {
							echo'Verification email was successfully sent.';
						}else if($_SESSION['offshore_loginerror']=='email_failed') {
							echo'An error occured while sending verification email, try again later.';
						}else if($_SESSION['offshore_loginerror']=='blockeduser') {
							echo'Account has been suspended temporary.';
						}else if($_SESSION['offshore_loginerror']=='email_confirm') {
							echo'Account activated, Welcome to '.$set['site_name'];
						}
						unset($_SESSION['offshore_loginerror']);?>						
					</span>                 
                </div>
              </div>
          </div>
<?php }
if(!empty($_SESSION['offshore_status'])){?>
            <div class="col-lg-12">
              <div class="alert bg-success text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>&times;</span></button>
<?php 
if($_SESSION['offshore_status']=='success') {
    echo'Registration was successful';
}
unset($_SESSION['offshore_status']);?>                 
                </div>
              </div>
<?php }?>
					<div class=" mb-0">
						<div class="card-body">
							<div class="text-center mb-3">
								<a href="./"><img src="asset/<?php echo $logo['image_link']; ?>" style="max-width:70%; height:auto;" class=""></a>
								<h5 class="mb-0">Log in into your account</h5>
								<span class="d-block">You still don't have a <?php echo $set['site_name'];?> account? <a class="text-green" href="./register">Click here</a></span>
							</div>

							<div class="form-group form-group-feedback form-group-feedback-right">
								<input type="email" class="form-control" placeholder="Email" name="email" required>
								<div class="form-control-feedback">
									<i class="icon-envelop text-green"></i>
								</div>
							</div>

							<div class="form-group form-group-feedback form-group-feedback-right">
								<input type="password" class="form-control" name="password" placeholder="Password" required>
								<div class="form-control-feedback">
									<i class="icon-lock2 text-green"></i>
								</div>
							</div>
							<div class="text-center mb-3">
								<span class="d-block">Did you forget your password? <a class="text-green" href="./forgot">Click here</a></span>
							</div>
							<div class="form-group text-center">
								<button type="submit" class="btn text-green-800 bg-green-800 rounded-round">Sign in</button>
							</div>
						</div>
					</div>
				</form>
				<!-- /login form -->

			</div>
			<!-- /content area -->


			<!-- Footer -->

			<!-- /footer -->

		</div>
		<!-- /main content -->

	</div>
<?php require_once("include/user_footer.php"); ?>