<!DOCTYPE html>
<html>
<head>
    <style>
        body { font-family: sans-serif; font-size: 12px; }
        h2 { text-align: center; }
        table { width: 100%; border-collapse: collapse; margin-top: 10px; }
        th, td { border: 1px solid #000; padding: 6px; }
        th { background: #eee; }
    </style>
</head>
<body>

<h2>LAPORAN KEUANGAN</h2>
<p>Bulan: <?= $bulan ?> / <?= $tahun ?></p>

<!-- IURAN -->
<h3>IURAN MASUK</h3>
<table>
<tr><th>Tanggal</th><th>Jumlah</th></tr>
<?php while($d = $iuran_masuk->fetch_assoc()): ?>
<tr>
<td><?= $d['tanggal_bayar'] ?></td>
<td>Rp <?= number_format($d['jumlah']) ?></td>
</tr>
<?php endwhile; ?>
</table>

<h3>IURAN KELUAR</h3>
<table>
<tr><th>Tanggal</th><th>Jumlah</th><th>Keterangan</th></tr>
<?php while($d = $iuran_keluar->fetch_assoc()): ?>
<tr>
<td><?= $d['tanggal'] ?></td>
<td>Rp <?= number_format($d['jumlah']) ?></td>
<td><?= $d['keterangan'] ?></td>
</tr>
<?php endwhile; ?>
</table>

<!-- VENDOR -->
<h3>KAS VENDOR MASUK</h3>
<table>
<tr><th>Tanggal</th><th>Jumlah</th><th>Keterangan</th></tr>
<?php while($d = $vendor_masuk->fetch_assoc()): ?>
<tr>
<td><?= $d['tanggal'] ?></td>
<td>Rp <?= number_format($d['jumlah']) ?></td>
<td><?= $d['keterangan'] ?></td>
</tr>
<?php endwhile; ?>
</table>

<h3>KAS VENDOR KELUAR</h3>
<table>
<tr><th>Tanggal</th><th>Jumlah</th><th>Keterangan</th></tr>
<?php while($d = $vendor_keluar->fetch_assoc()): ?>
<tr>
<td><?= $d['tanggal'] ?></td>
<td>Rp <?= number_format($d['jumlah']) ?></td>
<td><?= $d['keterangan'] ?></td>
</tr>
<?php endwhile; ?>
</table>

</body>
</html>