<div class="list-group">
  <div class="list-group-item"><i class="fa fa-fw fa-trash-o"></i> <?php echo $wo['lang']['delete_account']; ?> <?php if(Wo_IsAdmin($wo['user']['user_id']) === true) { ?><a href="<?php echo $wo['setting']['url'];?>">(<?php echo $wo['setting']['name'];?>)</a><?php } ?></div>
   <div class="setting-well">
   <form action="#" method="post" class="form-horizontal setting-delete-account-form">
      <fieldset>
         <div class="setting-delete-account-alert setting-update-alert"></div>
         <div class="form-group">
            <label class="col-md-3" for="password"><?php echo $wo['lang']['current_password']; ?></label>
            <div class="col-md-6">
               <input id="password" name="password" type="password" class="form-control input-md">
            </div>
         </div>
         <hr>
         <div class="form-group last-btn">
            <label class="col-md-3"></label>
            <div class="col-sm-3 text-left">
               <button type="submit" class="form-control btn-main">
               <i class="fa fa-remove progress-icon" data-icon="remove"></i> <?php echo $wo['lang']['delete']; ?>
               </button>
            </div>
         </div>
      </fieldset>
   </form>
</div>
</div>
<script type="text/javascript">
$(function() {
  $('form.setting-delete-account-form').ajaxForm({
    url: Wo_Ajax_Requests_File() + '?f=delete_user_account',
    beforeSend: function() {
      Wo_progressIconLoader($('form.setting-delete-account-form').find('button'));
    },
    success: function(data) {
      if (data.status == 200) {
        $('.setting-delete-account-alert').html('<div class="alert alert-success">' + data.message + '</div>');
        $('.alert-success').fadeIn('fast', function() {
          window.setTimeout(function() {
            window.location.href = data.location;
          }, 3000);
        });
      } else {
        var errors = data.errors.join("<br>");
        $('.setting-delete-account-alert').html('<div class="alert alert-danger">' + errors + '</div>');
        $('.alert-danger').fadeIn(300);
      }
      Wo_progressIconLoader($('form.setting-delete-account-form').find('button'));
    }
  });
});
</script>