Viewing File: /home/quiczmwg/affordablerealtycorporation.com/admin/application_details.php

<?php
// session_start();
include 'head.php';
include 'header.php';
?>

<body class="skin-default fixed-layout">
<div id="main-wrapper">

    <?php 
    include 'sidebar.php';

    if (!isset($_GET['id']) || empty($_GET['id'])) {
        die("<div class='alert alert-danger text-center m-5'>Invalid request. No application ID provided.</div>");
    }

    $id = intval($_GET['id']);
    $sql = $conn->query("SELECT * FROM rental_applications WHERE id = $id");

    if ($sql->num_rows == 0) {
        die("<div class='alert alert-warning text-center m-5'>Application not found.</div>");
    }

    $app = $sql->fetch_assoc();
    ?>

<div class="page-wrapper">
    <section>
        <div class="">
        <?php include 'nav1.php'; ?>
            <div class="container-fluid">
                <div class="card">
                    <div class="card-header">
                        <h4>Application Details - <?php echo htmlspecialchars($app['full_name']); ?></h4>
                        <a href="manage_applications.php" class="btn btn-secondary btn-sm">← Back to Applications</a>
                    </div>
                    <div class="card-body">
                        <div class="table-responsive">
                            <table class="table table-bordered table-striped">
                                <tbody>
                                    <tr><th>ID</th><td><?php echo $app['id']; ?></td></tr>
                                    <tr><th>Full Name</th><td><?php echo htmlspecialchars($app['full_name']); ?></td></tr>
                                    <tr><th>Date of Birth</th><td><?php echo $app['dob'] ? date("j M Y", strtotime($app['dob'])) : "N/A"; ?></td></tr>
                                    <tr><th>Phone</th><td><?php echo htmlspecialchars($app['phone']); ?></td></tr>
                                    <tr><th>Pets</th><td><?php echo ($app['pets'] == "yes") ? "Yes - " . htmlspecialchars($app['pet_info']) : "No"; ?></td></tr>
                                    <tr><th>Smoker</th><td><?php echo ucfirst($app['smoke']); ?></td></tr>
                                    <tr><th>Current Address</th><td><?php echo nl2br(htmlspecialchars($app['current_address'])); ?></td></tr>
                                    <tr><th>Income Sources</th><td><?php echo nl2br(htmlspecialchars($app['income_sources'])); ?></td></tr>
                                    <tr><th>Income Amount</th><td><?php echo htmlspecialchars($app['income_amount']); ?></td></tr>
                                    <tr><th>Income Contact</th><td><?php echo nl2br(htmlspecialchars($app['income_contact'])); ?></td></tr>
                                    <tr><th>Income Duration</th><td><?php echo htmlspecialchars($app['income_duration']); ?></td></tr>
                                    <tr><th>Has Roommate</th><td><?php echo ucfirst($app['has_roommate']); ?></td></tr>
                                    <tr><th>Guarantor Name</th><td><?php echo htmlspecialchars($app['guarantor_name']); ?></td></tr>
                                    <tr><th>Guarantor Relationship</th><td><?php echo htmlspecialchars($app['guarantor_relationship']); ?></td></tr>
                                    <tr><th>Guarantor Phone</th><td><?php echo htmlspecialchars($app['guarantor_phone']); ?></td></tr>
                                    <tr><th>Housing Voucher</th><td><?php echo ($app['housing_voucher'] == "yes") ? "Yes - " . htmlspecialchars($app['voucher_type']) . " ($" . htmlspecialchars($app['voucher_amount']) . ")" : "No"; ?></td></tr>
                                    <tr><th>Issuing Authority</th><td><?php echo htmlspecialchars($app['issuing_authority']); ?></td></tr>
                                    <tr><th>Voucher Expiration</th><td><?php echo $app['voucher_expiration'] ? date("j M Y", strtotime($app['voucher_expiration'])) : "N/A"; ?></td></tr>
                                    <tr><th>Viewing Date</th><td><?php echo $app['viewing_date'] ? date("j M Y", strtotime($app['viewing_date'])) : "N/A"; ?></td></tr>
                                    <tr><th>Payment Option</th><td><?php echo htmlspecialchars($app['payment_option']); ?></td></tr>
                                    <tr><th>Application Created</th><td><?php echo date("j M Y, g:i a", strtotime($app['created_at'])); ?></td></tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="mt-3">
                            <a href="delete_application.php?id=<?php echo $app['id']; ?>" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this application?');">Delete Application</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
</div>

<?php include 'footer.php'; ?>
</body>
</html>
Back to Directory File Manager
<