File: /mnt/data/kofejob-wp/wp-content/themes/kofejob/template-parts/sidebar-emp.php
<?php
$current_user_id = get_current_user_id();
$pid = get_user_meta( $current_user_id, 'employer_id' , true );
global $kofejob_theme_options;
$user_info = get_userdata($current_user_id);
$page_name ='';
if(isset($_GET['ext']) && $_GET['ext'] !="")
{
$page_name = $_GET['ext'];
}
$alt_id ='';
?>
<div class="settings-header d-sm-flex flex-row flex-wrap text-center text-sm-start align-items-center">
<a href="<?php echo esc_url(get_permalink($pid)); ?>"> <?php
$pro_img_id = get_post_meta( $pid, '_profile_pic_attachment_id', true );
$pro_img = wp_get_attachment_image_src( $pro_img_id, 'thumbnail' );
if(wp_attachment_is_image($pro_img_id))
{
?>
<img src="<?php echo esc_url($pro_img[0]); ?>" alt="<?php echo esc_attr(get_post_meta($pro_img_id, '_wp_attachment_image_alt', TRUE)); ?>" class="avatar-lg rounded-circle" loading="lazy">
<?php
}
else
{
?>
<img src="<?php echo esc_url($kofejob_theme_options['employer_df_img']['url']); ?>" alt="<?php echo esc_attr(get_post_meta($alt_id, '_wp_attachment_image_alt', TRUE)); ?>" class="avatar-lg rounded-circle" loading="lazy">
<?php
}
?></a>
<div class="ms-sm-3 ms-md-0 ms-lg-3 mt-2 mt-sm-0 mt-md-2 mt-lg-0 text-left">
<h3 class="mb-1">
<a href="<?php echo esc_url(get_permalink($pid)); ?>">
<?php echo kofejob_get_username('employer', $pid); ?>
</a>
</h3>
<p class="mb-0"><?php echo esc_html($user_info->user_email); ?></p>
</div>
</div>
<div class="settings-menu" id="sidebar">
<ul class="nav">
<?php $dashboard_page = kofejob_fl_framework_get_options('user_dashboard_page');
if ($dashboard_page) : ?>
<li <?php if ($post->ID == $dashboard_page) : ?>class="nav-item active" <?php endif; ?>><a <?php if ($post->ID == $dashboard_page) : ?>class="active" <?php endif; ?> href="<?php echo esc_url(get_permalink($dashboard_page)); ?>"><i class="material-icons">verified_user</i><span class="menu-title"><?php echo get_the_title($dashboard_page); ?></a></span></li>
<?php endif; ?>
<?php $listings_page = kofejob_fl_framework_get_options('my_listing_page');
if ($listings_page) : ?>
<li <?php if ($post->ID == $listings_page) : ?> class="active" <?php endif; ?> ><a <?php if ($post->ID == $listings_page) : ?>class="active" <?php endif; ?> href="<?php echo esc_url(get_permalink($listings_page)); ?>?ext=projects"><i class="material-icons">business_center</i> <?php echo get_the_title($listings_page); ?> </a></li>
<?php endif; ?>
<?php $bookmarks_page =kofejob_fl_framework_get_options('my_favourites_page');
if ($bookmarks_page) : ?>
<li id="" <?php if ($post->ID == $bookmarks_page) : ?>class="active" <?php endif; ?> ><a href="<?php echo esc_url(get_permalink($bookmarks_page)); ?>?ext=followed-freelancers&list-style=grid"><i class="material-icons">local_play</i> <?php echo get_the_title($bookmarks_page); ?></a></li>
<?php endif; ?>
<?php
global $KofejobChat_options;
$dashboard_page = isset($KofejobChat_options['KofejobChat-dashboard-page']) && $KofejobChat_options['KofejobChat-dashboard-page'] != '' ? $KofejobChat_options['KofejobChat-dashboard-page'] : 'javascript:void(0)';
if ($dashboard_page != '')
{
?>
<li class="nav-item">
<a class="nav-link" href="<?php echo esc_url(get_permalink(kofejob_fl_framework_get_options('my_messages_page')));?>">
<i class="material-icons">chat</i>
<span class="menu-title"><?php echo esc_html('Message', 'kofejob');?> </span>
</a>
</li>
<?php
}
?>
<?php $my_payments_page = kofejob_fl_framework_get_options('my_payments_page');
if ($my_payments_page) : ?>
<li <?php if ($post->ID == $my_payments_page) : ?> class="active" <?php endif; ?> ><a <?php if ($post->ID == $my_payments_page) : ?>class="active" <?php endif; ?> href="<?php echo esc_url(get_permalink($my_payments_page)); ?>?ext=statements"><i class="far fa-list-alt menu-icon"></i> <?php echo get_the_title($my_payments_page); ?> </a></li>
<?php endif; ?>
<?php $profile_page = kofejob_fl_framework_get_options('my_profile_page');
if ($profile_page) : ?>
<li <?php if ($post->ID == $profile_page) : ?>class="active" <?php endif; ?> ><a <?php if ($post->ID == $profile_page) : ?>class="active" <?php endif; ?> href="<?php echo esc_url(get_permalink($profile_page)); ?>"><i class="material-icons">settings</i> <span class="menu-title"><?php echo get_the_title($profile_page); ?></span></a></li>
<?php endif; ?>
<li class="nav-item">
<a class="nav-link" href="<?php echo wp_logout_url( get_the_permalink( $kofejob_theme_options['login_page'] ) ); ?>">
<i class="material-icons">power_settings_new</i>
<span class="menu-title"><?php echo esc_html__('Logout', 'kofejob');?></span>
</a>
</li>
</ul>
</div>