auth = new HVAC_Google_Sheets_Auth(); $this->manager = new HVAC_Google_Sheets_Manager(); add_action('wp_ajax_hvac_create_master_report', array($this, 'ajax_create_master_report')); add_action('wp_ajax_hvac_create_event_spreadsheet', array($this, 'ajax_create_event_spreadsheet')); add_action('wp_ajax_hvac_test_google_sheets_connection', array($this, 'ajax_test_connection')); add_action('wp_ajax_hvac_verify_folder_structure', array($this, 'ajax_verify_folder_structure')); } /** * Render Google Sheets admin page */ public function render_admin_page() { try { // Initialize with safe defaults $auth_status = array( 'has_credentials' => false, 'is_authenticated' => false, 'client_id' => 'Not configured', 'token_expires' => 'N/A' ); // Try to get auth status if ($this->auth) { $auth_status = $this->auth->get_config_status(); } // Initialize report variables $latest_report = null; $report_history = array(); // Try to get reports if manager is available if ($this->manager) { $latest_report = $this->manager->get_latest_master_report(); $report_history = $this->manager->get_master_report_history(); } ?>
Generate a comprehensive report with system overview, trainer performance, all events, and revenue analytics.
Create detailed spreadsheets for individual events with attendees, financial data, and event details.
No event spreadsheets created yet.
'; return; } foreach ($results as $result) { $sheet_data = maybe_unserialize($result->meta_value); if (is_array($sheet_data) && isset($sheet_data['url'])) { echo '