
<body class="mod-bg-1 ">
<!-- DOC: script to save and load page settings -->
<script>
    /**
     *  This script should be placed right after the body tag for fast execution 
     *  Note: the script is written in pure javascript and does not depend on thirdparty library
     **/
    'use strict';

    var classHolder = document.getElementsByTagName("BODY")[0],
        /** 
         * Load from localstorage
         **/
        themeSettings = (localStorage.getItem('themeSettings')) ? JSON.parse(localStorage.getItem('themeSettings')) :
        {},
        themeURL = themeSettings.themeURL || '',
        themeOptions = themeSettings.themeOptions || '';
    /** 
     * Load theme options
     **/
    if (themeSettings.themeOptions)
    {
        classHolder.className = themeSettings.themeOptions;
        console.log("%c✔ Theme settings loaded", "color: #148f32");
    }
    else
    {
        console.log("Heads up! Theme settings is empty or does not exist, loading default settings...");
    }
    if (themeSettings.themeURL && !document.getElementById('mytheme'))
    {
        var cssfile = document.createElement('link');
        cssfile.id = 'mytheme';
        cssfile.rel = 'stylesheet';
        cssfile.href = themeURL;
        document.getElementsByTagName('head')[0].appendChild(cssfile);
    }
    /** 
     * Save to localstorage 
     **/
    var saveSettings = function()
    {
        themeSettings.themeOptions = String(classHolder.className).split(/[^\w-]+/).filter(function(item)
        {
            return /^(nav|header|mod|display)-/i.test(item);
        }).join(' ');
        if (document.getElementById('mytheme'))
        {
            themeSettings.themeURL = document.getElementById('mytheme').getAttribute("href");
        };
        localStorage.setItem('themeSettings', JSON.stringify(themeSettings));
    }
    /** 
     * Reset settings
     **/
    var resetSettings = function()
    {
        localStorage.setItem("themeSettings", "");
    }

</script>


<?php
    $userDetails = $this->session->userdata('isUserLoggedIn');
    // print_r($userDetails); 
    // echo $userDetails['Id'];
    // echo $userDetails['isUserType'];
    // echo $userDetails['fiMenu'];

?>


<!-- BEGIN Page Wrapper -->
<div class="page-wrapper">
    <div class="page-inner">
        <!-- BEGIN Left Aside -->
        <aside class="page-sidebar">
            <div class="page-logo">
                <a href="<?php echo base_url() ?>" class="page-logo-link" >
                    <span class="page-logo-text mr-1 sidear-site-title">Quest <span>Compendium</span></span> 
                    <span class="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span> 
                    <!-- <i class="fal fa-angle-down d-inline-block ml-1 fs-lg color-primary-300"></i>  -->
                </a>
            </div>
            <!-- BEGIN PRIMARY NAVIGATION -->
            <nav id="js-primary-nav" class="primary-nav side_bar_scroll" role="navigation" >
                <div class="nav-filter">
                    <div class="position-relative">
                        <input type="text" id="nav_filter_input" placeholder="Filter menu" class="form-control" tabindex="0">
                        <a href="#" onclick="return false;" class="btn-primary btn-search-close js-waves-off" data-action="toggle" data-class="list-filter-active" data-target=".page-sidebar">
                            <i class="fal fa-chevron-up"></i>
                        </a>
                    </div>
                </div>
                <div class="info-card">
                    <div class="info-card-text">
                        <a href="#" class="d-flex align-items-center text-white">
                            <span class="text-truncate text-truncate-lg d-inline-block">
                                <?php echo isset($pageTitle)?$pageTitle:'Dashboard'; ?>
                            </span>
                        </a>
                        <span class="d-inline-block text-truncate text-truncate-lg"></span>
                    </div>
                    <img src="<?php echo base_url() ?>assets/img/card-backgrounds/cover-2-lg.png" class="cover" alt="cover">
                    <!-- <a href="#" onclick="return false;" class="pull-trigger-btn" data-action="toggle" data-class="list-filter-active" data-target=".page-sidebar" data-focus="nav_filter_input">
                        <i class="fal fa-angle-down"></i>
                    </a> -->
                </div>
                <ul id="js-nav-menu" class="nav-menu">
                    

                    <?php if($userDetails['isUserType']=='admin'): ?>

                    <li>
                        <a href="<?php echo base_url() ?>dashboard" title="Different Flavors" data-filter-tags="package info different flavors">
                            <i class="fal fa-chart-pie"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Dashboard</span>
                        </a>
                    </li>

                    <li>
                        <a href="<?php echo base_url() ?>hotels" title="Package Info" data-filter-tags="package info">
                            <i class="fal fa-building"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Hotels Property</span>
                        </a>
                    </li>

                    <li>
                        <a href="<?php echo base_url() ?>menu" title="Package Info" data-filter-tags="package info">
                            <i class="fal fa-table"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Manage Menu</span>
                        </a>
                    </li>

                    <li class="">
                        <a title="Menu" data-filter-tags="documentation" class="waves-effect waves-themed" aria-expanded="false">
                            <i class="fal fa-book"></i>
                            <span class="nav-link-text" data-i18n="nav.documentation" style="color: #fff;">Menus</span> </a>
                       
                        <ul>
                            <?php 


                                        $query = $this->db->select('*')->get('menu');
                                        $menuLists = $query->result_array(); 

                                          // echo "<pre>"; print_r($query); die();
                                           $bgArray = array(
                                                '0'=>'resort.png',
                                                '1'=>'place.png',
                                                '2'=>'alarm1.png',
                                                '3'=>'dining-table1.png',
                                                '4'=>'meeting1.png',
                                            );
                     

                                           if(count($menuLists) > 0){
                                            $i = 0;
                                              foreach($menuLists as $menulistvalue){
                                                if(!isset($bgArray[$i])){
                                                $i = 0;
                                                }
                                        ?>
                                        <li class="#" >
                                            <a href="<?php echo base_url() ?>category/index/<?php echo $menulistvalue['id']; ?>" title="Different Flavors" data-filter-tags="package info different flavors">
                                                <img style="width: 100%; height: auto;     max-width: 21px; margin-right: 13px;" src="<?php echo base_url() ?>assets/img/siderbar_logo/<?php echo $bgArray[$i] ?>" alt="" aria-roledescription="logo">
                                                <!-- <i class="<?php echo $bgArray[$i] ?>"></i> -->
                                                <span class="nav-link-text" data-i18n="nav.package_info"><?php echo $menulistvalue['fsTitle']; ?></span>
                                            </a>
                                        </li>
                                        <?php
                                            $i++;
                                          }
                                        }
                                        ?> 
                        </ul>
                    </li>

                    

                 <!--     <li>
                        <a href="<?php echo base_url() ?>category" title="Package Info" data-filter-tags="package info">
                            <i class="fal fa-table"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Hotel Facility</span>
                        </a>
                    </li>

                    <li>
                        <a href="<?php echo base_url() ?>facilities" title="Package Info" data-filter-tags="package info">
                            <i class="fal fa-shield-alt"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Facility Informations</span>
                        </a>
                    </li> -->

                   

                    <li>
                        <a href="<?php echo base_url() ?>Static_pages" title="Package Info" data-filter-tags="package info">
                            <i class="fal fa-book"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">CMS Pages</span>
                        </a>
                    </li>


                    <?php else: ?>

                    <style type="text/css">
                       .side_bar_scroll {height: calc(100vh - 200px) !important;}
                       .qr_manage{ position: absolute; top: 45%; left: -8%; width: 100% }

                       @media screen and (min-width: 1600px)  {
                        .side_bar_scroll {height: calc(91vh - 200px) !important; }
                        .qr_manage{ top: 50%; }
                       }
                    </style>    

                    <li>
                        <a href="<?php echo base_url() ?>dashboard" title="Different Flavors" data-filter-tags="package info different flavors">
                            <i class="fal fa-chart-pie"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Dashboard</span>
                        </a>
                    </li>   

                    <?php
                        //echo $this->uri->segment(1);
                        $menuId = 0;
                        if(isset($_REQUEST['menu_id'])){
                            $menuId = $_REQUEST['menu_id'];
                        }else{
                            $menuId =$this->uri->segment(3);
                        }
                        //echo $menuId; 
                    ?>


                    <li class="<?php echo $this->uri->segment(1)=='hotel_category' || $this->uri->segment(1)=='hotel_facilitates'?'active':''; ?>">
                        <a title="Menu" data-filter-tags="documentation" class="waves-effect waves-themed" aria-expanded="false">
                            <i class="fal fa-book"></i>
                            <span class="nav-link-text" data-i18n="nav.documentation" style="color: #fff;">Menus</span> </a>
                       
                        <ul>
                            <?php 


                                        $query = $this->db->select('*')->where('fiHotelId',$userDetails['Id'])->get('hotel_menu');
                                        $menuLists = $query->result_array(); 

                                          // echo "<pre>"; print_r($query); die();
                                           $bgArray = array(
                                                '0'=>'resort.png',
                                                '1'=>'place.png',
                                                '2'=>'alarm1.png',
                                                '3'=>'dining-table1.png',
                                                '4'=>'meeting1.png',
                                            );
                     

                                           if(count($menuLists) > 0){
                                            $i = 0;
                                              foreach($menuLists as $menulistvalue){
                                                if(!isset($bgArray[$i])){
                                                $i = 0;
                                                }
                                        ?>
                                        <li class="<?php echo $menuId==$menulistvalue['id']?'active':''; ?>" >
                                            <a href="<?php echo base_url() ?>hotel_category/index/<?php echo $menulistvalue['id']; ?>" title="Different Flavors" data-filter-tags="package info different flavors">
                                                <img style="width: 100%; height: auto;     max-width: 21px; margin-right: 13px;" src="<?php echo base_url() ?>assets/img/siderbar_logo/<?php echo $bgArray[$i] ?>" alt="" aria-roledescription="logo">
                                                <!-- <i class="<?php echo $bgArray[$i] ?>"></i> -->
                                                <span class="nav-link-text" data-i18n="nav.package_info"><?php echo $menulistvalue['fsTitle']; ?></span>
                                            </a>
                                        </li>
                                        <?php
                                            $i++;
                                          }
                                        }
                                        ?> 
                        </ul>
                    </li>

                    <li>
                        <a href="<?php echo base_url() ?>edit_profile/update/<?php echo $userDetails['Id']; ?> " data-filter-tags="package info different flavors">
                            <i class="fal fa-user"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Hotel Setting</span>
                        </a>
                    </li>

                    <li>
                        <a href="<?php echo base_url() ?>notification" data-filter-tags="package info different flavors">
                            <i class="fal fa-bell"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Notification</span>
                        </a>
                    </li> 

                 <!--    <li>
                        <a href="<?php echo base_url() ?>hotel_menu" data-filter-tags="package info different flavors">
                            <i class="fal fa-building"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">Manage Menus</span>
                        </a>
                    </li> -->

                    <li>
                        <a href="<?php echo base_url() ?>hotel_static_pages" data-filter-tags="package info different flavors">
                            <i class="fal fa-book"></i>
                            <span class="nav-link-text" data-i18n="nav.package_info">CMS Pages</span>
                        </a>
                    </li> 

                   
                </ul>
                <div class="filter-message js-filter-message bg-success-600"></div>
            </nav>

             <div class="qr_manage">
                        <?php
                            $query = $this->db->select('fsShortLink')->where('id',$userDetails['Id'])->get('hotels');
                            $quCode = $query->result_array(); 

                            foreach($quCode as $shortLink){
                           
                        ?>

                        <img style="  float: right; width: 50%; border: 1px solid #ccc; position: absolute; top: 230px; right: 45px;" src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=<?php echo $shortLink['fsShortLink'] ?>">

                        <?php                    
                        }
                        ?> 
                    </div> 


            <?php endif; ?>
            <!-- END PRIMARY NAVIGATION -->
            <!-- NAV FOOTER -->

            <div class="nav-footer shadow-top">
                <a href="#" onclick="return false;" data-action="toggle" data-class="nav-function-minify" class="hidden-md-down">
                    <i class="ni ni-chevron-right"></i>
                    <i class="ni ni-chevron-right"></i>
                </a>
                <ul class="list-table m-auto nav-footer-buttons">
                    
                    <li>
                        <a href="<?php echo base_url() ?>?action=logout" data-toggle="tooltip" data-placement="top" title="Logout">
                            <i class="fal fa-sign-out"></i>
                        </a>
                    </li>
                </ul>
            </div> <!-- END NAV FOOTER -->
        </aside>
        <!-- END Left Aside -->
        <div class="page-content-wrapper">
            <!-- BEGIN Page Header -->
            <header class="page-header" role="banner">
                <!-- we need this logo when user switches to nav-function-top -->
                <div class="page-logo">
                    <a href="#" class="page-logo-link press-scale-down d-flex align-items-center position-relative" data-toggle="modal" data-target="#modal-shortcut">
                        <img src="img/logo.png" alt="" aria-roledescription="logo">
                        <span class="page-logo-text mr-1">Hotel Compendium</span>
                        <span class="position-absolute text-white opacity-50 small pos-top pos-right mr-2 mt-n2"></span>
                        <i class="fal fa-angle-down d-inline-block ml-1 fs-lg color-primary-300"></i>
                    </a>
                </div>
                <!-- DOC: nav menu layout change shortcut -->
                <div class="hidden-md-down dropdown-icon-menu position-relative">
                    <a href="#" class="header-btn btn js-waves-off" data-action="toggle" data-class="nav-function-hidden" title="Hide Navigation">
                        <i class="ni ni-menu" ></i>
                    </a>
                    <ul>
                        <li>
                            <a href="#" class="btn js-waves-off" data-action="toggle" data-class="nav-function-minify" title="Minify Navigation">
                                <i class="ni ni-minify-nav"></i>
                            </a>
                        </li>
                        <li>
                            <a href="#" class="btn js-waves-off" data-action="toggle" data-class="nav-function-fixed" title="Lock Navigation">
                                <i class="ni ni-lock-nav"></i>
                            </a>
                        </li>
                    </ul>
                </div>
                <!-- DOC: mobile button appears during mobile width -->
                <div class="hidden-lg-up">
                    <a href="#" class="header-btn btn press-scale-down" data-action="toggle" data-class="mobile-nav-on">
                        <i class="ni ni-menu" style="padding-top: 6px!important;"></i>
                    </a>
                </div>
                <div class="search">
                    <form class="app-forms hidden-xs-down" role="search" action="https://www.gotbootstrap.com/themes/smartadmin/4.0.2/page_search.html" autocomplete="off">
                        <input type="text" id="search-field" placeholder="Search for anything" class="form-control" tabindex="1">
                        <a href="#" onclick="return false;" class="btn-danger btn-search-close js-waves-off d-none" data-action="toggle" data-class="mobile-search-on">
                            <i class="fal fa-times"></i>
                        </a>
                    </form>
                </div>

                <div class="ml-auto d-flex">
                    <!-- activate app search icon (mobile) -->
                    
                    <!-- app settings -->
                    <a href="#" data-toggle="dropdown" class="header-icon d-flex align-items-center justify-content-center ml-2">
                            <img src="<?php echo base_url() ?>assets/img/demo/avatars/avatar-admin_ones.jpg" class="profile-image rounded-circle" alt="Dr. Codex Lantern">
                        </a>
                         <div class="fs-lg text-truncate text-truncate-lg" style= "margin-top: 5px; margin-right: 20px;"><?php echo $userDetails['fsEmail']; ?></div>
                     <div class="hidden-md-down">
                        <a href="<?php echo base_url() ?>?action=logout" class="btn btn-outline-danger" style=" box-shadow: unset; cursor: pointer;">Logout
                            <i style="margin-left: 5px;"  class="fal fa-sign-out"></i>
                        </a>
                    </div> 
                    <div>


                        <div class="dropdown-menu dropdown-menu-animated dropdown-lg">
                            <div class="dropdown-header bg-trans-gradient d-flex flex-row py-4 rounded-top">
                                <div class="d-flex flex-row align-items-center mt-1 mb-1 color-white">

                                    <span class="mr-2">
                                        <img src="<?php echo base_url() ?>assets/img/demo/avatars/avatar-admin_ones.jpg" class="rounded-circle profile-image" alt="Dr. Codex Lantern">

                                    </span>
                                    <?php if($userDetails['isUserType']=='admin'): ?>
                                    
                                    <div class="info-card-text">
                                        <div class="fs-lg text-truncate text-truncate-lg">Admin</div>
                                        <!-- <span class="text-truncate text-truncate-md opacity-80">drlantern@gotbootstrap.com</span> -->
                                    </div>
                                    <?php else: ?>
                                        <div class="info-card-text">
                                            <div class="fs-lg text-truncate text-truncate-lg"><?php echo $userDetails['fsName']; ?></div>
                                            <span class="text-truncate text-truncate-md opacity-80"><?php echo $userDetails['fsEmail']; ?></span>
                                        </div>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="dropdown-divider m-0"></div>
                            <!-- <a href="#" class="dropdown-item" data-action="app-fullscreen">
                                <span data-i18n="drpdwn.fullscreen">Fullscreen</span>
                                <i class="float-right text-muted fw-n">F11</i>
                            </a> -->
                            <div class="dropdown-divider m-0"></div>
                            <a class="dropdown-item fw-500 pt-3 pb-3" href="<?php echo base_url() ?>?action=logout">
                                <span data-i18n="drpdwn.page-logout">Logout</span>
                                <span class="float-right fw-n">Hotel Compendium</span>
                            </a>
                        </div>
                    </div>
                </div>
            </header>
            <!-- END Page Header -->
            <!-- BEGIN Page Content -->
            <!-- the #js-page-content id is needed for some plugins to initialize -->
            <style type="text/css">
                .info-card {height: 5.53rem;}
            </style>