<?php
// debug_logs.php - Place this in your admin area
require 'helpers.php';
require_committee();

echo "<h3>Recent SMS Debug Logs</h3>";
echo "<pre style='background: #f8f9fa; padding: 15px; border-radius: 5px;'>";

// Read the last 50 lines of error log
$logFile = '/path/to/your/error_log'; // You may need to adjust this path
if (file_exists($logFile)) {
    $logs = array_slice(file($logFile), -50);
    foreach ($logs as $log) {
        if (strpos($log, 'PHONE NUMBER DEBUG') !== false || 
            strpos($log, 'Processing phone') !== false ||
            strpos($log, 'Cleaned phone') !== false ||
            strpos($log, 'SMS') !== false) {
            echo htmlspecialchars($log);
        }
    }
} else {
    echo "Error log file not found. Check your PHP error_log path.";
}

echo "</pre>";
?>