<?= $this->extend('layouts/owner') ?>

<?= $this->section('content') ?>

<div class="container-fluid">

    <div class="row mb-3">

        <div class="col-md-6">

            <h3>

                <i class="fas fa-money-bill-wave"></i>

                Cash Flow

            </h3>

        </div>

        <div class="col-md-6 text-end">

            <a href="<?= base_url('owner/finance') ?>" class="btn btn-secondary">

                Kembali

            </a>

        </div>

    </div>

    <div class="card shadow">

        <div class="card-header bg-success text-white">

            Data Cash Flow

        </div>

        <div class="card-body">

            <table class="table table-bordered table-hover">

                <thead class="table-dark">

                <tr>

                    <th>No</th>

                    <th>Tanggal</th>

                    <th>Jenis</th>

                    <th>Keterangan</th>

                    <th>Jumlah</th>

                </tr>

                </thead>

                <tbody>

                <?php $no=1; ?>

                <?php foreach($cashflows as $row): ?>

                <tr>

                    <td><?= $no++ ?></td>

                    <td><?= $row['tanggal'] ?></td>

                    <td>

                        <?php if($row['jenis']=="Masuk"): ?>

                            <span class="badge bg-success">

                                MASUK

                            </span>

                        <?php else: ?>

                            <span class="badge bg-danger">

                                KELUAR

                            </span>

                        <?php endif ?>

                    </td>

                    <td>

                        <?= esc($row['keterangan']) ?>

                    </td>

                    <td>

                        Rp <?= number_format($row['jumlah'],0,',','.') ?>

                    </td>

                </tr>

                <?php endforeach ?>

                </tbody>

            </table>

        </div>

    </div>

</div>

<?= $this->endSection() ?>