<style>
    .close:focus {
        outline: none;
    }

    .top-right {
        top: 20px;
        right: 20px;
    }

    .toast {
        border: 1px solid coral
    }
</style>
<div class="content-wrapper clearfix">

    <?php require('./layout/headerpage.php'); ?>

    <div class="container col-12 mb-4 pb-5">
        <div class="row">
            <div class="col-12">
                <div class="col-12">
                    <div class="card  mx-2">
                        <div class="timeline-header bg-primary py-2 pl-2">
                            <b class="text-light judul"><span class="bi bi-clipboard-check"></span> Rekam Transaksi </b>
                        </div>

                        <!-- /.card-header -->
                        <div class="card-body my-0 mx-1">

                            <?php
                            //$class = new simakom_search();
                            //$showList = $class->search_input();
                            ?>
                            <table id="example51" class="table table-bordered table-striped table-hover table-sm mb-4 mt-3">
                                <thead>
                                    <tr>
                                        <th>No</th>
                                        <th>Bayar</th>
                                        <th>Edit</th>
                                        <th>NIS</th>
                                        <th>Nama User</th>
                                        <th>Kelas</th>
                                        <th>Telpon</th>

                                    </tr>
                                </thead>
                                <tbody>

                                    <?php
                                    //Pastikan webaddress sudah terisi
                                    $sekolah = new sekolah;
                                    //$webadres = $sekolah->dataSekolah('webaddress');
                                    if ($sekolah->dataSekolah('webaddress') == "") {
                                        $direct = new toast();
                                        echo  $direct->redirectID('toast', 'inputwebaddress', $sekolah->dataSekolah('id'), 'seting/lembaga');
                                    };

                                    //Delete Kuitansi Pdf sebelumnya
                                    $clsTransaksi = new transaksi;
                                    echo $clsTransaksi->delPdf('./view/transaksi/', "print_" . strtoupper($user_id));


                                    $crud = new crudData();
                                    $showSiswa = $crud->showTable($tb_siswa_min . " order by jenjang asc, paralel asc, nama asc");
                                    $no = 0;
                                    while ($data = $showSiswa->fetch(PDO::FETCH_OBJ)) {

                                        $id_siswa = $crud->getValue($tb_siswa, "where nis='$data->nis'", 'id');
                                        $hp_siswa = $crud->getValue($tb_siswa, "where nis='$data->nis'", 'hp');
                                        $link = new linkpage;

                                        if ($id_siswa == "") {
                                            $edit = "No ID";
                                        } else {
                                            $edit = "<a " . $link->pageID($id_siswa, 'seting/siswa/siswa_edit') . " class='badge badge-secondary  px-1 py-1 d-inline' > <i class='bi bi-pencil-square'></i> EDIT</a>";
                                        };

                                        $no++;
                                        echo "
                                                    <tr>                                                   
                                                        <td width='20px' align='center'>$no</td>
                                                        <td width='50px' align='center'>
                                                        <a " . $link->pageID($id_siswa, 'transaksi/transaksi_create') . " class='badge badge-success  px-1 py-1 d-inline'> <i class='bi bi-credit-card-2-back
                                                        '></i>  BAYAR</a>
                                                        </td>
                                                        <td width='50px' align='center'>$edit</td>
                                                        <td>$data->nis</td>
                                                        <td>$data->nama</td>                                                      
                                                        <td>$data->jenjang - $data->paralel</td>    
                                                        <td>$hp_siswa</td>                                              
                                                       
                                                    </tr>";
                                    }


                                    ?>

                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--/. container-fluid -->
        </section>
        <!-- /.content -->
    </div>
</div>