import_steps
9 months ago
_table_body.php
9 months ago
edit_form.php
1 year ago
import_csv_modal.php
9 months ago
import_load_step.php
3 months ago
index.php
4 months ago
inline_edit_form.php
1 year ago
mini_profile.php
1 year ago
new_form.php
1 year ago
query_for_booking_form.php
1 year ago
quick_edit.php
4 months ago
view_customer_log.php
1 year ago
index.php
124 lines
| 1 | <?php |
| 2 | /** @var $customers OsCustomerModel[] */ |
| 3 | /** @var $customers_violating_auth_rules array */ |
| 4 | |
| 5 | if ( ! defined( 'ABSPATH' ) ) { |
| 6 | exit; // Exit if accessed directly |
| 7 | } |
| 8 | |
| 9 | if($customers){ |
| 10 | if(!empty($customers_violating_auth_rules['values'])){ |
| 11 | $field_name = ($customers_violating_auth_rules['field'] == 'email') ? __('email addresses', 'latepoint') : __('phone numbers', 'latepoint'); ?> |
| 12 | |
| 13 | <div class="latepoint-fix-records-warning"> |
| 14 | <i class="latepoint-icon latepoint-icon-info"></i> |
| 15 | <div> |
| 16 | <div><?php echo sprintf(__('There are customers with identical %s, you need to fix these, otherwise they will not be able to make bookings:', 'latepoint'), $field_name); ?></div> |
| 17 | <div class="latepoint-fix-records-values"><?php echo implode(', ', $customers_violating_auth_rules['values']); ?></div> |
| 18 | </div> |
| 19 | </div> |
| 20 | <?php |
| 21 | } |
| 22 | ?> |
| 23 | <div class="table-with-pagination-w has-scrollable-table"> |
| 24 | <div class="os-pagination-w with-actions"> |
| 25 | <div class="table-heading-w"> |
| 26 | <h2 class="table-heading"><?php esc_html_e('Customers', 'latepoint'); ?></h2> |
| 27 | <div class="pagination-info"><?php echo esc_html__('Showing', 'latepoint'). ' <span class="os-pagination-from">' . esc_html( $showing_from ) . '</span>-<span class="os-pagination-to">' . esc_html($showing_to) . '</span> ' . esc_html__('of', 'latepoint') . ' <span class="os-pagination-total">' . esc_html($total_customers) . '</span>'; ?></div> |
| 28 | </div> |
| 29 | <div class="mobile-table-actions-trigger"><i class="latepoint-icon latepoint-icon-more-horizontal"></i></div> |
| 30 | <div class="table-actions"> |
| 31 | <?php if (OsSettingsHelper::can_download_records_as_csv()) { ?> |
| 32 | <a data-os-lightbox-classes="width-500" data-os-after-call="latepoint_init_customers_import" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('customers', 'import_csv_modal')); ?>" href="#" data-os-output-target="lightbox" class="latepoint-btn latepoint-btn-grey latepoint-btn-outline"><i class="latepoint-icon latepoint-icon-download"></i><span><?php esc_html_e('Import .csv', 'latepoint'); ?></span></a> |
| 33 | <a href="<?php echo esc_url(wp_nonce_url(OsRouterHelper::build_admin_post_link(OsRouterHelper::build_route_name('customers', 'index')), 'customers_csv_export', '_wpnonce')); ?>" target="_blank" class="latepoint-btn latepoint-btn-outline latepoint-btn-grey download-csv-with-filters"><i class="latepoint-icon latepoint-icon-upload"></i><span><?php esc_html_e('Export .csv', 'latepoint'); ?></span></a> |
| 34 | <?php } ?> |
| 35 | <?php if(OsAuthHelper::can_wp_users_login_as_customers()){ ?> |
| 36 | <?php $not_connected_count = OsCustomerHelper::count_customers_not_connected_to_wp_users(); ?> |
| 37 | <?php if($not_connected_count){ ?> |
| 38 | <a href="#" data-os-success-action="reload" data-os-params="<?php echo esc_attr(OsUtilHelper::build_os_params([], 'connect_all_customers_to_wp_users')); ?>" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('customers', 'connect_all_to_wp_users')); ?>" class="latepoint-btn latepoint-btn-outline latepoint-btn-grey"><i class="latepoint-icon latepoint-icon-wordpress"></i><span><?php esc_html_e('Connect to WP Users', 'latepoint'); ?><?php echo ' ['.esc_html($not_connected_count).']'; ?></span></a> |
| 39 | <?php } ?> |
| 40 | <?php } ?> |
| 41 | <a href="#" <?php echo OsCustomerHelper::quick_customer_btn_html(); ?> class="latepoint-btn latepoint-btn-outline latepoint-btn-grey"><i class="latepoint-icon latepoint-icon-plus"></i><span><?php esc_html_e('New Customer', 'latepoint'); ?></span></a> |
| 42 | </div> |
| 43 | </div> |
| 44 | <div class="os-customers-list"> |
| 45 | <div class="os-scrollable-table-w"> |
| 46 | <div class="os-table-w os-table-compact"> |
| 47 | <table class="os-table os-reload-on-booking-update os-scrollable-table" data-route="<?php echo OsRouterHelper::build_route_name('customers', 'index'); ?>"> |
| 48 | <thead> |
| 49 | <tr> |
| 50 | <th><?php esc_html_e('ID', 'latepoint'); ?></th> |
| 51 | <th class="text-left"><?php esc_html_e('Full Name', 'latepoint'); ?></th> |
| 52 | <th><?php esc_html_e('Phone', 'latepoint'); ?></th> |
| 53 | <th><?php esc_html_e('Email', 'latepoint'); ?></th> |
| 54 | <?php if(OsSettingsHelper::is_using_social_login()) echo '<th>'.esc_html__('Social', 'latepoint').'</th>'; ?> |
| 55 | <th><?php esc_html_e('Total Apps', 'latepoint'); ?></th> |
| 56 | <th><?php esc_html_e('Next App', 'latepoint'); ?></th> |
| 57 | <th><?php esc_html_e('Time to Next', 'latepoint'); ?></th> |
| 58 | <?php if(OsAuthHelper::can_wp_users_login_as_customers()) echo '<th>' . esc_html__('WP User ID', 'latepoint') . '</th>'; ?> |
| 59 | <th><?php esc_html_e('Registered On', 'latepoint'); ?></th> |
| 60 | </tr> |
| 61 | <tr> |
| 62 | <th><?php echo OsFormHelper::text_field('filter[id]', false, '', ['style' => 'width: 40px;', 'class' => 'os-table-filter', 'placeholder' => __('ID', 'latepoint')]); ?></th> |
| 63 | <th><?php echo OsFormHelper::text_field('filter[customer]', false, '', ['class' => 'os-table-filter', 'placeholder' => __('Search by Name', 'latepoint')]); ?></th> |
| 64 | <th><?php echo OsFormHelper::text_field('filter[phone]', false, '', ['class' => 'os-table-filter', 'placeholder' => __('Phone...', 'latepoint')]); ?></th> |
| 65 | <th><?php echo OsFormHelper::text_field('filter[email]', false, '', ['class' => 'os-table-filter', 'placeholder' => __('Search by Email', 'latepoint')]); ?></th> |
| 66 | <th></th> |
| 67 | <th></th> |
| 68 | <th></th> |
| 69 | <?php if(OsSettingsHelper::is_using_social_login()) echo '<th></th>'; ?> |
| 70 | <?php if(OsAuthHelper::can_wp_users_login_as_customers()) echo '<th></th>'; ?> |
| 71 | <th> |
| 72 | <div class="os-form-group"> |
| 73 | <div class="os-date-range-picker os-table-filter-datepicker" data-can-be-cleared="yes" data-no-value-label="<?php esc_attr_e('Filter By Date', 'latepoint'); ?>" data-clear-btn-label="<?php esc_attr_e('Reset Date Filtering', 'latepoint'); ?>"> |
| 74 | <span class="range-picker-value"><?php esc_html_e('Filter By Date', 'latepoint'); ?></span> |
| 75 | <i class="latepoint-icon latepoint-icon-chevron-down"></i> |
| 76 | <input type="hidden" class="os-table-filter os-datepicker-date-from" name="filter[registration_date_from]" value=""/> |
| 77 | <input type="hidden" class="os-table-filter os-datepicker-date-to" name="filter[registration_date_to]" value=""/> |
| 78 | </div> |
| 79 | </div> |
| 80 | </th> |
| 81 | </tr> |
| 82 | </thead> |
| 83 | <tbody> |
| 84 | <?php include('_table_body.php'); ?> |
| 85 | </tbody> |
| 86 | <tfoot> |
| 87 | <tr> |
| 88 | <th><?php esc_html_e('ID', 'latepoint'); ?></th> |
| 89 | <th class="text-left"><?php esc_html_e('Full Name', 'latepoint'); ?></th> |
| 90 | <th><?php esc_html_e('Phone', 'latepoint'); ?></th> |
| 91 | <th><?php esc_html_e('Email', 'latepoint'); ?></th> |
| 92 | <?php if(OsSettingsHelper::is_using_social_login()) echo '<th>'.esc_html__('Social', 'latepoint').'</th>'; ?> |
| 93 | <th><?php esc_html_e('Total Apps', 'latepoint'); ?></th> |
| 94 | <th><?php esc_html_e('Next App', 'latepoint'); ?></th> |
| 95 | <th><?php esc_html_e('Time to Next', 'latepoint'); ?></th> |
| 96 | <?php if(OsAuthHelper::can_wp_users_login_as_customers()) echo '<th>' . esc_html__('WP User ID', 'latepoint') . '</th>'; ?> |
| 97 | <th><?php esc_html_e('Registered On', 'latepoint'); ?></th> |
| 98 | </tr> |
| 99 | </tfoot> |
| 100 | </table> |
| 101 | </div> |
| 102 | </div> |
| 103 | </div> |
| 104 | <div class="os-pagination-w"> |
| 105 | <div class="pagination-info"><?php echo esc_html__('Showing', 'latepoint'). ' <span class="os-pagination-from">'. esc_html($showing_from) . '</span>-<span class="os-pagination-to">'. esc_html($showing_to) .'</span> '.esc_html__('of', 'latepoint').' <span class="os-pagination-total">'. esc_html($total_customers). '</span>'; ?></div> |
| 106 | <div class="pagination-page-select-w"> |
| 107 | <label for="tablePaginationPageSelector"><?php esc_html_e('Page:', 'latepoint'); ?></label> |
| 108 | <select id="tablePaginationPageSelector" name="page" class="pagination-page-select"> |
| 109 | <?php |
| 110 | for($i = 1; $i <= $total_pages; $i++){ |
| 111 | $selected = ($current_page_number == $i) ? 'selected' : ''; |
| 112 | echo '<option '.esc_html($selected).'>'.esc_html($i).'</option>'; |
| 113 | } ?> |
| 114 | </select> |
| 115 | </div> |
| 116 | </div> |
| 117 | </div> |
| 118 | <?php }else{ ?> |
| 119 | <div class="no-results-w"> |
| 120 | <div class="icon-w"><i class="latepoint-icon latepoint-icon-users"></i></div> |
| 121 | <h2><?php esc_html_e('No Customers Found', 'latepoint'); ?></h2> |
| 122 | <a href="#" <?php echo OsCustomerHelper::quick_customer_btn_html(); ?> class="latepoint-btn"><i class="latepoint-icon latepoint-icon-plus"></i><span><?php esc_html_e('Add Customer', 'latepoint'); ?></span></a> |
| 123 | </div> |
| 124 | <?php } ?> |