<?php
$clsLaporan = new tabungan_laporan;
$totalDebetToday = $clsLaporan->rekapTotalbyJenis($tabungan_transaksi, 'D', "tanggal='$today'");
$totalKreditToday = $clsLaporan->rekapTotalbyJenis($tabungan_transaksi, 'K', "tanggal='$today'");
$kasToday = $totalDebetToday - $totalKreditToday;
if ($kasToday > 0) {
    $signToday = " <span class='float-right text-warning'>
                     <i class='fas fa-arrow-up text-sm'></i>
               </span>";
    $text_color = "text-success";
} elseif ($kasToday == 0) {
    $signToday = " <span class='float-right text-warning'>
                     <i class='fas fa-arrow-right text-sm'></i>
               </span>";
    $text_color = "text-dark";
} else {
    $signToday = " <span class='float-right text-danger'>
                 <i class='fas fa-arrow-down text-sm'></i>
             </span>";
    $text_color = "text-danger";
}; ?>
<div class="row">
    <div class="col-12 col-sm-12">
        <div class="bg-light py-2 px-3 mt-1">
            <h2 class="mb-0 <?php echo $text_color; ?>" style="font-family:tahoma">
                Rp. <?php echo $format->ribuan($kasToday) . ' ' . $signToday; ?>
            </h2>
            <h5 class="mt-0 ">
                <p class="small footnote"><?php echo $format->hari($time->getDate()) . ', ' . $format->dateToIndo($time->getDate()); ?></p>
            </h5>
        </div>
        <hr>
        <div class="row">
            <div class="col-sm-12 col-md-12">
                <dl class="row">
                    <dt class="col-sm-4">DEBET</dt>
                    <dt class="col-sm-5">: Rp. <?php echo $format->ribuan($totalDebetToday); ?></dt>
                    <dt class="col-sm-4">KREDIT</dd>
                    <dt class="col-sm-5">: Rp. <?php echo $format->ribuan($totalKreditToday); ?></dt>
                </dl>
            </div>
        </div>
    </div>
</div>