<?php global $access; if($access != 1){ exit("Direct Access not allowed"); } ?>

              <div>
                <h3>Search Results</h3>
              </div><br>

<div id="paging_container1">
<div class="page_navigation"></div><br />

<div class="content">
<!-- Search item -->
        <?php		
		if ($totaldehoteles > 0) {
			for ($k = 1; $k <= $totaldehoteles; $k++) {
				$arrk              = $k - 1;
				$khotelid          = $arrayhotelsearch[$arrk]['hotel_id'];
				$khotelname        = $arrayhotelsearch[$arrk]['hotel_name'];
				$khotelprice       = $arrayhotelsearch[$arrk]['hotel_price'];
				$khoteladdress     = $arrayhotelsearch[$arrk]['hotel_address'];
				$khotelcity        = $arrayhotelsearch[$arrk]['hotel_city'];
				$khotelcountry     = $arrayhotelsearch[$arrk]['hotel_country'];
				$khotelzip         = $arrayhotelsearch[$arrk]['hotel_zip'];
				$khotelstars       = $arrayhotelsearch[$arrk]['hotel_stars'];
				$khotelreviews     = $arrayhotelsearch[$arrk]['hotel_reviews'];
				$khotelreviewscore = $arrayhotelsearch[$arrk]['hotel_reviews_score'];
				$khotelimage       = $arrayhotelsearch[$arrk]['hotel_image'];
				$khoteldescription = $arrayhotelsearch[$arrk]['hotel_description'];
				$khotelsupplier    = $arrayhotelsearch[$arrk]['hotel_supplier'];
				$klongitud         = $arrayhotelsearch[$arrk]['longitud'];
				$klatitud          = $arrayhotelsearch[$arrk]['latitud'];
				
				$finalprice = $khotelprice*$finaltotal;
		?>
				
                
   <div style="display:none;">
   <script type="text/javascript">
	$(document).ready(function(){
		$('.link-<?php echo $khotelid; ?>').toggle(
			function () {
				if($('#box-<?php echo $khotelid; ?>').text() == '') {
					$("#loading-<?php echo $khotelid; ?>").show();
					$.ajax({
						url:'<?php echo "inc/querys/roomavailability.php?hotelid=$khotelid&hotelname=$khotelname&city=$khotelcity&ota_priority=$khotelsupplier&guests=$guests&maxguests=$guestsroommayor&$datosbusqueda&baseC=$newcurrency"; ?>',
						method:'GET',
						success:function(r) {
							$('.link-<?php echo $khotelid; ?>').html('hide rates');
							$('#box-<?php echo $khotelid; ?>').html(r).hide().slideDown(1000);
								$("#loading-<?php echo $khotelid; ?>").hide(); // hide ajax loader
						},
						error:function() {
							alert('file does not exist');
						}
					});
				} else {
					$(this).html('hide rates');
					$('#box-<?php echo $khotelid; ?>').slideDown(1000);
				}
			},
			function () {
				$(this).html('view rates');
				$('#box-<?php echo $khotelid; ?>').slideUp(1000);
			}
		);
	});
   </script>
   </div>
              
              <div class="hotelistcontainer">
                <div class="row-fluid">
                  <span class="span3">
                    <div class="thumbdiv">
                      <a class='previewimg fl' href="<?php echo "hotel.php?hotelid=$khotelid&hotelname=$khotelname&city=$khotelcity&ota_priority=$khotelsupplier&element_id=&longitud=$klongitud&latitud=$klatitud&guests=$guests&maxguests=$guestsroommayor&$datosbusqueda&baseC=$newcurrency"; ?>"><img src='<?php echo $khotelimage; ?>' class="thumbimg image" /></a>
                      <a class="fancybox fancybox.iframe" href="inc/querys/list-gallery.php?<?php echo "hotel_id=$khotelid&hotel_name=$khotelname&city=$khotelcity&ota_priority=$khotelsupplier&element_id=&longitud=$klongitud&latitud=$klatitud&guests=$guests&$datosbusqueda&baseC=$newcurrency"; ?>"><p class="morephotostxt">More Photos</p></a>
                    </div>
                  </span>
                  <span class="span6 HotelInfoContent">
                    <span class="hoteltitle"></span>
                    <div class="HotelName">
                      <p><a href="<?php echo "hotel.php?hotelid=$khotelid&hotelname=$khotelname&city=$khotelcity&ota_priority=$khotelsupplier&element_id=&longitud=$klongitud&latitud=$klatitud&guests=$guests&maxguests=$guestsroommayor&$datosbusqueda&baseC=$newcurrency"; ?>"><span style="color:#000;"><?php echo $khotelname; ?></span></a></p>
                    </div>
                    <div class="HotelStarContent">
                      <img src="<?php echo PATH; ?>images/<?php echo $khotelstars; ?>.png" class="image">
                    </div>
                    <div class="addresshoteltxt">
                      <p><?php echo $khoteladdress; ?> <?php echo $khotelcity; ?></p>
                    </div>
                    <div class="hoteldesctxt">
                      <p><?php echo $khoteldescription; ?></p>
                    </div>
                  </span>
                  <span class="span3">
                    <p class="prizetext"><?php $singleprice = number_format($finalprice, 2, '.', ''); echo $currencysymbol . intval($singleprice); ?></p>
                  </span>
                </div>
                
                <div class="detailstxt">
                  <p><span class="link link-<?php echo $khotelid; ?>">View Details</span></p>
                  <div id="box-<?php echo $khotelid; ?>"></div>
<div id="loading-<?php echo $khotelid; ?>" style="display:none; position:relative; width:130px;"><img src="<?php echo PATH; ?>img/icon_loading.gif" style="position:absolute; top:3px; width:30px;" /> <span style="float:right;">Loading Rates</span></div>
                </div>
                
                <div class='clear'>&nbsp;</div>
			<hr />
                
              </div>

		<?php } } ?>
		<!-- End of Search item -->
</div>		
      
                
                <div class="page_navigation"></div><br />

</div>