<?php 
	Template::Show('login_temp_head.php'); 
	
	/* Add 4 closing div tags in the end of this page */
	
	/*       
		<!-- END Login Form -->
    </div>
    <!-- END Login Block -->
</div>
</div>
</div>

</div>

<!-- Login Container -->

<!-- END Login Container --> */

?>
    	
		<?php 
        	$authcode1 = $_GET['code'];
        	$pilot = ICSData::getPilotData($authcode1); 
        	$pid = $pilot->pilotid;
        	
        	if($authcode1 == $pilot->password_reset) {
        	?>
        	<div class="alert alert-warning">
            <h4><i class="fa fa-check-circle"></i> Account Verified!</h4> Continue to reset your password
        	</div>
        	<?php } else { ?>
        	<div class="alert alert-danger">
            <h4><i class="fa fa-times"></i> Invalid Auth Code!</h4> Unable to process
        	</div>
        	<?php return; } ?>
        
        	<form action="<?php echo url('/login/authpassreset');?>" method="POST" class="form-horizontal form-bordered form-control-borderless">
        	
    		<div class="form-group">
                <div class="col-xs-12">
                    <div class="input-group">
                    	<span class="input-group-addon"><i class="gi gi-user"></i></span>
                        <input class="form-control" type="text" name="username" value="<?php echo $pilot->firstname.' '.$pilot->lastname; ?>" disabled>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-12">
                	<!--<label class="form-group" for="email">Secret Authentication Code</label>-->
                    <div class="input-group">
                    	<span class="input-group-addon"><i class="fa fa-lock"></i></span>
                        <input class="form-control" id="authcode" type="text" name="authcode" placeholder="Enter the 30 Digit Authentication Code" value="<?php echo $_GET['code']; ?>">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-6">
                    <div class="input-group">
                    	<span class="input-group-addon"><i class="gi gi-asterisk"></i></span>
                        <input class="form-control" id="password" type="password" name="newpassword1" placeholder="Enter New Password" value="">
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="input-group">
                    	<span class="input-group-addon"><i class="gi gi-asterisk"></i></span>
                        <input class="form-control" type="password" name="newpassword2" placeholder="Confirm New Password" value="">
                    </div>
                </div>
            </div>
    		<div class="form-group form-actions">
        		<div class="col-xs-12 text-right">
            		<input type="hidden" name="action" value="resetpass" />
            		<input type="hidden" name="pid" value="<?php $pid; ?>" />
   					<input class="btn btn-sm btn-primary" type="submit" name="submit" value="Reset Password" />
        		</div>
    		</div>
    		<div class="form-group">
        		<div class="col-xs-12 text-center">
            		<small>Did you remember your password?</small> <a href="<?php echo url('/login'); ?>" id="link-reminder"><small>Login</small></a>
        		</div>
    		</div>
		</form>
	<!-- END Login Form -->
    </div>
    <!-- END Login Block -->
</div>
</div>
</div>

</div>

<!-- Login Container -->

<!-- END Login Container --> 