<div class="wo_settings_page wow_content">
	<div class="avatar-holder">
		<img src="<?php echo $wo['setting']['avatar']?>" alt="<?php echo $wo['setting']['name']?> Profile Picture" class="avatar">
		<div class="infoz">
			<h5 title="<?php echo $wo['setting']['name']?>"><a href="<?php echo Wo_SeoLink('index.php?link1=timeline&u=' . $wo['setting']['username'] . '');?>" data-ajax="?link1=timeline&u=<?php echo $wo['setting']['username'] ?>"><?php echo $wo['setting']['name']?></a></h5>
			<p><?php echo $wo['lang']['change_password']; ?></p>
		</div>
	</div>
	<hr>

	<form class="form-horizontal setting-change-password-form" method="post">
		<div class="setting-password-alert setting-update-alert"></div>
        
		<?php if ($wo['setting']['user_id'] == $wo['user']['user_id']) { ?>
		<div class="wow_form_fields">
			<label for="current_password"><?php echo $wo['lang']['current_password']; ?></label>  
			<input id="current_password" name="current_password" type="password" class="form-control input-md">
		</div>
		<?php } ?>
		<div class="row">
			<div class="col-md-6">
				<div class="wow_form_fields">
					<label for="new_password"><?php echo $wo['lang']['new_password']; ?></label>
					<input id="new_password" name="new_password" type="password" class="form-control input-md">
				</div>
			</div>
			<div class="col-md-6">
				<div class="wow_form_fields">
					<label for="repeat_new_password"><?php echo $wo['lang']['repeat_password']; ?></label>
					<input id="repeat_new_password" name="repeat_new_password" type="password" class="form-control input-md">
				</div>
			</div>
		</div>
		<hr>
		<div class="wow_form_fields">
			<label for="two_factor"><?php echo $wo['lang']['two_factor']; ?></label>  
			<select id="country" name="two_factor" class="form-control">
				<option value="1" <?php echo ($wo['setting']['two_factor'] == '1')   ? 'selected' : '';?> ><?php echo $wo['lang']['enable']; ?></option>
				<option value="0" <?php echo ($wo['setting']['two_factor'] == '0')   ? 'selected' : '';?> ><?php echo $wo['lang']['disable']; ?></option>
			</select>
		</div>
		
		<div class="text-center">
			<button type="submit" class="btn btn-main btn-mat btn-mat-raised add_wow_loader"><?php echo $wo['lang']['save']; ?></button>
		</div>

		<input type="hidden" name="user_id" value="<?php echo $wo['setting']['user_id'];?>">
        <input type="hidden" name="hash_id" value="<?php echo Wo_CreateSession();?>">
   </form>
</div>
<script type="text/javascript">
$(function() {
  $('form.setting-change-password-form').ajaxForm({
    url: Wo_Ajax_Requests_File() + '?f=update_user_password',
    beforeSend: function() {
      $('.wo_settings_page').find('.add_wow_loader').addClass('btn-loading');
    },
    success: function(data) {
      if (data.status == 200) {
        $('.setting-password-alert').html('<div class="alert alert-success">' + data.message + '</div>');
        $('.alert-success').fadeIn('fast', function() {
          $(this).delay(2500).slideUp(500, function() {
              $(this).remove();
          });
        });
        $('form.setting-change-password-form').clearForm();
      } else if (data.errors) {
        var errors = data.errors.join("<br>");
        $('.setting-password-alert').html('<div class="alert alert-danger">' + errors + '</div>');
        $('.alert-danger').fadeIn(300);
      }
      $('.wo_settings_page').find('.add_wow_loader').removeClass('btn-loading');
    }
  });
});
</script>