<?php
$user_id                = $wo['user']['user_id'];
$wo['setting']['admin'] = false;
if (isset($_GET['user']) && !empty($_GET['user']) && Wo_IsAdmin($wo['user']['user_id']) === true) {
    if (Wo_UserExists($_GET['user']) === false) {
        header("Location: " . Wo_SeoLink('index.php?tab1=home'));
        exit();
    }
    $user_id                = Wo_UserIdFromUsername($_GET['user']);
    $wo['setting']['admin'] = true;
}
$wo['setting'] = Wo_UserData($user_id);
?>

<div class="page-margin">
   <div class="row">
      <div class="col-lg-8">
         <ul class="nav nav-tabs">
            <li class="active">
               <a href="#general-setting" data-toggle="tab">
               <i class="fa fa-cogs"></i> 
               <span class="setting-tab-text"><?php echo $wo['lang']['general'];?></span>
               </a>
            </li>
            <li>
               <a href="#profile-setting" data-toggle="tab">
               <i class="fa fa-user"></i>
               <span class="setting-tab-text"><?php echo $wo['lang']['profile'];?></span>
               </a>
            </li>
            <li>
               <a href="#privacy-setting" data-toggle="tab">
               <i class="fa fa-lock"></i>
               <span class="setting-tab-text"><?php echo $wo['lang']['privacy'];?></span>
               </a>
            </li>
            <li>
               <a href="#change-password-setting" data-toggle="tab">
               <i class="fa fa-key"></i>
               <span class="setting-tab-text"><?php echo $wo['lang']['password'];?></span>
               </a>
            </li>
            <?php if($wo['config']['deleteAccount'] == 1 && $wo['user']['user_id'] == $wo['setting']['user_id']) { ?>
            <li>
               <a href="#delete-setting" data-toggle="tab">
               <i class="fa fa-user-times"></i>
               <span class="setting-tab-text"><?php echo $wo['lang']['delete_account'];?></span>
               </a>
            </li>
            <?php }?>
         </ul>
         <div class="tab-content" id="tabs">
            <div class="tab-pane active" id="general-setting">
               <?php echo Wo_LoadPage('setting/general'); ?>
            </div>
            <div class="tab-pane" id="profile-setting">
               <?php echo Wo_LoadPage('setting/profile'); ?>
            </div>
            <div class="tab-pane" id="privacy-setting">
               <?php echo Wo_LoadPage('setting/privacy'); ?>
            </div>
            <div class="tab-pane" id="change-password-setting">
               <?php echo Wo_LoadPage('setting/changePassword'); ?>
            </div>
            <?php if($wo['config']['deleteAccount'] == 1 && $wo['user']['user_id'] == $wo['setting']['user_id']) { ?>
            <div class="tab-pane" id="delete-setting"><?php echo Wo_LoadPage('setting/delete'); ?></div>
            <?php } ?>
         </div>
      </div>
      <div class="sidebar">
         <?php echo Wo_LoadPage('sidebar/content');?>
      </div>
   </div>
</div>