{% extends '../../template.html' %}
{% block style %}
{% endblock %}

{% block title %}Apotek{% endblock %}
{% block print %}{% endblock %}
{% block sidebar %}
<!-- Sidebar -->
	<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

	 	<!-- Sidebar - Brand -->
		<a class="sidebar-brand d-flex align-items-center justify-content-center" href="{% nav user_login %}">
			<!-- <div class="sidebar-brand-icon rotate-n-15"> -->
				<!-- <i class="fas fa-laugh-wink"></i> -->
			<!-- </div> -->
			<div class="sidebar-brand-text mx-3">Apotek ARCADE</div>
		</a>

		<!-- Divider -->
		<hr class="sidebar-divider my-0">
		{% if session.user.akses == 1%}
		<!-- Nav Item - Dashboard -->
		<li id="mHome" class="nav-item">
			<a class="nav-link" href="{% nav apotek_home %}">
				<i class="fas fa-fw fa-tachometer-alt"></i>
				<span>Dashboard</span></a>
		</li>
		{% endif %}
		<!-- Divider -->
		<hr class="sidebar-divider">
		{% if session.user.akses == 1%}
		<!-- Nav Item - Data Master Collapse Menu -->
		<li id="mData" class="nav-item">
			<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseData"
				aria-expanded="true" aria-controls="collapseData">
				<i class="fas fa-fw fa-database"></i>
				<span>Data Master</span>
			</a>
			<div id="collapseData" class="collapse" aria-labelledby="headingData" data-parent="#accordionSidebar">
				<div class="bg-white py-2 collapse-inner rounded">
					<a id="smSatuanObat" class="collapse-item" href="{% nav apotek_obat_satuan %}">Satuan Obat</a>
					<a id="smKategoriObat" class="collapse-item" href="{% nav apotek_obat_kategori %}">Kategori Obat</a>
					<a id="smGenericObat" class="collapse-item" href="{% nav apotek_obat_generic %}">Nama Generic</a>
					<a id="smDataObat" class="collapse-item" href="{% nav apotek_obat_obat %}">Data Obat</a>
					<a id="smDataPemasok" class="collapse-item" href="{% nav apotek_obat_pemasok %}">Data Pemasok</a>
				</div>
			</div>
		</li>
		{% endif %}
		
		<!-- Nav Item - Inventory Collapse Menu -->
		<li id="mInventory" class="nav-item">
			<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseInventory"
				aria-expanded="true" aria-controls="collapseInventory">
				<i class="fas fa-fw fa-boxes"></i>
				<span>Inventory</span>
			</a>
			<div id="collapseInventory" class="collapse" aria-labelledby="headingInventory"
				data-parent="#accordionSidebar">
				<div class="bg-white py-2 collapse-inner rounded">
					<a id="smStockObat" class="collapse-item" href="{% nav apotek_obat_stock %}">Stock Obat</a>
					{% if session.user.akses == 1%}
					<a id="smObatMasuk" class="collapse-item" href="{% nav apotek_obat_masuk %}">Obat Masuk</a>
					<a id="smObatKeluar" class="collapse-item" href="{% nav apotek_obat_keluar %}">Obat Keluar</a>
					<a id="smPembayaranPemasok" class="collapse-item" href="{% nav apotek_obat_pembayaran %}">Pembayaran Pemasok</a>
					{% endif %}
				</div>
			</div>
		</li>
		
		<!-- Nav Item - Penjualan Collapse Menu -->
		<li id="mPenjualan" class="nav-item">
			<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePenjualan"
				aria-expanded="true" aria-controls="collapsePenjualan">
				<i class="fas fa-fw fa-dollar-sign"></i>
				<span>Penjualan</span>
			</a>
			<div id="collapsePenjualan" class="collapse" aria-labelledby="headingPenjualan"
				data-parent="#accordionSidebar">
				<div class="bg-white py-2 collapse-inner rounded">
					<a id="smPenjualanObat" class="collapse-item" href="{% nav apotek_obat_penjualan %}">Penjualan Obat</a>
					<a id="smDataPenjualan" class="collapse-item" href="{% nav apotek_obat_datapenjualan %}">Data Penjualan</a>
				</div>
			</div>
		</li>

		<!-- Divider -->
		<hr class="sidebar-divider">
		
		<!-- Nav Item - Info Obat -->
		<li id="mInfo" class="nav-item">
			<a class="nav-link" href="{% nav apotek_obat_info %}">
				<i class="fas fa-fw fa-info-circle"></i>
				<span>Panduan Obat</span></a>
		</li>

		<!-- Divider -->
		<hr class="sidebar-divider d-none d-md-block">

		<!-- 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 -->
{% endblock %}
{% block content %}
	{% block subcontent %}{% endblock %}
{% endblock %}

{% block script %}
{% endblock %}

{% block mainscript %}
<script type="text/javascript">
	$(document).ready(function() {
		$('#dataTable').on( 'draw.dt', function () {
			refreshEvent();
		});
		refreshEvent();
	});
	function menuSelected(menu,sub) {
		idmenu = "#"+menu;
		idsub = "#"+sub;
		$(idmenu).addClass("active");
		$(idsub).addClass("active");
		$("#"+$(idmenu+" .nav-link").attr("aria-controls")).addClass("show");
	}
</script>
{% endblock %}
