<?php 
include('master/config.php');
 session_start();
if(isset($_SESSION['username'])){
     header('Location:dashboard.php');
}
if(isset($_POST['submit']))
{
    
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    $sql = "SELECT * FROM admin where username = '".$username."' AND  password = '".$password."' ";
    $query = mysqli_query($conn,$sql);
    $num_row = mysqli_num_rows($query);
   
  // echo $num_row;
  if($num_row > 0){
      $_SESSION['username'] = $username;
      header('Location:dashboard.php?msg=1');
  }else{
      header('Location:index.php?msg=1');
  }
   
   
}
?>
<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Favicon icon -->
    <link rel="icon" type="image/png" sizes="16x16" href="../favicon.ico">
    <title>iGlobe Solutions | Admin Panel</title>
   <?php require('master/link.php');?>
   <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<style>
    body{
    background: url(http://mymaplist.com/img/parallax/back.png);
	background-color: #444;
    background: url(http://mymaplist.com/img/parallax/pinlayer2.png),url(http://mymaplist.com/img/parallax/pinlayer1.png),url(http://mymaplist.com/img/parallax/back.png);    
}

.vertical-offset-100{
    padding-top:100px;
}
</style>
</head>

<body>
   
    <div class="preloader">
        <div class="lds-ripple">
            <div class="lds-pos"></div>
            <div class="lds-pos"></div>
        </div>
    </div>
    
    <div id="main-wrapper" data-layout="vertical" data-navbarbg="skin5" data-sidebartype="full" data-sidebar-position="absolute" data-header-position="absolute" data-boxed-layout="full">
       
   
     
        <div class="page-wrapper" style="margin-left: 0px !important;">
          
   
          
            <div class="container-fluid">
            
             <div class="row vertical-offset-100">
                 
    	<div class="col-md-4 col-md-offset-4">
    	    <?php if(isset($_GET['msg']) && $_GET['msg'] == 1){?>
    	      <div class="alert alert-info alert-dismissible show" role="alert">
                  <strong>Info!</strong> Incorrect username or password.
                  <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                  </button>
                </div>
                
                <?php } ?>
    		<div class="panel panel-default">
			  	<div class="panel-heading">
			    	<h3 class="panel-title">Please sign in</h3>
			 	</div>
			  	<div class="panel-body">
			    	<form action="" method="post">
                    <fieldset>
			    	  	<div class="form-group">
			    		    <input class="form-control" placeholder="Username" name="username" type="text">
			    		</div>
			    		<div class="form-group">
			    			<input class="form-control" placeholder="Password" name="password" type="password" value="">
			    		</div>
			    	
			    		<button class="btn btn-lg btn-success btn-block" name="submit" type="submit">Login</button>
			    	</fieldset>
			      	</form>
			    </div>
			</div>
		</div>
	</div>
              
             
              
            </div>
           
          
          
        </div>
       
    </div>
    
   <?php require('master/footer.php');?>
   <script>
//       $(document).ready(function(){
//   $(document).mousemove(function(e){
//      TweenLite.to($('body'), 
//         .5, 
//         { css: 
//             {
//                 backgroundPosition: ""+ parseInt(event.pageX/8) + "px "+parseInt(event.pageY/'12')+"px, "+parseInt(event.pageX/'15')+"px "+parseInt(event.pageY/'15')+"px, "+parseInt(event.pageX/'30')+"px "+parseInt(event.pageY/'30')+"px"
//             }
//         });
//   });
// });
   </script>
</body>

</html>