public function dashboard_page() { global $wpdb; $table_scans = $wpdb->prefix . 'muo_inventory_scans'; $table_website = $wpdb->prefix . 'muo_website_units'; $table_exceptions = $wpdb->prefix . 'muo_inventory_exceptions'; $latest_scans = $wpdb->get_results("SELECT * FROM {$table_scans} ORDER BY id DESC LIMIT 10"); $latest_website_rows = $wpdb->get_results("SELECT id, scan_id, dealer_id, stock_number, vin, year, make, model, trim, condition_type, page_type, vehicle_url FROM {$table_website} ORDER BY id DESC LIMIT 15"); $latest_exceptions = $wpdb->get_results("SELECT id, scan_id, dealer_id, stock_number, vin, year, make, model, inventory_status, website_status, issue_type, issue_note FROM {$table_exceptions} ORDER BY id DESC LIMIT 25"); echo '
DB Prefix: ' . esc_html($wpdb->prefix) . '
'; echo 'Website Table: ' . esc_html($table_website) . '
'; echo 'Exceptions Table: ' . esc_html($table_exceptions) . '
'; if (!empty($latest_scans)) { echo '| ID | '; echo 'Dealer ID | '; echo 'Status | '; echo 'Total Inventory Units | '; echo 'Total Website Units | '; echo 'Total Exceptions | '; echo 'Started | '; echo 'Completed | '; echo '
|---|---|---|---|---|---|---|---|
| ' . esc_html($scan->id) . ' | '; echo '' . esc_html($scan->dealer_id) . ' | '; echo '' . esc_html($scan->scan_status) . ' | '; echo '' . esc_html($scan->total_inventory_units) . ' | '; echo '' . esc_html($scan->total_website_units) . ' | '; echo '' . esc_html($scan->total_exceptions) . ' | '; echo '' . esc_html($scan->started_at) . ' | '; echo '' . esc_html($scan->completed_at) . ' | '; echo '
No scans yet.
'; } echo '| ID | '; echo 'Scan ID | '; echo 'Dealer ID | '; echo 'Stock # | '; echo 'VIN | '; echo 'Year | '; echo 'Make | '; echo 'Model | '; echo 'Trim | '; echo 'Condition | '; echo 'Page Type | '; echo 'URL | '; echo '
|---|---|---|---|---|---|---|---|---|---|---|---|
| ' . esc_html($row->id) . ' | '; echo '' . esc_html($row->scan_id) . ' | '; echo '' . esc_html($row->dealer_id) . ' | '; echo '' . esc_html($row->stock_number) . ' | '; echo '' . esc_html($row->vin) . ' | '; echo '' . esc_html($row->year) . ' | '; echo '' . esc_html($row->make) . ' | '; echo '' . esc_html($row->model) . ' | '; echo '' . esc_html($row->trim) . ' | '; echo '' . esc_html($row->condition_type) . ' | '; echo '' . esc_html($row->page_type) . ' | '; echo '' . esc_html($row->vehicle_url) . ' | '; echo '
No website rows found yet.
'; } echo '| ID | '; echo 'Scan ID | '; echo 'Dealer ID | '; echo 'Stock # | '; echo 'VIN | '; echo 'Year | '; echo 'Make | '; echo 'Model | '; echo 'Inventory Status | '; echo 'Website Status | '; echo 'Issue Type | '; echo 'Issue Note | '; echo '
|---|---|---|---|---|---|---|---|---|---|---|---|
| ' . esc_html($row->id) . ' | '; echo '' . esc_html($row->scan_id) . ' | '; echo '' . esc_html($row->dealer_id) . ' | '; echo '' . esc_html($row->stock_number) . ' | '; echo '' . esc_html($row->vin) . ' | '; echo '' . esc_html($row->year) . ' | '; echo '' . esc_html($row->make) . ' | '; echo '' . esc_html($row->model) . ' | '; echo '' . esc_html($row->inventory_status) . ' | '; echo '' . esc_html($row->website_status) . ' | '; echo '' . esc_html($this->friendly_issue_label($row->issue_type)) . ' | '; echo '' . esc_html($row->issue_note) . ' | '; echo '
No exceptions found yet.
'; } echo '