<?php

namespace PHPMaker2024\laundrytech;

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

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

        // Add fields
        .setFields([
            ["GroupID", [fields.GroupID.visible && fields.GroupID.required ? ew.Validators.required(fields.GroupID.caption) : null], fields.GroupID.isInvalid],
            ["Label", [fields.Label.visible && fields.Label.required ? ew.Validators.required(fields.Label.caption) : null], fields.Label.isInvalid],
            ["Provider", [fields.Provider.visible && fields.Provider.required ? ew.Validators.required(fields.Provider.caption) : null], fields.Provider.isInvalid],
            ["Comment", [fields.Comment.visible && fields.Comment.required ? ew.Validators.required(fields.Comment.caption) : null], fields.Comment.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_uggroups">
<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->GroupID->Visible) { // GroupID ?>
    <div id="r_GroupID"<?= $Page->GroupID->rowAttributes() ?>>
        <label id="elh_laundrytech_uggroups_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_uggroups_GroupID">
<span<?= $Page->GroupID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->GroupID->getDisplayValue($Page->GroupID->EditValue))) ?>"></span>
<input type="hidden" data-table="laundrytech_uggroups" data-field="x_GroupID" data-hidden="1" name="x_GroupID" id="x_GroupID" value="<?= HtmlEncode($Page->GroupID->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Label->Visible) { // Label ?>
    <div id="r_Label"<?= $Page->Label->rowAttributes() ?>>
        <label id="elh_laundrytech_uggroups_Label" for="x_Label" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Label->caption() ?><?= $Page->Label->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Label->cellAttributes() ?>>
<span id="el_laundrytech_uggroups_Label">
<input type="<?= $Page->Label->getInputTextType() ?>" name="x_Label" id="x_Label" data-table="laundrytech_uggroups" data-field="x_Label" value="<?= $Page->Label->EditValue ?>" size="30" maxlength="300" placeholder="<?= HtmlEncode($Page->Label->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Label->formatPattern()) ?>"<?= $Page->Label->editAttributes() ?> aria-describedby="x_Label_help">
<?= $Page->Label->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Label->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Provider->Visible) { // Provider ?>
    <div id="r_Provider"<?= $Page->Provider->rowAttributes() ?>>
        <label id="elh_laundrytech_uggroups_Provider" for="x_Provider" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Provider->caption() ?><?= $Page->Provider->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Provider->cellAttributes() ?>>
<span id="el_laundrytech_uggroups_Provider">
<input type="<?= $Page->Provider->getInputTextType() ?>" name="x_Provider" id="x_Provider" data-table="laundrytech_uggroups" data-field="x_Provider" value="<?= $Page->Provider->EditValue ?>" size="30" maxlength="10" placeholder="<?= HtmlEncode($Page->Provider->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Provider->formatPattern()) ?>"<?= $Page->Provider->editAttributes() ?> aria-describedby="x_Provider_help">
<?= $Page->Provider->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Provider->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Comment->Visible) { // Comment ?>
    <div id="r_Comment"<?= $Page->Comment->rowAttributes() ?>>
        <label id="elh_laundrytech_uggroups_Comment" for="x_Comment" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Comment->caption() ?><?= $Page->Comment->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Comment->cellAttributes() ?>>
<span id="el_laundrytech_uggroups_Comment">
<textarea data-table="laundrytech_uggroups" data-field="x_Comment" name="x_Comment" id="x_Comment" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->Comment->getPlaceHolder()) ?>"<?= $Page->Comment->editAttributes() ?> aria-describedby="x_Comment_help"><?= $Page->Comment->EditValue ?></textarea>
<?= $Page->Comment->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Comment->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_uggroupsedit"><?= $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_uggroupsedit" 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_uggroups");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
