show.php
42 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Copyright (c) 2023 LatePoint LLC. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | /** |
| 7 | * @var $booking OsBookingModel |
| 8 | * @var $for string |
| 9 | * @var $key string |
| 10 | */ |
| 11 | |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; // Exit if accessed directly |
| 15 | } |
| 16 | |
| 17 | |
| 18 | ?> |
| 19 | <div class="manage-booking-wrapper" data-route-name="<?php echo esc_attr(OsRouterHelper::build_route_name('manage_booking_by_key', 'show')); ?>" data-key="<?php echo esc_attr($key); ?>"> |
| 20 | <?php if($for == 'agent'){ ?> |
| 21 | <div class="manage-booking-controls status-<?php echo esc_attr($booking->status); ?>"> |
| 22 | <div class="change-booking-status-trigger-wrapper" data-route-name="<?php echo esc_attr(OsRouterHelper::build_route_name('manage_booking_by_key', 'change_status')); ?>"> |
| 23 | <?php |
| 24 | echo OsFormHelper::select_field('booking[status]', __('Status:', 'latepoint'), OsBookingHelper::get_statuses_list(), $booking->status, ['id' => 'booking_status_'.$booking->id, 'class' => 'change-booking-status-trigger']); |
| 25 | // Add CSRF protection nonce for status change |
| 26 | wp_nonce_field( 'change_status_booking_' . $booking->id, '_wpnonce', false ); |
| 27 | ?> |
| 28 | </div> |
| 29 | |
| 30 | <?php if(OsCustomerHelper::can_reschedule_booking($booking)){ ?> |
| 31 | <a href="#" class="latepoint-btn latepoint-btn-white latepoint-request-booking-reschedule latepoint-btn-link" data-os-after-call="latepoint_init_reschedule" data-os-lightbox-classes="width-450 reschedule-calendar-wrapper" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('manage_booking_by_key', 'request_reschedule_calendar')); ?>" data-os-params="<?php echo esc_attr(OsUtilHelper::build_os_params(['key' => $key])); ?>" data-os-output-target="lightbox"> |
| 32 | <i class="latepoint-icon latepoint-icon-calendar"></i> |
| 33 | <span><?php esc_html_e('Reschedule', 'latepoint'); ?></span> |
| 34 | </a> |
| 35 | <?php } ?> |
| 36 | </div> |
| 37 | <?php } ?> |
| 38 | <div class="manage-booking-inner"> |
| 39 | <?php include(LATEPOINT_VIEWS_ABSPATH.'bookings/_full_summary.php'); ?> |
| 40 | </div> |
| 41 | </div> |
| 42 |