custom_day_schedule_form.php
1 year ago
default_form_fields.php
1 year ago
general.php
4 days ago
generate_instant_booking_page.php
1 year ago
get_pro.php
1 year ago
import_modal.php
1 year ago
notifications.php
1 year ago
pages.php
1 year ago
payments.php
1 year ago
premium_modal.php
1 year ago
steps_order_modal.php
5 months ago
version_5_intro.php
1 year ago
work_periods.php
1 year ago
generate_instant_booking_page.php
81 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @var $agents OsAgentModel[] |
| 4 | * @var $services OsServiceModel[] |
| 5 | * @var $locations OsLocationModel[] |
| 6 | * @var $selected_agent_id string |
| 7 | * @var $selected_service_id string |
| 8 | * @var $selected_location_id string |
| 9 | * @var $patterns array |
| 10 | * @var $background_pattern string |
| 11 | * @var $instant_booking_page_url string |
| 12 | */ |
| 13 | ?> |
| 14 | <div class="instant-booking-preview-and-settings"> |
| 15 | <div class="instant-booking-preview-wrapper"> |
| 16 | <div class="instant-booking-preview-heading"> |
| 17 | <h2><?php _e( 'Instant Page Preview', 'latepoint' ); ?></h2> |
| 18 | <div class="instant-booking-preview-settings-buttons"> |
| 19 | <a href="#" data-copy-url="<?php echo $instant_booking_page_url; ?>" class="latepoint-btn latepoint-btn-secondary instant-copy-url"><i class="latepoint-icon latepoint-icon-copy"></i><span><?php _e('Copy URL', 'latepoint'); ?></span></a> |
| 20 | <a href="<?php echo $instant_booking_page_url; ?>" target="_blank" class="latepoint-btn latepoint-btn-primary instant-visit-url"><span><?php _e('Visit', 'latepoint'); ?></span><i class="latepoint-icon latepoint-icon-external-link"></i></a> |
| 21 | </div> |
| 22 | </div> |
| 23 | <div class="instant-booking-settings-iframe-wrapper"> |
| 24 | <iframe class="instant-preview-iframe" src="<?php echo $instant_booking_page_url; ?>"></iframe> |
| 25 | </div> |
| 26 | </div> |
| 27 | <div class="instant-booking-settings-wrapper"> |
| 28 | <div class="instant-booking-preview-heading"> |
| 29 | <h2><?php _e( 'Settings', 'latepoint' ); ?></h2> |
| 30 | <a href="#" class="latepoint-instant-preview-close-trigger"><i class="latepoint-icon latepoint-icon-x"></i></a> |
| 31 | </div> |
| 32 | <div class="instant-booking-preview-settings-content" data-route-name="<?php echo esc_attr(OsRouterHelper::build_route_name('settings', 'generate_instant_booking_page_url')); ?>"> |
| 33 | <?php |
| 34 | |
| 35 | // Agents |
| 36 | $agent_options = [ [ 'value' => LATEPOINT_ANY_AGENT, 'label' => __( 'Any Available Agent', 'latepoint' ) ] ]; |
| 37 | foreach ( $agents as $agent ) { |
| 38 | $agent_options[] = [ 'value' => $agent->id, 'label' => $agent->full_name ]; |
| 39 | } |
| 40 | $agent_options[] = [ 'value' => '', 'label' => __( 'Customer has to pick', 'latepoint' ) ]; |
| 41 | if ( empty( $selected_agent_id ) ) { |
| 42 | $selected_agent_id = (count($agents) > 1) ? '' : LATEPOINT_ANY_AGENT; |
| 43 | } |
| 44 | echo OsFormHelper::select_field( 'instant_booking[selected_agent]', __( 'Selected Agent', 'latepoint' ), $agent_options, $selected_agent_id ); |
| 45 | |
| 46 | // Locations |
| 47 | $location_options = [ [ 'value' => LATEPOINT_ANY_LOCATION, 'label' => __( 'Any Available Location', 'latepoint' ) ] ]; |
| 48 | foreach ( $locations as $location ) { |
| 49 | $location_options[] = [ 'value' => $location->id, 'label' => $location->name ]; |
| 50 | } |
| 51 | $location_options[] = [ 'value' => '', 'label' => __( 'Customer has to pick', 'latepoint' ) ]; |
| 52 | if ( empty( $selected_location_id ) ) { |
| 53 | $selected_location_id = (count($locations) > 1) ? '' : LATEPOINT_ANY_LOCATION; |
| 54 | } |
| 55 | echo OsFormHelper::select_field( 'instant_booking[selected_location]', __( 'Selected Location', 'latepoint' ), $location_options, $selected_location_id ); |
| 56 | |
| 57 | // Services |
| 58 | $service_options = [[ 'value' => '', 'label' => __( 'Customer has to pick', 'latepoint' ) ]]; |
| 59 | foreach ( $services as $service ) { |
| 60 | $service_options[] = [ 'value' => $service->id, 'label' => $service->name ]; |
| 61 | } |
| 62 | if ( empty( $selected_service_id ) ) { |
| 63 | $selected_service_id = (count($services) > 1) ? '' : LATEPOINT_ANY_AGENT; |
| 64 | } |
| 65 | echo OsFormHelper::select_field( 'instant_booking[selected_service]', __( 'Selected Service', 'latepoint' ), $service_options, $selected_service_id ); |
| 66 | |
| 67 | echo OsFormHelper::toggler_field('instant_booking[hide_side_panel]', __('Hide Left Panel', 'latepoint'), false, '', 'large'); |
| 68 | echo OsFormHelper::toggler_field('instant_booking[hide_summary]', __('Hide Summary Panel', 'latepoint'), false, '', 'large'); |
| 69 | ?> |
| 70 | <div class="preview-settings-label"><?php _e('Background', 'latepoint'); ?></div> |
| 71 | <div class="preview-background-options"> |
| 72 | <div class="preview-background-option selected" data-pattern-key="default" style="background-image: radial-gradient(#eee 2px, transparent 0); background-size: 15px 15px; background-color: #fff;"></div> |
| 73 | <?php foreach($patterns as $key => $pattern){ |
| 74 | echo '<div class="preview-background-option" data-pattern-key="'.esc_attr($key).'" style="'.esc_attr($pattern).'"></div>'; |
| 75 | } |
| 76 | echo OsFormHelper::hidden_field('instant_booking[background_pattern]', 'default'); |
| 77 | ?> |
| 78 | </div> |
| 79 | </div> |
| 80 | </div> |
| 81 | </div> |