<form action="" method="post">

    <div class='row'>

        <div class="col-12 py-0 mb-0">
            <div class="row float-left">

                <div class="col-auto">
                    <button type="submit" class="btn btn-primary btn-xs mx-1 px-2 mt-0" name="backupBeranda"><i class="bi-fan"></i> PROSES</button>
                </div>
                <div class="col-auto">
                    <?php
                    $servroot = $_SERVER['DOCUMENT_ROOT'];
                    //$servweb = $_SERVER['HTTP_HOST'];
                    $clsTime = new time;
                    $metode = $clsTime->getDateBackup() . "_D";

                    $tp_back = substr($tahun, 0, 4) . '_' . substr($tahun, 5, 4);

                    if (file_exists($servroot . "/asset/backup/AKSSIMAKOM6_" . $tp_back . "_D.zip") || file_exists("../../asset/backup/AKSSIMAKOM6_" . $tp_back . "_D.zip")) {
                        $fileTime = date("d/m/Y h:i", filemtime("../../asset/backup/AKSSIMAKOM6_" . $tp_back . "_D.zip"));
                        echo "<a href='../../asset/backup/AKSSIMAKOM6_" . $tp_back . "_D.zip'><button type='button' class='btn btn-secondary btn-xs mx-1 mt-0' name='download'><i class='bi-download'></i> BACKUP.zip $fileTime</button></a>";
                    } else {
                        echo "";
                    };
                    if (file_exists($servroot . "/asset/backup/SISWA_" . $tp_back . ".xlsx") || file_exists("../../asset/backup/SISWA_" . $tp_back . ".xlsx")) {
                        $fileTime = date("d/m/Y h:i", filemtime("../../asset/backup/SISWA_" . $tp_back . ".xlsx"));
                        echo "<a href='../../asset/backup/SISWA_" . $tp_back . ".xlsx'><button type='button' class='btn btn-success btn-xs mx-1 mt-0' name='download'><i class='bi-file-earmark-excel'></i> SISWA.xlsx $fileTime</button></a>";
                    } else {
                        echo "";
                    };
                    if (file_exists($servroot . "/asset/backup/TRANSAKSI_" . $tp_back . ".xlsx") || file_exists("../../asset/backup/TRANSAKSI_" . $tp_back . ".xlsx")) {
                        $fileTime = date("d/m/Y h:i", filemtime("../../asset/backup/TRANSAKSI_" . $tp_back . ".xlsx"));
                        echo "<a href='../../asset/backup/TRANSAKSI_" . $tp_back . ".xlsx'><button type='button' class='btn btn-success btn-xs mx-1 mt-0' name='download'><i class='bi-file-earmark-excel'></i> TRANSAKSI.xlsx $fileTime</button></a>";
                    } else {
                        echo "";
                    };

                    echo $link->exportXlsxBeranda('seting/siswa/siswa_export', 'DB SISWA', $tb_siswa);
                    echo $link->exportXlsxBeranda('transaksi/transaksi_export', 'DB TRANSAKSI', $tb_transaksi);
                    ?>

                </div>

            </div>
            <div class="row col-12">
                <small class="ml-2 text-danger"><i>Sempatkan Backup dan Download File Backup untuk Cadangan Data</i></small>
            </div>
        </div>
    </div>
</form>