<?php
	$set = $this->db->query("SELECT * FROM pengaturan WHERE id='2' ")->row();
	
	$bln = date('m');
	$thn = date('Y');
	$level_user = $this->session->userdata('level');
	$akses_user = $this->session->userdata('akses');
	
	$uri1 = $this->uri->segment('2');
	$uri2 = $this->uri->segment('2');

	
	if ($uri1 == 'index' OR $uri1== '') {
		$link_index = 'active';
		$show_index = 'show';
		$col_index  = '';
		} else {
		$link_index = '';
		$show_index = '';
		$col_index  = 'collapsed';
	}

	if ($uri1 == 'pengunjung') {
		$link_pengunjung = 'active';
		$show_pengunjung = 'show';
		$col_pengunjung  = '';
		} else {
		$link_pengunjung = '';
		$show_pengunjung = '';
		$col_pengunjung  = 'collapsed';
	}
	
	if ($uri1 == 'jamlayanan') {
		$link_jamlayanan = 'active';
		$show_jamlayanan = 'show';
		$col_jamlayanan  = '';
		} else {
		$link_jamlayanan = '';
		$show_jamlayanan = '';
		$col_jamlayanan  = 'collapsed';
	}	
	
	if ($uri1 == 'kontak') {
		$link_kontak = 'active';
		$show_kontak = 'show';
		$col_kontak  = '';
		} else {
		$link_kontak = '';
		$show_kontak = '';
		$col_kontak  = 'collapsed';
	}
		
	if ($uri1 == 'kontak2') {
		$link_kontak2 = 'active';
		$show_kontak2 = 'show';
		$col_kontak2  = '';
		} else {
		$link_kontak2 = '';
		$show_kontak2 = '';
		$col_kontak2  = 'collapsed';
	}
	
?>

<!-- Sidebar -->
<ul class="navbar-nav background-3 sidebar sidebar-dark accordion" id="accordionSidebar">
	
    <!-- Sidebar - Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" href="<?= base_url(); ?>">
        <div class="sidebar-brand-icon">
            <img src="<?= base_url('sb/img/'.$set->logo); ?>" width="50px" class="img-profile rounded-circle">
		</div>
        <div class="sidebar-brand-text mx-3"><?=$set->title;?> <sup>V.<?=$set->versi;?></sup></div>
	</a>
	
    <!-- Divider -->
    <hr class="sidebar-divider my-0">
	<hr class="sidebar-divider">
    <li class="nav-item <?=$link_index;?>">
        <a class="nav-link" href="<?= base_url('dashboard/index'); ?>">
            <img src="<?= base_url('sb/icon/home.svg'); ?>" width="20px"></img>
		<span>Antrian Online</span></a>
	</li>
	<hr class="sidebar-divider">
    <li class="nav-item <?=$link_pengunjung;?>">
        <a class="nav-link" href="<?= base_url('dashboard/pengunjung'); ?>">
            <img src="<?= base_url('sb/icon/chart.svg'); ?>" width="20px"></img>
		<span>Data Pengunjung</span></a>
	</li>
	<hr class="sidebar-divider">
    <!-- Divider -->
    <!-- Heading -->	
	<div class="sidebar-heading">
		Jam Layanan
	</div>
	<!-- Nav Item - Users -->
	<li class="nav-item <?=$link_jamlayanan;?>">
		<a class="nav-link" href="<?=base_url('dashboard/jamlayanan');?>">
			<i class="fas fa-calendar"></i>
		<span>Jam Layanan</span></a>
	</li>
    <!-- Divider -->
    <hr class="sidebar-divider">
	<div class="sidebar-heading">
		Kontak Pelayanan
	</div>
	<!-- Nav Item - Users -->
	<li class="nav-item <?=$link_kontak;?>">
		<a class="nav-link" href="<?=base_url('dashboard/kontak');?>">
			<i class="fas fa-phone"></i>
		<span>Kontak</span></a>
	</li>
    <!-- Divider -->
    <hr class="sidebar-divider">
	
	<!-- Heading -->
	<div class="sidebar-heading">
        Session Logout
	</div>
	<!-- Nav Item - Logout -->
	<li class="nav-item">
		<a class="nav-link" href="#" data-toggle="modal" data-target="#logoutModal">
			<i class="fas fa-sign-out-alt"></i>
		<span>Logout</span></a>
	</li>
	
	
	<!-- Sidebar Toggler (Sidebar) -->
	<div class="text-center d-none d-md-inline">
		<button class="rounded-circle border-0" id="sidebarToggle"></button>
	</div>
	
</ul>

<!-- End of Sidebar -->	