<!DOCTYPE html>
<html lang="en">

<head>

    <title>{% block title %}{% endblock %}</title>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Custom fonts for this template-->
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
	<link
        href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
        rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="{% nav public %}css/sb-admin-2.min.css" rel="stylesheet">
	<link href="{% nav public %}css/select2.min.css" rel="stylesheet">
	<!-- <link href="{% nav public %}css/date_android.css" rel="stylesheet"> -->
	<link href="{% nav public %}css/custom-style.css" rel="stylesheet">
	<link href="{% nav public %}css/datepicker.css" rel="stylesheet">
	
	<!-- Custom styles for datatable -->
    <link href="https://cdn.datatables.net/fixedheader/3.4.0/css/fixedHeader.dataTables.min.css" rel="stylesheet">
	<link href="{% nav public %}vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
	
	{% block style %}{% endblock %}

</head>

<div id="print">
	{% block print %}{% endblock %}
</div>

<body id="page-top">
	<div id="loading-overlay">
		<div id="ring"></div>
	</div>
    <!-- Page Wrapper -->
    <div id="wrapper">

        {% block sidebar %}
		{% endblock %}

        <!-- Content Wrapper -->
        <div id="content-wrapper" class="d-flex flex-column">

            <!-- Main Content -->
            <div id="content">

                <!-- Topbar -->
                <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

                    <!-- Sidebar Toggle (Topbar) -->
                    <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
                        <i class="fa fa-bars"></i>
                    </button>

                    <!-- Topbar Navbar -->
                    <ul class="navbar-nav ml-auto">

                        <!-- <div class="topbar-divider d-none d-sm-block"></div> -->

                        <!-- Nav Item - User Information -->
                        <li class="nav-item dropdown no-arrow">
                            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button"
                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="mr-2 d-none d-lg-inline text-gray-600 small">{{session.user.nama}}</span>
                                <img class="img-profile rounded-circle"
                                    src="{% nav public %}img/test.jpeg">
                            </a>
                            <!-- Dropdown - User Information -->
                            <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in"
                                aria-labelledby="userDropdown">
                                <!-- <a class="dropdown-item" href="#"> -->
                                    <!-- <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i> -->
                                    <!-- Profile -->
                                <!-- </a> -->
                                <!-- <a class="dropdown-item" href="#"> -->
                                    <!-- <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i> -->
                                    <!-- Settings -->
                                <!-- </a> -->
                                <a class="dropdown-item" href="#">
                                    <i class="fas fa-key fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Ubah Password
                                </a>
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                                    <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                                    Logout
                                </a>
                            </div>
                        </li>

                    </ul>

                </nav>
                <!-- End of Topbar -->

                <div id="info" style="position:fixed;top:80px;right:50px;width:200px;z-index:999;display:none;">
					<div class='alert alert-success' role='alert' style='width:100%;text-align:center;'>{{msg}}</div>
				</div>
				
				<!-- Loader -->
                <div id="loader"></div>
				
				<!-- Begin Page Content -->
                <div class="container-fluid" style="display:none">

					{% block content %}{% endblock %}

                </div>
                <!-- /.container-fluid -->

            </div>
            <!-- End of Main Content -->

            <!-- Footer -->
            <footer class="sticky-footer bg-white">
                <div class="container my-auto">
                    <div class="copyright text-center my-auto">
                        <span>Copyright &copy; Apotek ARCADE 2023</span>
                    </div>
                </div>
            </footer>
            <!-- End of Footer -->

        </div>
        <!-- End of Content Wrapper -->

    </div>
    <!-- End of Page Wrapper -->

    <!-- Scroll to Top Button-->
    <a class="scroll-to-top rounded" href="#page-top">
        <i class="fas fa-angle-up"></i>
    </a>

    <!-- Logout Modal-->
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
        aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">LOGOUT</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">Anda Yakin ingin Keluar?</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
                    <a class="btn btn-primary" href="{% nav user_logout %}">Logout</a>
                </div>
            </div>
        </div>
    </div>

	<script type="text/javascript">Number.prototype.formatMoney = function(c, d, t){
	var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
	   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
	 };</script>
	 
    <!-- Bootstrap core JavaScript-->
    <script src="{% nav public %}vendor/jquery/jquery.min.js"></script>
    <script src="{% nav public %}vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="{% nav public %}vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="{% nav public %}js/sb-admin-2.min.js"></script>
	<script src="{% nav public %}js/select2/select2.min.js"></script>
	
	<!-- Page level plugins -->
    <script src="{% nav public %}vendor/datatables/jquery.dataTables.min.js"></script>
    <script src="{% nav public %}vendor/datatables/dataTables.bootstrap4.min.js"></script>
	<script src="https://cdn.datatables.net/fixedheader/3.4.0/js/dataTables.fixedHeader.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
	<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
	
	<!-- Page level custom scripts -->
    <script src="{% nav public %}js/demo/datatables-demo.js"></script>
	
	<script src="{% nav public %}js/moment-datepicker.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$('#loader').hide();
			$('.container-fluid').show();
			$(window).on("beforeunload", function() { 
				$("#loading-overlay").show(); 
			});
		});
	</script>

	{% block script %}{% endblock %}
	{% block mainscript %}{% endblock %}

</body>

</html>