<?php

include "../../layout/classModal.php";

$id = $_POST['rowid'];
$len = strlen($id);
$tahun = substr($id, -9, 9);
$id_siswa = substr($id, 0, $len - 9);

$tabungan_siswa = "tabungan_siswa" .  substr($tahun, 2, 2) . substr($tahun, 7, 2);
$tabungan_transaksi = "tabungan_transaksi" .  substr($tahun, 2, 2) . substr($tahun, 7, 2);

$cekID = new cekID();
$jmldata = $cekID->cek($tabungan_siswa, 'id', $id_siswa);

$clasCrud = new crudData();
$qry = $clasCrud->editData($tabungan_siswa, 'id', $id_siswa);
$data = $qry->fetch(PDO::FETCH_OBJ);

$clsCsrf = new csrf();
?>
<style>
    .fontInput {
        font-size: 11px;
        font-family: arial;
    }
</style>

<div class="info-box-content">
    <div class="col-sm-12 invoice-col pt-0">

        <form action="<?php $classPage = new linkpage();
                        echo $classPage->pageAction('transaksi/setor_exec'); ?>" method="post">
            <?php $clsCsrf->token(); ?>
            <input type="text" name="id" value="<?php echo $data->id; ?>" class="form-control form-control-sm fontInput" hidden>
            <div class="row">
                <label for="exampleEmail" class="col-sm-4 col-form-label">
                    <h4 style="font-family: 'Courier New', Courier, monospace;" class="mt-1">Jumlah </h4>
                </label>
                <div class="col-sm-8">
                    <input type="text" name="jumlah" value="" class="form-control form-control-lg fontInput" oninput="this.value=this.value.replace(/[aA-zZ.]/g,'').replace(/(\..*)./g,'$1');" style="font-size: large; text-align:right" required>
                </div>
            </div>
            <div class="row">
                <label for="exampleEmail" class="col-sm-4 col-form-label">
                    <h4 style="font-family: 'Courier New', Courier, monospace;" class="mt-1">Catatan </h4>
                </label>
                <div class="col-sm-8">
                    <input type="text" name="catatan" value="" class="form-control form-control-lg fontInput" style="font-size: small; text-align:left">
                </div>
            </div>
            <div class="row mt-4">
                <div class="col-auto">
                    <button type="submit" class="btn btn-primary btn-xs float-left" name="submitsetor"><i class="bi-save"></i> Simpan</button>
                </div>
            </div>
        </form>
    </div>
</div>