<!-- Sidebar  -->
<style>
            .custicon{
                color: #908d95;

            }
            .custcolumn .customicon{
                color: #908d95;
            }
            .custcolumn:hover .customicon{
                color: #847474;
            }
            .custcolumn  span{
                color: #908d95;
            }
            .custcolumn:hover  span{
                color: #847474;

            }
            .custcolumn:hover {
                background-color: #847474;
            }
            .custcolumn {
                margin-bottom: 1px;
                background-color: #fdf1e1;
            }
            
        </style>
        <nav id="sidebar" style="background-color: #957C78;">
            <!-- <div class="sidebar-header">
                <h3>Bootstrap Sidebar</h3>
            </div> -->

            <ul class="list-unstyled components" style="color:#DBD0CE;border-bottom: 0px solid #DBD0CE;padding: 0px;">
               
                <p style="color: #908d95;line-height:30px;background-color: #DBD0CE;margin-bottom:1px;"> <i class="fas fa-cog mr-2 customsidefont" style="color: #908d95;"></i><span class="customsidefont">你好! <?php echo $fullName;?></span></p>
                <li style="background-color: #DBD0CE;" class="custcolumn">

                <form action="/at-cms/adminmain/changeshop" method="POST">
                    

                    <span class="d-inline-block customsidefont" >
                    &nbsp;&nbsp;切換分店:</span>
                   
                    <select name="shopid" id="shopid" class="form-control d-inline-block customsidefont" style="width: auto;height: auto!important;"

                    <?php 
                    // rold id 7=boss
                    // rold id 6=admin
                    // rold id 5=consultant/manager  ->can change shop but only view booking
                    // rold id 4=consultant          ->cannot change shop
                    // rold id 3=therapist/manager  ->can change shop
                    // role id 2=therapist          ->cannot change shop 
                    //role id 1=manager             ->can change shop
                    if($this->session->userdata('roleId')==7 || $this->session->userdata('roleId')==6 || $this->session->userdata('roleId')==5 || $this->session->userdata('roleId')==3 || $this->session->userdata('roleId')==1){

                    ?>
                     onchange="this.form.submit()"
                     <?php 
                        }
                     ?>
                     <?php
                            // therapist and consultant not manager cannot change shop
                            if($this->session->userdata('roleId')==2 || $this->session->userdata('roleId')==4){
                                echo "disabled";
                            }
                    ?>
                     >
                        <?php foreach ($shop as $shoprow) {
                        ?>
                            <option value="<?php echo $shoprow->id;?>"
                                <?php
                                    if($currentshop==$shoprow->id){
                                        echo "selected";
                                    }
                                ?>
                                ><span class="customsidefont"><?php echo $shoprow->name;?></span></option>
                        <?php    # code...
                        }
                        ?>
                    </select>
                   
                    <input type="hidden" name="inputcontroller" id="inputcontroller" value="<?php echo $this->uri->segment(2);?>">
        
                </form>
                </li>
                <?php
                    if($this->session->userdata('dashboard_access')==true){
                ?> 
                <li style="background-color: #DBD0CE;" class="custcolumn">

                    <a href="/at-cms/dashboard"><i class="fas fa-tachometer-alt mr-2 customicon <?php
                    if($selectedmenu=='dashboard'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='dashboard'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >儀錶板</span></a>
                </li>  
                <?php
                    }//if($this->session->set_userdata('dashboad_access')==1){
                ?>  
                 <?php
                    // if($this->session->userdata('pricelist_access')==true){
                ?> 
               <!--  <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/pricelist"><i class="fas fa-list mr-2 customicon"></i><span >價錢列表</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 

                <?php
                    if($this->session->userdata('pricelist_access')==true){
                ?> 
                <li style="background-color: #DBD0CE;" class="custcolumn">

                    <a href="/at-cms/brpricelist"><i class="fas fa-list mr-2 customicon <?php
                    if($selectedmenu=='brpricelist'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brpricelist'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">價錢列表</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 


                 <?php
                    // if($this->session->userdata('brcustomer_access')==true){
                ?> 
                <!-- <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/customeradmin">

                        <i class="fas fa-user mr-2 customicon"></i><span >客戶管理</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 

                <?php
                    if($this->session->userdata('brcustomer_access')==true){
                ?>  
                <li style="background-color: #DBD0CE;" class="custcolumn">

                    <a href="/at-cms/brcustomeradmin/display">

                        <i class="fas fa-user mr-2 customicon <?php
                    if($selectedmenu=='brcustomeradmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brcustomeradmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >客戶管理</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                 <?php
                    if($this->session->userdata('brbooking_access')==true){
                ?> 
                <li style="background-color: #DBD0CE;" class="custcolumn">

                    <a href="/at-cms/brbookingnew"><i class="fas fa-calendar-alt mr-2 customicon customsidefont <?php
                    if($selectedmenu=='brbookingnew'){
                        echo 'activemenu';
                    }
                    ?>"></i><span class="<?php
                    if($selectedmenu=='brbookingnew'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">預約-日曆</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 

                  <?php
                    // if($this->session->userdata('brbooking_access')==true){
                ?> 
               <!--  <li style="background-color: #fdf1e1;" class="custcolumn">

                    <a href="/at-cms/brbookingnewtest"><i class="fas fa-calendar-alt mr-2 customicon"></i><span >預約-日曆新test</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 

                <?php
                    //old calendar 2020-08-07
                    // if($this->session->userdata('brbooking_access')==true){
                ?> 
               <!--  <li style="background-color: #fdf1e1;" class="custcolumn">

                    <a href="/at-cms/brbooking"><i class="fas fa-calendar-alt mr-2 customicon"></i><span >預約-日曆</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                   //end //old calendar 2020-08-07
                ?> 
                <?php
                    // if($this->session->userdata('brbooking_access')==true){
                ?> 
              <!--   <li style="background-color: #fdf1e1;" class="custcolumn">

                    <a href="/at-cms/booking"><i class="fas fa-calendar-alt mr-2 customicon"></i><span >預約-日曆舊</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 


                <?php
                    // if($this->session->userdata('brbooking_access')==true){
                ?> 
               <!--   <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/bookinglist"><i class="fas fa-calendar-alt mr-2 customicon"></i><span >預約-列表</span></a>
                </li> -->
                 <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                 <?php
                    if($this->session->userdata('brbooking_access')==true){
                ?>  
                <li style="background-color: #DBD0CE;" class="custcolumn">

                    <a href="/at-cms/brbookinglist"><i class="fas fa-calendar-alt mr-2 customicon customsidefont <?php
                    if($selectedmenu=='brbookinglist'){
                        echo 'activemenu';
                    }
                    ?>"></i><span class="<?php
                    if($selectedmenu=='brbookinglist'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >預約-列表</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                <?php
                    if($this->session->userdata('brbooking_access')==true){
                ?>  
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brinvoiceadmin"><i class="fas fa-calendar-alt mr-2 customicon <?php
                    if($selectedmenu=='brinvoiceadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brinvoiceadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">發票</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                <?php
                    // if($this->session->userdata('brservice_access')==true){
                ?> 
                <!--  <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/servicesadmin"><i class="fas fa-list mr-2 customicon"></i><span >服務管理</span></a>
                </li> -->
                  <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?>   
                 <?php
                    if($this->session->userdata('brservice_access')==true){
                ?>  
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brservicesadmin"><i class="fas fa-list mr-2 customicon <?php
                    if($selectedmenu=='brservicesadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brservicesadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">服務管理</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                 <?php
                    // if($this->session->userdata('bremployee_access')==true){
                ?> 
              <!--   <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/employeeadmin"><i class="fas fa-users mr-2 customicon"></i><span >職員</span></a>
                </li> -->
                <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                 <?php
                    if($this->session->userdata('bremployee_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/bremployeeadmin"><i class="fas fa-building mr-2 customicon <?php
                    if($selectedmenu=='bremployeeadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='bremployeeadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">職員</span></a>
                </li>
                 <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
                <?php
                    // if($this->session->userdata('brroom_access')==true){
                ?>  
                 <!-- <li style="background-color: #ffffff;" class="custcolumn">

                    <a href="/at-cms/roomadmin"><i class="fas fa-building mr-2 customicon"></i><span >房間</span></a>
                </li> -->
                <?php
                    // }//if($this->session->userdata('pricelist_access')==true){
                ?> 

                 <?php
                    if($this->session->userdata('brroom_access')==true){
                ?>  
                 <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brroomadmin"><i class="fas fa-building mr-2 customicon <?php
                    if($selectedmenu=='brroomadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brroomadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >房間</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('pricelist_access')==true){
                ?> 
               
               
                
                 <?php
                    if($this->session->userdata('brsetting_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brcustomerleveladmin">

                        <i class="fas fa-user mr-2 customicon <?php
                    if($selectedmenu=='brcustomerleveladmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brcustomerleveladmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">客戶級別設定</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 

                 <?php
                    if($this->session->userdata('brsetting_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brcustomerbodyadmin">

                        <i class="fas fa-user mr-2 customicon <?php
                    if($selectedmenu=='brcustomerbodyadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brcustomerbodyadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">客戶表格身體選項設定</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                <?php
                    if($this->session->userdata('brsetting_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brcustomerfaceadmin">

                        <i class="fas fa-user mr-2 customicon <?php
                    if($selectedmenu=='brcustomerfaceadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brcustomerfaceadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">客戶表格面部選項設定</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                 <?php
                    if($this->session->userdata('brsetting_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brshopadmin"><i class="fas fa-building mr-2 customicon <?php
                    if($selectedmenu=='brshopadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='brshopadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >門店</span></a>
                </li>
               <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                 <?php
                    //if($this->session->userdata('brsetting_access')==true){
                ?> 
                <?php
                    if($this->session->userdata('employeerole_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/bremployeegroupadmin"><i class="fas fa-building mr-2 customicon <?php
                    if($selectedmenu=='bremployeegroupadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span class="<?php
                    if($selectedmenu=='bremployeegroupadmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont" >職員角色</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                <?php
                    //}//if($this->session->userdata('brsetting_access')==true){
                ?> 
                <!--  <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/employeeadmin"><i class="fas fa-users mr-2 customicon"></i><span >職員</span></a>
                </li> -->
              <?php
                    if($this->session->userdata('brsetting_access')==true){
                ?>
                <li style="background-color: #dbd0ce;" class="custcolumn">

                    <a href="/at-cms/brchanneladmin">

                        <i class="fas fa-user mr-2 customicon <?php
                    if($selectedmenu=='brchanneladmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont"></i><span  class="<?php
                    if($selectedmenu=='brchanneladmin'){
                        echo 'activemenu';
                    }
                    ?> customsidefont">會員來源管理</span></a>
                </li>
                <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                 <?php
                    if($this->session->userdata('brsetting_access')==true){
                        //hided user menu at 2020-08-17
                ?>
<!--                 <li style="background-color: #dbd0ce;" class="custcolumn">
                    <a href="/at-cms/adminmain"><i class="fas fa-user mr-2 customicon customsidefont"></i><span class="customsidefont" >管理員用戶</span></a>
                </li>
 -->
                 <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                <!-- <li class="active">
                    <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle"><p><i class="fas fa-user mr-2"></i>管理員用戶</p></a>
                    <ul class="collapse list-unstyled" id="homeSubmenu">
                        <li>
                            <a href="#">Home 1</a>
                        </li>
                        <li>
                            <a href="#">Home 2</a>
                        </li>
                        <li>
                            <a href="#">Home 3</a>
                        </li>
                    </ul>
                </li> -->
                
             <!--    <li style="background-color: #dbd0ce;" class="custcolumn">
                    <a href="/at-cms/frontadmin"><i class="fas fa-university mr-2 customicon"></i><span >機構用戶</span></a>
                </li> -->
               <!--  <li style="background-color: #dbd0ce;" class="custcolumn">
                    <a href="/at-cms/folderadmin"><i class="fas fa-folder mr-2 customicon"></i><span >分類管理</span></a>
                </li> -->
                <!-- <li style="background-color: #dbd0ce;" class="custcolumn">
                    <a href="#pageSubmenu" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle"><i class="fas fa-folder mr-2 customicon"></i><span >分類管理</span></a>
                    <ul class="collapse list-unstyled" id="pageSubmenu">
                        <li>
                            <a href="#">Page 1</a>
                        </li>
                        <li>
                            <a href="#">Page 2</a>
                        </li>
                        <li>
                            <a href="#">Page 3</a>
                        </li>
                    </ul>
                </li> -->

               <!--  <li style="background-color: #dbd0ce;"  class="custcolumn">
                    <a href="/at-cms/rightadmin"><i class="fas fa-lock mr-2 customicon"></i><span >用戶權限</span></a>
                </li> -->
                <?php
                    if($this->session->userdata('brsetting_access')==true){
                    //hided user data
                ?>
<!--                 <li style="background-color: #dbd0ce;"  class="custcolumn">
                    <a href="#"><i class="far fa-clock mr-2 customicon customsidefont"></i><span class="customsidefont" >用戶記錄</span></a>
                </li> -->
                 <?php
                    }//if($this->session->userdata('brsetting_access')==true){
                ?> 
                <li style="background-color: #dbd0ce;"  class="custcolumn">
                    <a href="<?php echo base_url();?>at-cms/login/logout"><i class="fas fa-power-off mr-2 customicon customsidefont"></i><span  class="customsidefont">安全登出</span></a>
                </li>
                <li style="background-color: #dbd0ce;height:40vh;"  >
                   
                </li>
            </ul>

            <!-- <ul class="list-unstyled CTAs">
                <li>
                    <a href="https://bootstrapious.com/tutorial/files/sidebar.zip" class="download">Download source</a>
                </li>
                <li>
                    <a href="https://bootstrapious.com/p/bootstrap-sidebar" class="article">Back to article</a>
                </li>
            </ul> -->
        </nav>