
      <!-- Begin page -->
        <div id="layout-wrapper">

            
            <header id="page-topbar">
                <div class="navbar-header">
                    <div class="d-flex">
                       <!-- LOGO -->
                       <div class="navbar-brand-box">
                        <a href="index.php" class="logo logo-dark">
                            <span class="logo-sm">
                                CP
                            </span>
                            <span class="logo-lg">
                                CP
                            </span>
                        </a>

                        <a href="index.php" class="logo logo-light">
                            <span class="logo-sm">
                                CP
                            </span>
                            <span class="logo-lg">
                                CP
                            </span>
                        </a>
                    </div>

                    <button type="button" class="btn btn-sm px-3 font-size-16 header-item waves-effect vertical-menu-btn">
                        <i class="fa fa-fw fa-bars"></i>
                    </button>

                       

                    </div>

                    <div class="d-flex">

                        <div class="dropdown d-inline-block d-lg-none ms-2">
                            <button type="button" class="btn header-item noti-icon waves-effect" id="page-header-search-dropdown"
                                data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <i class="ri-search-line"></i>
                            </button>
                            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end p-0"
                                aria-labelledby="page-header-search-dropdown">
                    
                                <form class="p-3">
                                    <div class="mb-3 m-0">
                                        <div class="input-group">
                                            <input type="text" class="form-control" placeholder="Search ...">
                                            <div class="input-group-append">
                                                <button class="btn btn-primary" type="submit"><i class="ri-search-line"></i></button>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>

                       

                        <div class="dropdown d-none d-lg-inline-block ms-1">
                            <button type="button" class="btn header-item noti-icon waves-effect" data-bs-toggle="fullscreen">
                                <i class="ri-fullscreen-line"></i>
                            </button>
                        </div>

                        

                        <div class="dropdown d-inline-block user-dropdown">
                            <button type="button" class="btn header-item waves-effect" id="page-header-user-dropdown"
                                data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <!--<img class="rounded-circle header-profile-user" src="../assets/images/users/avatar-2.jpg"
                                    alt="Header Avatar">-->
                                    <i class="ri-shut-down-line align-middle me-1"></i>
                            </button>
                            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-end">
                                <!--
                                <div class="p-3">
                                    <div class="row align-items-center">
                                        <div class="col">
                                            <h6 class="m-0"> Danish Zehen </h6>
                                        </div>
                                    </div>
                                </div>
                                -->
                                <div data-simplebar style="max-height: 230px;">
                                <!-- item-->
                               
                                <!-- item-->
                               
                                <!-- item-->
                                
                                <!-- item-->
                               
                            </div>
                             <!-- item-->
                             <div class="pt-2 border-top">
                                <div class="d-grid">
                                    <a class="btn btn-sm btn-link font-size-14 text-center" href="../salir.php">
                                        <i class="ri-shut-down-line align-middle me-1"></i> Salir
                                    </a>
                                </div>
                            </div>
                            </div>
                        </div>                      
            
                    </div>
                </div>
            </header>
        </div>    

            <!-- ========== Left Sidebar Start ========== -->
            <div class="vertical-menu">

                <!-- LOGO -->
                <div class="navbar-brand-box">
                    <a href="/public_html/gestioncp/modulos/index_M.php" class="logo logo-dark">
                        <span class="logo-sm">
                            Camperspatagonia
                        </span>
                        <span class="logo-lg">
                        Camperspatagonia
                        </span>
                    </a>

                    <a href="/public_html/gestioncp/modulos/index_M.php" class="logo logo-light">
                        <span class="logo-sm">
                        Camperspatagonia
                        </span>
                        <span class="logo-lg">
                        Camperspatagonia
                        </span>
                    </a>
                </div>

                <button type="button" class="btn btn-sm px-3 font-size-16 header-item waves-effect vertical-menu-btn">
                    <i class="fa fa-fw fa-bars"></i>
                </button>

                <div data-simplebar class="sidebar-menu-scroll">

                    <!--- Sidemenu -->
                    <div id="sidebar-menu">
                        <!-- Left Menu Start -->
                        <ul class="metismenu list-unstyled" id="side-menu">
                            <li class="menu-title">Menu</li>
                                    
                                <?php
                                
                                $sql = $mysqli->query("select * from tb_menu order by orden");
                                while ($rows = $sql->fetch_assoc()){
                                    $id_menu  = $rows['id_menu'];
                                    $nombre   = $rows['nombre'];
                                    $expandir = $rows['expandir'];
                                    $icono    = $rows['icono'];
                                    $url      = $rows['url'];
                                    if ($expandir==1){
                                        $link = "javascript: void(0);";
                                        $class = "has-arrow waves-effect";
                                    }else{
                                        $link = $url;
                                        $class = "waves-effect";
                                    }

                                    ?>
                                    <li>
                                    <a href="<?=$link?>" class="<?=$class?>">
                                        <i class="<?=$icono?>"></i>
                                        <span><?=$nombre?></span>
                                    </a>                                            
                                    <?php
                                    if ($expandir==1){
                                        // submenu
                                        $sql2 = $mysqli->query("select * from tb_submenu where id_menu='$id_menu' order by orden");
                                        ?>
                                        <ul class="sub-menu" aria-expanded="false">
                                            <?
                                            while ($rows2 = $sql2->fetch_assoc()){
                                                $id_submenu = $rows2['id_submenu'];
                                                $nombre_sub     = $rows2['nombre'];
                                                $url        = $rows2['url'];
                                                ?>
                                                <li>
                                                    <a href="<?=$url?>"><?=$nombre_sub?></a>                                                                                  
                                                </li>
                                                <?
                                            }
                                            ?>                                                                                            
                                        </ul>
                                        <?php
                                    }
                                    ?>
                                    </li>
                                    <?php
                                }
                                
                                ?>     

                                    
                              

                        </ul>
                    </div>
                    <!-- Sidebar -->
                </div>
            </div>
            <!-- Left Sidebar End -->

            
