Beispiel #1
0
 function get_booking_form($my_boook_type)
 {
     $booking_form_field_active1 = get_bk_option('booking_form_field_active1');
     $booking_form_field_required1 = get_bk_option('booking_form_field_required1');
     $booking_form_field_label1 = get_bk_option('booking_form_field_label1');
     $booking_form_field_label1 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label1);
     $booking_form_field_active2 = get_bk_option('booking_form_field_active2');
     $booking_form_field_required2 = get_bk_option('booking_form_field_required2');
     $booking_form_field_label2 = get_bk_option('booking_form_field_label2');
     $booking_form_field_label2 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label2);
     $booking_form_field_active3 = get_bk_option('booking_form_field_active3');
     $booking_form_field_required3 = get_bk_option('booking_form_field_required3');
     $booking_form_field_label3 = get_bk_option('booking_form_field_label3');
     $booking_form_field_label3 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label3);
     $booking_form_field_active4 = get_bk_option('booking_form_field_active4');
     $booking_form_field_required4 = get_bk_option('booking_form_field_required4');
     $booking_form_field_label4 = get_bk_option('booking_form_field_label4');
     $booking_form_field_label4 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label4);
     $booking_form_field_active5 = get_bk_option('booking_form_field_active5');
     $booking_form_field_required5 = get_bk_option('booking_form_field_required5');
     $booking_form_field_label5 = get_bk_option('booking_form_field_label5');
     $booking_form_field_label5 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label5);
     $my_form = '[calendar]';
     //'<div style="text-align:left;">'.
     //'<p>'.__('First Name (required)', 'wpdev-booking').':<br />  <span class="wpdev-form-control-wrap name'.$my_boook_type.'"><input type="text" name="name'.$my_boook_type.'" value="" class="wpdev-validates-as-required" size="40" /></span> </p>'.
     if ($booking_form_field_active1 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="name' . $my_boook_type . '" class="control-label">' . $booking_form_field_label1 . ($booking_form_field_required1 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="name' . $my_boook_type . '" id="name' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required1 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active2 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="secondname' . $my_boook_type . '" class="control-label">' . $booking_form_field_label2 . ($booking_form_field_required2 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="secondname' . $my_boook_type . '" id="secondname' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required2 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active3 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="email' . $my_boook_type . '" class="control-label">' . $booking_form_field_label3 . ($booking_form_field_required3 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="email' . $my_boook_type . '" id="email' . $my_boook_type . '" class="input-xlarge wpdev-validates-as-email' . ($booking_form_field_required3 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active4 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="phone' . $my_boook_type . '" class="control-label">' . $booking_form_field_label4 . ($booking_form_field_required4 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="phone' . $my_boook_type . '" id="phone' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required4 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                     <p class="help-block"></p>
                   </div>
                 </div>';
     }
     if ($booking_form_field_active5 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="details" class="control-label">' . $booking_form_field_label5 . ($booking_form_field_required5 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <textarea rows="3" name="details' . $my_boook_type . '" id="details' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required5 == 'On' ? ' wpdev-validates-as-required ' : '') . '"></textarea>
                   </div>
                 </div>';
     }
     $my_form .= '  <div class="control-group">[captcha]</div>';
     $my_form .= '  <button class="btn btn-primary" type="button" onclick="mybooking_submit(this.form,' . $my_boook_type . ',\'' . getBookingLocale() . '\');" >' . __('Send', 'wpdev-booking') . '</button> ';
     //.'<p>'.__('Last Name (required)', 'wpdev-booking').':<br />  <span class="wpdev-form-control-wrap secondname'.$my_boook_type.'"><input type="text" name="secondname'.$my_boook_type.'" value="" class="wpdev-validates-as-required" size="40" /></span> </p>'.
     //'<p>'.__('Email (required)', 'wpdev-booking').':<br /> <span class="wpdev-form-control-wrap email'.$my_boook_type.'"><input type="text" name="email'.$my_boook_type.'" value="" class="wpdev-validates-as-email wpdev-validates-as-required" size="40" /></span> </p>'.
     //'<p>'.__('Phone', 'wpdev-booking').':<br />            <span class="wpdev-form-control-wrap phone'.$my_boook_type.'"><input type="text" name="phone'.$my_boook_type.'" value="" size="40" /></span> </p>'.
     //'<p>'.__('Details', 'wpdev-booking').':<br />          <span class="wpdev-form-control-wrap details'.$my_boook_type.'"><textarea name="details'.$my_boook_type.'" cols="40" rows="10"></textarea></span> </p>';
     //$my_form .=  '<p>[captcha]</p>';
     //$my_form .=  '<p><input type="button" value="'.__('Send', 'wpdev-booking').'" onclick="mybooking_submit(this.form,'.$my_boook_type.',\''.getBookingLocale().'\');" /></p>
     //        </div>';
     return $my_form;
 }
Beispiel #2
0
function get_booking_info_4_tooltip($bk_id, $bookings, $booking_types, $title_in_day = '', $title = '', $title_hint = '')
{
    $user = wp_get_current_user();
    $user_bk_id = $user->ID;
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Gathering data  about the booking to  show in the calendar !!! ////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Get it from the option settings
    $what_show_in_day_template = get_bk_option('booking_default_title_in_day_for_calendar_view_mode');
    // '<span style="font-size:07px;">[id]</span>:[name]';
    if ($title != '') {
        $title .= ' / ';
    }
    // Other Booking in the same day
    $title .= $bk_id;
    if ($title_in_day != '') {
        $title_in_day .= ',';
    }
    // Other Booking in the same day
    //$title_in_day .=  $bk_id ;
    if (function_exists('get_title_for_showing_in_day')) {
        $title_in_day .= get_title_for_showing_in_day($bk_id, $bookings, $what_show_in_day_template);
    } else {
        $title_in_day .= $bk_id . ':' . $bookings[$bk_id]->form_data['_all_fields_']['name'];
    }
    if ($title_hint != '') {
        $title_hint .= ' <hr style="margin:10px 5px;" /> ';
    }
    // Other Booking in the same day
    $title_hint .= '<div class=\'booking-listing-collumn\' >';
    if (function_exists('get_booking_title')) {
        if (isset($booking_types[$bookings[$bk_id]->booking_type])) {
            $bk_title = $booking_types[$bookings[$bk_id]->booking_type]->title;
        } else {
            $bk_title = get_booking_title($bookings[$bk_id]->booking_type);
        }
        $bk_title = '<span class=\'label label-resource label-info\'>' . $bk_title . '</span>';
    } else {
        $bk_title = '';
    }
    $title_hint .= '<span class=\'field-id\'>' . $bk_id . '</span>' . ' ' . $bk_title;
    if (class_exists('wpdev_bk_biz_s')) {
        $title_hint .= '<div style=\'float:right;\'>';
        if (function_exists('wpdev_bk_get_payment_status_simple')) {
            $pay_status = wpdev_bk_get_payment_status_simple($bookings[$bk_id]->pay_status);
            $pay_status = '<span class=\'label label-payment-status payment-label-unknown\'><span style=\'font-size:07px;\'>' . __('Payment', 'wpdev-booking') . '</span> ' . $pay_status . '</span>';
        } else {
            $pay_status = '';
        }
        $title_hint .= ' ' . $pay_status;
        $currency = apply_bk_filter('get_currency_info');
        $show_cost_value = wpdev_bk_cost_number_format($bookings[$bk_id]->cost);
        $title_hint .= ' <div class="cost-fields-group" style=\'float:right; margin:2px;\'>' . $currency . ' ' . $show_cost_value . '</div>';
        $title_hint .= '</div>';
    }
    $title_hint .= '<div>' . $bookings[$bk_id]->form_show . '</div>';
    //$bookings[$bk_id]->form_data['name'].' ' . $bookings[$bk_id]->form_data['secondname'] ;
    //$title_hint .= ' '. $bookings[$bk_id]->remark;
    //BL
    $bk_dates_short_id = array();
    if (count($bookings[$bk_id]->dates) > 0) {
        $bk_dates_short_id = isset($bookings[$bk_id]->dates_short_id) ? $bookings[$bk_id]->dates_short_id : array();
    }
    // Array ([0] => [1] => .... [4] => 6... [11] => [12] => 8 )
    $is_approved = 0;
    if (count($bookings[$bk_id]->dates) > 0) {
        $is_approved = $bookings[$bk_id]->dates[0]->approved;
    }
    $short_dates_content = wpdevbk_get_str_from_dates_short($bookings[$bk_id]->dates_short, $is_approved, $bk_dates_short_id, $booking_types);
    $short_dates_content = str_replace('"', "'", $short_dates_content);
    $title_hint .= '<div style=\'margin-top:5px;\'>' . $short_dates_content . '</div>';
    // $reload_time = 2000;
    // setTimeout(function ( ) {location.reload(true);} ,'.$reload_time.');
    /**
       $title_hint .= '<div style=\'text-align:right;\'>';
       if ( class_exists('wpdev_bk_personal') ) {
            $bk_url_add         = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/'. WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking-reservation' ;        
            $bk_hash            = (isset($bookings[$bk_id]->hash))?$bookings[$bk_id]->hash:'';         
            $bk_booking_type    = $bookings[$bk_id]->booking_type;
            $edit_booking_url = $bk_url_add . '&booking_type='.$bk_booking_type.'&booking_hash='.$bk_hash.'&parent_res=1' ; 
            $title_hint .= '<a style=\'margin:-60px 20px 0 2px;position:absolute;right:0px;\' href=\''.$edit_booking_url .'\' onclick=\'\' ><i class=\'icon-edit\'></i><!--img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/edit_type.png\' style=\'width:12px; height:13px;\'--></a>';
       }
       $title_hint .= '<a style=\'margin:-40px 20px 0 0;position:absolute;right:0px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking('. $bk_id.',1, '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );\' ><i class=\'icon-ok-circle\'></i><!--img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/accept-24x24.gif\' style=\'width:14px; height:14px;\'--></a>';   
       $title_hint .= '<a style=\'margin:-22px 20px 0 0;position:absolute;right:0px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking('. $bk_id.',0, '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );\' ><i class=\'icon-ban-circle\'></i><!--img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/remove-16x16.png\' style=\'margin:0px 5px;width:15px; height:15px;\'--></a>';
       $title_hint .= '<a href=\'javascript:;\' onclick=\'javascript:delete_booking('. $bk_id.', '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );\' ><i class=\'icon-trash\'></i><!--img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/delete_type.png\' style=\'width:13px; height:13px;\'--></a>';
       $title_hint .= '</div>';
       /**/
    $is_approved = 0;
    if (!empty($bookings[$bk_id]->dates)) {
        $is_approved = $bookings[$bk_id]->dates[0]->approved;
    }
    $title .= '<div class=\'timeline_info_bk_actionsbar_' . $bk_id . '\'  style=\'display: inline;
    line-height: 1em;
    padding: 10px;
    vertical-align: text-top;\'>';
    if (class_exists('wpdev_bk_personal')) {
        $bk_url_add = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking-reservation';
        $bk_hash = isset($bookings[$bk_id]->hash) ? $bookings[$bk_id]->hash : '';
        $bk_booking_type = $bookings[$bk_id]->booking_type;
        $edit_booking_url = $bk_url_add . '&booking_type=' . $bk_booking_type . '&booking_hash=' . $bk_hash . '&parent_res=1';
        $title .= '<a class=\'button button-secondary\' style=\'margin-right:5px;\' href=\'' . $edit_booking_url . '\' onclick=\'\' ><i class=\'icon-edit\'></i></a>';
    }
    $title .= '<a class=\'button button-secondary approve_bk_link ' . ($is_approved ? 'hidden_items' : '') . '\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking(' . $bk_id . ',1, ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-ok-circle\'></i></a>';
    $title .= '<a class=\'button button-secondary pending_bk_link ' . ($is_approved ? '' : 'hidden_items') . '\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking(' . $bk_id . ',0, ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-ban-circle\'></i></a>';
    $title .= '<a class=\'button button-secondary\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:delete_booking(' . $bk_id . ', ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-trash\'></i></a>';
    $title .= '</div>';
    //cell_bk_id_10  time_section_in_day timeslots_in_this_day1 time_hour0  time_in_days_num_30 time_booked_in_day   approved
    /**
       $title_hint .= '<div style=\'text-align:right;\'>';
       $title_hint .= '<a style=\'margin:-40px 0 0 0;position:absolute;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking('. $bk_id.',1, '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );setTimeout(function ( ) {location.reload(true);} ,'.$reload_time.');\' ><img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/accept-24x24.gif\' style=\'width:14px; height:14px;\'></a>';   
    //   $title_hint .= ' <a href="javascript:void(0)"  class="tooltip_bottom approve_bk_link  '. ( ($is_approved)?' hidden_items ':'') .' "
    //       onclick="javascript:approve_unapprove_booking('. $bk_id.',1, '. $user_bk_id. ', \''. getBookingLocale() .'\' , 1  );"
    //        ><img src="' . WPDEV_BK_PLUGIN_URL .'/img/accept-24x24.gif" style="width:14px; height:14px;"></a>';
    //
       $title_hint .= '<a style=\'margin:-22px 0 0 -6px;position:absolute;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking('. $bk_id.',0, '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );setTimeout(function ( ) {location.reload(true);} ,'.$reload_time.');\' ><img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/remove-16x16.png\' style=\'margin:0px 5px;width:15px; height:15px;\'></a>';
    //   $title_hint .= '<a href="javascript:void(0)"  class="tooltip_bottom pending_bk_link  '. ( (! $is_approved)?  ' hidden_items ':'' ) .' "
    //       onclick="javascript:approve_unapprove_booking('. $bk_id .',0, '. $user_bk_id .', \''. getBookingLocale() .'\' , 1  );"
    //        ><img src="' . WPDEV_BK_PLUGIN_URL .'/img/remove-16x16.png" style="width:15px; height:15px;"></a>';
    //    //if ( bk_are_you_sure(\''. esc_js(__('Do you really want to set booking as pending ?', 'wpdev-booking')) .'\') ) 
       
       $title_hint .= '<a href=\'javascript:;\' onclick=\'javascript:delete_booking('. $bk_id.', '. $user_bk_id .', &quot;'. getBookingLocale() .'&quot; , 1   );setTimeout(function ( ) {location.reload(true);} ,'.$reload_time.');\' ><img src=\'' . WPDEV_BK_PLUGIN_URL .'/img/delete_type.png\' style=\'width:13px; height:13px;\'></a>';
       //if ( bk_are_you_sure(\''. esc_js(__('Do you really want to delete this booking ?', 'wpdev-booking')) .'\') ) 
       $title_hint .= '</div>';
       /**/
    $title_hint .= '</div>';
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    return array($title_in_day, $title, $title_hint, $is_approved);
}
function wpbc_load_js($where_to_load = 'both')
{
    // Load the jQuery  and jQuery Migrate
    if ($where_to_load == 'client' || $where_to_load == 'both') {
        wp_enqueue_script('jquery');
        // Required for the Client Side
        global $wp_scripts;
        if (is_a($wp_scripts, 'WP_Scripts')) {
            if (isset($wp_scripts->registered['jquery'])) {
                $version = $wp_scripts->registered['jquery']->ver;
                // Load the jQuery 1.7.1 if the them load the older jQuery and version of booking Calendar is BS or higher
                if (version_compare($version, '1.7.1', '<')) {
                    wp_deregister_script('jquery');
                    wp_register_script('jquery', "http://code.jquery.com/jquery-1.7.1.min.js", false, '1.7.1');
                    // wp_register_script('jquery', ("http://code.jquery.com/jquery-latest.min.js"), false, false);
                    wp_enqueue_script('jquery');
                }
                // Load the "jquery-migrate" if the jQuery version newer then 1.9
                if (version_compare($version, '1.9', '>=')) {
                    wp_register_script('jquery-migrate', "http://code.jquery.com/jquery-migrate-1.0.0.js", false, '1.0.0');
                    wp_enqueue_script('jquery-migrate');
                }
            }
        }
    }
    if (($where_to_load == 'admin' || $where_to_load == 'both') && (is_admin() && strpos($_SERVER['REQUEST_URI'], 'wpdev-booking.phpwpdev-booking') !== false && strpos($_SERVER['REQUEST_URI'], 'wpdev-booking.phpwpdev-booking-reservation') === false)) {
        wp_enqueue_script('jquery-ui-dialog');
    }
    // Requireed for the Payment request dialog
    if ($where_to_load == 'admin') {
        wp_enqueue_script('jquery-ui-sortable');
    }
    // Define JS Variables
    wpbc_define_js_vars($where_to_load);
    // Datepick
    wp_enqueue_script('wpbc-datepick', WPDEV_BK_PLUGIN_URL . '/js/datepick/jquery.datepick' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-global-vars'), '1.0');
    // Localization
    $locale = getBookingLocale();
    // Load translation for calendar. Exmaple: $locale = 'fr_FR';
    if (!empty($locale) && substr($locale, 0, 2) !== 'en' && file_exists(WPDEV_BK_PLUGIN_DIR . '/js/datepick/jquery.datepick-' . substr($locale, 0, 2) . '.js')) {
        wp_enqueue_script('wpbc-datepick-localize', WPDEV_BK_PLUGIN_URL . '/js/datepick/jquery.datepick-' . substr($locale, 0, 2) . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-datepick'), '1.0');
    } else {
        if (!empty($locale) && !in_array($locale, array('en_US', 'en_CA', 'en_GB', 'en_AU')) && file_exists(WPDEV_BK_PLUGIN_DIR . '/js/datepick/jquery.datepick-' . strtolower(substr($locale, 3)) . '.js')) {
            wp_enqueue_script('wpbc-datepick-localize', WPDEV_BK_PLUGIN_URL . '/js/datepick/jquery.datepick-' . strtolower(substr($locale, 3)) . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-datepick'), '1.0');
        }
    }
    // Main  Script
    // Old wp_enqueue_script( 'wpbc-main', WPDEV_BK_PLUGIN_URL . '/js/wpdev.bk'.((WP_BK_MIN)?'.min':'').'.js', array( 'wpbc-datepick' ), '1.0');
    if ($where_to_load == 'client' || $where_to_load == 'both') {
        wp_enqueue_script('wpbc-main-client', WPDEV_BK_PLUGIN_URL . '/js/client' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-datepick'), '1.0');
    }
    if ($where_to_load == 'admin' || $where_to_load == 'both') {
        wp_enqueue_script('wpbc-main-admin', WPDEV_BK_PLUGIN_URL . '/js/admin' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-global-vars'), '1.0');
    }
    // Load Bootstrap
    if (is_admin()) {
        if (get_bk_option('booking_is_not_load_bs_script_in_admin') !== 'On') {
            wp_enqueue_script('wpbc-bts', WPDEV_BK_PLUGIN_URL . '/interface/bs/js/bs.min' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-global-vars'), '1.0');
        }
    } else {
        if (class_exists('wpdev_bk_biz_s') && get_bk_option('booking_is_not_load_bs_script_in_client') !== 'On') {
            wp_enqueue_script('wpbc-bts', WPDEV_BK_PLUGIN_URL . '/interface/bs/js/bs.min' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-global-vars'), '1.0');
        }
    }
    if ($where_to_load == 'admin' || $where_to_load == 'both') {
        // Choozen
        wp_enqueue_script('wpbc-chosen', WPDEV_BK_PLUGIN_URL . '/interface/chosen/chosen.jquery.min' . (WP_BK_MIN ? '.min' : '') . '.js', array('wpbc-global-vars'), '1.0');
    }
    do_action('wpbc_enqueue_js_files', $where_to_load);
}
Beispiel #4
0
function booking_listing_table($bookings, $booking_types)
{
    //debuge($_REQUEST);
    $user = wp_get_current_user();
    $user_bk_id = $user->ID;
    $bk_url_listing = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking';
    $bk_url_add = $bk_url_listing . '-reservation';
    $bk_url_resources = $bk_url_listing . '-resources';
    $bk_url_settings = $bk_url_listing . '-option';
    $bk_admin_url = get_params_in_url(array('page_num', 'wh_booking_type'));
    $booking_date_view_type = get_bk_option('booking_date_view_type');
    if ($booking_date_view_type == 'short') {
        $wide_days_class = ' hidden_items ';
        $short_days_class = '';
    } else {
        $wide_days_class = '';
        $short_days_class = ' hidden_items ';
    }
    $version = get_bk_version();
    if ($version == 'free') {
        $is_free = true;
    } else {
        $is_free = false;
    }
    ?>
         <div id="listing_visible_bookings">
          <?php 
    if (count($bookings) > 0) {
        ?>
          <div class="row-fluid booking-listing-header">
              <div class="booking-listing-collumn span1 wpbc_column_1" style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" onclick="javascript:setCheckBoxInTable(this.checked, 'booking_list_item_checkbox');">&nbsp;&nbsp;&nbsp;<?php 
        echo 'ID';
        ?>
</div>
              <div class="booking-listing-collumn span<?php 
        echo $is_free ? '1' : '2';
        ?>
 wpbc_column_2"><?php 
        _e('Labels', 'wpdev-booking');
        if (!$is_free) {
            echo ' / ';
            _e('Actions', 'wpdev-booking');
        }
        ?>
</div>
              <div class="booking-listing-collumn span<?php 
        echo $is_free ? '5' : '6';
        ?>
 wpbc_column_4"><?php 
        _e('Booking Data', 'wpdev-booking');
        ?>
</div>
              <div class="booking-listing-collumn span3 wpbc_column_5"><?php 
        _e('Booking Dates', 'wpdev-booking');
        ?>
&nbsp;&nbsp;&nbsp;
                  <a href="javascript:void(0)" id="booking_dates_full" onclick="javascript:
                            jQuery('#booking_dates_full').hide();
                            jQuery('#booking_dates_small').show();
                            jQuery('.booking_dates_small').hide();
                            jQuery('.booking_dates_full').show();" data-original-title="<?php 
        _e('Show ALL dates of booking', 'wpdev-booking');
        ?>
"  rel="tooltip" class="tooltip_top <?php 
        echo $short_days_class;
        ?>
 "><i class="icon-resize-full" style=" margin-top: 2px;"></i></a>
                  <a href="javascript:void(0)" id="booking_dates_small" onclick="javascript:
                            jQuery('#booking_dates_small').hide();
                            jQuery('#booking_dates_full').show();
                            jQuery('.booking_dates_small').show();
                            jQuery('.booking_dates_full').hide();" data-original-title="<?php 
        _e('Show only check in/out dates', 'wpdev-booking');
        ?>
"  rel="tooltip" class="tooltip_top <?php 
        echo $wide_days_class;
        ?>
 " ><i class="icon-resize-small" style=" margin-top: 2px;"></i></a>
              </div>
              <?php 
        if ($is_free) {
            ?>
              <div class="booking-listing-collumn span2 wpbc_column_5"><?php 
            _e('Actions', 'wpdev-booking');
            ?>
</div>
              <?php 
        }
        ?>
          </div>
          <?php 
    } else {
        echo '<center><h3>' . __('Nothing found!', 'wpdev-booking') . '</h3></center>';
    }
    ?>
        <?php 
    // P
    $print_data = apply_bk_filter('get_bklist_print_header', array(array()));
    $is_alternative_color = true;
    $id_of_new_bookings = array();
    foreach ($bookings as $bk) {
        $is_selected_color = 0;
        //rand(0,1);
        $is_alternative_color = !$is_alternative_color;
        $booking_id = $bk->booking_id;
        // 100
        $is_new = isset($bk->is_new) ? $bk->is_new : '0';
        // 1
        $bk_modification_date = isset($bk->modification_date) ? $bk->modification_date : '';
        // 2012-02-29 16:01:58
        $bk_form = $bk->form;
        // select-one^rangetime5^10:00 - 12:00~text^name5^Jonny~text^secondname5^Smith~email^ ....
        $bk_form_show = $bk->form_show;
        // First Name:Jonny   Last Name:Smith   Email:email@server.com  Country:GB  ....
        $bk_form_data = $bk->form_data;
        // Array ([name] => Jonny... [_all_] => Array ( [rangetime5] => 10:00 - 12:00 [name5] => Jonny ... ) .... )
        $bk_dates = $bk->dates;
        // Array ( [0] => stdClass Object ( [booking_id] => 8 [booking_date] => 2012-04-16 10:00:01 [approved] => 0 [type_id] => )
        $bk_dates_short = $bk->dates_short;
        // Array ( [0] => 2012-04-16 10:00:01 [1] => - [2] => 2012-04-20 12:00:02 [3] => , [4] => 2012-04-16 10:00:01 ....
        //P
        $bk_booking_type = isset($bk->booking_type) ? $bk->booking_type : '1';
        // 3
        if (!class_exists('wpdev_bk_personal')) {
            $bk_booking_type_name = '<span class="label_resource_not_exist">' . __('Default', 'wpdev-booking') . '</span>';
        } else {
            if (isset($booking_types[$bk_booking_type])) {
                $bk_booking_type_name = $booking_types[$bk_booking_type]->title;
                // Default
                if (strlen($bk_booking_type_name) > 19) {
                    //$bk_booking_type_name = substr($bk_booking_type_name, 0,  13) . ' ... ' . substr($bk_booking_type_name, -3 );
                    $bk_booking_type_name = '<span style="cursor:pointer;" rel="tooltip" class="tooltip_top"  data-original-title="' . $bk_booking_type_name . '">' . substr($bk_booking_type_name, 0, 13) . ' ... ' . substr($bk_booking_type_name, -3) . '</span>';
                }
            } else {
                $bk_booking_type_name = '<span class="label_resource_not_exist">' . __('Resource not exist', 'wpdev-booking') . '</span>';
            }
        }
        $bk_hash = isset($bk->hash) ? $bk->hash : '';
        // 99c9c2bd4fd0207e4376bdbf5ee473bc
        $bk_remark = isset($bk->remark) ? $bk->remark : '';
        //
        //BS
        $bk_cost = isset($bk->cost) ? $bk->cost : '';
        // 150.00
        $bk_pay_status = isset($bk->pay_status) ? $bk->pay_status : '';
        // 30800
        $bk_pay_request = isset($bk->pay_request) ? $bk->pay_request : '';
        // 0
        $bk_status = isset($bk->status) ? $bk->status : '';
        //BL
        $bk_dates_short_id = array();
        if (count($bk->dates) > 0) {
            $bk_dates_short_id = isset($bk->dates_short_id) ? $bk->dates_short_id : array();
        }
        // Array ([0] => [1] => .... [4] => 6... [11] => [12] => 8 )
        $is_approved = 0;
        if (count($bk->dates) > 0) {
            $is_approved = $bk->dates[0]->approved;
        }
        //BS
        $is_paid = 0;
        $payment_status_titles_current = '';
        if (class_exists('wpdev_bk_biz_s')) {
            if (is_payment_status_ok(trim($bk_pay_status))) {
                $is_paid = 1;
            }
            $payment_status_titles = get_payment_status_titles();
            $payment_status_titles_current = array_search($bk_pay_status, $payment_status_titles);
            if ($payment_status_titles_current === FALSE) {
                $payment_status_titles_current = $bk_pay_status;
            }
        }
        if ($is_new == 1) {
            $id_of_new_bookings[] = $booking_id;
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Get SHORT Dates showing data ////////////////////////////////////////////////////////////////////////////////////////////////////
        //$short_dates_content = wpdevbk_get_str_from_dates_short($bk_dates_short, $is_approved , $bk_dates_short_id , $booking_types );
        $short_dates_content = '';
        $dcnt = 0;
        foreach ($bk_dates_short as $dt) {
            if ($dt == '-') {
                $short_dates_content .= '<span class="date_tire"> - </span>';
            } elseif ($dt == ',') {
                $short_dates_content .= '<span class="date_tire">, </span>';
            } else {
                $short_dates_content .= '<a href="javascript:void(0)" class="field-booking-date ';
                if ($is_approved) {
                    $short_dates_content .= ' approved';
                }
                $short_dates_content .= '">';
                $bk_date = wpdevbk_get_date_in_correct_format($dt);
                $short_dates_content .= $bk_date[0];
                $short_dates_content .= '<sup class="field-booking-time">' . $bk_date[1] . '</sup>';
                // BL
                if (class_exists('wpdev_bk_biz_l')) {
                    if (!empty($bk_dates_short_id[$dcnt])) {
                        $bk_booking_type_name_date = $booking_types[$bk_dates_short_id[$dcnt]]->title;
                        // Default
                        if (strlen($bk_booking_type_name_date) > 19) {
                            $bk_booking_type_name_date = substr($bk_booking_type_name_date, 0, 13) . '...' . substr($bk_booking_type_name_date, -3);
                        }
                        $short_dates_content .= '<sup class="field-booking-time date_from_dif_type"> ' . $bk_booking_type_name_date . '</sup>';
                    }
                }
                $short_dates_content .= '</a>';
            }
            $dcnt++;
        }
        // Get WIDE Dates showing data /////////////////////////////////////////////////////////////////////////////////////////////////////
        $wide_dates_content = '';
        $dates_count = count($bk_dates);
        $dcnt = 0;
        foreach ($bk_dates as $dt) {
            $dcnt++;
            $wide_dates_content .= '<a href="javascript:void(0)" class="field-booking-date ';
            if ($is_approved) {
                $wide_dates_content .= ' approved';
            }
            $wide_dates_content .= ' ">';
            $bk_date = wpdevbk_get_date_in_correct_format($dt->booking_date);
            $wide_dates_content .= $bk_date[0];
            $wide_dates_content .= '<sup class="field-booking-time">' . $bk_date[1] . '</sup>';
            // BL
            if (class_exists('wpdev_bk_biz_l')) {
                if ($dt->type_id != '' && isset($booking_types[$dt->type_id])) {
                    $bk_booking_type_name_date = $booking_types[$dt->type_id]->title;
                    // Default
                    if (strlen($bk_booking_type_name_date) > 19) {
                        $bk_booking_type_name_date = substr($bk_booking_type_name_date, 0, 13) . '...' . substr($bk_booking_type_name_date, -3);
                    }
                    $wide_dates_content .= '<sup class="field-booking-time date_from_dif_type"> ' . $bk_booking_type_name_date . '</sup>';
                }
            }
            $wide_dates_content .= '</a>';
            if ($dcnt < $dates_count) {
                $wide_dates_content .= '<span class="date_tire">, </span>';
            }
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // BS
        $pay_print_status = '';
        if (class_exists('wpdev_bk_biz_s')) {
            if ($is_paid) {
                $pay_print_status = __('Paid OK', 'wpdev-booking');
                if ($payment_status_titles_current == 'Completed') {
                    $pay_print_status = $payment_status_titles_current;
                }
            } else {
                if (is_numeric($bk_pay_status) || $bk_pay_status == '') {
                    $pay_print_status = __('Unknown', 'wpdev-booking');
                } else {
                    $pay_print_status = $payment_status_titles_current;
                }
            }
        }
        ///// Print data  //////////////////////////////////////////////////////////////////////////////
        $print_data[] = apply_bk_filter('get_bklist_print_row', array(), $booking_id, $is_approved, $bk_form_show, $bk_booking_type_name, $is_paid, $pay_print_status, $booking_date_view_type == 'short' ? '<div class="booking_dates_small">' . $short_dates_content . '</div>' : '<div class="booking_dates_full">' . $wide_dates_content . '</div>', $bk_cost);
        //////////////////////////////////////////////////////////////////////////////////////////////
        ?>
          <div id="booking_mark_<?php 
        echo $booking_id;
        ?>
"  class="<?php 
        if ($is_new != '1') {
            echo ' hidden_items ';
        }
        ?>
 new-label clearfix-height">
              <a href="javascript:void(0)"  class="tooltip_bottom approve_bk_link  <?php 
        //if ($is_approved) echo ' hidden_items ';
        ?>
 "
                       onclick="javascript:mark_read_booking( '<?php 
        echo $booking_id;
        ?>
' ,
                                                      0, <?php 
        echo $user_bk_id;
        ?>
, '<?php 
        echo getBookingLocale();
        ?>
' );"
                       data-original-title="<?php 
        _e('Mark', 'wpdev-booking');
        echo ' ';
        _e('Unread', 'wpdev-booking');
        ?>
"  rel="tooltip" >
                        <img src="<?php 
        echo WPDEV_BK_PLUGIN_URL;
        ?>
/img/label_new_blue.png" style="width:24px; height:24px;"></a>
          </div>
          <div id="booking_row_<?php 
        echo $booking_id;
        ?>
"  class="row-fluid booking-listing-row clearfix-height<?php 
        if ($is_alternative_color) {
            echo ' row_alternative_color ';
        }
        if ($is_selected_color) {
            echo ' row_selected_color ';
        }
        //if ($is_new) echo ' row_unread_color ';
        $date_format = get_bk_option('booking_date_format');
        $time_format = get_bk_option('booking_time_format');
        if (empty($date_format)) {
            $date_format = "m / d / Y, D";
        }
        if (empty($time_format)) {
            $time_format = 'h:i a';
        }
        $cr_date = date_i18n($date_format, mysql2date('U', $bk_modification_date));
        $cr_time = date_i18n($time_format, mysql2date('U', $bk_modification_date));
        ?>
" >

              <div class="wpbc_column_1 booking-listing-collumn bktextcenter span1">
                    <input type="checkbox" class="booking_list_item_checkbox" 
                           onclick="javascript: if (jQuery(this).attr('checked') !== undefined ) { jQuery(this).parent().parent().addClass('row_selected_color'); } else {jQuery(this).parent().parent().removeClass('row_selected_color');}"
                           <?php 
        if ($is_selected_color) {
            echo ' checked="CHECKED" ';
        }
        ?>
                           id="booking_id_selected_<?php 
        echo $booking_id;
        ?>
"  name="booking_appr_<?php 
        $booking_id;
        ?>
"
                           /><span class="wpbc_mobile_legend clear" style="margin:0 -5px 0 25px"><?php 
        _e('ID', 'wpdev-booking');
        ?>
: </span><span class="field-id"><?php 
        echo $booking_id;
        ?>
</span>                  
              </div>

              <div class="wpbc_column_2 booking-listing-collumn bktextleft booking-labels span<?php 
        echo $is_free ? '1' : '2';
        ?>
 ">
                  <?php 
        make_bk_action('wpdev_bk_listing_show_resource_label', $bk_booking_type_name, $bk_admin_url . '&wh_booking_type=' . $bk_booking_type);
        ?>
                  <?php 
        make_bk_action('wpdev_bk_listing_show_payment_label', $is_paid, $pay_print_status, $payment_status_titles_current);
        ?>
                  <span class="label label-pending <?php 
        if ($is_approved) {
            echo ' hidden_items ';
        }
        ?>
 "><?php 
        _e('Pending', 'wpdev-booking');
        ?>
</span>
                  <span class="label label-approved <?php 
        if (!$is_approved) {
            echo ' hidden_items ';
        }
        ?>
"><?php 
        _e('Approved', 'wpdev-booking');
        ?>
</span>
              </div>

              <div class="wpbc_column_3 booking-listing-collumn bktextjustify span<?php 
        echo $is_free ? '5' : '6';
        ?>
 ">
                    <div style="text-align:left"><?php 
        echo $bk_form_show;
        ?>
</div>
              </div>

              <div class="wpbc_column_4 booking-listing-collumn bktextleft booking-dates span3">

                <div class="booking_dates_small <?php 
        echo $short_days_class;
        ?>
"><?php 
        echo $short_dates_content;
        ?>
</div>
                <div class="booking_dates_full  <?php 
        echo $wide_days_class;
        ?>
" ><?php 
        echo $wide_dates_content;
        ?>
</div>

              </div>

              <?php 
        $edit_booking_url = $bk_url_add . '&booking_type=' . $bk_booking_type . '&booking_hash=' . $bk_hash . '&parent_res=1';
        ?>

              <div class="wpbc_column_5 booking-listing-collumn booking-actions<?php 
        echo $is_free ? '0 span2 bktextcenter' : ' bktextleft ';
        ?>
 ">

                <?php 
        $is_can = true;
        //current_user_can( 'edit_posts' );
        if ($is_can) {
            ?>
                  
                  
                  <?php 
            make_bk_action('wpdev_bk_listing_show_cost_btn', $booking_id, $bk_cost);
            ?>
                  
                  <div class="actions-fields-group">
                    <?php 
            make_bk_action('wpdev_bk_listing_show_edit_btn', $booking_id, $edit_booking_url, $bk_remark, $bk_booking_type);
            ?>
<a    href="javascript:void(0)"  class="tooltip_top approve_bk_link button-secondary button  <?php 
            if ($is_approved) {
                echo ' hidden_items ';
            }
            ?>
 "
                            onclick="javascript:approve_unapprove_booking(<?php 
            echo $booking_id;
            ?>
,1, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1  );"
                            data-original-title="<?php 
            _e('Approve', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                       ><i class="icon-ok-circle"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/accept-24x24.gif" style="width:14px; height:14px;"><?php /**/
            ?>
</a><a                     
                            href="javascript:void(0)"  class="tooltip_top pending_bk_link button-secondary button  <?php 
            if (!$is_approved) {
                echo ' hidden_items ';
            }
            ?>
 "
                            onclick="javascript:if ( bk_are_you_sure('<?php 
            echo esc_js(__('Do you really want to set booking as pending ?', 'wpdev-booking'));
            ?>
') ) approve_unapprove_booking(<?php 
            echo $booking_id;
            ?>
,0, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1  );"
                            data-original-title="<?php 
            _e('Reject', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                        ><i class="icon-ban-circle"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/remove-16x16.png" style="width:15px; height:15px;"><?php /**/
            ?>
</a><a                     
                            href="javascript:void(0)" 
                            onclick="javascript:if ( bk_are_you_sure('<?php 
            echo esc_js(__('Do you really want to delete this booking ?', 'wpdev-booking'));
            ?>
') ) delete_booking(<?php 
            echo $booking_id;
            ?>
, <?php 
            echo $user_bk_id;
            ?>
, '<?php 
            echo getBookingLocale();
            ?>
' , 1   );"
                            data-original-title="<?php 
            _e('Delete', 'wpdev-booking');
            ?>
"  rel="tooltip" 
                            class="tooltip_top button-secondary button"
                        ><i class="icon-trash"></i><?php 
            /** ?><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/delete_type.png" style="width:13px; height:13px;"><?php /**/
            ?>
</a><?php 
            make_bk_action('wpdev_bk_listing_show_print_btn', $booking_id);
            make_bk_action('wpdev_bk_listing_show_payment_status_btn', $booking_id);
            ?>
                      
                    <div class="field-date" style="<?php 
            echo $is_free ? 'margin-top:5px;float: none;white-space: normal;' : '';
            ?>
"><span ><?php 
            _e('Created', 'wpdev-booking');
            ?>
:</span> <span><?php 
            echo $cr_date, ' ', $cr_time;
            ?>
</span></div>
                  </div>
              <?php 
        }
        ?>
              </div>
       
              <?php 
        make_bk_action('wpdev_bk_listing_show_edit_fields', $booking_id, $bk_remark);
        ?>

              <?php 
        make_bk_action('wpdev_bk_listing_show_payment_status_cost_fields', $booking_id, $bk_pay_status);
        ?>
              
          </div>
        <?php 
    }
    ?>
        </div>

        <?php 
    //if  ( wpbc_is_field_in_table_exists('booking','is_new') != 0 )  renew_NumOfNewBookings($id_of_new_bookings); // Update num status if supported
    ?>

        <?php 
    make_bk_action('wpdev_bk_listing_show_change_booking_resources', $booking_types);
    ?>

        <?php 
    if (function_exists('wpdevbk_generate_print_loyout')) {
        wpdevbk_generate_print_loyout($print_data);
    }
}
function get_booking_info_4_tooltip($bk_id, $bookings, $booking_types, $title_in_day = '', $title = '', $title_hint = '')
{
    $user = wp_get_current_user();
    $user_bk_id = $user->ID;
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Gathering data  about the booking to  show in the calendar !!! ////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Get it from the option settings
    $what_show_in_day_template = get_bk_option('booking_default_title_in_day_for_calendar_view_mode');
    // '<span style="font-size:07px;">[id]</span>:[name]';
    if ($title != '') {
        $title .= ' / ';
    }
    // Other Booking in the same day
    $title .= $bk_id;
    if ($title_in_day != '') {
        $title_in_day .= ',';
    }
    // Other Booking in the same day
    //$title_in_day .=  $bk_id ;
    if (function_exists('get_title_for_showing_in_day')) {
        $title_in_day .= get_title_for_showing_in_day($bk_id, $bookings, $what_show_in_day_template);
    } else {
        $title_in_day .= $bk_id . ':' . $bookings[$bk_id]->form_data['_all_fields_']['name'];
    }
    if ($title_hint != '') {
        $title_hint .= ' <hr style="margin:10px 5px;" /> ';
    }
    // Other Booking in the same day
    $title_hint .= '<div class=\'booking-listing-collumn\' >';
    if (function_exists('get_booking_title')) {
        if (isset($booking_types[$bookings[$bk_id]->booking_type])) {
            $bk_title = $booking_types[$bookings[$bk_id]->booking_type]->title;
        } else {
            $bk_title = get_booking_title($bookings[$bk_id]->booking_type);
        }
        $bk_title = '<span class=\'label label-resource label-info\'>' . $bk_title . '</span>';
    } else {
        $bk_title = '';
    }
    $title_hint .= '<span class=\'field-id\'>' . $bk_id . '</span>' . ' ' . $bk_title;
    if (class_exists('wpdev_bk_biz_s')) {
        $title_hint .= '<div style=\'float:right;\'>';
        if (function_exists('wpdev_bk_get_payment_status_simple')) {
            $pay_status = wpdev_bk_get_payment_status_simple($bookings[$bk_id]->pay_status);
            $pay_status = '<span class=\'label label-payment-status payment-label-unknown\'><span style=\'font-size:07px;\'>' . __('Payment', 'booking') . '</span> ' . $pay_status . '</span>';
        } else {
            $pay_status = '';
        }
        $title_hint .= ' ' . $pay_status;
        $currency = apply_bk_filter('get_currency_info');
        $show_cost_value = wpdev_bk_cost_number_format($bookings[$bk_id]->cost);
        $title_hint .= ' <div class="cost-fields-group" style=\'float:right; margin:2px;\'>' . $currency . ' ' . $show_cost_value . '</div>';
        $title_hint .= '</div>';
    }
    $title_hint .= '<div>' . $bookings[$bk_id]->form_show . '</div>';
    //$bookings[$bk_id]->form_data['name'].' ' . $bookings[$bk_id]->form_data['secondname'] ;
    //$title_hint .= ' '. $bookings[$bk_id]->remark;
    //BL
    $bk_dates_short_id = array();
    if (count($bookings[$bk_id]->dates) > 0) {
        $bk_dates_short_id = isset($bookings[$bk_id]->dates_short_id) ? $bookings[$bk_id]->dates_short_id : array();
    }
    // Array ([0] => [1] => .... [4] => 6... [11] => [12] => 8 )
    $is_approved = 0;
    if (count($bookings[$bk_id]->dates) > 0) {
        $is_approved = $bookings[$bk_id]->dates[0]->approved;
    }
    $short_dates_content = wpdevbk_get_str_from_dates_short($bookings[$bk_id]->dates_short, $is_approved, $bk_dates_short_id, $booking_types);
    $short_dates_content = str_replace('"', "'", $short_dates_content);
    $title_hint .= '<div style=\'margin-top:5px;\'>' . $short_dates_content . '</div>';
    $is_approved = 0;
    if (!empty($bookings[$bk_id]->dates)) {
        $is_approved = $bookings[$bk_id]->dates[0]->approved;
    }
    $title .= '<div class=\'timeline_info_bk_actionsbar_' . $bk_id . '\'  style=\'display: inline;
    line-height: 1em;
    padding: 10px;
    vertical-align: text-top;\'>';
    $is_can = true;
    //current_user_can( 'edit_posts' );
    if ($is_can) {
        if (class_exists('wpdev_bk_personal')) {
            $bk_url_add = 'admin.php?page=' . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . 'wpdev-booking-reservation';
            $bk_hash = isset($bookings[$bk_id]->hash) ? $bookings[$bk_id]->hash : '';
            $bk_booking_type = $bookings[$bk_id]->booking_type;
            $edit_booking_url = $bk_url_add . '&booking_type=' . $bk_booking_type . '&booking_hash=' . $bk_hash . '&parent_res=1';
            $title .= '<a class=\'button button-secondary\' style=\'margin-right:5px;\' href=\'' . $edit_booking_url . '\' onclick=\'\' ><i class=\'icon-edit\'></i></a>';
        }
        $title .= '<a class=\'button button-secondary approve_bk_link ' . ($is_approved ? 'hidden_items' : '') . '\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking(' . $bk_id . ',1, ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-ok-circle\'></i></a>';
        $title .= '<a class=\'button button-secondary pending_bk_link ' . ($is_approved ? '' : 'hidden_items') . '\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:approve_unapprove_booking(' . $bk_id . ',0, ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-ban-circle\'></i></a>';
        $title .= '<a class=\'button button-secondary\' style=\'margin-right:5px;\' href=\'javascript:;\' onclick=\'javascript:delete_booking(' . $bk_id . ', ' . $user_bk_id . ', &quot;' . getBookingLocale() . '&quot; , 1   );\' ><i class=\'icon-trash\'></i></a>';
    }
    $title .= '</div>';
    $title_hint .= '</div>';
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    return array($title_in_day, $title, $title_hint, $is_approved);
}
 function loadLocale($locale = '')
 {
     if (empty($locale)) {
         $locale = getBookingLocale();
     }
     if (!empty($locale)) {
         $domain = str_replace('.php', '', WPDEV_BK_PLUGIN_FILENAME);
         $mofile = WPDEV_BK_PLUGIN_DIR . '/languages/' . $domain . '-' . $locale . '.mo';
         if (file_exists($mofile)) {
             //return load9999_textdomain($domain , $mofile);  // Depricated
             $plugin_rel_path = WPDEV_BK_PLUGIN_DIRNAME . '/languages';
             return load_plugin_textdomain($domain, false, $plugin_rel_path);
         } else {
             return false;
         }
     }
     return false;
 }
 function get_booking_form($my_boook_type)
 {
     $booking_form_field_active1 = get_bk_option('booking_form_field_active1');
     $booking_form_field_required1 = get_bk_option('booking_form_field_required1');
     $booking_form_field_label1 = get_bk_option('booking_form_field_label1');
     $booking_form_field_label1 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label1);
     if (function_exists('icl_translate')) {
         $booking_form_field_label1 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label1', $booking_form_field_label1);
     }
     $booking_form_field_active2 = get_bk_option('booking_form_field_active2');
     $booking_form_field_required2 = get_bk_option('booking_form_field_required2');
     $booking_form_field_label2 = get_bk_option('booking_form_field_label2');
     $booking_form_field_label2 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label2);
     if (function_exists('icl_translate')) {
         $booking_form_field_label2 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label2', $booking_form_field_label2);
     }
     $booking_form_field_active3 = get_bk_option('booking_form_field_active3');
     $booking_form_field_required3 = get_bk_option('booking_form_field_required3');
     $booking_form_field_label3 = get_bk_option('booking_form_field_label3');
     $booking_form_field_label3 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label3);
     if (function_exists('icl_translate')) {
         $booking_form_field_label3 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label3', $booking_form_field_label3);
     }
     $booking_form_field_active4 = get_bk_option('booking_form_field_active4');
     $booking_form_field_required4 = get_bk_option('booking_form_field_required4');
     $booking_form_field_label4 = get_bk_option('booking_form_field_label4');
     $booking_form_field_label4 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label4);
     if (function_exists('icl_translate')) {
         $booking_form_field_label4 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label4', $booking_form_field_label4);
     }
     $booking_form_field_active5 = get_bk_option('booking_form_field_active5');
     $booking_form_field_required5 = get_bk_option('booking_form_field_required5');
     $booking_form_field_label5 = get_bk_option('booking_form_field_label5');
     $booking_form_field_label5 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label5);
     if (function_exists('icl_translate')) {
         $booking_form_field_label5 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label5', $booking_form_field_label5);
     }
     $booking_form_field_active6 = get_bk_option('booking_form_field_active6');
     $booking_form_field_required6 = get_bk_option('booking_form_field_required6');
     $booking_form_field_label6 = get_bk_option('booking_form_field_label6');
     $booking_form_field_label6 = apply_bk_filter('wpdev_check_for_active_language', $booking_form_field_label6);
     if (function_exists('icl_translate')) {
         $booking_form_field_label6 = icl_translate('wpml_custom', 'wpbc_custom_form_field_label6', $booking_form_field_label6);
     }
     $booking_form_field_values6 = get_bk_option('booking_form_field_values6');
     $my_form = '[calendar]';
     //'<div style="text-align:left;">'.
     //'<p>'.__('First Name (required)', 'wpdev-booking').':<br />  <span class="wpdev-form-control-wrap name'.$my_boook_type.'"><input type="text" name="name'.$my_boook_type.'" value="" class="wpdev-validates-as-required" size="40" /></span> </p>'.
     if ($booking_form_field_active1 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="name' . $my_boook_type . '" class="control-label">' . $booking_form_field_label1 . ($booking_form_field_required1 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="name' . $my_boook_type . '" id="name' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required1 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active2 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="secondname' . $my_boook_type . '" class="control-label">' . $booking_form_field_label2 . ($booking_form_field_required2 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="secondname' . $my_boook_type . '" id="secondname' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required2 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active3 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="email' . $my_boook_type . '" class="control-label">' . $booking_form_field_label3 . ($booking_form_field_required3 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="email' . $my_boook_type . '" id="email' . $my_boook_type . '" class="input-xlarge wpdev-validates-as-email' . ($booking_form_field_required3 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                   </div>
                 </div>';
     }
     if ($booking_form_field_active6 == 'On') {
         $my_form .= '  <div class="control-group">
                       <label for="visitors' . $my_boook_type . '" class="control-label">' . $booking_form_field_label6 . ($booking_form_field_required6 == 'On' ? '*' : '') . ':</label>
                       <div class="controls">
                         <select name="visitors' . $my_boook_type . '" id="visitors' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required6 == 'On' ? ' wpdev-validates-as-required ' : '') . '">';
         //$booking_form_field_values6 = explode("\n",$booking_form_field_values6);
         $booking_form_field_values6 = preg_split('/\\r\\n|\\r|\\n/', $booking_form_field_values6);
         foreach ($booking_form_field_values6 as $select_option) {
             $select_option = str_replace(array("'", '"'), '', $select_option);
             $my_form .= '  <option value="' . $select_option . '">' . $select_option . '</option>';
         }
         $my_form .= '     </select>                            
                         <p class="help-block"></p>
                       </div>
                     </div>';
     }
     if ($booking_form_field_active4 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="phone' . $my_boook_type . '" class="control-label">' . $booking_form_field_label4 . ($booking_form_field_required4 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <input type="text" name="phone' . $my_boook_type . '" id="phone' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required4 == 'On' ? ' wpdev-validates-as-required ' : '') . '">
                     <p class="help-block"></p>
                   </div>
                 </div>';
     }
     if ($booking_form_field_active5 != 'Off') {
         $my_form .= '  <div class="control-group">
                   <label for="details" class="control-label">' . $booking_form_field_label5 . ($booking_form_field_required5 == 'On' ? '*' : '') . ':</label>
                   <div class="controls">
                     <textarea rows="3" name="details' . $my_boook_type . '" id="details' . $my_boook_type . '" class="input-xlarge' . ($booking_form_field_required5 == 'On' ? ' wpdev-validates-as-required ' : '') . '"></textarea>
                   </div>
                 </div>';
     }
     $my_form .= '  <div class="control-group">[captcha]</div>';
     $my_form .= '  <button class="btn btn-primary" type="button" onclick="mybooking_submit(this.form,' . $my_boook_type . ',\'' . getBookingLocale() . '\');" >' . __('Send', 'wpdev-booking') . '</button> ';
     //.'<p>'.__('Last Name (required)', 'wpdev-booking').':<br />  <span class="wpdev-form-control-wrap secondname'.$my_boook_type.'"><input type="text" name="secondname'.$my_boook_type.'" value="" class="wpdev-validates-as-required" size="40" /></span> </p>'.
     //'<p>'.__('Email (required)', 'wpdev-booking').':<br /> <span class="wpdev-form-control-wrap email'.$my_boook_type.'"><input type="text" name="email'.$my_boook_type.'" value="" class="wpdev-validates-as-email wpdev-validates-as-required" size="40" /></span> </p>'.
     //'<p>'.__('Phone', 'wpdev-booking').':<br />            <span class="wpdev-form-control-wrap phone'.$my_boook_type.'"><input type="text" name="phone'.$my_boook_type.'" value="" size="40" /></span> </p>'.
     //'<p>'.__('Details', 'wpdev-booking').':<br />          <span class="wpdev-form-control-wrap details'.$my_boook_type.'"><textarea name="details'.$my_boook_type.'" cols="40" rows="10"></textarea></span> </p>';
     //$my_form .=  '<p>[captcha]</p>';
     //$my_form .=  '<p><input type="button" value="'.__('Send', 'wpdev-booking').'" onclick="mybooking_submit(this.form,'.$my_boook_type.',\''.getBookingLocale().'\');" /></p>
     //        </div>';
     return $my_form;
 }
function wpbc_gcal_extend_buttons_in_action_toolbar_booking_listing()
{
    $booking_gcal_feed = get_bk_option('booking_gcal_feed');
    $is_this_btn_disabled = false;
    if (!class_exists('wpdev_bk_personal') && $booking_gcal_feed == '') {
        $is_this_btn_disabled = true;
        $settigns_link = "admin.php?page=" . WPDEV_BK_PLUGIN_DIRNAME . '/' . WPDEV_BK_PLUGIN_FILENAME . "wpdev-booking-option&tab=sync";
    } else {
        $booking_gcal_events_from = get_bk_option('booking_gcal_events_from');
        $booking_gcal_events_from_offset = get_bk_option('booking_gcal_events_from_offset');
        $booking_gcal_events_from_offset_type = get_bk_option('booking_gcal_events_from_offset_type');
        $booking_gcal_events_until = get_bk_option('booking_gcal_events_until');
        $booking_gcal_events_until_offset = get_bk_option('booking_gcal_events_until_offset');
        $booking_gcal_events_until_offset_type = get_bk_option('booking_gcal_events_until_offset_type');
        $booking_gcal_events_max = get_bk_option('booking_gcal_events_max');
        // $booking_gcal_timezone = get_bk_option( 'booking_gcal_timezone');
    }
    ?>
    <div id="wpbc_gcal_import_events" class="modal" style="display:none;width:59%;" >
       <div class="modal-header">
           <a class="close" data-dismiss="modal">&times;</a>
           <h3><?php 
    if ($is_this_btn_disabled) {
        _e('Warning!', 'booking');
    } else {
        _e('Retrieve Google Calendar Events ', 'booking');
    }
    ?>
</h3>
       </div>
       <div class="modal-body">
         <?php 
    if ($is_this_btn_disabled) {
        ?>
   
            <label class="help-block" style="display:block;">
                <?php 
        printf(__('Please configure settings for import Google Calendar events', 'booking'), '<b>', ',</b>');
        ?>
 
                <a href="<?php 
        echo $settigns_link;
        ?>
"><?php 
        _e('here', 'booking');
        ?>
</a>
            </label>
          <?php 
    } else {
        ?>

                <table class="visibility_gcal_feeds_settings form-table settings-table"  >
                    <tbody>
                    <?php 
        if (function_exists('wpbc_gcal_settings_content_field_selection_booking_resources')) {
            wpbc_gcal_settings_content_field_selection_booking_resources();
        } else {
            ?>
<input type="hidden" name="wpbc_booking_resource" id="wpbc_booking_resource" value="" /><?php 
        }
        wpbc_gcal_settings_content_field_from($booking_gcal_events_from, $booking_gcal_events_from_offset, $booking_gcal_events_from_offset_type);
        wpbc_gcal_settings_content_field_until($booking_gcal_events_until, $booking_gcal_events_until_offset, $booking_gcal_events_until_offset_type);
        wpbc_gcal_settings_content_field_max_feeds($booking_gcal_events_max);
        // wpbc_gcal_settings_content_field_timezone($booking_gcal_timezone);
        ?>
  
                    </tbody>
                </table>

          <?php 
    }
    ?>
 
       </div>
        <div class="modal-footer" style="text-align:center;"> 
         <?php 
    if ($is_this_btn_disabled) {
        ?>
   
         <a href="<?php 
        echo $settigns_link;
        ?>
" 
            class="button button-primary"  style="float:none;" >
             <?php 
        _e('Configure', 'booking');
        ?>
         </a>
         <?php 
    } else {
        ?>
         <a href="javascript:void(0)" class="button button-primary"  style="float:none;"                                        
            onclick="javascript:wpbc_import_gcal_events('<?php 
        echo get_bk_current_user_id();
        ?>
'
                                                            , [ jQuery('#booking_gcal_events_from').val(), jQuery('#booking_gcal_events_from_offset').val(), jQuery('#booking_gcal_events_from_offset_type').val() ]
                                                        , [ jQuery('#booking_gcal_events_until').val(), jQuery('#booking_gcal_events_until_offset').val(), jQuery('#booking_gcal_events_until_offset_type').val() ]
                                                        , jQuery('#booking_gcal_events_max').val()
                                                        , jQuery('#wpbc_booking_resource').val()
                 );jQuery('#wpbc_gcal_import_events').modal('hide');"
            ><?php 
        _e('Import Google Calendar Events', 'booking');
        ?>
</a>
         <?php 
    }
    ?>
   
         <a href="javascript:void(0)" class="button" style="float:none;" data-dismiss="modal"><?php 
    _e('Close', 'booking');
    ?>
</a>
       </div>
    </div>
    <div class="btn-group">                            
        <a  data-original-title="<?php 
    _e('Import Google Calendar Events', 'booking');
    ?>
"  rel="tooltip"
            class="tooltip_top button button-secondary<?php 
    if ($is_this_btn_disabled) {
        echo ' disabled';
    }
    ?>
" 
            <?php 
    if (true) {
        ?>
                onclick='javascript:jQuery("#wpbc_gcal_import_events").modal("show");'
            <?php 
    } else {
        ?>
                onclick="javascript:wpbc_import_gcal_events('<?php 
        echo get_bk_current_user_id();
        ?>
' );"
            <?php 
    }
    ?>
                            
           /><?php 
    _e('Import', 'booking');
    ?>
 <i class="icon-download"></i></a>
        <!--a data-original-title="<?php 
    _e('Export only current page of bookings to CSV format', 'booking');
    ?>
"  rel="tooltip" 
           class="tooltip_top  button button-secondary" onclick='javascript:export_booking_listing("page", "<?php 
    echo getBookingLocale();
    ?>
");'
           /> <i class="icon-chevron-down"></i></a-->
    </div>
    <?php 
}
 function get_booking_form($my_boook_type)
 {
     $my_form = '<div style="text-align:left;">
             <p>' . __('First Name (required)', 'wpdev-booking') . ':<br />  <span class="wpdev-form-control-wrap name' . $my_boook_type . '"><input type="text" name="name' . $my_boook_type . '" value="" class="wpdev-validates-as-required" size="40" /></span> </p>
             <p>' . __('Last Name (required)', 'wpdev-booking') . ':<br />  <span class="wpdev-form-control-wrap secondname' . $my_boook_type . '"><input type="text" name="secondname' . $my_boook_type . '" value="" class="wpdev-validates-as-required" size="40" /></span> </p>
             <p>' . __('Email (required)', 'wpdev-booking') . ':<br /> <span class="wpdev-form-control-wrap email' . $my_boook_type . '"><input type="text" name="email' . $my_boook_type . '" value="" class="wpdev-validates-as-email wpdev-validates-as-required" size="40" /></span> </p>
             <p>' . __('Phone', 'wpdev-booking') . ':<br />            <span class="wpdev-form-control-wrap phone' . $my_boook_type . '"><input type="text" name="phone' . $my_boook_type . '" value="" size="40" /></span> </p>
             <p>' . __('Details', 'wpdev-booking') . ':<br />          <span class="wpdev-form-control-wrap details' . $my_boook_type . '"><textarea name="details' . $my_boook_type . '" cols="40" rows="10"></textarea></span> </p>';
     $my_form .= '<p>[captcha]</p>';
     $my_form .= '<p><input type="button" value="' . __('Send', 'wpdev-booking') . '" onclick="mybooking_submit(this.form,' . $my_boook_type . ',\'' . getBookingLocale() . '\');" /></p>
             </div>';
     return $my_form;
 }
    public function showImportedEvents()
    {
        ////////////////////////////////////////////////////////////////////////
        ?>
        
        <table style="width:100%;margin-top:45px;" id="gcal_imported_events<?php 
        echo $this->getResource();
        ?>
" class="resource_table booking_table" cellpadding="0" cellspacing="0">
            <?php 
        if (function_exists('get_booking_title')) {
            echo '<tr><td colspan="6" style="padding:5px 10px;font-style:italic;"> <h4>', get_booking_title($this->getResource()), '</h4></td></tr>';
        }
        ?>
            <?php 
        // Headers
        ?>
            <tr>
                <th style="width:15px;"><input type="checkbox" onclick="javascript:jQuery('#gcal_imported_events<?php 
        echo $this->getResource();
        ?>
 .events_items').attr('checked', this.checked);" class="" id="events_items_all"  name="events_items_all" /></th>
                <th style="width:10px;height:35px;border-left: 1px solid #BBBBBB;"> <?php 
        _e('ID', 'booking');
        ?>
 </th>
                <th style="height:35px;width:220px;" style="border-left: 1px solid #ccc;"> <?php 
        _e('Title', 'booking');
        ?>
 </th>                
                <th style="text-align:center;"> <?php 
        _e('Info', 'booking');
        ?>
 </th>
                <th style="text-align:center;"> <?php 
        _e('Dates', 'booking');
        ?>
 </th>
                <th style="width:10px;height:35px;border-left: 1px solid #BBBBBB;"> <?php 
        _e('GID', 'booking');
        ?>
 </th>
            </tr>
            <?php 
        $alternative_color = '';
        if (!empty($this->events)) {
            foreach ($this->events as $bt) {
                if ($alternative_color == '') {
                    $alternative_color = ' class="alternative_color" ';
                } else {
                    $alternative_color = '';
                }
                ?>
                   <tr id="gcal_imported_events_id_<?php 
                echo $bt['id'];
                ?>
">
                        <td <?php 
                echo $alternative_color;
                ?>
 ><span class="wpbc_mobile_legend"><?php 
                _e('Selection', 'booking');
                ?>
:</span><input type="checkbox" class="events_items" id="events_items_<?php 
                echo $bt['id'];
                ?>
" value="<?php 
                echo $bt['id'];
                ?>
"  name="events_items_<?php 
                echo $bt['id'];
                ?>
" /></td>
                        <td style="border-left: 1px solid #ccc;text-align: center;" <?php 
                echo $alternative_color;
                ?>
 ><span class="wpbc_mobile_legend"><?php 
                _e('ID', 'booking');
                ?>
:</span><?php 
                echo $bt['id'];
                ?>
</td>
                        <td <?php 
                echo $alternative_color;
                ?>
 style="border-left: 1px solid #ccc;">
                            <span class="wpbc_mobile_legend"><?php 
                _e('Title', 'booking');
                ?>
:</span>
                            <span ><?php 
                echo $bt['title'];
                ?>
</span>
                        </td>                        
                        <td style="border-right: 0px;border-left: 1px solid #ccc;text-align: center;" <?php 
                echo $alternative_color;
                ?>
 >
                            <span class="wpbc_mobile_legend"><?php 
                _e('Info', 'booking');
                ?>
:</span>
                            <span ><?php 
                echo $bt['description'];
                ?>
</span><br/>
                            <?php 
                if (!empty($bt['location'])) {
                    echo '<span >', __('Location:', 'booking'), ': ', $bt['location'], '</span>';
                }
                ?>
                        </td>

                        <td style="border-right: 0px;border-left: 1px solid #ccc;text-align: center;" <?php 
                echo $alternative_color;
                ?>
 >
                            <span class="booking-listing-collumn booking-dates">
                                <span class="wpbc_mobile_legend"><?php 
                _e('Dates', 'booking');
                ?>
:</span>
                                <div class="booking_dates_full" style="font-size: 11px;padding:3px 5px;" ><?php 
                $bt['dates'] = explode(', ', $bt['dates']);
                foreach ($bt['dates'] as $keyd => $valued) {
                    $valued = explode('.', $valued);
                    $valued = wpdevbk_get_date_in_correct_format(sprintf("%04d-%02d-%02d", $valued[2], $valued[1], $valued[0]));
                    $bt['dates'][$keyd] = '<a href="javascript:void(0)" class="field-booking-date" style="font-weight: normal;">' . $valued[0] . '</a>';
                }
                $bt['dates'] = implode('<span class="date_tire" style="font-size: 12px;">, </span>', $bt['dates']);
                echo $bt['dates'];
                //date_i18n('d.m.Y H:i',$bt['start_time'] ), ' - ', date_i18n('d.m.Y H:i',$bt['end_time']);
                ?>
                                </div>
                            </span>
                        </td>
                        <td style="border-left: 1px solid #ccc;text-align: center;" <?php 
                echo $alternative_color;
                ?>
 ><span class="wpbc_mobile_legend"><?php 
                _e('GID', 'booking');
                ?>
:</span><?php 
                echo $bt['sync_gid'];
                ?>
</td>
                   </tr>                   
            <?php 
            }
        }
        ?>

            <tr class="wpbc_table_footer">
                <td colspan="6" style="text-align: center;"> 
                    <a href="javascript:void(0)" class="button button-primary" style="float:none;margin:10px;" 
                       onclick="javascript:location.reload();" ><?php 
        _e('Reload page', 'booking');
        ?>
</a>                    
                    <a href="javascript:void(0)" class="button" style="float:none;margin:10px;" 
                       onclick="javascript:jQuery('#gcal_imported_events<?php 
        echo $this->getResource();
        ?>
').remove();" ><?php 
        _e('Hide', 'booking');
        ?>
</a>                    
                    <a href="javascript:void(0)" class="button"  style="float:none;margin:10px;"                                        
                       onclick="javascript: if ( bk_are_you_sure('<?php 
        echo esc_js(__('Do you really want to delete selected booking(s) ?', 'booking'));
        ?>
') ) {
                                                    delete_booking( 
                                                                    get_selected_bookings_id_in_this_list('#gcal_imported_events<?php 
        echo $this->getResource();
        ?>
 .events_items', 13) 
                                                                    , <?php 
        echo $this->getUserID();
        ?>
                                                                    , '<?php 
        echo getBookingLocale();
        ?>
' 
                                                                    , 1  
                                                    ); 
                                            } "
                       ><?php 
        _e('Delete selected booking(s)', 'booking');
        ?>
</i></a>
                    
                </td>
            </tr>

        </table>
        <script type="text/javascript"> 
            jQuery("#gcal_imported_events<?php 
        echo $this->getResource();
        ?>
").insertAfter("#booking_listings_interface_header");
        </script>
        <?php 
    }