SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,559
Folders
418
Scanned Size
3.85 GB
PHP Files
922
Editable Text Files
12,820
File viewer
guarded to /htdocs
/old/sms/dashboard.php
<?php declare(strict_types=1); require_once __DIR__ . '/bootstrap.php'; require_once __DIR__ . '/sender.php'; session_name('SI_SMS_DASH'); if (session_status() !== PHP_SESSION_ACTIVE) { session_start(['cookie_httponly' => true, 'cookie_secure' => true, 'cookie_samesite' => 'Strict']); } $error = ''; $notice = ''; if (isset($_POST['access_key'])) { if (hash_equals((string) SI_SMS_DASHBOARD_KEY, trim((string) $_POST['access_key']))) { session_regenerate_id(true); $_SESSION['si_sms_admin'] = true; } else { $error = 'Access key not accepted.'; } } if (isset($_POST['logout'])) { $_SESSION = []; session_destroy(); header('Location: dashboard.php'); exit; } $authorized = ($_SESSION['si_sms_admin'] ?? false) === true; if ($authorized && isset($_POST['send_sms'])) { $to = trim((string) ($_POST['to'] ?? '')); $message = trim((string) ($_POST['message'] ?? '')); if ($message === '') { $error = 'Enter a message.'; } else { $result = si_sms_send($to, $message); if ($result['ok']) { $notice = 'Text message submitted successfully.'; si_sms_log('dashboard_sms_sent', ['to' => $to, 'body' => $message]); } else { $error = (string) $result['error']; } } } $records = []; if ($authorized) { $logFile = rtrim((string) GUARDIAN_PRIVATE_ROOT, '/') . '/logs/si_sms.ndjson'; if (is_file($logFile) && is_readable($logFile)) { $lines = array_slice(file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [], -150); foreach (array_reverse($lines) as $line) { $row = json_decode($line, true); if (is_array($row)) $records[] = $row; } } } ?><!doctype html> <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"> <title>SI Text Operations</title> <style> :root{color-scheme:dark;--bg:#070a13;--panel:#11182a;--line:#263451;--text:#eef4ff;--muted:#91a3c4;--cyan:#49dcff;--violet:#a67cff;--ok:#48e59b;--bad:#ff6688}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 10% 0,#162344 0,transparent 35%),var(--bg);color:var(--text);font:15px system-ui,-apple-system,sans-serif}.wrap{width:min(1180px,94vw);margin:36px auto}.head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.brand{font-size:clamp(24px,4vw,44px);font-weight:800}.brand span{color:var(--cyan)}.grid{display:grid;grid-template-columns:360px 1fr;gap:18px}.card{background:color-mix(in srgb,var(--panel) 92%,transparent);border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:0 20px 70px #0008}label{display:block;margin:14px 0 6px;color:var(--muted)}input,textarea,button{width:100%;border:1px solid var(--line);border-radius:12px;background:#090e1b;color:var(--text);padding:12px;font:inherit}textarea{min-height:145px;resize:vertical}button{cursor:pointer;background:linear-gradient(120deg,var(--cyan),var(--violet));color:#050711;font-weight:800;margin-top:14px}.quiet{width:auto;background:transparent;color:var(--muted);padding:8px 12px}.alert{padding:12px;border-radius:12px;margin-bottom:14px}.error{background:#52172a;color:#ffd7e1}.notice{background:#123e32;color:#caffeb}.stats{display:flex;gap:10px;flex-wrap:wrap}.pill{border:1px solid var(--line);border-radius:999px;padding:8px 12px;color:var(--muted)}.list{display:grid;gap:10px;max-height:680px;overflow:auto}.event{border:1px solid var(--line);border-radius:14px;padding:13px}.event b{color:var(--cyan)}.meta{color:var(--muted);font-size:12px;margin-top:6px;overflow-wrap:anywhere}.empty{color:var(--muted);padding:40px;text-align:center}@media(max-width:800px){.grid{grid-template-columns:1fr}.head{align-items:flex-start;gap:15px;flex-direction:column}} </style></head><body><main class="wrap"><header class="head"><div><div class="brand"><span>SI</span> Text Operations</div><div class="stats"><span class="pill">Twilio SMS</span><span class="pill">Website alerts</span><span class="pill">Private logs</span></div></div><?php if($authorized):?><form method="post"><button class="quiet" name="logout">Sign out</button></form><?php endif?></header> <?php if($error):?><div class="alert error"><?=htmlspecialchars($error)?></div><?php endif?><?php if($notice):?><div class="alert notice"><?=htmlspecialchars($notice)?></div><?php endif?> <?php if(!$authorized):?><section class="card" style="max-width:460px"><h1>Private dashboard</h1><p style="color:var(--muted)">Enter the dashboard access key stored in the private configuration.</p><form method="post"><label>Access key</label><input type="password" name="access_key" required autofocus><button>Open dashboard</button></form></section> <?php else:?><div class="grid"><section class="card"><h2>Send a text</h2><form method="post"><input type="hidden" name="send_sms" value="1"><label>Destination</label><input name="to" value="<?=htmlspecialchars((string) SI_TRANSFER_NUMBER)?>" required><label>Message</label><textarea name="message" placeholder="SI alert or response" required></textarea><button>Send SMS</button></form><hr style="border:0;border-top:1px solid var(--line);margin:24px 0"><h2>Monitoring</h2><p style="color:var(--muted)">Cron endpoint:</p><div class="meta"><?=htmlspecialchars(rtrim((string) APP_BASE_URL,'/').'/SI/sms/monitor.php?key=PRIVATE')?></div></section><section class="card"><h2>Recent activity</h2><div class="list"><?php if(!$records):?><div class="empty">No SMS activity recorded yet.</div><?php endif?><?php foreach($records as $row):?><article class="event"><b><?=htmlspecialchars((string)($row['event']??'event'))?></b><div><?=htmlspecialchars((string)(($row['details']['body']??$row['details']['message']??'')))?></div><div class="meta"><?=htmlspecialchars((string)($row['time']??''))?> · <?=htmlspecialchars((string)($row['from']??''))?> → <?=htmlspecialchars((string)($row['to']??''))?></div></article><?php endforeach?></div></section></div><?php endif?></main></body></html>
Save file
Quick jump
open a path
Open