Please log in to view the dashboard.
'; } if (!current_user_can('view_hvac_dashboard')) { return 'You do not have permission to view this dashboard.
$
Target: $| Status | Event Name | Date | Organizer | Capacity | Sold | Revenue | Actions |
|---|---|---|---|---|---|---|---|
| $ | Edit | Summary |
No events found.
$html, 'count' => count($events), 'status' => $status )); } /** * Enqueue dashboard assets (CSS and JavaScript) */ public function enqueue_dashboard_assets() { // Check if we're on the dashboard page global $post; if (!is_a($post, 'WP_Post') || !has_shortcode($post->post_content, 'hvac_trainer_dashboard')) { return; } // Enqueue UX enhancements (CSS and JS) wp_enqueue_style( 'hvac-ux-enhancements-css', HVAC_CE_PLUGIN_URL . 'assets/css/hvac-ux-enhancements.css', array(), HVAC_CE_VERSION ); wp_enqueue_script( 'hvac-ux-enhancements-js', HVAC_CE_PLUGIN_URL . 'assets/js/hvac-ux-enhancements.js', array('jquery'), HVAC_CE_VERSION, true ); // Enqueue dashboard JavaScript wp_enqueue_script( 'hvac-dashboard-js', HVAC_CE_PLUGIN_URL . 'assets/js/hvac-dashboard.js', array('jquery', 'hvac-ux-enhancements-js'), HVAC_CE_VERSION, true ); // Localize script with AJAX URL and nonce wp_localize_script('hvac-dashboard-js', 'hvac_dashboard', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('hvac_dashboard_nonce') )); // Inline CSS for now - can be moved to external file later $css = ' .hvac-dashboard-wrapper { max-width: 1200px; margin: 0 auto; padding: 20px; } .hvac-dashboard-header { margin-bottom: 30px; } .hvac-dashboard-header h1 { margin-bottom: 20px; } .hvac-dashboard-nav { display: flex; gap: 10px; flex-wrap: wrap; } .hvac-button { display: inline-block; padding: 10px 20px; text-decoration: none; border-radius: 4px; transition: all 0.3s ease; } .hvac-button-primary { background-color: #E9AF28; color: #000; } .hvac-button-primary:hover { background-color: #d49b20; } .hvac-button-secondary { background-color: #0B5C7D; color: #fff; } .hvac-button-secondary:hover { background-color: #084562; } .hvac-dashboard-stats { margin-bottom: 40px; } .hvac-stats-row { display: flex; flex-direction: row; flex-wrap: wrap; margin: -10px; /* Counteract the padding on columns */ justify-content: space-between; align-items: stretch; margin-top: 20px; } .hvac-stat-col { flex: 1; min-width: 160px; /* Ensure minimum width for readability */ padding: 10px; } .hvac-stat-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 20px; text-align: center; } .hvac-stat-card h3 { margin: 0 0 10px; font-size: 16px; color: #666; } .hvac-stat-card .metric-value { font-size: 32px; font-weight: bold; color: #E9AF28; margin: 0; } .hvac-stat-card small { display: block; margin-top: 5px; color: #666; } .hvac-dashboard-events { margin-top: 40px; } .hvac-event-filters { margin: 20px 0; display: flex; gap: 10px; align-items: center; } .hvac-filter { padding: 5px 15px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; color: #333; transition: all 0.3s ease; } .hvac-filter:hover, .hvac-filter-active { background-color: #E9AF28; color: #000; border-color: #E9AF28; } .hvac-events-table-wrapper { overflow-x: auto; } .hvac-events-table { width: 100%; border-collapse: collapse; margin-top: 20px; } .hvac-events-table th, .hvac-events-table td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; } .hvac-events-table th { background-color: #f8f9fa; font-weight: bold; } .hvac-events-table tr:hover { background-color: #f8f9fa; } .hvac-events-table a { color: #0B5C7D; text-decoration: none; } .hvac-events-table a:hover { text-decoration: underline; } @media (max-width: 768px) { .hvac-stats-grid { grid-template-columns: 1fr; } .hvac-events-table { font-size: 14px; } .hvac-events-table th, .hvac-events-table td { padding: 8px; } } '; wp_add_inline_style('astra-theme-css', $css); } } // Initialize the dashboard new HVAC_Dashboard();