
		<div class="col-md-3">
                    <?php 
                    include_once ROOT . 'views' . DS . 'layout' . DS . 'default' . DS . '_LeftSiderbar_hoteles.php';
                    
                    if($this->objHotel){ ?>
                        <div style="width:100%; height:400px;margin-bottom: 18px;" id="mapaPrincipal"></div>
                    <?php }
                    ?>
		</div>
        
        
		<div class="col-md-9">
        <?php if($this->objHotel){?>
			<ul class="booking-list">
                        <?php 
                        $prange = $this->json->precio->desde.';'. $this->json->precio->hasta;
                        if(($this->nombre_hotel != '') || $this->getCategoria != 'O' || $this->getPlanalimenticio_bus!= 'O' || $this->get_integracion_side !='O' ||($this->price_range != '0;0' && $this->price_range != $prange && $this->price_range != 'O')){  ?>
                            <div class="row">
                                <div class="col-md-12">                        
                                    <a class="btn-sm btn-danger" href="<?php echo $this->get_url_filtros, '/O/0;0/O/O/O/0'; ?>" >Quitar filtros</a><br><br>
                                </div>  
                            </div>
			<?php } 

            //$c=1;
            foreach($this->objHotel as $c => $hotel ){ ?>
                <li>
                <div class="booking-item">
                
                    <form class="form_Hoteles_<?php echo $c;?> form_hotel_detalle" target="_blank"  method="post" action="<?php echo BASE_URL.'hoteles/detalle/'.$this->form;?>">
                        <div class="row">
                            <div class="col-md-3">
                            <?php if(isset($hotel->bestValue)){ 
                                if($hotel->bestValue == 1){ ?>
                            <div style="position: relative;">
                                <div style="position: absolute;z-index:999;left: -20px;top:-6px;">
                                    <img src="<?php echo $_layoutParamsCB['ruta_hoteles']; ?>/certificate_seal-512.png" style=" max-width: 50px;" rel="tooltip" data-placement="top" title="Excelente Relaci&oacute;n Precio Calidad en las fechas Seleccionadas!"/>
                                </div>
                            </div>
                            <?php }
                            } ?>
                                <div class="booking-item-img-wrap">
                                      <?php
                                        

                                        if(isset($hotel->images[0]->image) && $hotel->images[0]->image!=''){


                                        if($hotel->origen=='ORS'){ ?>
                                                

                                        <img src="<?php echo $_layoutParamsCB['ruta_hoteles'].'/'.$hotel->images[0]->image;?>" />

                                      <?php }else{ ?>

                                            <img src="<?php echo str_replace('http://', 'https://', $hotel->images[0]->image);?>"/>
                                            
                                            <?php if($hotel->origen=='GTA'){ ?>
                                            <div style="position: relative;">
                                                <p style="font-size: 10px; position: absolute; top: -25px; margin-left: 3px; background-color: #FFFFFF;padding-right: 5px; padding-left: 4px;">Image from VFM Leonardo, Inc</p>
                                            </div> 

                                      <?php }
                                  }


                                  

                                      }else{ ?>
                                        <img src="<?php echo $_layoutParamsCB['ruta_hoteles']; ?>/sin_foto.png" />
                                      <?php } ?>                                    
                                </div>
                            </div>
                            <div class="col-md-6" style="padding-right: 0px;">
                            
                               <b class="color-text-second" style="font-size :20px;"><?php echo Functions::remplase_codigo_caracter($hotel->name);?></b><br>
                                <div class="booking-item-rating">
                                    <ul class="icon-group booking-item-rating-stars">
                                        <?php
                                        //categoryCode
                                        $star = substr($hotel->categoryName,0,1);

                                        if(strpos($hotel->categoryName, 'Estrellas') || strpos($hotel->categoryName, 'ESTRELLAS')){

                                            for($i=1;$i<=5 ;$i++){

                                             if( $i<=$star){ ?>

                                                    <li><i class="fa fa-star"></i></li>

                                                <?php }else{ ?>

                                                    <li><i class="fa fa-star-o"></i></li>

                                                <?php }
                                                } ?>
                                            <li><?php echo ' ('.$hotel->categoryCode.')'; ?></li>

                                        <?php 
                                    }elseif($hotel->origen=='HBE'){ ?>
                                        <li><?php echo $hotel->categoryName.' ('.$hotel->categoryCode.')'; ?></li>

                                       <?php }else{

                                            if($star>0){
                                            for($i=1;$i<=5 ;$i++){

                                             if( $i<=$star){ ?>

                                                    <li><i class="fa fa-star"></i></li>

                                                <?php }else{ ?>

                                                    <li><i class="fa fa-star-o"></i></li>

                                                <?php }
                                                } ?>
                                            <li><?php echo ' ('.$hotel->categoryCode.')'; ?></li>
                                          <?php  }else{ ?>

                                                <li><?php echo $hotel->categoryName.' ('.$hotel->categoryCode.')'; ?></li>
                                            <?php } 
                                        }
                                        ?>
                                    </ul>
                                </div>
                                <p class="booking-item-address" style="margin-bottom: 2px;"><i class="fa fa-map-marker"></i> <?php echo $hotel->destinationName;?></p>
                                <p class="booking-item-address" style="margin-bottom: 14px;"><i class="fa fa-map-marker"></i> <a data-effect="mfp-zoom-out" data-toggle="modal" href="#myModal3" onclick="Hoteles.prototype.desplegarMapa('<?php echo $hotel->latitude; ?>','<?php echo $hotel->longitude; ?>');" style="text-decoration: underline;">Ubicaci&oacute;n</a></p>
                                
                                <p class="booking-item-address" >
                                    <?php 
                                    $promocion = '';

                                    $minrateHotel = $hotel->minRate;
                                    $planAL = $hotel->rooms[0]->rates[0]->boardName;
                                    $tipoHab = $hotel->rooms[0]->name;

                                    if(isset( $hotel->rooms[0]->promotions->name)){
                                            $promocion =  $hotel->rooms[0]->promotions->name;
                                    }

                                    if($hotel->origen=='OMN'){
                                        
                                        foreach ($hotel->rooms as $room) {
                                            foreach ($room->rates as $rate) {
                                                if($minrateHotel > $rate->net){
                                                    $minrateHotel = $rate->net;
                                                    $planAL = $rate->boardName;
                                                    $tipoHab = $room->name;
                                                }
                                            }
                                                
                                        }
                                    }else{

                                        foreach ($hotel->rooms as $room) {
                                            foreach ($room->rates as $rate) {
                                                if($minrateHotel == Functions::tarifa_Hotel($rate->net,$hotel->markup,$hotel->currency,Session::get('sess_moneda_valor_hotel_'.$hotel->currency))){
                                                    $planAL = $rate->boardName;
                                                    $tipoHab = $room->name;
                                                }
                                            }
                                                
                                        }
                                    }

                                    

                            echo '<b ><span style="background-color:#0ab21b; color:#FFFFFF;border-radius: 3px;padding: 4px 6px;margin-right: 3px; line-height: 24px;">'.Functions::remplase_codigo_caracter($tipoHab).'</span> <span style="background-color:#0ab21b; color:#FFFFFF;border-radius: 3px;padding: 4px 6px; line-height: 24px;">'.Functions::remplase_codigo_caracter($planAL).'</span></b>';
                            ?>
                            </p>
                                 <div class="col-md-12">

                            <?php if($promocion!=''){ ?>

                                <br>
                                <div class="col-md-1">&nbsp;</div>
                                <div class="col-md-11"><b><span style="background-color:#EA5D08; color:#FFFFFF;border-radius: 3px;padding: 4px 6px;margin-right: 3px;"><?php echo Functions::remplase_codigo_caracter($promocion);?></span></b></div>
                            <?php } ?>
                        </div>
                            </div>
                            <div class="col-md-3">
                           

                            <span class="pull-right"  style="background-color:#6865F8; color:#FFFFFF;border-radius: 3px;padding: 4px 6px;margin-right: 3px;">Precio <?php echo $this->noches; ?> noches desde</span><span class="booking-item-price" style="margin-bottom: 0px;">

                            <b class="text-color" style="font-size: 20px;">
                            <div class="pull-right" style="width: 100%;">
                            <span class="pull-right"><?php 
                            if($hotel->currency!='CLP'){


                            if($hotel->origen=='OMN'){
                            echo Functions::formatoValor('D',  round(Functions::tarifa_Hotel($minrateHotel,$hotel->markup,$hotel->currency,Session::get('sess_moneda_valor_hotel_'.$hotel->currency))));
                            }else{

                                echo Functions::formatoValor('D',round($minrateHotel));
                            }

                        }else{

                            if($hotel->origen=='OMN'){
                              echo Functions::formatoValor('P', round( Functions::tarifa_Hotel($minrateHotel,$hotel->markup,$hotel->currency,Session::get('sess_moneda_valor_hotel_'.$hotel->currency))));  
                          }else{

                            echo Functions::formatoValor('P',round($minrateHotel));
                          }
                            

                        }
                            ?>
                        </span>
                        </div>
                            <?php if($hotel->currency!='CLP'){ ?>

                            <div class="text-color pull-right" style="font-size: 15px; margin-top: -20px;">

                            
                            (<?php 

                                if($hotel->origen=='OMN'){
                                echo Functions::formatoValor('P',round(Functions::tarifa_Hotel($minrateHotel*Session::get('sess_tcambio'),$hotel->markup,$hotel->currency,Session::get('sess_moneda_valor_hotel_'.$hotel->currency))));
                                }else{
                                    echo Functions::formatoValor('P',round(($minrateHotel*Session::get('sess_tcambio'))));

                                } ?>)

                            
                            </div>
                            <?php } ?>
                            </b>
                            
                            <input type="hidden" name="paisDes" value="<?php echo urlencode($this->_pais); ?>">
                            <input type="hidden" name="ciudadNombre" value="<?php echo $this->_ciudadName;?>">
                            <input type="hidden" name="codHotel" value="<?php echo $this->_codH;?>">
                            <input type="hidden" name="fechaIn" value="<?php echo $this->_fechaIn;?>">
                            <input type="hidden" name="fechaOut" value="<?php echo $this->_fechaOut; ?>">
                            <input type="hidden" name="cantAdult" value="<?php echo $this->_cantAd;?>">
                            <input type="hidden" name="cantChild" value="<?php echo $this->_cantCh;?>">
                            <input type="hidden" name="codRam" value="<?php echo $this->_codRam; ?>">
                            <input type="hidden" name="cantHab" value="<?php echo $this->_cantHab; ?>">
                            <input type="hidden" name="integracion" value="<?php echo $hotel->origen; ?>">
                            <input type="hidden" name="codigo_hotel_integracion" value="<?php echo $hotel->code; ?>">
                            <input type="hidden" name="cantChild2" value="<?php echo $this->_cant_CHD_1+$this->_cant_CHD_2+$this->_cant_CHD_3 ;?>">
                            <input type="hidden" name="cantAdult2" value="<?php echo $this->_cant_AD_1+$this->_cant_AD_2+$this->_cant_AD_3;?>">
                            <input type="hidden" class="edades_child" name="edades_child" value="">
                            

                           </span>
                           <div class="col-md-12">&nbsp;</div>
                           
                            <a onclick="set_edades();Hoteles.prototype.procesoDetalleProg('<?php echo $this->form;?>','form_Hoteles_<?php echo $c; ?>')"><center><span class="btn btn-primary pull-right">Ver Detalle</span></center></a>
                            </div>
                        </div>
                        <p class="pull-right" style="font-size: 10px;"><?php  
                        
                                echo ($hotel->origen == 'DIS')? RBS: $hotel->origen;
                                ?></p>
                        </form>
                    </div>
                </li>
                <?php //$c++;
                } ?>
            </ul>
                    <div class="row">
                        <div class="col-md-12">
                            <ul class="pagination">
                                <?php $ultima = ((int)($this->_totalRegistros/10))*10;
                                    
                                $paginas = $this->_page;

                                $final = ($ultima/10)+1;

                                
                                $actual = ($this->_page/10)+1;
                               

                                $indice = $actual;
                                $antes =$this->_page -10;
                                if($this->_page > 0){ ?>
                                <li><a href="<?php echo $this->_urlPage;?>/0">Primera</a></li>
                                <li >...</li>
                                <li><a href="<?php echo $this->_urlPage.'/'.$antes;?>"> < </a> </li>
                                <?php }

                                for($i=1 ;$i<=5;$i++){
                                    if($ultima < $paginas ){
                                        break;
                                    } 
                                    if($paginas != $this->_totalRegistros){ 
                                        ?>
                                <li <?php if($paginas == $this->_page ) { ?> class="active"<?php } ?> ><a href="<?php echo $this->_urlPage.'/'.$paginas;?>"><?php echo $indice; ?></a></li>
                                <?php 
                            }

                                $paginas = $paginas+10;
                                       $indice++;
                                }

                                if($paginas-10 < $ultima ){ ?>
                                <li >...</li>
                                <li><a href="<?php echo ($this->_totalRegistros == $ultima )? $this->_urlPage.'/'.($ultima -10 ) : $this->_urlPage.'/'.$ultima;?>">Ultima</a></li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                    <br>
        <?php }else{  ?>


        <?php 
                        $prange =$this->json->precio->desde.';'.$this->json->precio->hasta;
                        if(($this->nombre_hotel != '') || $this->getCategoria != 'O' || $this->getPlanalimenticio_bus!= 'O' || $this->get_integracion_side != 'O' ||($this->price_range != '0;0' && $this->price_range != $prange && $this->price_range != 'O')){  ?>
                            <div class="row">
                                <div class="col-md-12">                        
                                    <a class="btn-sm btn-danger" href="<?php echo $this->get_url_filtros, '/O/0;0/O/O/O/0'; ?>" >Quitar filtros</a><br><br>
                                </div>  
                            </div>
            <?php } ?>


                     <div class="alert alert-dismissable alert-warning">
                                No se encontraron registros para esta b&uacute;squeda.
                            </div>

                    <?php echo Session::get('sess_error_busqueda_Hotel'); ?>
        <?php } ?>
		</div>
<script>
     $('.i-check, .i-radio').iCheck({
        checkboxClass: 'i-check',
        radioClass: 'i-radio'
        });

     $("#price-slider").ionRangeSlider({
        min: MIN_RANGE,
        max: MAX_RANGE,
        //prefix: "$",
        values_separator: " - ",
        type: "double",
        grid: true,
        prettify_enabled: true,
        prettify_separator: "."
    });

<?php if($this->objHotel){ ?>
/*Se gatilla en hoteles.js*/
function initMapPrincipal() {
    
    <?php foreach ($this->objHotel as $key => $hot) {
     //'-33.426246','-70.614602'
    if(isset($hot->latitude) && $hot->latitude != '') { ?>

    var myLatLng = new google.maps.LatLng(<?php echo str_replace(",",".",$hot->latitude), ',', str_replace(",",".",$hot->longitude); ?>);
    <?php break; } else { ?>
    var myLatLng = new google.maps.LatLng(-33.426246, -70.614602);    
    <?php } } ?>
    var myOptions = {
                zoom: 10,
                center: myLatLng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };

var map = new google.maps.Map(document.getElementById("mapaPrincipal"), myOptions);

var image = {
  url: '<?php echo $_layoutParamsCB['ruta_hoteles'];?>/hotel_icono.png', //ruta de la imagen
  origin: new google.maps.Point(0,0),
  size: new google.maps.Size(30, 30), //origen de la iamgen
//el ancla de la imagen, el punto donde esta marcando, en nuestro caso el centro inferior.
  anchor: new google.maps.Point(20, 60) 
 };

    <?php foreach ($this->objHotel as $key => $hot) { 



         if(isset($hot->latitude) && $hot->latitude != '') {?>

            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(<?php echo str_replace(",",".",$hot->latitude);?>,<?php echo str_replace(",",".",$hot->longitude);?>),
                map: map,
                icon: image,
                title: "<?php echo $hot->name; ?>"
            });
            marker.setMap(map);
            google.maps.event.addListener(marker, 'click', function() {

                $('#myModal1').modal('show');
                //infowindow.open(map, marker);

                Hoteles.prototype.procesoDetalleProg('<?php echo $this->form;?>','form_Hoteles_<?php echo $key; ?>');
            });
            //infowindow.open(map,marker);
    <?php 
} 
} ?>


};
<?php } ?>


$(".filtrosHoteles").on('ifClicked', function () {
    setTimeout(function() {
        $( "#frmLSHoteles" ).submit();
    }, 500);
});

$(".select_integracion").on('change',function(){
    setTimeout(function() {
        $( "#frmLSHoteles" ).submit();
    }, 500);
});
$("#btnAplicar").click( function() {
    $( "#frmLSVuelos" ).submit();
});
$("[rel='tooltip']").tooltip();
</script>
 <script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSyByJ-PrjAq7ZDCa8_bCGYB-hzoAJcInrug&callback=<?php echo $this->mapa;?>"></script>
<script>
    var insideIframe = window.top !== window.self;
    if(insideIframe){
        $(".form_hotel_detalle").removeAttr('target');
    }
</script>
