<?php echo Wo_LoadPage('welcome/welcome-header');?>
<div class="wrapper">
	<div class="login forgot_pass fadeInUp animated animated_5">
		<form id="confirm-form" class="fadeInUp animated animated_9" method="post">
			<p class="title"><?php echo $wo['lang']['confirm_your_account']?></p>
			<p><?php echo $wo['lang']['sign_in_attempt']?></p>
			<p><?php echo $wo['lang']['we_have_sent_you_code']?></p>
			<div class="errors"></div>
			<div class="wow_form_fields">
				<label for="confirm_code">Confirmation code</label>
				<input id="confirm_code" name="confirm_code" type="text" autofocus />
			</div>
			<div class="login_signup_combo">
				<div class="login__">
					<button type="submit" class="btn btn-main btn-mat btn-mat-raised add_wow_loader"><?php echo $wo['lang']['confirm']?></button>
				</div>
				<div class="signup__"></div>
			</div>
		</form>
	</div>
</div>
<div class="container"><?php echo Wo_LoadPage('footer/welcome');?></div>

<script>
var working = false;
var $this = $('#confirm-form');
var $state = $this.find('.errors');
$(function() {
  $this.ajaxForm({
    url: Wo_Ajax_Requests_File() + '?f=confirm_user_unusal_login',
    beforeSend: function() {
		working = true;$this.find('button').attr("disabled", true);
		$this.find('.add_wow_loader').addClass('btn-loading');
    },
    success: function(data) {
      if (data.status == 200) {
        $state.addClass('success');
        $state.html('<?php echo $wo['lang']['welcome_'] ?>');
		$this.find('.add_wow_loader').removeClass('btn-loading');
        setTimeout(function () {
         window.location.href = data.location;
        }, 1000);
      } else {
        $this.find('button').attr("disabled", false);
		$this.find('.add_wow_loader').removeClass('btn-loading');
        $state.html(data.errors);
      }
      working = false;
    }
  });
});
</script>