| 1 |
<?php |
| 2 |
/** |
| 3 |
* The template for Search field BOOKINGS_DATE. |
| 4 |
* |
| 5 |
* This is the template that field layout for search form |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
?> |
| 13 |
|
| 14 |
<?php |
| 15 |
|
| 16 |
if(!function_exists('run_wdk_bookings')) return false; |
| 17 |
|
| 18 |
$field_key = 'field_'.wmvc_show_data('idfield',$field_data); |
| 19 |
$field_attr_id = 'wdk_field_'.wmvc_show_data('idfield', $field_data); |
| 20 |
$placeholder_to = esc_html__('End Date','wpdirectorykit'); |
| 21 |
$placeholder_from = esc_html__('Start Date','wpdirectorykit'); |
| 22 |
|
| 23 |
$field_value_from = ''; |
| 24 |
$field_value_to = ''; |
| 25 |
|
| 26 |
if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key.'_from'])) { |
| 27 |
$field_value_from = sanitize_text_field($predefinedfields_query[$field_key.'_from']); |
| 28 |
} |
| 29 |
|
| 30 |
if(isset($predefinedfields_query) && !empty($predefinedfields_query[$field_key.'_from'])) { |
| 31 |
$field_value_to = sanitize_text_field($predefinedfields_query[$field_key.'_from']); |
| 32 |
} |
| 33 |
|
| 34 |
if(isset($_GET[$field_key.'_from'])) { |
| 35 |
$field_value_from = sanitize_text_field($_GET[$field_key.'_from']); |
| 36 |
} |
| 37 |
|
| 38 |
if(isset($_GET[$field_key.'_to'])) { |
| 39 |
$field_value_to = sanitize_text_field($_GET[$field_key.'_to']); |
| 40 |
} |
| 41 |
|
| 42 |
wdk_search_fields_toggle(); |
| 43 |
|
| 44 |
wp_enqueue_script( 'daterangepicker-moment' ); |
| 45 |
wp_enqueue_script( 'daterangepicker' ); |
| 46 |
wp_enqueue_style('daterangepicker'); |
| 47 |
|
| 48 |
|
| 49 |
$date_class = 'wdk-fielddate_range' ; |
| 50 |
|
| 51 |
if(get_option('wdk_bookings_is_hours_enabled')) { |
| 52 |
$date_class = 'wdk-fielddatetime_range'; |
| 53 |
} |
| 54 |
|
| 55 |
?> |
| 56 |
|
| 57 |
<div class="wdk-field wdk-col min_max_wdk-field <?php echo esc_attr(wmvc_show_data('field_type', $field_data)); ?> <?php echo esc_attr(wmvc_show_data('class', $field_data)); ?> wdk_field_id_booking_dates"> |
| 58 |
<label class="wdk-field-label"><?php echo esc_html(wmvc_show_data('field_label', $field_data)); ?></label> |
| 59 |
<div class="wdk-field-group"> |
| 60 |
<div class="wdk-row min_max_row"> |
| 61 |
<div class="wdk-col wdk-col-6" style="width: 50%;"> |
| 62 |
<input class="wdk-control <?php echo esc_attr($date_class );?> date_from center" <?php if(get_option('wdk_bookings_calendar_single')):?> data-wdksingle = 'true' <?php endif; ?> name="<?php echo esc_attr($field_key); ?>_from" type="text" id="<?php echo esc_attr($field_attr_id.'_from'); ?>" value="<?php echo esc_attr($field_value_from); ?>" placeholder="<?php echo esc_attr($placeholder_from);?>"> |
| 63 |
</div> |
| 64 |
<div class="wdk-col wdk-col-6" style="width: 50%;"> |
| 65 |
<input class="wdk-control <?php echo esc_attr($date_class );?> date_to center" <?php if(get_option('wdk_bookings_calendar_single')):?> data-wdksingle = 'true' <?php endif; ?> name="<?php echo esc_attr($field_key); ?>_to" type="text" id="<?php echo esc_attr($field_attr_id.'_to'); ?>" value="<?php echo esc_attr($field_value_to); ?>" placeholder="<?php echo esc_attr($placeholder_to);?>"> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
</div> |
| 69 |
</div> |