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

global  $wpdb,
		$accommodation_tbl,
		$facilities_tbl,
		$destinations_tbl,
		$hotels_tbl,
		$countries_tbl,
		$hotels_terminals_tbl,
		$categories_tbl,
		$chains_tbl;


$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);
  ?>
     <article class="search-result box">

      <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-5">
          <a href="#<?php //echo site_url('hotel/'.$hotel->hotel_id.'/'.$hotel->name); ?>" 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->name; ?></a></h3>
          <p><?php echo ucwords(strtolower($hotel->address.', '.$hotel->city.', '.$hotel->country_name)); ?></p>            
          <!-- <a href="#" title="Lorem ipsum"><span class="plus">Compare
            <i class="glyphicon glyphicon-plus"></i>
          </span></a> -->

          <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" href="javascript:void(0)">Virtuoso Amenities</a></div>

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

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

      <span class="clearfix"></span>
    </article> 
  <?php 
    } 
  }else{
    echo '<h4>Lo sentimos, no se han encontrado resultados!</h4>';
  }
  
