<?php

namespace PHPMaker2021\rdigital21;

// Page object
$SekolahList = &$Page;
?>
<?php if (!$Page->isExport()) { ?>
<script>
var currentForm, currentPageID;
var fsekolahlist;
loadjs.ready("head", function () {
    var $ = jQuery;
    // Form object
    currentPageID = ew.PAGE_ID = "list";
    fsekolahlist = currentForm = new ew.Form("fsekolahlist", "list");
    fsekolahlist.formKeyCountName = '<?= $Page->FormKeyCountName ?>';
    loadjs.done("fsekolahlist");
});
var fsekolahlistsrch, currentSearchForm, currentAdvancedSearchForm;
loadjs.ready("head", function () {
    var $ = jQuery;
    // Form object for search
    fsekolahlistsrch = currentSearchForm = new ew.Form("fsekolahlistsrch");

    // Dynamic selection lists

    // Filters
    fsekolahlistsrch.filterList = <?= $Page->getFilterList() ?>;

    // Init search panel as collapsed
    fsekolahlistsrch.initSearchPanel = true;
    loadjs.done("fsekolahlistsrch");
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php } ?>
<?php if (!$Page->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($Page->TotalRecords > 0 && $Page->ExportOptions->visible()) { ?>
<?php $Page->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($Page->ImportOptions->visible()) { ?>
<?php $Page->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($Page->SearchOptions->visible()) { ?>
<?php $Page->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($Page->FilterOptions->visible()) { ?>
<?php $Page->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$Page->renderOtherOptions();
?>
<?php if ($Security->canSearch()) { ?>
<?php if (!$Page->isExport() && !$Page->CurrentAction) { ?>
<form name="fsekolahlistsrch" id="fsekolahlistsrch" class="form-inline ew-form ew-ext-search-form" action="<?= CurrentPageUrl(false) ?>">
<div id="fsekolahlistsrch-search-panel" class="<?= $Page->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="sekolah">
    <div class="ew-extended-search">
<div id="xsr_<?= $Page->SearchRowCount + 1 ?>" class="ew-row d-sm-flex">
    <div class="ew-quick-search input-group">
        <input type="text" name="<?= Config("TABLE_BASIC_SEARCH") ?>" id="<?= Config("TABLE_BASIC_SEARCH") ?>" class="form-control" value="<?= HtmlEncode($Page->BasicSearch->getKeyword()) ?>">
        <input type="hidden" name="<?= Config("TABLE_BASIC_SEARCH_TYPE") ?>" id="<?= Config("TABLE_BASIC_SEARCH_TYPE") ?>" value="<?= HtmlEncode($Page->BasicSearch->getType()) ?>">
        <div class="input-group-append">
            <button class="btn btn-primary" name="btn-submit" id="btn-submit" type="submit"><?= $Language->phrase("SearchBtn") ?></button>
            <button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle dropdown-toggle-split" aria-haspopup="true" aria-expanded="false"><span id="searchtype"><?= $Page->BasicSearch->getTypeNameShort() ?></span></button>
            <div class="dropdown-menu dropdown-menu-right">
                <a class="dropdown-item<?php if ($Page->BasicSearch->getType() == "") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this);"><?= $Language->phrase("QuickSearchAuto") ?></a>
                <a class="dropdown-item<?php if ($Page->BasicSearch->getType() == "=") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, '=');"><?= $Language->phrase("QuickSearchExact") ?></a>
                <a class="dropdown-item<?php if ($Page->BasicSearch->getType() == "AND") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'AND');"><?= $Language->phrase("QuickSearchAll") ?></a>
                <a class="dropdown-item<?php if ($Page->BasicSearch->getType() == "OR") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'OR');"><?= $Language->phrase("QuickSearchAny") ?></a>
            </div>
        </div>
    </div>
</div>
    </div><!-- /.ew-extended-search -->
</div><!-- /.ew-search-panel -->
</form>
<?php } ?>
<?php } ?>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<?php if ($Page->TotalRecords > 0 || $Page->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($Page->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> sekolah">
<?php if (!$Page->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$Page->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?= CurrentPageUrl(false) ?>">
<?= $Page->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $Page->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="fsekolahlist" id="fsekolahlist" class="form-inline ew-form ew-list-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="sekolah">
<div id="gmp_sekolah" class="<?= ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($Page->TotalRecords > 0 || $Page->isGridEdit()) { ?>
<table id="tbl_sekolahlist" class="table ew-table"><!-- .ew-table -->
<thead>
    <tr class="ew-table-header">
<?php
// Header row
$Page->RowType = ROWTYPE_HEADER;

// Render list options
$Page->renderListOptions();

// Render list options (header, left)
$Page->ListOptions->render("header", "left");
?>
<?php if ($Page->sekolah_id->Visible) { // sekolah_id ?>
        <th data-name="sekolah_id" class="<?= $Page->sekolah_id->headerCellClass() ?>"><div id="elh_sekolah_sekolah_id" class="sekolah_sekolah_id"><?= $Page->renderSort($Page->sekolah_id) ?></div></th>
<?php } ?>
<?php if ($Page->npsn->Visible) { // npsn ?>
        <th data-name="npsn" class="<?= $Page->npsn->headerCellClass() ?>"><div id="elh_sekolah_npsn" class="sekolah_npsn"><?= $Page->renderSort($Page->npsn) ?></div></th>
<?php } ?>
<?php if ($Page->nss->Visible) { // nss ?>
        <th data-name="nss" class="<?= $Page->nss->headerCellClass() ?>"><div id="elh_sekolah_nss" class="sekolah_nss"><?= $Page->renderSort($Page->nss) ?></div></th>
<?php } ?>
<?php if ($Page->nama_sekolah->Visible) { // nama_sekolah ?>
        <th data-name="nama_sekolah" class="<?= $Page->nama_sekolah->headerCellClass() ?>"><div id="elh_sekolah_nama_sekolah" class="sekolah_nama_sekolah"><?= $Page->renderSort($Page->nama_sekolah) ?></div></th>
<?php } ?>
<?php if ($Page->status->Visible) { // status ?>
        <th data-name="status" class="<?= $Page->status->headerCellClass() ?>"><div id="elh_sekolah_status" class="sekolah_status"><?= $Page->renderSort($Page->status) ?></div></th>
<?php } ?>
<?php if ($Page->website->Visible) { // website ?>
        <th data-name="website" class="<?= $Page->website->headerCellClass() ?>"><div id="elh_sekolah_website" class="sekolah_website"><?= $Page->renderSort($Page->website) ?></div></th>
<?php } ?>
<?php if ($Page->_email->Visible) { // email ?>
        <th data-name="_email" class="<?= $Page->_email->headerCellClass() ?>"><div id="elh_sekolah__email" class="sekolah__email"><?= $Page->renderSort($Page->_email) ?></div></th>
<?php } ?>
<?php if ($Page->alamat->Visible) { // alamat ?>
        <th data-name="alamat" class="<?= $Page->alamat->headerCellClass() ?>"><div id="elh_sekolah_alamat" class="sekolah_alamat"><?= $Page->renderSort($Page->alamat) ?></div></th>
<?php } ?>
<?php if ($Page->desa_kelurahan->Visible) { // desa_kelurahan ?>
        <th data-name="desa_kelurahan" class="<?= $Page->desa_kelurahan->headerCellClass() ?>"><div id="elh_sekolah_desa_kelurahan" class="sekolah_desa_kelurahan"><?= $Page->renderSort($Page->desa_kelurahan) ?></div></th>
<?php } ?>
<?php if ($Page->kecamatan->Visible) { // kecamatan ?>
        <th data-name="kecamatan" class="<?= $Page->kecamatan->headerCellClass() ?>"><div id="elh_sekolah_kecamatan" class="sekolah_kecamatan"><?= $Page->renderSort($Page->kecamatan) ?></div></th>
<?php } ?>
<?php if ($Page->kabupaten->Visible) { // kabupaten ?>
        <th data-name="kabupaten" class="<?= $Page->kabupaten->headerCellClass() ?>"><div id="elh_sekolah_kabupaten" class="sekolah_kabupaten"><?= $Page->renderSort($Page->kabupaten) ?></div></th>
<?php } ?>
<?php if ($Page->namaks->Visible) { // namaks ?>
        <th data-name="namaks" class="<?= $Page->namaks->headerCellClass() ?>"><div id="elh_sekolah_namaks" class="sekolah_namaks"><?= $Page->renderSort($Page->namaks) ?></div></th>
<?php } ?>
<?php if ($Page->nipks->Visible) { // nipks ?>
        <th data-name="nipks" class="<?= $Page->nipks->headerCellClass() ?>"><div id="elh_sekolah_nipks" class="sekolah_nipks"><?= $Page->renderSort($Page->nipks) ?></div></th>
<?php } ?>
<?php if ($Page->datetime->Visible) { // datetime ?>
        <th data-name="datetime" class="<?= $Page->datetime->headerCellClass() ?>"><div id="elh_sekolah_datetime" class="sekolah_datetime"><?= $Page->renderSort($Page->datetime) ?></div></th>
<?php } ?>
<?php
// Render list options (header, right)
$Page->ListOptions->render("header", "right");
?>
    </tr>
</thead>
<tbody>
<?php
if ($Page->ExportAll && $Page->isExport()) {
    $Page->StopRecord = $Page->TotalRecords;
} else {
    // Set the last record to display
    if ($Page->TotalRecords > $Page->StartRecord + $Page->DisplayRecords - 1) {
        $Page->StopRecord = $Page->StartRecord + $Page->DisplayRecords - 1;
    } else {
        $Page->StopRecord = $Page->TotalRecords;
    }
}
$Page->RecordCount = $Page->StartRecord - 1;
if ($Page->Recordset && !$Page->Recordset->EOF) {
    // Nothing to do
} elseif (!$Page->AllowAddDeleteRow && $Page->StopRecord == 0) {
    $Page->StopRecord = $Page->GridAddRowCount;
}

// Initialize aggregate
$Page->RowType = ROWTYPE_AGGREGATEINIT;
$Page->resetAttributes();
$Page->renderRow();
while ($Page->RecordCount < $Page->StopRecord) {
    $Page->RecordCount++;
    if ($Page->RecordCount >= $Page->StartRecord) {
        $Page->RowCount++;

        // Set up key count
        $Page->KeyCount = $Page->RowIndex;

        // Init row class and style
        $Page->resetAttributes();
        $Page->CssClass = "";
        if ($Page->isGridAdd()) {
            $Page->loadRowValues(); // Load default values
            $Page->OldKey = "";
            $Page->setKey($Page->OldKey);
        } else {
            $Page->loadRowValues($Page->Recordset); // Load row values
            if ($Page->isGridEdit()) {
                $Page->OldKey = $Page->getKey(true); // Get from CurrentValue
                $Page->setKey($Page->OldKey);
            }
        }
        $Page->RowType = ROWTYPE_VIEW; // Render view

        // Set up row id / data-rowindex
        $Page->RowAttrs->merge(["data-rowindex" => $Page->RowCount, "id" => "r" . $Page->RowCount . "_sekolah", "data-rowtype" => $Page->RowType]);

        // Render row
        $Page->renderRow();

        // Render list options
        $Page->renderListOptions();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php
// Render list options (body, left)
$Page->ListOptions->render("body", "left", $Page->RowCount);
?>
    <?php if ($Page->sekolah_id->Visible) { // sekolah_id ?>
        <td data-name="sekolah_id" <?= $Page->sekolah_id->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_sekolah_id">
<span<?= $Page->sekolah_id->viewAttributes() ?>>
<?= $Page->sekolah_id->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->npsn->Visible) { // npsn ?>
        <td data-name="npsn" <?= $Page->npsn->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_npsn">
<span<?= $Page->npsn->viewAttributes() ?>>
<?= $Page->npsn->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nss->Visible) { // nss ?>
        <td data-name="nss" <?= $Page->nss->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_nss">
<span<?= $Page->nss->viewAttributes() ?>>
<?= $Page->nss->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nama_sekolah->Visible) { // nama_sekolah ?>
        <td data-name="nama_sekolah" <?= $Page->nama_sekolah->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_nama_sekolah">
<span<?= $Page->nama_sekolah->viewAttributes() ?>>
<?= $Page->nama_sekolah->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->status->Visible) { // status ?>
        <td data-name="status" <?= $Page->status->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_status">
<span<?= $Page->status->viewAttributes() ?>>
<?= $Page->status->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->website->Visible) { // website ?>
        <td data-name="website" <?= $Page->website->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_website">
<span<?= $Page->website->viewAttributes() ?>>
<?= $Page->website->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->_email->Visible) { // email ?>
        <td data-name="_email" <?= $Page->_email->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah__email">
<span<?= $Page->_email->viewAttributes() ?>>
<?= $Page->_email->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->alamat->Visible) { // alamat ?>
        <td data-name="alamat" <?= $Page->alamat->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_alamat">
<span<?= $Page->alamat->viewAttributes() ?>>
<?= $Page->alamat->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->desa_kelurahan->Visible) { // desa_kelurahan ?>
        <td data-name="desa_kelurahan" <?= $Page->desa_kelurahan->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_desa_kelurahan">
<span<?= $Page->desa_kelurahan->viewAttributes() ?>>
<?= $Page->desa_kelurahan->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->kecamatan->Visible) { // kecamatan ?>
        <td data-name="kecamatan" <?= $Page->kecamatan->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_kecamatan">
<span<?= $Page->kecamatan->viewAttributes() ?>>
<?= $Page->kecamatan->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->kabupaten->Visible) { // kabupaten ?>
        <td data-name="kabupaten" <?= $Page->kabupaten->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_kabupaten">
<span<?= $Page->kabupaten->viewAttributes() ?>>
<?= $Page->kabupaten->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->namaks->Visible) { // namaks ?>
        <td data-name="namaks" <?= $Page->namaks->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_namaks">
<span<?= $Page->namaks->viewAttributes() ?>>
<?= $Page->namaks->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nipks->Visible) { // nipks ?>
        <td data-name="nipks" <?= $Page->nipks->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_nipks">
<span<?= $Page->nipks->viewAttributes() ?>>
<?= $Page->nipks->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->datetime->Visible) { // datetime ?>
        <td data-name="datetime" <?= $Page->datetime->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_sekolah_datetime">
<span<?= $Page->datetime->viewAttributes() ?>>
<?= $Page->datetime->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
<?php
// Render list options (body, right)
$Page->ListOptions->render("body", "right", $Page->RowCount);
?>
    </tr>
<?php
    }
    if (!$Page->isGridAdd()) {
        $Page->Recordset->moveNext();
    }
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php } ?>
</div><!-- /.ew-grid-middle-panel -->
<?php if (!$Page->CurrentAction) { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
</form><!-- /.ew-list-form -->
<?php
// Close recordset
if ($Page->Recordset) {
    $Page->Recordset->close();
}
?>
<?php if (!$Page->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$Page->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?= CurrentPageUrl(false) ?>">
<?= $Page->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $Page->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($Page->TotalRecords == 0 && !$Page->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $Page->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<?php if (!$Page->isExport()) { ?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("sekolah");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php } ?>
