<?php 

session_start(); 


include '../config/functions.php';
include '../config/db.php';
include '../config/config.php';

  
  $err = "";
  $msg = "";
  $email = $password = "";

  if (isset($_POST['login'])) {
     
        $email = trim($_POST['email']);
        $password = trim($_POST['password']);
      

   if (empty($error)) {
          $sql = mysqli_query($link, "SELECT * FROM admin WHERE email = '$email'  ");
          if (mysqli_num_rows($sql) > 0) {
              $row = mysqli_fetch_assoc($sql);
              $admin_email = $row['email'];
              $admin_password = $row['password'];

              if ($password == $admin_password ) {
                  $_SESSION['ADMIN_LOGIN'] = $admin_email;
                  echo "<script>
            window.location.href = 'dashboard.php';
          </script>";
              }else{
                 echo "<script>
             alert('Incorrect admin password');
          </script>";

              }
          }else{
              echo "<script>
             alert('Incorrect username');
          </script>";
             
          }
      }
  }

     

 ?>
<!DOCTYPE html>
<html lang="en">

  
<!-- Mirrored from www.kodingwife.com/demos/templatemonster/arise/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 31 Jan 2024 07:36:22 GMT -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Bootstrap Gallery - Bootstrap Gallery Template</title>

    <!-- Meta -->
    <meta name="description" content="Marketplace for Bootstrap Admin Dashboards" />
    <meta name="author" content="Bootstrap Gallery" />
    <link rel="canonical" href="https://www.bootstrap.gallery/">
    <meta property="og:url" content="https://www.bootstrap.gallery/">
    <meta property="og:title" content="Admin Templates - Dashboard Templates | Bootstrap Gallery">
    <meta property="og:description" content="Marketplace for Bootstrap Admin Dashboards">
    <meta property="og:type" content="Website">
    <meta property="og:site_name" content="Bootstrap Gallery">
    <link rel="shortcut icon" href="assets/images/favicon.svg" />

    <!-- Title -->
    <title>Arise Admin Template - Admin Dashboard</title>


    <!-- *************
			************ Common Css Files *************
		************ -->

    <!-- Animated css -->
    <link rel="stylesheet" href="assets/css/animate.css">

    <!-- Bootstrap font icons css -->
    <link rel="stylesheet" href="assets/fonts/bootstrap/bootstrap-icons.css">

    <!-- Main css -->
    <link rel="stylesheet" href="assets/css/main.min.css">


  </head>

  <body class="login-container">

    <!-- Loading wrapper start -->
    <!-- <div id="loading-wrapper">
			<div class="spinner">
                <div class="line1"></div>
				<div class="line2"></div>
				<div class="line3"></div>
				<div class="line4"></div>
				<div class="line5"></div>
				<div class="line6"></div>
            </div>
		</div> -->
    <!-- Loading wrapper end -->

    <!-- Login box start -->
    <form action="login.php" method="post">
      <div class="login-box">
        <div class="login-form">
          <a href="index.html" class="login-logo">
            <img src="assets/images/logo.svg" alt="Vico Admin" />
          </a>
          <div class="login-welcome">
            Welcome back, <br />Please login to your  admin account.
          </div>
          <div class="mb-3">
            <label class="form-label">Email</label>
            <input type="text" class="form-control" name="email">
          </div>
          <div class="mb-3">
          <label class="form-label">Password</label>
            <input type="password" class="form-control" name="password">
          </div>
          <div class="login-form-actions">
            <button type="submit" class="btn" name="login"> <span class="icon"> <i class="bi bi-arrow-right-circle"></i> </span>
              Login</button>
          </div>
        </div>
      </div>
    </form>
    <!-- Login box end -->

    <!-- *************
			************ Required JavaScript Files *************
		************* -->
    <!-- Required jQuery first, then Bootstrap Bundle JS -->
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/bootstrap.bundle.min.js"></script>
    <script src="assets/js/modernizr.js"></script>
    <script src="assets/js/moment.js"></script>

    <!-- *************
			************ Vendor Js Files *************
		************* -->

    <!-- Main Js Required -->
    <script src="assets/js/main.js"></script>

  </body>


<!-- Mirrored from www.kodingwife.com/demos/templatemonster/arise/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 31 Jan 2024 07:36:24 GMT -->
</html>