<?php 
session_start();
include("connect/config.php");
include("validate-scripts.php");

function GeraHash($qtd){ 
$Caracteres = '123456789'; 
$QuantidadeCaracteres = strlen($Caracteres); 
$QuantidadeCaracteres--; 
$Hash=NULL; 
    for($x=1;$x<=$qtd;$x++){ 
        $Posicao = rand(0,$QuantidadeCaracteres); 
        $Hash .= substr($Caracteres,$Posicao,1); 
    } 
return $Hash; 
} 
$randum_number=GeraHash(3);
$_SESSION['randum_number']=$randum_number;
?>
<!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<head>
<title>Login :: <?php echo $CompnayTitle_Name;?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap-css -->
<link rel="stylesheet" href="css/bootstrap.min.css" >
<!-- //bootstrap-css -->
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<link href="css/style-responsive.css" rel="stylesheet"/>
<!-- font CSS -->
<link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- font-awesome icons -->
<link rel="stylesheet" href="css/font.css" type="text/css"/>
<link href="css/font-awesome.css" rel="stylesheet"> 
<link rel="stylesheet" href="sweet/sweet-alert.css">
<!-- //font-awesome icons -->
<script src="js/jquery2.0.3.min.js"></script>
</head>
<body on contextmenu="return false;" onselectstart="return false;" ondragstart="return false;">

<?php
// Check for error message in session
if (isset($_SESSION['errorMessage'])) {
$errorMessage = $_SESSION['errorMessage'];
?>
                      <script src="sweet/sweet-alert.js"></script>
                      <script>
                        Swal.fire({
                          icon: 'error',
                          title: 'Login Failed',
                          text: '<?php echo $errorMessage; ?>',
                          confirmButtonText: 'OK'
                        });
					</script>
<?php  unset($_SESSION['errorMessage']); } ?>


<div class="log-w3">
<div class="w3layouts-main">
	<h2>Sign In Now</h2>
		<form action="log_action.php" method="post" autocomplete="off">
			<input type="text" class="ggg" name="signInEmail" onkeypress="restrictusername(event)" placeholder="USERNAME" required="">
			<input type="password" class="ggg" onkeypress="restrictpassword(event)" name="signInPassword" placeholder="PASSWORD" required="">
			<input type="number" class="ggg" onkeypress="restrictnumber(event)" name="captcha" placeholder="Security Code" min="0" required="">
			<h2 style="color:#444;"><?=$randum_number; ?></h2>
			<!----<span><input type="checkbox" />Remember Me</span>
			<h6><a href="#">Forgot Password?</a></h6>---->
				<div class="clearfix"></div>
				<input type="submit" value="Sign In" name="login">
		</form>
		<!---<p>Don't Have an Account ?<a href="registration.html">Create an account</a></p>--->
</div>
</div>
<script src="js/bootstrap.js"></script>
<script src="js/jquery.dcjqaccordion.2.7.js"></script>
<script src="js/scripts.js"></script>
<script src="js/jquery.slimscroll.js"></script>
<script src="js/jquery.nicescroll.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="js/jquery.scrollTo.js"></script>


<script src="js/drcvl131.js"></script>
<script>
$(document).ready(function(){
   $(document).bind("contextmenu",function(e){
      return false;
   });
});
</script>


</body>
</html>
