<?php

namespace PHPMaker2021\rdigital21;

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

    // Add fields
    var currentTable = <?= JsonEncode(GetClientVar("tables", "nilai_sumatif")) ?>,
        fields = currentTable.fields;
    fnilai_sumatiflistsrch.addFields([
        ["nilai_s_id", [], fields.nilai_s_id.isInvalid],
        ["guru_id", [], fields.guru_id.isInvalid],
        ["kode_mapel", [], fields.kode_mapel.isInvalid],
        ["kelas", [], fields.kelas.isInvalid],
        ["nis", [], fields.nis.isInvalid],
        ["nisn", [], fields.nisn.isInvalid],
        ["nama", [], fields.nama.isInvalid],
        ["jk", [], fields.jk.isInvalid],
        ["s1", [], fields.s1.isInvalid],
        ["s2", [], fields.s2.isInvalid],
        ["s3", [], fields.s3.isInvalid],
        ["s4", [], fields.s4.isInvalid],
        ["s5", [], fields.s5.isInvalid],
        ["s6", [], fields.s6.isInvalid],
        ["s7", [], fields.s7.isInvalid],
        ["s8", [], fields.s8.isInvalid],
        ["nas", [], fields.nas.isInvalid],
        ["sts", [], fields.sts.isInvalid],
        ["sas", [], fields.sas.isInvalid],
        ["nr1", [], fields.nr1.isInvalid],
        ["nr2", [], fields.nr2.isInvalid]
    ]);

    // Set invalid fields
    $(function() {
        fnilai_sumatiflistsrch.setInvalid();
    });

    // Validate form
    fnilai_sumatiflistsrch.validate = function () {
        if (!this.validateRequired)
            return true; // Ignore validation
        var fobj = this.getForm(),
            $fobj = $(fobj),
            rowIndex = "";
        $fobj.data("rowindex", rowIndex);

        // Validate fields
        if (!this.validateFields(rowIndex))
            return false;

        // Call Form_CustomValidate event
        if (!this.customValidate(fobj)) {
            this.focus();
            return false;
        }
        return true;
    }

    // Form_CustomValidate
    fnilai_sumatiflistsrch.customValidate = function(fobj) { // DO NOT CHANGE THIS LINE!
        // Your custom validation code here, return false if invalid.
        return true;
    }

    // Use JavaScript validation or not
    fnilai_sumatiflistsrch.validateRequired = <?= Config("CLIENT_VALIDATE") ? "true" : "false" ?>;

    // Dynamic selection lists
    fnilai_sumatiflistsrch.lists.kode_mapel = <?= $Page->kode_mapel->toClientList($Page) ?>;
    fnilai_sumatiflistsrch.lists.kelas = <?= $Page->kelas->toClientList($Page) ?>;

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

    // Init search panel as collapsed
    fnilai_sumatiflistsrch.initSearchPanel = true;
    loadjs.done("fnilai_sumatiflistsrch");
});
</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 if (!$Page->isExport() || Config("EXPORT_MASTER_RECORD") && $Page->isExport("print")) { ?>
<?php
if ($Page->DbMasterFilter != "" && $Page->getCurrentMasterTable() == "penilaian") {
    if ($Page->MasterRecordExists) {
        include_once "views/PenilaianMaster.php";
    }
}
?>
<?php } ?>
<?php
$Page->renderOtherOptions();
?>
<?php if ($Security->canSearch()) { ?>
<?php if (!$Page->isExport() && !$Page->CurrentAction) { ?>
<form name="fnilai_sumatiflistsrch" id="fnilai_sumatiflistsrch" class="form-inline ew-form ew-ext-search-form" action="<?= CurrentPageUrl(false) ?>">
<div id="fnilai_sumatiflistsrch-search-panel" class="<?= $Page->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="nilai_sumatif">
    <div class="ew-extended-search">
<?php
// Render search row
$Page->RowType = ROWTYPE_SEARCH;
$Page->resetAttributes();
$Page->renderRow();
?>
<?php if ($Page->kode_mapel->Visible) { // kode_mapel ?>
    <?php
        $Page->SearchColumnCount++;
        if (($Page->SearchColumnCount - 1) % $Page->SearchFieldsPerRow == 0) {
            $Page->SearchRowCount++;
    ?>
<div id="xsr_<?= $Page->SearchRowCount ?>" class="ew-row d-sm-flex d-none">
    <?php
        }
     ?>
    <div id="xsc_kode_mapel" class="ew-cell form-group">
        <template id="tpsc_nilai_sumatif_kode_mapel"><label for="x_kode_mapel" class="ew-search-caption ew-label"><?= $Page->kode_mapel->caption() ?></label></template>
        <template id="tpz_nilai_sumatif_kode_mapel"><span class="ew-search-operator">
<?= $Language->phrase("LIKE") ?>
<input type="hidden" name="z_kode_mapel" id="z_kode_mapel" value="LIKE">
</span></template>
        <template id="tpx_nilai_sumatif_kode_mapel"><span id="el_nilai_sumatif_kode_mapel" class="ew-search-field">
    <select
        id="x_kode_mapel"
        name="x_kode_mapel"
        class="form-control ew-select<?= $Page->kode_mapel->isInvalidClass() ?>"
        data-select2-id="nilai_sumatif_x_kode_mapel"
        data-table="nilai_sumatif"
        data-field="x_kode_mapel"
        data-value-separator="<?= $Page->kode_mapel->displayValueSeparatorAttribute() ?>"
        <?= $Page->kode_mapel->editAttributes() ?>>
        <?= $Page->kode_mapel->selectOptionListHtml("x_kode_mapel") ?>
    </select>
    <div class="invalid-feedback"><?= $Page->kode_mapel->getErrorMessage(false) ?></div>
<?= $Page->kode_mapel->Lookup->getParamTag($Page, "p_x_kode_mapel") ?>
<script>
loadjs.ready("head", function() {
    var el = document.querySelector("select[data-select2-id='nilai_sumatif_x_kode_mapel']"),
        options = { name: "x_kode_mapel", selectId: "nilai_sumatif_x_kode_mapel", language: ew.LANGUAGE_ID, dir: ew.IS_RTL ? "rtl" : "ltr" };
    options.dropdownParent = $(el).closest("#ew-modal-dialog, #ew-add-opt-dialog")[0];
    Object.assign(options, ew.vars.tables.nilai_sumatif.fields.kode_mapel.selectOptions);
    ew.createSelect(options);
});
</script>
</span></template>
        <template id="tpv_nilai_sumatif_kode_mapel">
        </template>
    </div>
    <?php if ($Page->SearchColumnCount % $Page->SearchFieldsPerRow == 0) { ?>
</div>
    <?php } ?>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
    <?php
        $Page->SearchColumnCount++;
        if (($Page->SearchColumnCount - 1) % $Page->SearchFieldsPerRow == 0) {
            $Page->SearchRowCount++;
    ?>
<div id="xsr_<?= $Page->SearchRowCount ?>" class="ew-row d-sm-flex d-none">
    <?php
        }
     ?>
    <div id="xsc_kelas" class="ew-cell form-group">
        <template id="tpsc_nilai_sumatif_kelas"><label for="x_kelas" class="ew-search-caption ew-label"><?= $Page->kelas->caption() ?></label></template>
        <template id="tpz_nilai_sumatif_kelas"><span class="ew-search-operator">
<?= $Language->phrase("LIKE") ?>
<input type="hidden" name="z_kelas" id="z_kelas" value="LIKE">
</span></template>
        <template id="tpx_nilai_sumatif_kelas"><span id="el_nilai_sumatif_kelas" class="ew-search-field">
    <select
        id="x_kelas"
        name="x_kelas"
        class="form-control ew-select<?= $Page->kelas->isInvalidClass() ?>"
        data-select2-id="nilai_sumatif_x_kelas"
        data-table="nilai_sumatif"
        data-field="x_kelas"
        data-value-separator="<?= $Page->kelas->displayValueSeparatorAttribute() ?>"
        <?= $Page->kelas->editAttributes() ?>>
        <?= $Page->kelas->selectOptionListHtml("x_kelas") ?>
    </select>
    <div class="invalid-feedback"><?= $Page->kelas->getErrorMessage(false) ?></div>
<?= $Page->kelas->Lookup->getParamTag($Page, "p_x_kelas") ?>
<script>
loadjs.ready("head", function() {
    var el = document.querySelector("select[data-select2-id='nilai_sumatif_x_kelas']"),
        options = { name: "x_kelas", selectId: "nilai_sumatif_x_kelas", language: ew.LANGUAGE_ID, dir: ew.IS_RTL ? "rtl" : "ltr" };
    options.dropdownParent = $(el).closest("#ew-modal-dialog, #ew-add-opt-dialog")[0];
    Object.assign(options, ew.vars.tables.nilai_sumatif.fields.kelas.selectOptions);
    ew.createSelect(options);
});
</script>
</span></template>
        <template id="tpv_nilai_sumatif_kelas">
        </template>
    </div>
    <?php if ($Page->SearchColumnCount % $Page->SearchFieldsPerRow == 0) { ?>
</div>
    <?php } ?>
<?php } ?>
    <?php if ($Page->SearchColumnCount % $Page->SearchFieldsPerRow > 0) { ?>
</div>
    <?php } ?>
<div id="tpsd_nilai_sumatiflist" class="ew-custom-template-search"></div>
<template id="tpsm_nilai_sumatiflist">
<div id="nilai_sumatiflist"><div class="card card-warning card-outline card-body">
    <div id="r_kode_mapel" class="form-group row">
        <label for="x_kode_mapel" class="col-sm-3 col-form-label"><?= $Page->kode_mapel->caption() ?></label>
        <div class="col-sm-8"><slot class="ew-slot" name="tpx_nilai_sumatif_kode_mapel"></slot></div>
    </div>
    <div id="r_kelas" class="form-group row">
        <label for="x_kelas" class="col-sm-3 col-form-label"><?= $Page->kelas->caption() ?></label>
        <div class="col-sm-8"><slot class="ew-slot" name="tpx_nilai_sumatif_kelas"></slot></div>
    </div>
 </div> 
</div>
</template>
<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>
<script>
loadjs.ready(["jsrender", "makerjs"], function() {
    ew.applyTemplate("tpsd_nilai_sumatiflist", "tpsm_nilai_sumatiflist");
});
</script>
<?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 } ?> nilai_sumatif">
<?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="fnilai_sumatiflist" id="fnilai_sumatiflist" 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="nilai_sumatif">
<?php if ($Page->getCurrentMasterTable() == "penilaian" && $Page->CurrentAction) { ?>
<input type="hidden" name="<?= Config("TABLE_SHOW_MASTER") ?>" value="penilaian">
<input type="hidden" name="fk_penilaian_id" value="<?= HtmlEncode($Page->penilaian_id->getSessionValue()) ?>">
<?php } ?>
<div id="gmp_nilai_sumatif" class="<?= ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($Page->TotalRecords > 0 || $Page->isGridEdit()) { ?>
<table id="tbl_nilai_sumatiflist" 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->nilai_s_id->Visible) { // nilai_s_id ?>
        <th data-name="nilai_s_id" class="<?= $Page->nilai_s_id->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nilai_s_id" class="nilai_sumatif_nilai_s_id"><?= $Page->renderSort($Page->nilai_s_id) ?></div></th>
<?php } ?>
<?php if ($Page->guru_id->Visible) { // guru_id ?>
        <th data-name="guru_id" class="<?= $Page->guru_id->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_guru_id" class="nilai_sumatif_guru_id"><?= $Page->renderSort($Page->guru_id) ?></div></th>
<?php } ?>
<?php if ($Page->kode_mapel->Visible) { // kode_mapel ?>
        <th data-name="kode_mapel" class="<?= $Page->kode_mapel->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_kode_mapel" class="nilai_sumatif_kode_mapel"><?= $Page->renderSort($Page->kode_mapel) ?></div></th>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
        <th data-name="kelas" class="<?= $Page->kelas->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_kelas" class="nilai_sumatif_kelas"><?= $Page->renderSort($Page->kelas) ?></div></th>
<?php } ?>
<?php if ($Page->nis->Visible) { // nis ?>
        <th data-name="nis" class="<?= $Page->nis->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nis" class="nilai_sumatif_nis"><?= $Page->renderSort($Page->nis) ?></div></th>
<?php } ?>
<?php if ($Page->nisn->Visible) { // nisn ?>
        <th data-name="nisn" class="<?= $Page->nisn->headerCellClass() ?>"><div id="elh_nilai_sumatif_nisn" class="nilai_sumatif_nisn"><?= $Page->renderSort($Page->nisn) ?></div></th>
<?php } ?>
<?php if ($Page->nama->Visible) { // nama ?>
        <th data-name="nama" class="<?= $Page->nama->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nama" class="nilai_sumatif_nama"><?= $Page->renderSort($Page->nama) ?></div></th>
<?php } ?>
<?php if ($Page->jk->Visible) { // jk ?>
        <th data-name="jk" class="<?= $Page->jk->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_jk" class="nilai_sumatif_jk"><?= $Page->renderSort($Page->jk) ?></div></th>
<?php } ?>
<?php if ($Page->s1->Visible) { // s1 ?>
        <th data-name="s1" class="<?= $Page->s1->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s1" class="nilai_sumatif_s1"><?= $Page->renderSort($Page->s1) ?></div></th>
<?php } ?>
<?php if ($Page->s2->Visible) { // s2 ?>
        <th data-name="s2" class="<?= $Page->s2->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s2" class="nilai_sumatif_s2"><?= $Page->renderSort($Page->s2) ?></div></th>
<?php } ?>
<?php if ($Page->s3->Visible) { // s3 ?>
        <th data-name="s3" class="<?= $Page->s3->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s3" class="nilai_sumatif_s3"><?= $Page->renderSort($Page->s3) ?></div></th>
<?php } ?>
<?php if ($Page->s4->Visible) { // s4 ?>
        <th data-name="s4" class="<?= $Page->s4->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s4" class="nilai_sumatif_s4"><?= $Page->renderSort($Page->s4) ?></div></th>
<?php } ?>
<?php if ($Page->s5->Visible) { // s5 ?>
        <th data-name="s5" class="<?= $Page->s5->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s5" class="nilai_sumatif_s5"><?= $Page->renderSort($Page->s5) ?></div></th>
<?php } ?>
<?php if ($Page->s6->Visible) { // s6 ?>
        <th data-name="s6" class="<?= $Page->s6->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s6" class="nilai_sumatif_s6"><?= $Page->renderSort($Page->s6) ?></div></th>
<?php } ?>
<?php if ($Page->s7->Visible) { // s7 ?>
        <th data-name="s7" class="<?= $Page->s7->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s7" class="nilai_sumatif_s7"><?= $Page->renderSort($Page->s7) ?></div></th>
<?php } ?>
<?php if ($Page->s8->Visible) { // s8 ?>
        <th data-name="s8" class="<?= $Page->s8->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_s8" class="nilai_sumatif_s8"><?= $Page->renderSort($Page->s8) ?></div></th>
<?php } ?>
<?php if ($Page->nas->Visible) { // nas ?>
        <th data-name="nas" class="<?= $Page->nas->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nas" class="nilai_sumatif_nas"><?= $Page->renderSort($Page->nas) ?></div></th>
<?php } ?>
<?php if ($Page->sts->Visible) { // sts ?>
        <th data-name="sts" class="<?= $Page->sts->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_sts" class="nilai_sumatif_sts"><?= $Page->renderSort($Page->sts) ?></div></th>
<?php } ?>
<?php if ($Page->sas->Visible) { // sas ?>
        <th data-name="sas" class="<?= $Page->sas->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_sas" class="nilai_sumatif_sas"><?= $Page->renderSort($Page->sas) ?></div></th>
<?php } ?>
<?php if ($Page->nr1->Visible) { // nr1 ?>
        <th data-name="nr1" class="<?= $Page->nr1->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nr1" class="nilai_sumatif_nr1"><?= $Page->renderSort($Page->nr1) ?></div></th>
<?php } ?>
<?php if ($Page->nr2->Visible) { // nr2 ?>
        <th data-name="nr2" class="<?= $Page->nr2->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_nilai_sumatif_nr2" class="nilai_sumatif_nr2"><?= $Page->renderSort($Page->nr2) ?></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 . "_nilai_sumatif", "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->nilai_s_id->Visible) { // nilai_s_id ?>
        <td data-name="nilai_s_id" <?= $Page->nilai_s_id->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nilai_s_id">
<span<?= $Page->nilai_s_id->viewAttributes() ?>>
<?= $Page->nilai_s_id->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->guru_id->Visible) { // guru_id ?>
        <td data-name="guru_id" <?= $Page->guru_id->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_guru_id">
<span<?= $Page->guru_id->viewAttributes() ?>>
<?= $Page->guru_id->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->kode_mapel->Visible) { // kode_mapel ?>
        <td data-name="kode_mapel" <?= $Page->kode_mapel->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_kode_mapel">
<span<?= $Page->kode_mapel->viewAttributes() ?>>
<?= $Page->kode_mapel->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->kelas->Visible) { // kelas ?>
        <td data-name="kelas" <?= $Page->kelas->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_kelas">
<span<?= $Page->kelas->viewAttributes() ?>>
<?= $Page->kelas->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nis->Visible) { // nis ?>
        <td data-name="nis" <?= $Page->nis->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nis">
<span<?= $Page->nis->viewAttributes() ?>>
<?= $Page->nis->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nisn->Visible) { // nisn ?>
        <td data-name="nisn" <?= $Page->nisn->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nisn">
<span<?= $Page->nisn->viewAttributes() ?>>
<?= $Page->nisn->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nama->Visible) { // nama ?>
        <td data-name="nama" <?= $Page->nama->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nama">
<span<?= $Page->nama->viewAttributes() ?>>
<?= $Page->nama->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->jk->Visible) { // jk ?>
        <td data-name="jk" <?= $Page->jk->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_jk">
<span<?= $Page->jk->viewAttributes() ?>>
<?= $Page->jk->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s1->Visible) { // s1 ?>
        <td data-name="s1" <?= $Page->s1->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s1">
<span<?= $Page->s1->viewAttributes() ?>>
<?= $Page->s1->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s2->Visible) { // s2 ?>
        <td data-name="s2" <?= $Page->s2->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s2">
<span<?= $Page->s2->viewAttributes() ?>>
<?= $Page->s2->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s3->Visible) { // s3 ?>
        <td data-name="s3" <?= $Page->s3->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s3">
<span<?= $Page->s3->viewAttributes() ?>>
<?= $Page->s3->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s4->Visible) { // s4 ?>
        <td data-name="s4" <?= $Page->s4->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s4">
<span<?= $Page->s4->viewAttributes() ?>>
<?= $Page->s4->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s5->Visible) { // s5 ?>
        <td data-name="s5" <?= $Page->s5->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s5">
<span<?= $Page->s5->viewAttributes() ?>>
<?= $Page->s5->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s6->Visible) { // s6 ?>
        <td data-name="s6" <?= $Page->s6->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s6">
<span<?= $Page->s6->viewAttributes() ?>>
<?= $Page->s6->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s7->Visible) { // s7 ?>
        <td data-name="s7" <?= $Page->s7->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s7">
<span<?= $Page->s7->viewAttributes() ?>>
<?= $Page->s7->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->s8->Visible) { // s8 ?>
        <td data-name="s8" <?= $Page->s8->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_s8">
<span<?= $Page->s8->viewAttributes() ?>>
<?= $Page->s8->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nas->Visible) { // nas ?>
        <td data-name="nas" <?= $Page->nas->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nas">
<span<?= $Page->nas->viewAttributes() ?>><?= number_format($Page->nas->getViewValue(),2) ?>
</span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->sts->Visible) { // sts ?>
        <td data-name="sts" <?= $Page->sts->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_sts">
<span<?= $Page->sts->viewAttributes() ?>>
<?= $Page->sts->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->sas->Visible) { // sas ?>
        <td data-name="sas" <?= $Page->sas->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_sas">
<span<?= $Page->sas->viewAttributes() ?>>
<?= $Page->sas->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nr1->Visible) { // nr1 ?>
        <td data-name="nr1" <?= $Page->nr1->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nr1">
<span<?= $Page->nr1->viewAttributes() ?>>
<?= $Page->nr1->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->nr2->Visible) { // nr2 ?>
        <td data-name="nr2" <?= $Page->nr2->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_nilai_sumatif_nr2">
<span<?= $Page->nr2->viewAttributes() ?>>
<?= $Page->nr2->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("nilai_sumatif");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php } ?>
