<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">

	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="description" content="">
	<meta name="author" content="ThemeBucket">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<link rel="shortcut icon" href="https://wingschauffeurltd.com/wings/images/cancrete.png">

	<title>Booking System</title>

	<!--Core CSS -->
	<link href="https://wingschauffeurltd.com/wings/font-awesome/css/font-awesome.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://wingschauffeurltd.com/wings/css/bootstrap.css">
	<link rel="stylesheet" href="https://wingschauffeurltd.com/wings/css/style.css">
	<link rel="stylesheet" href="https://wingschauffeurltd.com/wings/css/bootstrap.min.css">
	<link href="https://wingschauffeurltd.com/wings/css/style-responsive.css" rel="stylesheet" />

	<script src="https://code.jquery.com/jquery-latest.min.js"></script>
	<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
	<link href='https://fonts.googleapis.com/css?family=Coda+Caption:800|Pacifico|Hind|Anton|Chewy|Bangers|Montserrat:400,700' rel='stylesheet' type='text/css'>
</head>
  <body class="login-body">

    <div class="container" id="login_box">

      <div class="form-signin" >
      <div id="message">
        <h2 class="form-signin-heading">Cab Ezy Log In</h2>
      </div>  
        <div class="login-wrap">
            <div class="user-login-info">
            	Enter Your User Name
                <input id="user_name" type="text" class="form-control" name="user_name" placeholder="User ID" autofocus onkeypress="return textonly(event);">
                Enter Your PIN (Numeric Only)
                <input id="pin" maxlength="5" type="password" class="input_text form-control" name="pin" placeholder="Enter Your 5 Numbers PIN" onkeypress="return numericonly(event);">
            </div>
          <!--
            <label class="checkbox">
                <input type="checkbox" value="remember-me"> Remember me
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> </a>

                </span>
            </label>
           -->
            <button class="btn btn-lg btn-login btn-block" id="authorise">Sign in</button>
<!--
            <div class="registration">
                Don't have an account yet?
                <a class="" href="registration.html">
                    Create an account
                </a>
            </div>
-->
        </div>

          <!-- Modal -->
          <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
              <div class="modal-dialog">
                  <div class="modal-content">
                      <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                          <h4 class="modal-title">Forgot Password ?</h4>
                      </div>
                      <div class="modal-body">
                          <p>Enter your e-mail address below to reset your password.</p>
                          <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

                      </div>
                      <div class="modal-footer">
                          <button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
                          <button class="btn btn-success" type="button">Submit</button>
                      </div>
                  </div>
              </div>
          </div>
          <!-- modal -->

      </div>

    </div>



    <!-- Placed js at the end of the document so the pages load faster -->

    <!--Core js-->
    <!--<script src="https://wingschauffeurltd.com/wings/js/jquery.js"></script>
    <script src="https://wingschauffeurltd.com/wings/bs3/js/bootstrap.min.js"></script>
	<script src="https://wingschauffeurltd.com/wings/custom_js/jas_functions.js"></script>
	<script type = "text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script> -->
	
<script type="text/javascript">
$('#authorise').click(function(){
	var attempt = 3;
	var user_name=$('#user_name').val();
	var pin=$('#pin').val();
	if(user_name=='')
	{  
		alert("Please fill User Name");
	    $('#user_name').focus();
		
		}
	if(pin=='')
	{  
		alert("Please enter your PIN");
	    $('#pin').focus();
		
		}
	var dataString ='user_name=' + user_name+'&pin=' + pin;
	$.ajax({
                    type: "POST",
					url:"ajax/signin.php",
					data:dataString,
					
					success: function(data){
						
						if(data=='Failed')
						{
						 $('#login_box').effect( "shake", {times:4}, 1000 );
						
						 $('#message').html('<h2 class="form-signin-heading"  style="background-color:#F4070B; color:#EDE7E7;">Oops !! Login Failed</h2>');
						 $('#user_name').val("");
						 $('#pin').val("");
						 $('#user_name').focus();
						 
						 
        					}
							/*
							if(data=='Teacher')
							{
								window.location="teacher_dashboard.php";
								
								}
							if(data=='Student')
							{
								window.location="student_to_do.php";
								
								}
								*/
							if(data=='admin')
							{
								window.location="dashboard.php";
								
								}
					 	}
	});
});
</script>
  </body>
</html>
