����JFIF��`�`�����Viewing File: /home/u820193700/domains/throtllr.in/public_html/admin/manage_inspections.php
<?php
require_once '../includes/db.php';
require_once '../includes/functions.php';
if(!is_logged_in()) { redirect("login.php"); }

// Fetch inspections
$stmt = $pdo->query("SELECT * FROM inspection_bookings ORDER BY created_at DESC");
$inspections = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Manage Inspections - ReOwn Admin</title>
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="admin.css">
</head>
<body>

<?php include 'admin_sidebar.php'; ?>

<div id="main-content">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h2>Manage Inspections</h2>
    </div>

    <div class="glass-card p-4">
        <div class="table-responsive">
            <table class="table table-dark table-hover align-middle">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>Customer Name</th>
                        <th>Phone</th>
                        <th>Preferred Date</th>
                        <th>Preferred Time</th>
                        <th>Status</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php if (count($inspections) > 0): ?>
                        <?php foreach($inspections as $insp): ?>
                        <tr>
                            <td><?php echo htmlspecialchars($insp['id']); ?></td>
                            <td><?php echo htmlspecialchars($insp['name']); ?></td>
                            <td><?php echo htmlspecialchars($insp['phone']); ?></td>
                            <td><?php echo htmlspecialchars($insp['preferred_date']); ?></td>
                            <td><?php echo htmlspecialchars($insp['preferred_time']); ?></td>
                            <td>
                                <?php 
                                $statusClass = 'bg-secondary';
                                if($insp['status'] == 'completed') $statusClass = 'bg-success';
                                if($insp['status'] == 'pending') $statusClass = 'bg-warning text-dark';
                                if($insp['status'] == 'cancelled') $statusClass = 'bg-danger';
                                ?>
                                <span class="badge <?php echo $statusClass; ?>"><?php echo ucfirst($insp['status']); ?></span>
                            </td>
                            <td>
                                <a href="view_inspection.php?id=<?php echo $insp['id']; ?>" class="btn btn-sm btn-outline-light me-1" title="View/Edit"><i class="fas fa-edit"></i></a>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    <?php else: ?>
                        <tr><td colspan="7" class="text-center text-muted">No inspections found.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Back to Directory �������}�!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������������� ������w�!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz������������������������������������������������������������������������ ��?��_��+��?��(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(���(�����