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,027
Folders
377
Scanned Size
3.79 GB
PHP Files
791
Editable Text Files
12,311
File viewer
guarded to /htdocs
/gaylord/demo/inc/inbox.php
<?php declare(strict_types=1); function inbox_rows(int $uid): array { $s=db()->prepare("SELECT u.*, MAX(m.created_at) last_message, MAX(m.body) last_body, SUM(CASE WHEN m.recipient_id=? AND m.read_at IS NULL THEN 1 ELSE 0 END) unread FROM users u JOIN messages m ON (m.sender_id=u.id AND m.recipient_id=?) OR (m.recipient_id=u.id AND m.sender_id=?) GROUP BY u.id ORDER BY last_message DESC"); $s->execute([$uid,$uid,$uid]); return $s->fetchAll(); } function render_inbox(array $me): void { $rows=inbox_rows((int)$me['id']); $chatName=(string)($_GET['chat'] ?? ''); $chat=null; if($chatName){ $s=db()->prepare('SELECT * FROM users WHERE username=?'); $s->execute([$chatName]); $chat=$s->fetch() ?: null; } if(!$chat && $rows) $chat=$rows[0]; $msgs=[]; if($chat){$s=db()->prepare('SELECT * FROM messages WHERE (sender_id=? AND recipient_id=?) OR (sender_id=? AND recipient_id=?) ORDER BY id ASC');$s->execute([(int)$me['id'],(int)$chat['id'],(int)$chat['id'],(int)$me['id']]);$msgs=$s->fetchAll();} ?> <section class="inbox-v3"> <aside class="conversation-col"><h2>Messages</h2><?php foreach($rows as $r): ?><a class="conversation-card <?=$chat && (int)$chat['id']===(int)$r['id']?'active':''?>" href="<?=e(view_url('inbox',['chat'=>$r['username']]))?>"><img src="<?=user_avatar($r)?>" alt=""><span><b><?=e($r['display_name'])?></b><small><?=e($r['last_body'])?></small></span><?php if((int)$r['unread']):?><em><?=(int)$r['unread']?></em><?php endif;?></a><?php endforeach; ?></aside> <main class="chat-col"><?php if(!$chat): ?><div class="empty-state">Select a conversation.</div><?php else: ?><div class="chat-head"><a href="<?=e(view_url('profile',['id'=>(int)$chat['id']]))?>"><img src="<?=user_avatar($chat)?>" alt=""></a><div><h2><?=e($chat['display_name'])?></h2><p>@<?=e($chat['username'])?> · <?=e($chat['profile_status'])?></p></div></div><div class="chat-stream"><?php foreach($msgs as $m): ?><div class="bubble <?=((int)$m['sender_id']===(int)$me['id'])?'mine':''?>"><p><?=nl2br(e($m['body']))?></p><time><?=e($m['created_at'])?></time></div><?php endforeach; ?></div><form class="composer" method="post"><input type="hidden" name="csrf" value="<?=e(csrf_token())?>"><input type="hidden" name="action" value="send_message"><input type="hidden" name="to" value="<?=e($chat['username'])?>"><textarea name="body" placeholder="Message <?=e($chat['display_name'])?>…"></textarea><button class="send-btn">Send</button></form><?php endif; ?></main> <aside class="context-col"><?php if($chat): ?><div class="mini-profile"><img src="<?=user_avatar($chat)?>"><h3><?=e($chat['display_name'])?></h3><p><?=e($chat['vibe'])?></p><a class="glass-btn" href="<?=e(view_url('profile',['id'=>(int)$chat['id']]))?>">View Profile</a></div><?php endif; ?><div class="ai-nudge"><b>AI Suggestions</b><p>Ask about shared interests, events nearby, or profile details.</p></div><div class="notice-card"><b>Notification Center</b><p>Message alerts and profile events dock here.</p></div></aside> </section> <?php }
Save file
Quick jump
open a path
Open