0 ? date('Y-m-d H:i', $v) : '-'; } function h($v) { return htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8'); } // ── Connected schools (tokens are NOT selected) ────────────────────────────── $connected = []; $pending = []; $error = ''; if ($dbReady) { $sql = "SELECT record_num, school_name, square_merchant_id, square_merchant_name, square_location_id, square_currency, square_country, square_ready, square_connected_at, square_token_expires_at, square_merchant_key, square_status_issues, square_status_checked_at, square_authorization_revoked, (square_access_token IS NOT NULL AND square_access_token <> '') AS has_access, (square_refresh_token IS NOT NULL AND square_refresh_token <> '') AS has_refresh FROM schools WHERE square_merchant_id IS NOT NULL AND square_merchant_id <> '' ORDER BY square_connected_at DESC"; $r = db_query($sql); if ($r) { while ($row = db_fetch_assoc($r)) { $connected[] = $row; } } $pr = db_query( "SELECT state, school_num, status, merchant_id, created_at, connected_at, last_callback FROM square_pending_onboarding ORDER BY created_at DESC LIMIT 50" ); if ($pr) { while ($row = db_fetch_assoc($pr)) { $pending[] = $row; } } } else { $error = 'Host database layer (db_query) is not available — cannot read.'; } ?>
Read-only snapshot from the live database. Tokens are never shown.
square_connected.php from production when finished.No schools have a Square connection yet.
| record_num | School | Merchant | Location | Currency | Ready | Tokens | Connected | Token expires | Embed key | Issues |
|---|---|---|---|---|---|---|---|---|---|---|
|
|
revoked ready not ready | access refresh | ' . h($c['square_merchant_key']) . '' : '—'; ?> | none'; ?> |
No onboarding attempts recorded.
| school_num (record_num) |
Status | Merchant id | Created | Connected | Last callback | State |
|---|---|---|---|---|---|---|
|
' . h($st) . ''; ?> | ' . h($p['merchant_id']) . '' : '—'; ?> | … |