<?php

namespace PHPMaker2021\rdigital21;

// Page object
$NilaiFormatifAdd = &$Page;
?>
<script>
var currentForm, currentPageID;
var fnilai_formatifadd;
loadjs.ready("head", function () {
    var $ = jQuery;
    // Form object
    currentPageID = ew.PAGE_ID = "add";
    fnilai_formatifadd = currentForm = new ew.Form("fnilai_formatifadd", "add");

    // Add fields
    var currentTable = <?= JsonEncode(GetClientVar("tables", "nilai_formatif")) ?>,
        fields = currentTable.fields;
    if (!ew.vars.tables.nilai_formatif)
        ew.vars.tables.nilai_formatif = currentTable;
    fnilai_formatifadd.addFields([
        ["kode_tapel", [fields.kode_tapel.visible && fields.kode_tapel.required ? ew.Validators.required(fields.kode_tapel.caption) : null], fields.kode_tapel.isInvalid],
        ["penilaian_id", [fields.penilaian_id.visible && fields.penilaian_id.required ? ew.Validators.required(fields.penilaian_id.caption) : null], fields.penilaian_id.isInvalid],
        ["guru_id", [fields.guru_id.visible && fields.guru_id.required ? ew.Validators.required(fields.guru_id.caption) : null], fields.guru_id.isInvalid],
        ["kode_mapel", [fields.kode_mapel.visible && fields.kode_mapel.required ? ew.Validators.required(fields.kode_mapel.caption) : null], fields.kode_mapel.isInvalid],
        ["kelas", [fields.kelas.visible && fields.kelas.required ? ew.Validators.required(fields.kelas.caption) : null], fields.kelas.isInvalid],
        ["nis", [fields.nis.visible && fields.nis.required ? ew.Validators.required(fields.nis.caption) : null], fields.nis.isInvalid],
        ["nama", [fields.nama.visible && fields.nama.required ? ew.Validators.required(fields.nama.caption) : null], fields.nama.isInvalid],
        ["jk", [fields.jk.visible && fields.jk.required ? ew.Validators.required(fields.jk.caption) : null], fields.jk.isInvalid],
        ["f1", [fields.f1.visible && fields.f1.required ? ew.Validators.required(fields.f1.caption) : null], fields.f1.isInvalid],
        ["f2", [fields.f2.visible && fields.f2.required ? ew.Validators.required(fields.f2.caption) : null], fields.f2.isInvalid],
        ["f3", [fields.f3.visible && fields.f3.required ? ew.Validators.required(fields.f3.caption) : null], fields.f3.isInvalid],
        ["f4", [fields.f4.visible && fields.f4.required ? ew.Validators.required(fields.f4.caption) : null], fields.f4.isInvalid],
        ["f5", [fields.f5.visible && fields.f5.required ? ew.Validators.required(fields.f5.caption) : null], fields.f5.isInvalid],
        ["f6", [fields.f6.visible && fields.f6.required ? ew.Validators.required(fields.f6.caption) : null], fields.f6.isInvalid],
        ["f7", [fields.f7.visible && fields.f7.required ? ew.Validators.required(fields.f7.caption) : null], fields.f7.isInvalid],
        ["f8", [fields.f8.visible && fields.f8.required ? ew.Validators.required(fields.f8.caption) : null], fields.f8.isInvalid],
        ["f9", [fields.f9.visible && fields.f9.required ? ew.Validators.required(fields.f9.caption) : null], fields.f9.isInvalid],
        ["f10", [fields.f10.visible && fields.f10.required ? ew.Validators.required(fields.f10.caption) : null], fields.f10.isInvalid],
        ["f11", [fields.f11.visible && fields.f11.required ? ew.Validators.required(fields.f11.caption) : null], fields.f11.isInvalid],
        ["f12", [fields.f12.visible && fields.f12.required ? ew.Validators.required(fields.f12.caption) : null], fields.f12.isInvalid],
        ["f13", [fields.f13.visible && fields.f13.required ? ew.Validators.required(fields.f13.caption) : null], fields.f13.isInvalid],
        ["f14", [fields.f14.visible && fields.f14.required ? ew.Validators.required(fields.f14.caption) : null], fields.f14.isInvalid],
        ["f15", [fields.f15.visible && fields.f15.required ? ew.Validators.required(fields.f15.caption) : null], fields.f15.isInvalid],
        ["naf", [fields.naf.visible && fields.naf.required ? ew.Validators.required(fields.naf.caption) : null], fields.naf.isInvalid]
    ]);

    // Set invalid fields
    $(function() {
        var f = fnilai_formatifadd,
            fobj = f.getForm(),
            $fobj = $(fobj),
            $k = $fobj.find("#" + f.formKeyCountName), // Get key_count
            rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1,
            startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
        for (var i = startcnt; i <= rowcnt; i++) {
            var rowIndex = ($k[0]) ? String(i) : "";
            f.setInvalid(rowIndex);
        }
    });

    // Validate form
    fnilai_formatifadd.validate = function () {
        if (!this.validateRequired)
            return true; // Ignore validation
        var fobj = this.getForm(),
            $fobj = $(fobj);
        if ($fobj.find("#confirm").val() == "confirm")
            return true;
        var addcnt = 0,
            $k = $fobj.find("#" + this.formKeyCountName), // Get key_count
            rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1,
            startcnt = (rowcnt == 0) ? 0 : 1, // Check rowcnt == 0 => Inline-Add
            gridinsert = ["insert", "gridinsert"].includes($fobj.find("#action").val()) && $k[0];
        for (var i = startcnt; i <= rowcnt; i++) {
            var rowIndex = ($k[0]) ? String(i) : "";
            $fobj.data("rowindex", rowIndex);

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

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

        // Process detail forms
        var dfs = $fobj.find("input[name='detailpage']").get();
        for (var i = 0; i < dfs.length; i++) {
            var df = dfs[i],
                val = df.value,
                frm = ew.forms.get(val);
            if (val && frm && !frm.validate())
                return false;
        }
        return true;
    }

    // Form_CustomValidate
    fnilai_formatifadd.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_formatifadd.validateRequired = <?= Config("CLIENT_VALIDATE") ? "true" : "false" ?>;

    // Dynamic selection lists
    fnilai_formatifadd.lists.kode_mapel = <?= $Page->kode_mapel->toClientList($Page) ?>;
    fnilai_formatifadd.lists.kelas = <?= $Page->kelas->toClientList($Page) ?>;
    loadjs.done("fnilai_formatifadd");
});
</script>
<script>
loadjs.ready("head", function () {
    // Client script
    $(document).ready((function(){$("#x_f1, #x_f2, #x_f3, #x_f4, #x_f5, #x_f6, #x_f7, #x_f8, #x_f9, #x_f10, #x_f11, #x_f12, #x_f13, #x_f14, #x_f15, #x_f16, #x_f17, #x_f18, #x_f19, #x_f20, #x_f21, #x_f22, #x_f23, #x_f24, #x_f25, #x_f26, #x_f27, #x_f28, #x_f29, #x_f30").change((function(){for(var f=[parseInt($("#x_f1").val())||0,parseInt($("#x_f2").val())||0,parseInt($("#x_f3").val())||0,parseInt($("#x_f4").val())||0,parseInt($("#x_f5").val())||0,parseInt($("#x_f6").val())||0,parseInt($("#x_f7").val())||0,parseInt($("#x_f8").val())||0,parseInt($("#x_f9").val())||0,parseInt($("#x_f10").val())||0,parseInt($("#x_f11").val())||0,parseInt($("#x_f12").val())||0,parseInt($("#x_f13").val())||0,parseInt($("#x_f14").val())||0,parseInt($("#x_f15").val())||0],x=0,_=0,a=0;a<f.length;a++)0!==f[a]&&(x+=f[a],_++);var n=_>0?(x/_).toFixed(0):0;$("#x_naf").val(n)}))}));
});
</script>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<form name="fnilai_formatifadd" id="fnilai_formatifadd" class="<?= $Page->FormClassName ?>" 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_formatif">
<input type="hidden" name="action" id="action" value="insert">
<input type="hidden" name="modal" value="<?= (int)$Page->IsModal ?>">
<input type="hidden" name="<?= $Page->OldKeyName ?>" value="<?= $Page->OldKey ?>">
<?php if ($Page->getCurrentMasterTable() == "penilaian") { ?>
<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 class="ew-add-div d-none"><!-- page* -->
<?php if ($Page->kode_tapel->Visible) { // kode_tapel ?>
    <div id="r_kode_tapel" class="form-group row">
        <label id="elh_nilai_formatif_kode_tapel" for="x_kode_tapel" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_kode_tapel"><?= $Page->kode_tapel->caption() ?><?= $Page->kode_tapel->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->kode_tapel->cellAttributes() ?>>
<template id="tpx_nilai_formatif_kode_tapel"><span id="el_nilai_formatif_kode_tapel">
<input type="<?= $Page->kode_tapel->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_kode_tapel" name="x_kode_tapel" id="x_kode_tapel" maxlength="255" value="<?= $Page->kode_tapel->EditValue ?>"<?= $Page->kode_tapel->editAttributes() ?> aria-describedby="x_kode_tapel_help">
<?= $Page->kode_tapel->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->kode_tapel->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->penilaian_id->Visible) { // penilaian_id ?>
    <div id="r_penilaian_id" class="form-group row">
        <label id="elh_nilai_formatif_penilaian_id" for="x_penilaian_id" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_penilaian_id"><?= $Page->penilaian_id->caption() ?><?= $Page->penilaian_id->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->penilaian_id->cellAttributes() ?>>
<?php if ($Page->penilaian_id->getSessionValue() != "") { ?>
<template id="tpx_nilai_formatif_penilaian_id"><span id="el_nilai_formatif_penilaian_id">
<span<?= $Page->penilaian_id->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->penilaian_id->getDisplayValue($Page->penilaian_id->ViewValue))) ?>"></span>
</span></template>
<input type="hidden" id="x_penilaian_id" name="x_penilaian_id" value="<?= HtmlEncode($Page->penilaian_id->CurrentValue) ?>" data-hidden="1">
<?php } else { ?>
<template id="tpx_nilai_formatif_penilaian_id"><span id="el_nilai_formatif_penilaian_id">
<input type="<?= $Page->penilaian_id->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_penilaian_id" name="x_penilaian_id" id="x_penilaian_id" maxlength="255" value="<?= $Page->penilaian_id->EditValue ?>"<?= $Page->penilaian_id->editAttributes() ?> aria-describedby="x_penilaian_id_help">
<?= $Page->penilaian_id->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->penilaian_id->getErrorMessage() ?></div>
</span></template>
<?php } ?>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->guru_id->Visible) { // guru_id ?>
    <div id="r_guru_id" class="form-group row">
        <label id="elh_nilai_formatif_guru_id" for="x_guru_id" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_guru_id"><?= $Page->guru_id->caption() ?><?= $Page->guru_id->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->guru_id->cellAttributes() ?>>
<template id="tpx_nilai_formatif_guru_id"><span id="el_nilai_formatif_guru_id">
<input type="<?= $Page->guru_id->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_guru_id" name="x_guru_id" id="x_guru_id" maxlength="255" value="<?= $Page->guru_id->EditValue ?>"<?= $Page->guru_id->editAttributes() ?> aria-describedby="x_guru_id_help">
<?= $Page->guru_id->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->guru_id->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->kode_mapel->Visible) { // kode_mapel ?>
    <div id="r_kode_mapel" class="form-group row">
        <label id="elh_nilai_formatif_kode_mapel" for="x_kode_mapel" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_kode_mapel"><?= $Page->kode_mapel->caption() ?><?= $Page->kode_mapel->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->kode_mapel->cellAttributes() ?>>
<template id="tpx_nilai_formatif_kode_mapel"><span id="el_nilai_formatif_kode_mapel">
    <select
        id="x_kode_mapel"
        name="x_kode_mapel"
        class="form-control ew-select<?= $Page->kode_mapel->isInvalidClass() ?>"
        data-select2-id="nilai_formatif_x_kode_mapel"
        data-table="nilai_formatif"
        data-field="x_kode_mapel"
        data-value-separator="<?= $Page->kode_mapel->displayValueSeparatorAttribute() ?>"
        <?= $Page->kode_mapel->editAttributes() ?>>
        <?= $Page->kode_mapel->selectOptionListHtml("x_kode_mapel") ?>
    </select>
    <?= $Page->kode_mapel->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->kode_mapel->getErrorMessage() ?></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_formatif_x_kode_mapel']"),
        options = { name: "x_kode_mapel", selectId: "nilai_formatif_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_formatif.fields.kode_mapel.selectOptions);
    ew.createSelect(options);
});
</script>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
    <div id="r_kelas" class="form-group row">
        <label id="elh_nilai_formatif_kelas" for="x_kelas" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_kelas"><?= $Page->kelas->caption() ?><?= $Page->kelas->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->kelas->cellAttributes() ?>>
<?php if (!$Security->isAdmin() && $Security->isLoggedIn() && !$Page->userIDAllow("add")) { // Non system admin ?>
<template id="tpx_nilai_formatif_kelas"><span id="el_nilai_formatif_kelas">
<span<?= $Page->kelas->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->kelas->getDisplayValue($Page->kelas->EditValue))) ?>"></span>
</span></template>
<input type="hidden" data-table="nilai_formatif" data-field="x_kelas" data-hidden="1" name="x_kelas" id="x_kelas" value="<?= HtmlEncode($Page->kelas->CurrentValue) ?>">
<?php } else { ?>
<template id="tpx_nilai_formatif_kelas"><span id="el_nilai_formatif_kelas">
    <select
        id="x_kelas"
        name="x_kelas"
        class="form-control ew-select<?= $Page->kelas->isInvalidClass() ?>"
        data-select2-id="nilai_formatif_x_kelas"
        data-table="nilai_formatif"
        data-field="x_kelas"
        data-value-separator="<?= $Page->kelas->displayValueSeparatorAttribute() ?>"
        <?= $Page->kelas->editAttributes() ?>>
        <?= $Page->kelas->selectOptionListHtml("x_kelas") ?>
    </select>
    <?= $Page->kelas->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->kelas->getErrorMessage() ?></div>
<?= $Page->kelas->Lookup->getParamTag($Page, "p_x_kelas") ?>
<script>
loadjs.ready("head", function() {
    var el = document.querySelector("select[data-select2-id='nilai_formatif_x_kelas']"),
        options = { name: "x_kelas", selectId: "nilai_formatif_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_formatif.fields.kelas.selectOptions);
    ew.createSelect(options);
});
</script>
</span></template>
<?php } ?>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->nis->Visible) { // nis ?>
    <div id="r_nis" class="form-group row">
        <label id="elh_nilai_formatif_nis" for="x_nis" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_nis"><?= $Page->nis->caption() ?><?= $Page->nis->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->nis->cellAttributes() ?>>
<template id="tpx_nilai_formatif_nis"><span id="el_nilai_formatif_nis">
<input type="<?= $Page->nis->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_nis" name="x_nis" id="x_nis" maxlength="255" value="<?= $Page->nis->EditValue ?>"<?= $Page->nis->editAttributes() ?> aria-describedby="x_nis_help">
<?= $Page->nis->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->nis->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->nama->Visible) { // nama ?>
    <div id="r_nama" class="form-group row">
        <label id="elh_nilai_formatif_nama" for="x_nama" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_nama"><?= $Page->nama->caption() ?><?= $Page->nama->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->nama->cellAttributes() ?>>
<template id="tpx_nilai_formatif_nama"><span id="el_nilai_formatif_nama">
<input type="<?= $Page->nama->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_nama" name="x_nama" id="x_nama" maxlength="255" value="<?= $Page->nama->EditValue ?>"<?= $Page->nama->editAttributes() ?> aria-describedby="x_nama_help">
<?= $Page->nama->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->nama->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->jk->Visible) { // jk ?>
    <div id="r_jk" class="form-group row">
        <label id="elh_nilai_formatif_jk" for="x_jk" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_jk"><?= $Page->jk->caption() ?><?= $Page->jk->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->jk->cellAttributes() ?>>
<template id="tpx_nilai_formatif_jk"><span id="el_nilai_formatif_jk">
<input type="<?= $Page->jk->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_jk" name="x_jk" id="x_jk" maxlength="255" value="<?= $Page->jk->EditValue ?>"<?= $Page->jk->editAttributes() ?> aria-describedby="x_jk_help">
<?= $Page->jk->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->jk->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f1->Visible) { // f1 ?>
    <div id="r_f1" class="form-group row">
        <label id="elh_nilai_formatif_f1" for="x_f1" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f1"><?= $Page->f1->caption() ?><?= $Page->f1->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f1->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f1"><span id="el_nilai_formatif_f1">
<input type="<?= $Page->f1->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f1" name="x_f1" id="x_f1" maxlength="255" value="<?= $Page->f1->EditValue ?>"<?= $Page->f1->editAttributes() ?> aria-describedby="x_f1_help">
<?= $Page->f1->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f1->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f2->Visible) { // f2 ?>
    <div id="r_f2" class="form-group row">
        <label id="elh_nilai_formatif_f2" for="x_f2" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f2"><?= $Page->f2->caption() ?><?= $Page->f2->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f2->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f2"><span id="el_nilai_formatif_f2">
<input type="<?= $Page->f2->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f2" name="x_f2" id="x_f2" maxlength="255" value="<?= $Page->f2->EditValue ?>"<?= $Page->f2->editAttributes() ?> aria-describedby="x_f2_help">
<?= $Page->f2->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f2->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f3->Visible) { // f3 ?>
    <div id="r_f3" class="form-group row">
        <label id="elh_nilai_formatif_f3" for="x_f3" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f3"><?= $Page->f3->caption() ?><?= $Page->f3->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f3->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f3"><span id="el_nilai_formatif_f3">
<input type="<?= $Page->f3->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f3" name="x_f3" id="x_f3" maxlength="255" value="<?= $Page->f3->EditValue ?>"<?= $Page->f3->editAttributes() ?> aria-describedby="x_f3_help">
<?= $Page->f3->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f3->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f4->Visible) { // f4 ?>
    <div id="r_f4" class="form-group row">
        <label id="elh_nilai_formatif_f4" for="x_f4" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f4"><?= $Page->f4->caption() ?><?= $Page->f4->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f4->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f4"><span id="el_nilai_formatif_f4">
<input type="<?= $Page->f4->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f4" name="x_f4" id="x_f4" maxlength="255" value="<?= $Page->f4->EditValue ?>"<?= $Page->f4->editAttributes() ?> aria-describedby="x_f4_help">
<?= $Page->f4->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f4->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f5->Visible) { // f5 ?>
    <div id="r_f5" class="form-group row">
        <label id="elh_nilai_formatif_f5" for="x_f5" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f5"><?= $Page->f5->caption() ?><?= $Page->f5->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f5->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f5"><span id="el_nilai_formatif_f5">
<input type="<?= $Page->f5->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f5" name="x_f5" id="x_f5" maxlength="255" value="<?= $Page->f5->EditValue ?>"<?= $Page->f5->editAttributes() ?> aria-describedby="x_f5_help">
<?= $Page->f5->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f5->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f6->Visible) { // f6 ?>
    <div id="r_f6" class="form-group row">
        <label id="elh_nilai_formatif_f6" for="x_f6" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f6"><?= $Page->f6->caption() ?><?= $Page->f6->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f6->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f6"><span id="el_nilai_formatif_f6">
<input type="<?= $Page->f6->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f6" name="x_f6" id="x_f6" maxlength="255" value="<?= $Page->f6->EditValue ?>"<?= $Page->f6->editAttributes() ?> aria-describedby="x_f6_help">
<?= $Page->f6->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f6->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f7->Visible) { // f7 ?>
    <div id="r_f7" class="form-group row">
        <label id="elh_nilai_formatif_f7" for="x_f7" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f7"><?= $Page->f7->caption() ?><?= $Page->f7->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f7->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f7"><span id="el_nilai_formatif_f7">
<input type="<?= $Page->f7->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f7" name="x_f7" id="x_f7" maxlength="255" value="<?= $Page->f7->EditValue ?>"<?= $Page->f7->editAttributes() ?> aria-describedby="x_f7_help">
<?= $Page->f7->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f7->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f8->Visible) { // f8 ?>
    <div id="r_f8" class="form-group row">
        <label id="elh_nilai_formatif_f8" for="x_f8" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f8"><?= $Page->f8->caption() ?><?= $Page->f8->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f8->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f8"><span id="el_nilai_formatif_f8">
<input type="<?= $Page->f8->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f8" name="x_f8" id="x_f8" maxlength="255" value="<?= $Page->f8->EditValue ?>"<?= $Page->f8->editAttributes() ?> aria-describedby="x_f8_help">
<?= $Page->f8->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f8->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f9->Visible) { // f9 ?>
    <div id="r_f9" class="form-group row">
        <label id="elh_nilai_formatif_f9" for="x_f9" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f9"><?= $Page->f9->caption() ?><?= $Page->f9->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f9->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f9"><span id="el_nilai_formatif_f9">
<input type="<?= $Page->f9->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f9" name="x_f9" id="x_f9" maxlength="255" value="<?= $Page->f9->EditValue ?>"<?= $Page->f9->editAttributes() ?> aria-describedby="x_f9_help">
<?= $Page->f9->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f9->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f10->Visible) { // f10 ?>
    <div id="r_f10" class="form-group row">
        <label id="elh_nilai_formatif_f10" for="x_f10" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f10"><?= $Page->f10->caption() ?><?= $Page->f10->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f10->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f10"><span id="el_nilai_formatif_f10">
<input type="<?= $Page->f10->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f10" name="x_f10" id="x_f10" maxlength="255" value="<?= $Page->f10->EditValue ?>"<?= $Page->f10->editAttributes() ?> aria-describedby="x_f10_help">
<?= $Page->f10->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f10->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f11->Visible) { // f11 ?>
    <div id="r_f11" class="form-group row">
        <label id="elh_nilai_formatif_f11" for="x_f11" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f11"><?= $Page->f11->caption() ?><?= $Page->f11->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f11->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f11"><span id="el_nilai_formatif_f11">
<input type="<?= $Page->f11->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f11" name="x_f11" id="x_f11" maxlength="255" value="<?= $Page->f11->EditValue ?>"<?= $Page->f11->editAttributes() ?> aria-describedby="x_f11_help">
<?= $Page->f11->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f11->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f12->Visible) { // f12 ?>
    <div id="r_f12" class="form-group row">
        <label id="elh_nilai_formatif_f12" for="x_f12" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f12"><?= $Page->f12->caption() ?><?= $Page->f12->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f12->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f12"><span id="el_nilai_formatif_f12">
<input type="<?= $Page->f12->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f12" name="x_f12" id="x_f12" maxlength="255" value="<?= $Page->f12->EditValue ?>"<?= $Page->f12->editAttributes() ?> aria-describedby="x_f12_help">
<?= $Page->f12->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f12->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f13->Visible) { // f13 ?>
    <div id="r_f13" class="form-group row">
        <label id="elh_nilai_formatif_f13" for="x_f13" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f13"><?= $Page->f13->caption() ?><?= $Page->f13->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f13->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f13"><span id="el_nilai_formatif_f13">
<input type="<?= $Page->f13->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f13" name="x_f13" id="x_f13" maxlength="255" value="<?= $Page->f13->EditValue ?>"<?= $Page->f13->editAttributes() ?> aria-describedby="x_f13_help">
<?= $Page->f13->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f13->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f14->Visible) { // f14 ?>
    <div id="r_f14" class="form-group row">
        <label id="elh_nilai_formatif_f14" for="x_f14" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f14"><?= $Page->f14->caption() ?><?= $Page->f14->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f14->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f14"><span id="el_nilai_formatif_f14">
<input type="<?= $Page->f14->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f14" name="x_f14" id="x_f14" maxlength="255" value="<?= $Page->f14->EditValue ?>"<?= $Page->f14->editAttributes() ?> aria-describedby="x_f14_help">
<?= $Page->f14->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f14->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->f15->Visible) { // f15 ?>
    <div id="r_f15" class="form-group row">
        <label id="elh_nilai_formatif_f15" for="x_f15" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_f15"><?= $Page->f15->caption() ?><?= $Page->f15->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->f15->cellAttributes() ?>>
<template id="tpx_nilai_formatif_f15"><span id="el_nilai_formatif_f15">
<input type="<?= $Page->f15->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_f15" name="x_f15" id="x_f15" maxlength="255" value="<?= $Page->f15->EditValue ?>"<?= $Page->f15->editAttributes() ?> aria-describedby="x_f15_help">
<?= $Page->f15->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->f15->getErrorMessage() ?></div>
</span></template>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->naf->Visible) { // naf ?>
    <div id="r_naf" class="form-group row">
        <label id="elh_nilai_formatif_naf" for="x_naf" class="<?= $Page->LeftColumnClass ?>"><template id="tpc_nilai_formatif_naf"><?= $Page->naf->caption() ?><?= $Page->naf->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></template></label>
        <div class="<?= $Page->RightColumnClass ?>"><div <?= $Page->naf->cellAttributes() ?>>
<template id="tpx_nilai_formatif_naf" class="nilai_formatifadd">
<input readonly type="<?= $Page->naf->getInputTextType() ?>" data-table="nilai_formatif" data-field="x_naf" name="x_naf" id="x_naf" maxlength="255" value="<?= $Page->naf->EditValue ?>" <?= $Page->naf->editAttributes() ?> aria-describedby="x_naf_help">
</template>
<template id="tpx_nilai_formatif_naf"><span id="el_nilai_formatif_naf">
<slot name="tpx_nilai_formatif_naf"></slot>
</span></template>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
<div id="tpd_nilai_formatifadd" class="ew-custom-template"></div>
<template id="tpm_nilai_formatifadd">
<div id="ct_NilaiFormatifAdd"><div class="row">
    <div class="col-lg-6">    
        <div id="r_nilai_f_id" class="form-group row">
            <label for="x_nilai_f_id" class="col-sm-3 col-form-label"><?= $Page->nilai_f_id->caption() ?></label>
            <div class="col-sm-9"><slot class="ew-slot" name="tpx_nilai_formatif_nilai_f_id"></slot></div>
        </div>
        <div id="r_kode_tapel" class="form-group row">
            <label for="x_kode_tapel" class="col-sm-3 col-form-label"><?= $Page->kode_tapel->caption() ?></label>
            <div class="col-sm-9"><slot class="ew-slot" name="tpx_nilai_formatif_kode_tapel"></slot></div>
        </div>
        <div id="r_penilaian_id" class="form-group row">
            <label for="x_penilaian_id" class="col-sm-3 col-form-label"><?= $Page->penilaian_id->caption() ?></label>
            <div class="col-sm-9"><slot class="ew-slot" name="tpx_nilai_formatif_penilaian_id"></slot></div>
        </div>
        <div id="r_guru_id" class="form-group row">
            <label for="x_guru_id" class="col-sm-3 col-form-label"><?= $Page->guru_id->caption() ?></label>
            <div class="col-sm-9"><slot class="ew-slot" name="tpx_nilai_formatif_guru_id"></slot></div>
        </div>
        <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-9"><slot class="ew-slot" name="tpx_nilai_formatif_kode_mapel"></slot></div>
        </div>
    </div>
    <div class="col-lg-6">
        <div id="r_kelas" class="form-group row">
            <label for="x_kelas" class="col-sm-2 col-form-label"><?= $Page->kelas->caption() ?></label>
            <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_kelas"></slot></div>
        </div>
        <div id="r_nis" class="form-group row">
            <label for="x_nis" class="col-sm-2 col-form-label"><?= $Page->nis->caption() ?></label>
            <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_nis"></slot></div>
        </div>
        <div id="r_nama" class="form-group row">
            <label for="x_nama" class="col-sm-2 col-form-label"><?= $Page->nama->caption() ?></label>
            <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_nama"></slot></div>
        </div>
        <div id="r_jk" class="form-group row">
            <label for="x_jk" class="col-sm-2 col-form-label"><?= $Page->jk->caption() ?></label>
            <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_jk"></slot></div>
        </div>
        <div id="r_naf" class="form-group row">
            <label for="x_naf" class="col-sm-2 col-form-label"><?= $Page->naf->caption() ?></label>
            <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_naf"></slot></div>
        </div>
    </div>
</div>
<div class="card card-body bg-light">
    <div class="row">
        <div class="col-lg-4">
            <div id="r_f1" class="form-group row">
                <label for="x_f1" class="col-sm-2 col-form-label"><?= $Page->f1->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f1"></slot></div>
            </div>
            <div id="r_f2" class="form-group row">
                <label for="x_f2" class="col-sm-2 col-form-label"><?= $Page->f2->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f2"></slot></div>
            </div>
            <div id="r_f3" class="form-group row">
                <label for="x_f3" class="col-sm-2 col-form-label"><?= $Page->f3->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f3"></slot></div>
            </div>
            <div id="r_f4" class="form-group row">
                <label for="x_f4" class="col-sm-2 col-form-label"><?= $Page->f4->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f4"></slot></div>
            </div>
            <div id="r_f5" class="form-group row">
                <label for="x_f5" class="col-sm-2 col-form-label"><?= $Page->f5->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f5"></slot></div>
            </div>
        </div>
        <div class="col-lg-4">
            <div id="r_f6" class="form-group row">
                <label for="x_f6" class="col-sm-2 col-form-label"><?= $Page->f6->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f6"></slot></div>
            </div>
            <div id="r_f7" class="form-group row">
                <label for="x_f7" class="col-sm-2 col-form-label"><?= $Page->f7->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f7"></slot></div>
            </div>
            <div id="r_f8" class="form-group row">
                <label for="x_f8" class="col-sm-2 col-form-label"><?= $Page->f8->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f8"></slot></div>
            </div>
            <div id="r_f9" class="form-group row">
                <label for="x_f9" class="col-sm-2 col-form-label"><?= $Page->f9->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f9"></slot></div>
            </div>
            <div id="r_f10" class="form-group row">
                <label for="x_f10" class="col-sm-2 col-form-label"><?= $Page->f10->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f10"></slot></div>
            </div> 
        </div>
        <div class="col-lg-4"> 
            <div id="r_f11" class="form-group row">
                <label for="x_f11" class="col-sm-2 col-form-label"><?= $Page->f11->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f11"></slot></div>
            </div>
            <div id="r_f12" class="form-group row">
                <label for="x_f12" class="col-sm-2 col-form-label"><?= $Page->f12->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f12"></slot></div>
            </div>
            <div id="r_f13" class="form-group row">
                <label for="x_f13" class="col-sm-2 col-form-label"><?= $Page->f13->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f13"></slot></div>
            </div>
            <div id="r_f14" class="form-group row">
                <label for="x_f14" class="col-sm-2 col-form-label"><?= $Page->f14->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f14"></slot></div>
            </div>
            <div id="r_f15" class="form-group row">
                <label for="x_f15" class="col-sm-2 col-form-label"><?= $Page->f15->caption() ?></label>
                <div class="col-sm-10"><slot class="ew-slot" name="tpx_nilai_formatif_f15"></slot></div>
            </div>
        </div>
    </div>
</div>
</div>
</template>
<?php if (!$Page->IsModal) { ?>
<div class="form-group row"><!-- buttons .form-group -->
    <div class="<?= $Page->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?= $Language->phrase("AddBtn") ?></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><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<?php } ?>
</form>
<script class="ew-apply-template">
loadjs.ready(["jsrender", "makerjs"], function() {
    ew.templateData = { rows: <?= JsonEncode($Page->Rows) ?> };
    ew.applyTemplate("tpd_nilai_formatifadd", "tpm_nilai_formatifadd", "nilai_formatifadd", "<?= $Page->CustomExport ?>", ew.templateData.rows[0]);
    loadjs.done("customtemplate");
});
</script>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("nilai_formatif");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
