<?php

namespace PHPMaker2024\laundrytech;

// Page object
$LaundrytechUgrightsEdit = &$Page;
?>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<main class="edit">
<form name="flaundrytech_ugrightsedit" id="flaundrytech_ugrightsedit" class="<?= $Page->FormClassName ?>" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate autocomplete="off">
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { laundrytech_ugrights: currentTable } });
var currentPageID = ew.PAGE_ID = "edit";
var currentForm;
var flaundrytech_ugrightsedit;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("flaundrytech_ugrightsedit")
        .setPageId("edit")

        // Add fields
        .setFields([
            ["_TableName", [fields._TableName.visible && fields._TableName.required ? ew.Validators.required(fields._TableName.caption) : null], fields._TableName.isInvalid],
            ["GroupID", [fields.GroupID.visible && fields.GroupID.required ? ew.Validators.required(fields.GroupID.caption) : null, ew.Validators.integer], fields.GroupID.isInvalid],
            ["AccessMask", [fields.AccessMask.visible && fields.AccessMask.required ? ew.Validators.required(fields.AccessMask.caption) : null], fields.AccessMask.isInvalid],
            ["_Page", [fields._Page.visible && fields._Page.required ? ew.Validators.required(fields._Page.caption) : null], fields._Page.isInvalid]
        ])

        // Form_CustomValidate
        .setCustomValidate(
            function (fobj) { // DO NOT CHANGE THIS LINE! (except for adding "async" keyword)!
                    // Your custom validation code here, return false if invalid.
                    return true;
                }
        )

        // Use JavaScript validation or not
        .setValidateRequired(ew.CLIENT_VALIDATE)

        // Dynamic selection lists
        .setLists({
        })
        .build();
    window[form.id] = form;
    currentForm = form;
    loadjs.done(form.id);
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?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="laundrytech_ugrights">
<input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="modal" value="<?= (int)$Page->IsModal ?>">
<?php if (IsJsonResponse()) { ?>
<input type="hidden" name="json" value="1">
<?php } ?>
<input type="hidden" name="<?= $Page->OldKeyName ?>" value="<?= $Page->OldKey ?>">
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->_TableName->Visible) { // TableName ?>
    <div id="r__TableName"<?= $Page->_TableName->rowAttributes() ?>>
        <label id="elh_laundrytech_ugrights__TableName" for="x__TableName" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_TableName->caption() ?><?= $Page->_TableName->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_TableName->cellAttributes() ?>>
<span id="el_laundrytech_ugrights__TableName">
<input type="<?= $Page->_TableName->getInputTextType() ?>" name="x__TableName" id="x__TableName" data-table="laundrytech_ugrights" data-field="x__TableName" value="<?= $Page->_TableName->EditValue ?>" size="30" maxlength="300" placeholder="<?= HtmlEncode($Page->_TableName->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->_TableName->formatPattern()) ?>"<?= $Page->_TableName->editAttributes() ?> aria-describedby="x__TableName_help">
<?= $Page->_TableName->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_TableName->getErrorMessage() ?></div>
<input type="hidden" data-table="laundrytech_ugrights" data-field="x__TableName" data-hidden="1" data-old name="o__TableName" id="o__TableName" value="<?= HtmlEncode($Page->_TableName->OldValue ?? $Page->_TableName->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->GroupID->Visible) { // GroupID ?>
    <div id="r_GroupID"<?= $Page->GroupID->rowAttributes() ?>>
        <label id="elh_laundrytech_ugrights_GroupID" for="x_GroupID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->GroupID->caption() ?><?= $Page->GroupID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->GroupID->cellAttributes() ?>>
<span id="el_laundrytech_ugrights_GroupID">
<input type="<?= $Page->GroupID->getInputTextType() ?>" name="x_GroupID" id="x_GroupID" data-table="laundrytech_ugrights" data-field="x_GroupID" value="<?= $Page->GroupID->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->GroupID->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->GroupID->formatPattern()) ?>"<?= $Page->GroupID->editAttributes() ?> aria-describedby="x_GroupID_help">
<?= $Page->GroupID->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->GroupID->getErrorMessage() ?></div>
<input type="hidden" data-table="laundrytech_ugrights" data-field="x_GroupID" data-hidden="1" data-old name="o_GroupID" id="o_GroupID" value="<?= HtmlEncode($Page->GroupID->OldValue ?? $Page->GroupID->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->AccessMask->Visible) { // AccessMask ?>
    <div id="r_AccessMask"<?= $Page->AccessMask->rowAttributes() ?>>
        <label id="elh_laundrytech_ugrights_AccessMask" for="x_AccessMask" class="<?= $Page->LeftColumnClass ?>"><?= $Page->AccessMask->caption() ?><?= $Page->AccessMask->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->AccessMask->cellAttributes() ?>>
<span id="el_laundrytech_ugrights_AccessMask">
<input type="<?= $Page->AccessMask->getInputTextType() ?>" name="x_AccessMask" id="x_AccessMask" data-table="laundrytech_ugrights" data-field="x_AccessMask" value="<?= $Page->AccessMask->EditValue ?>" size="30" maxlength="10" placeholder="<?= HtmlEncode($Page->AccessMask->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->AccessMask->formatPattern()) ?>"<?= $Page->AccessMask->editAttributes() ?> aria-describedby="x_AccessMask_help">
<?= $Page->AccessMask->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->AccessMask->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_Page->Visible) { // Page ?>
    <div id="r__Page"<?= $Page->_Page->rowAttributes() ?>>
        <label id="elh_laundrytech_ugrights__Page" for="x__Page" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_Page->caption() ?><?= $Page->_Page->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_Page->cellAttributes() ?>>
<span id="el_laundrytech_ugrights__Page">
<textarea data-table="laundrytech_ugrights" data-field="x__Page" name="x__Page" id="x__Page" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->_Page->getPlaceHolder()) ?>"<?= $Page->_Page->editAttributes() ?> aria-describedby="x__Page_help"><?= $Page->_Page->EditValue ?></textarea>
<?= $Page->_Page->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_Page->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
<?= $Page->IsModal ? '<template class="ew-modal-buttons">' : '<div class="row ew-buttons">' ?><!-- buttons .row -->
    <div class="<?= $Page->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit" form="flaundrytech_ugrightsedit"><?= $Language->phrase("SaveBtn") ?></button>
<?php if (IsJsonResponse()) { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-bs-dismiss="modal"><?= $Language->phrase("CancelBtn") ?></button>
<?php } else { ?>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" form="flaundrytech_ugrightsedit" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
<?php } ?>
    </div><!-- /buttons offset -->
<?= $Page->IsModal ? "</template>" : "</div>" ?><!-- /buttons .row -->
</form>
</main>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("laundrytech_ugrights");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
