<?php
date_default_timezone_set('Asia/Jakarta');
$tanggal = mktime(date("m"), date("d"), date("Y"));
$tglsekarang = date("d-m-Y", $tanggal);


if (isset($_POST['tanggal'])) {
    $tanggal = $_POST['tanggal'];
} else {
    $classTime = new time();
    $tanggal =  $classTime->getDateInput();
};
$format = new format();
$tanggalBuku = $format->dateToEng($tanggal);

$lembaga = new lembaga();
if (isset($_POST['bulan'])) {
    $bulan = $_POST['bulan'];
    //$periode = $_POST['bulan'];
    $v_bulan = $lembaga->ValPeriode($bulan, $tahun1, $tahun2);
} else {
    $bulan = $lembaga->nowPeriode();
    //$periode = $lembaga->nowPeriode();
    $v_bulan = $lembaga->ValPeriode($bulan, $tahun1, $tahun2);
};


$classNeraca = new simakom_neraca();

?>

<div class="row col-md-12 mt-2">
    <div class="col-sm-12 invoice-col">
        <form action="" method="post">
            <div class="row">
                <label class="col-sm-2 col-form-label">Periode </label>
                <div class="col-md-7">
                    <select name="bulan" class="form-control form-control-sm fontInput small">
                        <option value="<?php echo $bulan; ?>"><?php echo $v_bulan; ?></option>
                        <?php
                        $oplist = $lembaga->listPeriode($tahun1, $tahun2);
                        echo $oplist;
                        ?>
                    </select>
                </div>
                <div class="col-md-3 mt-1">
                    <button type="submit" class="btn btn-primary btn-xs float-left " name="save"><i class="bi-funnel"></i> <b> SUBMIT</b></button>
                </div>
            </div>
        </form>

    </div>
</div>



<?php
$class = new simakom_search();
//$showList = $class->search_input();
?>
<table class="table table-bordered table-hover table-sm mb-0 mt-2">
    <thead>
        <tr>
            <th>Uraian</th>
            <th width="200">Jumlah</th>
        </tr>
    </thead>
</table>

<table id="searchtable" class="table table-bordered table-sm  mt-0 mb-0">

    <tbody>
        <?php echo $classNeraca->viewJurnal($tb_siswa, $tb_transaksi,  $tb_transaksi_aks, $tb_jurnal, $periode, $tahun);

        ?>

    </tbody>
</table>