<?php
include_once"db.php";
if (isset($_POST['login'])){

	$email = $_POST['email'];
	$pass =  $_POST['password'];
	
	$user = "SELECT * FROM admin WHERE email='$email' AND  password='$pass'";
	$run_user = mysqli_query($conn, $user);
	$check_user = mysqli_num_rows($run_user);
	if($check_user==0){
	
	echo "<script>alert('Please check your login credentials')</script>";	
	
	}
	else {
	$_SESSION['email']=$email;
	echo"<script>window.open('customer_data','_self')</script>";
	}
	}
?>
<!DOCTYPE html>
<html dir="ltr">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>CMS | Travelobien</title>
    
    <link href="css/login.css" rel="stylesheet">
	<link href="css/core.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
 <style>
 /*.bgColor{
	background:rgb(0, 0, 0, 0.5) !important;
}*/
</style>
</head>
<body id="adminBanner" style="background-image:url('assets/images/admin-background.jpg');">
    <div class="main-wrapper">
        <div class="preloader">
            <div class="lds-ripple">
                <div class="lds-pos"></div>
                <div class="lds-pos"></div>
            </div>
        </div>
        <div class="auth-wrapper d-flex no-block justify-content-center align-items-center" style="background:url(assets/images/background/login-register.jpg) no-repeat center center; background-size: cover;">
            <div class="auth-box p-4 bg-white rounded bgColor">
                <div id="loginform">
                    <div class="logo">
                        <h3 class="box-title mb-3">Sign In</h3>
                    </div>
                    <!-- Form -->
                    <div class="row">
                        <div class="col-12">
                            <form class="form-horizontal mt-3 form-material" method="post" id="frmLogin">
                                <div class="form-group mb-3">
                                    <div class="">
                                        <input class="form-control" type="email" name="email" required="" placeholder="Email"> </div>
                                </div>
                                <div class="form-group mb-4">
                                    <div class="">
                                        <input class="form-control" type="password" name="password" required="" placeholder="Password"> </div>
                                </div>
                                <div class="form-group text-center mt-4">
                                    <div class="col-xs-12">
                                        <button class="btn btn-info btn-lg btn-block text-uppercase waves-effect waves-light" type="submit" name="login">Log In</button>
                                    </div>
                                </div>
                                
                            </form>
							<div id="result"><?php //echo $msg?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="login-asset/plugins/jquery/dist/jquery.min.js"></script>
    <script src="login-asset/plugins/popper.js/dist/umd/popper.min.js"></script>
    <script src="login-asset/plugins/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="js/core.js"></script>
    <script>
    $('[data-toggle="tooltip"]').tooltip();
    $(".preloader").fadeOut();
    $('#to-recover').on("click", function() {
        $("#loginform").slideUp();
        $("#recoverform").fadeIn();
    });
    </script>
</body>

</html>