_booking_info_box_small.php
9 months ago
index.php
1 year ago
widget_bookings_and_availability_timeline.php
9 months ago
widget_daily_bookings_chart.php
1 year ago
widget_upcoming_appointments.php
1 year ago
widget_upcoming_appointments.php
95 lines
| 1 | <?php |
| 2 | /* @var $booking OsBookingModel */ |
| 3 | /* @var $upcoming_bookings OsBookingModel[] */ |
| 4 | /* @var $locations OsLocationModel[] */ |
| 5 | /* @var $agents OsAgentModel[] */ |
| 6 | /* @var $services OsServiceModel[] */ |
| 7 | |
| 8 | /* @var $selected_location_id string|bool */ |
| 9 | /* @var $selected_agent_id string|bool */ |
| 10 | /* @var $selected_service_id string|bool */ |
| 11 | |
| 12 | |
| 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | exit; // Exit if accessed directly |
| 15 | } |
| 16 | |
| 17 | ?> |
| 18 | <div class="os-widget os-widget-animated os-widget-upcoming-appointments" data-os-reload-action="<?php echo esc_attr(OsRouterHelper::build_route_name('dashboard', 'widget_upcoming_appointments')); ?>"> |
| 19 | <div class="os-widget-header with-actions"> |
| 20 | <h3 class="os-widget-header-text"><?php esc_html_e('Upcoming', 'latepoint'); ?></h3> |
| 21 | <div class="os-widget-header-actions-trigger"><i class="latepoint-icon latepoint-icon-more-horizontal"></i></div> |
| 22 | <div class="os-widget-header-actions"> |
| 23 | <select name="location_id" class="os-trigger-reload-widget"> |
| 24 | <option value=""><?php esc_html_e('All locations', 'latepoint'); ?></option> |
| 25 | <?php |
| 26 | if($locations){ |
| 27 | foreach($locations as $location){ ?> |
| 28 | <option value="<?php echo esc_attr($location->id); ?>" <?php if($location->id == $selected_location_id) echo 'selected="selected"' ?>><?php echo esc_html($location->name); ?></option> |
| 29 | <?php } |
| 30 | } ?> |
| 31 | </select> |
| 32 | <?php if(count($agents)>1){ ?> |
| 33 | <select name="agent_id" id="" class="os-trigger-reload-widget"> |
| 34 | <option value=""><?php esc_html_e('All Agents', 'latepoint'); ?></option> |
| 35 | <?php |
| 36 | if($agents){ |
| 37 | foreach($agents as $agent){ ?> |
| 38 | <option value="<?php echo esc_attr($agent->id); ?>" <?php if($agent->id == $selected_agent_id) echo 'selected="selected"' ?>><?php echo esc_html($agent->full_name); ?></option> |
| 39 | <?php } |
| 40 | } ?> |
| 41 | </select> |
| 42 | <?php } ?> |
| 43 | <select name="service_id" id="" class="os-trigger-reload-widget"> |
| 44 | <option value=""><?php esc_html_e('All Services', 'latepoint'); ?></option> |
| 45 | <?php |
| 46 | if($services){ |
| 47 | foreach($services as $service){ ?> |
| 48 | <option value="<?php echo esc_attr($service->id); ?>" <?php if($service->id == $selected_service_id) echo 'selected="selected"' ?>><?php echo esc_html($service->name); ?></option> |
| 49 | <?php } |
| 50 | } ?> |
| 51 | </select> |
| 52 | </div> |
| 53 | </div> |
| 54 | <div class="os-widget-content no-padding"> |
| 55 | <div class="appointment-boxes-squared-w"> |
| 56 | <div class="appointment-boxes-caption" style="display:none;"><div><?php esc_html_e('Upcoming', 'latepoint'); ?></div></div> |
| 57 | <?php if($upcoming_bookings){ ?> |
| 58 | <?php foreach($upcoming_bookings as $booking){ |
| 59 | $max_capacity = OsServiceHelper::get_max_capacity($booking->service); ?> |
| 60 | <div class="appointment-box-squared" <?php echo ($max_capacity > 1) ? OsBookingHelper::group_booking_btn_html($booking->id) : OsBookingHelper::quick_booking_btn_html($booking->id); ?>> |
| 61 | <div class="appointment-main-info"> |
| 62 | <div class="appointment-color-elem" style="background-color: <?php echo esc_attr($booking->service->bg_color); ?>"></div> |
| 63 | <div class="appointment-main-info-i"> |
| 64 | <div class="avatar-w" style="background-image: url(<?php echo esc_url($booking->agent->get_avatar_url()); ?>);"> |
| 65 | <div class="agent-info-tooltip"><?php echo esc_html($booking->agent->full_name); ?></div> |
| 66 | </div> |
| 67 | <div class="appointment-date-w"> |
| 68 | <div class="appointment-time-left"> |
| 69 | <?php |
| 70 | // translators: %s is time left |
| 71 | echo sprintf(esc_html__('in %s', 'latepoint'), $booking->time_left); ?> |
| 72 | </div> |
| 73 | <div class="appointment-service-name"><?php echo esc_html($booking->service->name); ?></div> |
| 74 | <div class="appointment-date-i"> |
| 75 | <div class="appointment-date"><?php echo esc_html($booking->get_nice_start_date(true).', '); ?></div> |
| 76 | <div class="appointment-time"><?php echo esc_html($booking->get_nice_start_time()); ?></div> |
| 77 | </div> |
| 78 | </div> |
| 79 | </div> |
| 80 | <div class="appointment-link"> |
| 81 | <i class="latepoint-icon latepoint-icon-arrow-right"></i> |
| 82 | </div> |
| 83 | </div> |
| 84 | </div> |
| 85 | <?php } ?> |
| 86 | <?php }else{ ?> |
| 87 | <div class="no-results-w"> |
| 88 | <div class="icon-w"><i class="latepoint-icon latepoint-icon-inbox"></i></div> |
| 89 | <div class="count-label""><?php esc_html_e('No Upcoming Appointments', 'latepoint'); ?></div class=count-label""> |
| 90 | <a href="#" <?php echo OsOrdersHelper::quick_order_btn_html(); ?> class="latepoint-btn latepoint-btn-link"><i class="latepoint-icon latepoint-icon-plus"></i><span><?php esc_html_e('Add Appointment', 'latepoint'); ?></span></a> |
| 91 | </div> |
| 92 | <?php } ?> |
| 93 | </div> |
| 94 | </div> |
| 95 | </div> |