HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/AppData/Roaming/Code/User/History/655c119a/IL6V.php
<?php
// Inside your dashboard.php
$statsFile = 'script_stats.json';
$scriptStats = file_exists($statsFile) ? json_decode(file_get_contents($statsFile), true) : [];
?>

<div class="card">
    <h3>Script Activations (Global)</h3>
    <table style="width:100%; border-collapse: collapse;">
        <thead>
            <tr style="background:#f8f9fa;">
                <th style="padding:10px;">Script Name</th>
                <th style="padding:10px;">Total Hits</th>
                <th style="padding:10px;">Last Active (Taipei)</th>
            </tr>
        </thead>
        <tbody>
            <?php if(empty($scriptStats)): ?>
                <tr><td colspan="3" style="padding:10px; text-align:center;">No scripts monitored yet.</td></tr>
            <?php else: ?>
                <?php foreach($scriptStats as $name => $info): ?>
                <tr>
                    <td style="padding:10px; border-bottom:1px solid #eee;"><?php echo htmlspecialchars($name); ?></td>
                    <td style="padding:10px; border-bottom:1px solid #eee;"><span class="badge"><?php echo $info['hits']; ?></span></td>
                    <td style="padding:10px; border-bottom:1px solid #eee; font-size:0.8rem; color:#666;"><?php echo $info['last_seen']; ?></td>
                </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </tbody>
    </table>
</div>