<?php 
error_reporting(E_ERROR | E_PARSE);
require_once 'pages/Auth.php';
session_start();
?>
<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <?php include_once 'includes/head.php'; ?>
    <script language="javascript" type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<style>
.pr_myDivLoading {
    position: absolute;
    margin: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(99, 49, 0, 0.6);
    z-index: 10000;

    text-align: center;
    display: flex;
    justify-content: center;
    display: none;
}

.LoadingBar {
    background: white;
    position: absolute;
    right: 0;
    bottom: 0;
    top: 0;
    left: 0;
    margin: auto;
    width: 30%;
    height: 26%;
    padding: 10px;

    border-radius: 20px;
    border: solid 2px rgba(99, 49, 50, 0.5);
    background-image: url("images/load1.gif");
    object-fit: cover;
}
</style>

<body>
    <div class="pr_myDivLoading">
        <div class="LoadingBar"> Loading ...Please Wait ....</div>
    </div>
    <!-- top navigation bar -->
    <?php include_once 'includes/top_bar.php'; ?>
    <!-- top navigation bar -->

    <div class="container-fluid wpb_wrapper">
        <?php include_once('includes/rane_menu.php'); ?>
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <?php                                       
                $Request = $_GET['stvat'];   
                         
                include 'includes/mRane.php';
                $db_reference = menuAccess();
                $index = array_search($Request, array_column($db_reference,'Request')); 
                
                if($index){  
                           
                    include_once($db_reference[$index]['url']);
                }
                else{
                    include_once('pages/404.php');
                }            
            ?>
        </main>
        <div style="width:100%;height:53px;">
        </div>
    </div>

    <?php include_once 'includes/footer.php'; ?>

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
        integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous">
    </script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
        integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous">
    </script>

    <script src="https://unpkg.com/feather-icons/dist/feather.min.js"></script>

    <script src="scripts/side_menu.js"></script>

    <link rel="stylesheet" type="text/css"
        href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css" />
    <script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"></script>
    <!-- <script
  src="https://code.jquery.com/jquery-3.5.1.js"
  integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
  crossorigin="anonymous"></script>
  <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
   -->
   <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
    <script>
    feather.replace()
    </script>
<script>
    function prSelect(ele) {
        return document.querySelectorAll(ele);
    }
    function prjSelect(ele) {        
        return $(ele);
    } 
</script>
</body>