Files
care-book-block-ultimate/BACKUP-ESSENTIALS/PRODUCTION-READY/care-booking-block-ultimate/admin/partials/admin-display.php
Emanuel Almeida 38bb926742 chore: add spec-kit and standardize signatures
- Added GitHub spec-kit for development workflow
- Standardized file signatures to Descomplicar® format
- Updated development configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 01:27:34 +01:00

336 lines
15 KiB
PHP

/**
* Descomplicar® Crescimento Digital
* https://descomplicar.pt
*/
<?php
/**
* Admin display for Care Booking Block plugin
*
* @package CareBookingBlock
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="wrap care-booking-admin">
<h1><?php esc_html_e('Care Booking Control', 'care-booking-block'); ?></h1>
<!-- Status Banner -->
<div class="care-booking-status">
<div class="status-item">
<span class="dashicons dashicons-admin-users"></span>
<strong id="blocked-doctors-count">0</strong>
<span><?php esc_html_e('Blocked Doctors', 'care-booking-block'); ?></span>
</div>
<div class="status-item">
<span class="dashicons dashicons-admin-settings"></span>
<strong id="blocked-services-count">0</strong>
<span><?php esc_html_e('Blocked Services', 'care-booking-block'); ?></span>
</div>
<div class="status-item">
<span class="dashicons dashicons-performance"></span>
<strong id="cache-status"><?php esc_html_e('Unknown', 'care-booking-block'); ?></strong>
<span><?php esc_html_e('Cache Status', 'care-booking-block'); ?></span>
</div>
</div>
<!-- Navigation Tabs -->
<nav class="nav-tab-wrapper wp-clearfix">
<a href="#doctors" class="nav-tab nav-tab-active" data-tab="doctors">
<?php esc_html_e('Doctors', 'care-booking-block'); ?>
</a>
<a href="#services" class="nav-tab" data-tab="services">
<?php esc_html_e('Services', 'care-booking-block'); ?>
</a>
<a href="#settings" class="nav-tab" data-tab="settings">
<?php esc_html_e('Settings', 'care-booking-block'); ?>
</a>
</nav>
<!-- Loading Indicator -->
<div class="care-booking-loading" style="display: none;">
<div class="spinner is-active"></div>
<p><?php esc_html_e('Loading...', 'care-booking-block'); ?></p>
</div>
<!-- Doctors Tab -->
<div id="doctors-tab" class="tab-content active">
<div class="tablenav top">
<div class="alignleft actions">
<button type="button" class="button" id="refresh-doctors">
<span class="dashicons dashicons-update"></span>
<?php esc_html_e('Refresh', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="bulk-block-doctors">
<span class="dashicons dashicons-hidden"></span>
<?php esc_html_e('Block Selected', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="bulk-unblock-doctors">
<span class="dashicons dashicons-visibility"></span>
<?php esc_html_e('Unblock Selected', 'care-booking-block'); ?>
</button>
</div>
<div class="alignright actions">
<input type="search" id="doctors-search" placeholder="<?php esc_attr_e('Search doctors...', 'care-booking-block'); ?>" />
<button type="button" class="button" id="search-doctors"><?php esc_html_e('Search', 'care-booking-block'); ?></button>
</div>
</div>
<table class="wp-list-table widefat fixed striped">
<thead>
<tr>
<td class="manage-column column-cb check-column">
<input type="checkbox" id="select-all-doctors" />
</td>
<th class="manage-column column-name column-primary">
<?php esc_html_e('Doctor Name', 'care-booking-block'); ?>
</th>
<th class="manage-column column-email">
<?php esc_html_e('Email', 'care-booking-block'); ?>
</th>
<th class="manage-column column-status">
<?php esc_html_e('Status', 'care-booking-block'); ?>
</th>
<th class="manage-column column-actions">
<?php esc_html_e('Actions', 'care-booking-block'); ?>
</th>
</tr>
</thead>
<tbody id="doctors-list">
<tr>
<td colspan="5" class="no-items">
<?php esc_html_e('No doctors found. Loading...', 'care-booking-block'); ?>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Services Tab -->
<div id="services-tab" class="tab-content">
<div class="tablenav top">
<div class="alignleft actions">
<select id="services-doctor-filter">
<option value=""><?php esc_html_e('All Doctors', 'care-booking-block'); ?></option>
</select>
<button type="button" class="button" id="filter-services">
<?php esc_html_e('Filter', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="refresh-services">
<span class="dashicons dashicons-update"></span>
<?php esc_html_e('Refresh', 'care-booking-block'); ?>
</button>
</div>
<div class="alignright actions">
<button type="button" class="button" id="bulk-block-services">
<span class="dashicons dashicons-hidden"></span>
<?php esc_html_e('Block Selected', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="bulk-unblock-services">
<span class="dashicons dashicons-visibility"></span>
<?php esc_html_e('Unblock Selected', 'care-booking-block'); ?>
</button>
</div>
</div>
<table class="wp-list-table widefat fixed striped">
<thead>
<tr>
<td class="manage-column column-cb check-column">
<input type="checkbox" id="select-all-services" />
</td>
<th class="manage-column column-name column-primary">
<?php esc_html_e('Service Name', 'care-booking-block'); ?>
</th>
<th class="manage-column column-doctor">
<?php esc_html_e('Doctor', 'care-booking-block'); ?>
</th>
<th class="manage-column column-status">
<?php esc_html_e('Status', 'care-booking-block'); ?>
</th>
<th class="manage-column column-actions">
<?php esc_html_e('Actions', 'care-booking-block'); ?>
</th>
</tr>
</thead>
<tbody id="services-list">
<tr>
<td colspan="5" class="no-items">
<?php esc_html_e('No services found. Select a doctor or click refresh.', 'care-booking-block'); ?>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Settings Tab -->
<div id="settings-tab" class="tab-content">
<form id="settings-form">
<table class="form-table" role="presentation">
<tbody>
<tr>
<th scope="row">
<label for="cache-timeout">
<?php esc_html_e('Cache Timeout', 'care-booking-block'); ?>
</label>
</th>
<td>
<input type="number" id="cache-timeout" name="cache_timeout" value="3600" min="300" max="86400" />
<p class="description">
<?php esc_html_e('Cache timeout in seconds (300-86400). Default: 3600 (1 hour).', 'care-booking-block'); ?>
</p>
</td>
</tr>
<tr>
<th scope="row">
<label for="admin-only">
<?php esc_html_e('Admin Only Mode', 'care-booking-block'); ?>
</label>
</th>
<td>
<input type="checkbox" id="admin-only" name="admin_only" />
<label for="admin-only">
<?php esc_html_e('Only apply restrictions on frontend (keep full access in admin)', 'care-booking-block'); ?>
</label>
</td>
</tr>
<tr>
<th scope="row">
<label for="css-injection">
<?php esc_html_e('CSS Injection', 'care-booking-block'); ?>
</label>
</th>
<td>
<input type="checkbox" id="css-injection" name="css_injection" checked />
<label for="css-injection">
<?php esc_html_e('Enable CSS injection to hide blocked elements', 'care-booking-block'); ?>
</label>
</td>
</tr>
</tbody>
</table>
<div class="settings-actions">
<button type="submit" class="button-primary">
<?php esc_html_e('Save Settings', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="clear-cache">
<span class="dashicons dashicons-trash"></span>
<?php esc_html_e('Clear Cache', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="export-settings">
<span class="dashicons dashicons-download"></span>
<?php esc_html_e('Export Settings', 'care-booking-block'); ?>
</button>
<button type="button" class="button" id="import-settings">
<span class="dashicons dashicons-upload"></span>
<?php esc_html_e('Import Settings', 'care-booking-block'); ?>
</button>
</div>
</form>
<!-- System Information -->
<div class="system-info">
<h3><?php esc_html_e('System Information', 'care-booking-block'); ?></h3>
<table class="wp-list-table widefat">
<tbody>
<tr>
<th><?php esc_html_e('Plugin Version', 'care-booking-block'); ?></th>
<td><?php echo esc_html(CARE_BOOKING_BLOCK_VERSION); ?></td>
</tr>
<tr>
<th><?php esc_html_e('WordPress Version', 'care-booking-block'); ?></th>
<td><?php echo esc_html(get_bloginfo('version')); ?></td>
</tr>
<tr>
<th><?php esc_html_e('PHP Version', 'care-booking-block'); ?></th>
<td><?php echo esc_html(PHP_VERSION); ?></td>
</tr>
<tr>
<th><?php esc_html_e('KiviCare Status', 'care-booking-block'); ?></th>
<td id="kivicare-status">
<span class="status-checking"><?php esc_html_e('Checking...', 'care-booking-block'); ?></span>
</td>
</tr>
<tr>
<th><?php esc_html_e('Database Table', 'care-booking-block'); ?></th>
<td id="database-status">
<span class="status-checking"><?php esc_html_e('Checking...', 'care-booking-block'); ?></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Success/Error Messages -->
<div class="care-booking-notices" style="display: none;">
<div class="notice notice-success is-dismissible" id="success-notice" style="display: none;">
<p><strong><?php esc_html_e('Success!', 'care-booking-block'); ?></strong> <span class="message"></span></p>
</div>
<div class="notice notice-error is-dismissible" id="error-notice" style="display: none;">
<p><strong><?php esc_html_e('Error!', 'care-booking-block'); ?></strong> <span class="message"></span></p>
</div>
<div class="notice notice-info is-dismissible" id="info-notice" style="display: none;">
<p><strong><?php esc_html_e('Info!', 'care-booking-block'); ?></strong> <span class="message"></span></p>
</div>
</div>
<!-- Hidden File Input for Import -->
<input type="file" id="import-file" accept=".json" style="display: none;" />
</div>
<!-- Doctor Row Template -->
<script type="text/template" id="doctor-row-template">
<tr data-doctor-id="{{id}}">
<th scope="row" class="check-column">
<input type="checkbox" class="doctor-checkbox" value="{{id}}" />
</th>
<td class="column-name column-primary">
<strong>{{name}}</strong>
<div class="row-actions">
<span class="view">
<a href="#" class="view-services" data-doctor-id="{{id}}">
<?php esc_html_e('View Services', 'care-booking-block'); ?>
</a>
</span>
</div>
</td>
<td class="column-email">{{email}}</td>
<td class="column-status">
<span class="status-badge {{status_class}}">{{status_text}}</span>
</td>
<td class="column-actions">
<button type="button" class="button toggle-doctor" data-doctor-id="{{id}}" data-blocked="{{is_blocked}}">
<span class="dashicons {{toggle_icon}}"></span>
{{toggle_text}}
</button>
</td>
</tr>
</script>
<!-- Service Row Template -->
<script type="text/template" id="service-row-template">
<tr data-service-id="{{id}}" data-doctor-id="{{doctor_id}}">
<th scope="row" class="check-column">
<input type="checkbox" class="service-checkbox" value="{{id}}" data-doctor-id="{{doctor_id}}" />
</th>
<td class="column-name column-primary">
<strong>{{name}}</strong>
</td>
<td class="column-doctor">{{doctor_name}}</td>
<td class="column-status">
<span class="status-badge {{status_class}}">{{status_text}}</span>
</td>
<td class="column-actions">
<button type="button" class="button toggle-service" data-service-id="{{id}}" data-doctor-id="{{doctor_id}}" data-blocked="{{is_blocked}}">
<span class="dashicons {{toggle_icon}}"></span>
{{toggle_text}}
</button>
</td>
</tr>
</script>