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

defined( 'ABSPATH' ) || exit();

global $hb_settings,$hb_room,$post;
$single_purchase = get_option( 'tp_hotel_booking_single_purchase' );

$post_id = get_the_ID();
$room_size = get_post_meta($post_id, 'framework-room-size', true);
$room_price = get_post_meta($post_id, 'framework-room-price', true);
$room_sleeps = get_post_meta($post_id, 'framework-room-sleeps', true);
$room_bed_size = get_post_meta($post_id, 'framework-room-bed', true);
$room_bathroom = get_post_meta($post_id, 'framework-room-bathroom', true);
$room_know_more = get_post_meta($post_id, 'framework-room-know-more', true);
$max_rooms = get_post_meta( $post_id, '_hb_num_of_rooms', true );
$prices = get_post_meta( $post_id, '_hbpricing[prices]', true );

?>

<div class="">
  <div class="room-card">
    <div class="room-card-photo"> <?php echo get_the_post_thumbnail($post_id, 'bestel-rooms-thumb', array('class' => 'img-fluid')); ?>
      <div class="flex-wrap-center"> 
      	<a href="<?php the_permalink(); ?>" class="btn btn-primary room-qview"><?php echo esc_html__('BOOK NOW', 'bestel') ?></a> 	  
      </div>
    </div>
    <div class="room-card-info">
      <div class="row">
        <div class="col">
          <h3 class="room-type"><a href="<?php the_permalink(); ?>">
            <?php the_title(); ?>
            </a></h3>
        </div>
        <div class="col-auto ml-auto">
          <div class="room-card-attr"> <span data-toggle="popover" data-trigger="hover" data-placement="top" data-content="<?php echo esc_attr( $room_sleeps); ?>"><i class="icon-two-man"></i></span> <span data-toggle="popover" data-trigger="hover" data-placement="top" data-content="<?php echo esc_attr($room_bed_size); ?>"><i class="icon-double-size-bed"></i></span> <span data-toggle="popover" data-trigger="hover" data-placement="top" data-content="<?php echo esc_attr($room_bathroom); ?>"><i class="icon-bathtub"></i></span> </div>
        </div>
      </div>
      <div class="room-size mt-0"><?php echo esc_html__('Room size:', 'bestel') ?> <?php echo esc_html($room_size); ?> <?php echo esc_html__('m', 'bestel'); ?><sup><?php echo esc_html__('2', 'bestel'); ?></sup></div>
      <div class="row">
        <div class="col">
          <div class="room-price"><span>
            <?php 
										
			 if(class_exists('WP_Hotel_Booking')){
				do_action( 'hotel_booking_loop_room_price' ); 
			 }?>
          </div>
        </div>
        <div class="col-auto ml-auto"> <a href="<?php the_permalink(); ?>" class="room-information" data-toggle="popover" data-trigger="hover" data-placement="bottom"><i class="icon-information"></i><?php echo esc_html__('Know more', 'bestel') ?></a>
          <div class="popover-content d-none">
            <?php
			echo wp_kses($room_know_more, array(
					'ul' => array(''),
					'li' => array(''),
					'a' =>  array('href'),
				) );
			?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
