<?php

namespace ProjectManagement\prjProjectManagement;

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

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

        // Add fields
        .setFields([
            ["ResultID", [fields.ResultID.visible && fields.ResultID.required ? ew.Validators.required(fields.ResultID.caption) : null], fields.ResultID.isInvalid],
            ["Activities", [fields.Activities.visible && fields.Activities.required ? ew.Validators.required(fields.Activities.caption) : null], fields.Activities.isInvalid],
            ["DateDelivered", [fields.DateDelivered.visible && fields.DateDelivered.required ? ew.Validators.required(fields.DateDelivered.caption) : null, ew.Validators.datetime(fields.DateDelivered.clientFormatPattern)], fields.DateDelivered.isInvalid],
            ["Progress", [fields.Progress.visible && fields.Progress.required ? ew.Validators.required(fields.Progress.caption) : null, ew.Validators.float], fields.Progress.isInvalid],
            ["Status", [fields.Status.visible && fields.Status.required ? ew.Validators.required(fields.Status.caption) : null], fields.Status.isInvalid],
            ["Category", [fields.Category.visible && fields.Category.required ? ew.Validators.required(fields.Category.caption) : null], fields.Category.isInvalid],
            ["Weight", [fields.Weight.visible && fields.Weight.required ? ew.Validators.required(fields.Weight.caption) : null, ew.Validators.integer], fields.Weight.isInvalid],
            ["File", [fields.File.visible && fields.File.required ? ew.Validators.fileRequired(fields.File.caption) : null], fields.File.isInvalid],
            ["Notes", [fields.Notes.visible && fields.Notes.required ? ew.Validators.required(fields.Notes.caption) : null], fields.Notes.isInvalid],
            ["_ProjectID", [fields._ProjectID.visible && fields._ProjectID.required ? ew.Validators.required(fields._ProjectID.caption) : null], fields._ProjectID.isInvalid],
            ["Created_Date", [fields.Created_Date.visible && fields.Created_Date.required ? ew.Validators.required(fields.Created_Date.caption) : null], fields.Created_Date.isInvalid],
            ["Created_By", [fields.Created_By.visible && fields.Created_By.required ? ew.Validators.required(fields.Created_By.caption) : null], fields.Created_By.isInvalid],
            ["Last_Updated_Date", [fields.Last_Updated_Date.visible && fields.Last_Updated_Date.required ? ew.Validators.required(fields.Last_Updated_Date.caption) : null], fields.Last_Updated_Date.isInvalid],
            ["Last_Updated_By", [fields.Last_Updated_By.visible && fields.Last_Updated_By.required ? ew.Validators.required(fields.Last_Updated_By.caption) : null], fields.Last_Updated_By.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)

        // Multi-Page
        .setMultiPage(true)

        // Dynamic selection lists
        .setLists({
            "Status": <?= $Page->Status->toClientList($Page) ?>,
            "Category": <?= $Page->Category->toClientList($Page) ?>,
            "_ProjectID": <?= $Page->_ProjectID->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="projectresult">
<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 ?>">
<?php if ($Page->getCurrentMasterTable() == "masterproject") { ?>
<input type="hidden" name="<?= Config("TABLE_SHOW_MASTER") ?>" value="masterproject">
<input type="hidden" name="fk__ProjectID" value="<?= HtmlEncode($Page->_ProjectID->getSessionValue()) ?>">
<?php } ?>
<div class="ew-multi-page"><!-- multi-page -->
<div class="ew-nav<?= $Page->MultiPages->containerClasses() ?>" id="pages_ProjectresultEdit"><!-- multi-page tabs -->
    <ul class="<?= $Page->MultiPages->navClasses() ?>" role="tablist">
        <li class="nav-item"><button class="<?= $Page->MultiPages->navLinkClasses(1) ?>" data-bs-target="#tab_projectresult1" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectresult1" aria-selected="<?= JsonEncode($Page->MultiPages->isActive(1)) ?>"><?= $Page->pageCaption(1) ?></button></li>
        <li class="nav-item"><button class="<?= $Page->MultiPages->navLinkClasses(2) ?>" data-bs-target="#tab_projectresult2" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectresult2" aria-selected="<?= JsonEncode($Page->MultiPages->isActive(2)) ?>"><?= $Page->pageCaption(2) ?></button></li>
    </ul>
    <div class="<?= $Page->MultiPages->tabContentClasses() ?>"><!-- multi-page tabs .tab-content -->
        <div class="<?= $Page->MultiPages->tabPaneClasses(1) ?>" id="tab_projectresult1" role="tabpanel"><!-- multi-page .tab-pane -->
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->ResultID->Visible) { // ResultID ?>
    <div id="r_ResultID"<?= $Page->ResultID->rowAttributes() ?>>
        <label id="elh_projectresult_ResultID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ResultID->caption() ?><?= $Page->ResultID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ResultID->cellAttributes() ?>>
<span id="el_projectresult_ResultID">
<span<?= $Page->ResultID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->ResultID->getDisplayValue($Page->ResultID->EditValue))) ?>"></span>
<input type="hidden" data-table="projectresult" data-field="x_ResultID" data-hidden="1" data-page="1" name="x_ResultID" id="x_ResultID" value="<?= HtmlEncode($Page->ResultID->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Activities->Visible) { // Activities ?>
    <div id="r_Activities"<?= $Page->Activities->rowAttributes() ?>>
        <label id="elh_projectresult_Activities" for="x_Activities" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Activities->caption() ?><?= $Page->Activities->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Activities->cellAttributes() ?>>
<span id="el_projectresult_Activities">
<textarea data-table="projectresult" data-field="x_Activities" data-page="1" name="x_Activities" id="x_Activities" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->Activities->getPlaceHolder()) ?>"<?= $Page->Activities->editAttributes() ?> aria-describedby="x_Activities_help"><?= $Page->Activities->EditValue ?></textarea>
<?= $Page->Activities->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Activities->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->DateDelivered->Visible) { // DateDelivered ?>
    <div id="r_DateDelivered"<?= $Page->DateDelivered->rowAttributes() ?>>
        <label id="elh_projectresult_DateDelivered" for="x_DateDelivered" class="<?= $Page->LeftColumnClass ?>"><?= $Page->DateDelivered->caption() ?><?= $Page->DateDelivered->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->DateDelivered->cellAttributes() ?>>
<span id="el_projectresult_DateDelivered">
<input type="<?= $Page->DateDelivered->getInputTextType() ?>" name="x_DateDelivered" id="x_DateDelivered" data-table="projectresult" data-field="x_DateDelivered" value="<?= $Page->DateDelivered->EditValue ?>" data-page="1" placeholder="<?= HtmlEncode($Page->DateDelivered->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->DateDelivered->formatPattern()) ?>"<?= $Page->DateDelivered->editAttributes() ?> aria-describedby="x_DateDelivered_help">
<?= $Page->DateDelivered->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->DateDelivered->getErrorMessage() ?></div>
<?php if (!$Page->DateDelivered->ReadOnly && !$Page->DateDelivered->Disabled && !isset($Page->DateDelivered->EditAttrs["readonly"]) && !isset($Page->DateDelivered->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fprojectresultedit", "datetimepicker"], function () {
    let format = "<?= DateFormat(5) ?>",
        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("fprojectresultedit", "x_DateDelivered", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Progress->Visible) { // Progress ?>
    <div id="r_Progress"<?= $Page->Progress->rowAttributes() ?>>
        <label id="elh_projectresult_Progress" for="x_Progress" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Progress->caption() ?><?= $Page->Progress->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Progress->cellAttributes() ?>>
<span id="el_projectresult_Progress">
<input type="<?= $Page->Progress->getInputTextType() ?>" name="x_Progress" id="x_Progress" data-table="projectresult" data-field="x_Progress" value="<?= $Page->Progress->EditValue ?>" data-page="1" size="30" placeholder="<?= HtmlEncode($Page->Progress->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Progress->formatPattern()) ?>"<?= $Page->Progress->editAttributes() ?> aria-describedby="x_Progress_help">
<?= $Page->Progress->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Progress->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Status->Visible) { // Status ?>
    <div id="r_Status"<?= $Page->Status->rowAttributes() ?>>
        <label id="elh_projectresult_Status" for="x_Status" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Status->caption() ?><?= $Page->Status->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Status->cellAttributes() ?>>
<span id="el_projectresult_Status">
    <select
        id="x_Status"
        name="x_Status"
        class="form-select ew-select<?= $Page->Status->isInvalidClass() ?>"
        <?php if (!$Page->Status->IsNativeSelect) { ?>
        data-select2-id="fprojectresultedit_x_Status"
        <?php } ?>
        data-table="projectresult"
        data-field="x_Status"
        data-page="1"
        data-value-separator="<?= $Page->Status->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->Status->getPlaceHolder()) ?>"
        <?= $Page->Status->editAttributes() ?>>
        <?= $Page->Status->selectOptionListHtml("x_Status") ?>
    </select>
    <?= $Page->Status->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->Status->getErrorMessage() ?></div>
<?= $Page->Status->Lookup->getParamTag($Page, "p_x_Status") ?>
<?php if (!$Page->Status->IsNativeSelect) { ?>
<script>
loadjs.ready("fprojectresultedit", function() {
    var options = { name: "x_Status", selectId: "fprojectresultedit_x_Status" },
        el = document.querySelector("select[data-select2-id='" + options.selectId + "']");
    if (!el)
        return;
    options.closeOnSelect = !options.multiple;
    options.dropdownParent = el.closest("#ew-modal-dialog, #ew-add-opt-dialog");
    if (fprojectresultedit.lists.Status?.lookupOptions.length) {
        options.data = { id: "x_Status", form: "fprojectresultedit" };
    } else {
        options.ajax = { id: "x_Status", form: "fprojectresultedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.projectresult.fields.Status.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->File->Visible) { // File ?>
    <div id="r_File"<?= $Page->File->rowAttributes() ?>>
        <label id="elh_projectresult_File" class="<?= $Page->LeftColumnClass ?>"><?= $Page->File->caption() ?><?= $Page->File->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->File->cellAttributes() ?>>
<span id="el_projectresult_File">
<div id="fd_x_File" class="fileinput-button ew-file-drop-zone">
    <input
        type="file"
        id="x_File"
        name="x_File"
        class="form-control ew-file-input"
        title="<?= $Page->File->title() ?>"
        lang="<?= CurrentLanguageID() ?>"
        data-table="projectresult"
        data-field="x_File"
        data-size="1200"
        data-accept-file-types="<?= $Page->File->acceptFileTypes() ?>"
        data-max-file-size="<?= $Page->File->UploadMaxFileSize ?>"
        data-max-number-of-files="null"
        data-disable-image-crop="<?= $Page->File->ImageCropper ? 0 : 1 ?>"
        data-page="1"
        aria-describedby="x_File_help"
        <?= ($Page->File->ReadOnly || $Page->File->Disabled) ? " disabled" : "" ?>
        <?= $Page->File->editAttributes() ?>
    >
    <div class="text-body-secondary ew-file-text"><?= $Language->phrase("ChooseFile") ?></div>
    <?= $Page->File->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->File->getErrorMessage() ?></div>
</div>
<input type="hidden" name="fn_x_File" id= "fn_x_File" value="<?= $Page->File->Upload->FileName ?>">
<input type="hidden" name="fa_x_File" id= "fa_x_File" value="<?= (Post("fa_x_File") == "0") ? "0" : "1" ?>">
<table id="ft_x_File" class="table table-sm float-start ew-upload-table"><tbody class="files"></tbody></table>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Notes->Visible) { // Notes ?>
    <div id="r_Notes"<?= $Page->Notes->rowAttributes() ?>>
        <label id="elh_projectresult_Notes" for="x_Notes" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Notes->caption() ?><?= $Page->Notes->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Notes->cellAttributes() ?>>
<span id="el_projectresult_Notes">
<textarea data-table="projectresult" data-field="x_Notes" data-page="1" name="x_Notes" id="x_Notes" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->Notes->getPlaceHolder()) ?>"<?= $Page->Notes->editAttributes() ?> aria-describedby="x_Notes_help"><?= $Page->Notes->EditValue ?></textarea>
<?= $Page->Notes->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Notes->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
        </div><!-- /multi-page .tab-pane -->
        <div class="<?= $Page->MultiPages->tabPaneClasses(2) ?>" id="tab_projectresult2" role="tabpanel"><!-- multi-page .tab-pane -->
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->Category->Visible) { // Category ?>
    <div id="r_Category"<?= $Page->Category->rowAttributes() ?>>
        <label id="elh_projectresult_Category" for="x_Category" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Category->caption() ?><?= $Page->Category->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Category->cellAttributes() ?>>
<span id="el_projectresult_Category">
<div class="input-group flex-nowrap">
    <select
        id="x_Category"
        name="x_Category"
        class="form-select ew-select<?= $Page->Category->isInvalidClass() ?>"
        <?php if (!$Page->Category->IsNativeSelect) { ?>
        data-select2-id="fprojectresultedit_x_Category"
        <?php } ?>
        data-table="projectresult"
        data-field="x_Category"
        data-page="2"
        data-value-separator="<?= $Page->Category->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->Category->getPlaceHolder()) ?>"
        <?= $Page->Category->editAttributes() ?>>
        <?= $Page->Category->selectOptionListHtml("x_Category") ?>
    </select>
    <?php if (AllowAdd(CurrentProjectID() . "masterprojectcategory") && !$Page->Category->ReadOnly) { ?>
    <button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_Category" title="<?= HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $Page->Category->caption() ?>" data-title="<?= $Page->Category->caption() ?>" data-ew-action="add-option" data-el="x_Category" data-url="<?= GetUrl("masterprojectcategoryaddopt") ?>"><i class="fa-solid fa-plus ew-icon"></i></button>
    <?php } ?>
</div>
<?= $Page->Category->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Category->getErrorMessage() ?></div>
<?= $Page->Category->Lookup->getParamTag($Page, "p_x_Category") ?>
<?php if (!$Page->Category->IsNativeSelect) { ?>
<script>
loadjs.ready("fprojectresultedit", function() {
    var options = { name: "x_Category", selectId: "fprojectresultedit_x_Category" },
        el = document.querySelector("select[data-select2-id='" + options.selectId + "']");
    if (!el)
        return;
    options.closeOnSelect = !options.multiple;
    options.dropdownParent = el.closest("#ew-modal-dialog, #ew-add-opt-dialog");
    if (fprojectresultedit.lists.Category?.lookupOptions.length) {
        options.data = { id: "x_Category", form: "fprojectresultedit" };
    } else {
        options.ajax = { id: "x_Category", form: "fprojectresultedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.projectresult.fields.Category.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Weight->Visible) { // Weight ?>
    <div id="r_Weight"<?= $Page->Weight->rowAttributes() ?>>
        <label id="elh_projectresult_Weight" for="x_Weight" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Weight->caption() ?><?= $Page->Weight->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Weight->cellAttributes() ?>>
<span id="el_projectresult_Weight">
<input type="<?= $Page->Weight->getInputTextType() ?>" name="x_Weight" id="x_Weight" data-table="projectresult" data-field="x_Weight" value="<?= $Page->Weight->EditValue ?>" data-page="2" size="30" placeholder="<?= HtmlEncode($Page->Weight->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Weight->formatPattern()) ?>"<?= $Page->Weight->editAttributes() ?> aria-describedby="x_Weight_help">
<?= $Page->Weight->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Weight->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { // ProjectID ?>
    <div id="r__ProjectID"<?= $Page->_ProjectID->rowAttributes() ?>>
        <label id="elh_projectresult__ProjectID" for="x__ProjectID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_ProjectID->caption() ?><?= $Page->_ProjectID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_ProjectID->cellAttributes() ?>>
<?php if ($Page->_ProjectID->getSessionValue() != "") { ?>
<span<?= $Page->_ProjectID->viewAttributes() ?>>
<span class="form-control-plaintext"><?= $Page->_ProjectID->getDisplayValue($Page->_ProjectID->ViewValue) ?></span></span>
<input type="hidden" id="x__ProjectID" name="x__ProjectID" value="<?= HtmlEncode($Page->_ProjectID->CurrentValue) ?>" data-hidden="1">
<?php } else { ?>
<span id="el_projectresult__ProjectID">
    <select
        id="x__ProjectID"
        name="x__ProjectID"
        class="form-select ew-select<?= $Page->_ProjectID->isInvalidClass() ?>"
        <?php if (!$Page->_ProjectID->IsNativeSelect) { ?>
        data-select2-id="fprojectresultedit_x__ProjectID"
        <?php } ?>
        data-table="projectresult"
        data-field="x__ProjectID"
        data-page="2"
        data-value-separator="<?= $Page->_ProjectID->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->_ProjectID->getPlaceHolder()) ?>"
        <?= $Page->_ProjectID->editAttributes() ?>>
        <?= $Page->_ProjectID->selectOptionListHtml("x__ProjectID") ?>
    </select>
    <?= $Page->_ProjectID->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->_ProjectID->getErrorMessage() ?></div>
<?= $Page->_ProjectID->Lookup->getParamTag($Page, "p_x__ProjectID") ?>
<?php if (!$Page->_ProjectID->IsNativeSelect) { ?>
<script>
loadjs.ready("fprojectresultedit", function() {
    var options = { name: "x__ProjectID", selectId: "fprojectresultedit_x__ProjectID" },
        el = document.querySelector("select[data-select2-id='" + options.selectId + "']");
    if (!el)
        return;
    options.closeOnSelect = !options.multiple;
    options.dropdownParent = el.closest("#ew-modal-dialog, #ew-add-opt-dialog");
    if (fprojectresultedit.lists._ProjectID?.lookupOptions.length) {
        options.data = { id: "x__ProjectID", form: "fprojectresultedit" };
    } else {
        options.ajax = { id: "x__ProjectID", form: "fprojectresultedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.projectresult.fields._ProjectID.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
<?php } ?>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
        </div><!-- /multi-page .tab-pane -->
    </div><!-- /multi-page tabs .tab-content -->
</div><!-- /multi-page tabs -->
</div><!-- /multi-page -->
<span id="el_projectresult_Created_Date">
<input type="hidden" data-table="projectresult" data-field="x_Created_Date" data-hidden="1" data-page="3" name="x_Created_Date" id="x_Created_Date" value="<?= HtmlEncode($Page->Created_Date->CurrentValue) ?>">
</span>
<span id="el_projectresult_Created_By">
<input type="hidden" data-table="projectresult" data-field="x_Created_By" data-hidden="1" data-page="3" name="x_Created_By" id="x_Created_By" value="<?= HtmlEncode($Page->Created_By->CurrentValue) ?>">
</span>
<?= $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="fprojectresultedit"><?= $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="fprojectresultedit" 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("projectresult");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
