403Webshell
Server IP : 173.209.174.21  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : nodor ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/wcsd/School-alert/Backup files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/wcsd/School-alert/Backup files/dashboard.php.old1
<?php
session_start();
require 'config/db.php';

if (!isset($_SESSION['user_id'])) {
    header('Location: login.php');
    exit();
}

// Fetch active alerts
$stmt = $pdo->prepare("
    SELECT alerts.alert_id, alerts.type, alerts.message, alerts.status, alerts.timestamp, schools.name AS school_name
    FROM alerts
    JOIN schools ON alerts.school_id = schools.school_id
    WHERE alerts.status = 'active'
    ORDER BY alerts.timestamp DESC
");
$stmt->execute();
$active_alerts = $stmt->fetchAll();

// Fetch resolved (old) alerts
$stmt = $pdo->prepare("
    SELECT alerts.alert_id, alerts.type, alerts.message, alerts.status, alerts.timestamp, schools.name AS school_name
    FROM alerts
    JOIN schools ON alerts.school_id = schools.school_id
    WHERE alerts.status = 'resolved'
    ORDER BY alerts.timestamp DESC
");
$stmt->execute();
$resolved_alerts = $stmt->fetchAll();
?>

<?php include __DIR__ . '/views/header.php'; ?>
<h2>Dashboard</h2>

<h3>Active Alerts</h3>
<?php if (empty($active_alerts)): ?>
    <p>No active alerts.</p>
<?php else: ?>
    <?php foreach ($active_alerts as $alert): ?>
        <div class="alert">
            <h4>Alert Type: <?= htmlspecialchars($alert['type']) ?></h4>
            <p>School Name: <?= htmlspecialchars($alert['school_name']) ?></p>
            <p>Message: <?= htmlspecialchars($alert['message']) ?></p>
            <p><small>Timestamp: <?= $alert['timestamp'] ?></small></p>
            <form action="acknowledge.php" method="POST">
                <input type="hidden" name="alert_id" value="<?= $alert['alert_id'] ?>">
                <button type="submit">Acknowledge</button>
            </form>
        </div>
    <?php endforeach; ?>
<?php endif; ?>

<h3>Old Events</h3>
<?php if (empty($resolved_alerts)): ?>
    <p>No old events.</p>
<?php else: ?>
    <?php foreach ($resolved_alerts as $alert): ?>
        <div class="alert old-alert">
            <h4>Alert Type: <?= htmlspecialchars($alert['type']) ?></h4>
            <p>School Name: <?= htmlspecialchars($alert['school_name']) ?></p>
            <p>Message: <?= htmlspecialchars($alert['message']) ?></p>
            <p><small>Timestamp: <?= $alert['timestamp'] ?></small></p>
        </div>
    <?php endforeach; ?>
<?php endif; ?>

<?php include __DIR__ . '/views/footer.php'; ?>

Youez - 2016 - github.com/yon3zu
LinuXploit