| 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 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 Organizers', '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_full_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"> |
| 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="tt-meeting-list-item"> |
| 59 |
<!-- meeting description --> |
| 60 |
<div class="tt-meeting-information"> |
| 61 |
<?php |
| 62 |
if (!empty($staffs)) { |
| 63 |
|
| 64 |
// Display both image and full name if there are two or fewer staff members |
| 65 |
?> |
| 66 |
<ul class="tt-author"> |
| 67 |
<?php |
| 68 |
foreach ($staffs as $key => $staff) { |
| 69 |
?> |
| 70 |
<li> |
| 71 |
<?php if ($staff['image']) { |
| 72 |
?> |
| 73 |
<img src="<?php echo esc_url($staff['image']); ?>" alt="<?php echo esc_attr($staff['full_name']); ?>" /> |
| 74 |
<?php } ?> |
| 75 |
<span><?php echo esc_html($staff['full_name']); ?></span> |
| 76 |
</li> |
| 77 |
<?php |
| 78 |
} |
| 79 |
?> |
| 80 |
</ul> |
| 81 |
<?php |
| 82 |
|
| 83 |
} |
| 84 |
?> |
| 85 |
</ul> |
| 86 |
<h3 class="tt-title"> |
| 87 |
<?php |
| 88 |
echo esc_html($meeting->get_name()); |
| 89 |
?> |
| 90 |
</h3> |
| 91 |
<?php |
| 92 |
if($meeting->get_description()) { |
| 93 |
?> |
| 94 |
<p><?php echo esc_html($meeting->get_description()); ?></p> |
| 95 |
<?php |
| 96 |
} |
| 97 |
?> |
| 98 |
</div> |
| 99 |
<div class="tt-meeting-action"> |
| 100 |
<!-- meeting info --> |
| 101 |
<ul class="meeting-info-list"> |
| 102 |
<!-- meeting duration --> |
| 103 |
<?php if (!empty($meeting->get_duration())) : ?> |
| 104 |
<li> |
| 105 |
<svg width="20" height="20" viewBox="0 0 20 20" fill="CurrentColor" xmlns="http://www.w3.org/2000/svg"> |
| 106 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2ZM0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10ZM10 3.6C10.5523 3.6 11 4.04772 11 4.6V9.38197L14.0472 10.9056C14.5412 11.1526 14.7414 11.7532 14.4944 12.2472C14.2474 12.7412 13.6468 12.9414 13.1528 12.6944L9.55279 10.8944C9.214 10.725 9 10.3788 9 10V4.6C9 4.04772 9.44771 3.6 10 3.6Z"/> |
| 107 |
</svg> |
| 108 |
<?php echo esc_html($meeting->get_duration()); ?> |
| 109 |
</li> |
| 110 |
<?php endif; ?> |
| 111 |
<!-- meeting price --> |
| 112 |
|
| 113 |
</ul> |
| 114 |
<button class="ant-btn ant-btn-primary ant-btn-block" data-id="<?php echo esc_attr($id); ?>"> |
| 115 |
<?php echo esc_html__("Book Now", "timetics"); ?> |
| 116 |
</button> |
| 117 |
</div> |
| 118 |
</div> |
| 119 |
<?php |
| 120 |
} |
| 121 |
?> |
| 122 |
<?php else: ?> |
| 123 |
<p><?php echo esc_html__("No meetings found", "timetics")?></p> |
| 124 |
<?php endif ;?> |
| 125 |
<div class="timetics-booking-modal"></div> |
| 126 |
</div> |