<!DOCTYPE HTML>
<html>
<head>
<?php
//Carrega 3 apartamentos
require_once './Control/ControlProduto.php';
$controlProduto = new ControlProduto();
$acomodacao = $controlProduto->pegarUmProduto('', $_GET['id']);
?>    
<meta charset="utf-8">
<title><?php echo $acomodacao->getNome();?> - San Karlo Hotel</title>
<?php include 'incCabecalho.php';?>
</head>


<body>

<?php include 'incTopHeader.php'; ?>
<?php 
$menuApartamentos=true;
include 'incTop.php'; 
?>    

<!-- Parallax Effect -->
<script type="text/javascript">$(document).ready(function(){$('#parallax-pagetitle').parallax("50%", -0.55);});</script>

<section class="parallax-effect">
  <div id="parallax-pagetitle" style="background-image: url(./images/parallax/recepcao.jpg);">
    <div class="color-overlay"> 
      <!-- Page title -->
      <div class="container">
        <div class="row">
          <div class="col-sm-3"></div>
          <div class="col-sm-9">
            <ol class="breadcrumb">
              <li><a href="index">Home</a></li>
              <li><a href="apartamentos">Apartamentos</a></li>
              <li class="active"><?php echo $acomodacao->getNome();?></li>
            </ol>
            <h1><?php echo $acomodacao->getNome();?></h1>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>    

<div class="container mt50">
  <div class="row"> 
    <!-- Slider -->
    <section class="standard-slider room-slider">
      <div class="col-sm-12 col-md-8">
        <div id="owl-standard" class="owl-carousel">
            <?php
            require_once './Control/ControlFoto.php';
            $controlFoto = new ControlFoto();
            if ($acomodacao->getGaleriaid() != NULL)
            {
                $galeria = $controlFoto->pegarUmGaleria($acomodacao->getGaleriaid());
                $fotos = $controlFoto->pegarTodosFotoporGaleria($galeria->getGaleriaID());
                while ($fotos->fetch())
                {
                    echo '<div class="item"> <a href="' . $fotos->getFotoq() .'" data-rel="prettyPhoto[gallery1]"><img src="' . $fotos->getFotoq() .'" alt="' . $fotos->gDescricao() .'" class="img-responsive"></a> </div>';
                }
            }
            ?>
          
        </div>
      </div>
    </section>
    
    <!-- Reservation form -->
    <section id="reservation-form" class="mt50 clearfix">
      <div class="col-sm-12 col-md-4">
          <h2 class="lined-heading"><span>Detalhes</span></h2>
            <table class="table table-striped mt30">
              <tbody>
                <tr>
                    <?php
                        $AcomodacaoDesc = $controlProduto->pegarTodosProdudoDescricaoporProduto($acomodacao->getProdutoid());
                        $cont = 0;
                         while ($AcomodacaoDesc->fetch())
                         {
                             if ($cont == 0)
                             {
                                 echo '<tr>';
                             }
                                echo '<td><i class="fa fa-check-circle"></i> ' . $AcomodacaoDesc->gNome() .'</td>';
                                $cont++;
                             if ($cont == 3)
                             {
                                 $cont = 0;
                                 echo '</tr>';
                             }
                         }
                         if ($cont <> 0)
                         {
                             echo '</tr>';
                         }
                    ?>
                </tr>
              </tbody>
            </table>
            <?php 
                if ($acomodacao->getPreco() != 0)
                {
                echo '<div class="price">&real;$ ' . $acomodacao->getPreco() . '<span>Tarifa Balcão - 02 Pax</span></div>'; 
                }
            ?>
      </div>
    </section>
    
    <!-- Room Content -->
    <section>
      <div class="container">
        <div class="row">
          <div class="col-sm-12 mt50">
              <h2 class="lined-heading"><span><?php echo $acomodacao->getNome(); ?></span></h2>  
            <?php echo $acomodacao->gDescricao(); ?>
          </div>
        </div>
      </div>
    </section>
  </div>
</div>

<!-- Other Rooms -->
<section class="rooms mt50">
  <div class="container">
    <div class="row">
      <div class="col-sm-12">
        <h2 class="lined-heading"><span>Outros apartamentos</span></h2>
      </div>
      <?php
      require_once './Control/ControlProduto.php';
        $controlProduto = new ControlProduto();
        $acomodacoes = $controlProduto->pegarTodosProduto();
        $acomodacoes->setHabilitado(True);
        $acomodacoes->order('idsite')->find();
        while ($acomodacoes->fetch())
        {
            if ($acomodacoes->getIdsite()!= $acomodacao->getIdsite())
            {
                $incAcomodacao = $acomodacoes;
                include './incAcomodacao.php';
            }
        }
      ?>
    </div>
  </div>
</section>



<?php include 'incFooter.php'; ?>

</body>
</html>