<?php
/**
 * The template for displaying single room gallery.
 *
 * This template can be overridden by copying it to yourtheme/wp-hotel-booking/single-room/gallery.php.
 *
 * @author  ThimPress, leehld
 * @package WP-Hotel-Booking/Templates
 * @version 1.6
 */

/**
 * Prevent loading this file directly
 */
defined( 'ABSPATH' ) || exit();

global $hb_room,$post;
/**
 * @var $hb_room WPHB_Room
 */
$galleries = $hb_room->get_galleries();
$post_id=get_the_ID();
?>

<?php if ( $galleries ) { 


?>

<div class="slider-gallery">
    <ul class="slider-room-gallery-main list-unstyled js-slider-gallery-room-main">
    <?php foreach ( $galleries as $key => $gallery ) { ?>
    <li>
         <?php echo wp_get_attachment_image( $gallery['id'], 'bestel-rooms-gallery-full'); ?>
    </li>
    <?php } ?>
        
    </ul>
</div>

<div class="row row-for-single-room">
                    <div class="col-lg-8">
                        <div class="slider-gallery">
                            <ul class="slider-room-gallery-thumbs list-unstyled js-slider-gallery-room-thumbs">
                                <?php foreach ( $galleries as $key => $gallery ) { ?>
                                <li>
                                     <?php echo wp_get_attachment_image( $gallery['id'], 'bestel-rooms-gallery'); ?>
                                </li>
                                <?php } ?>
                                
                            </ul>
                        </div>
                        <?php
                        $room_size = get_post_meta($post_id, "framework-room-size", TRUE);
                        $room_sleeps = get_post_meta($post_id, "framework-room-sleeps", TRUE);
                        $room_bed = get_post_meta($post_id, "framework-room-bed", TRUE);
                        $room_bathroom = get_post_meta($post_id, "framework-room-bathroom", TRUE);
                        ?>
                        <div class="info-grid">
                            <div class="row align-items-center">

                                <div class="col-6 col-sm">
                                    <div class="info-grid-label"><?php echo esc_html__('Room size', 'bestel'); ?></div>
                                    <div class="info-grid-text"><?php echo wp_kses_post($room_size); ?> <?php echo esc_html__('m', 'bestel'); ?><sup><?php echo esc_html__('2', 'bestel'); ?></sup></div>
                                </div>
                                <div class="col-6 col-sm">
                                    <div class="info-grid-label"><?php echo esc_html__('Sleeps', 'bestel'); ?></div>
                                    <div class="info-grid-text"><?php echo wp_kses_post($room_sleeps); ?></div>
                                </div>
                                <div class="col-6 col-sm">
                                    <div class="info-grid-label"><?php echo esc_html__('Bed types', 'bestel'); ?></div>
                                    <div class="info-grid-text"><?php echo wp_kses_post($room_bed); ?></div>
                                </div>
                                <div class="col-6 col-sm">
                                    <div class="info-grid-label"><?php echo esc_html__('Bathroom', 'bestel'); ?></div>
                                    <div class="info-grid-text"><?php echo wp_kses_post($room_bathroom); ?></div>
                                </div>
                            </div>
                        </div>
                        <div class="mt-3 mt-md-7"></div>
                        
                        
                        
                        <?php do_action( 'hotel_booking_single_room_infomation' ); ?>
                        
                        
                        <div class="mt-3 mt-md-5"></div>
                        <h2><?php echo esc_html__('Room Features', 'bestel') ?></h2>

                        <?php
                        $room_breakfast = get_post_meta($post_id, "framework-room-breakfast", TRUE);
                        $room_safe = get_post_meta($post_id, "framework-room-safe", TRUE);
                        $room_lift = get_post_meta($post_id, "framework-room-lift", TRUE);
                        $room_tv = get_post_meta($post_id, "framework-room-tv", TRUE);
                        $room_view = get_post_meta($post_id, "framework-room-view", TRUE);
                        $room_wifi = get_post_meta($post_id, "framework-room-free-wifi", TRUE);
                        $room_hair_dryer = get_post_meta($post_id, "framework-room-hair-dryer", TRUE);
                        $room_air_conditioner = get_post_meta($post_id, "framework-room-air-conditioner", TRUE);
                        $room_air_minibar = get_post_meta($post_id, "framework-room-air-minibar", TRUE);
                        $room_widget_info = get_post_meta($post_id, "framework-room-widget-info", TRUE);
                        $room_price = get_post_meta($post_id, "framework-room-price", TRUE);
                        $room_features = get_post_meta($post_id, "framework-room-features", TRUE);
                        ?>

                        <div class="row">
                            <div class="col-md-4">
                                <ul class="marker-list">
                                    <li><?php echo esc_html__('Breakfast', 'bestel'); ?> : <span><?php echo wp_kses_post($room_breakfast); ?></span></li>
                                    <li><?php echo esc_html__('Safe', 'bestel') ?>: <span><?php echo wp_kses_post($room_safe); ?></span></li>
                                    <li><?php echo esc_html__('Lift', 'bestel') ?>: <span><?php echo wp_kses_post($room_lift); ?></span></li>
                                    <li><?php echo esc_html__('TV', 'bestel') ?>: <span><?php echo wp_kses_post($room_tv); ?></span></li>
                                    <li><?php echo esc_html__('View', 'bestel') ?>: <span><?php echo wp_kses_post($room_view); ?></span></li>
                                </ul>
                            </div>
                            <div class="col-md-8 mt-4 mt-md-0">
                                <div class="d-flex justify-content-between flex-wrap">
                                    <?php if($room_features != ""){
                                        echo wp_kses_post($room_features);
                                    }else{
                                    ?>

                                    <div class="icn-text-sm">
                                        <div class="icn-text-circle"><i class="icon-wifi "></i></div>
                                        <div><?php echo esc_html__('Free WiFi', 'bestel') ?> :
                                            <br><span><?php echo wp_kses_post($room_wifi); ?></span></div>
                                    </div>
                                    <div class="icn-text-sm">
                                        <div class="icn-text-circle"><i class="icon-hair-dryer"></i></div>
                                        <div><?php echo esc_html__('Hair dryer', 'bestel') ?>:
                                            <br><span><?php echo wp_kses_post($room_hair_dryer); ?></span></div>
                                    </div>
                                    <div class="icn-text-sm">
                                        <div class="icn-text-circle"><i class="icon-air-conditioner"></i></div>
                                        <div><?php echo esc_html__('Air conditioner', 'bestel') ?>:
                                            <br><span><?php echo wp_kses_post($room_air_conditioner); ?></span></div>
                                    </div>
                                    <div class="icn-text-sm">
                                        <div class="icn-text-circle"><i class="icon-cocktail"></i></div>
                                        <div><?php echo esc_html__('Minibar', 'bestel') ?>:
                                            <br><span><?php echo wp_kses_post($room_air_minibar); ?></span></div>
                                    </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4 mt-5 mt-lg-0">
                        <div class="row">
                            <div class="col-sm col-lg-12">
                                <div class="info-box-color">
                                    <?php echo wp_kses_post($room_widget_info); ?>
                                    <div class="text-center mt-2">
                                        <?php if ( function_exists( 'hb_settings' ) ) { ?>
                                            <?php if ( hb_settings()->get( 'display_pricing_plans' ) ) { ?>
                                                <div class="info-box-price">
                                                <?php do_action( 'hotel_booking_loop_room_price' ); ?>
                                                </div>
                                            <?php } ?>
                                        <?php } ?>

                                         <?php if (function_exists('bestel_get_option') && bestel_get_option('bestel-booking-option') ){ ?>
                                        <div class="mt-2"><a href="<?php echo esc_js('javascript:void(0)');?>" class="btn btn-primary btn-white btn-block" data-toggle="modal" data-target="#modalBooking"><?php echo esc_html__('BOOK NOW', 'bestel') ?></a></div>
                                        <?php } ?>


                                        <?php if ( hb_settings()->get( 'enable_single_book', 0 )  && !bestel_get_option('bestel-booking-option') ) { ?>
                                            <div class="mt-2">
                                        <a href="<?php echo esc_js('javascript:void(0)');?>" data-id="<?php echo esc_attr( $hb_room->ID ) ?>" data-name="<?php echo esc_attr( $hb_room->name ) ?>"
                                           class="btn btn-primary btn-white btn-block gallery" id="hb_room_load_booking_form">
                                            <?php echo esc_html__('BOOK NOW', 'bestel') ?>
                                        </a>
                                        </div>
                                        <?php }?>
                                        
                                        <p class="p-sm mt-2"><?php echo esc_html__('Best Choice - Low Price Guarantee', 'bestel') ?></p>
                                    
                                    </div>
                                 </div>
                             </div>
                            <div class="col-sm col-lg-12 mt-3 mt-sm-0 mt-lg-3">
                                <div class="info-box-grey">
                                    <?php
                                    if (is_active_sidebar('rooms_sevices')) {
                                        dynamic_sidebar('rooms_sevices');
                                    }
                                    ?>
                                </div>
                            </div>
                        </div>
                    </div>
                
<?php } else {
    echo get_the_post_thumbnail( get_the_ID() );
} ?>