PluginProbe
Booking Calendar / 10.1.3
Booking Calendar v10.1.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
booking / core / lib / wpdev-booking-class.php

wpdev-booking-class.php in Booking Calendar 10.1.3, at core/lib/wpdev-booking-class.php

1,046 lines 48.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4 class wpdev_booking {
5
6 public $popover_front_end_js_is_writed; //FixIn: Flex TimeLine 1.0 -- previos this was private and not public property
7
8 // <editor-fold defaultstate="collapsed" desc=" C O N S T R U C T O R & P r o p e r t i e s ">
9
10 var $wpdev_bk_personal;
11
12 function __construct() {
13
14 // In AJAX request it DO NOT RUNNING. Important note
15
16 $this->popover_front_end_js_is_writed = false;
17
18 if ( class_exists( 'wpdev_bk_personal' ) ) {
19 $this->wpdev_bk_personal = new wpdev_bk_personal();
20 } else {
21 $this->wpdev_bk_personal = false;
22 }
23
24
25 // User defined - hooks
26 add_action( 'wpdev_bk_add_calendar', array( &$this, 'add_calendar_action' ), 10, 2 );
27 add_action( 'wpdev_bk_add_form', array( &$this, 'add_booking_form_action' ), 10, 2 );
28 add_bk_action( 'wpdevbk_add_form', array( &$this, 'add_booking_form_action' ) );
29 add_filter( 'wpdev_bk_get_form', array( &$this, 'get_booking_form_action' ), 10, 2 );
30 add_bk_filter( 'wpdevbk_get_booking_form', array( &$this, 'get_booking_form_action' ) );
31 add_filter( 'wpdev_bk_get_showing_date_format', array( &$this, 'get_showing_date_format' ), 10, 1 );
32
33 // Get script for calendar activation
34 add_bk_filter( 'pre_get_calendar_html', array( &$this, 'pre_get_calendar_html' ) );
35
36 add_action( 'init', array( $this, 'wpbc_shortcodes_init' ), 9999 ); // <- priority to load it last
37 }
38 // </editor-fold>
39
40
41 /**
42 * S H O R T C O D E s Init
43 *
44 * @return void
45 */
46 function wpbc_shortcodes_init(){
47
48 add_shortcode( 'booking', array( &$this, 'booking_shortcode' ) );
49 add_shortcode( 'bookingcalendar', array( &$this, 'booking_calendar_only_shortcode' ) );
50 add_shortcode( 'bookingform', array( &$this, 'bookingform_shortcode' ) );
51 add_shortcode( 'bookingedit', array( &$this, 'bookingedit_shortcode' ) );
52 add_shortcode( 'bookingsearch', array( &$this, 'bookingsearch_shortcode' ) );
53 add_shortcode( 'bookingsearchresults', array( &$this, 'bookingsearchresults_shortcode' ) );
54 add_shortcode( 'bookingselect', array( &$this, 'bookingselect_shortcode' ) );
55 add_shortcode( 'bookingresource', array( &$this, 'bookingresource_shortcode' ) );
56 add_shortcode( 'bookingtimeline', array( &$this, 'bookingtimeline_shortcode' ) );
57 add_shortcode( 'bookingcustomerlisting', array( &$this, 'bookingcustomerlisting_shortcode' ) ); //FixIn: 8.1.3.5
58 add_shortcode( 'booking_test_speed', array( &$this, 'booking_test_speed_shortcode' ) ); //FixIn: 8.7.11.13
59 }
60
61
62 // <editor-fold defaultstate="collapsed" desc=" S U P P O R T F U N C T I O N S ">
63
64 function silent_deactivate_WPBC() {
65 deactivate_plugins( WPBC_PLUGIN_DIRNAME . '/' . WPBC_PLUGIN_FILENAME, true );
66 }
67
68
69 // Change date format
70 function get_showing_date_format( $mydate ) {
71 $date_format = get_bk_option( 'booking_date_format' );
72 if ( $date_format == '' ) {
73 $date_format = "d.m.Y";
74 }
75
76 $time_format = get_bk_option( 'booking_time_format' );
77 if ( $time_format !== false ) {
78 $time_format = ' ' . $time_format;
79 $my_time = date( 'H:i:s', $mydate );
80 if ( $my_time == '00:00:00' ) {
81 $time_format = '';
82 }
83 } else {
84 $time_format = '';
85 }
86
87 // return date($date_format . $time_format , $mydate);
88 return date_i18n( $date_format, $mydate ) . '<sup class="booking-table-time">' . date_i18n( $time_format, $mydate ) . '</sup>';
89 }
90
91 // </editor-fold>
92
93
94 // <editor-fold defaultstate="collapsed" desc=" B O O K I N G s A D M I N F U N C T I O N s ">
95
96 /**
97 * Generate booking CAPTCHA fields for booking form
98 *
99 * @param $bk_tp resource ID
100 *
101 * @return string|true
102 */
103 function createCapthaContent($bk_tp) {
104
105 $admin_uri = ltrim( str_replace( get_site_url( null, '', 'admin' ), '', admin_url( 'admin.php?' ) ), '/' );
106 if ( ( get_bk_option( 'booking_is_use_captcha' ) !== 'On' )
107 || (
108 ( strpos( $_SERVER['REQUEST_URI'], $admin_uri ) !== false )
109 && ( ! wpbc_is_settings_form_page() )
110 )
111 ) {
112 return '';
113 } else {
114
115 $html = wpbc_captcha__simple__generate_html_content( $bk_tp );
116
117 return $html;
118 }
119 }
120
121 // Get default Booking resource
122 function get_default_type() {
123
124 if ( $this->wpdev_bk_personal !== false ) {
125 if ( ( isset( $_GET['booking_type'] ) ) && ( $_GET['booking_type'] != '' ) ) {
126 $bk_type = $_GET['booking_type'];
127 } else {
128 $bk_type = $this->wpdev_bk_personal->get_default_booking_resource_id();
129 }
130 } else {
131 $bk_type = 1;
132 }
133
134 return $bk_type;
135 }
136
137 // </editor-fold>
138
139
140 // <editor-fold defaultstate="collapsed" desc=" C L I E N T S I D E & H O O K S ">
141
142
143 // Get HTML for the initilizing inline calendars
144 function pre_get_calendar_html( $resource_id=1, $cal_count=1, $bk_otions=array() ){
145 //SHORTCODE:
146 /*
147 * [booking type=56 form_type='standard' nummonths=4
148 * options='{calendar months_num_in_row=2 width=682px cell_height=48px}']
149 */
150
151 $bk_otions = wpbc_parse_calendar_options($bk_otions);
152 /* options:
153 [months_num_in_row] => 2
154 [width] => 341px define: width: 100%; max-width:341px;
155 [strong_width] => 341px define: width:341px;
156 [cell_height] => 48px
157 */
158 $width = $months_num_in_row = $cell_height = '';
159
160 if (!empty($bk_otions)){
161
162 if ( isset( $bk_otions['months_num_in_row'] ) ) {
163 $months_num_in_row = $bk_otions['months_num_in_row'];
164 }
165
166 if ( isset( $bk_otions['width'] ) ) {
167 $width = 'width:100%;max-width:' . $bk_otions['width'] . ';'; //FixIn: 9.3.1.5
168 }
169 if ( isset( $bk_otions['strong_width'] ) ) {
170 $width .= 'width:' . $bk_otions['strong_width'] . ';'; //FixIn: 9.3.1.6
171 }
172
173 if ( isset( $bk_otions['cell_height'] ) ) {
174 $cell_height = $bk_otions['cell_height'];
175 }
176 if ( isset( $bk_otions['strong_cell_height'] ) ) { //FixIn: 9.7.3.3
177 $cell_height = $bk_otions['strong_cell_height'] . '!important;';
178 }
179 }
180 /* FixIn: 9.7.3.4 */
181
182 if (!empty($cell_height))
183 $style= '<style type="text/css" rel="stylesheet" >'.
184 '.hasDatepick .datepick-inline .datepick-title-row th,'.
185 '.hasDatepick .datepick-inline .datepick-days-cell{'.
186 ' height: '.$cell_height.'; '.
187 '}'.
188 '</style>';
189 else $style= '';
190
191 //FixIn: 8.2.1.27
192 $booking_timeslot_day_bg_as_available = get_bk_option( 'booking_timeslot_day_bg_as_available' );
193
194 $booking_timeslot_day_bg_as_available = ( $booking_timeslot_day_bg_as_available === 'On' ) ? ' wpbc_timeslot_day_bg_as_available' : '';
195
196 //FixIn: 9.8.1
197 $is_custom_width_css = ( empty( $width ) ) ? ' wpbc_no_custom_width ' : '';
198
199 $calendar = $style.
200 '<div class="bk_calendar_frame' . $is_custom_width_css . ' months_num_in_row_' . $months_num_in_row . ' cal_month_num_' . $cal_count . $booking_timeslot_day_bg_as_available . '" style="' . $width . '">' .
201 '<div id="calendar_booking' . $resource_id . '">' .
202 __('Calendar is loading...' ,'booking').
203 '</div>'.
204 '</div>'.
205 '';
206
207 $booking_is_show_powered_by_notice = get_bk_option( 'booking_is_show_powered_by_notice' );
208 if ( ( ! class_exists( 'wpdev_bk_personal' ) ) && ( $booking_is_show_powered_by_notice == 'On' ) ) {
209 $calendar .= '<div style="font-size:7px;text-align:left;margin:0 0 10px;text-shadow: none;">Powered by <a href="https://wpbookingcalendar.com" target="_blank" title="Booking Calendar plugin for WordPress">Booking Calendar</a></div>';
210 }
211
212 $calendar .= '<textarea id="date_booking' . $resource_id . '" name="date_booking' . $resource_id . '" autocomplete="off" style="display:none;"></textarea>'; // Calendar code
213
214 $calendar .= wpbc_get_calendar_legend(); //FixIn: 9.4.3.6
215
216 $calendar_css_class_outer = 'wpbc_calendar_wraper';
217
218 //FixIn: 7.0.1.24
219 $is_booking_change_over_days_triangles = get_bk_option( 'booking_change_over_days_triangles' );
220 if ( $is_booking_change_over_days_triangles !== 'Off' ) {
221 $calendar_css_class_outer .= ' wpbc_change_over_triangle';
222 }
223
224 $calendar = '<div class="' . esc_attr( $calendar_css_class_outer ) . '">' . $calendar . '</div>';
225
226 return $calendar;
227 }
228
229
230 // Get form
231 function get_booking_form( $my_boook_type ) {
232
233 $my_form = apply_bk_filter( 'wpbc_get_free_booking_form' , $my_boook_type );
234
235 return $my_form;
236 }
237
238 // Get booking form
239 function get_booking_form_action( $resource_id = 1, $my_boook_count = 1, $my_booking_form = 'standard', $my_selected_dates_without_calendar = '', $start_month_calendar = false, $bk_otions = array() ) {
240
241 $res = $this->add_booking_form_action($resource_id,$my_boook_count, 0, $my_booking_form , $my_selected_dates_without_calendar, $start_month_calendar, $bk_otions );
242 return $res;
243 }
244
245 //Show booking form from action call - wpdev_bk_add_form
246 function add_booking_form_action( $resource_id = 1, $cal_count = 1, $is_echo = 1, $my_booking_form = 'standard', $my_selected_dates_without_calendar = '', $start_month_calendar = false, $bk_otions = array() ) {
247
248 $additional_bk_types = array();
249 if ( strpos($resource_id,';') !== false ) {
250 $additional_bk_types = explode(';',$resource_id);
251 $resource_id = $additional_bk_types[0];
252 }
253
254 //--------------------------------------------------------------------------------------------------------------
255 // Check if booking resource exist
256 if ( $resource_id == '') {
257 $my_result = __('Booking resource type is not defined. This can be, when at the URL is wrong booking hash.' ,'booking');
258 if ( $is_echo ) echo $my_result;
259 else return $my_result;
260 return;
261 }
262
263 $is_booking_resource_exist = apply_bk_filter('wpdev_is_booking_resource_exist',true, $resource_id, $is_echo );
264 if (! $is_booking_resource_exist) {
265 if ( $is_echo ) echo 'Booking resource does not exist.' . ' [ID=' . $resource_id . ']';
266 return 'Booking resource does not exist.' . ' [ID=' . $resource_id . ']';
267 }
268
269 //--------------------------------------------------------------------------------------------------------------
270 // Define $this->client_side_active_params_of_user to specific User,
271 // depends from belonging booking resource to specific User
272 make_bk_action('check_multiuser_params_for_client_side', $resource_id );
273
274 //--------------------------------------------------------------------------------------------------------------
275 // Get Booking ID and booking resource ID, if we EDIT booking
276 if ( isset( $_GET['booking_hash'] ) ) {
277
278 $my_booking_id_type = wpbc_hash__get_booking_id__resource_id( $_GET['booking_hash'] );
279
280 $is_error = false; //FixIn: 9.1.3.2
281 if ( $my_booking_id_type !== false ) {
282
283 list( $my_edited_bk_id, $my_boook_type ) = $my_booking_id_type;
284
285 if ( $my_boook_type == '' ) {
286 $is_error ='<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
287 }
288 } else {
289 $is_error = '<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
290 }
291
292 if ( false !== $is_error ) {
293 if ( $is_echo ) {
294 echo $is_error;
295 }
296 return $is_error;
297 }
298
299 // Check situation when we have editing "child booking resource", so need to reupdate calendar and form to have it for parent resource.
300 if ( //FixIn: 6.1.1.9 //Fix:2016-10-12
301 ( ! isset( $_GET['booking_pay'] ) )
302 && ( ! isset( $_GET['resource_no_update'] ) ) //FixIn: 9.4.2.3
303 && ( function_exists( 'wpbc_is_this_child_resource' ) )
304 && ( wpbc_is_this_child_resource( $my_boook_type ) )
305 ){
306 $bk_parent_br_id = wpbc_get_parent_resource( $my_boook_type );
307 $resource_id = $bk_parent_br_id;
308 }
309 }
310
311 //--------------------------------------------------------------------------------------------------------------
312 // Get JS vars for Booked dates | Rates | Availability & define function for showing calendar
313
314 $start_script_code = wpbc__calendar__load( array(
315 'resource_id' => $resource_id,
316 'aggregate_resource_id_arr' => $additional_bk_types,
317 'selected_dates_without_calendar' => $my_selected_dates_without_calendar,
318 'calendar_number_of_months' => $cal_count,
319 'start_month_calendar' => $start_month_calendar,
320 'shortcode_options' => $bk_otions,
321 'custom_form' => ( isset( $_GET['booking_form'] ) ) ? wpbc_clean_text_value( $_GET['booking_form'] ) : $my_booking_form //FixIn: 10.0.0.10
322 ));
323
324
325 if ( $my_selected_dates_without_calendar !== '' ) { //FixIn: 9.3.1.1
326 // Disable booked time slots, for predefined selected date in the booking form (it's shortcode for booking form, without the calendar)
327 $start_script_code .= '<script type="text/javascript"> ' . wpbc_jq_ready_start(); //FixIn: 10.1.3.7
328 $start_script_code .= " bkDisableBookedTimeSlots( jQuery( '#date_booking{$resource_id}' ).val(), {$resource_id} ); ";
329 $start_script_code .= wpbc_jq_ready_end() . '</script>'; //FixIn: 10.1.3.7
330 }
331
332
333 //--------------------------------------------------------------------------------------------------------------
334 // Get booking form content
335 $my_result = ' ' . $this->get__client_side_booking_content($resource_id, $my_booking_form, $my_selected_dates_without_calendar, $cal_count, $bk_otions ) . ' ' . $start_script_code ;
336
337
338 $my_result = apply_filters('wpdev_booking_form', $my_result , $resource_id); // Add DIV structure, where to show payment form
339
340
341 make_bk_action('finish_check_multiuser_params_for_client_side', $resource_id );
342
343 if ( $is_echo ) echo $my_result;
344 else return $my_result;
345 }
346
347
348 /**
349 * For [bookingcalendar ... ] shortcode Only!
350 *
351 * @param $resource_id
352 * @param $cal_count
353 * @param $is_echo
354 * @param $start_month_calendar
355 * @param $bk_otions
356 *
357 * @return string|void
358 */
359 function add_calendar_action( $resource_id = 1, $cal_count = 1, $is_echo = 1, $start_month_calendar = false, $bk_otions = array() ) {
360
361 $additional_bk_types = array();
362 if ( strpos($resource_id,';') !== false ) {
363 $additional_bk_types = explode(';',$resource_id);
364 $resource_id = $additional_bk_types[0];
365 }
366
367 make_bk_action('check_multiuser_params_for_client_side', $resource_id );
368
369 if (isset($_GET['booking_hash'])) {
370 $my_booking_id_type = wpbc_hash__get_booking_id__resource_id( $_GET['booking_hash'] );
371 if ($my_booking_id_type != false)
372 if ($my_booking_id_type[1]=='') {
373 $my_result = '<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
374 if ( $is_echo ) echo $my_result;
375 else return $my_result;
376 return;
377 }
378 }
379
380
381 $start_script_code = wpbc__calendar__load( array(
382 'resource_id' => $resource_id,
383 'aggregate_resource_id_arr' => $additional_bk_types,
384 'selected_dates_without_calendar' => '',
385 'calendar_number_of_months' => $cal_count,
386 'start_month_calendar' => $start_month_calendar,
387 'custom_form' => 'standard' // Because we show only 'AVAILABILITY CALENDAR' without the form, at all.
388 ));
389
390 $my_result = '<div style="clear:both;height:10px;"></div>' . $this->pre_get_calendar_html( $resource_id, $cal_count, $bk_otions );
391
392 $my_result .= ' ' . $start_script_code ;
393
394 $my_result = apply_filters('wpdev_booking_calendar', $my_result , $resource_id);
395
396
397 $booking_form_is_using_bs_css = get_bk_option( 'booking_form_is_using_bs_css' );
398 $my_result = '<span ' . (($booking_form_is_using_bs_css == 'On') ? 'class="wpdevelop"' : '') . '>' . $my_result . '</span>';
399
400 make_bk_action('finish_check_multiuser_params_for_client_side', $resource_id );
401
402 if ( $is_echo ) echo $my_result;
403 else return $my_result;
404 }
405
406 // Get content at client side of C A L E N D A R
407 function get__client_side_booking_content( $resource_id = 1, $my_booking_form = 'standard', $my_selected_dates_without_calendar = '', $cal_count = 1, $bk_otions = array() ) {
408
409 $nl = '<div style="clear:both;height:10px;"></div>'; // New line
410 if ($my_selected_dates_without_calendar=='') {
411 // Get HTML with [calendar] shortcode and Styles for calendar. Get legend html.
412 $calendar = $this->pre_get_calendar_html( $resource_id, $cal_count, $bk_otions );
413 } else {
414 $calendar = '<textarea rows="3" cols="50" id="date_booking' . $resource_id . '" name="date_booking' . $resource_id . '" autocomplete="off" style="display:none;">' . $my_selected_dates_without_calendar . '</textarea>'; // Calendar code
415 }
416
417 //FixIn: 8.2.1.1
418 $form = '<a name="bklnk' . $resource_id . '" id="bklnk' . $resource_id . '"></a><div id="booking_form_div' . $resource_id . '" class="booking_form_div">';
419 //FixIn:6.0.1.5
420 $custom_params = array();
421 if (! empty($bk_otions)) {
422 $param ='\s*([name|value]+)=[\'"]{1}([^\'"]+)[\'"]{1}\s*'; // Find all possible options
423 $pattern_to_search='%\s*{([^\s]+)' . $param . $param .'}\s*[,]?\s*%';
424 preg_match_all($pattern_to_search, $bk_otions, $matches, PREG_SET_ORDER);
425 //debuge($matches);
426 foreach ( $matches as $matche_value ) {
427 if ( $matche_value[1] == 'parameter' ) {
428 $custom_params[ $matche_value[3] ]= $matche_value[5];
429 }
430 }
431 }
432 //FixIn:6.0.1.5
433
434 if ( $this->wpdev_bk_personal !== false ) {
435 $form .= $this->wpdev_bk_personal->get_booking_form( $resource_id, $my_booking_form, $custom_params );
436 } else {
437 $form .= $this->get_booking_form( $resource_id );
438 }
439
440
441 // Insert calendar into form
442 if ( strpos($form, '[calendar]') !== false ) $form = str_replace('[calendar]', $calendar ,$form);
443 else $form = '<div class="booking_form_div">' . $calendar . '</div>' . $nl . $form ;
444
445 // Replace additional calendars like [calendar id=9] to HTML and JS code
446 $form = apply_bk_filter( 'wpdev_check_for_additional_calendars_in_form'
447 , $form
448 , $resource_id
449 , array(
450 'booking_form' => $my_booking_form ,
451 'selected_dates' => $my_selected_dates_without_calendar ,
452 'cal_count' => $cal_count ,
453 'otions' => $bk_otions
454 )
455 );
456
457 if ( strpos($form, '[captcha]') !== false ) {
458 $captcha = $this->createCapthaContent($resource_id);
459 $form =str_replace('[captcha]', $captcha ,$form);
460 }
461
462 // Set additional "Check in/out" times, if activated to use change-over days!
463 $form = apply_filters( 'wpbc_booking_form_html__update__append_change_over_times', $form, $resource_id );
464
465
466
467 // Add booking type field
468 $form .= '<input id="bk_type' . $resource_id . '" name="bk_type' . $resource_id . '" class="" type="hidden" value="' . $resource_id . '" /></div>';
469 $submitting = '<div id="submiting' . $resource_id . '"></div><div class="form_bk_messages" id="form_bk_messages' . $resource_id . '" ></div>';
470
471 //Params: $action = -1, $name = "_wpnonce", $referer = true , $echo = true
472
473 $wpbc_nonce = wp_nonce_field('CALCULATE_THE_COST', ( "wpbc_nonceCALCULATE_THE_COST" . $resource_id) , true , false );
474
475
476 $res = $form . $submitting . $wpbc_nonce;
477
478 $my_random_id = time() * rand(0,1000);
479 $my_random_id = 'form_id'. $my_random_id;
480
481 $booking_form_is_using_bs_css = get_bk_option( 'booking_form_is_using_bs_css');
482 $booking_form_format_type = get_bk_option( 'booking_form_format_type');
483 $booking_form_theme = get_bk_option( 'booking_form_theme');
484
485 $return_form = '<div id="' . $my_random_id . '" '
486 . ' class="wpbc_container wpbc_container_booking_form '
487 . ( ( wpbc_is_this_demo() == 'On' ) ? 'wpbc_demo_site ' : '' )
488 . esc_attr( $booking_form_theme ) . ' '
489 . ( ( $booking_form_is_using_bs_css == 'On' ) ? 'wpdevelop ' : '' )
490 . '" >' .
491 '<form id="booking_form' . $resource_id . '" class="booking_form ' . $booking_form_format_type . '" method="post" action="">' .
492 '<div id="ajax_respond_insert' . $resource_id . '" class="ajax_respond_insert" style="display:none;"></div>' .
493 $res.
494 '</form></div>';
495
496 $return_form .= '<div id="booking_form_garbage' . $resource_id . '" class="booking_form_garbage"></div>';
497
498 if ($my_selected_dates_without_calendar == '' ) {
499 // Check according already shown Booking Calendar and set do not visible of it
500
501 $return_form .= '<script type="text/javascript"> ' . wpbc_jq_ready_start(); //FixIn: 10.1.3.7
502 $return_form .= ' jQuery(".widget_wpdev_booking .booking_form.form-horizontal").removeClass("form-horizontal");
503 var visible_calendars_count = _wpbc.get_other_param( "calendars__on_this_page" ).length;
504 if (visible_calendars_count !== null ) {
505 for (var i=0;i< visible_calendars_count ;i++){
506 if ( _wpbc.get_other_param( "calendars__on_this_page" )[i] === ' . $resource_id . ' ) {
507 document.getElementById("'.$my_random_id.'").innerHTML = "<span style=\'color:#A00;font-size:10px;\'>'.
508 sprintf( esc_js( __('%sWarning! Booking calendar for this booking resource are already at the page, please check more about this issue at %sthis page%s' ,'booking') )
509 , ''
510 , ''
511 , ': https://wpbookingcalendar.com/faq/why-the-booking-calendar-widget-not-show-on-page/'
512 )
513 .'</span>";
514 jQuery("#'.$my_random_id.'").animate( {opacity: 1}, 10000 ).fadeOut(5000);
515 return;
516 }
517 }
518 _wpbc.get_other_param( "calendars__on_this_page" )[ visible_calendars_count ]=' . intval( $resource_id ) . ';
519 } ';
520 $return_form .= wpbc_jq_ready_end() . '</script>'; //FixIn: 10.1.3.7
521 } else {
522 //FixIn:6.1.1.16 //FixIn: 8.2.1.13
523 $return_form .= '<script type="text/javascript"> ' . wpbc_jq_ready_start(); //FixIn: 10.1.3.7
524 $return_form .= ' if(typeof( showCostHintInsideBkForm ) == "function") { showCostHintInsideBkForm(' . $resource_id . '); } ';
525 $return_form .= wpbc_jq_ready_end() . '</script>'; //FixIn: 10.1.3.7
526 }
527
528 $is_use_auto_fill_for_logged = get_bk_option( 'booking_is_use_autofill_4_logged_user' ) ;
529
530
531 if (! isset($_GET['booking_hash']))
532 if ($is_use_auto_fill_for_logged == 'On') {
533
534 $curr_user = wpbc_get_current_user();
535 if ( $curr_user->ID > 0 ) {
536 $user_nick_name = get_user_meta( $curr_user->ID, 'nickname' );
537 $user_nick_name = ( empty( $user_nick_name ) ) ? '' : $user_nick_name[0]; //FixIn: 8.7.1.5
538
539 $return_form .= '<script type="text/javascript"> ' . wpbc_jq_ready_start(); //FixIn: 10.1.3.7
540 $return_form .= 'var bk_af_submit_form = document.getElementById( "booking_form' . $resource_id . '" );
541 var bk_af_count = bk_af_submit_form.elements.length;
542 var bk_af_element;
543 var bk_af_reg;
544 for (var bk_af_i=0; bk_af_i<bk_af_count; bk_af_i++) {
545 bk_af_element = bk_af_submit_form.elements[bk_af_i];
546 //FixIn: 9.4.3.4
547 if ( bk_af_element.type == "text" )
548 if ( bk_af_element.name !== ("date_booking' . $resource_id . '" ) )
549 {
550 // NickName //FixIn: 8.6.1.2
551 bk_af_reg = /^([A-Za-z0-9_\-\.])*(nickname){1}([A-Za-z0-9_\-\.])*$/;
552 if(bk_af_reg.test(bk_af_element.name) != false)
553 if (bk_af_element.value == "" )
554 bk_af_element.value = "' . str_replace( "'", '', $user_nick_name ) . '";
555 // Second Name
556 bk_af_reg = /^([A-Za-z0-9_\-\.])*(last|second){1}([_\-\.])?name([A-Za-z0-9_\-\.])*$/;
557 if(bk_af_reg.test(bk_af_element.name) != false)
558 if (bk_af_element.value == "" )
559 bk_af_element.value = "'.str_replace("'",'',$curr_user->last_name).'";
560 // First Name
561 bk_af_reg = /^name([0-9_\-\.])*$/;
562 if(bk_af_reg.test(bk_af_element.name) != false)
563 if (bk_af_element.value == "" )
564 bk_af_element.value = "'.str_replace("'",'',$curr_user->first_name).'";
565 bk_af_reg = /^([A-Za-z0-9_\-\.])*(first|my){1}([_\-\.])?name([A-Za-z0-9_\-\.])*$/;
566 if(bk_af_reg.test(bk_af_element.name) != false)
567 if (bk_af_element.value == "" )
568 bk_af_element.value = "'.str_replace("'",'',$curr_user->first_name).'";
569 // Email
570 bk_af_reg = /^(e)?([_\-\.])?mail([0-9_\-\.])*$/;
571 if(bk_af_reg.test(bk_af_element.name) != false)
572 if (bk_af_element.value == "" )
573 bk_af_element.value = "'.str_replace("'",'',$curr_user->user_email).'";
574 // Phone
575 bk_af_reg = /^([A-Za-z0-9_\-\.])*(phone|fone){1}([A-Za-z0-9_\-\.])*$/;
576 if(bk_af_reg.test(bk_af_element.name) != false)
577 if (bk_af_element.value == "" )
578 bk_af_element.value = "'.str_replace("'",'',$curr_user->phone_number).'";
579 // NB Enfants
580 bk_af_reg = /^(e)?([_\-\.])?nb_enfant([0-9_\-\.])*$/;
581 if(bk_af_reg.test(bk_af_element.name) != false)
582 if (bk_af_element.value == "" )
583 bk_af_element.value = "'.str_replace("'",'',$curr_user->nb_enfant).'";
584 // URL
585 bk_af_reg = /^([A-Za-z0-9_\-\.])*(URL|site|web|WEB){1}([A-Za-z0-9_\-\.])*$/;
586 if(bk_af_reg.test(bk_af_element.name) != false)
587 if (bk_af_element.value == "" )
588 bk_af_element.value = "'.str_replace("'",'',$curr_user->user_url).'";
589 }
590 }';
591 $return_form .= wpbc_jq_ready_end() . '</script>'; //FixIn: 10.1.3.7
592 }
593 }
594
595 return $return_form ;
596 }
597 // </editor-fold>
598
599
600 // <editor-fold defaultstate="collapsed" desc=" S H O R T C O D E S ">
601
602 //FixIn: 8.7.11.13
603 function booking_test_speed_shortcode( $attr ) {
604
605 if ( wpbc_is_on_edit_page() ) {
606 return wpbc_get_preview_for_shortcode( 'booking_test_speed', $attr ); //FixIn: 9.9.0.39
607 }
608
609 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
610
611 echo '<h4>Booking Calendar Test</h4>';
612
613 $datesArray = Array(
614 '2021-09-10'
615 , '2021-09-11'
616 , '2021-09-12'
617 , '2021-09-13'
618 , '2021-09-14'
619 , '2021-09-15'
620 , '2021-09-16'
621 , '2021-09-17'
622 , '2021-09-18'
623 ) ;
624 for( $i = 0; $i < 1 ; $i++) {
625 $result = wpbc_api_is_dates_booked( $datesArray, $resource_id = 13 );
626 //debuge((int) $result );
627 }
628
629 debuge_speed('(int)');
630 echo '<hr/>';
631 echo '<hr/>';
632 }
633
634 //FixIn: 8.1.3.5
635 /** Listing customners bookings in timeline view
636 *
637 * @param $attr - The same parameters as for bookingtimeline shortcode (function)
638 *
639 * @return mixed|string|void
640 */
641 function bookingcustomerlisting_shortcode( $attr ){
642
643 if ( wpbc_is_on_edit_page() ) {
644 return wpbc_get_preview_for_shortcode( 'bookingcustomerlisting', $attr ); //FixIn: 9.9.0.39
645 }
646
647 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
648
649 //FixIn: 8.4.5.11
650 if (! is_array($attr)) {
651 $attr = array();
652 }
653 if ( ( isset( $_GET['booking_hash'] ) ) || ( isset( $attr['booking_hash'] ) ) ) {
654
655
656 if ( isset( $_GET['booking_hash'] ) ) {
657 $my_booking_id_type = wpbc_hash__get_booking_id__resource_id( $_GET['booking_hash'] );
658
659 $attr['booking_hash'] = $_GET['booking_hash'];
660 } else {
661 $my_booking_id_type = wpbc_hash__get_booking_id__resource_id( $attr['booking_hash'] );
662 }
663
664 if ( $my_booking_id_type !== false ) {
665
666 if ( ! isset( $attr['type' ] ) ) { // 8.1.3.5.2
667
668 $br_list = wpbc_get_all_booking_resources_list();
669 $br_list = array_keys( $br_list );
670 $br_list = implode(',',$br_list);
671 $attr['type' ] = $br_list; //wpbc_get_default_resource();
672 }
673 if ( ! isset( $attr['view_days_num' ] ) ) {
674 $attr['view_days_num' ] = 30;
675 }
676 if ( ! isset( $attr['scroll_start_date' ] ) ) {
677 $attr['scroll_start_date' ] = '';
678 }
679 if ( ! isset( $attr['scroll_day' ] ) ) {
680 $attr['scroll_day' ] = 0;
681 }
682 if ( ! isset( $attr['scroll_month' ] ) ) {
683 $attr['scroll_month' ] = 0;
684 }
685 if ( ! isset( $attr['header_title' ] ) ) {
686 $attr['header_title' ] = __( 'My bookings' , 'booking');
687 }
688
689 $timeline_results = $this->bookingtimeline_shortcode( $attr );
690
691 return $timeline_results ;
692
693 } else {
694 return '<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
695 }
696
697 } else {
698 return __( 'This page can only be accessed through links in emails related to your booking.', 'booking' )
699 . ' <br/><em>'
700 . sprintf( __( 'Please check more about configuration at %sthis page%s', 'booking' ), '<a href="https://wpbookingcalendar.com/faq/configure-editing-cancel-payment-bookings-for-visitors/" target="_blank">', '</a>.' )
701 . '</em>';
702 }
703 }
704
705
706 /**
707 * TimeLine shortcode
708 *
709 * @param type $attr
710 * @return type
711 *
712 * Shortcodes exmaples:
713 *
714 *
715 ** Matrix:
716 * 1 Month View Mode:
717 [bookingtimeline type="3,4,1,5,6,7,8,9,2,10,11,12,14" view_days_num=30 scroll_start_date="" scroll_month=0 header_title='All Bookings']
718 * 2 Months View Mode:
719 [bookingtimeline type="1,5,6,7,8,9,2,10,11,12,3,4,14" view_days_num=60 scroll_start_date="" scroll_month=-1 header_title='All Bookings']
720 * 1 Week View Mode:
721 [bookingtimeline type="3,4" view_days_num=7 scroll_start_date="" scroll_day=-7 header_title='All Bookings']
722 * 1 Day View Mode:
723 [bookingtimeline type="3,4" view_days_num=1 scroll_start_date="" scroll_day=0 header_title='All Bookings']
724
725 ** Single:
726 * 1 Month View Mode:
727 [bookingtimeline type="4" view_days_num=30 scroll_start_date="" scroll_day=-15 scroll_month=0 header_title='All Bookings']
728 * 3 Months View Mode:
729 [bookingtimeline type="4" view_days_num=90 scroll_start_date="" scroll_day=-30]
730 * 1 Year View Mode:
731 [bookingtimeline type="4" view_days_num=365 scroll_start_date="" scroll_month=-3]
732
733
734 */
735 function bookingtimeline_shortcode($attr) {
736
737 if ( wpbc_is_on_edit_page() ) {
738 return wpbc_get_preview_for_shortcode( 'bookingtimeline', $attr ); //FixIn: 9.9.0.39
739 }
740
741 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
742
743 //FixIn: 8.6.1.13
744 $timeline_results = bookingflextimeline_shortcode($attr);
745 return $timeline_results;
746 }
747
748 // Replace MARK at post with content at client side ----- [booking nummonths='1' type='1']
749 function booking_shortcode($attr) {
750
751 if ( wpbc_is_on_edit_page() ) {
752 return wpbc_get_preview_for_shortcode( 'booking', $attr ); //FixIn: 9.9.0.39
753 }
754
755 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
756
757 if ( isset( $_GET['booking_hash'] ) ) {
758 return
759 __( 'You need to use special shortcode [bookingedit] for booking editing.', 'booking' )
760 . ' '
761 . sprintf( __( 'Please check FAQ instruction how to configure it here %s', 'booking' )
762 , '<a href="https://wpbookingcalendar.com/faq/configure-editing-cancel-payment-bookings-for-visitors/">https://wpbookingcalendar.com/faq/configure-editing-cancel-payment-bookings-for-visitors/</a>'
763 );
764 }
765
766 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
767
768 $my_boook_count = get_bk_option( 'booking_client_cal_count' );
769 $my_boook_type = 1;
770 $my_booking_form = 'standard';
771 $start_month_calendar = false;
772 $bk_otions = array();
773
774 if ( isset( $attr['nummonths'] ) ) { $my_boook_count = $attr['nummonths']; }
775
776 if ( isset( $attr['resource_id'] ) ) { $attr['type'] = $attr['resource_id']; }
777 if ( isset( $attr['type'] ) ) { $my_boook_type = $attr['type']; }
778
779 if ( isset( $attr['form_type'] ) ) { $my_booking_form = $attr['form_type']; }
780
781 if ( isset( $attr['agregate'] ) && (! empty( $attr['agregate'] )) ) {
782 $additional_bk_types = $attr['agregate'];
783 $my_boook_type .= ';'.$additional_bk_types;
784 }
785 if ( isset( $attr['aggregate'] ) && (! empty( $attr['aggregate'] )) ) {
786 $additional_bk_types = $attr['aggregate'];
787 $my_boook_type .= ';'.$additional_bk_types;
788 }
789
790
791 if ( isset( $attr['startmonth'] ) ) { // Set start month of calendar, fomrat: '2011-1'
792
793 $start_month_calendar = explode( '-', $attr['startmonth'] );
794 if ( (is_array($start_month_calendar)) && ( count($start_month_calendar) > 1) ) { }
795 else $start_month_calendar = false;
796
797 }
798
799 if ( isset( $attr['options'] ) ) { $bk_otions = $attr['options']; }
800
801 $res = $this->add_booking_form_action( $my_boook_type, $my_boook_count, 0, $my_booking_form, '', $start_month_calendar, $bk_otions );
802
803 return $res;
804 }
805
806
807 // Replace MARK at post with content at client side ----- [booking nummonths='1' type='1']
808 function booking_calendar_only_shortcode($attr) {
809
810 if ( wpbc_is_on_edit_page() ) {
811 return wpbc_get_preview_for_shortcode( 'bookingcalendar', $attr ); //FixIn: 9.9.0.39
812 }
813
814 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
815
816 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
817
818 $my_boook_count = get_bk_option( 'booking_client_cal_count' );
819 $my_boook_type = 1;
820 $start_month_calendar = false;
821 $bk_otions = array();
822 if ( isset( $attr['nummonths'] ) ) { $my_boook_count = $attr['nummonths']; }
823 if ( isset( $attr['resource_id'] ) ) { $attr['type'] = $attr['resource_id']; }
824 if ( isset( $attr['type'] ) ) { $my_boook_type = $attr['type']; }
825 if ( isset( $attr['agregate'] ) && (! empty( $attr['agregate'] )) ) {
826 $additional_bk_types = $attr['agregate'];
827 $my_boook_type .= ';'.$additional_bk_types;
828 }
829 if ( isset( $attr['aggregate'] ) && (! empty( $attr['aggregate'] )) ) { //FixIn: 8.3.3.8
830 $additional_bk_types = $attr['aggregate'];
831 $my_boook_type .= ';'.$additional_bk_types;
832 }
833
834 if ( isset( $attr['startmonth'] ) ) { // Set start month of calendar, fomrat: '2011-1'
835 $start_month_calendar = explode( '-', $attr['startmonth'] );
836 if ( (is_array($start_month_calendar)) && ( count($start_month_calendar) > 1) ) { }
837 else $start_month_calendar = false;
838 }
839
840 if ( isset( $attr['options'] ) ) { $bk_otions = $attr['options']; }
841 $res = $this->add_calendar_action($my_boook_type,$my_boook_count, 0, $start_month_calendar, $bk_otions );
842
843
844 $start_script_code = "<div id='calendar_booking_unselectable".$my_boook_type."'></div>";
845 return "<div class='wpbc_only_calendar wpbc_container'>" . $start_script_code . $res . '</div>'; //FixIn: 8.0.1.2
846 }
847
848 // Show only booking form, with already selected dates
849 function bookingform_shortcode($attr) {
850
851 if ( wpbc_is_on_edit_page() ) {
852 return wpbc_get_preview_for_shortcode( 'bookingform', $attr ); //FixIn: 9.9.0.39
853 }
854
855 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
856
857 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
858
859 $my_boook_type = 1;
860 $my_booking_form = 'standard';
861 $my_boook_count = 1;
862 $my_selected_dates_without_calendar = '';
863
864 if ( isset( $attr['resource_id'] ) ) { $attr['type'] = $attr['resource_id']; }
865 if ( isset( $attr['type'] ) ) { $my_boook_type = $attr['type']; }
866 if ( isset( $attr['form_type'] ) ) { $my_booking_form = $attr['form_type']; }
867 if ( isset( $attr['selected_dates'] ) ) { $my_selected_dates_without_calendar = $attr['selected_dates']; } //$my_selected_dates_without_calendar = '20.08.2010, 29.08.2010';
868
869 $res = $this->add_booking_form_action($my_boook_type,$my_boook_count, 0 , $my_booking_form, $my_selected_dates_without_calendar, false );
870
871 return $res;
872 }
873
874 // Show booking form for editing
875 function bookingedit_shortcode($attr) {
876
877 if ( wpbc_is_on_edit_page() ) {
878 return wpbc_get_preview_for_shortcode( 'bookingedit', $attr ); //FixIn: 9.9.0.39
879 }
880
881 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
882
883
884 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
885
886 if ( isset( $_GET['wpbc_hash'] ) ) {
887
888 if ( function_exists( 'wpbc_parse_one_way_hash' ) ) {
889
890 $one_way_hash_response = wpbc_parse_one_way_hash( $_GET['wpbc_hash'] );
891
892 return $one_way_hash_response;
893 }
894 }
895
896 $my_boook_count = get_bk_option( 'booking_client_cal_count' );
897 $my_boook_type = 1;
898 $my_booking_form = 'standard';
899 $bk_otions = array();
900 if ( isset( $attr['nummonths'] ) ) { $my_boook_count = $attr['nummonths']; }
901 if ( isset( $attr['resource_id'] ) ) { $attr['type'] = $attr['resource_id']; }
902 if ( isset( $attr['type'] ) ) { $my_boook_type = $attr['type']; }
903 if ( isset( $attr['form_type'] ) ) { $my_booking_form = $attr['form_type']; }
904 if ( isset( $attr['agregate'] ) && (! empty( $attr['agregate'] )) ) { //FixIn:7.0.1.26
905 $additional_bk_types = $attr['agregate'];
906 $my_boook_type .= ';'.$additional_bk_types;
907 }
908 if ( isset( $attr['aggregate'] ) && (! empty( $attr['aggregate'] )) ) {
909 $additional_bk_types = $attr['aggregate'];
910 $my_boook_type .= ';'.$additional_bk_types;
911 }
912 if ( isset( $attr['options'] ) ) { $bk_otions = $attr['options']; }
913
914
915 if (isset($_GET['booking_hash'])) {
916 $my_booking_id_type = wpbc_hash__get_booking_id__resource_id( $_GET['booking_hash'] );
917 if ($my_booking_id_type !== false) {
918 $my_edited_bk_id = $my_booking_id_type[0];
919 $my_boook_type = $my_booking_id_type[1];
920 if ($my_boook_type == '') return '<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
921 } else {
922 return '<strong>' . __('Oops!' ,'booking') . '</strong> ' . __('We could not find your booking. The link you used may be incorrect or has expired. If you need assistance, please contact our support team.' ,'booking');
923 }
924
925 } else {
926 return __('This page can only be accessed through links in emails related to your booking.' ,'booking')
927 . ' <br/><em>'
928 . sprintf( __('Please check more about configuration at %sthis page%s' ,'booking')
929 , '<a href="https://wpbookingcalendar.com/faq/configure-editing-cancel-payment-bookings-for-visitors/" target="_blank">' , '</a>.')
930 . '</em>';
931 }
932
933
934 $res = $this->add_booking_form_action($my_boook_type,$my_boook_count, 0 , $my_booking_form, '', false, $bk_otions );
935
936 if (isset($_GET['booking_pay'])) {
937 // Payment form
938 if ( 'On' == get_bk_option( 'booking_super_admin_receive_regular_user_payments' ) ){ //FixIn: 9.2.3.8
939 make_bk_action('make_force_using_this_user', -999 ); // '-999' - This ID "by default" is the ID of super booking admin user
940 }
941
942
943 $res = wpbc_do_shortcode__booking_confirm( array(
944 'booking_hash' => $_GET['booking_hash']
945 ) );
946
947 if ( 'On' == get_bk_option( 'booking_super_admin_receive_regular_user_payments' ) ){ //FixIn: 9.2.3.8
948 make_bk_action( 'finish_force_using_this_user' );
949 }
950
951 }
952
953 return $res;
954 }
955
956 // Search form
957 function bookingsearch_shortcode($attr) {
958
959 if ( wpbc_is_on_edit_page() ) {
960 return wpbc_get_preview_for_shortcode( 'bookingsearch', $attr ); //FixIn: 9.9.0.39
961 }
962
963 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
964
965 $search_form = '';
966
967 if ( function_exists( 'wpbc_search_avy__show_search_form' ) ) {
968
969 ob_start();
970
971 $search_form_content = wpbc_search_avy__show_search_form( $attr );
972
973 echo $search_form_content;
974
975 $search_form = ob_get_clean();
976 }
977
978 return $search_form ;
979 }
980
981 /**
982 * Search Results Shortcode -- Show 'Search Results' at New Page
983 *
984 * @param $attr
985 *
986 * @return string
987 */
988 function bookingsearchresults_shortcode($attr) {
989
990 if ( wpbc_is_on_edit_page() ) {
991 return wpbc_get_preview_for_shortcode( 'bookingsearchresults', $attr ); //FixIn: 9.9.0.39
992 }
993
994 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
995
996 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
997
998 $search_results_to_show = '';
999 if ( function_exists( 'wpbc_search_avy__show_search_results' ) ) {
1000
1001 ob_start();
1002
1003 wpbc_search_avy__show_search_results( $attr ); //FixIn: 10.0.0.37
1004
1005 $search_results_to_show .= ob_get_clean();
1006 }
1007
1008 return $search_results_to_show;
1009 }
1010
1011
1012 // Select Booking form using the selectbox
1013 function bookingselect_shortcode($attr) {
1014
1015 if ( wpbc_is_on_edit_page() ) {
1016 return wpbc_get_preview_for_shortcode( 'bookingselect', $attr ); //FixIn: 9.9.0.39
1017 }
1018
1019 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
1020
1021 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
1022
1023 $search_form = apply_bk_filter('wpdev_get_booking_select_form','', $attr );
1024
1025 return $search_form ;
1026 }
1027
1028 // Select Booking form using the selectbox
1029 function bookingresource_shortcode($attr) {
1030
1031 if ( wpbc_is_on_edit_page() ) {
1032 return wpbc_get_preview_for_shortcode( 'bookingresource', $attr ); //FixIn: 9.9.0.39
1033 }
1034
1035 $attr = wpbc_escape_shortcode_params( $attr ); //FixIn: 9.7.3.6.1
1036
1037 //if ( function_exists( 'wpbc_br_cache' ) ) $br_cache = wpbc_br_cache(); // Init booking resources cache
1038
1039 $search_form = apply_bk_filter('wpbc_booking_resource_info','', $attr );
1040
1041 return $search_form ;
1042 }
1043
1044
1045 // </editor-fold>
1046 }