<!--aside class="main-sidebar sidebar-dark-primary elevation-4">
  <a href="<?= site_url('/') ?>" class="brand-link"><span class="brand-text font-weight-light">MiSistema</span></a>
  <div class="sidebar">
    <nav class="mt-2">
      <ul class="nav nav-pills nav-sidebar flex-column">
        <li class="nav-item">
          <a href="<?= site_url('dashboard') ?>" class="nav-link">
            <i class="nav-icon fas fa-tachometer-alt"></i><p>Dashboard</p>
          </a>
        </li>
      </ul>
    </nav>
  </div>
</aside-->


<!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="#" class="brand-link">
      <img src="<?php echo base_url(); ?>intercambio/fotos/logo.jpg" alt="SIGAPAS Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
      <span class="brand-text font-weight-light">SIGAPAS</span>
    </a>

    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="<?php echo base_url(); ?>intercambio/fotos/<?php echo session('fotoUsuario') ? session('fotoUsuario') : 'usuario3.png';  ?>" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">
            <?= session('nombreUsuario') ?>
  	      </a>
        </div>
      </div>

  
      <!-- SidebarSearch Form -->
      <div class="form-inline">
        <div class="input-group" data-widget="sidebar-search">
          <input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
          <div class="input-group-append">
            <button class="btn btn-sidebar">
              <i class="fas fa-search fa-fw"></i>
            </button>
          </div>
        </div>
      </div>
  



<!-- Sidebar Menu -->  
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
  
          <!-- Add icons to the links using the .nav-icon class 
               with font-awesome or any other icon font library -->
          <li class="nav-item">
            <a href="<?= site_url('dashboard') ?>" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i><p>Dashboard</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                Administración
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="<?php echo base_url('/users'); ?>" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>Usuarios</p>
                </a>
              </li>
            </ul>
          </li>
  
          <li class="nav-item menu-open">
              
            <a href="#" class="nav-link active">
              <i class="nav-icon far fa-plus-square"></i>
              <p>
                Servicios y UPAS
                <i class="fas fa-angle-left right"></i>
              </p>
            </a>
            
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="#" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>
                    Servicios
                    <i class="fas fa-angle-left right"></i>
                  </p>
                </a>
                <ul class="nav nav-treeview">
                  <li class="nav-item">
                    <a href="<?php echo base_url('red_agua_potable'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Red de Agua Potable</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="<?php echo base_url('red_alcantarillado'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Red de Alcantarillado</p>
                    </a>
                  </li>
                    <li class="nav-item">
                    <a href="<?php echo base_url('medidores'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Medidores</p>
                    </a>
                  </li>
                  
                  <li class="nav-item">
                    <a href="<?php echo base_url('camaras'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Camaras</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="<?php echo base_url('valvulas'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Vavulas</p>
                    </a>
                  </li>

                </ul>
              </li>
              <li class="nav-item">
                <a href="#" class="nav-link">
                  <i class="far fa-circle nav-icon"></i>
                  <p>
                    UPAS
                    <i class="fas fa-angle-left right"></i>
                  </p>
                </a>
                <ul class="nav nav-treeview">
                  <li class="nav-item">
                    <a href="<?php echo base_url('predios'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Predios</p>
                    </a>
                  </li>                    
                  <li class="nav-item">
                    <a href="<?php echo base_url('otbs'); ?>" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>OTBS</p>
                    </a>
                  </li>                    

                  <li class="nav-item">
                    <a href="#" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Manzanas</p>
                    </a>
                  </li>
                  <li class="nav-item">
                    <a href="#" class="nav-link">
                      <i class="far fa-circle nav-icon"></i>
                      <p>Distritos</p>
                    </a>
                  </li>

                </ul>
              </li>              
            </ul>
          </li>

          <li class="nav-header">MISCELLANEOUS</li>
          <li class="nav-item">
            <a href="#" class="nav-link">
              <i class="nav-icon fas fa-ellipsis-h"></i>
              <p>Tabbed IFrame Plugin</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="https://jameuge.com" class="nav-link">
              <i class="nav-icon fas fa-circle"></i>
              <p>www.jameuge.com</p>
            </a>
          </li>
          <li class="nav-item">
            <a href="#" onclick="cerrarSesion()" class="nav-link">
              <i class="far fa-circle nav-icon text-danger"></i>
              <p>Salir</p>
              
                <script type="text/javascript">
                function cerrarSesion(){
                    //alert('Inicial javascript');
                    //alert('prueba');
                	Swal.fire('Sweet Alert 2');
                	Swal.fire({
                    	title: 'Quiere salir',
                    	text: 'Fin de la sección',
                    	icon: 'warning',
                    	showCancelButton: true,
                    	cancelButtonColor: '#d33',
                        confirmButtonText: 'Si, Salir' 
                    }).then((result) => {
                    	if (result.isConfirmed) {
                    		window.location.href = "<?php echo base_url('auth/cerrarSesion'); ?>";
                        }
                    })
                    //alert('final javascript');
                }
                </script> 
                
            </a>
          </li>
        </ul>
      </nav>
    </div>
    <!-- /.sidebar -->
  </aside>

     