<?php

namespace PHPMaker2024\laundrytech;

// Page object
$LaundrytechUgmembersAdd = &$Page;
?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { laundrytech_ugmembers: currentTable } });
var currentPageID = ew.PAGE_ID = "add";
var currentForm;
var flaundrytech_ugmembersadd;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("flaundrytech_ugmembersadd")
        .setPageId("add")

        // Add fields
        .setFields([
            ["_UserName", [fields._UserName.visible && fields._UserName.required ? ew.Validators.required(fields._UserName.caption) : null], fields._UserName.isInvalid],
            ["GroupID", [fields.GroupID.visible && fields.GroupID.required ? ew.Validators.required(fields.GroupID.caption) : null, ew.Validators.integer], fields.GroupID.isInvalid],
            ["Provider", [fields.Provider.visible && fields.Provider.required ? ew.Validators.required(fields.Provider.caption) : null], fields.Provider.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 $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<form name="flaundrytech_ugmembersadd" id="flaundrytech_ugmembersadd" class="<?= $Page->FormClassName ?>" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate autocomplete="off">
<?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_ugmembers">
<input type="hidden" name="action" id="action" value="insert">
<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-add-div"><!-- page* -->
<?php if ($Page->_UserName->Visible) { // UserName ?>
    <div id="r__UserName"<?= $Page->_UserName->rowAttributes() ?>>
        <label id="elh_laundrytech_ugmembers__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_ugmembers__UserName">
<input type="<?= $Page->_UserName->getInputTextType() ?>" name="x__UserName" id="x__UserName" data-table="laundrytech_ugmembers" data-field="x__UserName" value="<?= $Page->_UserName->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->_UserName->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->_UserName->formatPattern()) ?>"<?= $Page->_UserName->editAttributes() ?> aria-describedby="x__UserName_help">
<?= $Page->_UserName->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_UserName->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->GroupID->Visible) { // GroupID ?>
    <div id="r_GroupID"<?= $Page->GroupID->rowAttributes() ?>>
        <label id="elh_laundrytech_ugmembers_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_ugmembers_GroupID">
<input type="<?= $Page->GroupID->getInputTextType() ?>" name="x_GroupID" id="x_GroupID" data-table="laundrytech_ugmembers" 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>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Provider->Visible) { // Provider ?>
    <div id="r_Provider"<?= $Page->Provider->rowAttributes() ?>>
        <label id="elh_laundrytech_ugmembers_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_ugmembers_Provider">
<input type="<?= $Page->Provider->getInputTextType() ?>" name="x_Provider" id="x_Provider" data-table="laundrytech_ugmembers" 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 } ?>
</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_ugmembersadd"><?= $Language->phrase("AddBtn") ?></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_ugmembersadd" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
<?php } ?>
    </div><!-- /buttons offset -->
<?= $Page->IsModal ? "</template>" : "</div>" ?><!-- /buttons .row -->
</form>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("laundrytech_ugmembers");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
