<?php require(SABLE_WORKING_PATH.'login/login_func.php'); ?>
<!--// Login -->
<script src="<?php SableGeneralFunctions::printModuleJS('login'); ?>"></script>
<form id="Login" name="Login">
	<input id="sId" type="hidden" value="<?php echo(SableSystem::sableEncode(session_id())); ?>">
	<div class="forms">
    	<!--// header -->
		<div class="container">
			<div class="row forms-grids">
				<div class="col-md-8 forms-grid">
					<h3 class="title"><i class="fa fa-sign-in-alt" aria-hidden="true"></i>&nbsp;Log In</h3>
					<p>Unauthorised access prohibited. Please log in using the credentials received via email. If you cannot remember your user name and/or password, please <a href="<?php echo(SableSystem::getCallPageLink('/login/forgotten.php')); ?>">click here</a>.</p>               
					<div class="clearfix"> </div>
				</div>
			</div>
        </div>       
        <!-- header //-->
    	<!--// user name -->
		<div class="container">
			<div class="row forms-grids">
				<div class="col-md-4 forms-grid">
						<input name="edtUserName" type="email" id="edtUserName" autocomplete="on" 
                        onfocus="showHint('edtUserName')" onblur="hideHint('edtUserName'); validate_edtUserName()" 
                        onkeypress="handleEnter(event)" value="<?= ($usr ?? '') ?>" placeholder="user name"/>				
				</div>
                <div class="col-md-4">
                    <div class="fieldHint" id="hint_edtUserName">Your assigned user name</div>
                </div>                
				<div class="clearfix"> </div>
			</div>
		</div>
        <!-- user name //-->
        <p></p>
        <!--// password -->
		<div class="container">
			<div class="row forms-grids">
				<div class="col-md-4 forms-grid">
				<input name="edtPassword" type="password" id="edtPassword" autocomplete="off"
					onfocus="showHint('edtPassword')"
					onblur="hideHint('edtPassword'); validate_edtPassword()" 
					onkeypress="handleEnter(event)" placeholder="password"/>
				<div class="view-password" onMouseDown="showHidePassword();" onMouseUp="showHidePassword();" 
				ontouchstart="showHidePassword();" ontouchend="showHidePassword();"><i class="fa fa-eye"></i></div>					
				</div>
                <div class="col-md-4 forms-grid">
                    <div class="fieldHint" id="hint_edtPassword">Your authentication password</div>
                </div>                
				<div class="clearfix"> </div>
			</div>
		</div>        
        <!-- password //-->
        <p></p>
        <!--// buttons -->
        <div class="container">
        	<div class="row forms-grids">
                <div class="col-xs-4 col-sm-3 col-md-2 col-lg-2 forms-grid">                            
                    <input type="button" id="btnCancel" value="Cancel"
                    class="submit" onclick="window.location = '<?php echo(SABLE_URL_ROOT); ?>'"/>
                </div>
                <div class="col-xs-4 col-sm-3 col-md-2 col-lg-2 forms-grid">                            
                    <input id="btnOk" type="button" onclick="userLogin()" value="Login" class="submit"/>
                </div>
            </div>                                            
        </div> 
        <!-- buttons //-->
        <div class="container">
        	<div class="row forms-grids">
                <div class="col-md-6 forms-grid">         
                 <p><i class="fa fa-question-circle" aria-hidden="true"></i>&nbsp;Forgot your password?&nbsp;<a href="<?php echo(SableSystem::getCallPageLink('/login/forgotten.php')); ?>" class="link_contrast">Click here to reset it.</a></p>       
                 </div>
            </div>
        </div>

        <div class="container">
        	<div class="row forms-grids">
                <div class="col-md-6 forms-grid">         
                 <p><i class="fa fa-user-lock" aria-hidden="true"></i>&nbsp;Not yet registered?&nbsp;<a href="<?php SableSystem::printSableLinkPath('user/join.php'); ?>" class="link_contrast">Sign up now!</a></p>       

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

        <div class="container">
        	<div class="row forms-grids">
                <div class="col-md-6 forms-grid">         
                 <p><i class="fa fa-envelope-open-text" aria-hidden="true"></i>&nbsp;Didn&rsquo;t get your activation email?&nbsp;<a href="<?php SableSystem::printSableLinkPath('login/resend.php'); ?>" class="link_contrast">Try resending.</a></p>       
                 </div>
            </div>
        </div>        

	</div>
</form>
<!-- Login //-->
<?php if (isset($usr)) echo('<script>document.getElementById("edtPassword").focus();</script>'); ?>