function wpbc_gcal_settings_submit() { if (!class_exists('wpdev_bk_personal')) { update_bk_option('booking_gcal_feed', $_POST['booking_gcal_feed']); } //update_bk_option( 'booking_gcal_feed', wpbc_set_relative_url( $_POST['booking_gcal_feed'] ) ); update_bk_option('booking_gcal_events_from', $_POST['booking_gcal_events_from']); if ($_POST['booking_gcal_events_from'] != 'date') { $_POST['booking_gcal_events_from_offset'] = intval($_POST['booking_gcal_events_from_offset']); if (empty($_POST['booking_gcal_events_from_offset'])) { $_POST['booking_gcal_events_from_offset'] = "-0"; } update_bk_option('booking_gcal_events_from_offset', $_POST['booking_gcal_events_from_offset']); } else { update_bk_option('booking_gcal_events_from_offset', $_POST['booking_gcal_events_from_offset']); } update_bk_option('booking_gcal_events_from_offset_type', $_POST['booking_gcal_events_from_offset_type']); update_bk_option('booking_gcal_events_until', $_POST['booking_gcal_events_until']); if ($_POST['booking_gcal_events_until'] != 'date') { $_POST['booking_gcal_events_until_offset'] = intval($_POST['booking_gcal_events_until_offset']); if (empty($_POST['booking_gcal_events_from_offset'])) { $_POST['booking_gcal_events_from_offset'] = "-0"; } update_bk_option('booking_gcal_events_until_offset', $_POST['booking_gcal_events_until_offset']); } else { update_bk_option('booking_gcal_events_until_offset', $_POST['booking_gcal_events_until_offset']); } update_bk_option('booking_gcal_events_until_offset_type', $_POST['booking_gcal_events_until_offset_type']); update_bk_option('booking_gcal_events_max', $_POST['booking_gcal_events_max']); update_bk_option('booking_gcal_api_key', $_POST['booking_gcal_api_key']); update_bk_option('booking_gcal_timezone', $_POST['booking_gcal_timezone']); // update_bk_option( 'booking_gcal_is_send_email' , ( ( isset( $_POST['booking_gcal_is_send_email'] ) ) ? 'On' : 'Off' ) ); $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, 'only_super_admin'); if ($is_can) { update_bk_option('booking_gcal_auto_import_is_active', isset($_POST['booking_gcal_auto_import_is_active']) ? 'On' : 'Off'); // Update Cron // if (isset($_POST['booking_gcal_auto_import_is_active'])) { update_bk_option('booking_gcal_auto_import_time', intval($_POST['booking_gcal_auto_import_time'])); // add wpbookingcalendar()->cron->update('wpbc_import_gcal', array('action' => array('wpbc_silent_import_all_events'), 'start_time' => time(), 'recurrence' => intval($_POST['booking_gcal_auto_import_time']))); } else { // delete wpbookingcalendar()->cron->delete('wpbc_import_gcal'); } } $event_fields = wpbc_gcal_get_events_fields_parameters(); $event_fields_array = array(); foreach ($event_fields as $event_fields_key => $event_fields_value) { if (isset($_POST["booking_gcal_events_form_fields_" . $event_fields_key])) { $event_fields_array[$event_fields_key] = $_POST["booking_gcal_events_form_fields_" . $event_fields_key]; } else { $event_fields_array[$event_fields_key] = ''; } } //debuge($event_fields_array, serialize($event_fields_array)); update_bk_option('booking_gcal_events_form_fields', serialize($event_fields_array)); // Hook make_bk_action('wpbc_gcal_settings_content_submit_booking_resources_table'); }
function wpdev_bk_settings_general() { $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, 'only_super_admin'); if ($is_can === false) { return; } if (isset($_POST['start_day_weeek'])) { $booking_skin = $_POST['booking_skin']; // $email_reservation_adress = htmlspecialchars( str_replace('\"','"',$_POST['email_reservation_adress'])); // $email_reservation_adress = str_replace("\'","'",$email_reservation_adress); $bookings_num_per_page = $_POST['bookings_num_per_page']; $booking_sort_order = $_POST['booking_sort_order']; $booking_default_toolbar_tab = $_POST['booking_default_toolbar_tab']; $bookings_listing_default_view_mode = $_POST['bookings_listing_default_view_mode']; $booking_view_days_num = $_POST['booking_view_days_num']; //$booking_sort_order_direction = $_POST['booking_sort_order_direction']; $max_monthes_in_calendar = $_POST['max_monthes_in_calendar']; if (isset($_POST['admin_cal_count'])) { $admin_cal_count = $_POST['admin_cal_count']; } if (isset($_POST['client_cal_count'])) { $client_cal_count = $_POST['client_cal_count']; } $start_day_weeek = $_POST['start_day_weeek']; $new_booking_title = $_POST['new_booking_title']; $new_booking_title_time = $_POST['new_booking_title_time']; $type_of_thank_you_message = $_POST['type_of_thank_you_message']; //get_bk_option( 'booking_type_of_thank_you_message' ); //= 'message'; = 'page'; $thank_you_page_URL = wpbc_make_link_relative($_POST['thank_you_page_URL']); //get_bk_option( 'booking_thank_you_page_URL' ); //= 'message'; = 'page'; $booking_date_format = $_POST['booking_date_format']; $booking_date_view_type = $_POST['booking_date_view_type']; //$is_dif_colors_approval_pending = $_POST['is_dif_colors_approval_pending']; if (isset($_POST['is_use_hints_at_admin_panel'])) { $is_use_hints_at_admin_panel = $_POST['is_use_hints_at_admin_panel']; } $type_of_day_selections = $_POST['type_of_day_selections']; if (isset($_POST['is_delete_if_deactive'])) { $is_delete_if_deactive = $_POST['is_delete_if_deactive']; } // check if (isset($_POST['wpdev_copyright_adminpanel'])) { $wpdev_copyright_adminpanel = $_POST['wpdev_copyright_adminpanel']; } // check if (isset($_POST['booking_is_show_powered_by_notice'])) { $booking_is_show_powered_by_notice = $_POST['booking_is_show_powered_by_notice']; } // check if (isset($_POST['is_use_captcha'])) { $is_use_captcha = $_POST['is_use_captcha']; } // check if (isset($_POST['is_use_autofill_4_logged_user'])) { $is_use_autofill_4_logged_user = $_POST['is_use_autofill_4_logged_user']; } // check if (isset($_POST['unavailable_day0'])) { $unavailable_day0 = $_POST['unavailable_day0']; } if (isset($_POST['unavailable_day1'])) { $unavailable_day1 = $_POST['unavailable_day1']; } if (isset($_POST['unavailable_day2'])) { $unavailable_day2 = $_POST['unavailable_day2']; } if (isset($_POST['unavailable_day3'])) { $unavailable_day3 = $_POST['unavailable_day3']; } if (isset($_POST['unavailable_day4'])) { $unavailable_day4 = $_POST['unavailable_day4']; } if (isset($_POST['unavailable_day5'])) { $unavailable_day5 = $_POST['unavailable_day5']; } if (isset($_POST['unavailable_day6'])) { $unavailable_day6 = $_POST['unavailable_day6']; } if (isset($_POST['user_role_booking'])) { $user_role_booking = $_POST['user_role_booking']; } if (isset($_POST['user_role_addbooking'])) { $user_role_addbooking = $_POST['user_role_addbooking']; } if (isset($_POST['user_role_settings'])) { $booking_user_role_settings = $_POST['user_role_settings']; } if (isset($_POST['user_role_resources'])) { $user_role_resources = $_POST['user_role_resources']; } if (wpdev_bk_is_this_demo()) { $user_role_booking = 'subscriber'; $user_role_addbooking = 'subscriber'; $booking_user_role_settings = 'subscriber'; $user_role_resources = 'subscriber'; } //////////////////////////////////////////////////////////////////////////////////////////////////////////// update_bk_option('booking_user_role_booking', $user_role_booking); update_bk_option('booking_user_role_addbooking', $user_role_addbooking); if (isset($user_role_resources)) { update_bk_option('booking_user_role_resources', $user_role_resources); } update_bk_option('booking_user_role_settings', $booking_user_role_settings); update_bk_option('bookings_num_per_page', $bookings_num_per_page); update_bk_option('booking_sort_order', $booking_sort_order); update_bk_option('booking_default_toolbar_tab', $booking_default_toolbar_tab); update_bk_option('bookings_listing_default_view_mode', $bookings_listing_default_view_mode); update_bk_option('booking_view_days_num', $booking_view_days_num); //update_bk_option( 'booking_sort_order_direction',$booking_sort_order_direction); update_bk_option('booking_skin', $booking_skin); // update_bk_option( 'booking_email_reservation_adress' , $email_reservation_adress ); // // if ( get_bk_version() == 'free' ) { // Update admin from adresses at free version // //update_bk_option( 'booking_email_reservation_from_adress', $email_reservation_adress ); // update_bk_option( 'booking_email_approval_adress', $email_reservation_adress ); // update_bk_option( 'booking_email_deny_adress', $email_reservation_adress ); // } update_bk_option('booking_max_monthes_in_calendar', $max_monthes_in_calendar); if (!isset($admin_cal_count)) { $admin_cal_count = 2; } if (!isset($client_cal_count)) { $client_cal_count = 1; } if (1 * $admin_cal_count > 12) { $admin_cal_count = 12; } if (1 * $admin_cal_count < 1) { $admin_cal_count = 1; } update_bk_option('booking_admin_cal_count', $admin_cal_count); if (1 * $client_cal_count > 12) { $client_cal_count = 12; } if (1 * $client_cal_count < 1) { $client_cal_count = 1; } update_bk_option('booking_client_cal_count', $client_cal_count); update_bk_option('booking_start_day_weeek', $start_day_weeek); update_bk_option('booking_title_after_reservation', $new_booking_title); update_bk_option('booking_title_after_reservation_time', $new_booking_title_time); update_bk_option('booking_type_of_thank_you_message', $type_of_thank_you_message); update_bk_option('booking_thank_you_page_URL', $thank_you_page_URL); update_bk_option('booking_date_format', $booking_date_format); update_bk_option('booking_date_view_type', $booking_date_view_type); // if (isset( $is_dif_colors_approval_pending )) $is_dif_colors_approval_pending = 'On'; // else $is_dif_colors_approval_pending = 'Off'; // update_bk_option( 'booking_dif_colors_approval_pending' , $is_dif_colors_approval_pending ); if (isset($is_use_hints_at_admin_panel)) { $is_use_hints_at_admin_panel = 'On'; } else { $is_use_hints_at_admin_panel = 'Off'; } update_bk_option('booking_is_use_hints_at_admin_panel', $is_use_hints_at_admin_panel); if (!wpdev_bk_is_this_demo()) { // Do not allow to chnage it in the demo if (isset($_POST['is_not_load_bs_script_in_client'])) { $is_not_load_bs_script_in_client = 'On'; } else { $is_not_load_bs_script_in_client = 'Off'; } update_bk_option('booking_is_not_load_bs_script_in_client', $is_not_load_bs_script_in_client); if (isset($_POST['is_not_load_bs_script_in_admin'])) { $is_not_load_bs_script_in_admin = 'On'; } else { $is_not_load_bs_script_in_admin = 'Off'; } update_bk_option('booking_is_not_load_bs_script_in_admin', $is_not_load_bs_script_in_admin); if (isset($_POST['is_load_js_css_on_specific_pages'])) { $is_load_js_css_on_specific_pages = 'On'; } else { $is_load_js_css_on_specific_pages = 'Off'; } update_bk_option('booking_is_load_js_css_on_specific_pages', $is_load_js_css_on_specific_pages); update_bk_option('booking_pages_for_load_js_css', $_POST['booking_pages_for_load_js_css']); $booking_pages_for_load_js_css = get_bk_option('booking_pages_for_load_js_css'); } update_bk_option('booking_type_of_day_selections', $type_of_day_selections); //////////////////////////////////////////////////////////////////////////////////////////////////////////// update_bk_option('booking_is_days_always_available', isset($_POST['booking_is_days_always_available']) ? 'On' : 'Off'); update_bk_option('booking_check_on_server_if_dates_free', isset($_POST['booking_check_on_server_if_dates_free']) ? 'On' : 'Off'); $unavailable_days_num_from_today = $_POST['unavailable_days_num_from_today']; update_bk_option('booking_unavailable_days_num_from_today', $unavailable_days_num_from_today); if (isset($unavailable_day0)) { $unavailable_day0 = 'On'; } else { $unavailable_day0 = 'Off'; } update_bk_option('booking_unavailable_day0', $unavailable_day0); if (isset($unavailable_day1)) { $unavailable_day1 = 'On'; } else { $unavailable_day1 = 'Off'; } update_bk_option('booking_unavailable_day1', $unavailable_day1); if (isset($unavailable_day2)) { $unavailable_day2 = 'On'; } else { $unavailable_day2 = 'Off'; } update_bk_option('booking_unavailable_day2', $unavailable_day2); if (isset($unavailable_day3)) { $unavailable_day3 = 'On'; } else { $unavailable_day3 = 'Off'; } update_bk_option('booking_unavailable_day3', $unavailable_day3); if (isset($unavailable_day4)) { $unavailable_day4 = 'On'; } else { $unavailable_day4 = 'Off'; } update_bk_option('booking_unavailable_day4', $unavailable_day4); if (isset($unavailable_day5)) { $unavailable_day5 = 'On'; } else { $unavailable_day5 = 'Off'; } update_bk_option('booking_unavailable_day5', $unavailable_day5); if (isset($unavailable_day6)) { $unavailable_day6 = 'On'; } else { $unavailable_day6 = 'Off'; } update_bk_option('booking_unavailable_day6', $unavailable_day6); //////////////////////////////////////////////////////////////////////////////////////////////////////////// if (isset($is_delete_if_deactive)) { $is_delete_if_deactive = 'On'; } else { $is_delete_if_deactive = 'Off'; } update_bk_option('booking_is_delete_if_deactive', $is_delete_if_deactive); if (isset($booking_is_show_powered_by_notice)) { $booking_is_show_powered_by_notice = 'On'; } else { $booking_is_show_powered_by_notice = 'Off'; } update_bk_option('booking_is_show_powered_by_notice', $booking_is_show_powered_by_notice); if (isset($wpdev_copyright_adminpanel)) { $wpdev_copyright_adminpanel = 'On'; } else { $wpdev_copyright_adminpanel = 'Off'; } update_bk_option('booking_wpdev_copyright_adminpanel', $wpdev_copyright_adminpanel); //////////////////////////////////////////////////////////////////////////////////////////////////////////// if (isset($is_use_captcha)) { $is_use_captcha = 'On'; } else { $is_use_captcha = 'Off'; } update_bk_option('booking_is_use_captcha', $is_use_captcha); if (isset($is_use_autofill_4_logged_user)) { $is_use_autofill_4_logged_user = '******'; } else { $is_use_autofill_4_logged_user = '******'; } update_bk_option('booking_is_use_autofill_4_logged_user', $is_use_autofill_4_logged_user); //if (isset( $is_show_legend )) $is_show_legend = 'On'; //else $is_show_legend = 'Off'; //update_bk_option( 'booking_is_show_legend' , $is_show_legend ); } else { $booking_skin = get_bk_option('booking_skin'); //$email_reservation_adress = get_bk_option( 'booking_email_reservation_adress') ; $max_monthes_in_calendar = get_bk_option('booking_max_monthes_in_calendar'); $bookings_num_per_page = get_bk_option('bookings_num_per_page'); $booking_sort_order = get_bk_option('booking_sort_order'); $booking_default_toolbar_tab = get_bk_option('booking_default_toolbar_tab'); $bookings_listing_default_view_mode = get_bk_option('bookings_listing_default_view_mode'); $booking_view_days_num = get_bk_option('booking_view_days_num'); //$booking_sort_order_direction = get_bk_option( 'booking_sort_order_direction'); $admin_cal_count = get_bk_option('booking_admin_cal_count'); $new_booking_title = get_bk_option('booking_title_after_reservation'); $new_booking_title_time = get_bk_option('booking_title_after_reservation_time'); $type_of_thank_you_message = get_bk_option('booking_type_of_thank_you_message'); //= 'message'; = 'page'; $thank_you_page_URL = get_bk_option('booking_thank_you_page_URL'); //= 'message'; = 'page'; $booking_date_format = get_bk_option('booking_date_format'); $booking_date_view_type = get_bk_option('booking_date_view_type'); $client_cal_count = get_bk_option('booking_client_cal_count'); $start_day_weeek = get_bk_option('booking_start_day_weeek'); $is_use_hints_at_admin_panel = get_bk_option('booking_is_use_hints_at_admin_panel'); $is_not_load_bs_script_in_client = get_bk_option('booking_is_not_load_bs_script_in_client'); $is_not_load_bs_script_in_admin = get_bk_option('booking_is_not_load_bs_script_in_admin'); $is_load_js_css_on_specific_pages = get_bk_option('booking_is_load_js_css_on_specific_pages'); $booking_pages_for_load_js_css = get_bk_option('booking_pages_for_load_js_css'); $type_of_day_selections = get_bk_option('booking_type_of_day_selections'); $is_delete_if_deactive = get_bk_option('booking_is_delete_if_deactive'); // check $wpdev_copyright_adminpanel = get_bk_option('booking_wpdev_copyright_adminpanel'); // check $booking_is_show_powered_by_notice = get_bk_option('booking_is_show_powered_by_notice'); // check $is_use_captcha = get_bk_option('booking_is_use_captcha'); // check $is_use_autofill_4_logged_user = get_bk_option('booking_is_use_autofill_4_logged_user'); // check $unavailable_days_num_from_today = get_bk_option('booking_unavailable_days_num_from_today'); $unavailable_day0 = get_bk_option('booking_unavailable_day0'); $unavailable_day1 = get_bk_option('booking_unavailable_day1'); $unavailable_day2 = get_bk_option('booking_unavailable_day2'); $unavailable_day3 = get_bk_option('booking_unavailable_day3'); $unavailable_day4 = get_bk_option('booking_unavailable_day4'); $unavailable_day5 = get_bk_option('booking_unavailable_day5'); $unavailable_day6 = get_bk_option('booking_unavailable_day6'); $user_role_booking = get_bk_option('booking_user_role_booking'); $user_role_addbooking = get_bk_option('booking_user_role_addbooking'); $user_role_resources = get_bk_option('booking_user_role_resources'); $booking_user_role_settings = get_bk_option('booking_user_role_settings'); } $booking_is_days_always_available = get_bk_option('booking_is_days_always_available'); $booking_check_on_server_if_dates_free = get_bk_option('booking_check_on_server_if_dates_free'); if (empty($type_of_thank_you_message)) { $type_of_thank_you_message = 'message'; } if (isset($_POST['start_day_weeek'])) { $wpbc = wpbookingcalendar(); if (isset($wpbc->notice)) { $wpbc->notice->show_message(__('Settings saved', 'booking'), 15); } } ?> <div class="clear" style="height:10px;"></div> <div class="wpdevbk-not-now"> <form name="post_option" action="" method="post" id="post_option" class="form-horizontal"> <div class="booking_settings_row" style="width:64%; float:left;margin-right:1%;"> <?php /** ?> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_main'; ?> id="<?php echo $my_close_open_win_id; ?>" class="postbox <?php if ( '1' == get_user_option( 'booking_win_' . $my_close_open_win_id ) ) echo 'closed'; ?>" > <div title="<?php _e('Click to toggle' ,'booking'); ?>" class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?>, '<?php echo $my_close_open_win_id; ?>');"><br></div> <h3 class='hndle'><span><?php _e('Main' ,'booking'); ?></span></h3> <div class="inside"> <table class="form-table"><tbody> <tr valign="top"> <th scope="row"><label for="email_reservation_adress" ><?php _e('Admin email' ,'booking'); ?>:</label></th> <td><input id="email_reservation_adress" name="email_reservation_adress" class="large-text" type="text" value="<?php echo $email_reservation_adress; ?>" /> <p class="description"><?php printf(__('Type default %sadmin email%s for booking confirmation' ,'booking'),'<b>','</b>');?></p> </td> </tr> </tbody></table> </div></div></div><?php /**/ ?> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_calendar'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Calendar', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <tr valign="top"> <th scope="row"><label for="booking_skin" ><?php _e('Calendar Skin', 'booking'); ?> :</label></th> <td> <?php // Check for the skins in the Custom User Skins folderm that do not ovveriden during update of plugin // Exmaple: http://example.com/wp-content/uploads/wpbc_skins/ // User need to create it manually. $upload_dir = wp_upload_dir(); $custom_user_skin_folder = $upload_dir['basedir'] . '/wpbc_skins/'; $dir_list = wpdev_bk_dir_list(array('/css/skins/', '/inc/skins/', $custom_user_skin_folder)); //debuge($dir_list); ?> <select id="booking_skin" name="booking_skin" style="text-transform:capitalize;"> <?php foreach ($dir_list as $value) { $value[1] = str_replace(array(WPDEV_BK_PLUGIN_URL, $upload_dir['basedir']), '', $value[1]); if ($booking_skin == $value[1]) { $selected_item = 'selected="SELECTED"'; } else { $selected_item = ''; } if (strpos(str_replace(array(WPDEV_BK_PLUGIN_URL, $upload_dir['basedir']), '', $booking_skin), $value[0]) !== false) { $selected_item = 'selected="SELECTED"'; } echo '<option ' . $selected_item . ' value="' . $value[1] . '" >' . $value[2] . '</option>'; } ?> </select> <span class="description"><?php _e('Select the skin of the booking calendar', 'booking'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><label for="max_monthes_in_calendar" ><?php _e('Number of months', 'booking'); ?> :</label></th> <td> <select id="max_monthes_in_calendar" name="max_monthes_in_calendar"> <?php for ($mm = 1; $mm < 12; $mm++) { ?> <option <?php if ($max_monthes_in_calendar == $mm . 'm') { echo "selected"; } ?> value="<?php echo $mm; ?> m"><?php echo $mm, ' '; _e('month(s)', 'booking'); ?> </option> <?php } ?> <?php for ($mm = 1; $mm < 11; $mm++) { ?> <option <?php if ($max_monthes_in_calendar == $mm . 'y') { echo "selected"; } ?> value="<?php echo $mm; ?> y"><?php echo $mm, ' '; _e('year(s)', 'booking'); ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select the maximum number of months to show (scroll)', 'booking'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><label for="start_day_weeek" ><?php _e('Start Day of the week', 'booking'); ?> :</label></th> <td> <select id="start_day_weeek" name="start_day_weeek"> <option <?php if ($start_day_weeek == '0') { echo "selected"; } ?> value="0"><?php _e('Sunday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '1') { echo "selected"; } ?> value="1"><?php _e('Monday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '2') { echo "selected"; } ?> value="2"><?php _e('Tuesday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '3') { echo "selected"; } ?> value="3"><?php _e('Wednesday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '4') { echo "selected"; } ?> value="4"><?php _e('Thursday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '5') { echo "selected"; } ?> value="5"><?php _e('Friday', 'booking'); ?> </option> <option <?php if ($start_day_weeek == '6') { echo "selected"; } ?> value="6"><?php _e('Saturday', 'booking'); ?> </option> </select> <span class="description"><?php _e('Select your start day of the week', 'booking'); ?> </span> </td> </tr> <tr valign="top"><td colspan="2" style="padding:10px 0px; "><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"><label for="unavailable_days_num_from_today" ><?php _e('Unavailable days from today', 'booking'); ?> :</label></th> <td> <select id="unavailable_days_num_from_today" name="unavailable_days_num_from_today"> <?php for ($i = 0; $i < 32; $i++) { ?> <option <?php if ($unavailable_days_num_from_today == $i) { echo "selected"; } ?> value="<?php echo $i; ?> "><?php echo $i; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select number of unavailable days in calendar start from today.', 'booking'); ?> </span> </td> </tr> <?php do_action('settings_calendar_unavailable_days'); ?> <tr valign="top"> <th scope="row"><?php _e('Unavailable week days', 'booking'); ?> :</th> <td> <label for="unavailable_day0" class="wpbc-single-checkbox"> <input id="unavailable_day0" name="unavailable_day0" <?php if ($unavailable_day0 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day0; ?> " type="checkbox" /> <?php _e('Sunday', 'booking'); ?> </label> <label for="unavailable_day1" class="wpbc-single-checkbox"> <input id="unavailable_day1" name="unavailable_day1" <?php if ($unavailable_day1 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day1; ?> " type="checkbox" /> <?php _e('Monday', 'booking'); ?> </label> <label for="unavailable_day2" class="wpbc-single-checkbox"> <input id="unavailable_day2" name="unavailable_day2" <?php if ($unavailable_day2 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day2; ?> " type="checkbox" /> <?php _e('Tuesday', 'booking'); ?> </label> <label for="unavailable_day3" class="wpbc-single-checkbox"> <input id="unavailable_day3" name="unavailable_day3" <?php if ($unavailable_day3 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day3; ?> " type="checkbox" /> <?php _e('Wednesday', 'booking'); ?> </label> <label for="unavailable_day4" class="wpbc-single-checkbox"> <input id="unavailable_day4" name="unavailable_day4" <?php if ($unavailable_day4 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day4; ?> " type="checkbox" /> <?php _e('Thursday', 'booking'); ?> </label> <label for="unavailable_day5" class="wpbc-single-checkbox"> <input id="unavailable_day5" name="unavailable_day5" <?php if ($unavailable_day5 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day5; ?> " type="checkbox" /> <?php _e('Friday', 'booking'); ?> </label> <label for="unavailable_day6" class="wpbc-single-checkbox"> <input id="unavailable_day6" name="unavailable_day6" <?php if ($unavailable_day6 == 'On') { echo "checked"; } ?> value="<?php echo $unavailable_day6; ?> " type="checkbox" /> <?php _e('Saturday', 'booking'); ?> </label> <p class="description"><?php _e('Check unavailable days in calendars. This option will overwrite all other settings.', 'booking'); ?> </p> </td> </tr> <?php /* Allow multiple bookings per same day previusly was here */ ?> <tr valign="top"><td colspan="2" style="padding:10px 0px; "><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"><?php _e('Type of days selection in calendar', 'booking'); ?> :</th> <td> <fieldset> <legend class="screen-reader-text"><span><?php _e('Type of days selection', 'booking'); ?> </span></legend> <label for="type_of_day_selections_single"> <input value="single" <?php if ($type_of_day_selections == 'single' || empty($type_of_day_selections)) { echo 'checked="CHECKED"'; } ?> onclick="javascript: jQuery('#togle_settings_range_type_selection').slideUp('normal'); jQuery('.booking_time_advanced_config').slideUp('normal'); if ( jQuery('#range_selection_time_is_active').length > 0 ) { jQuery('#range_selection_time_is_active').attr('checked', false); } if ( jQuery('#booking_recurrent_time').length > 0 ) { jQuery('#booking_recurrent_time').attr('checked', false); } if ( jQuery('#togle_settings_range_times').length > 0 ) { jQuery('#togle_settings_range_times').slideUp('normal'); } if ( jQuery('#togle_settings_availble_for_cehck_in_out').length > 0 ) { jQuery('#togle_settings_availble_for_cehck_in_out').slideUp('normal'); } " name="type_of_day_selections" id="type_of_day_selections_single" type="radio" /> <span><?php _e('Single day', 'booking'); ?> </span> </label><br /> <label for="type_of_day_selections_multiple"> <input value="multiple" <?php if ($type_of_day_selections == 'multiple') { echo 'checked="CHECKED"'; } ?> onclick="javascript: jQuery('#togle_settings_range_type_selection').slideUp('normal'); jQuery('.booking_time_advanced_config').slideDown('normal'); " name="type_of_day_selections" id="type_of_day_selections_multiple" type="radio" /> <span><?php _e('Multiple days', 'booking'); ?> </span> </label><br /> <?php if (class_exists('wpdev_bk_biz_s')) { ?> <label for="type_of_day_selections_range"> <input value="range" <?php if ($type_of_day_selections == 'range') { echo 'checked="CHECKED"'; } ?> onclick="javascript: jQuery('#togle_settings_range_type_selection').slideDown('normal'); jQuery('.booking_time_advanced_config').slideDown('normal'); " name="type_of_day_selections" id="type_of_day_selections_range" type="radio" /> <span><?php _e('Range days', 'booking'); ?> </span> </label> <?php } ?> </fieldset> </td> </tr> <?php do_action('settings_advanced_set_range_selections'); ?> <?php do_action('settings_advanced_set_fixed_time'); ?> <?php if (class_exists('wpdev_bk_biz_s')) { ?> <tr valign="top" class="booking_time_advanced_config" style="<?php if (get_bk_option('booking_type_of_day_selections') == 'single') { echo 'display:none;'; } ?> "> <td colspan="2" style="padding:0px 0px 10px; "><div style="border-bottom:1px solid #cccccc;"></div> </td> </tr> <?php } ?> <?php do_action('settings_set_show_cost_in_tooltips'); ?> <?php do_action('settings_set_show_availability_in_tooltips'); ?> <?php do_action('settings_set_show_time_in_tooltips'); ?> </tbody></table> </div></div></div> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_form'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Form', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <?php // Is using the BootStrap CSS ////////////////////////////////////////////////////////////////////////// if (isset($_POST['start_day_weeek'])) { if (isset($_POST['booking_form_is_using_bs_css'])) { $booking_form_is_using_bs_css = 'On'; } else { $booking_form_is_using_bs_css = 'Off'; } update_bk_option('booking_form_is_using_bs_css', $booking_form_is_using_bs_css); } $booking_form_is_using_bs_css = get_bk_option('booking_form_is_using_bs_css'); ?> <tr valign="top"> <th scope="row"><?php _e('CAPTCHA', 'booking'); ?> :</th> <td><fieldset><label for="is_use_captcha"> <input id="is_use_captcha" type="checkbox" <?php if ($is_use_captcha == 'On') { echo "checked"; } ?> value="<?php echo $is_use_captcha; ?> " name="is_use_captcha"/> <?php _e('Check the box to activate CAPTCHA inside the booking form.', 'booking'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Auto-fill fields', 'booking'); ?> :</th> <td><fieldset><label for="is_use_autofill_4_logged_user" > <input id="is_use_autofill_4_logged_user" type="checkbox" <?php if ($is_use_autofill_4_logged_user == 'On') { echo "checked"; } ?> value="<?php echo $is_use_autofill_4_logged_user; ?> " name="is_use_autofill_4_logged_user"/> <?php _e('Check the box to activate auto-fill form fields for logged in users.', 'booking'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"><?php _e('Use CSS BootStrap', 'booking'); ?> :</th> <td><fieldset><label for="booking_form_is_using_bs_css"> <input type="checkbox" name="booking_form_is_using_bs_css" id="booking_form_is_using_bs_css" <?php if ($booking_form_is_using_bs_css == 'On') { echo ' checked="checked" '; } ?> value="<?php echo $booking_form_is_using_bs_css; ?> " > <?php _e('Using BootStrap CSS for the form fields', 'booking'); ?> </label> </fieldset> <p class="description"><strong><?php _e('Note', 'booking'); ?> :</strong> <?php _e('You must not deactivate loading BootStrap files at advanced section of these settings!', 'booking'); ?> </p> </td> </tr> <?php wpdev_bk_settings_legend_section(); /** ?> <tr valign="top"> <th scope="row"><label for="is_show_legend" ><?php _e('Show legend' ,'booking'); ?>:</label><br><?php _e('at booking calendar' ,'booking'); ?></th> <td><input id="is_show_legend" type="checkbox" <?php if ($is_show_legend == 'On') echo "checked"; ?> value="<?php echo $is_show_legend; ?>" name="is_show_legend"/> <span class="description"> <?php _e('Check this box to display a legend of dates below the booking calendar.' ,'booking');?></span> </td> </tr><?php /**/ ?> <tr valign="top" style="padding: 0px;"> <th scope="row"><?php _e('Action after booking is done', 'booking'); ?> :</th> <td> <fieldset> <label for="type_of_thank_you_message_message"> <input <?php if ($type_of_thank_you_message == 'message') { echo 'checked="checked"'; } /**/ ?> value="message" type="radio" id="type_of_thank_you_message_message" name="type_of_thank_you_message" onclick="javascript: jQuery('#togle_settings_thank-you_page').slideUp('normal');jQuery('#togle_settings_thank-you_message').slideDown('normal');" /> <span><?php _e('Show "Thank You" message', 'booking'); ?> </span> </label><br /> <label for="type_of_thank_you_message_page"> <input <?php if ($type_of_thank_you_message == 'page') { echo 'checked="checked"'; } /**/ ?> value="page" type="radio" id="type_of_thank_you_message_page" name="type_of_thank_you_message" onclick="javascript: jQuery('#togle_settings_thank-you_page').slideDown('normal');jQuery('#togle_settings_thank-you_message').slideUp('normal');" /> <span><?php _e('Redirect visitor to a new "Thank You" page', 'booking'); ?> </span> </label> </fieldset> <?php if (class_exists('wpdev_bk_biz_s')) { ?> <p class="description"><strong><?php _e('Note', 'booking'); ?> :</strong> <?php _e('This action will have no effect, if the payment form(s) is active!', 'booking'); ?> </p> <?php } ?> </td> </tr> <tr valign="top" style="padding: 0px;"><td colspan="2" style="padding:0px;"> <div style="margin: -10px 0 10px 50px;"> <table id="togle_settings_thank-you_message" style="width:100%;<?php if ($type_of_thank_you_message != 'message') { echo 'display:none;'; } /**/ ?> " class="hided_settings_table"> <tr valign="top"> <th><label for="new_booking_title"><?php _e('Message title', 'booking'); ?> :</label></th> <td> <input id="new_booking_title" class="large-text" type="text" value="<?php echo $new_booking_title; ?> " name="new_booking_title" /> <p class="description"><?php printf(__('Type title of message %safter booking has done by user%s', 'booking'), '<b>', '</b>'); ?> </p> </td> </tr> <tr><td colspan="2" style="padding:0px;"><div style="margin-top:-15px;"><?php make_bk_action('show_additional_translation_shortcode_help'); ?> </div></td></tr> <tr> <th><label for="new_booking_title_time"><?php _e('Time of message showing', 'booking'); ?> :</label></th> <td> <input id="new_booking_title_time" class="small-text" type="text" size="45" value="<?php echo $new_booking_title_time; ?> " name="new_booking_title_time" /> <p class="description"><?php printf(__('Set duration of time (milliseconds) to show this message', 'booking'), '<b>', '</b>'); ?> </p> </td> </tr> </table> <table id="togle_settings_thank-you_page" style="width:100%;<?php if ($type_of_thank_you_message != 'page') { echo 'display:none;'; } /**/ ?> " class="hided_settings_table"> <tr valign="top"> <th scope="row"><label for="thank_you_page_URL" ><?php _e('URL of "thank you" page', 'booking'); ?> :</label></th> <td> <fieldset> <code style="font-size:14px;"><?php echo get_option('siteurl'); ?> </code><input value="<?php echo $thank_you_page_URL; ?> " name="thank_you_page_URL" id="thank_you_page_URL" class="large-text" type="text" /> </fieldset> <p class="description"><?php printf(__('Type URL of %s"Thank You" page%s', 'booking'), '<b>', '</b>'); ?> </p> </td> </tr> </table> </div> </td></tr> </tbody></table> </div></div></div> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_bktable'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Listing of bookings', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <tr valign="top"> <th scope="row"><label for="bookings_listing_default_view_mode" ><?php _e('Default booking admin page', 'booking'); ?> :</label></th> <td> <?php $wpdevbk_selectors = array(__('Bookings Listing', 'booking') => 'vm_listing', __('Calendar Overview', 'booking') => 'vm_calendar'); ?> <select id="bookings_listing_default_view_mode" name="bookings_listing_default_view_mode"> <?php foreach ($wpdevbk_selectors as $kk => $mm) { ?> <option <?php if ($bookings_listing_default_view_mode == strtolower($mm)) { echo "selected"; } ?> value="<?php echo strtolower($mm); ?> "><?php echo $kk; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select your default view mode of bookings at the booking listing page', 'booking'); ?> </span> </td> </tr> <?php make_bk_action('wpdev_bk_general_settings_set_default_booking_resource'); ?> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"><label for="booking_view_days_num" ><?php _e('Default calendar view mode', 'booking'); ?> :</label></th> <td><?php if (class_exists('wpdev_bk_personal')) { $wpdevbk_selectors = array(__('Day', 'booking') => '1', __('Week', 'booking') => '7', __('Month', 'booking') => '30', __('2 Months', 'booking') => '60', __('3 Months', 'booking') => '90', __('Year', 'booking') => '365'); } else { $wpdevbk_selectors = array(__('Month', 'booking') => '30', __('3 Months', 'booking') => '90', __('Year', 'booking') => '365'); } ?> <select id="booking_view_days_num" name="booking_view_days_num" onfocus="javascript:wpdev_bk_recheck_disabled_options();"> <?php foreach ($wpdevbk_selectors as $kk => $mm) { ?> <option <?php if ($booking_view_days_num == strtolower($mm)) { echo "selected"; } ?> value="<?php echo strtolower($mm); ?> "><?php echo $kk; ?> </option> <?php } ?> </select> <script type="text/javascript"> // Set the correct value of this selectbox, depend from the Matrix or Single Calendar Overview function wpdev_bk_recheck_disabled_options() { if ( jQuery('#default_booking_resource').length>0 ) { jQuery('#default_booking_resource').bind('change', function() { jQuery('#booking_view_days_num option:eq(2)').prop("selected", true); }); if ( jQuery('#default_booking_resource').val() == '' ) { //All resources selected jQuery('#booking_view_days_num option:eq(0)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(1)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(2)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(3)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(4)').prop("disabled", true); jQuery('#booking_view_days_num option:eq(5)').prop("disabled", true); } else { jQuery('#booking_view_days_num option:eq(0)').prop("disabled", true); jQuery('#booking_view_days_num option:eq(1)').prop("disabled", true); jQuery('#booking_view_days_num option:eq(2)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(3)').prop("disabled", true); jQuery('#booking_view_days_num option:eq(4)').prop("disabled", false); jQuery('#booking_view_days_num option:eq(5)').prop("disabled", false); } } } </script> <span class="description"><?php _e('Select your default calendar view mode at booking calendar overview page', 'booking'); ?> </span> </td> </tr> <?php make_bk_action('wpdev_bk_general_settings_set_default_title_in_day'); ?> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"><label for="booking_default_toolbar_tab" ><?php _e('Default toolbar tab', 'booking'); ?> :</label></th> <td> <?php $wpdevbk_selectors = array(__('Filter tab', 'booking') => 'filter', __('Actions tab', 'booking') => 'actions'); ?> <select id="booking_default_toolbar_tab" name="booking_default_toolbar_tab"> <?php foreach ($wpdevbk_selectors as $kk => $mm) { ?> <option <?php if ($booking_default_toolbar_tab == strtolower($mm)) { echo "selected"; } ?> value="<?php echo strtolower($mm); ?> "><?php echo $kk; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select your default opened tab in toolbar at booking listing page', 'booking'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><label for="bookings_num_per_page" ><?php _e('Bookings number per page', 'booking'); ?> :</label></th> <td> <?php $order_array = array(5, 10, 20, 25, 50, 75, 100); ?> <select id="bookings_num_per_page" name="bookings_num_per_page"> <?php foreach ($order_array as $mm) { ?> <option <?php if ($bookings_num_per_page == strtolower($mm)) { echo "selected"; } ?> value="<?php echo strtolower($mm); ?> "><?php echo $mm; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select number of bookings per page in booking listing', 'booking'); ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><label for="booking_sort_order" ><?php _e('Bookings default order', 'booking'); ?> :</label></th> <td><?php $order_array = array('ID'); $wpdevbk_selectors = array(__('ID', 'booking') . ' ' . __('ASC', 'booking') => '', __('ID', 'booking') . ' ' . __('DESC', 'booking') => 'booking_id_asc', __('Dates', 'booking') . ' ' . __('ASC', 'booking') => 'sort_date', __('Dates', 'booking') . ' ' . __('DESC', 'booking') => 'sort_date_asc'); if (class_exists('wpdev_bk_personal')) { $order_array[] = 'Resource'; $wpdevbk_selectors[__('Resource', 'booking') . ' ' . __('ASC', 'booking')] = 'booking_type'; $wpdevbk_selectors[__('Resource', 'booking') . ' ' . __('DESC', 'booking')] = 'booking_type_asc'; } if (class_exists('wpdev_bk_biz_s')) { $order_array[] = 'Cost'; $wpdevbk_selectors[__('Cost', 'booking') . ' ' . __('ASC', 'booking')] = 'cost'; $wpdevbk_selectors[__('Cost', 'booking') . ' ' . __('DESC', 'booking')] = 'cost_asc'; } ?> <select id="booking_sort_order" name="booking_sort_order"> <?php foreach ($wpdevbk_selectors as $kk => $mm) { ?> <option <?php if ($booking_sort_order == strtolower($mm)) { echo "selected"; } ?> value="<?php echo strtolower($mm); ?> "><?php echo $kk; ?> </option> <?php } ?> </select> <span class="description"><?php _e('Select your default order of bookings in the booking listing', 'booking'); ?> </span> </td> </tr> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <?php make_bk_action('wpdev_bk_general_settings_export_data_separator'); if (class_exists('wpdev_bk_personal')) { ?> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr><?php } ?> <tr valign="top"> <th scope="row"><label for="booking_date_format" ><?php _e('Date Format', 'booking'); ?> :</label></th> <td> <fieldset> <?php $date_formats = array(__('F j, Y'), 'Y/m/d', 'm/d/Y', 'd/m/Y'); $custom = TRUE; foreach ($date_formats as $format) { echo "\t<label title='" . esc_attr($format) . "'>"; echo "<input type='radio' name='booking_date_format' value='" . esc_attr($format) . "'"; if (get_bk_option('booking_date_format') === $format) { echo " checked='checked'"; $custom = FALSE; } echo ' /> ' . date_i18n($format) . "</label> \n"; } echo '<div style="height:7px;"></div>'; echo '<label><input type="radio" name="booking_date_format" id="date_format_custom_radio" value="' . $booking_date_format . '"'; if ($custom) { echo ' checked="checked"'; } echo '/> ' . __('Custom', 'booking') . ': </label>'; ?> <input id="booking_date_format_custom" class="regular-text" type="text" size="45" value="<?php echo $booking_date_format; ?> " name="booking_date_format_custom" style="line-height:35px;" onchange="javascript:document.getElementById('date_format_custom_radio').value = this.value;document.getElementById('date_format_custom_radio').checked=true;" /> <?php echo ' ' . date_i18n($booking_date_format) . "\n"; echo ' '; ?> <p class="description"><?php printf(__('Type your date format for emails and the booking table. %sDocumentation on date formatting%s', 'booking'), '<a href="http://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">', '</a>'); ?> </p> </fieldset> </td> </tr> <?php do_action('settings_advanced_set_time_format'); ?> <tr valign="top"> <th scope="row"><label for="booking_date_view_type" ><?php _e('Dates view', 'booking'); ?> :</label></th> <td> <select id="booking_date_view_type" name="booking_date_view_type"> <option <?php if ($booking_date_view_type == 'short') { echo "selected"; } ?> value="short"><?php _e('Short days view', 'booking'); ?> </option> <option <?php if ($booking_date_view_type == 'wide') { echo "selected"; } ?> value="wide"><?php _e('Wide days view', 'booking'); ?> </option> </select> <span class="description"><?php _e('Select the default view for dates on the booking tables', 'booking'); ?> </span> </td> </tr> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"> <?php _e('Show / hide hints', 'booking'); ?> : </th> <td> <fieldset> <label for="is_use_hints_at_admin_panel" > <input id="is_use_hints_at_admin_panel" type="checkbox" <?php if ($is_use_hints_at_admin_panel == 'On') { echo "checked"; } ?> value="<?php echo $is_use_hints_at_admin_panel; ?> " name="is_use_hints_at_admin_panel"/> <?php _e('Check this box if you want to show help hints on the admin panel.', 'booking'); ?> </label> </fieldset> </td> </tr> </tbody></table> </div></div></div> <?php make_bk_action('wpdev_bk_general_settings_cost_section'); ?> <?php make_bk_action('wpdev_bk_general_settings_pending_auto_cancelation'); ?> <div class='meta-box'> <?php /* // Closed by default ?><div <?php $my_close_open_win_id = 'bk_settings_resources_advanced_options'; ?> id="<?php echo $my_close_open_win_id; ?>" class="postbox <?php if ( '0' !== get_user_option( 'booking_win_' . $my_close_open_win_id ) ) echo 'closed'; ?>" > <div title="<?php _e('Click to toggle' ,'booking'); ?>" class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?>, '<?php echo $my_close_open_win_id; ?>');"><br></div> <?php /**/ ?> <div <?php $my_close_open_win_id = 'bk_settings_resources_advanced_options'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Advanced', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <?php make_bk_action('wpdev_bk_general_settings_edit_booking_url'); ?> <?php do_action('settings_advanced_set_update_hash_after_approve'); ?> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <th scope="row"><?php $show_untill_version_update = '5.4'; $wpbc_settings_element = 'dismiss_new_booking_check_on_server_if_dates_free'; if (version_compare(WP_BK_VERSION_NUM, $show_untill_version_update) < 0 && '1' != get_user_option('booking_win_' . $wpbc_settings_element)) { ?> <div id="<?php echo $wpbc_settings_element; ?> " class="new-label clearfix-height new-label-settings"><a class="tooltip_bottom" data-original-title="<?php _e('Hide', 'booking'); ?> " rel="tooltip" href="javascript:void(0)" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $wpbc_settings_element; ?> ');jQuery('#<?php echo $wpbc_settings_element; ?> ').hide();" ><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /img/label_new_blue.png" style="width:24px; height:24px;"></a></div><?php } /**/ ?> <?php _e('Checking to prevent double booking, during submitting booking', 'booking'); ?> :</th> <td> <fieldset> <label for="booking_check_on_server_if_dates_free" > <input <?php if ($booking_check_on_server_if_dates_free == 'On') { echo "checked"; } ?> value="<?php echo $booking_check_on_server_if_dates_free; ?> " type="checkbox" name="booking_check_on_server_if_dates_free" id="booking_check_on_server_if_dates_free" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("This feature can impact to speed of submitting booking. Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; jQuery('#booking_is_days_always_available').prop('checked', false ); } else {this.checked = false;} }" /> <?php printf(__('Check this box, if you want to %sre-check if the selected dates available during submitting booking%s.', 'booking'), '<strong>', '</strong>', '<strong>', '</strong>'); ?> </label> </fieldset> <span class="description" style="padding:0;"><strong><?php _e('Note', 'booking'); ?> !</strong> <?php _e('This feature useful to prevent double booking of the same date(s) or time(s), if several visitors try to book the same date(s) in same calendar during the same time.', 'booking'); if (class_exists('wpdev_bk_biz_l')) { echo ' '; _e('This feature does not work for booking resources with capacity higher than one.', 'booking'); } ?> </span> </td> </tr> <tr valign="top"> <th scope="row"><?php /* $show_untill_version_update = '5.3'; $wpbc_settings_element = 'dismiss_new_booking_is_days_always_available'; if ( ( version_compare(WP_BK_VERSION_NUM, $show_untill_version_update ) < 0 ) && ( '1' != get_user_option( 'booking_win_' . $wpbc_settings_element ) ) ) { ?><div id="<?php echo $wpbc_settings_element; ?>" class="new-label clearfix-height new-label-settings"><a class="tooltip_bottom" data-original-title="<?php _e('Hide' ,'booking'); ?>" rel="tooltip" href="javascript:void(0)" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?>, '<?php echo $wpbc_settings_element; ?>');jQuery('#<?php echo $wpbc_settings_element; ?>').hide();" ><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/label_new_blue.png" style="width:24px; height:24px;"></a></div><?php } */ ?> <?php _e('Allow unlimited bookings per same day(s)', 'booking'); ?> :</th> <td> <fieldset> <label for="booking_is_days_always_available" > <input <?php if ($booking_is_days_always_available == 'On') { echo "checked"; } ?> value="<?php echo $booking_is_days_always_available; ?> " type="checkbox" name="booking_is_days_always_available" id="booking_is_days_always_available" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("You allow unlimited number of bookings per same dates, its can be a reason of double bookings on the same date. Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; jQuery('#booking_check_on_server_if_dates_free').prop('checked', false );jQuery('#booking_is_show_pending_days_as_available').prop('checked', false );jQuery('#togle_settings_show_pending_days_as_available').slideUp('normal'); } else {this.checked = false;} }" /> <?php printf(__('Check this box, if you want to %sset any days as available%s in calendar. Your visitors will be able to make %sunlimited bookings per same date(s) in calendar and do not see any booked date(s)%s of other visitors.', 'booking'), '<strong>', '</strong>', '<strong>', '</strong>'); ?> </label> </fieldset> </td> </tr> <?php do_action('wpdev_bk_general_settings_advanced_section'); ?> <tr valign="top"><td colspan="2"><div style="border-bottom:1px solid #cccccc;"></div></td></tr> <tr valign="top"> <td colspan="2"> <div style="width:100%;"> <span style="color:#21759B;cursor: pointer;font-weight: bold;" onclick="javascript: jQuery('#togle_settings_javascriptloading').slideToggle('normal');jQuery('.bk_show_advanced_settings_js').toggle('normal');" style="text-decoration: none;font-weight: bold;font-size: 11px;"> <span class="bk_show_advanced_settings_js">+ <span style="border-bottom:1px dashed #21759B;"><?php _e('Show advanced settings of JavaScript loading', 'booking'); ?> </span></span> <span class="bk_show_advanced_settings_js" style="display:none;">- <span style="border-bottom:1px dashed #21759B;"><?php _e('Hide advanced settings of JavaScript loading', 'booking'); ?> </span></span> </span> </div> <table id="togle_settings_javascriptloading" style="display:none;" class="hided_settings_table"> <tr valign="top"> <th scope="row"> <?php _e('Disable Bootstrap loading on Front-End', 'booking'); ?> : </th> <td> <fieldset> <label for="is_not_load_bs_script_in_client" > <input id="is_not_load_bs_script_in_client" type="checkbox" <?php if ($is_not_load_bs_script_in_client == 'On') { echo "checked"; } ?> value="<?php echo $is_not_load_bs_script_in_client; ?> " name="is_not_load_bs_script_in_client" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; } else {this.checked = false;} }" /> <?php _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can disable loading of this script by this plugin.', 'booking'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"> <?php _e('Disable Bootstrap loading on Back-End', 'booking'); ?> : </th> <td> <fieldset> <label for="is_not_load_bs_script_in_admin" > <input id="is_not_load_bs_script_in_admin" type="checkbox" <?php if ($is_not_load_bs_script_in_admin == 'On') { echo "checked"; } ?> value="<?php echo $is_not_load_bs_script_in_admin; ?> " name="is_not_load_bs_script_in_admin" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; } else {this.checked = false;} }" /> <?php _e(' If your theme or some other plugin is load the BootStrap JavaScripts, you can disable loading of this script by this plugin.', 'booking'); ?> </label> </fieldset> </td> </tr> <tr valign="top" style="border-top:1px solid #ccc;"> <th scope="row"> <?php /* $show_untill_version_update = '5.5'; $wpbc_settings_element = 'dismiss_new_booking_is_load_js_css_on_specific_pages'; if ( ( version_compare(WP_BK_VERSION_NUM, $show_untill_version_update ) < 0 ) && ( '1' != get_user_option( 'booking_win_' . $wpbc_settings_element ) ) ) { ?><div id="<?php echo $wpbc_settings_element; ?>" class="new-label clearfix-height new-label-settings"><a class="tooltip_bottom" data-original-title="<?php _e('Hide' ,'booking'); ?>" rel="tooltip" href="javascript:void(0)" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?>, '<?php echo $wpbc_settings_element; ?>');jQuery('#<?php echo $wpbc_settings_element; ?>').hide();" ><img src="<?php echo WPDEV_BK_PLUGIN_URL; ?>/img/label_new_blue.png" style="width:24px; height:24px;"></a></div><?php } /**/ ?> <?php _e('Load JS and CSS files only on specific pages', 'booking'); ?> : </th> <td> <fieldset> <label for="is_load_js_css_on_specific_pages" > <input id="is_load_js_css_on_specific_pages" type="checkbox" <?php if ($is_load_js_css_on_specific_pages == 'On') { echo "checked"; } ?> value="<?php echo $is_load_js_css_on_specific_pages; ?> " name="is_load_js_css_on_specific_pages" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; jQuery('#togle_settings_load_js_css_on_specific_pages').slideDown('normal'); } else {this.checked = false; } } else { jQuery('#togle_settings_load_js_css_on_specific_pages').slideUp('normal'); }" /> <?php _e('Activate loading of CSS and JavaScript files of plugin only at specific pages.', 'booking'); ?> </label> </fieldset> </td> </tr> <tr valign="top" style="padding: 0px;"><td colspan="2" style="padding:0px;"> <div style="margin: -10px 0 10px 50px;"> <?php if (wpdev_bk_is_this_demo()) { ?> <div class="wpbc-error-message" style="text-align:left;"> <span class="wpbc-demo-alert-not-allow"><strong>Warning!</strong> Demo test version does not allow changes to these items.</span></div> <?php } ?> <table id="togle_settings_load_js_css_on_specific_pages" style="width:100%;<?php if ($is_load_js_css_on_specific_pages != 'On') { echo 'display:none;'; } /**/ ?> " class="hided_settings_table"> <tr valign="top" colspan="2"> <th><label for="booking_pages_for_load_js_css"><?php _e('Relative URLs of pages, where to load plugin CSS and JS files', 'booking'); ?> :</label></th> </tr> <tr> <td colspan="2"> <textarea id="booking_pages_for_load_js_css" name="booking_pages_for_load_js_css" style="width:100%;" rows="5" ><?php echo $booking_pages_for_load_js_css; ?> </textarea> <p class="description"><?php printf(__('Enter relative URLs of pages, where you have Booking Calendar elements (booking forms or availability calendars). Please enter one URL per line. Example: %s', 'booking'), '<code>/booking-form/</code>'); ?> </p> </td> </tr> </table> </div> </td></tr> </table> </td></tr> <tr valign="top"> <td colspan="2"> <div style="width:100%;"> <span style="color:#21759B;cursor: pointer;font-weight: bold;" onclick="javascript: jQuery('.bk_show_advanced_settings_powered').toggle('normal'); jQuery('#togle_settings_powered').slideToggle('normal');" style="text-decoration: none;font-weight: bold;font-size: 11px;"> <span class="bk_show_advanced_settings_powered">+ <span style="border-bottom:1px dashed #21759B;"><?php _e('Show settings of powered by notice', 'booking'); ?> </span></span> <span class="bk_show_advanced_settings_powered" style="display:none;">- <span style="border-bottom:1px dashed #21759B;"><?php _e('Hide settings of powered by notice', 'booking'); ?> </span></span> </span> </div> <table id="togle_settings_powered" style="display:none;" class="hided_settings_table"> <tr valign="top"> <th scope="row"> <?php _e('Powered by notice', 'booking'); ?> :</th> <td> <fieldset> <label for="booking_is_show_powered_by_notice" > <input id="booking_is_show_powered_by_notice" type="checkbox" <?php if ($booking_is_show_powered_by_notice == 'On') { echo "checked"; } ?> value="<?php echo $booking_is_show_powered_by_notice; ?> " name="booking_is_show_powered_by_notice"/> <?php printf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.', 'booking'), 'wpbookingcalendar.com'); ?> </label> </fieldset> </td> </tr> <tr valign="top"> <th scope="row"> <?php _e('Help and info notices', 'booking'); ?> : </th> <td> <fieldset> <label for="wpdev_copyright_adminpanel" > <input id="wpdev_copyright_adminpanel" type="checkbox" <?php if ($wpdev_copyright_adminpanel == 'On') { echo "checked"; } ?> value="<?php echo $wpdev_copyright_adminpanel; ?> " name="wpdev_copyright_adminpanel"/> <?php printf(__(' Turn On/Off version notice and help info links at booking admin panel.', 'booking'), 'wpbookingcalendar.com'); ?> </label> </fieldset> </td> </tr> </table> </td></tr> </tbody></table> </div> </div> </div> </div> <div class="booking_settings_row" style="width:35%; float:left;"> <?php $version = get_bk_version(); if (wpdev_bk_is_this_demo()) { $version = 'free'; } //if ( ($version !== 'free') && ($version!== 'biz_l') ) { wpdev_bk_upgrade_window($version); } ?> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_info'; ?> id="<?php echo $my_close_open_win_id; ?> " class="gdrgrid postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Information', 'booking'); ?> </span></h3> <div class="inside"> <?php make_bk_action('dashboard_bk_widget_show'); ?> </div> </div> </div> <?php /* if ( (!class_exists('wpdev_crm')) && ($version != 'free') ){ ?> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_recomended_plugins'; ?> id="<?php echo $my_close_open_win_id; ?>" class="gdrgrid postbox <?php if ( '1' == get_user_option( 'booking_win_' . $my_close_open_win_id ) ) echo 'closed'; ?>" > <div title="<?php _e('Click to toggle' ,'booking'); ?>" class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?>, '<?php echo $my_close_open_win_id; ?>');"><br></div> <h3 class='hndle'><span><?php _e('Recommended WordPress Plugins' ,'booking'); ?></span></h3> <div class="inside"> <h2 style="margin:10px;"><?php _e('Booking Manager - show all old bookings'); ?> </h2> <p style="margin:0px;"> <?php printf(__('This wordpress plugin is %sshow all approved and pending bookings from past%s. Show how many each customer is made bookings. Paid versions support %sexport to CSV, print layout, advanced filter%s. ' ,'booking'),'<strong>','</strong>','<strong>','</strong>'); ?> <br/> </p> <p style="text-align:center;padding:10px 0px;"> <a href="https://wordpress.org/plugins/booking-manager" class="button-primary" target="_blank">Download from wordpress</a> <a href="http://wpbookingmanager.com" class="button-primary" target="_blank">Demo site</a> </p> </div> </div> </div> <?php } */ ?> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_users_permissions'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('User permissions for plugin menu pages', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <tr valign="top"> <th scope="row"><label for="user_role_booking" ><?php _e('Bookings', 'booking'); ?> :</label></th> <td> <select id="user_role_booking" name="user_role_booking"> <option <?php if ($user_role_booking == 'subscriber') { echo "selected"; } ?> value="subscriber" ><?php echo translate_user_role('Subscriber'); ?> </option> <option <?php if ($user_role_booking == 'administrator') { echo "selected"; } ?> value="administrator" ><?php echo translate_user_role('Administrator'); ?> </option> <option <?php if ($user_role_booking == 'editor') { echo "selected"; } ?> value="editor" ><?php echo translate_user_role('Editor'); ?> </option> <option <?php if ($user_role_booking == 'author') { echo "selected"; } ?> value="author" ><?php echo translate_user_role('Author'); ?> </option> <option <?php if ($user_role_booking == 'contributor') { echo "selected"; } ?> value="contributor" ><?php echo translate_user_role('Contributor'); ?> </option> </select> </td> </tr> <tr valign="top"> <th scope="row"><label for="user_role_addbooking" ><?php _e('Add booking', 'booking'); ?> :</label></th> <td> <select id="user_role_addbooking" name="user_role_addbooking"> <option <?php if ($user_role_addbooking == 'subscriber') { echo "selected"; } ?> value="subscriber" ><?php echo translate_user_role('Subscriber'); ?> </option> <option <?php if ($user_role_addbooking == 'administrator') { echo "selected"; } ?> value="administrator" ><?php echo translate_user_role('Administrator'); ?> </option> <option <?php if ($user_role_addbooking == 'editor') { echo "selected"; } ?> value="editor" ><?php echo translate_user_role('Editor'); ?> </option> <option <?php if ($user_role_addbooking == 'author') { echo "selected"; } ?> value="author" ><?php echo translate_user_role('Author'); ?> </option> <option <?php if ($user_role_addbooking == 'contributor') { echo "selected"; } ?> value="contributor" ><?php echo translate_user_role('Contributor'); ?> </option> </select> </td> </tr> <?php if ($version !== 'free') { ?> <tr valign="top"> <th scope="row"><label for="user_role_resources" ><?php _e('Resources', 'booking'); ?> :</label></th> <td> <select id="user_role_resources" name="user_role_resources"> <option <?php if ($user_role_resources == 'subscriber') { echo "selected"; } ?> value="subscriber" ><?php echo translate_user_role('Subscriber'); ?> </option> <option <?php if ($user_role_resources == 'administrator') { echo "selected"; } ?> value="administrator" ><?php echo translate_user_role('Administrator'); ?> </option> <option <?php if ($user_role_resources == 'editor') { echo "selected"; } ?> value="editor" ><?php echo translate_user_role('Editor'); ?> </option> <option <?php if ($user_role_resources == 'author') { echo "selected"; } ?> value="author" ><?php echo translate_user_role('Author'); ?> </option> <option <?php if ($user_role_resources == 'contributor') { echo "selected"; } ?> value="contributor" ><?php echo translate_user_role('Contributor'); ?> </option> </select> </td> </tr> <?php } ?> <tr valign="top"> <th scope="row"><label for="user_role_settings" ><?php _e('Settings', 'booking'); ?> :</label></th> <td> <select id="user_role_settings" name="user_role_settings"> <option <?php if ($booking_user_role_settings == 'subscriber') { echo "selected"; } ?> value="subscriber" ><?php echo translate_user_role('Subscriber'); ?> </option> <option <?php if ($booking_user_role_settings == 'administrator') { echo "selected"; } ?> value="administrator" ><?php echo translate_user_role('Administrator'); ?> </option> <option <?php if ($booking_user_role_settings == 'editor') { echo "selected"; } ?> value="editor" ><?php echo translate_user_role('Editor'); ?> </option> <option <?php if ($booking_user_role_settings == 'author') { echo "selected"; } ?> value="author" ><?php echo translate_user_role('Author'); ?> </option> <option <?php if ($booking_user_role_settings == 'contributor') { echo "selected"; } ?> value="contributor" ><?php echo translate_user_role('Contributor'); ?> </option> </select> </td> </tr> <tr valign="top"> <td colspan="2"> <?php if (wpdev_bk_is_this_demo()) { ?> <div class="wpbc-error-message" style="text-align:left;"> <span class="wpbc-demo-alert-not-allow"><strong>Warning!</strong> Demo test version does not allow changes to these items.</span></div> <?php } ?> <p class="description"><?php _e('Select user access level for the menu pages of plugin', 'booking'); ?> </p> </td> </tr> </tbody></table> </div></div></div> <div class='meta-box'> <div <?php $my_close_open_win_id = 'bk_general_settings_uninstall'; ?> id="<?php echo $my_close_open_win_id; ?> " class="postbox <?php if ('1' == get_user_option('booking_win_' . $my_close_open_win_id)) { echo 'closed'; } ?> " > <div title="<?php _e('Click to toggle', 'booking'); ?> " class="handlediv" onclick="javascript:verify_window_opening(<?php echo get_bk_current_user_id(); ?> , '<?php echo $my_close_open_win_id; ?> ');"><br></div> <h3 class='hndle'><span><?php _e('Uninstall / deactivation', 'booking'); ?> </span></h3> <div class="inside"> <table class="form-table"><tbody> <tr valign="top"> <th scope="row"><?php _e('Delete booking data, when plugin deactivated', 'booking'); ?> :</th> <td> <fieldset> <label for="is_delete_if_deactive"> <input id="is_delete_if_deactive" type="checkbox" <?php if ($is_delete_if_deactive == 'On') { echo "checked"; } ?> value="<?php echo $is_delete_if_deactive; ?> " name="is_delete_if_deactive" onclick="javascript: if (this.checked) { var answer = confirm('<?php _e('Warning', 'booking'); echo '! '; _e("If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?", 'booking'); ?> '); if ( answer){ this.checked = true; } else {this.checked = false;} }" /> <?php _e('Check this box to delete all booking data when you uninstal this plugin.', 'booking'); ?> </label> </fieldset> </td> </tr> </tbody></table> </div></div></div> <?php make_bk_action('wpdev_booking_technical_booking_section'); ?> </div> <div class="clear" style="height:10px;"></div> <input class="button-primary button" style="float:right;" type="submit" value="<?php _e('Save Changes', 'booking'); ?> " name="Submit"/> <div class="clear" style="height:10px;"></div> </form> </div> <?php }
} require_once WPDEV_BK_PLUGIN_DIR . '/lib/wpbc-ajax.php'; // NT - Ajax } else { // Usual Loading of plugin // We are having Response, its executed in other file: wpbc-response.php if (WP_BK_RESPONSE) { return; } if (is_admin()) { // Define Notices System self::$instance->notice = new WPBC_Notices(); } // Normal Start $wpdev_bk = new wpdev_booking(); // GO // Cron Jobs ..... ///////////////////////////////////////////////// self::$instance->cron = new WPBC_Cron(); //////////////////////////////////////////////////////////////////// } } } } // Get Instance of Booking Calendar CLASS function wpbookingcalendar() { return Booking_Calendar::getInstance(); } // Start wpbookingcalendar();