Server : LiteSpeed
System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : outerorb ( 1091)
PHP Version : 8.1.34
Disable Function : mail
Directory :  /home2/outerorb/assetradar.outerorbittech.com/admin/

📁 Create New:
⬆️ Upload File:
Current Dir [ Writable ] Root [ Writable ]


OR Upload from URL:
URL: Save as:

📄 File: alerts.php

Path: /home2/outerorb/assetradar.outerorbittech.com/admin/alerts.php

Size: 1.8 KB

Permissions: 0666

<?php
require_once __DIR__ . '/../inc/auth.php';
require_login();
$u = current_user();
require_admin();
define('ADMIN_PAGE', true);
include __DIR__ . '/../inc/header.php';
include __DIR__ . '/admin_menu.php';

// damaged items
$dam = $mysqli->query("SELECT i.*, u.name as assigned_name FROM items i LEFT JOIN users u ON i.assigned_to=u.id WHERE i.condition_status='Damaged'");
// warranty alerts (expiry within 30 days)
$warr = $mysqli->query("SELECT i.*, DATEDIFF(i.warranty_to, CURDATE()) as days_left FROM items i WHERE i.warranty_to IS NOT NULL AND DATEDIFF(i.warranty_to, CURDATE()) <= 30 ORDER BY days_left ASC");

?>
<div class="card p-3 card-hero">
  <h5>Alerts & Warranties</h5>
  <h6>Damaged Items</h6>
  <table class="table">
    <thead><tr><th>Asset</th><th>Name</th><th>Assigned</th><th>Action</th></tr></thead>
    <tbody>
    <?php while($r=$dam->fetch_assoc()): ?>
      <tr>
        <td><?php echo esc($r['asset_tag']); ?></td>
        <td><?php echo esc($r['item_name']); ?></td>
        <td><?php echo esc($r['assigned_name']); ?></td>
        <td><a class="btn btn-sm btn-primary" href="<?php echo BASE_URL; ?>/admin/assign_item.php?item_id=<?php echo $r['id']; ?>">Reassign</a></td>
      </tr>
    <?php endwhile; ?>
    </tbody>
  </table>

  <h6 class="mt-4">Warranties expiring within 30 days</h6>
  <table class="table">
    <thead><tr><th>Asset</th><th>Name</th><th>Warranty Expires</th><th>Days Left</th></tr></thead>
    <tbody>
      <?php while($w=$warr->fetch_assoc()): ?>
      <tr>
        <td><?php echo esc($w['asset_tag']); ?></td>
        <td><?php echo esc($w['item_name']); ?></td>
        <td><?php echo esc($w['warranty_to']); ?></td>
        <td><?php echo esc($w['days_left']); ?></td>
      </tr>
      <?php endwhile; ?>
    </tbody>
  </table>
</div>
<?php include __DIR__ . '/../inc/footer.php'; ?>

← Back to Directory Edit File 🔒 Chmod

WP File Manager