| 1 |
<?php |
| 2 |
|
| 3 |
use Timetics\Core\Appointments\Appointment as Appointment; |
| 4 |
use Timetics\Core\Staffs\Staff; |
| 5 |
|
| 6 |
$meetings = Appointment::all([ |
| 7 |
'posts_per_page' => $limit |
| 8 |
]); |
| 9 |
|
| 10 |
$staffs = Staff::all(); |
| 11 |
$terms = get_terms( [ |
| 12 |
'taxonomy' => 'timetics-meeting-category', |
| 13 |
'hide_empty' => false, |
| 14 |
] ); |
| 15 |
|
| 16 |
?> |
| 17 |
<?php if ( $show_filter ) : ?> |
| 18 |
<div class="timetics-meeting-filter ant-row timetics-input"> |
| 19 |
<div class="timetics-select-wrapper ant-select"> |
| 20 |
<!-- Category List --> |
| 21 |
<select type="select" id="timetics-filter-category" class="timetics-select ant-select-selector"> |
| 22 |
<option value=""><?php esc_html_e( 'All Department', 'timetics' ); ?></option> |
| 23 |
<?php if ( $terms ): ?> |
| 24 |
<?php foreach( $terms as $term ): ?> |
| 25 |
<option value="<?php echo esc_attr( $term->term_id ); ?>"><?php echo esc_html( $term->name ); ?></option> |
| 26 |
<?php endforeach; ?> |
| 27 |
<?php endif; ?> |
| 28 |
</select> |
| 29 |
<!-- End Category List --> |
| 30 |
|
| 31 |
<!-- Staff List --> |
| 32 |
<select type="select" id="timetics-filter-staff"class="timetics-select ant-select-selector"> |
| 33 |
<option value=""><?php esc_html_e( 'All Staff', 'timetics' ); ?></option> |
| 34 |
<?php if ( $staffs ): ?> |
| 35 |
<?php foreach( $staffs['items'] as $staff ): ?> |
| 36 |
<?php |
| 37 |
$staff = new Staff( $staff->ID ); |
| 38 |
?> |
| 39 |
<option value="<?php echo esc_attr( $staff->get_id() ); ?>"><?php echo $staff->get_display_name(); ?></option> |
| 40 |
<?php endforeach; ?> |
| 41 |
<?php endif; ?> |
| 42 |
</select> |
| 43 |
</div> |
| 44 |
<!-- Staff List End --> |
| 45 |
</div> |
| 46 |
<?php endif; ?> |
| 47 |
|
| 48 |
<div class="tt-meeting-list-wrapper toplevel_page_timetics ant-row"> |
| 49 |
<?php if(!empty($meetings['items'])) : ?> |
| 50 |
<?php |
| 51 |
foreach ($meetings['items'] as $item) { |
| 52 |
$meeting = new Appointment($item->ID); |
| 53 |
$staffs = $meeting->get_staff(); |
| 54 |
$locations = $meeting->get_locations(); |
| 55 |
$id = $meeting->get_id(); |
| 56 |
$prices = $meeting->get_price(); |
| 57 |
?> |
| 58 |
<div class="ant-col-8 ant-col-xs-24 ant-col-md-8"> |
| 59 |
<div class="tt-meeting-list-item"> |
| 60 |
<?php |
| 61 |
if (!empty($staffs)) { |
| 62 |
if (count($staffs) > 2) { |
| 63 |
// Display only image for staff members if there are more than two |
| 64 |
?> |
| 65 |
<ul class="tt-author tt-author-avatar-list"> |
| 66 |
<?php |
| 67 |
foreach ($staffs as $key => $staff) { |
| 68 |
?> |
| 69 |
<li class="tt-single-host"> |
| 70 |
<img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" /> |
| 71 |
<div class="tt-tooltip-text"><?php echo esc_html($staff['full_name']); ?></div> |
| 72 |
</li> |
| 73 |
<?php |
| 74 |
} |
| 75 |
?> |
| 76 |
</ul> |
| 77 |
<?php |
| 78 |
} else { |
| 79 |
// Display both image and full name if there are two or fewer staff members |
| 80 |
?> |
| 81 |
<ul class="tt-author"> |
| 82 |
<?php |
| 83 |
foreach ($staffs as $key => $staff) { |
| 84 |
?> |
| 85 |
<li> |
| 86 |
<img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" /> |
| 87 |
<span><?php echo esc_html($staff['full_name']); ?></span> |
| 88 |
</li> |
| 89 |
<?php |
| 90 |
} |
| 91 |
?> |
| 92 |
</ul> |
| 93 |
<?php |
| 94 |
} |
| 95 |
} |
| 96 |
?> |
| 97 |
</ul> |
| 98 |
<h3 class="tt-title"> |
| 99 |
<?php |
| 100 |
echo esc_html($meeting->get_name()); |
| 101 |
?> |
| 102 |
</h3> |
| 103 |
<!-- meeting description --> |
| 104 |
<p><?php echo esc_html($meeting->get_description()); ?></p> |
| 105 |
|
| 106 |
<!-- meeting info --> |
| 107 |
<ul class="meeting-info-list"> |
| 108 |
<!-- meeting duration --> |
| 109 |
<?php if (!empty($meeting->get_duration())) : ?> |
| 110 |
<li> |
| 111 |
<svg fill="#3263F8" width="18" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> |
| 112 |
<path d="M256 512C114.6 512 0 397.4 0 256S114.6 0 256 0S512 114.6 512 256s-114.6 256-256 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z" /> |
| 113 |
</svg> |
| 114 |
<?php echo esc_html($meeting->get_duration()); ?> |
| 115 |
</li> |
| 116 |
<?php endif; ?> |
| 117 |
<!-- meeting price --> |
| 118 |
|
| 119 |
</ul> |
| 120 |
<button class="ant-btn ant-btn-primary ant-btn-block" data-id="<?php echo esc_attr($id); ?>"> |
| 121 |
<?php echo esc_html__("Book Appointment", "timetics"); ?> |
| 122 |
</button> |
| 123 |
|
| 124 |
<div class="timetics-booking-modal"></div> |
| 125 |
</div> |
| 126 |
</div> |
| 127 |
<?php |
| 128 |
} |
| 129 |
?> |
| 130 |
<?php else: ?> |
| 131 |
<p><?php echo esc_html__("No meetings found", "timetics")?></p> |
| 132 |
<?php endif ;?> |
| 133 |
</div> |