<?php
include("config.php");


$uname = isset($_POST['username']) ? $_POST['username']:'';
$pass = isset($_POST['password']) ? $_POST['password']:'';
    

    
    
    if(isset($_POST['submit'])){
        $db=$conn->prepare("SELECT * FROM admin WHERE username=? && password=?");
        $db->bind_param("ss", $uname,$pass);
        $db->execute();
        $result = $db->get_result();
        
        if($result->num_rows ===0){
            $url2 = 'index.php';   
    
            echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url2.'">';
        }else{
            
            
            
            
            $url = 'Main/index.php';   
    
            echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'; 

        }
        
        
    }


?>


<!DOCTYPE html>

<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <link rel="shortcut icon" href="https://www.expertbotsfx.com/user/admin/img/favicon.png">

  <title>Admin Dashboard</title>

  <!-- Bootstrap CSS -->
  <link href="css/bootstrap.min.css" rel="stylesheet">
  <!-- bootstrap theme -->
  <link href="css/bootstrap-theme.css" rel="stylesheet">
  <!--external css-->
  <!-- font icon -->
  <link href="css/elegant-icons-style.css" rel="stylesheet">
  <link href="css/font-awesome.css" rel="stylesheet">
  <!-- Custom styles -->
  <link href="css/style.css" rel="stylesheet">
  <link href="css/style-responsive.css" rel="stylesheet">

  
</head>

<body class="login-img3-body">

  <div class="container">

    <form method="POST" class="login-form">
      <div class="login-wrap">
        <p class="login-img"><i class="icon_lock_alt"></i></p>
        <div class="input-group">
          <span class="input-group-addon"><i class="icon_profile"></i></span>
          <input type="text" name="username" class="form-control" placeholder="Username" autofocus="">
        </div>
        <div class="input-group">
          <span class="input-group-addon"><i class="icon_key_alt"></i></span>
          <input type="password" name="password" class="form-control" placeholder="Password">
        </div>
        <label class="checkbox">
                <input type="checkbox" value="remember-me"> Remember me
                <span class="pull-right"> <a href="#"> Forgot Password?</a></span>
            </label>
        <button class="btn btn-primary btn-lg btn-block" type="submit" name="submit">Sign in</button>
        
      </div>
    </form>
    <div class="text-right">
      <div class="credits">

         
        </div>
    </div>
  </div>





</body></html>