<?php

namespace PHPMaker2021\rdigital21;

// Page object
$WaliKelasDelete = &$Page;
?>
<script>
var currentForm, currentPageID;
var fwali_kelasdelete;
loadjs.ready("head", function () {
    var $ = jQuery;
    // Form object
    currentPageID = ew.PAGE_ID = "delete";
    fwali_kelasdelete = currentForm = new ew.Form("fwali_kelasdelete", "delete");
    loadjs.done("fwali_kelasdelete");
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<script>
if (!ew.vars.tables.wali_kelas) ew.vars.tables.wali_kelas = <?= JsonEncode(GetClientVar("tables", "wali_kelas")) ?>;
</script>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<form name="fwali_kelasdelete" id="fwali_kelasdelete" class="form-inline ew-form ew-delete-form" action="<?= CurrentPageUrl(false) ?>" method="post">
<?php if (Config("CHECK_TOKEN")) { ?>
<input type="hidden" name="<?= $TokenNameKey ?>" value="<?= $TokenName ?>"><!-- CSRF token name -->
<input type="hidden" name="<?= $TokenValueKey ?>" value="<?= $TokenValue ?>"><!-- CSRF token value -->
<?php } ?>
<input type="hidden" name="t" value="wali_kelas">
<input type="hidden" name="action" id="action" value="delete">
<?php foreach ($Page->RecKeys as $key) { ?>
<?php $keyvalue = is_array($key) ? implode(Config("COMPOSITE_KEY_SEPARATOR"), $key) : $key; ?>
<input type="hidden" name="key_m[]" value="<?= HtmlEncode($keyvalue) ?>">
<?php } ?>
<div class="card ew-card ew-grid">
<div class="<?= ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<table class="table ew-table">
    <thead>
    <tr class="ew-table-header">
<?php if ($Page->kode_tapel->Visible) { // kode_tapel ?>
        <th class="<?= $Page->kode_tapel->headerCellClass() ?>"><span id="elh_wali_kelas_kode_tapel" class="wali_kelas_kode_tapel"><?= $Page->kode_tapel->caption() ?></span></th>
<?php } ?>
<?php if ($Page->nama->Visible) { // nama ?>
        <th class="<?= $Page->nama->headerCellClass() ?>"><span id="elh_wali_kelas_nama" class="wali_kelas_nama"><?= $Page->nama->caption() ?></span></th>
<?php } ?>
<?php if ($Page->nip->Visible) { // nip ?>
        <th class="<?= $Page->nip->headerCellClass() ?>"><span id="elh_wali_kelas_nip" class="wali_kelas_nip"><?= $Page->nip->caption() ?></span></th>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
        <th class="<?= $Page->kelas->headerCellClass() ?>"><span id="elh_wali_kelas_kelas" class="wali_kelas_kelas"><?= $Page->kelas->caption() ?></span></th>
<?php } ?>
<?php if ($Page->pass->Visible) { // pass ?>
        <th class="<?= $Page->pass->headerCellClass() ?>"><span id="elh_wali_kelas_pass" class="wali_kelas_pass"><?= $Page->pass->caption() ?></span></th>
<?php } ?>
    </tr>
    </thead>
    <tbody>
<?php
$Page->RecordCount = 0;
$i = 0;
while (!$Page->Recordset->EOF) {
    $Page->RecordCount++;
    $Page->RowCount++;

    // Set row properties
    $Page->resetAttributes();
    $Page->RowType = ROWTYPE_VIEW; // View

    // Get the field contents
    $Page->loadRowValues($Page->Recordset);

    // Render row
    $Page->renderRow();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php if ($Page->kode_tapel->Visible) { // kode_tapel ?>
        <td <?= $Page->kode_tapel->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_wali_kelas_kode_tapel" class="wali_kelas_kode_tapel">
<span<?= $Page->kode_tapel->viewAttributes() ?>>
<?= $Page->kode_tapel->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->nama->Visible) { // nama ?>
        <td <?= $Page->nama->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_wali_kelas_nama" class="wali_kelas_nama">
<span<?= $Page->nama->viewAttributes() ?>>
<?= $Page->nama->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->nip->Visible) { // nip ?>
        <td <?= $Page->nip->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_wali_kelas_nip" class="wali_kelas_nip">
<span<?= $Page->nip->viewAttributes() ?>>
<?= $Page->nip->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
        <td <?= $Page->kelas->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_wali_kelas_kelas" class="wali_kelas_kelas">
<span<?= $Page->kelas->viewAttributes() ?>><center>
    <?php $kode_tapel=$wali_kelas->kode_tapel->getViewValue() ?>
    <?php $kelas=$wali_kelas->kelas->getViewValue() ?>
    <?php
    if ($kelas == '') {
    echo '<style> [data-name="kelas"] { background-color: red; } </style><p class="text-light">Anda Belum Pilih Kelas, silahkan Edit</p>';
    } else { ?>
    <div align="right" class="btn-group" role="group" aria-label="Basic example">  
        <a href="print/pdf_pd.php?k=<?=$kelas?>&ktp=<?=$kode_tapel?>&act=pd" class="btn bg-primary" target="_blank"><i class="fas fa-print"></i> Biodata PD <?= $kelas ?></a>
        <!-- Button trigger modal -->
        <button type="button" class="btn btn-warning btn-sm" data-toggle="modal" data-target="#exampleModal">
           <i class="fas fa-print"></i> Biodata P5 <?= $kelas ?>
       </button>
       <a href="print/pdf_leger.php?k=<?=$kelas?>&ktp=<?=$kode_tapel?>&act=leger" class="btn bg-info" target="_blank"><i class="fas fa-print"></i> Leger <?= $kelas ?></a>
       <a href="print/legerx.php?k=<?=$kelas?>&ktp=<?=$kode_tapel?>&act=leger" class="btn bg-success" target="_blank"><i class="fas fa-file-excel"></i> Leger <?= $kelas ?></a>
       <!-- Modal -->
       <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">Cetak Biodata P5</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
              </button>
          </div>
          <div class="modal-body">                                                
            <a href="print/pdf_p5.php?k=<?=$kelas?>&ktp=<?=$kode_tapel?>&act=up" class="btn bg-info" target="_blank"><i class="fas fa-print"></i> Halaman Depan</a>                                               
            <a href="print/pdf_p5.php?k=<?=$kelas?>&ktp=<?=$kode_tapel?>&act=down" class="btn bg-info" target="_blank"><i class="fas fa-print"></i> Halaman Akhir</a>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn bg-danger btn-block" data-dismiss="modal">Tutup</button> 
        </div>
    </div>
</div>
</div>
</div>
<?php } ?>
</center>
</span>
</span>
</td>
<?php } ?>
<?php if ($Page->pass->Visible) { // pass ?>
        <td <?= $Page->pass->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_wali_kelas_pass" class="wali_kelas_pass">
<span<?= $Page->pass->viewAttributes() ?>>
<?= $Page->pass->getViewValue() ?></span>
</span>
</td>
<?php } ?>
    </tr>
<?php
    $Page->Recordset->moveNext();
}
$Page->Recordset->close();
?>
</tbody>
</table>
</div>
</div>
<div>
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?= $Language->phrase("DeleteBtn") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
</div>
</form>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
