<?php
/**
 * Contain Site Header With include of menu
 *
 * PHP version 7.3
 *
 * @package        SMS
 * @version        Release 1.0.0
 * @create_by      Mohammad aljaouni
 * @create_date    10-08-2020
 * @edited_by      Mohammad aljaouni
 * @last_edit_date 10-08-2020
 * @todo           Nothing
 */
if(empty($chain) || $chain != "AWdrh78y892Djk*^523*%$#ghgHGHia&%$*)AsfdsLJnLaad") {
    header("location: index.php");
    exit;
}
?>
<!-- Start Site Header page-->
<!-- start layout-wrapper -->
<div id="layout-wrapper">
    <header id="page-topbar">
        <div class="navbar-header">
            <div class="d-flex">
                <!-- LOGO -->
                <div class="navbar-brand-box <?php echo (isset($menu) && $menu==false)?"no-background no-menu-logo":""?>">
                    <a href="index.php" class="logo logo-dark">
                        <span class="logo-sm ">
                           <img src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/logo-sm-dark.png" class="d-none" alt="" height="45">
                           <img src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/logo-sm-light.png" class="logo-sm-light" alt="" height="45">
                        </span>
                        <span class="logo-lg">
                            <img class="<?php echo (isset($menu) && $menu==false)?"mt-4":""?>" src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/<?php echo (isset($menu) && $menu==false)?"logo-light.png":"logo-lg.png"?>" alt="" width="<?php echo (isset($menu) && $menu==false)?"70px":"40%"?>" height="auto">
                        </span>
                    </a>
                </div>
                <button type="button" class="btn btn-sm px-3 font-size-24 header-item waves-effect <?php echo (isset($menu) && $menu==false)?"d-none":""?>" id="vertical-menu-btn">
                    <i class="mdi mdi-backburger"></i>
                </button>
            </div>

            <div class="d-flex">

                <div class="dropdown d-inline-block">
                    <button type="button" class="btn header-item waves-effect" id="page-header-flag-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <img class="" src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/flags/<?php echo $languageArray[$_SESSION["language"]]['languageSymbol']?>.jpg" alt="Header Language" height="14">
                    </button>
                    <div class="dropdown-menu dropdown-menu-right">
                        <!-- item-->
                        <a href="changeLanguage.php?setNewLanguage=2" class="dropdown-item notify-item">
                            <img src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/flags/en.jpg" alt="user-image" class="mr-2" height="10"><span class="align-middle"><?php echo $languageArray[2]['languageName']?></span>
                        </a>

                        <!-- item-->
                        <a href="changeLanguage.php?setNewLanguage=1" class="dropdown-item notify-item">
                            <img src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/flags/ar.jpg" alt="user-image" class="mr-2" height="12"><span class="align-middle"><?php echo $languageArray[1]['languageName']?></span>
                        </a>
                    </div>
                </div>
                <div class="dropdown d-inline-block">
                    <button type="button" class="btn header-item waves-effect" id="page-header-user-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <img class="rounded-circle header-profile-user" src="../assets/images/<?php echo $_SESSION['langSymbol'];?>/avatar.png" alt="Header Avatar">
                        <span class="d-none d-sm-inline-block ml-1"><?php echo ucfirst($_SESSION["adminName"])?></span>
                        <i class="mdi mdi-chevron-down d-none d-sm-inline-block"></i>
                    </button>
                    <div class="dropdown-menu dropdown-menu-right">
                        <!-- item-->
                        <a class="dropdown-item" href="changePassword.php"><i class="mdi mdi-account-settings font-size-16 align-middle mr-1"></i><?php echo $headerLBL["changePassword"];?></a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="signOut.php"><i class="mdi mdi-logout font-size-16 align-middle mr-1"></i><?php echo $headerLBL["logout"];?></a>
                    </div>
                </div>

            </div>
        </div>
    </header>
    <?php include("menu.php")?>
<!-- End Site Header page-->
