<?php $settings = get_setting(); ?>
<div id="preloader"><div class="preloader_2 loader_position"><span></span>
    <span></span></div></div>

<div class="home_page_navbar homeMenu">
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <div class="container-fluid">
      <a class="navbar-brand" href="<?= base_url(); ?>"><img src="<?= base_url(!empty($settings['logo'])?$settings['logo']:"assets/frontend/images/logo-example.jpg"); ?>" alt=""></a>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item <?= isset($page_title) && $page_title=='Home'?'active':''; ?>">
            <a class="nav-link" href="<?= base_url(); ?>"><?= html_escape(lang('home_menu'));?> <span class="sr-only">(current)</span></a>
          </li>
          <?php if($settings['is_user']==1): ?>
              <?php if(count($this->common_m->get_all_users())>0): ?>
              <li class="nav-item <?= isset($page_title) && $page_title=='Users'?'active':''; ?>">
                <a class="nav-link" href="<?= base_url('users'); ?>"><?= !empty(lang('home_users'))?html_escape(lang('home_users')):'users';?></a>
              </li>
            <?php endif;?>
          <?php endif;?>


         <?php if(isset($settings['is_user_demo']) && $settings['is_user_demo']==1): ?>
            <?php if(!empty($settings['demo_username'])): ?>
              <li class="nav-item <?= isset($page_title) && $page_title=='Users'?'active':''; ?>">
                <a class="nav-link" href="<?= base_url($settings['demo_username']); ?>"><?= !empty(lang('user_demo'))?html_escape(lang('user_demo')):'Demo';?></a>
              </li>
            <?php endif;?>
          <?php endif;?>

          <?php if($settings['is_review']==1): ?>
            <?php if($this->common_m->total_rating()>0): ?>
              <li class="nav-item <?= isset($page_title) && $page_title=='Reviews'?'active':''; ?>">
                <a class="nav-link" href="<?= base_url('review'); ?>"><?= !empty(lang('review'))?html_escape(lang('review')):'Reviews';?></a>
              </li>
            <?php endif;?>
          <?php endif;?>
          <?php if($settings['is_contact']==1): ?>
            <li class="nav-item <?= isset($page_title) && $page_title=='Contact'?'active':''; ?>" >
              <a class="nav-link" href="<?= base_url('contacts'); ?>"><?= !empty(lang('home_contacts'))?html_escape(lang('home_contacts')):'Contacts';?> </a>
            </li>
          <?php endif; ?>
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
              <i class="icofont-globe"></i> <?= !empty(auth('site_lang'))?auth('site_lang'):$settings['language'] ;?>
            </a>
            <div class="dropdown-menu languageDropdown" aria-labelledby="navbarDropdown">
              <?php $languages = $this->common_m->select_with_status('languages'); ?>
              <?php foreach ($languages as $key => $language): ?>
                <a class="dropdown-item" href="<?= base_url('home/lang_switch/'.$language['slug']) ;?>"><?= $language['lang_name'] ;?></a>
              <?php endforeach ?>
              
            </div>
          </li>
        </ul>
        <div class="right_bar">
          <?php if(count_all('pricing') > 0): ?>
            <?php if($settings['registration_option']==1): ?>
                <?php if(isset($page) && $page!="Home"): ?>
                  <a href="<?= base_url('#home_price'); ?>" class="create_profile"><i class="fa fa-user-plus"></i> &nbsp; <?= html_escape(lang('home_create_account'));?></a>
                    <?php else: ?>
                  <a href="javascript:;" class="create_profile"><i class="fa fa-user-plus"></i> &nbsp; <?= html_escape(lang('home_create_account'));?></a>
                <?php endif ?>
            <?php endif ?>
          <?php endif ?>
          <a href="<?= base_url('login');?>"><i class="fa fa-sign-in"></i> &nbsp;<?= html_escape(lang('home_login'));?></a>
        </div>
      </div>
    </div><!-- container -->
  </nav>
  
</div>