_form.php
9 months ago
_service_index_item.php
9 months ago
edit_form.php
1 year ago
index.php
9 months ago
new_form.php
1 year ago
index.php
68 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; // Exit if accessed directly |
| 4 | } |
| 5 | ?> |
| 6 | <?php if($uncategorized_services){ ?> |
| 7 | <div class="os-item-category-w"> |
| 8 | <div class="os-form-sub-header sub-level"><h3><?php esc_html_e('Uncategorized', 'latepoint'); ?></h3></div> |
| 9 | <div class="os-services-list os-resources-grid"> |
| 10 | <?php foreach ($uncategorized_services as $service): ?> |
| 11 | <?php include('_service_index_item.php'); ?> |
| 12 | <?php endforeach; ?> |
| 13 | |
| 14 | |
| 15 | <?php if(OsRolesHelper::can_user('service__create')){ ?> |
| 16 | <?php echo OsUtilHelper::add_resource_link_html(__('New Service', 'latepoint-pro-features'), OsRouterHelper::build_link(OsRouterHelper::build_route_name('services', 'new_form') )); ?> |
| 17 | <?php } ?> |
| 18 | </div> |
| 19 | </div> |
| 20 | <?php } ?> |
| 21 | <?php if($service_categories){ ?> |
| 22 | <?php foreach ($service_categories as $service_category): ?> |
| 23 | <div class="os-item-category-w"> |
| 24 | <div class="os-form-sub-header sub-level"><h3><?php echo esc_html($service_category->name); ?></h3></div> |
| 25 | <div class="os-services-list os-resources-grid"> |
| 26 | <?php |
| 27 | $active_services = $service_category->get_active_services(true, true); |
| 28 | if($active_services){ ?> |
| 29 | <?php foreach ($active_services as $service): ?> |
| 30 | <?php include('_service_index_item.php'); ?> |
| 31 | <?php endforeach; ?> |
| 32 | <?php |
| 33 | } ?> |
| 34 | <?php if(OsRolesHelper::can_user('service__create')){ ?> |
| 35 | <?php echo OsUtilHelper::add_resource_link_html(__('New Service', 'latepoint-pro-features'), OsRouterHelper::build_link(OsRouterHelper::build_route_name('services', 'new_form'), ['service_category_id' => $service_category->id] )); ?> |
| 36 | <?php } ?> |
| 37 | </div> |
| 38 | </div> |
| 39 | <?php endforeach; ?> |
| 40 | |
| 41 | <?php }else{ ?> |
| 42 | <?php if(!$uncategorized_services){ ?> |
| 43 | <div class="no-results-w"> |
| 44 | <div class="icon-w"><i class="latepoint-icon latepoint-icon-book"></i></div> |
| 45 | <h2><?php esc_html_e('No Active Services Found', 'latepoint'); ?></h2> |
| 46 | <?php if(OsRolesHelper::can_user('service__create')){ ?> |
| 47 | <a href="<?php echo esc_url(OsRouterHelper::build_link(OsRouterHelper::build_route_name('services', 'new_form') )); ?>" class="latepoint-btn"> |
| 48 | <i class="latepoint-icon latepoint-icon-plus-square"></i> |
| 49 | <span><?php esc_html_e('Add Service', 'latepoint'); ?></span> |
| 50 | </a> |
| 51 | <?php } ?> |
| 52 | </div> |
| 53 | <?php } ?> |
| 54 | <?php } ?> |
| 55 | |
| 56 | |
| 57 | <?php if($disabled_services){ |
| 58 | echo '<div class="disabled-items-wrapper">'; |
| 59 | // translators: %d number of services |
| 60 | echo '<div class="disabled-items-open-trigger"><span>'.esc_html(sprintf(_n('%d Disabled Service', '%d Disabled Services', count($disabled_services),'latepoint'), count($disabled_services))).'</span><i class="latepoint-icon latepoint-icon-chevron-down"></i></div>'; |
| 61 | echo '<div class="os-services-list os-resources-grid disabled-items-boxes">'; |
| 62 | foreach($disabled_services as $service){ |
| 63 | include('_service_index_item.php'); |
| 64 | } |
| 65 | echo '</div>'; |
| 66 | echo '</div>'; |
| 67 | } |
| 68 |