<?php
global $wp_query;
$panel_page = $wp_query->get('panel_page');
$sub_page = $wp_query->get('sub_page');
$user_id = get_current_user_id();
$user_profile = get_user_profile($user_id, true);
$user_data = get_userdata($user_id);
$display_name = (!empty($user_data->display_name)) ? $user_data->display_name : $user_data->user_login;
$vip_active = yascode_vip::is_active(); ?>
<div class="top-panel rt-shadow rt rt-bg">
    <div class="main">
        <img src="<?php echo $user_profile; ?>" width="70" height="70" class="right rt-50px avatar">
        <div class="inside left">

            <h1 class="rt rt-bold rt-rang rt-18"><?php echo $display_name; ?>
                <?php if ($vip_active) :
                    $user_vip = yascode_vip::get_user_vip_status($user_id); ?><span class="rt-35px rt-fff rt-12 is-vip green">اشتراک ویژه <?php echo ($user_vip['status'] == true) ? 'فعال' : 'غیرفعال'; ?> است</span>
                <?php endif; ?>
            </h1>

            <ul class="rt rt-15">
                <li class="right"><a href="<?php echo PANEL_URL; ?>" class="right rt-888 <?php echo (empty($panel_page) || $panel_page == 'dashboard') ? 'active' : ''; ?>"><i class="fa fa-user right"></i> پیشخوان کاربری</a></li>
                <?php if ($vip_active) : ?><li class="right"><a href="<?php echo PANEL_URL . '/plans'; ?>" class="right rt-888 <?php echo (!empty($panel_page) && $panel_page == 'plans') ? 'active' : ''; ?>"><i class="fa fa-star right"></i> اشتراک ویژه</a></li><?php endif; ?>
                <li class="right"><a href="<?php echo PANEL_URL . '/watch-list'; ?>" class="right rt-888 <?php echo (!empty($panel_page) && $panel_page == 'watch-list') ? 'active' : ''; ?>"><i class="fa fa-bookmark right"></i> ذخیره شده ها</a></li>
                <li class="right"><a href="<?php echo PANEL_URL . '/edit-profile'; ?>" class="right rt-888 <?php echo (!empty($panel_page) && $panel_page == 'edit-profile') ? 'active' : ''; ?>"><i class="fa fa-cog right"></i> ویرایش پروفایل</a></li>
                <li class="right"><a href="<?php echo PANEL_URL . '/change-password'; ?>" class="right rt-888 <?php echo (!empty($panel_page) && $panel_page == 'change-password') ? 'active' : ''; ?>"><i class="fa fa-key right"></i> تغییر رمز عبور</a></li>
                <li class="right"><a href="<?php echo wp_logout_url(SITE_URL); ?>" class="right rt-888"><i class="fa fa-sign-out right"></i> خروج</a></li>
            </ul>
        </div>
    </div>
</div>