Beispiel #1
0
function wpdevbk_show_booking_page()
{
    wpbc_welcome_panel();
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Get from SETTINGS (if its not set in request yet) the "tab"  & "view_mode" and set to $_REQUEST
    // If we have the "saved" filter set so LOAD it and set to REQUEST, if REQUEST was not set previously
    // & skip "wh_booking_type" from the saved filter set
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    wpdevbk_get_default_bk_listing_filter_set_to_params('default');
    // Get saved filters set        DONE!
    //debuge($_REQUEST);
    // Setting $_REQUEST['wh_booking_type']
    if (function_exists('wpdevbk_check_wh_booking_type_param_in_request')) {
        wpdevbk_check_wh_booking_type_param_in_request();
    }
    // DONE!
    // If  "wh_booking_type" is not set, and current user  is not superadmin, then set to  - $_REQUEST['wh_booking_type'] - booking resource from regular user
    make_bk_action('check_for_resources_of_notsuperadmin_in_booking_listing');
    // DONE!
    wpdevbk_booking_view_mode_buttons();
    // Show switch calendar/listing buttons DONE!
    //debuge($_REQUEST);
    switch ($_REQUEST['view_mode']) {
        case 'vm_calendar':
            // vm_calendar
            bookings_overview_in_calendar();
            break;
        default:
            // vm_listing
            wpdevbk_show_booking_listings();
    }
    wpdevbk_booking_listing_write_js();
    // Wtite inline  JS
    wpdevbk_booking_listing_write_css();
    // Write inline  CSS
}
        function content_of_booking_page_OLD()
        {
            // Check if this user ACTIVE and can be at this page in MultiUser version
            $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, 'check_for_active_users');
            if (!$is_can) {
                return false;
            }
            // Get default Booking Resource, if not its not set in GET parameter
            if (!isset($_GET['booking_type'])) {
                $default_booking_resource = get_bk_option('booking_default_booking_resource');
                if (isset($default_booking_resource) && $default_booking_resource !== false) {
                    $_GET['booking_type'] = $default_booking_resource;
                    make_bk_action('check_if_bk_res_parent_with_childs_set_parent_res', $default_booking_resource);
                    // Check if this resource parent and has some additional childs if so then assign to parent_res=1
                }
            }
            // Check if User can be here in MultiUser version for this booking resource (is this user owner of this resource or not)
            if (isset($_GET['booking_type'])) {
                $is_can = apply_bk_filter('multiuser_is_user_can_be_here', true, $_GET['booking_type']);
                if (!$is_can) {
                    return;
                }
            } else {
                if (class_exists('wpdev_bk_multiuser')) {
                    // If MultiUser so
                    $bk_multiuser = apply_bk_filter('get_default_bk_resource_for_user', false);
                    if ($bk_multiuser == false) {
                        return;
                    }
                }
            }
            // Booking listing
            ?>
 <div class="wpdevbk">
                <div id="ajax_working"></div>
                <div class="clear" style="height:1px;"></div>
                <div id="ajax_respond"></div>
                <?php 
            make_bk_action('write_content_for_popups');
            //debugq();
            wpdevbk_show_booking_listings();
            //debugq();
            ?>
               </div><?php 
        }