PluginProbe ʕ •ᴥ•ʔ
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress / 5.6.1
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress v5.6.1
5.6.10 5.6.9 5.6.8 5.6.7 5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / views / calendars / scopes / _booking_box_on_calendar.php
latepoint / lib / views / calendars / scopes Last commit date
_booking_box_on_calendar.php 1 year ago _day.php 10 months ago _list.php 1 year ago _month.php 3 months ago _shared.php 1 year ago _week.php 10 months ago
_booking_box_on_calendar.php
47 lines
1 <?php
2 /*
3 * Copyright (c) 2023 LatePoint LLC. All rights reserved.
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10 $booking_duration = $booking->get_total_duration(true);
11 if($booking_duration <= 0) $booking_duration = ($booking->service->duration > 0) ? $booking->service->duration : 60;
12 $booking_start_percent = ($booking->start_time - $work_boundaries->start_time) / ($work_boundaries->end_time - $work_boundaries->start_time) * 100;
13 $booking_duration_percent = min($booking_duration / $work_total_minutes * 100, 100 - $booking_start_percent);
14 if($booking_start_percent < 0) $booking_start_percent = 0;
15 $buffer_before_height_percent = (($booking->start_time - $booking->buffer_before) >= $work_boundaries->start_time) ? ($booking->buffer_before / $booking_duration * 100) : 0;
16 $buffer_after_height_percent = (($booking->end_time + $booking->buffer_after) <= $work_boundaries->end_time) ? ($booking->buffer_after / $booking_duration * 100) : 0;
17 $left = (isset($overlaps_count) && $overlaps_count > 1) ? 'left:'.(100 - round(150 / $overlaps_count)).'%' : '';
18
19 $max_capacity = OsServiceHelper::get_max_capacity($booking->service);
20 if($max_capacity > 1){
21 $action_html = OsBookingHelper::group_booking_btn_html($booking->id);
22 }else{
23 $action_html = OsBookingHelper::quick_booking_btn_html($booking->id);
24 }
25 $css = 'top: '.$booking_start_percent.'%; height: '.$booking_duration_percent.'%; background-color: '.esc_attr($booking->service->bg_color).'; '.$left;
26 ?>
27 <div class="ch-day-booking status-<?php echo esc_attr($booking->status); ?>" <?php echo $action_html; ?> style="<?php echo esc_attr($css); ?>">
28 <?php if($buffer_before_height_percent) echo '<div class="ch-day-buffer-before" style="height: '.esc_attr($buffer_before_height_percent).'%;"></div>'; ?>
29 <div class="ch-day-booking-i">
30 <div class="booking-service-name"><?php echo wp_kses_post(OsReplacerHelper::replace_all_vars(OsSettingsHelper::get_booking_template_for_calendar(), array('customer' => $booking->customer, 'agent' => $booking->agent, 'booking' => $booking, 'order' => $booking->get_order()))); ?></div>
31 <div class="booking-time"><?php echo esc_html(OsTimeHelper::minutes_to_hours_and_minutes($booking->start_time)); ?> - <?php echo esc_html(OsTimeHelper::minutes_to_hours_and_minutes($booking->end_time)); ?></div>
32 <?php if($max_capacity > 1){
33 $total_attendees_in_group = $total_attendees_in_group + $booking->total_attendees; ?>
34 <div class="booking-attendees">
35 <div>
36 <?php
37 // translators: %1$d is number of booked attendees
38 // translators: %2$d is capacity
39 echo esc_html__('Booked:', 'latepoint'). ' <span>'.esc_html(sprintf(__('%1$d of %2$d', 'latepoint'), $total_attendees_in_group, $booking->service->capacity_max)).'</span>'; ?></div>
40 <div class="booked-percentage">
41 <div class="booked-bar" style="width: <?php echo esc_attr(OsServiceHelper::get_percent_of_capacity_booked($booking->service, $total_attendees_in_group)); ?>%;"></div>
42 </div>
43 </div>
44 <?php } ?>
45 </div>
46 <?php if($buffer_after_height_percent) echo '<div class="ch-day-buffer-after" style="height: '.esc_attr($buffer_after_height_percent).'%;"></div>'; ?>
47 </div>