<?php include __DIR__ . '/../layouts/header.php'; ?>

<h1>Rent Payments</h1>
<a href="/rent/payments/create" class="btn btn-primary mb-3">Record Payment</a>
<table class="table table-bordered">
    <thead>
        <tr>
            <th>Date</th>
            <th>Property</th>
            <th>Period</th>
            <th>Amount</th>
            <th>Method</th>
            <th>Reference</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($payments as $p): ?>
        <tr>
            <td><?= $p['payment_date'] ?></td>
            <td><?= htmlspecialchars($p['property_name']) ?></td>
            <td><?= $p['period_month'] ?></td>
            <td><?= number_format($p['amount'], 2) ?></td>
            <td><?= $p['payment_method'] ?></td>
            <td><?= htmlspecialchars($p['reference']) ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

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