<?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">Confrim your phone</p>
			<div class="errors"></div>
			<div class="wow_form_fields">
				<label for="phone_num"><?php echo $wo['lang']['phone_number']?></label>
				<input id="phone_num" name="phone_num" type="text" value="<?php echo $wo['confirm_user']['phone_number'];?>" />
			</div>
			<div class="wow_form_fields">
				<label for="confirm_code">Confirmation code</label>
				<input id="confirm_code" name="confirm_code" type="text" autofocus />
			</div>
			<input type="hidden" name="user_id" id="confirm-user-id" value="<?php echo $wo['confirm_user']['user_id'];?>"/>
			<div id="hideMsg" class="item">
				<h2><span>60</span></h2>
			</div>
			<div class="form-group" id="re-send" style="display:none">
				<div class="text-center"><?php echo $wo['lang']['activation_get_code_again'];?> <a href="javascript:void(0);" onclick="Wo_ResendCode();"><i class="fa fa-repeat"></i> <?php echo $wo['lang']['activation_resend'];?></a>
				</div>
			</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() {
  Wo_SetTimer();
  $this.ajaxForm({
    url: Wo_Ajax_Requests_File() + '?f=confirm_user',
    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>