<?php

namespace PHPMaker2024\laundrytech;

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

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

        // Add fields
        .setFields([
            ["orderid", [fields.orderid.visible && fields.orderid.required ? ew.Validators.required(fields.orderid.caption) : null], fields.orderid.isInvalid],
            ["customerid", [fields.customerid.visible && fields.customerid.required ? ew.Validators.required(fields.customerid.caption) : null, ew.Validators.integer], fields.customerid.isInvalid],
            ["bookingdatetime", [fields.bookingdatetime.visible && fields.bookingdatetime.required ? ew.Validators.required(fields.bookingdatetime.caption) : null, ew.Validators.datetime(fields.bookingdatetime.clientFormatPattern)], fields.bookingdatetime.isInvalid],
            ["dueby", [fields.dueby.visible && fields.dueby.required ? ew.Validators.required(fields.dueby.caption) : null, ew.Validators.datetime(fields.dueby.clientFormatPattern)], fields.dueby.isInvalid],
            ["ordertype", [fields.ordertype.visible && fields.ordertype.required ? ew.Validators.required(fields.ordertype.caption) : null, ew.Validators.integer], fields.ordertype.isInvalid],
            ["invoiced", [fields.invoiced.visible && fields.invoiced.required ? ew.Validators.required(fields.invoiced.caption) : null, ew.Validators.integer], fields.invoiced.isInvalid],
            ["paid", [fields.paid.visible && fields.paid.required ? ew.Validators.required(fields.paid.caption) : null, ew.Validators.integer], fields.paid.isInvalid],
            ["ordervalue", [fields.ordervalue.visible && fields.ordervalue.required ? ew.Validators.required(fields.ordervalue.caption) : null, ew.Validators.float], fields.ordervalue.isInvalid],
            ["jobType", [fields.jobType.visible && fields.jobType.required ? ew.Validators.required(fields.jobType.caption) : null, ew.Validators.integer], fields.jobType.isInvalid],
            ["createdOn", [fields.createdOn.visible && fields.createdOn.required ? ew.Validators.required(fields.createdOn.caption) : null, ew.Validators.datetime(fields.createdOn.clientFormatPattern)], fields.createdOn.isInvalid],
            ["createdBy", [fields.createdBy.visible && fields.createdBy.required ? ew.Validators.required(fields.createdBy.caption) : null, ew.Validators.integer], fields.createdBy.isInvalid],
            ["siteId", [fields.siteId.visible && fields.siteId.required ? ew.Validators.required(fields.siteId.caption) : null, ew.Validators.integer], fields.siteId.isInvalid],
            ["pickupComplete", [fields.pickupComplete.visible && fields.pickupComplete.required ? ew.Validators.required(fields.pickupComplete.caption) : null, ew.Validators.integer], fields.pickupComplete.isInvalid],
            ["pickupDatetime", [fields.pickupDatetime.visible && fields.pickupDatetime.required ? ew.Validators.required(fields.pickupDatetime.caption) : null, ew.Validators.datetime(fields.pickupDatetime.clientFormatPattern)], fields.pickupDatetime.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({
            "customerid": <?= $Page->customerid->toClientList($Page) ?>,
            "ordertype": <?= $Page->ordertype->toClientList($Page) ?>,
        })
        .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="orders">
<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->orderid->Visible) { // orderid ?>
    <div id="r_orderid"<?= $Page->orderid->rowAttributes() ?>>
        <label id="elh_orders_orderid" class="<?= $Page->LeftColumnClass ?>"><?= $Page->orderid->caption() ?><?= $Page->orderid->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->orderid->cellAttributes() ?>>
<span id="el_orders_orderid">
<span<?= $Page->orderid->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->orderid->getDisplayValue($Page->orderid->EditValue))) ?>"></span>
<input type="hidden" data-table="orders" data-field="x_orderid" data-hidden="1" name="x_orderid" id="x_orderid" value="<?= HtmlEncode($Page->orderid->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->customerid->Visible) { // customerid ?>
    <div id="r_customerid"<?= $Page->customerid->rowAttributes() ?>>
        <label id="elh_orders_customerid" class="<?= $Page->LeftColumnClass ?>"><?= $Page->customerid->caption() ?><?= $Page->customerid->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->customerid->cellAttributes() ?>>
<span id="el_orders_customerid">
<?php
if (IsRTL()) {
    $Page->customerid->EditAttrs["dir"] = "rtl";
}
?>
<span id="as_x_customerid" class="ew-auto-suggest">
    <input type="<?= $Page->customerid->getInputTextType() ?>" class="form-control" name="sv_x_customerid" id="sv_x_customerid" value="<?= RemoveHtml($Page->customerid->EditValue) ?>" autocomplete="off" size="30" placeholder="<?= HtmlEncode($Page->customerid->getPlaceHolder()) ?>" data-placeholder="<?= HtmlEncode($Page->customerid->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->customerid->formatPattern()) ?>"<?= $Page->customerid->editAttributes() ?> aria-describedby="x_customerid_help">
</span>
<selection-list hidden class="form-control" data-table="orders" data-field="x_customerid" data-input="sv_x_customerid" data-value-separator="<?= $Page->customerid->displayValueSeparatorAttribute() ?>" name="x_customerid" id="x_customerid" value="<?= HtmlEncode($Page->customerid->CurrentValue) ?>"></selection-list>
<?= $Page->customerid->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->customerid->getErrorMessage() ?></div>
<script>
loadjs.ready("fordersedit", function() {
    fordersedit.createAutoSuggest(Object.assign({"id":"x_customerid","forceSelect":false}, { lookupAllDisplayFields: <?= $Page->customerid->Lookup->LookupAllDisplayFields ? "true" : "false" ?> }, ew.vars.tables.orders.fields.customerid.autoSuggestOptions));
});
</script>
<?= $Page->customerid->Lookup->getParamTag($Page, "p_x_customerid") ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->bookingdatetime->Visible) { // bookingdatetime ?>
    <div id="r_bookingdatetime"<?= $Page->bookingdatetime->rowAttributes() ?>>
        <label id="elh_orders_bookingdatetime" for="x_bookingdatetime" class="<?= $Page->LeftColumnClass ?>"><?= $Page->bookingdatetime->caption() ?><?= $Page->bookingdatetime->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->bookingdatetime->cellAttributes() ?>>
<span id="el_orders_bookingdatetime">
<input type="<?= $Page->bookingdatetime->getInputTextType() ?>" name="x_bookingdatetime" id="x_bookingdatetime" data-table="orders" data-field="x_bookingdatetime" value="<?= $Page->bookingdatetime->EditValue ?>" placeholder="<?= HtmlEncode($Page->bookingdatetime->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->bookingdatetime->formatPattern()) ?>"<?= $Page->bookingdatetime->editAttributes() ?> aria-describedby="x_bookingdatetime_help">
<?= $Page->bookingdatetime->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->bookingdatetime->getErrorMessage() ?></div>
<?php if (!$Page->bookingdatetime->ReadOnly && !$Page->bookingdatetime->Disabled && !isset($Page->bookingdatetime->EditAttrs["readonly"]) && !isset($Page->bookingdatetime->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fordersedit", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fordersedit", "x_bookingdatetime", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->dueby->Visible) { // dueby ?>
    <div id="r_dueby"<?= $Page->dueby->rowAttributes() ?>>
        <label id="elh_orders_dueby" for="x_dueby" class="<?= $Page->LeftColumnClass ?>"><?= $Page->dueby->caption() ?><?= $Page->dueby->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->dueby->cellAttributes() ?>>
<span id="el_orders_dueby">
<input type="<?= $Page->dueby->getInputTextType() ?>" name="x_dueby" id="x_dueby" data-table="orders" data-field="x_dueby" value="<?= $Page->dueby->EditValue ?>" placeholder="<?= HtmlEncode($Page->dueby->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->dueby->formatPattern()) ?>"<?= $Page->dueby->editAttributes() ?> aria-describedby="x_dueby_help">
<?= $Page->dueby->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->dueby->getErrorMessage() ?></div>
<?php if (!$Page->dueby->ReadOnly && !$Page->dueby->Disabled && !isset($Page->dueby->EditAttrs["readonly"]) && !isset($Page->dueby->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fordersedit", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fordersedit", "x_dueby", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ordertype->Visible) { // ordertype ?>
    <div id="r_ordertype"<?= $Page->ordertype->rowAttributes() ?>>
        <label id="elh_orders_ordertype" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ordertype->caption() ?><?= $Page->ordertype->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ordertype->cellAttributes() ?>>
<span id="el_orders_ordertype">
<?php
if (IsRTL()) {
    $Page->ordertype->EditAttrs["dir"] = "rtl";
}
?>
<span id="as_x_ordertype" class="ew-auto-suggest">
    <input type="<?= $Page->ordertype->getInputTextType() ?>" class="form-control" name="sv_x_ordertype" id="sv_x_ordertype" value="<?= RemoveHtml($Page->ordertype->EditValue) ?>" autocomplete="off" size="30" placeholder="<?= HtmlEncode($Page->ordertype->getPlaceHolder()) ?>" data-placeholder="<?= HtmlEncode($Page->ordertype->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ordertype->formatPattern()) ?>"<?= $Page->ordertype->editAttributes() ?> aria-describedby="x_ordertype_help">
</span>
<selection-list hidden class="form-control" data-table="orders" data-field="x_ordertype" data-input="sv_x_ordertype" data-value-separator="<?= $Page->ordertype->displayValueSeparatorAttribute() ?>" name="x_ordertype" id="x_ordertype" value="<?= HtmlEncode($Page->ordertype->CurrentValue) ?>"></selection-list>
<?= $Page->ordertype->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ordertype->getErrorMessage() ?></div>
<script>
loadjs.ready("fordersedit", function() {
    fordersedit.createAutoSuggest(Object.assign({"id":"x_ordertype","forceSelect":false}, { lookupAllDisplayFields: <?= $Page->ordertype->Lookup->LookupAllDisplayFields ? "true" : "false" ?> }, ew.vars.tables.orders.fields.ordertype.autoSuggestOptions));
});
</script>
<?= $Page->ordertype->Lookup->getParamTag($Page, "p_x_ordertype") ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->invoiced->Visible) { // invoiced ?>
    <div id="r_invoiced"<?= $Page->invoiced->rowAttributes() ?>>
        <label id="elh_orders_invoiced" for="x_invoiced" class="<?= $Page->LeftColumnClass ?>"><?= $Page->invoiced->caption() ?><?= $Page->invoiced->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->invoiced->cellAttributes() ?>>
<span id="el_orders_invoiced">
<input type="<?= $Page->invoiced->getInputTextType() ?>" name="x_invoiced" id="x_invoiced" data-table="orders" data-field="x_invoiced" value="<?= $Page->invoiced->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->invoiced->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->invoiced->formatPattern()) ?>"<?= $Page->invoiced->editAttributes() ?> aria-describedby="x_invoiced_help">
<?= $Page->invoiced->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->invoiced->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->paid->Visible) { // paid ?>
    <div id="r_paid"<?= $Page->paid->rowAttributes() ?>>
        <label id="elh_orders_paid" for="x_paid" class="<?= $Page->LeftColumnClass ?>"><?= $Page->paid->caption() ?><?= $Page->paid->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->paid->cellAttributes() ?>>
<span id="el_orders_paid">
<input type="<?= $Page->paid->getInputTextType() ?>" name="x_paid" id="x_paid" data-table="orders" data-field="x_paid" value="<?= $Page->paid->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->paid->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->paid->formatPattern()) ?>"<?= $Page->paid->editAttributes() ?> aria-describedby="x_paid_help">
<?= $Page->paid->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->paid->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ordervalue->Visible) { // ordervalue ?>
    <div id="r_ordervalue"<?= $Page->ordervalue->rowAttributes() ?>>
        <label id="elh_orders_ordervalue" for="x_ordervalue" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ordervalue->caption() ?><?= $Page->ordervalue->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ordervalue->cellAttributes() ?>>
<span id="el_orders_ordervalue">
<input type="<?= $Page->ordervalue->getInputTextType() ?>" name="x_ordervalue" id="x_ordervalue" data-table="orders" data-field="x_ordervalue" value="<?= $Page->ordervalue->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->ordervalue->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ordervalue->formatPattern()) ?>"<?= $Page->ordervalue->editAttributes() ?> aria-describedby="x_ordervalue_help">
<?= $Page->ordervalue->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ordervalue->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->jobType->Visible) { // jobType ?>
    <div id="r_jobType"<?= $Page->jobType->rowAttributes() ?>>
        <label id="elh_orders_jobType" for="x_jobType" class="<?= $Page->LeftColumnClass ?>"><?= $Page->jobType->caption() ?><?= $Page->jobType->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->jobType->cellAttributes() ?>>
<span id="el_orders_jobType">
<input type="<?= $Page->jobType->getInputTextType() ?>" name="x_jobType" id="x_jobType" data-table="orders" data-field="x_jobType" value="<?= $Page->jobType->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->jobType->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->jobType->formatPattern()) ?>"<?= $Page->jobType->editAttributes() ?> aria-describedby="x_jobType_help">
<?= $Page->jobType->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->jobType->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->createdOn->Visible) { // createdOn ?>
    <div id="r_createdOn"<?= $Page->createdOn->rowAttributes() ?>>
        <label id="elh_orders_createdOn" for="x_createdOn" class="<?= $Page->LeftColumnClass ?>"><?= $Page->createdOn->caption() ?><?= $Page->createdOn->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->createdOn->cellAttributes() ?>>
<span id="el_orders_createdOn">
<input type="<?= $Page->createdOn->getInputTextType() ?>" name="x_createdOn" id="x_createdOn" data-table="orders" data-field="x_createdOn" value="<?= $Page->createdOn->EditValue ?>" placeholder="<?= HtmlEncode($Page->createdOn->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->createdOn->formatPattern()) ?>"<?= $Page->createdOn->editAttributes() ?> aria-describedby="x_createdOn_help">
<?= $Page->createdOn->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->createdOn->getErrorMessage() ?></div>
<?php if (!$Page->createdOn->ReadOnly && !$Page->createdOn->Disabled && !isset($Page->createdOn->EditAttrs["readonly"]) && !isset($Page->createdOn->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fordersedit", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fordersedit", "x_createdOn", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->createdBy->Visible) { // createdBy ?>
    <div id="r_createdBy"<?= $Page->createdBy->rowAttributes() ?>>
        <label id="elh_orders_createdBy" for="x_createdBy" class="<?= $Page->LeftColumnClass ?>"><?= $Page->createdBy->caption() ?><?= $Page->createdBy->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->createdBy->cellAttributes() ?>>
<span id="el_orders_createdBy">
<input type="<?= $Page->createdBy->getInputTextType() ?>" name="x_createdBy" id="x_createdBy" data-table="orders" data-field="x_createdBy" value="<?= $Page->createdBy->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->createdBy->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->createdBy->formatPattern()) ?>"<?= $Page->createdBy->editAttributes() ?> aria-describedby="x_createdBy_help">
<?= $Page->createdBy->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->createdBy->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->siteId->Visible) { // siteId ?>
    <div id="r_siteId"<?= $Page->siteId->rowAttributes() ?>>
        <label id="elh_orders_siteId" for="x_siteId" class="<?= $Page->LeftColumnClass ?>"><?= $Page->siteId->caption() ?><?= $Page->siteId->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->siteId->cellAttributes() ?>>
<span id="el_orders_siteId">
<input type="<?= $Page->siteId->getInputTextType() ?>" name="x_siteId" id="x_siteId" data-table="orders" data-field="x_siteId" value="<?= $Page->siteId->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->siteId->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->siteId->formatPattern()) ?>"<?= $Page->siteId->editAttributes() ?> aria-describedby="x_siteId_help">
<?= $Page->siteId->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->siteId->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->pickupComplete->Visible) { // pickupComplete ?>
    <div id="r_pickupComplete"<?= $Page->pickupComplete->rowAttributes() ?>>
        <label id="elh_orders_pickupComplete" for="x_pickupComplete" class="<?= $Page->LeftColumnClass ?>"><?= $Page->pickupComplete->caption() ?><?= $Page->pickupComplete->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->pickupComplete->cellAttributes() ?>>
<span id="el_orders_pickupComplete">
<input type="<?= $Page->pickupComplete->getInputTextType() ?>" name="x_pickupComplete" id="x_pickupComplete" data-table="orders" data-field="x_pickupComplete" value="<?= $Page->pickupComplete->EditValue ?>" size="30" placeholder="<?= HtmlEncode($Page->pickupComplete->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->pickupComplete->formatPattern()) ?>"<?= $Page->pickupComplete->editAttributes() ?> aria-describedby="x_pickupComplete_help">
<?= $Page->pickupComplete->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->pickupComplete->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->pickupDatetime->Visible) { // pickupDatetime ?>
    <div id="r_pickupDatetime"<?= $Page->pickupDatetime->rowAttributes() ?>>
        <label id="elh_orders_pickupDatetime" for="x_pickupDatetime" class="<?= $Page->LeftColumnClass ?>"><?= $Page->pickupDatetime->caption() ?><?= $Page->pickupDatetime->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->pickupDatetime->cellAttributes() ?>>
<span id="el_orders_pickupDatetime">
<input type="<?= $Page->pickupDatetime->getInputTextType() ?>" name="x_pickupDatetime" id="x_pickupDatetime" data-table="orders" data-field="x_pickupDatetime" value="<?= $Page->pickupDatetime->EditValue ?>" placeholder="<?= HtmlEncode($Page->pickupDatetime->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->pickupDatetime->formatPattern()) ?>"<?= $Page->pickupDatetime->editAttributes() ?> aria-describedby="x_pickupDatetime_help">
<?= $Page->pickupDatetime->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->pickupDatetime->getErrorMessage() ?></div>
<?php if (!$Page->pickupDatetime->ReadOnly && !$Page->pickupDatetime->Disabled && !isset($Page->pickupDatetime->EditAttrs["readonly"]) && !isset($Page->pickupDatetime->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fordersedit", "datetimepicker"], function () {
    let format = "<?= DateFormat(0) ?>",
        options = {
            localization: {
                locale: ew.LANGUAGE_ID + "-u-nu-" + ew.getNumberingSystem(),
                hourCycle: format.match(/H/) ? "h24" : "h12",
                format,
                ...ew.language.phrase("datetimepicker")
            },
            display: {
                icons: {
                    previous: ew.IS_RTL ? "fa-solid fa-chevron-right" : "fa-solid fa-chevron-left",
                    next: ew.IS_RTL ? "fa-solid fa-chevron-left" : "fa-solid fa-chevron-right"
                },
                components: {
                    hours: !!format.match(/h/i),
                    minutes: !!format.match(/m/),
                    seconds: !!format.match(/s/i)
                },
                theme: ew.getPreferredTheme()
            }
        };
    ew.createDateTimePicker("fordersedit", "x_pickupDatetime", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
<?php
    if (in_array("ordercontainers", explode(",", $Page->getCurrentDetailTable())) && $ordercontainers->DetailEdit) {
?>
<?php if ($Page->getCurrentDetailTable() != "") { ?>
<h4 class="ew-detail-caption"><?= $Language->tablePhrase("ordercontainers", "TblCaption") ?></h4>
<?php } ?>
<?php include_once "OrdercontainersGrid.php" ?>
<?php } ?>
<?php
    if (in_array("orderstages", explode(",", $Page->getCurrentDetailTable())) && $orderstages->DetailEdit) {
?>
<?php if ($Page->getCurrentDetailTable() != "") { ?>
<h4 class="ew-detail-caption"><?= $Language->tablePhrase("orderstages", "TblCaption") ?></h4>
<?php } ?>
<?php include_once "OrderstagesGrid.php" ?>
<?php } ?>
<?php
    if (in_array("orderarticles", explode(",", $Page->getCurrentDetailTable())) && $orderarticles->DetailEdit) {
?>
<?php if ($Page->getCurrentDetailTable() != "") { ?>
<h4 class="ew-detail-caption"><?= $Language->tablePhrase("orderarticles", "TblCaption") ?></h4>
<?php } ?>
<?php include_once "OrderarticlesGrid.php" ?>
<?php } ?>
<?= $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="fordersedit"><?= $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="fordersedit" 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("orders");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
