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

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

 global $bestel_opt;

if ( ! class_exists( 'WP_Hotel_Booking' ) ) {
	return false;
}
$check_in_date  = hb_get_request( 'check_in_date' );
$check_out_date = hb_get_request( 'check_out_date' );
$adults         = hb_get_request( 'adults', 0 );
$max_child      = hb_get_request( 'max_child', 0 );
$uniqid         = uniqid();

?>
<div class="booking-form-wrap">
<form name="hb-search-form" action="<?php echo hb_get_url(); ?>"
		  class="hb-search-form-<?php echo esc_attr( $uniqid ); ?>">
<div id="hotel-booking-search-<?php echo uniqid(); ?>" class="booking-form js-booking-form <?php echo ( is_front_page() ) ? '' : 'js-booking-form-page'; ?>">
<a href="<?php echo esc_js( 'javascript:void(0)' ); ?>" class="booking-form-close js-booking-form-close"><i class="icon-close"></i></a>
	
<div class="container">
<div class="row">


<div class="col-auto d-none d-md-block">
		<div class="input-date">
			<input type="text" name="check_in_date" id="check_in_date_<?php echo esc_attr( $uniqid ); ?>"
								   class="form-control hb_input_date_check" value="<?php echo esc_attr( $check_in_date ); ?>"
								   placeholder="<?php esc_html_e( 'Check In', 'bestel' ); ?>"/>
		 </div>
	</div>
	<div class="col-auto d-none d-md-block">
		<div class="input-date">
		<input type="text" name="check_out_date" id="check_out_date_<?php echo esc_attr( $uniqid ); ?>"
								   class="form-control hb_input_date_check" value="<?php echo esc_attr( $check_out_date ); ?>"
								   placeholder="<?php esc_html_e( 'Check Out', 'bestel' ); ?>"/>
								   
		 </div>
	</div>
	
	<div class="col-sm-6 d-block d-md-none">
		<div class="input-date">
			<input type="text" name="check_in_date" id="check_in_date_<?php echo esc_attr( $uniqid ); ?>"
								   class="form-control hb_input_date_check" value="<?php echo esc_attr( $check_in_date ); ?>"
								   placeholder="<?php esc_html_e( 'Check In', 'bestel' ); ?>"/>
		 </div>
	</div>
	<div class="col-sm-6 d-block d-md-none">
		<div class="input-date">
		<input type="text" name="check_out_date" id="check_out_date_<?php echo esc_attr( $uniqid ); ?>"
								   class="form-control hb_input_date_check" value="<?php echo esc_attr( $check_out_date ); ?>"
								   placeholder="<?php esc_html_e( 'Check Out', 'bestel' ); ?>"/>
								   
		 </div>
	</div>
	

	
<div class="col-md-auto d-none d-md-block">
				   <div class="popover-markup popover-1">
								<div class="trigger form-group">
<?php
					hb_dropdown_numbers(
						array(
							'name'              => 'adults_capacity',
							'class'             => 'form-control',
							'min'               => 1,
							'max'               => hb_get_max_capacity_of_rooms(),
							'show_option_none'  => esc_html__( 'Adults', 'bestel' ),
							'selected'          => $adults,
							'option_none_value' => 0,
							'options'           => hb_get_capacity_of_rooms(),
						)
					);
					?>
								</div>
				</div>
</div>
<div class="col-md-auto d-none d-md-block">
				   <div class="popover-markup popover-1">
								<div class="trigger form-group">
<?php
					hb_dropdown_numbers(
						array(
							'name'              => 'max_child',
							'class'             => 'form-control',
							'min'               => 1,
							'max'               => hb_get_max_child_of_rooms(),
							'show_option_none'  => esc_html__( 'Children', 'bestel' ),
							'option_none_value' => 0,
							'selected'          => $max_child,
						)
					);
					?>
								</div>
				</div>
</div>
<div class="col-sm-6 d-block d-md-none mt-1 mt-md-0">
				   <div class="popover-markup popover-1">
								<div class="trigger form-group">
<?php
					hb_dropdown_numbers(
						array(
							'name'              => 'adults_capacity',
							'class'             => 'form-control',
							'min'               => 1,
							'max'               => hb_get_max_capacity_of_rooms(),
							'show_option_none'  => esc_html__( 'Adults', 'bestel' ),
							'selected'          => $adults,
							'option_none_value' => 0,
							'options'           => hb_get_capacity_of_rooms(),
						)
					);
					?>
								</div>
				</div>
</div>
<div class="col-sm-6 d-block d-md-none mt-1 mt-md-0">
				   <div class="popover-markup popover-1">
								<div class="trigger form-group">
<?php
					hb_dropdown_numbers(
						array(
							'name'              => 'max_child',
							'class'             => 'form-control',
							'min'               => 1,
							'max'               => hb_get_max_child_of_rooms(),
							'show_option_none'  => esc_html__( 'Children', 'bestel' ),
							'option_none_value' => 0,
							'selected'          => $max_child,
						)
					);
					?>
								</div>
				</div>
</div>
	
		
		<?php wp_nonce_field( 'hb_search_nonce_action', 'nonce' ); ?>
		<input type="hidden" name="hotel-booking" value="results"/>
		<input type="hidden" name="widget-search"
			   value="<?php echo isset( $atts['widget_search'] ) ? $atts['widget_search'] : false; ?>"/>
		<input type="hidden" name="action" value="hotel_booking_parse_search_params"/>
<div class="col-sm-12 col-md-12 col-lg-auto text-center mt-1 mt-lg-0 col-btn">
	<button type="submit" class="btn btn-primary"><?php esc_html_e( 'CHECK ROOMS', 'bestel' ); ?></button>
</div>
   
	</div>
	<div class="booking-form-note d-none d-md-block"><?php esc_html_e( '* Best Price Guarantee', 'bestel' ); ?> </div>
	</div>
  <div class="booking-form-open js-booking-form-open"><span data-toggle="tooltip" data-placement="left" title="Open panel" data-original-title="Open panel">+</span></div>
	 
</div>
<div class="booking-form-toggle d-md-none"><a href="tel:<?php echo wp_kses_post( $bestel_opt['bestel-page-header-phone'] ); ?>"><i class="icon-telephone"></i></a><div class="js-booking-form-toggle"><span><?php esc_html_e( 'BOOK NOW', 'bestel' ); ?></span><span class="close-text js-close-text"><?php esc_html_e( 'CLOSE', 'bestel' ); ?></span></div></div>
</form>
</div>
