<?php

namespace PHPMaker2024\laundrytech;

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

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

        // Add fields
        .setFields([
            ["_username", [fields._username.visible && fields._username.required ? ew.Validators.required(fields._username.caption) : null], fields._username.isInvalid],
            ["_password", [fields._password.visible && fields._password.required ? ew.Validators.required(fields._password.caption) : null], fields._password.isInvalid],
            ["_email", [fields._email.visible && fields._email.required ? ew.Validators.required(fields._email.caption) : null], fields._email.isInvalid],
            ["fullname", [fields.fullname.visible && fields.fullname.required ? ew.Validators.required(fields.fullname.caption) : null], fields.fullname.isInvalid],
            ["groupid", [fields.groupid.visible && fields.groupid.required ? ew.Validators.required(fields.groupid.caption) : null], fields.groupid.isInvalid],
            ["active", [fields.active.visible && fields.active.required ? ew.Validators.required(fields.active.caption) : null, ew.Validators.integer], fields.active.isInvalid],
            ["ext_security_id", [fields.ext_security_id.visible && fields.ext_security_id.required ? ew.Validators.required(fields.ext_security_id.caption) : null], fields.ext_security_id.isInvalid],
            ["apikey", [fields.apikey.visible && fields.apikey.required ? ew.Validators.required(fields.apikey.caption) : null], fields.apikey.isInvalid],
            ["encpwd", [fields.encpwd.visible && fields.encpwd.required ? ew.Validators.fileRequired(fields.encpwd.caption) : null], fields.encpwd.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_usersadd" id="flaundrytech_usersadd" 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_users">
<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_users__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_users__username">
<input type="<?= $Page->_username->getInputTextType() ?>" name="x__username" id="x__username" data-table="laundrytech_users" 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->_password->Visible) { // password ?>
    <div id="r__password"<?= $Page->_password->rowAttributes() ?>>
        <label id="elh_laundrytech_users__password" for="x__password" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_password->caption() ?><?= $Page->_password->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_password->cellAttributes() ?>>
<span id="el_laundrytech_users__password">
<input type="<?= $Page->_password->getInputTextType() ?>" name="x__password" id="x__password" data-table="laundrytech_users" data-field="x__password" value="<?= $Page->_password->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->_password->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->_password->formatPattern()) ?>"<?= $Page->_password->editAttributes() ?> aria-describedby="x__password_help">
<?= $Page->_password->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_password->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_email->Visible) { // email ?>
    <div id="r__email"<?= $Page->_email->rowAttributes() ?>>
        <label id="elh_laundrytech_users__email" for="x__email" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_email->caption() ?><?= $Page->_email->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_email->cellAttributes() ?>>
<span id="el_laundrytech_users__email">
<input type="<?= $Page->_email->getInputTextType() ?>" name="x__email" id="x__email" data-table="laundrytech_users" data-field="x__email" value="<?= $Page->_email->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->_email->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->_email->formatPattern()) ?>"<?= $Page->_email->editAttributes() ?> aria-describedby="x__email_help">
<?= $Page->_email->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->_email->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->fullname->Visible) { // fullname ?>
    <div id="r_fullname"<?= $Page->fullname->rowAttributes() ?>>
        <label id="elh_laundrytech_users_fullname" for="x_fullname" class="<?= $Page->LeftColumnClass ?>"><?= $Page->fullname->caption() ?><?= $Page->fullname->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->fullname->cellAttributes() ?>>
<span id="el_laundrytech_users_fullname">
<input type="<?= $Page->fullname->getInputTextType() ?>" name="x_fullname" id="x_fullname" data-table="laundrytech_users" data-field="x_fullname" value="<?= $Page->fullname->EditValue ?>" size="30" maxlength="255" placeholder="<?= HtmlEncode($Page->fullname->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->fullname->formatPattern()) ?>"<?= $Page->fullname->editAttributes() ?> aria-describedby="x_fullname_help">
<?= $Page->fullname->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->fullname->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->groupid->Visible) { // groupid ?>
    <div id="r_groupid"<?= $Page->groupid->rowAttributes() ?>>
        <label id="elh_laundrytech_users_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_users_groupid">
<input type="<?= $Page->groupid->getInputTextType() ?>" name="x_groupid" id="x_groupid" data-table="laundrytech_users" data-field="x_groupid" value="<?= $Page->groupid->EditValue ?>" size="30" maxlength="255" 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->active->Visible) { // active ?>
    <div id="r_active"<?= $Page->active->rowAttributes() ?>>
        <label id="elh_laundrytech_users_active" for="x_active" class="<?= $Page->LeftColumnClass ?>"><?= $Page->active->caption() ?><?= $Page->active->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->active->cellAttributes() ?>>
<span id="el_laundrytech_users_active">
<input type="<?= $Page->active->getInputTextType() ?>" name="x_active" id="x_active" data-table="laundrytech_users" data-field="x_active" value="<?= $Page->active->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->active->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->active->formatPattern()) ?>"<?= $Page->active->editAttributes() ?> aria-describedby="x_active_help">
<?= $Page->active->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->active->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ext_security_id->Visible) { // ext_security_id ?>
    <div id="r_ext_security_id"<?= $Page->ext_security_id->rowAttributes() ?>>
        <label id="elh_laundrytech_users_ext_security_id" for="x_ext_security_id" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ext_security_id->caption() ?><?= $Page->ext_security_id->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ext_security_id->cellAttributes() ?>>
<span id="el_laundrytech_users_ext_security_id">
<input type="<?= $Page->ext_security_id->getInputTextType() ?>" name="x_ext_security_id" id="x_ext_security_id" data-table="laundrytech_users" data-field="x_ext_security_id" value="<?= $Page->ext_security_id->EditValue ?>" size="30" maxlength="100" placeholder="<?= HtmlEncode($Page->ext_security_id->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ext_security_id->formatPattern()) ?>"<?= $Page->ext_security_id->editAttributes() ?> aria-describedby="x_ext_security_id_help">
<?= $Page->ext_security_id->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ext_security_id->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->apikey->Visible) { // apikey ?>
    <div id="r_apikey"<?= $Page->apikey->rowAttributes() ?>>
        <label id="elh_laundrytech_users_apikey" for="x_apikey" class="<?= $Page->LeftColumnClass ?>"><?= $Page->apikey->caption() ?><?= $Page->apikey->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->apikey->cellAttributes() ?>>
<span id="el_laundrytech_users_apikey">
<input type="<?= $Page->apikey->getInputTextType() ?>" name="x_apikey" id="x_apikey" data-table="laundrytech_users" data-field="x_apikey" value="<?= $Page->apikey->EditValue ?>" size="30" maxlength="100" placeholder="<?= HtmlEncode($Page->apikey->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->apikey->formatPattern()) ?>"<?= $Page->apikey->editAttributes() ?> aria-describedby="x_apikey_help">
<?= $Page->apikey->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->apikey->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->encpwd->Visible) { // encpwd ?>
    <div id="r_encpwd"<?= $Page->encpwd->rowAttributes() ?>>
        <label id="elh_laundrytech_users_encpwd" class="<?= $Page->LeftColumnClass ?>"><?= $Page->encpwd->caption() ?><?= $Page->encpwd->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->encpwd->cellAttributes() ?>>
<span id="el_laundrytech_users_encpwd">
<div id="fd_x_encpwd" class="fileinput-button ew-file-drop-zone">
    <input
        type="file"
        id="x_encpwd"
        name="x_encpwd"
        class="form-control ew-file-input"
        title="<?= $Page->encpwd->title() ?>"
        lang="<?= CurrentLanguageID() ?>"
        data-table="laundrytech_users"
        data-field="x_encpwd"
        data-size="65535"
        data-accept-file-types="<?= $Page->encpwd->acceptFileTypes() ?>"
        data-max-file-size="<?= $Page->encpwd->UploadMaxFileSize ?>"
        data-max-number-of-files="null"
        data-disable-image-crop="<?= $Page->encpwd->ImageCropper ? 0 : 1 ?>"
        aria-describedby="x_encpwd_help"
        <?= ($Page->encpwd->ReadOnly || $Page->encpwd->Disabled) ? " disabled" : "" ?>
        <?= $Page->encpwd->editAttributes() ?>
    >
    <div class="text-body-secondary ew-file-text"><?= $Language->phrase("ChooseFile") ?></div>
    <?= $Page->encpwd->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->encpwd->getErrorMessage() ?></div>
</div>
<input type="hidden" name="fn_x_encpwd" id= "fn_x_encpwd" value="<?= $Page->encpwd->Upload->FileName ?>">
<input type="hidden" name="fa_x_encpwd" id= "fa_x_encpwd" value="0">
<table id="ft_x_encpwd" class="table table-sm float-start ew-upload-table"><tbody class="files"></tbody></table>
</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_usersadd"><?= $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_usersadd" 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_users");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
