<?php

namespace PHPMaker2024\laundrytech;

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

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

        // Add fields
        .setFields([
            ["ID", [fields.ID.visible && fields.ID.required ? ew.Validators.required(fields.ID.caption) : null], fields.ID.isInvalid],
            ["TYPE", [fields.TYPE.visible && fields.TYPE.required ? ew.Validators.required(fields.TYPE.caption) : null, ew.Validators.integer], fields.TYPE.isInvalid],
            ["NAME", [fields.NAME.visible && fields.NAME.required ? ew.Validators.required(fields.NAME.caption) : null], fields.NAME.isInvalid],
            ["_USERNAME", [fields._USERNAME.visible && fields._USERNAME.required ? ew.Validators.required(fields._USERNAME.caption) : null], fields._USERNAME.isInvalid],
            ["COOKIE", [fields.COOKIE.visible && fields.COOKIE.required ? ew.Validators.required(fields.COOKIE.caption) : null], fields.COOKIE.isInvalid],
            ["_SEARCH", [fields._SEARCH.visible && fields._SEARCH.required ? ew.Validators.required(fields._SEARCH.caption) : null], fields._SEARCH.isInvalid],
            ["_TABLENAME", [fields._TABLENAME.visible && fields._TABLENAME.required ? ew.Validators.required(fields._TABLENAME.caption) : null], fields._TABLENAME.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_settings">
<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->ID->Visible) { // ID ?>
    <div id="r_ID"<?= $Page->ID->rowAttributes() ?>>
        <label id="elh_laundrytech_settings_ID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ID->caption() ?><?= $Page->ID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ID->cellAttributes() ?>>
<span id="el_laundrytech_settings_ID">
<span<?= $Page->ID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->ID->getDisplayValue($Page->ID->EditValue))) ?>"></span>
<input type="hidden" data-table="laundrytech_settings" data-field="x_ID" data-hidden="1" name="x_ID" id="x_ID" value="<?= HtmlEncode($Page->ID->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->TYPE->Visible) { // TYPE ?>
    <div id="r_TYPE"<?= $Page->TYPE->rowAttributes() ?>>
        <label id="elh_laundrytech_settings_TYPE" for="x_TYPE" class="<?= $Page->LeftColumnClass ?>"><?= $Page->TYPE->caption() ?><?= $Page->TYPE->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->TYPE->cellAttributes() ?>>
<span id="el_laundrytech_settings_TYPE">
<input type="<?= $Page->TYPE->getInputTextType() ?>" name="x_TYPE" id="x_TYPE" data-table="laundrytech_settings" data-field="x_TYPE" value="<?= $Page->TYPE->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->TYPE->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->TYPE->formatPattern()) ?>"<?= $Page->TYPE->editAttributes() ?> aria-describedby="x_TYPE_help">
<?= $Page->TYPE->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->TYPE->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->NAME->Visible) { // NAME ?>
    <div id="r_NAME"<?= $Page->NAME->rowAttributes() ?>>
        <label id="elh_laundrytech_settings_NAME" for="x_NAME" class="<?= $Page->LeftColumnClass ?>"><?= $Page->NAME->caption() ?><?= $Page->NAME->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->NAME->cellAttributes() ?>>
<span id="el_laundrytech_settings_NAME">
<textarea data-table="laundrytech_settings" data-field="x_NAME" name="x_NAME" id="x_NAME" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->NAME->getPlaceHolder()) ?>"<?= $Page->NAME->editAttributes() ?> aria-describedby="x_NAME_help"><?= $Page->NAME->EditValue ?></textarea>
<?= $Page->NAME->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->NAME->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_USERNAME->Visible) { // USERNAME ?>
    <div id="r__USERNAME"<?= $Page->_USERNAME->rowAttributes() ?>>
        <label id="elh_laundrytech_settings__USERNAME" for="x__USERNAME" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_USERNAME->caption() ?><?= $Page->_USERNAME->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_USERNAME->cellAttributes() ?>>
<span id="el_laundrytech_settings__USERNAME">
<textarea data-table="laundrytech_settings" data-field="x__USERNAME" name="x__USERNAME" id="x__USERNAME" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->_USERNAME->getPlaceHolder()) ?>"<?= $Page->_USERNAME->editAttributes() ?> aria-describedby="x__USERNAME_help"><?= $Page->_USERNAME->EditValue ?></textarea>
<?= $Page->_USERNAME->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_USERNAME->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->COOKIE->Visible) { // COOKIE ?>
    <div id="r_COOKIE"<?= $Page->COOKIE->rowAttributes() ?>>
        <label id="elh_laundrytech_settings_COOKIE" for="x_COOKIE" class="<?= $Page->LeftColumnClass ?>"><?= $Page->COOKIE->caption() ?><?= $Page->COOKIE->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->COOKIE->cellAttributes() ?>>
<span id="el_laundrytech_settings_COOKIE">
<input type="<?= $Page->COOKIE->getInputTextType() ?>" name="x_COOKIE" id="x_COOKIE" data-table="laundrytech_settings" data-field="x_COOKIE" value="<?= $Page->COOKIE->EditValue ?>" size="30" maxlength="500" placeholder="<?= HtmlEncode($Page->COOKIE->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->COOKIE->formatPattern()) ?>"<?= $Page->COOKIE->editAttributes() ?> aria-describedby="x_COOKIE_help">
<?= $Page->COOKIE->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->COOKIE->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_SEARCH->Visible) { // SEARCH ?>
    <div id="r__SEARCH"<?= $Page->_SEARCH->rowAttributes() ?>>
        <label id="elh_laundrytech_settings__SEARCH" for="x__SEARCH" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_SEARCH->caption() ?><?= $Page->_SEARCH->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_SEARCH->cellAttributes() ?>>
<span id="el_laundrytech_settings__SEARCH">
<textarea data-table="laundrytech_settings" data-field="x__SEARCH" name="x__SEARCH" id="x__SEARCH" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->_SEARCH->getPlaceHolder()) ?>"<?= $Page->_SEARCH->editAttributes() ?> aria-describedby="x__SEARCH_help"><?= $Page->_SEARCH->EditValue ?></textarea>
<?= $Page->_SEARCH->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_SEARCH->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_TABLENAME->Visible) { // TABLENAME ?>
    <div id="r__TABLENAME"<?= $Page->_TABLENAME->rowAttributes() ?>>
        <label id="elh_laundrytech_settings__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_settings__TABLENAME">
<input type="<?= $Page->_TABLENAME->getInputTextType() ?>" name="x__TABLENAME" id="x__TABLENAME" data-table="laundrytech_settings" 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>
</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_settingsedit"><?= $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_settingsedit" 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_settings");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
