| @@ -1,62 +1,78 @@ | ||
| 1 | -<?php defined( 'ABSPATH' ) || exit; ?> | |
| 1 | +<?php | |
| 2 | +defined( 'ABSPATH' ) || exit; | |
| 2 | 3 | |
| 4 | +/** | |
| 5 | + * @var object $bookings | |
| 6 | + * @var array $attributes | |
| 7 | + * @var int $per_page | |
| 8 | + * @var int $start_page | |
| 9 | + * @var int $end_page | |
| 10 | + * @var string $booking_period | |
| 11 | + * @var array $page_options | |
| 12 | + * @var array $period_options | |
| 13 | + */ | |
| 14 | +?> | |
| 15 | + | |
| 3 | 16 | <div class="fcal_container"> |
| 4 | 17 | <div class="fcal_booking_header"> |
| 5 | - <h2><?php echo esc_html($attributes['title']) ?></h2> | |
| 6 | - <div class="fcal_booking_header_actions"> | |
| 7 | - <?php if ($attributes['filter'] == 'show') : ?> | |
| 18 | + <?php if ($attributes['title']) : ?> | |
| 19 | + <h2><?php echo esc_html($attributes['title']) ?></h2> | |
| 20 | + <?php endif; ?> | |
| 21 | + <?php if ($attributes['filter'] == 'show') : ?> | |
| 22 | + <div class="fcal_booking_header_actions"> | |
| 8 | 23 | <form action="" method="GET"> |
| 9 | - <?php foreach ($period_options as $value => $label): ?> | |
| 24 | + <?php foreach ($period_options as $fluentBookingValue => $fluentBookingLabel): ?> | |
| 10 | 25 | <div class="fcal_radio_btn"> |
| 11 | - <input type="radio" name="booking_period" id="fcal_period_<?php echo esc_attr($value) ?>" | |
| 12 | - value="<?php echo esc_attr($value) ?>" <?php echo $booking_period == $value ? 'checked' : '' ?> | |
| 26 | + <input type="radio" name="booking_period" id="fcal_period_<?php echo esc_attr($fluentBookingValue) ?>" | |
| 27 | + value="<?php echo esc_attr($fluentBookingValue) ?>" <?php echo $booking_period == $fluentBookingValue ? 'checked' : '' ?> | |
| 13 | 28 | onchange="this.form.submit()"> |
| 14 | - <label for="fcal_period_<?php echo esc_attr($value) ?>"><?php echo esc_html($label) ?></label> | |
| 29 | + <label for="fcal_period_<?php echo esc_attr($fluentBookingValue) ?>"><?php echo esc_html($fluentBookingLabel) ?></label> | |
| 15 | 30 | </div> |
| 16 | 31 | <?php endforeach; ?> |
| 32 | + <input type="hidden" name="booking_per_page" value="<?php echo esc_attr($per_page); ?>"> | |
| 17 | 33 | </form> |
| 18 | - <?php endif; ?> | |
| 19 | - </div> | |
| 34 | + </div> | |
| 35 | + <?php endif; ?> | |
| 20 | 36 | </div> |
| 21 | 37 | <div class="fcal_all_bookings"> |
| 22 | 38 | <div class="fcal_bookings"> |
| 23 | 39 | <div class="fcal_booking_wrapper"> |
| 24 | - <?php foreach ($bookings as $booking) : ?> | |
| 25 | - <div class="fcal_booking" onclick="location.href='<?php echo esc_url($booking->getConfirmationUrl()); ?>'"> | |
| 26 | - <div class="fcal_spot_wrapper <?php echo 'fcal_spot_status_' . esc_attr($booking->status) ?>"> | |
| 40 | + <?php foreach ($bookings as $fluentBookingBooking) : ?> | |
| 41 | + <div class="fcal_booking" onclick="location.href='<?php echo esc_url($fluentBookingBooking->getConfirmationUrl()); ?>'"> | |
| 42 | + <div class="fcal_spot_wrapper <?php echo 'fcal_spot_status_' . esc_attr($fluentBookingBooking->status) ?>"> | |
| 27 | 43 | <div class="fcal_spot_line"> |
| 28 | 44 | <div class="fcal_spot_timing"> |
| 29 | - <p class="fcal_booking_date"><?php echo esc_html($booking->booking_date); ?></p> | |
| 30 | - <p class="fcal_booking_time"><?php echo esc_html($booking->booking_time); ?></p> | |
| 31 | - <p class="fcal_booking_timezone">(<?php echo esc_html($booking->person_time_zone); ?>)</p> | |
| 45 | + <p class="fcal_booking_date"><?php echo esc_html($fluentBookingBooking->booking_date); ?></p> | |
| 46 | + <p class="fcal_booking_time"><?php echo esc_html($fluentBookingBooking->booking_time); ?></p> | |
| 47 | + <p class="fcal_booking_timezone">(<?php echo esc_html($fluentBookingBooking->person_time_zone); ?>)</p> | |
| 32 | 48 | </div> |
| 33 | 49 | <div class="fcal_spot_desc"> |
| 34 | 50 | <h3 class="fcal_spot_title"> |
| 35 | - <?php echo wp_kses_post($booking->getBookingTitle(true)); ?> | |
| 51 | + <?php echo wp_kses_post($fluentBookingBooking->getBookingTitle(true)); ?> | |
| 36 | 52 | </h3> |
| 37 | 53 | <div class="fcal_spot_desc_sub_info"> |
| 38 | - <?php if ($booking->happening_status) : ?> | |
| 39 | - <?php foreach ($booking->happening_status as $slug => $status) : ?> | |
| 54 | + <?php if ($fluentBookingBooking->happening_status) : ?> | |
| 55 | + <?php foreach ($fluentBookingBooking->happening_status as $fluentBookingSlug => $fluentBookingStatus) : ?> | |
| 40 | 56 | <div class="fcal_spot_happening"> |
| 41 | - <span class=<?php echo 'fcal_' . esc_attr($slug) ?>> | |
| 42 | - <?php echo esc_html($status) ?> | |
| 57 | + <span class=<?php echo 'fcal_' . esc_attr($fluentBookingSlug) ?>> | |
| 58 | + <?php echo esc_html($fluentBookingStatus) ?> | |
| 43 | 59 | </span> |
| 44 | 60 | </div> |
| 45 | 61 | <?php endforeach; ?> |
| 46 | 62 | <?php else : ?> |
| 47 | 63 | <span class="fcal_spot_period_status"> |
| 48 | - <?php echo esc_html($booking->booking_status_text) ?> | |
| 64 | + <?php echo esc_html($fluentBookingBooking->booking_status_text) ?> | |
| 49 | 65 | </span> |
| 50 | 66 | <?php endif; ?> |
| 51 | 67 | |
| 52 | - <?php if ($booking->payment_status) : ?> | |
| 53 | - <p class="fcal_spot_payment_status <?php echo esc_attr($booking->payment_status) ?>"> | |
| 54 | - <?php echo esc_html($booking->payment_status_text) ?> | |
| 68 | + <?php if ($fluentBookingBooking->payment_status) : ?> | |
| 69 | + <p class="fcal_spot_payment_status <?php echo esc_attr($fluentBookingBooking->payment_status) ?>"> | |
| 70 | + <?php echo esc_html($fluentBookingBooking->payment_status_text) ?> | |
| 55 | 71 | </p> |
| 56 | 72 | <?php endif; ?> |
| 57 | 73 | |
| 58 | - <?php if ($booking->status == 'pending' && $booking->payment_status != 'pending') : ?> | |
| 74 | + <?php if ($fluentBookingBooking->status == 'pending' && $fluentBookingBooking->payment_status != 'pending') : ?> | |
| 59 | 75 | <p class="fcal_spot_period_status unconfirmed"> |
| 60 | 76 | <?php esc_html_e('Unconfirmed', 'fluent-booking') ?> |
| 61 | 77 | </p> |
| 62 | 78 | <?php endif; ?> |
| @@ -63,9 +79,9 @@ | ||
| 63 | 79 | </div> |
| 64 | 80 | </div> |
| 65 | 81 | <div class="fcal_spot_actions"> |
| 66 | 82 | <button class="fcal_plain_btn" |
| 67 | - onclick="location.href='<?php echo esc_url($booking->getConfirmationUrl()); ?>'"> | |
| 83 | + onclick="location.href='<?php echo esc_url($fluentBookingBooking->getConfirmationUrl()); ?>'"> | |
| 68 | 84 | <?php esc_html_e('View', 'fluent-booking')?> |
| 69 | 85 | </button> |
| 70 | 86 | </div> |
| 71 | 87 | </div> |
| @@ -87,13 +103,14 @@ | ||
| 87 | 103 | <span><?php echo esc_html(__('Total', 'fluent-booking') . ' ' . $bookings->total())?></span> |
| 88 | 104 | |
| 89 | 105 | <form action="" method="GET"> |
| 90 | 106 | <select name="booking_per_page" id="fcal_booking_per_page" onchange="this.form.submit()"> |
| 91 | - <?php foreach ($page_options as $option): ?> | |
| 92 | - <option value="<?php echo esc_attr($option); ?>" <?php $per_page == $option ? 'selected' : '' ?>> | |
| 93 | - <?php echo esc_html($option) . '/' . esc_html__('page', 'fluent-booking') ?> | |
| 107 | + <?php foreach ($page_options as $fluentBookingOption): ?> | |
| 108 | + <option value="<?php echo esc_attr($fluentBookingOption); ?>" <?php echo ($per_page == $fluentBookingOption) ? 'selected' : ''; ?>> | |
| 109 | + <?php echo esc_html($fluentBookingOption) . '/' . esc_html__('page', 'fluent-booking') ?> | |
| 94 | 110 | </option> |
| 95 | 111 | <?php endforeach; ?> |
| 112 | + <input type="hidden" name="booking_period" value="<?php echo esc_attr($booking_period); ?>"> | |
| 96 | 113 | </select> |
| 97 | 114 | </form> |
| 98 | 115 | |
| 99 | 116 | <?php if ($bookings->onFirstPage()): ?> |