<div class="main-header">
  <div class="logo-header" data-background-color="black">
    <!-- Tip 1: You can change the background color of the logo header using: data-background-color="black | dark | blue | purple | light-blue | green | orange | red" -->
    <a href="<?= base_url('admin/home') ?>" class="logo">
      <img src="<?= base_url('assets/admin/img/ponto/ponto-logo-white-originals-cropped.png') ?>" alt="Logo da Agência Ponto" title="Logo da Agência Ponto" class="navbar-brand">
    </a>
    <button class="navbar-toggler sidenav-toggler ml-auto" type="button" data-toggle="collapse" data-target="collapse"
      aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon">
        <i class="la la-bars"></i>
      </span>
    </button>
    <button class="topbar-toggler more"><i class="la la-ellipsis-v"></i></button>
  </div>

  <nav class="navbar navbar-header navbar-expand-lg" data-background-color="black">
    <!-- Tip 1: You can change the background color of the navbar header using: data-background-color="black | dark | blue | purple | light-blue | green | orange | red" -->
    <div class="container-fluid">
      <!-- <div class="navbar-minimize">
        <button class="btn btn-minimize btn-rounded">
          <i class="la la-navicon"></i>
        </button>
      </div> -->
      <ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
        <li class="nav-item mr-20px">
          <a class="nav-link" href="<?= base_url() ?>" target="_blank">
            <div class="d-flex align-items-center">
              Visitar site
              <i class="ml-2" data-feather="globe"></i>
            </div>
          </a>
        </li>
        <li class="nav-item dropdown hidden-caret">
          <span class="d-flex dropdown-toggle color-white cursor-pointer" data-toggle="dropdown" href="" aria-expanded="false">
            <i data-feather="settings"></i>
          </span>
          <ul class="dropdown-menu dropdown-user animated fadeIn">
            <li>
              <div class="user-box">
                <div class="u-text">
                  <h4><?= $this->session->userdata('admin')['name'] ?></h4>
                </div>
              </div>
            </li>
            <li>
              <div class="dropdown-divider"></div>
              <a class="dropdown-item" href="<?= base_url('admin/login/logout') ?>">Sair</a>
            </li>
          </ul>
        </li>
      </ul>
    </div>
  </nav>
</div>

<div class="sidebar">
  <div class="sidebar-wrapper scrollbar-inner">
    <div class="sidebar-content">
      <ul class="nav">
      <li class="nav-section"><h4 class="text-section">Geral</h4></li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'administrators' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/administrators') ?>">
            <i data-feather="users"></i>
            <p>Usuários</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'messages' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/messages') ?>">
            <i data-feather="message-circle"></i>
            <p>Mensagens</p>
            <?php if (isset($unreadMessagesLength) && $unreadMessagesLength) : ?>
              <span class="badge badge-count badge-primary"><?= $unreadMessagesLength ?></span>
            <?php endif ?>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'onlineQuotes' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/onlineQuotes') ?>">
            <i data-feather="dollar-sign"></i>
            <p>Cotações online</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'metatags' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/metatags') ?>">
            <i data-feather="activity"></i>
            <p>Metatags</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Empresa</h4>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'companyInformations' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/companyInformations') ?>">
            <i data-feather="info"></i>
            <p>Informações</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'socialMedias' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/socialMedias') ?>">
            <i data-feather="globe"></i>
            <p>Redes sociais</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Galeria</h4>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'galleryImages' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/galleryImages') ?>">
            <i data-feather="image"></i>
            <p>Imagens</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'galleryVideos' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/galleryVideos') ?>">
            <i data-feather="play-circle"></i>
            <p>Videos</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Unidades</h4>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'unities' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/unities') ?>">
            <i data-feather="box"></i>
            <p>Unidades</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'cities' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/cities') ?>">
            <i data-feather="map-pin"></i>
            <p>Cidades</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Documentos</h4>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'documents' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/documents') ?>">
            <i data-feather="file-text"></i>
            <p>Documentos</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'users' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/users') ?>">
            <i data-feather="user-check"></i>
            <p>Usuários</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Conteúdos</h4>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'pagesContents' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/pagesContents') ?>">
            <i data-feather="file-text"></i>
            <p>Inf. das páginas</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'whyChooseUsItems' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/whyChooseUsItems') ?>">
            <i data-feather="file-text"></i>
            <p>Itens PQ. nos escolher</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'banners' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/banners') ?>">
            <i data-feather="image"></i>
            <p>Banners</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'services' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/services') ?>">
            <i data-feather="box"></i>
            <p>Serviços</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'testimonials' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/testimonials') ?>">
            <i data-feather="message-circle"></i>
            <p>Depoimentos</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'structureItems' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/structureItems') ?>">
            <i data-feather="list"></i>
            <p>Estrutura</p>
          </a>
        </li>
        <li class="nav-item <?= isset($names) && $names['link'] == 'internBanners' ? 'active' : '' ?>">
          <a href="<?= site_url('admin/internBanners') ?>">
            <i data-feather="image"></i>
            <p>Banners Internos</p>
          </a>
        </li>

        <li class="nav-section">
          <h4 class="text-section">Sair do sistema</h4>
        </li>
        <li class="nav-item">
          <a href="<?= site_url('admin/login/logout') ?>">
            <i data-feather="log-out" class="rotate-180"></i>
            <p>Sair</p>
          </a>
        </li>
      </ul>
    </div>
  </div>
</div>