HEX
Server: nginx/1.24.0
System: Linux DGT-WORDPRESS-VM-SERVER 6.14.0-1014-azure #14~24.04.1-Ubuntu SMP Fri Oct 3 20:52:11 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.4.12
Disabled: NONE
Upload Files
File: /mnt/data/dreamsrent-wp-demo/wp-content/themes/dreamsrent/templates/template-dashboard.php
<?php
/**
 * Template Name: Dashboard Page
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package Dreamsrent
 */

get_header();
$current_user = wp_get_current_user();
$user_id = get_current_user_id();
$roles = $current_user->roles;
$role = array_shift($roles);

if (!is_user_logged_in()) {
    $login_page = dreamsrent_fl_framework_getoptions('header_login_link');

    wp_redirect(esc_url(get_permalink($login_page)));
    exit();
}

if (!empty($current_user->user_firstname)) {
    $name = $current_user->user_firstname;
} else {
    $name =  $current_user->display_name;
}

?>

<div class="dashboard-section">
    <div class="container">
        <div class="row">
            <div class="col-lg-12">
                <div class="dashboard-menu">
                    <ul>
                        <!-- Dashboard Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $dashboard_page = dreamsrent_fl_framework_getoptions('dashboard_page');
                            if ($dashboard_page) : ?>
                                <li>
                               
    <a <?php if ($post->ID == $dashboard_page) { ?>class="active" <?php 

    }; ?>  href="<?php echo esc_url(get_permalink($dashboard_page)); ?>">
        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/dashboard-icon.svg" alt="Dashboard">
        <span><?php echo esc_html__('Dashboard','dreamsrent'); ?></span>
    </a>
</li>

                               
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Bookings Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $bookings_page = dreamsrent_fl_framework_getoptions('bookings_page');
                            if ($bookings_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $bookings_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($bookings_page)); ?>?status=allbookings">

                                
                                   
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/booking-icon.svg" alt="Booking">
                                        <span><?php echo esc_html__('Booking List' ,'dreamsrent'); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Reviews Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $reviews_page = dreamsrent_fl_framework_getoptions('reviews_page');
                            if ($reviews_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $reviews_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($reviews_page)); ?>">
                                   
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/review-icon.svg" alt="Reviews">
                                        <span><?php echo esc_html__('Reviews' ,'dreamsrent'); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Wishlist Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $wishlist_page = dreamsrent_fl_framework_getoptions('wishlist_page');
                            if ($wishlist_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $wishlist_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($wishlist_page)); ?>">
                                    
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/wishlist-icon.svg" alt="Wishlists">
                                        <span><?php echo esc_html__('Wishlist','dreamsrent' ); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Chat Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $chat_page = dreamsrent_fl_framework_getoptions('chat_page');
                            if ($chat_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $chat_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($chat_page)); ?>">
                                    
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/message-icon.svg" alt="Message">
                                        <span><?php echo esc_html__('Chat','dreamsrent' ); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Payments Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $payments_page = dreamsrent_fl_framework_getoptions('payments_page');
                            if ($payments_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $payments_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($payments_page)); ?>">
                                    
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/payment-icon.svg" alt="Payment">
                                        <span><?php echo esc_html__('Payments' ,'dreamsrent'); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>


                        <!-- Notification Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $notifications_page = dreamsrent_fl_framework_getoptions('notifications_page');
                            if ($notifications_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $notifications_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($notifications_page)); ?>">
                                    
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/message-icon.svg" alt="Payment">
                                        <span><?php echo esc_html__('Notifications' ,'dreamsrent'); ?></span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                        <!-- Profile Link -->
                        <?php if (in_array($role, array('administrator', 'admin', 'owner', 'seller', 'subscriber'))) : ?>
                            <?php $profile_page = dreamsrent_fl_framework_getoptions('profile_page');
                            if ($profile_page) : ?>
                                <li>
                                <a <?php if ($post->ID == $profile_page) { ?>class="active" <?php 

}; ?>  href="<?php echo esc_url(get_permalink($profile_page)); ?>">
                                  
                                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/settings-icon.svg" alt="Settings">
                                        <span><?php echo esc_html__('Settings','dreamsrent' ); ?> </span>
                                    </a>
                                </li>
                            <?php endif; ?>
                        <?php endif; ?>

                       
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- Content
================================================== -->
<div class="container">
    
    <?php
    while (have_posts()) : the_post();
        the_content();
    endwhile; // End of the loop.
    ?>
</div>
<?php get_footer(); ?>