<?php
include "../../../../wp-blog-header.php";

  $hotels = search_hotels($_POST);

  if(!empty($hotels)){
    foreach ($hotels as $hotel) {
      $images = get_hotel_images($hotel->hotel_id);
      $facilities = get_hotel_facilities($hotel->hotel_id,70,8);
      $image = NORMAL_IMAGE_PATH.$images[0]->path;
      $img_url= itg_timthumb_image($image, 200,320);
      $hotel_link = create_hotel_link($hotel->hotel_id);
      

  ?>
     <article class="search-result box">

      <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-5">
          <a href="<?php echo $hotel_link; ?>" title="<?php echo $hotel->name; ?>" class="thumbnail">
            <img src="<?php echo $img_url; ?>" alt="<?php echo $hotel->name; ?>" />
          </a>
        </div>
      
        <div class="col-xs-12 col-sm-12 col-md-7 mt20">
          <div class="mtv">
          <h3><a href="<?php echo $hotel_link; ?>"><?php echo $hotel->name; ?></a></h3>
          <p><?php echo ucwords(strtolower($hotel->address.', '.$hotel->city.', '.$hotel->country_name)); ?></p>            

          <ul class="meta-search">
            <?php 
            foreach($facilities as $facility){
                echo '<li><i class="fa fa-check-square-o"></i><span>'.$facility->name.'</span></li>';
            }
            ?>
          </ul>

          <div class="clearfix"></div>

          <div class="mt20 virt_text"><a class="top rooms_check" href="javascript:void(0)" hotel-code="<?php echo $hotel->code; ?>">Servicios Virtuoso</a></div>

          <div class="clearfix"></div>
          </div>
            
        </div>
      </div>

      <div class="bottom slidingDiv roomdetails_<?php echo $hotel->code; ?>">
        <p><?php echo $hotel->description; ?></p> 
      </div>

      <span class="clearfix"></span>
    </article> 
  <?php 
  
    } 
  }
  ?>


