<?php
require_once './Control/ControlProduto.php';
$controlProduto = new ControlProduto();
$apartamentos = $controlProduto->pegarTodosProduto();
$ar = $apartamentos->allToArray();
$ar = Utilidades::OrdenarArray($ar, 'idsite');
if (isset($menuHome))
{
    $menuHome='active';
} else
{
    $menuHome='';
}
if (isset($menuHotel))
{
    $menuHotel='active';
} else
{
    $menuHotel='';
}
if (isset($menuApartamentos))
{
    $menuApartamentos='active';
} else
{
    $menuApartamentos='';
}
if (isset($menuToulouse))
{
    $menuToulouse='active';
} else
{
    $menuToulouse='';
}
if (isset($menuLocalizacao))
{
    $menuLocalizacao='active';
} else
{
    $menuLocalizacao='';
}
if (isset($menuPacotes))
{
    $menuPacotes='active';
} else
{
    $menuPacotes='';
}
if (isset($menuContato))
{
    $menuContato='active';
} else
{
    $menuContato='';
}
?>
<!-- Header -->
<header>
  <!-- Navigation -->
  <div class="navbar yamm navbar-default" id="sticky">
    <div class="container">
      <div class="navbar-header">
        <button type="button" data-toggle="collapse" data-target="#navbar-collapse-grid" class="navbar-toggle"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
        <a href="index" class="navbar-brand">         
        <!-- Logo -->
        <div id="logo"> <img id="default-logo" src="images/logorosa.png" alt="San Karlo Hotel"></div>
        </a> </div>
      <div id="navbar-collapse-grid" class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
          <li class="dropdown <?php echo $menuHome;?>"> <a href="index"><i class="fa fa-home"></i> Home</a>
          <li class="<?php echo $menuHotel;?>"> <a href="hotel"><i class="fa fa-institution"></i> Hotel</a></li>              
          </li>
		  <li class="dropdown <?php echo $menuApartamentos;?>"> <a href="apartamentos" data-toggle="dropdown" class="dropdown-toggle js-activated"><i class="fa fa-building"></i> Apartamentos<b class="caret"></b></a>
            <ul class="dropdown-menu">
               <!-- Lista os apartamentos -->
               <li><a href="apartamentos"><i class="fa fa-building"></i> Listar Todos</a></li>
               <?php
               foreach ($ar as $value) {
                   if ($value['habilitado'] == 'sim')
                   {
                        echo '<li><a href="apartamento?id=' . $value['idsite'] . '">' . $value['nome'] . '</a></li>';
                   } 
               }
               ?>
            </ul>
          </li>
          <li class="<?php echo $menuToulouse;?>"> <a href="toulouse"><i class="fa fa-briefcase"></i> Espaço Toulouse</a></li>
          <li class="<?php echo $menuPacotes;?>"> <a href="pacotes"><i class="fa fa-folder-open"></i> Pacotes</a></li>
          <li class="<?php echo $menuContato;?>"> <a href="contato"><i class="fa fa-phone"></i> Fale conosco</a></li>
	  <li class="<?php echo $menuContato;?>"> 
<!-- mibew text link --><a id="mibew-agent-button" href="http://chat.sankarlohotel.com.br/chat?locale=pt-br" target="_blank" onclick="Mibew.Objects.ChatPopups['57e1a819aaac4fb'].open();return false;"><span class="parpadea" style="font-size: large; color: red;"><i class="fa fa-weixin"></i>Chat</span></a><script type="text/javascript" src="http://chat.sankarlohotel.com.br/js/compiled/chat_popup.js"></script><script type="text/javascript">Mibew.ChatPopup.init({"id":"57e1a819aaac4fb","url":"http:\/\/chat.sankarlohotel.com.br\/chat?locale=pt-br","preferIFrame":true,"modSecurity":false,"width":640,"height":480,"resizable":true,"styleLoader":"http:\/\/chat.sankarlohotel.com.br\/chat\/style\/popup"});</script><!-- / mibew text link -->
</li>
        </ul>
      </div>
    </div>
  </div>
</header>
