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/incoming.php
<?php declare(strict_types=1); require_once __DIR__ . '/bootstrap.php'; $body = trim(si_sms_post('Body')); $normalized = strtolower($body); $sender = si_sms_post('From'); $senderDigits=preg_replace('/\D/','',$sender)??''; $isKeith=in_array($senderDigits,['18707275153','18703088682'],true); $isJamesGlass=$senderDigits==='19728322044'; $knownName='';$contactsFile=(defined('GUARDIAN_PRIVATE_ROOT')?rtrim((string)GUARDIAN_PRIVATE_ROOT,'/'):dirname($_SERVER['DOCUMENT_ROOT']??__DIR__).'/private').'/si_contacts.php'; if(is_readable($contactsFile))foreach((array)(require $contactsFile) as $contact){$digits=preg_replace('/\D/','',(string)($contact['number']??''))??'';if($digits===$senderDigits){$knownName=(string)($contact['first_name']??$contact['name']??'');break;}} si_sms_log('incoming_sms', [ 'body' => $body, 'media_count' => si_sms_post('NumMedia', '0'), ]); if ($body === '') { si_sms_reply('SI received an empty message. Text HELP to see available options.'); } if($isKeith && preg_match('/^(task|remind|call)\b[: ]*(.+)$/i',$body,$m)===1){ $kind=strtolower($m[1]);$task=trim($m[2]);si_sms_add_task($task,$sender,$kind); si_sms_log('keith_task_created',['type'=>$kind,'task'=>$task]); si_sms_reply('SIMON saved this '.$kind.': '.$task.'. Calls to another person will wait for your approval in the operations dashboard.'); } /* Private travel notifications requested by Keith. These are text-triggered, not background location tracking. */ if($isJamesGlass && preg_match('/\b(out of town|leaving town|away from town|traveling)\b/i',$body)===1){ $ok=si_sms_send('+18707275153','SIMON update from James Glass: '.$body); si_sms_log('travel_notice_to_keith',['from'=>'James Glass','message'=>$body,'delivered'=>$ok]); si_sms_reply($ok?'Thanks, James. SIMON told Keith that you will be out of town.':'Thanks, James. SIMON saved this for Keith, but the delivery needs attention.'); } if($isKeith && preg_match('/\b(leaving|leave|headed|heading|going|departing)\b.*\b(for|to)\s+dallas\b/i',$body)===1){ $ok=si_sms_send('+19728322044','SIMON travel update: Keith is leaving for Dallas.'); si_sms_log('keith_departure_to_dallas',['notified'=>'James Glass','delivered'=>$ok]); si_sms_reply($ok?'SIMON notified James Glass that you are leaving for Dallas.':'SIMON saved the Dallas departure, but the message to James needs attention.'); } if($isKeith && preg_match('/\b(leaving|left|departing|departed)\s+(from\s+)?dallas\b/i',$body)===1){ $ok=si_sms_send('+14797791135','SIMON travel update: Keith has left Dallas.'); si_sms_log('keith_departure_from_dallas',['notified'=>'Kay Whitehead mobile','delivered'=>$ok]); si_sms_reply($ok?'SIMON notified Kay Whitehead that you left Dallas.':'SIMON saved your Dallas departure, but the message to Kay needs attention.'); } if(preg_match('/\b(urgent|important|critical|immediately)\b/i',$body)===1){ si_sms_log('priority_message',['message'=>$body,'sender'=>$sender]); si_sms_send('+18707275153','SIMON priority clarification needed from '.$sender.': '.$body); si_sms_reply('SIMON marked this important and sent it directly to Keith Ballard for clarification.'); } if (preg_match('/\b(stop|unsubscribe|cancel|end|quit)\b/i', $normalized) === 1) { si_sms_log('opt_out_requested'); si_sms_reply('You requested to stop messages. Twilio will process the opt-out for this number.'); } if (preg_match('/\b(help|menu|options|start)\b/i', $normalized) === 1) { si_sms_reply( 'SI menu: text STATUS for SIMON status, SALES for sales, PUBLISHING for books, ' . 'WEB360 for Web360 support, NEWS for live-feed information, MESSAGE to leave a message, ' . 'or type your question.' ); } if (preg_match('/\b(status|health|simon status|system)\b/i', $normalized) === 1) { si_sms_log('status_request'); si_sms_reply( 'SIMON is online for SMS testing. Telephone voice routing is staged for a later upgrade. ' . 'Reply HELP for available SI options.' ); } if (preg_match('/\b(sales|buy|price|pricing|order|purchase)\b/i', $normalized) === 1) { si_sms_log('sales_request'); si_sms_reply( 'Thank you for contacting Gaylord Sinclair sales. Tell SI which book, product, or service ' . 'interests you, along with the best name for follow-up.' ); } if (preg_match('/\b(publishing|book|author|manuscript|editing|publisher)\b/i', $normalized) === 1) { si_sms_log('publishing_request'); si_sms_reply( 'You reached Gaylord Sinclair Publishing. Please send the title or service you are asking ' . 'about and SI will organize the request for follow-up.' ); } if (preg_match('/\b(web ?360|website|builder|app|php|support)\b/i', $normalized) === 1) { si_sms_log('web360_request'); si_sms_reply( 'SI recorded your Web360 or technical-support request. Describe the problem, page address, ' . 'and any error shown so it can be routed correctly.' ); } if (preg_match('/\b(news|headline|feed|weather|briefing)\b/i', $normalized) === 1) { si_sms_log('feed_request'); si_sms_reply( 'Live-feed answers are the next connection stage. SI recorded this request; current SMS ' . 'testing supports routing, status, messages, publishing, sales, and Web360 questions.' ); } if (preg_match('/\b(message|contact|call me|callback|keith|human|person)\b/i', $normalized) === 1) { si_sms_log('follow_up_requested', ['message' => $body]); si_sms_reply( 'SI recorded your follow-up request. Please reply with your name, the best callback number, ' . 'and a short description of what you need.' ); } si_sms_log('general_question', ['question' => $body, 'sender' => $sender]); if (defined('OPENAI_API_KEY') && !str_contains((string) OPENAI_API_KEY, 'PASTE_')) { si_sms_reply( 'SI received your question and saved it for the connected intelligence response stage. ' . 'For this first test, reply HELP to use an active routing option.' ); } $preview = function_exists('mb_substr') ? mb_substr($body, 0, 180) : substr($body, 0, 180); si_sms_reply( ($knownName!==''?'Hi '.$knownName.'. ':'').'SIMON received: "' . $preview . '". ' . 'I will help as best I can, organize the request, or ask Keith for clarification when needed.' );
Save file
Quick jump
open a path
Open