PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / 5.5.2
LatePoint – Calendar Booking Plugin for Appointments and Events v5.5.2
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 / search / query_results.php
latepoint / lib / views / search Last commit date
query_results.php 1 year ago
query_results.php
72 lines
1 <?php
2 /* @var $bookings OsBookingModel[] */
3 /* @var $services OsServiceModel[] */
4 /* @var $agents OsAgentModel[] */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly
8 }
9
10
11 ?>
12 <div class="latepoint-top-search-results">
13
14 <h3><i class="latepoint-icon latepoint-icon-calendar"></i><span><?php esc_html_e('Appointments', 'latepoint'); ?></span></h3>
15 <?php if(!empty($bookings)){ ?>
16 <div class="latepoint-search-results-tiles-w">
17 <?php foreach($bookings as $booking){ ?>
18 <a href="#" <?php echo OsBookingHelper::quick_booking_btn_html($booking->id); ?> class="booking-result latepoint-search-result">
19 <div class="avatar" style="background-image: url(<?php echo esc_url($booking->service->selection_image_url); ?>)"></div>
20 <div class="name"><?php echo preg_replace("/($query)/i", "<strong>$1</strong>", esc_html($booking->booking_code)); ?></div>
21 </a>
22 <?php } ?>
23 </div>
24 <?php }else{
25 echo '<div class="search-no-results">'.esc_html__('No Matched Appointments found.', 'latepoint').' <a href="#" '.OsOrdersHelper::quick_order_btn_html().'>'.esc_html__('Add Appointment', 'latepoint').'</a></div>';
26 } ?>
27 <h3><i class="latepoint-icon latepoint-icon-users"></i><span><?php esc_html_e('Customers', 'latepoint'); ?></span></h3>
28 <?php if(!empty($customers)){ ?>
29 <div class="latepoint-search-results-tiles-w">
30 <?php foreach($customers as $customer){ ?>
31 <a href="#" <?php echo OsCustomerHelper::quick_customer_btn_html($customer->id); ?> class="customer-result latepoint-search-result">
32 <div class="avatar" style="background-image: url(<?php echo esc_url($customer->avatar_url); ?>)"></div>
33 <div class="name"><?php echo preg_replace("/($query)/i", "<strong>$1</strong>", esc_html($customer->full_name)); ?></div>
34 </a>
35 <?php } ?>
36 </div>
37 <?php }else{
38 echo '<div class="search-no-results">'.esc_html__('No Matched Customers found.', 'latepoint').' <a href="#" '.OsCustomerHelper::quick_customer_btn_html().'>'.esc_html__('Add Customer', 'latepoint').'</a></div>';
39 } ?>
40 <?php if(OsRolesHelper::can_user('agent__view')){
41 // This results are only for admins
42 ?>
43 <h3><i class="latepoint-icon latepoint-icon-briefcase"></i><span><?php esc_html_e('Agents', 'latepoint'); ?></span></h3>
44 <?php if(!empty($agents)){ ?>
45 <div class="latepoint-search-results-tiles-w">
46 <?php foreach($agents as $agent){ ?>
47 <a href="<?php echo esc_url(OsRouterHelper::build_link(OsRouterHelper::build_route_name('agents', 'edit_form'), array('id' => $agent->id) )); ?>" class="agent-result latepoint-search-result">
48 <div class="avatar" style="background-image: url(<?php echo esc_url($agent->avatar_url); ?>)"></div>
49 <div class="name"><?php echo preg_replace("/($query)/i", "<strong>$1</strong>", esc_html($agent->full_name)); ?></div>
50 </a>
51 <?php } ?>
52 </div>
53 <?php }else{
54 echo '<div class="search-no-results">'.esc_html__('No Matched Agents found.', 'latepoint').' <a href="'.esc_url(OsRouterHelper::build_link(OsRouterHelper::build_route_name('agents', 'create'))).'">'.esc_html__('Add Agent', 'latepoint').'</a></div>';
55 } ?>
56 <?php } ?>
57 <?php if(OsRolesHelper::can_user('service__view')){ ?>
58 <h3><i class="latepoint-icon latepoint-icon-shopping-bag"></i><span><?php esc_html_e('Services', 'latepoint'); ?></span></h3>
59 <?php if(!empty($services)){ ?>
60 <div class="latepoint-search-results-tiles-w">
61 <?php foreach($services as $service){ ?>
62 <a href="<?php echo esc_url(OsRouterHelper::build_link(OsRouterHelper::build_route_name('services', 'edit_form'), array('id' => $service->id) )); ?>" class="service-result latepoint-search-result">
63 <div class="avatar" style="background-image: url(<?php echo esc_url($service->selection_image_url); ?>)"></div>
64 <div class="name"><?php echo preg_replace("/($query)/i", "<strong>$1</strong>", esc_html($service->name)); ?></div>
65 </a>
66 <?php } ?>
67 </div>
68 <?php }else{
69 echo '<div class="search-no-results">'.esc_html__('No Matched Services found.', 'latepoint').' <a href="'.esc_url(OsRouterHelper::build_link(OsRouterHelper::build_route_name('services', 'create'))).'">'.esc_html__('Add Service', 'latepoint').'</a></div>';
70 } ?>
71 <?php } ?>
72 </div>