<?php include("../connection.php"); ?>


<!DOCTYPE html>

<html lang="en">

  <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>Admin Panel</title>

    <!-- Bootstrap -->

    <link href="src/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <link href='http://fonts.googleapis.com/css?family=Roboto:900,300,400' rel='stylesheet' type='text/css'>

    <link href="src/css/sugarrush.css" rel="stylesheet" type="text/css">

 </head>

<?php

if(isset($_REQUEST['submit']))
{
  $admin_email_id=$_REQUEST['admin_email_id'];
  $admin_pass=$_REQUEST['admin_pass'];

    $sql_select = "SELECT * FROM `tbl_admin` WHERE `username` ='$admin_email_id' && `password` ='$admin_pass'";
   $run_select = mysqli_query($link,$sql_select);
   $reslt = mysqli_fetch_assoc($run_select);
   

  if($admin_pass==$reslt['password'])
  {
  $_SESSION['user_id']=$reslt['id'];  
  $_SESSION['user_name']=$reslt['username'];
  echo "<script type='text/javascript'> window.location.href = 'dashboard.php'; </script>";
  }
  else
  {
    $msg="Sorry you have input wrong id or password";
  }
}

?>

<body class="login-page">

    <div class="animsition">



      <main class="login-container">


        <div class="panel-container">

          <section class="panel">

            <header class="panel-heading">

            <?php if($msg!=""){ ?><h6 style="color:#F00;"><?php echo $msg; ?></h6><?php } ?>

              <h2 style="color:#bd5151;">ICV Assessments PVT. LTD</h2>

              <p>Admin Panel</p>

            </header>

            <div class="panel-body">

              <form method="post">

                <div class="form-group">

                  <label for="username">Username</label>

                  <input type="mail" class="form-control" name="admin_email_id"  placeholder="Username" required>

                </div>



      <div class="form-group">

                  <label for="password">Password</label>

                  <input type="password" class="form-control" name="admin_pass" placeholder="Password" required>

                </div>

                

                <div class="form-group text-center">

                 <button class="btn-login btn btn-primary" name="submit">Sign in</button>

                </div>



                <hr>

                <div class="social-login" align="center">

                 <img src="src/img/download.png" class="img-responsive">

                </div>

              </form>

              <hr>

            </div>

          </section>

        </div>

      </main> 

      <script src="src/js/jquery-1.11.2.min.js"></script>

      <script src="src/bootstrap/js/bootstrap.min.js"></script>

      <!-- Include all compiled plugins (below), or include individual files as needed -->

      <script src="src/js/animsition/dist/js/jquery.animsition.min.js"></script>

      <script src="src/js/login.js"></script>

    </div>

  </body>

</html>