<script>
    ;
    (function () {
        function id(v) {
            return document.getElementById(v);
        }

        function loadbar() {
            var ovrl = id("overlay"),
                prog = id("progress"),
                stat = id("progstat"),
                img = document.images,
                c = 0;
            tot = img.length;

            function imgLoaded() {
                c += 1;
                var perc = ((100 / tot * c) << 0) + "%";
                prog.style.width = perc;
                //stat.innerHTML = "Loading "+ perc;
                stat.innerHTML = perc;
                if (c === tot) return doneLoading();
            }

            function doneLoading() {
                ovrl.style.opacity = 0;
                setTimeout(function () {
                    ovrl.style.display = "none";
                }, 1200);
            }

            for (var i = 0; i < tot; i++) {
                var tImg = new Image();
                tImg.onload = imgLoaded;
                tImg.onerror = imgLoaded;
                tImg.src = img[i].src;
            }
        }

        document.addEventListener('DOMContentLoaded', loadbar, false);
    }());
</script>
<div id="overlay">
    <div id="progstat"></div>
    <div id="progress"></div>
</div>
<!--header start-->
<div class="back_gradient">
<header class="header fixed-top not_fixed clearfix">

    <!--logo start-->
    <div class="brand top_logo">
        <a href="<?= PROJECT_URL ?>index.php" class="logo"><img src="<?= PROJECT_URL ?>images/logo.png" alt=""></a>
    </div>
        <div class="clearfix"></div>


    <!--logo end-->
</header>
<!--header end-->
<?php
$myvalue = $_SERVER["REQUEST_URI"];
$arr = explode('?', trim($myvalue));
$arr[0];
$FinalValue = array();
$TotalMenu = Menu::GetMenuList($filter);
foreach ($TotalMenu AS $Menu) {
    $MenuValue = $Menu->url;
    $Value = explode('?', trim($MenuValue));
    $FinalValue[] = $Value[0];
}
if (in_array($arr[0], $FinalValue)) {
    $Page = Menu::GetSelectedMenu($_SESSION['sess_userid']);
    $Pages = $Page->menu_id;

    $GetMenuFilter = " WHERE FIND_IN_SET(menu_id, '" . $Pages . "') ";
    $ShowMenu = Menu::GetMenuList($GetMenuFilter);
    foreach ($ShowMenu AS $menu) {
        $menuvalue = $menu->url;
        $value = explode('?', trim($menuvalue));
        $finalvalue[] = $value[0];

    }

    if (in_array($arr[0], $finalvalue)) {
        //echo "Done";
    } else {
        header("Location: " . PROJECT_ADMIN_URL);
    }
}
?>