<!DOCTYPE html>
<html lang="<?= $language ?>" data-bs-theme="auto">

<head>
    <script src="inc/layout/js/color-modes.js"></script>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>
        <?php echo $Name_co ?>
    </title>

    <!-- <link rel="stylesheet" href="inc/layout/css/css@3.css"> -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3">
    <link rel="stylesheet" href="inc/layout/css/bootstrap.<?= $rorl ?>min.css">
    <link href="inc/layout/css/select2.css" rel="stylesheet" />
    <link rel="stylesheet" href="inc/layout/css/all.min.css">
    <script src="inc/layout/js/jq-3.7.1.min.js"></script>
    <link rel="stylesheet" href="inc/layout/css/style.css">

    <!-- <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> -->
    <script type="text/javascript" src="inc/layout/js/charts-loader.js"></script>
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <!-- <script src="./node_modules/puppeteer/lib/cjs/puppeteer/puppeteer.js"></script> -->
    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }

        .b-example-divider {
            width: 100%;
            height: 3rem;
            background-color: rgba(0, 0, 0, .1);
            border: solid rgba(0, 0, 0, .15);
            border-width: 1px 0;
            box-shadow: inset 0 .5em 1.5em rgba(0, 0, 0, .1), inset 0 .125em .5em rgba(0, 0, 0, .15);
        }

        .b-example-vr {
            flex-shrink: 0;
            width: 1.5rem;
            height: 100vh;
        }

        .bi {
            vertical-align: -.125em;
            fill: currentColor;
        }

        .nav-scroller {
            position: relative;
            z-index: 2;
            height: 2.75rem;
            overflow-y: hidden;
        }

        .nav-scroller .nav {
            display: flex;
            flex-wrap: nowrap;
            padding-bottom: 1rem;
            margin-top: -1px;
            overflow-x: auto;
            text-align: center;
            white-space: nowrap;
            -webkit-overflow-scrolling: touch;
        }

        .btn-bd-primary {
            --bd-violet-bg: #712cf9;
            --bd-violet-rgb: 112.520718, 44.062154, 249.437846;

            --bs-btn-font-weight: 600;
            --bs-btn-color: var(--bs-white);
            --bs-btn-bg: var(--bd-violet-bg);
            --bs-btn-border-color: var(--bd-violet-bg);
            --bs-btn-hover-color: var(--bs-white);
            --bs-btn-hover-bg: #6528e0;
            --bs-btn-hover-border-color: #6528e0;
            --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb);
            --bs-btn-active-color: var(--bs-btn-hover-color);
            --bs-btn-active-bg: #5a23c8;
            --bs-btn-active-border-color: #5a23c8;
        }

        .bd-mode-toggle {
            z-index: 1500;
        }

        .bd-mode-toggle .dropdown-menu .active .bi {
            display: block !important;
        }

        .sidebar {
            width: 250px;
            height: 100%;
            position: fixed;
            top: 0;
            right: -200px;
            /* يمين الشاشة */
            /* background: #333; */
            padding-top: 50px;
            transition: all 0.3s;
            transition: ease-in-out;
            z-index: 99;
            border: 2px solid #067ead;
        }

        .sidebar .menu-all-ac {
            display: inline-block !important;
            transition: ease-in-out;
        }

        .sidebar .menu-mini-ac {
            display: none !important;
            transition: ease-in-out;
        }

        .sidebar.active {
            right: 0;
        }

        #toggleSidebar {
            position: fixed;
            right: 7px;
            top: 5px;
        }

        .sidebar ul {
            margin-right: 0;
            /* تأكيد عدم وجود هامش على اليمين للعناصر */
        }

        .sidebar li {
            text-align: left;
            /* جعل النصوص تظهر على اليسار */
        }
    </style>
    <!-- <link rel="stylesheet" href="inc/layout/css/fontawesome.min.css"> -->
    <!-- <link rel="stylesheet" href="inc/layout/css/font-awesome.min.css"> -->
    <!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css"> -->
    <!-- <link rel="stylesheet" href="inc/layout/css/bootstrap.min.css">  -->
    <!-- <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /> -->

    <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -->

    <!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.slim.min.js"></script> -->
    <!-- <script src="inc/layout/js/jquery.slim.min.js"></script> -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    <link rel="stylesheet" href="inc/layout/css/sidebars.css">
</head>

<body>
    <svg xmlns="http://www.w3.org/2000/svg" class="d-none">
        <symbol id="check2" viewBox="0 0 16 16">
            <path
                d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z" />
        </symbol>
        <symbol id="circle-half" viewBox="0 0 16 16">
            <path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z" />
        </symbol>
        <symbol id="moon-stars-fill" viewBox="0 0 16 16">
            <path
                d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" />
            <path
                d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z" />
        </symbol>
        <symbol id="sun-fill" viewBox="0 0 16 16">
            <path
                d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" />
        </symbol>
    </svg>

    <div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
        <button class="btn btn-bd-primary py-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button"
            aria-expanded="false" data-bs-toggle="dropdown" aria-label="Toggle theme (auto)">
            <svg class="bi my-1 theme-icon-active" width="1em" height="1em">
                <use href="#circle-half"></use>
            </svg>
            <span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
        </button>
        <ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="bd-theme-text">
            <li>
                <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light"
                    aria-pressed="false">
                    <svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em">
                        <use href="#sun-fill"></use>
                    </svg>
                    Light
                    <svg class="bi ms-auto d-none" width="1em" height="1em">
                        <use href="#check2"></use>
                    </svg>
                </button>
            </li>
            <li>
                <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark"
                    aria-pressed="false">
                    <svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em">
                        <use href="#moon-stars-fill"></use>
                    </svg>
                    Dark
                    <svg class="bi ms-auto d-none" width="1em" height="1em">
                        <use href="#check2"></use>
                    </svg>
                </button>
            </li>
            <li>
                <button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="auto"
                    aria-pressed="true">
                    <svg class="bi me-2 opacity-50 theme-icon" width="1em" height="1em">
                        <use href="#circle-half"></use>
                    </svg>
                    Auto
                    <svg class="bi ms-auto d-none" width="1em" height="1em">
                        <use href="#check2"></use>
                    </svg>
                </button>
            </li>
        </ul>
    </div>

    <svg xmlns="http://www.w3.org/2000/svg" class="d-none">
        <symbol id="bootstrap" viewBox="0 0 118 94">
            <title>Bootstrap</title>
            <path fill-rule="evenodd" clip-rule="evenodd"
                d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z">
            </path>
        </symbol>
        <symbol id="home" viewBox="0 0 16 16">
            <path
                d="M8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4.5a.5.5 0 0 0 .5-.5v-4h2v4a.5.5 0 0 0 .5.5H14a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146zM2.5 14V7.707l5.5-5.5 5.5 5.5V14H10v-4a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v4H2.5z" />
        </symbol>
        <symbol id="speedometer2" viewBox="0 0 16 16">
            <path
                d="M8 4a.5.5 0 0 1 .5.5V6a.5.5 0 0 1-1 0V4.5A.5.5 0 0 1 8 4zM3.732 5.732a.5.5 0 0 1 .707 0l.915.914a.5.5 0 1 1-.708.708l-.914-.915a.5.5 0 0 1 0-.707zM2 10a.5.5 0 0 1 .5-.5h1.586a.5.5 0 0 1 0 1H2.5A.5.5 0 0 1 2 10zm9.5 0a.5.5 0 0 1 .5-.5h1.5a.5.5 0 0 1 0 1H12a.5.5 0 0 1-.5-.5zm.754-4.246a.389.389 0 0 0-.527-.02L7.547 9.31a.91.91 0 1 0 1.302 1.258l3.434-4.297a.389.389 0 0 0-.029-.518z" />
            <path fill-rule="evenodd"
                d="M0 10a8 8 0 1 1 15.547 2.661c-.442 1.253-1.845 1.602-2.932 1.25C11.309 13.488 9.475 13 8 13c-1.474 0-3.31.488-4.615.911-1.087.352-2.49.003-2.932-1.25A7.988 7.988 0 0 1 0 10zm8-7a7 7 0 0 0-6.603 9.329c.203.575.923.876 1.68.63C4.397 12.533 6.358 12 8 12s3.604.532 4.923.96c.757.245 1.477-.056 1.68-.631A7 7 0 0 0 8 3z" />
        </symbol>
        <symbol id="table" viewBox="0 0 16 16">
            <path
                d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z" />
        </symbol>
        <symbol id="people-circle" viewBox="0 0 16 16">
            <path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z" />
            <path fill-rule="evenodd"
                d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z" />
        </symbol>
        <symbol id="grid" viewBox="0 0 16 16">
            <path
                d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z" />
        </symbol>
    </svg>
    <?php
    $thisday = date('d');
    $thismon = date('m');
    $thisyear = date('Y');
    if ($thismon == 1) {
        $days = 31;
    } else if ($thismon == 2) {
        if ($thisyear % 2 == 1) {
            $days = 28;
        } else {
            $days = 29;
        }
    } else if ($thismon == 3) {
        $days = 31;
    } else if ($thismon == 4) {
        $days = 30;
    } else if ($thismon == 5) {
        $days = 31;
    } else if ($thismon == 6) {
        $days = 30;
    } else if ($thismon == 7) {
        $days = 31;
    } else if ($thismon == 8) {
        $days = 31;
    } else if ($thismon == 9) {
        $days = 30;
    } else if ($thismon == 10) {
        $days = 31;
    } else if ($thismon == 11) {
        $days = 30;
    } else if ($thismon == 12) {
        $days = 31;
    }
    if (isset($sessionUser) && !empty($sessionUser)) {
        ?>
        <header class="head-fixed text-center">
            <nav class="navbar navbar-expand-lg navbar-light bg-light">
                <div class="container-fluid">
                    
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                        data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                    <div class="collapse navbar-collapse" id="navbarSupportedContent">
                        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                            <li class="nav-item">
                                <a class="nav-link active" aria-current="page" href="home"><i class="fa fa-home"
                                        aria-hidden="true"></i></a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    إضافة
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <li><a class="dropdown-item" href="reservations?do=add">اضافة ملف</a></li>
                                    <li><a class="dropdown-item" href="transportation?do=add">اضافة شركة نقل</a></li>
                                    <li><a class="dropdown-item" href="airline?do=add">اضافة شركة طيران</a></li>
                                    <li><a class="dropdown-item" href="transportation?do=add_run_command">إضافة أمر تشغيل</a></li>
                                    <li><a class="dropdown-item" href="cars?do=add">اضافة سيارة</a></li>
                                    <li><a class="dropdown-item" href="agents?do=add">اضافة وكيل</a></li>
                                    <li><a class="dropdown-item" href="hotels?do=add">اضافة فندق</a></li>
                                    <li><a class="dropdown-item" href="#">اضافة مطعم</a></li>
                                    <li><a class="dropdown-item" href="employees.php?do=add">اضافة موظف</a></li>
                                    <li><a class="dropdown-item" href="cars?do=add_driver">اضافة سائق</a></li>
                                    <li><a class="dropdown-item" href="add_nationality">اضافة جنسية</a></li>
                                    <li><a class="dropdown-item" href="add_all.php?manage=room_type&do=add">اضافة نوع غرفة</a></li>
                                    <!-- <li><a class="dropdown-item" href="transportation?do=add_operation_statement">اضافة بيان تشغيل</a></li>
                                    <li><a class="dropdown-item" href="transportation?do=add_vehicle_capacity">إضافة نوع وسعة السيارة</a></li> -->
                                </ul>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    الإدارة
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <?php
                                    $countmanagement = 0;
                                    $tourism_management = "SELECT * FROM tourism_management";
                                    $managementsResult = $con->query($tourism_management);
                                    while ($management = $managementsResult->fetch(PDO::FETCH_ASSOC)) {
                                        $id_user = $_SESSION['admin'];
                                        if (checkadmin($id_user, $management['department_id'], 2) == 1) {
                                            $countmanagement += 1;
                                            // echo "<option value='{$management['ID']}'>{$management['name_management']}</option>";
                                        }
                                    }
                                    if ($countmanagement > 0 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="reservations?do=all_file">إدارة الملفات</a></li>
                                        <?php 
                                    } else {
                                        ?>
                                        <li>إدارة الملفات</a></li>
                                        <?php 
                                    }
                                    if (checkadmin($_SESSION['admin'], 3, 2) == 1 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="transportation?do=all_companies_transportation">إدارة شركات النقل</a></li>
                                        <?php
                                    } 
                                    if (checkadmin($_SESSION['admin'], 3, 2) == 1 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="cars?do=all_cars">إدارة السيارات</a></li>
                                        <?php
                                    } 
                                    if (checkadmin($_SESSION['admin'], 2, 2) == 1 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="hotels?do=all_hotels">إدارة الفنادق</a></li>
                                        <?php
                                    } 
                                    if (checkadmin($_SESSION['admin'], 2, 2) == 1 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="agents?do=all_agents">إدارة الوكلاء</a></li>
                                        <?php
                                    }
                                    if (checkadmin($_SESSION['admin'], 14, 2) == 1 ) {
                                        ?>
                                        <li><a class="dropdown-item" href="employees.php?do=all_employees">إدارة الموظفين</a></li>
                                        <?php
                                    } 
                                    ?>
                                </ul>
                            </li>
                            <?php 
                            if (checkadmin($_SESSION['admin'], 12, 2) == 1 ) {
                                ?>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    الحسابات
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=Manage">دليل
                                            الحسابات</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=add_yomya">إضافة
                                            قيد</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=add_ExchangeRate">تغيير 
                                            سعر الصرف</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=add_sanad&id=1">إضافة
                                            إذن صرف</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=add_sanad&id=2">إضافة
                                            إذن قبض</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=yomya">اليومية
                                            العامة</a></li>
                                    <!-- <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=ledger">دفتر
                                            الأستاذ</a></li> -->
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=account_statements">كشف حساب
                                            </a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=treasury">كشف حساب الخزينة
                                            </a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=balance">ميزان
                                            المراجعة</a></li>
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=tree&do=ditels_earn">قائمة
                                            الدخل</a></li>
                                    <li><a class="dropdown-item"
                                            href="reports_account.php?Manage=tree&do=financial_center">قائمة المركز
                                            المالى</a></li>
                                    <!-- <li><a class="dropdown-item" href="reports.php?Manage=Import&rep=All">التقرير الشهرى</a></li> -->
                                </ul>
                            </li>
                            <?php 
                            }
                            if (checkadmin($_SESSION['admin'], 13, 2) == 1  ) {
                                ?>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    مراكز التكلفة
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <li><a class="dropdown-item" href="reports_account.php?Manage=cost_centers&do=costs"> تقرير مراكز التكلفة</a></li>
                                    <!-- <li><a class="dropdown-item" href="reports.php?Manage=Import&rep=All">التقرير الشهرى</a></li> -->
                                </ul>
                            </li>
                            <?php } ?>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    التقارير
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <?php
                                    if (checkadmin($_SESSION['admin'], 13, 2) == 1 || checkadmin($_SESSION['admin'], 12, 2) == 1) {
                                        ?>
                                    <li>
                                        <a class="dropdown-item" href="reports.php?Manage=files&report=year">تقرير الملفات
                                        </a>
                                    </li>
                                    <?php } ?>
                                    <li><a class="dropdown-item" href="reports.php?Manage=payment">تقرير Payment
                                        </a></li>
                                    <li><a class="dropdown-item" href="reports.php?Manage=arrival">تقرير Arrival
                                        </a></li>
                                    <!-- <li><a class="dropdown-item" href="reports.php?Manage=hotels">تقرير الفنادق
                                        </a></li> -->
                                    <!-- <li><a class="dropdown-item" href="reports.php?Manage=cars">تقرير
                                            السيارات
                                        </a></li>
                                    <li><a class="dropdown-item" href="reports.php?Manage=receipt_recent&rep=All">تقرير
                                            العملاء
                                        </a></li>
                                    <li><a class="dropdown-item" href="reports.php?Manage=receipt_recent&rep=All">تقرير
                                            المصاريف
                                        </a></li>
                                    <li><a class="dropdown-item" href="reports.php?Manage=receipt_recent&rep=All">تقرير
                                            الوكلاء
                                        </a></li>
                                    <li><a class="dropdown-item" href="reports.php?Manage=receipt_recent&rep=All">تقرير
                                            الخزينة
                                        </a></li> -->

                                </ul>
                            </li>
                            <?php ?>
                        </ul>
                        <form id="searchForm" action="reservations?do=all_data_file" method="post">
                            <div class="input-group">
                                
                                <input class="form-control form-control-sm" name="search_name" type="search" placeholder="أدخل رقم الملف" aria-label="Search">
                                <button class="btn btn-primary" type="submit" name="search_file"><i class="fa-solid fa-magnifying-glass"></i></button>
                            </div>
                        </form>
                        <script>
    $(document).ready(function(){
        $('#search_name').keyup(function(){
            var search_name = $(this).val();
            
            if(search_name != ''){
                $.ajax({
                    url: 'reservations?do=all_data_file',
                    type: 'POST',
                    data: {search_file: true, search_name: search_name},
                    success:function(response){
                        $('#searchResults').html(response);
                    }
                });
            } else {
                $('#searchResults').html('');
            }
        });
    });
    </script>
                        <a class="navbar-brand" style="
                                font-family: Aref Ruqaa, sans-serif;
                                font-size: 24px;
                                font-weight: 700;
                                color: #000;
                            ">
                            <?php echo $pageTitle ?>
                        </a>
                        
                        <!--
                        <a class="navbar-brand" href="index.php">
                        <img src="img/logo.png" alt="" style=" width: 30%; height: 100%; min-width: 127px;">
                        </a> -->
                        <ul class="d-flex navbar-nav mb-2 mb-lg-0">

                            <!-- <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    الإعدادت <i class="fa fa-cog" aria-hidden="true"></i>
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <?php
                                    if ($pr == 0 || $pr == 1 || $pr == 2 || $pr == 3) {
                                        ?>
                                        <li><a class="dropdown-item" href="#">إعدادات البرنامج</a></li>
                                        <li><a class="dropdown-item" href="settings.php?do=AddNameCo">إعدادات البرنامج</a></li> -->
                                        <!--<li><a class="dropdown-item" href="">تعديل بيانات الشركة</a></li>-->
                                        <!-- <?php
                                    } ?>
                                </ul>
                            </li>  -->
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                                    data-bs-toggle="dropdown" aria-expanded="false">
                                    الملف الشخصى <i class="fa fa-user" aria-hidden="true"></i>
                                </a>
                                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                                    <?php
                                    if ($pr == 0 || $pr == 1 || $pr == 2 || $pr == 3) {
                                        ?>
                                        <li><a class="dropdown-item" href="profile.php">المستخدمين</a></li>
                                        <li><a class="dropdown-item" href="profile.php?profile=add_permissions">إعطاء
                                                الصلاحيات</a></li>
                                        <?php
                                    } ?>
                                    <li><a class="dropdown-item"
                                            href="profile.php?profile=Edit&userid=<?php echo $_SESSION['admin'] ?>">تعديل
                                            بياناتك</a></li>
                                    <li><a class="dropdown-item" href="logout.php">تسجيل الخروج</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>
        </header>
        <div class="sidebar">
            <button id="toggleSidebar" class="btn btn-secondary">
                <i class="fas fa-bars"></i>
            </button>
            <!-- اضف هنا العناصر الخاصة بالقائمة الجانبية -->
            <div class="d-flex flex-column flex-shrink-0 bg-body-tertiary menu-mini">

                <ul class="nav nav-pills nav-flush flex-column mb-auto text-center">
                    <li class="nav-item">
                        <a href="home" class="nav-link active py-3 border-bottom rounded-0" aria-current="page"
                            title="الرئيسية" data-bs-toggle="tooltip" data-bs-placement="right">
                            <svg class="bi pe-none" width="24" height="24" role="img" aria-label="Home">
                                <use xlink:href="#home" />
                            </svg>
                        </a>
                    </li>
                    <?php
                    if (checkadmin($_SESSION['admin'], 4, 2) == 2 || checkadmin($_SESSION['admin'], 1, 0) == 0 || checkadmin($_SESSION['admin'], 4, 1) == 1) {
                        ?>
                        <li>
                            <a href="reservations?do=all_file" class="nav-link py-3 border-bottom rounded-0"
                                title="ادارة الملفات" data-bs-toggle="tooltip" data-bs-placement="right">
                                <!-- <i class="fa-solid fa-folder-plus fa-xl"></i> -->
                                <svg width="24" height="24" role="img" fill="currentColor" class="bi bi-folder-fill"
                                    viewBox="0 0 16 16">
                                    <path
                                        d="M9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.825a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31L.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3m-8.322.12C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981z" />
                                </svg>
                            </a>
                        </li>
                    <?php } ?>
                    <li>
                        <a href="#" class="nav-link py-3 border-bottom rounded-0" title="Orders" data-bs-toggle="tooltip"
                            data-bs-placement="right">
                            <svg class="bi pe-none" width="24" height="24" role="img" aria-label="Orders">
                                <use xlink:href="#table" />
                            </svg>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="nav-link py-3 border-bottom rounded-0" title="Products" data-bs-toggle="tooltip"
                            data-bs-placement="right">
                            <svg class="bi pe-none" width="24" height="24" role="img" aria-label="Products">
                                <use xlink:href="#grid" />
                            </svg>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="nav-link py-3 border-bottom rounded-0" title="Customers" data-bs-toggle="tooltip"
                            data-bs-placement="right">
                            <svg class="bi pe-none" width="24" height="24" role="img" aria-label="Customers">
                                <use xlink:href="#people-circle" />
                            </svg>
                        </a>
                    </li>
                </ul>
                <div class="dropdown border-top">
                    <a href="#"
                        class="d-flex align-items-center justify-content-center p-3 link-body-emphasis text-decoration-none dropdown-toggle"
                        data-bs-toggle="dropdown" aria-expanded="false">
                        <img src="https://github.com/mdo.png" alt="mdo" width="24" height="24" class="rounded-circle">
                    </a>
                    <ul class="dropdown-menu text-small shadow">
                        <li><a class="dropdown-item" href="#">New project...</a></li>
                        <li><a class="dropdown-item" href="#">Settings</a></li>
                        <li><a class="dropdown-item" href="#">Profile</a></li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li><a class="dropdown-item" href="#">Sign out</a></li>
                    </ul>
                </div>
            </div>
            <div class="flex-shrink-0 p-3 menu-all" style="width: 245px; display:none">
                <a href="/"
                    class="d-flex align-items-center pb-3 mb-3 link-body-emphasis text-decoration-none border-bottom">
                    <!-- <svg class="bi pe-none me-2" width="30" height="24">
                        <use xlink:href="#bootstrap" />
                    </svg> -->
                    <span class="fs-5 fw-semibold">مرحبا
                        <?php echo ""; ?>
                    </span>
                </a>
                <ul class="list-unstyled ps-0">
                    <li class="mb-1">
                        <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed"
                            data-bs-toggle="collapse" data-bs-target="#home-collapse" aria-expanded="true">
                            ادارة الملفات
                        </button>
                        <div class="collapse show" id="home-collapse">
                            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
                                <?php
                                if (checkadmin($_SESSION['admin'], 4, 2) == 2 || checkadmin($_SESSION['admin'], 1, 0) == 0 || checkadmin($_SESSION['admin'], 4, 1) == 1) {
                                    ?>
                                    <li><a href="reservations?do=all_file"
                                            class="link-body-emphasis d-inline-flex text-decoration-none rounded">عرض
                                            الملفات</a>
                                    </li>
                                <?php } ?>
                                <li><a href="reservations?do=add"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">اضافة ملف
                                        جديد</a>
                                </li>
                                <!-- <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Reports</a>
                                </li> -->
                            </ul>
                        </div>
                    </li>
                    <li class="mb-1">
                        <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed"
                            data-bs-toggle="collapse" data-bs-target="#dashboard-collapse" aria-expanded="false">
                            Dashboard
                        </button>
                        <div class="collapse" id="dashboard-collapse">
                            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Overview</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Weekly</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Monthly</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Annually</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="mb-1">
                        <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed"
                            data-bs-toggle="collapse" data-bs-target="#orders-collapse" aria-expanded="false">
                            Orders
                        </button>
                        <div class="collapse" id="orders-collapse">
                            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">New</a></li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Processed</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Shipped</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Returned</a>
                                </li>
                            </ul>
                        </div>
                    </li>
                    <li class="border-top my-3"></li>
                    <li class="mb-1">
                        <button class="btn btn-toggle d-inline-flex align-items-center rounded border-0 collapsed"
                            data-bs-toggle="collapse" data-bs-target="#account-collapse" aria-expanded="false">
                            Account
                        </button>
                        <div class="collapse" id="account-collapse">
                            <ul class="btn-toggle-nav list-unstyled fw-normal pb-1 small">
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">New...</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Profile</a>
                                </li>
                                <li><a href="#"
                                        class="link-body-emphasis d-inline-flex text-decoration-none rounded">Settings</a>
                                </li>
                                <li><a href="#" class="link-body-emphasis d-inline-flex text-decoration-none rounded">Sign
                                        out</a></li>
                            </ul>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <?php
    }
    ?>
    <div class="view">
        <?php
        if (isset($_SESSION['msg']) && !empty($_SESSION['msg'])) {
            ?>
            <div id="msgdata" style="
                    position: fixed;
                    background: #2194e5;
                    width: auto;
                    left: 25%;
                    right: auto;
                    border-radius: 5px;
                    text-align: center;
                    padding: 10px;
                    color: #fff;
                    top: 60px;
                    z-index: 15;">
                <?php echo $_SESSION['msg']; ?>
            </div>
            <?php
            $_SESSION['msg'] = "";
        }
        ?>
        <div class="container-fluid" style="direction: rtl;">