<?php

namespace ProjectManagement\prjProjectManagement;

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

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

        // Add fields
        .setFields([
            ["_ProjectID", [fields._ProjectID.visible && fields._ProjectID.required ? ew.Validators.required(fields._ProjectID.caption) : null], fields._ProjectID.isInvalid],
            ["ProjectName", [fields.ProjectName.visible && fields.ProjectName.required ? ew.Validators.required(fields.ProjectName.caption) : null], fields.ProjectName.isInvalid],
            ["PlanStart", [fields.PlanStart.visible && fields.PlanStart.required ? ew.Validators.required(fields.PlanStart.caption) : null, ew.Validators.datetime(fields.PlanStart.clientFormatPattern)], fields.PlanStart.isInvalid],
            ["PlanEnd", [fields.PlanEnd.visible && fields.PlanEnd.required ? ew.Validators.required(fields.PlanEnd.caption) : null, ew.Validators.datetime(fields.PlanEnd.clientFormatPattern)], fields.PlanEnd.isInvalid],
            ["StartDate", [fields.StartDate.visible && fields.StartDate.required ? ew.Validators.required(fields.StartDate.caption) : null, ew.Validators.datetime(fields.StartDate.clientFormatPattern)], fields.StartDate.isInvalid],
            ["EndDate", [fields.EndDate.visible && fields.EndDate.required ? ew.Validators.required(fields.EndDate.caption) : null, ew.Validators.datetime(fields.EndDate.clientFormatPattern)], fields.EndDate.isInvalid],
            ["WarrantyEnd", [fields.WarrantyEnd.visible && fields.WarrantyEnd.required ? ew.Validators.required(fields.WarrantyEnd.caption) : null, ew.Validators.datetime(fields.WarrantyEnd.clientFormatPattern)], fields.WarrantyEnd.isInvalid],
            ["Status", [fields.Status.visible && fields.Status.required ? ew.Validators.required(fields.Status.caption) : null], fields.Status.isInvalid],
            ["Progress", [fields.Progress.visible && fields.Progress.required ? ew.Validators.required(fields.Progress.caption) : null], fields.Progress.isInvalid],
            ["PaymentProgress", [fields.PaymentProgress.visible && fields.PaymentProgress.required ? ew.Validators.required(fields.PaymentProgress.caption) : null], fields.PaymentProgress.isInvalid],
            ["PaymentDate", [fields.PaymentDate.visible && fields.PaymentDate.required ? ew.Validators.required(fields.PaymentDate.caption) : null], fields.PaymentDate.isInvalid],
            ["ClientID", [fields.ClientID.visible && fields.ClientID.required ? ew.Validators.required(fields.ClientID.caption) : null], fields.ClientID.isInvalid],
            ["ManagerID", [fields.ManagerID.visible && fields.ManagerID.required ? ew.Validators.required(fields.ManagerID.caption) : null], fields.ManagerID.isInvalid],
            ["ProjectTemplateID", [fields.ProjectTemplateID.visible && fields.ProjectTemplateID.required ? ew.Validators.required(fields.ProjectTemplateID.caption) : null], fields.ProjectTemplateID.isInvalid],
            ["Priority", [fields.Priority.visible && fields.Priority.required ? ew.Validators.required(fields.Priority.caption) : null], fields.Priority.isInvalid],
            ["Description", [fields.Description.visible && fields.Description.required ? ew.Validators.required(fields.Description.caption) : null], fields.Description.isInvalid],
            ["ProjectValue", [fields.ProjectValue.visible && fields.ProjectValue.required ? ew.Validators.required(fields.ProjectValue.caption) : null, ew.Validators.float], fields.ProjectValue.isInvalid],
            ["ProjectDebt", [fields.ProjectDebt.visible && fields.ProjectDebt.required ? ew.Validators.required(fields.ProjectDebt.caption) : null, ew.Validators.float], fields.ProjectDebt.isInvalid],
            ["PONumber", [fields.PONumber.visible && fields.PONumber.required ? ew.Validators.required(fields.PONumber.caption) : null], fields.PONumber.isInvalid],
            ["PaymentLink", [fields.PaymentLink.visible && fields.PaymentLink.required ? ew.Validators.required(fields.PaymentLink.caption) : null], fields.PaymentLink.isInvalid],
            ["ClearingDate", [fields.ClearingDate.visible && fields.ClearingDate.required ? ew.Validators.required(fields.ClearingDate.caption) : null, ew.Validators.datetime(fields.ClearingDate.clientFormatPattern)], fields.ClearingDate.isInvalid],
            ["ClearingAging", [fields.ClearingAging.visible && fields.ClearingAging.required ? ew.Validators.required(fields.ClearingAging.caption) : null, ew.Validators.integer], fields.ClearingAging.isInvalid],
            ["Active", [fields.Active.visible && fields.Active.required ? ew.Validators.required(fields.Active.caption) : null], fields.Active.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) ?>,
            "ClientID": <?= $Page->ClientID->toClientList($Page) ?>,
            "ManagerID": <?= $Page->ManagerID->toClientList($Page) ?>,
            "ProjectTemplateID": <?= $Page->ProjectTemplateID->toClientList($Page) ?>,
            "Priority": <?= $Page->Priority->toClientList($Page) ?>,
            "Active": <?= $Page->Active->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="masterproject">
<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-multi-page"><!-- multi-page -->
<div class="ew-nav<?= $Page->MultiPages->containerClasses() ?>" id="pages_MasterprojectEdit"><!-- multi-page tabs -->
    <ul class="<?= $Page->MultiPages->navClasses() ?>" role="tablist">
        <li class="nav-item"><button class="<?= $Page->MultiPages->navLinkClasses(1) ?>" data-bs-target="#tab_masterproject1" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_masterproject1" 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_masterproject2" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_masterproject2" aria-selected="<?= JsonEncode($Page->MultiPages->isActive(2)) ?>"><?= $Page->pageCaption(2) ?></button></li>
        <li class="nav-item"><button class="<?= $Page->MultiPages->navLinkClasses(3) ?>" data-bs-target="#tab_masterproject3" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_masterproject3" aria-selected="<?= JsonEncode($Page->MultiPages->isActive(3)) ?>"><?= $Page->pageCaption(3) ?></button></li>
    </ul>
    <div class="<?= $Page->MultiPages->tabContentClasses() ?>"><!-- multi-page tabs .tab-content -->
        <div class="<?= $Page->MultiPages->tabPaneClasses(1) ?>" id="tab_masterproject1" role="tabpanel"><!-- multi-page .tab-pane -->
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->_ProjectID->Visible) { // ProjectID ?>
    <div id="r__ProjectID"<?= $Page->_ProjectID->rowAttributes() ?>>
        <label id="elh_masterproject__ProjectID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->_ProjectID->caption() ?><?= $Page->_ProjectID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->_ProjectID->cellAttributes() ?>>
<span id="el_masterproject__ProjectID">
<span<?= $Page->_ProjectID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->_ProjectID->getDisplayValue($Page->_ProjectID->EditValue))) ?>"></span>
<input type="hidden" data-table="masterproject" data-field="x__ProjectID" data-hidden="1" data-page="1" name="x__ProjectID" id="x__ProjectID" value="<?= HtmlEncode($Page->_ProjectID->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ProjectName->Visible) { // ProjectName ?>
    <div id="r_ProjectName"<?= $Page->ProjectName->rowAttributes() ?>>
        <label id="elh_masterproject_ProjectName" for="x_ProjectName" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ProjectName->caption() ?><?= $Page->ProjectName->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ProjectName->cellAttributes() ?>>
<span id="el_masterproject_ProjectName">
<input type="<?= $Page->ProjectName->getInputTextType() ?>" name="x_ProjectName" id="x_ProjectName" data-table="masterproject" data-field="x_ProjectName" value="<?= $Page->ProjectName->EditValue ?>" data-page="1" size="30" maxlength="100" placeholder="<?= HtmlEncode($Page->ProjectName->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ProjectName->formatPattern()) ?>"<?= $Page->ProjectName->editAttributes() ?> aria-describedby="x_ProjectName_help">
<?= $Page->ProjectName->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ProjectName->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Status->Visible) { // Status ?>
    <div id="r_Status"<?= $Page->Status->rowAttributes() ?>>
        <label id="elh_masterproject_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_masterproject_Status">
<div class="input-group flex-nowrap">
    <select
        id="x_Status"
        name="x_Status"
        class="form-select ew-select<?= $Page->Status->isInvalidClass() ?>"
        <?php if (!$Page->Status->IsNativeSelect) { ?>
        data-select2-id="fmasterprojectedit_x_Status"
        <?php } ?>
        data-table="masterproject"
        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>
    <?php if (AllowAdd(CurrentProjectID() . "masterprogress") && !$Page->Status->ReadOnly) { ?>
    <button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_Status" title="<?= HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $Page->Status->caption() ?>" data-title="<?= $Page->Status->caption() ?>" data-ew-action="add-option" data-el="x_Status" data-url="<?= GetUrl("masterprogressaddopt") ?>"><i class="fa-solid fa-plus ew-icon"></i></button>
    <?php } ?>
</div>
<?= $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("fmasterprojectedit", function() {
    var options = { name: "x_Status", selectId: "fmasterprojectedit_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 (fmasterprojectedit.lists.Status?.lookupOptions.length) {
        options.data = { id: "x_Status", form: "fmasterprojectedit" };
    } else {
        options.ajax = { id: "x_Status", form: "fmasterprojectedit", limit: 3 };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.masterproject.fields.Status.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Progress->Visible) { // Progress ?>
    <div id="r_Progress"<?= $Page->Progress->rowAttributes() ?>>
        <label id="elh_masterproject_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_masterproject_Progress">
<span<?= $Page->Progress->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->Progress->getDisplayValue($Page->Progress->EditValue))) ?>"></span>
<input type="hidden" data-table="masterproject" data-field="x_Progress" data-hidden="1" data-page="1" name="x_Progress" id="x_Progress" value="<?= HtmlEncode($Page->Progress->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ClientID->Visible) { // ClientID ?>
    <div id="r_ClientID"<?= $Page->ClientID->rowAttributes() ?>>
        <label id="elh_masterproject_ClientID" for="x_ClientID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ClientID->caption() ?><?= $Page->ClientID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ClientID->cellAttributes() ?>>
<span id="el_masterproject_ClientID">
<div class="input-group flex-nowrap">
    <select
        id="x_ClientID"
        name="x_ClientID"
        class="form-select ew-select<?= $Page->ClientID->isInvalidClass() ?>"
        <?php if (!$Page->ClientID->IsNativeSelect) { ?>
        data-select2-id="fmasterprojectedit_x_ClientID"
        <?php } ?>
        data-table="masterproject"
        data-field="x_ClientID"
        data-page="1"
        data-value-separator="<?= $Page->ClientID->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->ClientID->getPlaceHolder()) ?>"
        <?= $Page->ClientID->editAttributes() ?>>
        <?= $Page->ClientID->selectOptionListHtml("x_ClientID") ?>
    </select>
    <?php if (AllowAdd(CurrentProjectID() . "masterclient") && !$Page->ClientID->ReadOnly) { ?>
    <button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_ClientID" title="<?= HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $Page->ClientID->caption() ?>" data-title="<?= $Page->ClientID->caption() ?>" data-ew-action="add-option" data-el="x_ClientID" data-url="<?= GetUrl("masterclientaddopt") ?>"><i class="fa-solid fa-plus ew-icon"></i></button>
    <?php } ?>
</div>
<?= $Page->ClientID->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ClientID->getErrorMessage() ?></div>
<?= $Page->ClientID->Lookup->getParamTag($Page, "p_x_ClientID") ?>
<?php if (!$Page->ClientID->IsNativeSelect) { ?>
<script>
loadjs.ready("fmasterprojectedit", function() {
    var options = { name: "x_ClientID", selectId: "fmasterprojectedit_x_ClientID" },
        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 (fmasterprojectedit.lists.ClientID?.lookupOptions.length) {
        options.data = { id: "x_ClientID", form: "fmasterprojectedit" };
    } else {
        options.ajax = { id: "x_ClientID", form: "fmasterprojectedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.masterproject.fields.ClientID.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ManagerID->Visible) { // ManagerID ?>
    <div id="r_ManagerID"<?= $Page->ManagerID->rowAttributes() ?>>
        <label id="elh_masterproject_ManagerID" for="x_ManagerID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ManagerID->caption() ?><?= $Page->ManagerID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ManagerID->cellAttributes() ?>>
<span id="el_masterproject_ManagerID">
<div class="input-group flex-nowrap">
    <select
        id="x_ManagerID"
        name="x_ManagerID"
        class="form-select ew-select<?= $Page->ManagerID->isInvalidClass() ?>"
        <?php if (!$Page->ManagerID->IsNativeSelect) { ?>
        data-select2-id="fmasterprojectedit_x_ManagerID"
        <?php } ?>
        data-table="masterproject"
        data-field="x_ManagerID"
        data-page="1"
        data-value-separator="<?= $Page->ManagerID->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->ManagerID->getPlaceHolder()) ?>"
        <?= $Page->ManagerID->editAttributes() ?>>
        <?= $Page->ManagerID->selectOptionListHtml("x_ManagerID") ?>
    </select>
    <?php if (AllowAdd(CurrentProjectID() . "masteruser") && !$Page->ManagerID->ReadOnly) { ?>
    <button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_ManagerID" title="<?= HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $Page->ManagerID->caption() ?>" data-title="<?= $Page->ManagerID->caption() ?>" data-ew-action="add-option" data-el="x_ManagerID" data-url="<?= GetUrl("masteruseraddopt") ?>"><i class="fa-solid fa-plus ew-icon"></i></button>
    <?php } ?>
</div>
<?= $Page->ManagerID->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ManagerID->getErrorMessage() ?></div>
<?= $Page->ManagerID->Lookup->getParamTag($Page, "p_x_ManagerID") ?>
<?php if (!$Page->ManagerID->IsNativeSelect) { ?>
<script>
loadjs.ready("fmasterprojectedit", function() {
    var options = { name: "x_ManagerID", selectId: "fmasterprojectedit_x_ManagerID" },
        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 (fmasterprojectedit.lists.ManagerID?.lookupOptions.length) {
        options.data = { id: "x_ManagerID", form: "fmasterprojectedit" };
    } else {
        options.ajax = { id: "x_ManagerID", form: "fmasterprojectedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.masterproject.fields.ManagerID.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ProjectTemplateID->Visible) { // ProjectTemplateID ?>
    <div id="r_ProjectTemplateID"<?= $Page->ProjectTemplateID->rowAttributes() ?>>
        <label id="elh_masterproject_ProjectTemplateID" for="x_ProjectTemplateID" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ProjectTemplateID->caption() ?><?= $Page->ProjectTemplateID->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ProjectTemplateID->cellAttributes() ?>>
<span id="el_masterproject_ProjectTemplateID">
<div class="input-group flex-nowrap">
    <select
        id="x_ProjectTemplateID"
        name="x_ProjectTemplateID"
        class="form-select ew-select<?= $Page->ProjectTemplateID->isInvalidClass() ?>"
        <?php if (!$Page->ProjectTemplateID->IsNativeSelect) { ?>
        data-select2-id="fmasterprojectedit_x_ProjectTemplateID"
        <?php } ?>
        data-table="masterproject"
        data-field="x_ProjectTemplateID"
        data-page="1"
        data-value-separator="<?= $Page->ProjectTemplateID->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->ProjectTemplateID->getPlaceHolder()) ?>"
        <?= $Page->ProjectTemplateID->editAttributes() ?>>
        <?= $Page->ProjectTemplateID->selectOptionListHtml("x_ProjectTemplateID") ?>
    </select>
    <?php if (AllowAdd(CurrentProjectID() . "projecttemplate") && !$Page->ProjectTemplateID->ReadOnly) { ?>
    <button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_ProjectTemplateID" title="<?= HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $Page->ProjectTemplateID->caption() ?>" data-title="<?= $Page->ProjectTemplateID->caption() ?>" data-ew-action="add-option" data-el="x_ProjectTemplateID" data-url="<?= GetUrl("projecttemplateaddopt") ?>"><i class="fa-solid fa-plus ew-icon"></i></button>
    <?php } ?>
</div>
<?= $Page->ProjectTemplateID->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ProjectTemplateID->getErrorMessage() ?></div>
<?= $Page->ProjectTemplateID->Lookup->getParamTag($Page, "p_x_ProjectTemplateID") ?>
<?php if (!$Page->ProjectTemplateID->IsNativeSelect) { ?>
<script>
loadjs.ready("fmasterprojectedit", function() {
    var options = { name: "x_ProjectTemplateID", selectId: "fmasterprojectedit_x_ProjectTemplateID" },
        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 (fmasterprojectedit.lists.ProjectTemplateID?.lookupOptions.length) {
        options.data = { id: "x_ProjectTemplateID", form: "fmasterprojectedit" };
    } else {
        options.ajax = { id: "x_ProjectTemplateID", form: "fmasterprojectedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumInputLength = ew.selectMinimumInputLength;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.masterproject.fields.ProjectTemplateID.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Priority->Visible) { // Priority ?>
    <div id="r_Priority"<?= $Page->Priority->rowAttributes() ?>>
        <label id="elh_masterproject_Priority" for="x_Priority" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Priority->caption() ?><?= $Page->Priority->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Priority->cellAttributes() ?>>
<span id="el_masterproject_Priority">
    <select
        id="x_Priority"
        name="x_Priority"
        class="form-select ew-select<?= $Page->Priority->isInvalidClass() ?>"
        <?php if (!$Page->Priority->IsNativeSelect) { ?>
        data-select2-id="fmasterprojectedit_x_Priority"
        <?php } ?>
        data-table="masterproject"
        data-field="x_Priority"
        data-page="1"
        data-value-separator="<?= $Page->Priority->displayValueSeparatorAttribute() ?>"
        data-placeholder="<?= HtmlEncode($Page->Priority->getPlaceHolder()) ?>"
        <?= $Page->Priority->editAttributes() ?>>
        <?= $Page->Priority->selectOptionListHtml("x_Priority") ?>
    </select>
    <?= $Page->Priority->getCustomMessage() ?>
    <div class="invalid-feedback"><?= $Page->Priority->getErrorMessage() ?></div>
<?php if (!$Page->Priority->IsNativeSelect) { ?>
<script>
loadjs.ready("fmasterprojectedit", function() {
    var options = { name: "x_Priority", selectId: "fmasterprojectedit_x_Priority" },
        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 (fmasterprojectedit.lists.Priority?.lookupOptions.length) {
        options.data = { id: "x_Priority", form: "fmasterprojectedit" };
    } else {
        options.ajax = { id: "x_Priority", form: "fmasterprojectedit", limit: ew.LOOKUP_PAGE_SIZE };
    }
    options.minimumResultsForSearch = Infinity;
    options = Object.assign({}, ew.selectOptions, options, ew.vars.tables.masterproject.fields.Priority.selectOptions);
    ew.createSelect(options);
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Description->Visible) { // Description ?>
    <div id="r_Description"<?= $Page->Description->rowAttributes() ?>>
        <label id="elh_masterproject_Description" for="x_Description" class="<?= $Page->LeftColumnClass ?>"><?= $Page->Description->caption() ?><?= $Page->Description->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->Description->cellAttributes() ?>>
<span id="el_masterproject_Description">
<textarea data-table="masterproject" data-field="x_Description" data-page="1" name="x_Description" id="x_Description" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->Description->getPlaceHolder()) ?>"<?= $Page->Description->editAttributes() ?> aria-describedby="x_Description_help"><?= $Page->Description->EditValue ?></textarea>
<?= $Page->Description->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->Description->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->Active->Visible) { // Active ?>
    <div id="r_Active"<?= $Page->Active->rowAttributes() ?>>
        <label id="elh_masterproject_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_masterproject_Active">
<div class="form-check d-inline-block">
    <input type="checkbox" class="form-check-input<?= $Page->Active->isInvalidClass() ?>" data-table="masterproject" data-field="x_Active" data-boolean data-page="1" name="x_Active" id="x_Active" value="1"<?= ConvertToBool($Page->Active->CurrentValue) ? " checked" : "" ?><?= $Page->Active->editAttributes() ?> aria-describedby="x_Active_help">
    <div class="invalid-feedback"><?= $Page->Active->getErrorMessage() ?></div>
</div>
<?= $Page->Active->getCustomMessage() ?>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
        </div><!-- /multi-page .tab-pane -->
        <div class="<?= $Page->MultiPages->tabPaneClasses(2) ?>" id="tab_masterproject2" role="tabpanel"><!-- multi-page .tab-pane -->
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->PlanStart->Visible) { // PlanStart ?>
    <div id="r_PlanStart"<?= $Page->PlanStart->rowAttributes() ?>>
        <label id="elh_masterproject_PlanStart" for="x_PlanStart" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PlanStart->caption() ?><?= $Page->PlanStart->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PlanStart->cellAttributes() ?>>
<span id="el_masterproject_PlanStart">
<input type="<?= $Page->PlanStart->getInputTextType() ?>" name="x_PlanStart" id="x_PlanStart" data-table="masterproject" data-field="x_PlanStart" value="<?= $Page->PlanStart->EditValue ?>" data-page="2" placeholder="<?= HtmlEncode($Page->PlanStart->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->PlanStart->formatPattern()) ?>"<?= $Page->PlanStart->editAttributes() ?> aria-describedby="x_PlanStart_help">
<?= $Page->PlanStart->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->PlanStart->getErrorMessage() ?></div>
<?php if (!$Page->PlanStart->ReadOnly && !$Page->PlanStart->Disabled && !isset($Page->PlanStart->EditAttrs["readonly"]) && !isset($Page->PlanStart->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_PlanStart", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { // PlanEnd ?>
    <div id="r_PlanEnd"<?= $Page->PlanEnd->rowAttributes() ?>>
        <label id="elh_masterproject_PlanEnd" for="x_PlanEnd" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PlanEnd->caption() ?><?= $Page->PlanEnd->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PlanEnd->cellAttributes() ?>>
<span id="el_masterproject_PlanEnd">
<input type="<?= $Page->PlanEnd->getInputTextType() ?>" name="x_PlanEnd" id="x_PlanEnd" data-table="masterproject" data-field="x_PlanEnd" value="<?= $Page->PlanEnd->EditValue ?>" data-page="2" placeholder="<?= HtmlEncode($Page->PlanEnd->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->PlanEnd->formatPattern()) ?>"<?= $Page->PlanEnd->editAttributes() ?> aria-describedby="x_PlanEnd_help">
<?= $Page->PlanEnd->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->PlanEnd->getErrorMessage() ?></div>
<?php if (!$Page->PlanEnd->ReadOnly && !$Page->PlanEnd->Disabled && !isset($Page->PlanEnd->EditAttrs["readonly"]) && !isset($Page->PlanEnd->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_PlanEnd", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->StartDate->Visible) { // StartDate ?>
    <div id="r_StartDate"<?= $Page->StartDate->rowAttributes() ?>>
        <label id="elh_masterproject_StartDate" for="x_StartDate" class="<?= $Page->LeftColumnClass ?>"><?= $Page->StartDate->caption() ?><?= $Page->StartDate->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->StartDate->cellAttributes() ?>>
<span id="el_masterproject_StartDate">
<input type="<?= $Page->StartDate->getInputTextType() ?>" name="x_StartDate" id="x_StartDate" data-table="masterproject" data-field="x_StartDate" value="<?= $Page->StartDate->EditValue ?>" data-page="2" placeholder="<?= HtmlEncode($Page->StartDate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->StartDate->formatPattern()) ?>"<?= $Page->StartDate->editAttributes() ?> aria-describedby="x_StartDate_help">
<?= $Page->StartDate->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->StartDate->getErrorMessage() ?></div>
<?php if (!$Page->StartDate->ReadOnly && !$Page->StartDate->Disabled && !isset($Page->StartDate->EditAttrs["readonly"]) && !isset($Page->StartDate->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_StartDate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->EndDate->Visible) { // EndDate ?>
    <div id="r_EndDate"<?= $Page->EndDate->rowAttributes() ?>>
        <label id="elh_masterproject_EndDate" for="x_EndDate" class="<?= $Page->LeftColumnClass ?>"><?= $Page->EndDate->caption() ?><?= $Page->EndDate->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->EndDate->cellAttributes() ?>>
<span id="el_masterproject_EndDate">
<input type="<?= $Page->EndDate->getInputTextType() ?>" name="x_EndDate" id="x_EndDate" data-table="masterproject" data-field="x_EndDate" value="<?= $Page->EndDate->EditValue ?>" data-page="2" placeholder="<?= HtmlEncode($Page->EndDate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->EndDate->formatPattern()) ?>"<?= $Page->EndDate->editAttributes() ?> aria-describedby="x_EndDate_help">
<?= $Page->EndDate->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->EndDate->getErrorMessage() ?></div>
<?php if (!$Page->EndDate->ReadOnly && !$Page->EndDate->Disabled && !isset($Page->EndDate->EditAttrs["readonly"]) && !isset($Page->EndDate->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_EndDate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->WarrantyEnd->Visible) { // WarrantyEnd ?>
    <div id="r_WarrantyEnd"<?= $Page->WarrantyEnd->rowAttributes() ?>>
        <label id="elh_masterproject_WarrantyEnd" for="x_WarrantyEnd" class="<?= $Page->LeftColumnClass ?>"><?= $Page->WarrantyEnd->caption() ?><?= $Page->WarrantyEnd->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->WarrantyEnd->cellAttributes() ?>>
<span id="el_masterproject_WarrantyEnd">
<input type="<?= $Page->WarrantyEnd->getInputTextType() ?>" name="x_WarrantyEnd" id="x_WarrantyEnd" data-table="masterproject" data-field="x_WarrantyEnd" value="<?= $Page->WarrantyEnd->EditValue ?>" data-page="2" placeholder="<?= HtmlEncode($Page->WarrantyEnd->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->WarrantyEnd->formatPattern()) ?>"<?= $Page->WarrantyEnd->editAttributes() ?> aria-describedby="x_WarrantyEnd_help">
<?= $Page->WarrantyEnd->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->WarrantyEnd->getErrorMessage() ?></div>
<?php if (!$Page->WarrantyEnd->ReadOnly && !$Page->WarrantyEnd->Disabled && !isset($Page->WarrantyEnd->EditAttrs["readonly"]) && !isset($Page->WarrantyEnd->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_WarrantyEnd", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
</div><!-- /page* -->
        </div><!-- /multi-page .tab-pane -->
        <div class="<?= $Page->MultiPages->tabPaneClasses(3) ?>" id="tab_masterproject3" role="tabpanel"><!-- multi-page .tab-pane -->
<div class="ew-edit-div"><!-- page* -->
<?php if ($Page->PaymentProgress->Visible) { // PaymentProgress ?>
    <div id="r_PaymentProgress"<?= $Page->PaymentProgress->rowAttributes() ?>>
        <label id="elh_masterproject_PaymentProgress" for="x_PaymentProgress" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PaymentProgress->caption() ?><?= $Page->PaymentProgress->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PaymentProgress->cellAttributes() ?>>
<span id="el_masterproject_PaymentProgress">
<span<?= $Page->PaymentProgress->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->PaymentProgress->getDisplayValue($Page->PaymentProgress->EditValue))) ?>"></span>
<input type="hidden" data-table="masterproject" data-field="x_PaymentProgress" data-hidden="1" data-page="3" name="x_PaymentProgress" id="x_PaymentProgress" value="<?= HtmlEncode($Page->PaymentProgress->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->PaymentDate->Visible) { // PaymentDate ?>
    <div id="r_PaymentDate"<?= $Page->PaymentDate->rowAttributes() ?>>
        <label id="elh_masterproject_PaymentDate" for="x_PaymentDate" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PaymentDate->caption() ?><?= $Page->PaymentDate->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PaymentDate->cellAttributes() ?>>
<span id="el_masterproject_PaymentDate">
<span<?= $Page->PaymentDate->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?= HtmlEncode(RemoveHtml($Page->PaymentDate->getDisplayValue($Page->PaymentDate->EditValue))) ?>"></span>
<input type="hidden" data-table="masterproject" data-field="x_PaymentDate" data-hidden="1" data-page="3" name="x_PaymentDate" id="x_PaymentDate" value="<?= HtmlEncode($Page->PaymentDate->CurrentValue) ?>">
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ProjectValue->Visible) { // ProjectValue ?>
    <div id="r_ProjectValue"<?= $Page->ProjectValue->rowAttributes() ?>>
        <label id="elh_masterproject_ProjectValue" for="x_ProjectValue" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ProjectValue->caption() ?><?= $Page->ProjectValue->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ProjectValue->cellAttributes() ?>>
<span id="el_masterproject_ProjectValue">
<input type="<?= $Page->ProjectValue->getInputTextType() ?>" name="x_ProjectValue" id="x_ProjectValue" data-table="masterproject" data-field="x_ProjectValue" value="<?= $Page->ProjectValue->EditValue ?>" data-page="3" size="30" placeholder="<?= HtmlEncode($Page->ProjectValue->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ProjectValue->formatPattern()) ?>"<?= $Page->ProjectValue->editAttributes() ?> aria-describedby="x_ProjectValue_help">
<?= $Page->ProjectValue->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ProjectValue->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ProjectDebt->Visible) { // ProjectDebt ?>
    <div id="r_ProjectDebt"<?= $Page->ProjectDebt->rowAttributes() ?>>
        <label id="elh_masterproject_ProjectDebt" for="x_ProjectDebt" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ProjectDebt->caption() ?><?= $Page->ProjectDebt->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ProjectDebt->cellAttributes() ?>>
<span id="el_masterproject_ProjectDebt">
<input type="<?= $Page->ProjectDebt->getInputTextType() ?>" name="x_ProjectDebt" id="x_ProjectDebt" data-table="masterproject" data-field="x_ProjectDebt" value="<?= $Page->ProjectDebt->EditValue ?>" data-page="3" size="30" placeholder="<?= HtmlEncode($Page->ProjectDebt->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ProjectDebt->formatPattern()) ?>"<?= $Page->ProjectDebt->editAttributes() ?> aria-describedby="x_ProjectDebt_help">
<?= $Page->ProjectDebt->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ProjectDebt->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->PONumber->Visible) { // PONumber ?>
    <div id="r_PONumber"<?= $Page->PONumber->rowAttributes() ?>>
        <label id="elh_masterproject_PONumber" for="x_PONumber" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PONumber->caption() ?><?= $Page->PONumber->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PONumber->cellAttributes() ?>>
<span id="el_masterproject_PONumber">
<input type="<?= $Page->PONumber->getInputTextType() ?>" name="x_PONumber" id="x_PONumber" data-table="masterproject" data-field="x_PONumber" value="<?= $Page->PONumber->EditValue ?>" data-page="3" size="30" maxlength="100" placeholder="<?= HtmlEncode($Page->PONumber->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->PONumber->formatPattern()) ?>"<?= $Page->PONumber->editAttributes() ?> aria-describedby="x_PONumber_help">
<?= $Page->PONumber->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->PONumber->getErrorMessage() ?></div>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->PaymentLink->Visible) { // PaymentLink ?>
    <div id="r_PaymentLink"<?= $Page->PaymentLink->rowAttributes() ?>>
        <label id="elh_masterproject_PaymentLink" class="<?= $Page->LeftColumnClass ?>"><?= $Page->PaymentLink->caption() ?><?= $Page->PaymentLink->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->PaymentLink->cellAttributes() ?>>
<span id="el_masterproject_PaymentLink">
<?php $Page->PaymentLink->EditAttrs->appendClass("editor"); ?>
<textarea data-table="masterproject" data-field="x_PaymentLink" data-page="3" name="x_PaymentLink" id="x_PaymentLink" cols="35" rows="4" placeholder="<?= HtmlEncode($Page->PaymentLink->getPlaceHolder()) ?>"<?= $Page->PaymentLink->editAttributes() ?> aria-describedby="x_PaymentLink_help"><?= $Page->PaymentLink->EditValue ?></textarea>
<?= $Page->PaymentLink->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->PaymentLink->getErrorMessage() ?></div>
<script>
loadjs.ready(["fmasterprojectedit", "editor"], function() {
    ew.createEditor("fmasterprojectedit", "x_PaymentLink", 0, 0, <?= $Page->PaymentLink->ReadOnly || false ? "true" : "false" ?>);
});
</script>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ClearingDate->Visible) { // ClearingDate ?>
    <div id="r_ClearingDate"<?= $Page->ClearingDate->rowAttributes() ?>>
        <label id="elh_masterproject_ClearingDate" for="x_ClearingDate" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ClearingDate->caption() ?><?= $Page->ClearingDate->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ClearingDate->cellAttributes() ?>>
<span id="el_masterproject_ClearingDate">
<input type="<?= $Page->ClearingDate->getInputTextType() ?>" name="x_ClearingDate" id="x_ClearingDate" data-table="masterproject" data-field="x_ClearingDate" value="<?= $Page->ClearingDate->EditValue ?>" data-page="3" placeholder="<?= HtmlEncode($Page->ClearingDate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ClearingDate->formatPattern()) ?>"<?= $Page->ClearingDate->editAttributes() ?> aria-describedby="x_ClearingDate_help">
<?= $Page->ClearingDate->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ClearingDate->getErrorMessage() ?></div>
<?php if (!$Page->ClearingDate->ReadOnly && !$Page->ClearingDate->Disabled && !isset($Page->ClearingDate->EditAttrs["readonly"]) && !isset($Page->ClearingDate->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fmasterprojectedit", "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("fmasterprojectedit", "x_ClearingDate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</span>
</div></div>
    </div>
<?php } ?>
<?php if ($Page->ClearingAging->Visible) { // ClearingAging ?>
    <div id="r_ClearingAging"<?= $Page->ClearingAging->rowAttributes() ?>>
        <label id="elh_masterproject_ClearingAging" for="x_ClearingAging" class="<?= $Page->LeftColumnClass ?>"><?= $Page->ClearingAging->caption() ?><?= $Page->ClearingAging->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
        <div class="<?= $Page->RightColumnClass ?>"><div<?= $Page->ClearingAging->cellAttributes() ?>>
<span id="el_masterproject_ClearingAging">
<input type="<?= $Page->ClearingAging->getInputTextType() ?>" name="x_ClearingAging" id="x_ClearingAging" data-table="masterproject" data-field="x_ClearingAging" value="<?= $Page->ClearingAging->EditValue ?>" data-page="3" size="30" placeholder="<?= HtmlEncode($Page->ClearingAging->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->ClearingAging->formatPattern()) ?>"<?= $Page->ClearingAging->editAttributes() ?> aria-describedby="x_ClearingAging_help">
<?= $Page->ClearingAging->getCustomMessage() ?>
<div class="invalid-feedback"><?= $Page->ClearingAging->getErrorMessage() ?></div>
</span>
</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_masterproject_Created_Date">
<input type="hidden" data-table="masterproject" data-field="x_Created_Date" data-hidden="1" data-page="4" name="x_Created_Date" id="x_Created_Date" value="<?= HtmlEncode($Page->Created_Date->CurrentValue) ?>">
</span>
<span id="el_masterproject_Created_By">
<input type="hidden" data-table="masterproject" data-field="x_Created_By" data-hidden="1" data-page="4" name="x_Created_By" id="x_Created_By" value="<?= HtmlEncode($Page->Created_By->CurrentValue) ?>">
</span>
<?php if ($Page->getCurrentDetailTable() != "") { ?>
<?php
    $Page->DetailPages->ValidKeys = explode(",", $Page->getCurrentDetailTable());
?>
<div class="ew-detail-pages"><!-- detail-pages -->
<div class="ew-nav<?= $Page->DetailPages->containerClasses() ?>" id="details_Page"><!-- tabs -->
    <ul class="<?= $Page->DetailPages->navClasses() ?>" role="tablist"><!-- .nav -->
<?php
    if (in_array("projectmember", explode(",", $Page->getCurrentDetailTable())) && $projectmember->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectmember") ?><?= $Page->DetailPages->activeClasses("projectmember") ?>" data-bs-target="#tab_projectmember" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectmember" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectmember")) ?>"><?= $Language->tablePhrase("projectmember", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projecttask", explode(",", $Page->getCurrentDetailTable())) && $projecttask->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projecttask") ?><?= $Page->DetailPages->activeClasses("projecttask") ?>" data-bs-target="#tab_projecttask" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projecttask" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projecttask")) ?>"><?= $Language->tablePhrase("projecttask", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projectresult", explode(",", $Page->getCurrentDetailTable())) && $projectresult->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectresult") ?><?= $Page->DetailPages->activeClasses("projectresult") ?>" data-bs-target="#tab_projectresult" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectresult" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectresult")) ?>"><?= $Language->tablePhrase("projectresult", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projectmom", explode(",", $Page->getCurrentDetailTable())) && $projectmom->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectmom") ?><?= $Page->DetailPages->activeClasses("projectmom") ?>" data-bs-target="#tab_projectmom" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectmom" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectmom")) ?>"><?= $Language->tablePhrase("projectmom", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projectdocuments", explode(",", $Page->getCurrentDetailTable())) && $projectdocuments->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectdocuments") ?><?= $Page->DetailPages->activeClasses("projectdocuments") ?>" data-bs-target="#tab_projectdocuments" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectdocuments" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectdocuments")) ?>"><?= $Language->tablePhrase("projectdocuments", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projectpaymentprocess", explode(",", $Page->getCurrentDetailTable())) && $projectpaymentprocess->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectpaymentprocess") ?><?= $Page->DetailPages->activeClasses("projectpaymentprocess") ?>" data-bs-target="#tab_projectpaymentprocess" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectpaymentprocess" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectpaymentprocess")) ?>"><?= $Language->tablePhrase("projectpaymentprocess", "TblCaption") ?></button></li>
<?php
    }
?>
<?php
    if (in_array("projectproblems", explode(",", $Page->getCurrentDetailTable())) && $projectproblems->DetailEdit) {
?>
        <li class="nav-item"><button class="<?= $Page->DetailPages->navLinkClasses("projectproblems") ?><?= $Page->DetailPages->activeClasses("projectproblems") ?>" data-bs-target="#tab_projectproblems" data-bs-toggle="tab" type="button" role="tab" aria-controls="tab_projectproblems" aria-selected="<?= JsonEncode($Page->DetailPages->isActive("projectproblems")) ?>"><?= $Language->tablePhrase("projectproblems", "TblCaption") ?></button></li>
<?php
    }
?>
    </ul><!-- /.nav -->
    <div class="<?= $Page->DetailPages->tabContentClasses() ?>"><!-- .tab-content -->
<?php
    if (in_array("projectmember", explode(",", $Page->getCurrentDetailTable())) && $projectmember->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectmember") ?><?= $Page->DetailPages->activeClasses("projectmember") ?>" id="tab_projectmember" role="tabpanel"><!-- page* -->
<?php include_once "ProjectmemberGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projecttask", explode(",", $Page->getCurrentDetailTable())) && $projecttask->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projecttask") ?><?= $Page->DetailPages->activeClasses("projecttask") ?>" id="tab_projecttask" role="tabpanel"><!-- page* -->
<?php include_once "ProjecttaskGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projectresult", explode(",", $Page->getCurrentDetailTable())) && $projectresult->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectresult") ?><?= $Page->DetailPages->activeClasses("projectresult") ?>" id="tab_projectresult" role="tabpanel"><!-- page* -->
<?php include_once "ProjectresultGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projectmom", explode(",", $Page->getCurrentDetailTable())) && $projectmom->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectmom") ?><?= $Page->DetailPages->activeClasses("projectmom") ?>" id="tab_projectmom" role="tabpanel"><!-- page* -->
<?php include_once "ProjectmomGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projectdocuments", explode(",", $Page->getCurrentDetailTable())) && $projectdocuments->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectdocuments") ?><?= $Page->DetailPages->activeClasses("projectdocuments") ?>" id="tab_projectdocuments" role="tabpanel"><!-- page* -->
<?php include_once "ProjectdocumentsGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projectpaymentprocess", explode(",", $Page->getCurrentDetailTable())) && $projectpaymentprocess->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectpaymentprocess") ?><?= $Page->DetailPages->activeClasses("projectpaymentprocess") ?>" id="tab_projectpaymentprocess" role="tabpanel"><!-- page* -->
<?php include_once "ProjectpaymentprocessGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
<?php
    if (in_array("projectproblems", explode(",", $Page->getCurrentDetailTable())) && $projectproblems->DetailEdit) {
?>
        <div class="<?= $Page->DetailPages->tabPaneClasses("projectproblems") ?><?= $Page->DetailPages->activeClasses("projectproblems") ?>" id="tab_projectproblems" role="tabpanel"><!-- page* -->
<?php include_once "ProjectproblemsGrid.php" ?>
        </div><!-- /page* -->
<?php } ?>
    </div><!-- /.tab-content -->
</div><!-- /tabs -->
</div><!-- /detail-pages -->
<?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="fmasterprojectedit"><?= $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="fmasterprojectedit" 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("masterproject");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
