<?php

namespace ProjectManagement\prjProjectManagement;

// Page object
$PerformanceReportSummary = &$Page;
?>
<?php if (!$Page->isExport() && !$Page->DrillDown && !$DashboardReport) { ?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { PerformanceReport: currentTable } });
var currentPageID = ew.PAGE_ID = "summary";
var currentForm;
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php } ?>
<a id="top"></a>
<!-- Content Container -->
<div id="ew-report" class="ew-report container-fluid">
<?php if ($Page->ShowCurrentFilter) { ?>
<?php $Page->showFilterList() ?>
<?php } ?>
<div class="btn-toolbar ew-toolbar">
<?php
if (!$Page->DrillDownInPanel) {
    $Page->ExportOptions->render("body");
    $Page->SearchOptions->render("body");
    $Page->FilterOptions->render("body");
}
?>
</div>
<?php if (!$Page->isExport() && !$Page->DrillDown && !$DashboardReport) { ?>
<form name="fPerformanceReportsrch" id="fPerformanceReportsrch" class="ew-form ew-ext-search-form" action="<?= CurrentPageUrl(false) ?>" autocomplete="off">
<div id="fPerformanceReportsrch_search_panel" class="mb-2 mb-sm-0 <?= $Page->SearchPanelClass ?>"><!-- .ew-search-panel -->
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { PerformanceReport: currentTable } });
var currentPageID = ew.PAGE_ID = "summary";
var currentForm;
var fPerformanceReportsrch, currentSearchForm, currentAdvancedSearchForm;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery,
        fields = currentTable.fields;

    // Form object for search
    let form = new ew.FormBuilder()
        .setId("fPerformanceReportsrch")
        .setPageId("summary")
<?php if ($Page->UseAjaxActions) { ?>
        .setSubmitWithFetch(true)
<?php } ?>

        // Add fields
        .addFields([
            ["PlanEnd", [ew.Validators.datetime(fields.PlanEnd.clientFormatPattern)], fields.PlanEnd.isInvalid],
            ["y_PlanEnd", [ew.Validators.between], false],
            ["EndDate", [ew.Validators.datetime(fields.EndDate.clientFormatPattern)], fields.EndDate.isInvalid],
            ["y_EndDate", [ew.Validators.between], false]
        ])
        // Validate form
        .setValidate(
            async function () {
                if (!this.validateRequired)
                    return true; // Ignore validation
                let fobj = this.getForm();

                // Validate fields
                if (!this.validateFields())
                    return false;

                // Call Form_CustomValidate event
                if (!(await this.customValidate?.(fobj) ?? true)) {
                    this.focus();
                    return false;
                }
                return true;
            }
        )

        // 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({
            "TaskName": <?= $Page->TaskName->toClientList($Page) ?>,
            "Description": <?= $Page->Description->toClientList($Page) ?>,
            "AssignedTo": <?= $Page->AssignedTo->toClientList($Page) ?>,
            "Progress": <?= $Page->Progress->toClientList($Page) ?>,
            "Target": <?= $Page->Target->toClientList($Page) ?>,
            "Track": <?= $Page->Track->toClientList($Page) ?>,
            "PlanStart": <?= $Page->PlanStart->toClientList($Page) ?>,
            "StartDate": <?= $Page->StartDate->toClientList($Page) ?>,
            "Priority": <?= $Page->Priority->toClientList($Page) ?>,
            "Category": <?= $Page->Category->toClientList($Page) ?>,
            "_ProjectID": <?= $Page->_ProjectID->toClientList($Page) ?>,
            "Created_Date": <?= $Page->Created_Date->toClientList($Page) ?>,
            "Created_By": <?= $Page->Created_By->toClientList($Page) ?>,
            "Last_Updated_Date": <?= $Page->Last_Updated_Date->toClientList($Page) ?>,
            "Last_Updated_By": <?= $Page->Last_Updated_By->toClientList($Page) ?>,
        })

        // Filters
        .setFilterList(<?= $Page->getFilterList() ?>)
        .build();
    window[form.id] = form;
    loadjs.done(form.id);
});
</script>
<input type="hidden" name="cmd" value="search">
<?php if ($Security->canSearch()) { ?>
<?php if (!$Page->isExport() && !($Page->CurrentAction && $Page->CurrentAction != "search") && $Page->hasSearchFields()) { ?>
<div class="ew-extended-search container-fluid ps-2">
<div class="row mb-0<?= ($Page->SearchFieldsPerRow > 0) ? " row-cols-sm-" . $Page->SearchFieldsPerRow : "" ?>">
<?php
// Render search row
$Page->RowType = RowType::SEARCH;
$Page->resetAttributes();
$Page->renderRow();
?>
<?php if ($Page->TaskName->Visible) { // TaskName ?>
<?php
if (!$Page->TaskName->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_TaskName" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->TaskName->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_TaskName"
            name="x_TaskName[]"
            class="form-control ew-select<?= $Page->TaskName->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_TaskName"
            data-table="PerformanceReport"
            data-field="x_TaskName"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->TaskName->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->TaskName->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->TaskName->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->TaskName->editAttributes() ?>>
            <?= $Page->TaskName->selectOptionListHtml("x_TaskName", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->TaskName->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_TaskName",
                selectId: "fPerformanceReportsrch_x_TaskName",
                ajax: { id: "x_TaskName", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.TaskName.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Description->Visible) { // Description ?>
<?php
if (!$Page->Description->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Description" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Description->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Description"
            name="x_Description[]"
            class="form-control ew-select<?= $Page->Description->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Description"
            data-table="PerformanceReport"
            data-field="x_Description"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Description->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Description->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Description->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Description->editAttributes() ?>>
            <?= $Page->Description->selectOptionListHtml("x_Description", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Description->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Description",
                selectId: "fPerformanceReportsrch_x_Description",
                ajax: { id: "x_Description", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Description.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->AssignedTo->Visible) { // AssignedTo ?>
<?php
if (!$Page->AssignedTo->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_AssignedTo" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->AssignedTo->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_AssignedTo"
            name="x_AssignedTo[]"
            class="form-control ew-select<?= $Page->AssignedTo->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_AssignedTo"
            data-table="PerformanceReport"
            data-field="x_AssignedTo"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->AssignedTo->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->AssignedTo->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->AssignedTo->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->AssignedTo->editAttributes() ?>>
            <?= $Page->AssignedTo->selectOptionListHtml("x_AssignedTo", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->AssignedTo->getErrorMessage() ?></div>
        <?= $Page->AssignedTo->Lookup->getParamTag($Page, "p_x_AssignedTo") ?>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_AssignedTo",
                selectId: "fPerformanceReportsrch_x_AssignedTo",
                ajax: { id: "x_AssignedTo", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.AssignedTo.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Progress->Visible) { // Progress ?>
<?php
if (!$Page->Progress->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Progress" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Progress->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Progress"
            name="x_Progress[]"
            class="form-control ew-select<?= $Page->Progress->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Progress"
            data-table="PerformanceReport"
            data-field="x_Progress"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Progress->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Progress->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Progress->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Progress->editAttributes() ?>>
            <?= $Page->Progress->selectOptionListHtml("x_Progress", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Progress->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Progress",
                selectId: "fPerformanceReportsrch_x_Progress",
                ajax: { id: "x_Progress", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Progress.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Target->Visible) { // Target ?>
<?php
if (!$Page->Target->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Target" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Target->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Target"
            name="x_Target[]"
            class="form-control ew-select<?= $Page->Target->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Target"
            data-table="PerformanceReport"
            data-field="x_Target"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Target->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Target->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Target->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Target->editAttributes() ?>>
            <?= $Page->Target->selectOptionListHtml("x_Target", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Target->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Target",
                selectId: "fPerformanceReportsrch_x_Target",
                ajax: { id: "x_Target", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Target.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Track->Visible) { // Track ?>
<?php
if (!$Page->Track->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Track" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Track->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Track"
            name="x_Track[]"
            class="form-control ew-select<?= $Page->Track->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Track"
            data-table="PerformanceReport"
            data-field="x_Track"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Track->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Track->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Track->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Track->editAttributes() ?>>
            <?= $Page->Track->selectOptionListHtml("x_Track", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Track->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Track",
                selectId: "fPerformanceReportsrch_x_Track",
                ajax: { id: "x_Track", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Track.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->PlanStart->Visible) { // PlanStart ?>
<?php
if (!$Page->PlanStart->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_PlanStart" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->PlanStart->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_PlanStart"
            name="x_PlanStart[]"
            class="form-control ew-select<?= $Page->PlanStart->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_PlanStart"
            data-table="PerformanceReport"
            data-field="x_PlanStart"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->PlanStart->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->PlanStart->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->PlanStart->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->PlanStart->editAttributes() ?>>
            <?= $Page->PlanStart->selectOptionListHtml("x_PlanStart", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->PlanStart->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_PlanStart",
                selectId: "fPerformanceReportsrch_x_PlanStart",
                ajax: { id: "x_PlanStart", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.PlanStart.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { // PlanEnd ?>
<?php
if (!$Page->PlanEnd->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_PlanEnd" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->PlanEnd->UseFilter ? " ew-filter-field" : "" ?>">
        <div class="d-flex my-1 my-sm-0">
            <label for="x_PlanEnd" class="ew-search-caption ew-label"><?= $Page->PlanEnd->caption() ?></label>
            <div class="ew-search-operator">
<select name="z_PlanEnd" id="z_PlanEnd" class="form-select ew-operator-select" data-ew-action="search-operator">
<?php foreach ($Page->PlanEnd->SearchOperators as $opr) { ?>
<option value="<?= HtmlEncode($opr) ?>"<?= $Page->PlanEnd->AdvancedSearch->SearchOperator == $opr ? " selected" : "" ?>><?= $Language->phrase($opr == "=" ? "EQUAL" : $opr) ?></option>
<?php } ?>
</select>
</div>
        </div>
        <div id="el_PerformanceReport_PlanEnd" class="ew-search-field">
<input type="<?= $Page->PlanEnd->getInputTextType() ?>" name="x_PlanEnd" id="x_PlanEnd" data-table="PerformanceReport" data-field="x_PlanEnd" value="<?= $Page->PlanEnd->EditValue ?>" placeholder="<?= HtmlEncode($Page->PlanEnd->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->PlanEnd->formatPattern()) ?>"<?= $Page->PlanEnd->editAttributes() ?>>
<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(["fPerformanceReportsrch", "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("fPerformanceReportsrch", "x_PlanEnd", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</div>
        <div class="d-flex my-1 my-sm-0">
            <div class="ew-search-and d-none"><label><?= $Language->phrase("AND") ?></label></div>
        </div><!-- /.ew-search-field -->
        <div id="el2_PerformanceReport_PlanEnd" class="ew-search-field2 d-none">
<input type="<?= $Page->PlanEnd->getInputTextType() ?>" name="y_PlanEnd" id="y_PlanEnd" data-table="PerformanceReport" data-field="x_PlanEnd" value="<?= $Page->PlanEnd->EditValue2 ?>" placeholder="<?= HtmlEncode($Page->PlanEnd->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->PlanEnd->formatPattern()) ?>"<?= $Page->PlanEnd->editAttributes() ?>>
<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(["fPerformanceReportsrch", "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("fPerformanceReportsrch", "y_PlanEnd", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</div>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->StartDate->Visible) { // StartDate ?>
<?php
if (!$Page->StartDate->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_StartDate" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->StartDate->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_StartDate"
            name="x_StartDate[]"
            class="form-control ew-select<?= $Page->StartDate->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_StartDate"
            data-table="PerformanceReport"
            data-field="x_StartDate"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->StartDate->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->StartDate->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->StartDate->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->StartDate->editAttributes() ?>>
            <?= $Page->StartDate->selectOptionListHtml("x_StartDate", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->StartDate->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_StartDate",
                selectId: "fPerformanceReportsrch_x_StartDate",
                ajax: { id: "x_StartDate", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.StartDate.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->EndDate->Visible) { // EndDate ?>
<?php
if (!$Page->EndDate->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_EndDate" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->EndDate->UseFilter ? " ew-filter-field" : "" ?>">
        <div class="d-flex my-1 my-sm-0">
            <label for="x_EndDate" class="ew-search-caption ew-label"><?= $Page->EndDate->caption() ?></label>
            <div class="ew-search-operator">
<select name="z_EndDate" id="z_EndDate" class="form-select ew-operator-select" data-ew-action="search-operator">
<?php foreach ($Page->EndDate->SearchOperators as $opr) { ?>
<option value="<?= HtmlEncode($opr) ?>"<?= $Page->EndDate->AdvancedSearch->SearchOperator == $opr ? " selected" : "" ?>><?= $Language->phrase($opr == "=" ? "EQUAL" : $opr) ?></option>
<?php } ?>
</select>
</div>
        </div>
        <div id="el_PerformanceReport_EndDate" class="ew-search-field">
<input type="<?= $Page->EndDate->getInputTextType() ?>" name="x_EndDate" id="x_EndDate" data-table="PerformanceReport" data-field="x_EndDate" value="<?= $Page->EndDate->EditValue ?>" placeholder="<?= HtmlEncode($Page->EndDate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->EndDate->formatPattern()) ?>"<?= $Page->EndDate->editAttributes() ?>>
<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(["fPerformanceReportsrch", "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("fPerformanceReportsrch", "x_EndDate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</div>
        <div class="d-flex my-1 my-sm-0">
            <div class="ew-search-and d-none"><label><?= $Language->phrase("AND") ?></label></div>
        </div><!-- /.ew-search-field -->
        <div id="el2_PerformanceReport_EndDate" class="ew-search-field2 d-none">
<input type="<?= $Page->EndDate->getInputTextType() ?>" name="y_EndDate" id="y_EndDate" data-table="PerformanceReport" data-field="x_EndDate" value="<?= $Page->EndDate->EditValue2 ?>" placeholder="<?= HtmlEncode($Page->EndDate->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->EndDate->formatPattern()) ?>"<?= $Page->EndDate->editAttributes() ?>>
<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(["fPerformanceReportsrch", "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("fPerformanceReportsrch", "y_EndDate", ew.deepAssign({"useCurrent":false,"display":{"sideBySide":false}}, options));
});
</script>
<?php } ?>
</div>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Priority->Visible) { // Priority ?>
<?php
if (!$Page->Priority->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Priority" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Priority->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Priority"
            name="x_Priority[]"
            class="form-control ew-select<?= $Page->Priority->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Priority"
            data-table="PerformanceReport"
            data-field="x_Priority"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Priority->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Priority->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Priority->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Priority->editAttributes() ?>>
            <?= $Page->Priority->selectOptionListHtml("x_Priority", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Priority->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Priority",
                selectId: "fPerformanceReportsrch_x_Priority",
                ajax: { id: "x_Priority", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Priority.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Category->Visible) { // Category ?>
<?php
if (!$Page->Category->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Category" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Category->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Category"
            name="x_Category[]"
            class="form-control ew-select<?= $Page->Category->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Category"
            data-table="PerformanceReport"
            data-field="x_Category"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Category->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Category->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Category->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Category->editAttributes() ?>>
            <?= $Page->Category->selectOptionListHtml("x_Category", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Category->getErrorMessage() ?></div>
        <?= $Page->Category->Lookup->getParamTag($Page, "p_x_Category") ?>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Category",
                selectId: "fPerformanceReportsrch_x_Category",
                ajax: { id: "x_Category", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Category.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { // ProjectID ?>
<?php
if (!$Page->_ProjectID->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs__ProjectID" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->_ProjectID->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x__ProjectID"
            name="x__ProjectID[]"
            class="form-control ew-select<?= $Page->_ProjectID->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x__ProjectID"
            data-table="PerformanceReport"
            data-field="x__ProjectID"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->_ProjectID->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->_ProjectID->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->_ProjectID->getPlaceHolder()) ?>"
            <?= $Page->_ProjectID->editAttributes() ?>>
            <?= $Page->_ProjectID->selectOptionListHtml("x__ProjectID", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->_ProjectID->getErrorMessage() ?></div>
        <?= $Page->_ProjectID->Lookup->getParamTag($Page, "p_x__ProjectID") ?>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x__ProjectID",
                selectId: "fPerformanceReportsrch_x__ProjectID",
                ajax: { id: "x__ProjectID", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields._ProjectID.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
<?php
if (!$Page->Created_Date->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Created_Date" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Created_Date->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Created_Date"
            name="x_Created_Date[]"
            class="form-control ew-select<?= $Page->Created_Date->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Created_Date"
            data-table="PerformanceReport"
            data-field="x_Created_Date"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Created_Date->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Created_Date->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Created_Date->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Created_Date->editAttributes() ?>>
            <?= $Page->Created_Date->selectOptionListHtml("x_Created_Date", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Created_Date->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Created_Date",
                selectId: "fPerformanceReportsrch_x_Created_Date",
                ajax: { id: "x_Created_Date", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Created_Date.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
<?php
if (!$Page->Created_By->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Created_By" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Created_By->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Created_By"
            name="x_Created_By[]"
            class="form-control ew-select<?= $Page->Created_By->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Created_By"
            data-table="PerformanceReport"
            data-field="x_Created_By"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Created_By->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Created_By->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Created_By->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Created_By->editAttributes() ?>>
            <?= $Page->Created_By->selectOptionListHtml("x_Created_By", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Created_By->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Created_By",
                selectId: "fPerformanceReportsrch_x_Created_By",
                ajax: { id: "x_Created_By", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Created_By.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
<?php
if (!$Page->Last_Updated_Date->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Last_Updated_Date" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Last_Updated_Date->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Last_Updated_Date"
            name="x_Last_Updated_Date[]"
            class="form-control ew-select<?= $Page->Last_Updated_Date->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Last_Updated_Date"
            data-table="PerformanceReport"
            data-field="x_Last_Updated_Date"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Last_Updated_Date->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Last_Updated_Date->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Last_Updated_Date->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Last_Updated_Date->editAttributes() ?>>
            <?= $Page->Last_Updated_Date->selectOptionListHtml("x_Last_Updated_Date", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Last_Updated_Date->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Last_Updated_Date",
                selectId: "fPerformanceReportsrch_x_Last_Updated_Date",
                ajax: { id: "x_Last_Updated_Date", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Last_Updated_Date.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
<?php
if (!$Page->Last_Updated_By->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Last_Updated_By" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Last_Updated_By->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_Last_Updated_By"
            name="x_Last_Updated_By[]"
            class="form-control ew-select<?= $Page->Last_Updated_By->isInvalidClass() ?>"
            data-select2-id="fPerformanceReportsrch_x_Last_Updated_By"
            data-table="PerformanceReport"
            data-field="x_Last_Updated_By"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->Last_Updated_By->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->Last_Updated_By->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->Last_Updated_By->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->Last_Updated_By->editAttributes() ?>>
            <?= $Page->Last_Updated_By->selectOptionListHtml("x_Last_Updated_By", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->Last_Updated_By->getErrorMessage() ?></div>
        <script>
        loadjs.ready("fPerformanceReportsrch", function() {
            var options = {
                name: "x_Last_Updated_By",
                selectId: "fPerformanceReportsrch_x_Last_Updated_By",
                ajax: { id: "x_Last_Updated_By", form: "fPerformanceReportsrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.PerformanceReport.fields.Last_Updated_By.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->SearchColumnCount > 0) { ?>
   <div class="col-sm-auto mb-3">
       <button class="btn btn-primary" name="btn-submit" id="btn-submit" type="submit"><?= $Language->phrase("SearchBtn") ?></button>
   </div>
<?php } ?>
</div><!-- /.row -->
</div><!-- /.ew-extended-search -->
<?php } ?>
<?php } ?>
</div><!-- /.ew-search-panel -->
</form>
<?php } ?>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
<!-- Middle Container -->
<div id="ew-middle" class="<?= $Page->MiddleContentClass ?>">
<?php } ?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
<!-- Content Container -->
<div id="ew-content" class="<?= $Page->ContainerClass ?>">
<?php } ?>
<?php if ($Page->ShowReport) { ?>
<!-- Summary report (begin) -->
<main class="report-summary<?= ($Page->TotalGroups == 0) ? " ew-no-record" : "" ?>">
<?php
while ($Page->GroupCount <= count($Page->GroupRecords) && $Page->GroupCount <= $Page->DisplayGroups) {
?>
<?php
    // Show header
    if ($Page->ShowHeader) {
?>
<?php if ($Page->GroupCount > 1) { ?>
</tbody>
</table>
</div>
<!-- /.ew-grid-middle-panel -->
<!-- Report grid (end) -->
<?php if (!$Page->isExport() && !($Page->DrillDown && $Page->TotalGroups > 0) && $Page->Pager->Visible) { ?>
<!-- Bottom pager -->
<div class="card-footer ew-grid-lower-panel">
<?= $Page->Pager->render() ?>
</div>
<?php } ?>
</div>
<!-- /.ew-grid -->
<?= $Page->PageBreakHtml ?>
<?php } ?>
<div class="<?= $Page->ReportContainerClass ?>">
<!-- Report grid (begin) -->
<div id="gmp_PerformanceReport" class="card-body ew-grid-middle-panel <?= $Page->TableContainerClass ?>">
<table class="<?= $Page->TableClass ?>">
<thead>
	<!-- Table header -->
    <tr class="ew-table-header">
<?php if ($Page->AssignedTo->Visible) { ?>
    <?php if ($Page->AssignedTo->ShowGroupHeaderAsRow) { ?>
    <th data-name="AssignedTo"<?= $Page->AssignedTo->cellAttributes("ew-rpt-grp-caret") ?>><?= $Page->AssignedTo->groupToggleIcon() ?></th>
    <?php } else { ?>
    <th data-name="AssignedTo" class="<?= $Page->AssignedTo->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_AssignedTo"><?= $Page->renderFieldHeader($Page->AssignedTo) ?></div></th>
    <?php } ?>
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { ?>
    <?php if ($Page->_ProjectID->ShowGroupHeaderAsRow) { ?>
    <th data-name="_ProjectID">&nbsp;</th>
    <?php } else { ?>
    <th data-name="_ProjectID" class="<?= $Page->_ProjectID->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport__ProjectID"><?= $Page->renderFieldHeader($Page->_ProjectID) ?></div></th>
    <?php } ?>
<?php } ?>
<?php if ($Page->TaskID->Visible) { ?>
    <th data-name="TaskID" class="<?= $Page->TaskID->headerCellClass() ?>"><div class="PerformanceReport_TaskID"><?= $Page->renderFieldHeader($Page->TaskID) ?></div></th>
<?php } ?>
<?php if ($Page->TaskName->Visible) { ?>
    <th data-name="TaskName" class="<?= $Page->TaskName->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_TaskName"><?= $Page->renderFieldHeader($Page->TaskName) ?></div></th>
<?php } ?>
<?php if ($Page->Progress->Visible) { ?>
    <th data-name="Progress" class="<?= $Page->Progress->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_Progress"><?= $Page->renderFieldHeader($Page->Progress) ?></div></th>
<?php } ?>
<?php if ($Page->Target->Visible) { ?>
    <th data-name="Target" class="<?= $Page->Target->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_Target"><?= $Page->renderFieldHeader($Page->Target) ?></div></th>
<?php } ?>
<?php if ($Page->Track->Visible) { ?>
    <th data-name="Track" class="<?= $Page->Track->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_Track"><?= $Page->renderFieldHeader($Page->Track) ?></div></th>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { ?>
    <th data-name="PlanStart" class="<?= $Page->PlanStart->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_PlanStart"><?= $Page->renderFieldHeader($Page->PlanStart) ?></div></th>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { ?>
    <th data-name="PlanEnd" class="<?= $Page->PlanEnd->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_PlanEnd"><?= $Page->renderFieldHeader($Page->PlanEnd) ?></div></th>
<?php } ?>
<?php if ($Page->StartDate->Visible) { ?>
    <th data-name="StartDate" class="<?= $Page->StartDate->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_StartDate"><?= $Page->renderFieldHeader($Page->StartDate) ?></div></th>
<?php } ?>
<?php if ($Page->EndDate->Visible) { ?>
    <th data-name="EndDate" class="<?= $Page->EndDate->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_EndDate"><?= $Page->renderFieldHeader($Page->EndDate) ?></div></th>
<?php } ?>
<?php if ($Page->Priority->Visible) { ?>
    <th data-name="Priority" class="<?= $Page->Priority->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_Priority"><?= $Page->renderFieldHeader($Page->Priority) ?></div></th>
<?php } ?>
<?php if ($Page->Category->Visible) { ?>
    <th data-name="Category" class="<?= $Page->Category->headerCellClass() ?>" style="white-space: nowrap;"><div class="PerformanceReport_Category"><?= $Page->renderFieldHeader($Page->Category) ?></div></th>
<?php } ?>
<?php if ($Page->Complete->Visible) { ?>
    <th data-name="Complete" class="<?= $Page->Complete->headerCellClass() ?>"><div class="PerformanceReport_Complete"><?= $Page->renderFieldHeader($Page->Complete) ?></div></th>
<?php } ?>
    </tr>
</thead>
<tbody>
<?php
        if ($Page->TotalGroups == 0) {
            break; // Show header only
        }
        $Page->ShowHeader = false;
    } // End show header
?>
<?php

    // Build detail SQL
    $where = DetailFilterSql($Page->AssignedTo, $Page->getSqlFirstGroupField(), $Page->AssignedTo->groupValue(), $Page->Dbid);
    AddFilter($Page->PageFirstGroupFilter, $where, "OR");
    AddFilter($where, $Page->Filter);
    $sql = $Page->buildReportSql($Page->getSqlSelect(), $Page->getSqlFrom(), $Page->getSqlWhere(), $Page->getSqlGroupBy(), $Page->getSqlHaving(), $Page->getSqlOrderBy(), $where, $Page->Sort);
    $rs = $sql->executeQuery();
    $Page->DetailRecords = $rs?->fetchAll() ?? [];
    $Page->DetailRecordCount = count($Page->DetailRecords);

    // Load detail records
    $Page->AssignedTo->Records = &$Page->DetailRecords;
    $Page->AssignedTo->LevelBreak = true; // Set field level break
        $Page->GroupCounter[1] = $Page->GroupCount;
        $Page->AssignedTo->getCnt($Page->AssignedTo->Records); // Get record count
?>
<?php if ($Page->AssignedTo->Visible && $Page->AssignedTo->ShowGroupHeaderAsRow) { ?>
<?php
        // Render header row
        $Page->resetAttributes();
        $Page->RowType = RowType::TOTAL;
        $Page->RowTotalType = RowSummary::GROUP;
        $Page->RowTotalSubType = RowTotal::HEADER;
        $Page->RowGroupLevel = 1;
        $Page->renderRow();
?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->AssignedTo->Visible) { ?>
        <td data-field="AssignedTo"<?= $Page->AssignedTo->cellAttributes("ew-rpt-grp-caret") ?>><?= $Page->AssignedTo->groupToggleIcon() ?></td>
<?php } ?>
        <td data-field="AssignedTo" colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount - 1) ?>"<?= $Page->AssignedTo->cellAttributes() ?>>
            <span class="ew-summary-caption PerformanceReport_AssignedTo"><?= $Page->renderFieldHeader($Page->AssignedTo) ?></span><?= $Language->phrase("SummaryColon") ?><span<?= $Page->AssignedTo->viewAttributes() ?>><?= $Page->AssignedTo->GroupViewValue ?></span>
            <span class="ew-summary-count">(<span class="ew-aggregate-caption"><?= $Language->phrase("RptCnt") ?></span><span class="ew-aggregate-equal"><?= $Language->phrase("AggregateEqual") ?></span><span class="ew-aggregate-value"><?= FormatNumber($Page->AssignedTo->Count, Config("DEFAULT_NUMBER_FORMAT")) ?></span>)</span>
        </td>
    </tr>
<?php } ?>
<?php
    $Page->_ProjectID->getDistinctValues($Page->AssignedTo->Records, $Page->_ProjectID->getSort());
    $Page->setGroupCount(count($Page->_ProjectID->DistinctValues), $Page->GroupCounter[1]);
    $Page->GroupCounter[2] = 0; // Init group count index
    foreach ($Page->_ProjectID->DistinctValues as $_ProjectID) { // Load records for this distinct value
        $Page->_ProjectID->setGroupValue($_ProjectID); // Set group value
        $Page->_ProjectID->getDistinctRecords($Page->AssignedTo->Records, $Page->_ProjectID->groupValue());
        $Page->_ProjectID->LevelBreak = true; // Set field level break
        $Page->GroupCounter[2]++;
        $Page->_ProjectID->getCnt($Page->_ProjectID->Records); // Get record count
        $Page->setGroupCount($Page->_ProjectID->Count, $Page->GroupCounter[1], $Page->GroupCounter[2]);
?>
<?php if ($Page->_ProjectID->Visible && $Page->_ProjectID->ShowGroupHeaderAsRow) { ?>
<?php
        // Render header row
        $Page->_ProjectID->setDbValue($_ProjectID); // Set current value for ProjectID
        $Page->resetAttributes();
        $Page->RowType = RowType::TOTAL;
        $Page->RowTotalType = RowSummary::GROUP;
        $Page->RowTotalSubType = RowTotal::HEADER;
        $Page->RowGroupLevel = 2;
        $Page->renderRow();
?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->AssignedTo->Visible) { ?>
        <td data-field="AssignedTo"<?= $Page->AssignedTo->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { ?>
        <td data-field="_ProjectID"<?= $Page->_ProjectID->cellAttributes("ew-rpt-grp-caret") ?>><?= $Page->_ProjectID->groupToggleIcon() ?></td>
<?php } ?>
        <td data-field="_ProjectID" colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount - 2) ?>"<?= $Page->_ProjectID->cellAttributes() ?>>
            <span class="ew-summary-caption PerformanceReport__ProjectID"><?= $Page->renderFieldHeader($Page->_ProjectID) ?></span><?= $Language->phrase("SummaryColon") ?><span<?= $Page->_ProjectID->viewAttributes() ?>><?= $Page->_ProjectID->GroupViewValue ?></span>
            <span class="ew-summary-count">(<span class="ew-aggregate-caption"><?= $Language->phrase("RptCnt") ?></span><span class="ew-aggregate-equal"><?= $Language->phrase("AggregateEqual") ?></span><span class="ew-aggregate-value"><?= FormatNumber($Page->_ProjectID->Count, Config("DEFAULT_NUMBER_FORMAT")) ?></span>)</span>
        </td>
    </tr>
<?php } ?>
<?php
        $Page->RecordCount = 0; // Reset record count
        foreach ($Page->_ProjectID->Records as $record) {
            $Page->RecordCount++;
            $Page->RecordIndex++;
            $Page->loadRowValues($record);
?>
<?php
        // Render detail row
        $Page->resetAttributes();
        $Page->RowType = RowType::DETAIL;
        $Page->renderRow();
?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->AssignedTo->Visible) { ?>
    <?php if ($Page->AssignedTo->ShowGroupHeaderAsRow) { ?>
        <td data-field="AssignedTo"<?= $Page->AssignedTo->cellAttributes() ?>></td>
    <?php } else { ?>
        <td data-field="AssignedTo"<?= $Page->AssignedTo->cellAttributes() ?>><span<?= $Page->AssignedTo->viewAttributes() ?>><?= $Page->AssignedTo->GroupViewValue ?></span></td>
    <?php } ?>
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { ?>
    <?php if ($Page->_ProjectID->ShowGroupHeaderAsRow) { ?>
        <td data-field="_ProjectID"<?= $Page->_ProjectID->cellAttributes() ?>></td>
    <?php } else { ?>
        <td data-field="_ProjectID"<?= $Page->_ProjectID->cellAttributes() ?>><span<?= $Page->_ProjectID->viewAttributes() ?>><?= $Page->_ProjectID->GroupViewValue ?></span></td>
    <?php } ?>
<?php } ?>
<?php if ($Page->TaskID->Visible) { ?>
        <td data-field="TaskID"<?= $Page->TaskID->cellAttributes() ?>>
<span<?= $Page->TaskID->viewAttributes() ?>>
<?= $Page->TaskID->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->TaskName->Visible) { ?>
        <td data-field="TaskName"<?= $Page->TaskName->cellAttributes() ?>>
<span<?= $Page->TaskName->viewAttributes() ?>>
<?= $Page->TaskName->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Progress->Visible) { ?>
        <td data-field="Progress"<?= $Page->Progress->cellAttributes() ?>>
<span<?= $Page->Progress->viewAttributes() ?>>
<?= $Page->Progress->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Target->Visible) { ?>
        <td data-field="Target"<?= $Page->Target->cellAttributes() ?>>
<span<?= $Page->Target->viewAttributes() ?>>
<?= $Page->Target->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Track->Visible) { ?>
        <td data-field="Track"<?= $Page->Track->cellAttributes() ?>>
<span<?= $Page->Track->viewAttributes() ?>>
<?= $Page->Track->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { ?>
        <td data-field="PlanStart"<?= $Page->PlanStart->cellAttributes() ?>>
<span<?= $Page->PlanStart->viewAttributes() ?>>
<?= $Page->PlanStart->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { ?>
        <td data-field="PlanEnd"<?= $Page->PlanEnd->cellAttributes() ?>>
<span<?= $Page->PlanEnd->viewAttributes() ?>>
<?= $Page->PlanEnd->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->StartDate->Visible) { ?>
        <td data-field="StartDate"<?= $Page->StartDate->cellAttributes() ?>>
<span<?= $Page->StartDate->viewAttributes() ?>>
<?= $Page->StartDate->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->EndDate->Visible) { ?>
        <td data-field="EndDate"<?= $Page->EndDate->cellAttributes() ?>>
<span<?= $Page->EndDate->viewAttributes() ?>>
<?= $Page->EndDate->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Priority->Visible) { ?>
        <td data-field="Priority"<?= $Page->Priority->cellAttributes() ?>>
<span<?= $Page->Priority->viewAttributes() ?>>
<?= $Page->Priority->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Category->Visible) { ?>
        <td data-field="Category"<?= $Page->Category->cellAttributes() ?>>
<span<?= $Page->Category->viewAttributes() ?>>
<?= $Page->Category->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Complete->Visible) { ?>
        <td data-field="Complete"<?= $Page->Complete->cellAttributes() ?>>
<span<?= $Page->Complete->viewAttributes() ?>>
<?= $Page->Complete->getViewValue() ?></span>
</td>
<?php } ?>
    </tr>
<?php
    }
    } // End group level 1
?>
<?php

    // Next group
    $Page->loadGroupRowValues();

    // Show header if page break
    if ($Page->isExport()) {
        $Page->ShowHeader = ($Page->ExportPageBreakCount == 0) ? false : ($Page->GroupCount % $Page->ExportPageBreakCount == 0);
    }

    // Page_Breaking server event
    if ($Page->ShowHeader) {
        $Page->pageBreaking($Page->ShowHeader, $Page->PageBreakHtml);
    }
    $Page->GroupCount++;
} // End while
?>
<?php if ($Page->TotalGroups > 0) { ?>
</tbody>
<tfoot>
<?php
    $Page->resetAttributes();
    $Page->RowType = RowType::TOTAL;
    $Page->RowTotalType = RowSummary::GRAND;
    $Page->RowTotalSubType = RowTotal::FOOTER;
    $Page->RowAttrs["class"] = "ew-rpt-grand-summary";
    $Page->renderRow();
?>
<?php if ($Page->AssignedTo->ShowCompactSummaryFooter) { ?>
    <tr<?= $Page->rowAttributes() ?>><td colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount) ?>"><?= $Language->phrase("RptGrandSummary") ?> <span class="ew-summary-count">(<span class="ew-aggregate-caption"><?= $Language->phrase("RptCnt") ?></span><span class="ew-aggregate-equal"><?= $Language->phrase("AggregateEqual") ?></span><span class="ew-aggregate-value"><?= FormatNumber($Page->TotalCount, Config("DEFAULT_NUMBER_FORMAT")) ?></span>)</span></td></tr>
    <tr<?= $Page->rowAttributes() ?>>
<?php if ($Page->GroupColumnCount > 0) { ?>
        <td colspan="<?= $Page->GroupColumnCount ?>" class="ew-rpt-grp-aggregate"></td>
<?php } ?>
<?php if ($Page->TaskID->Visible) { ?>
        <td data-field="TaskID"<?= $Page->TaskID->cellAttributes() ?>><span class="ew-aggregate-caption"><?= $Language->phrase("RptCnt") ?></span><span class="ew-aggregate-equal"><?= $Language->phrase("AggregateEqual") ?></span><span class="ew-aggregate-value"><span<?= $Page->TaskID->viewAttributes() ?>><?= $Page->TaskID->CntViewValue ?></span></span></td>
<?php } ?>
<?php if ($Page->TaskName->Visible) { ?>
        <td data-field="TaskName"<?= $Page->TaskName->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Progress->Visible) { ?>
        <td data-field="Progress"<?= $Page->Progress->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Target->Visible) { ?>
        <td data-field="Target"<?= $Page->Target->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Track->Visible) { ?>
        <td data-field="Track"<?= $Page->Track->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { ?>
        <td data-field="PlanStart"<?= $Page->PlanStart->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { ?>
        <td data-field="PlanEnd"<?= $Page->PlanEnd->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->StartDate->Visible) { ?>
        <td data-field="StartDate"<?= $Page->StartDate->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->EndDate->Visible) { ?>
        <td data-field="EndDate"<?= $Page->EndDate->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Priority->Visible) { ?>
        <td data-field="Priority"<?= $Page->Priority->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Category->Visible) { ?>
        <td data-field="Category"<?= $Page->Category->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Complete->Visible) { ?>
        <td data-field="Complete"<?= $Page->Complete->cellAttributes() ?>></td>
<?php } ?>
    </tr>
<?php } else { ?>
    <tr<?= $Page->rowAttributes() ?>><td colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount) ?>"><?= $Language->phrase("RptGrandSummary") ?> <span class="ew-summary-count">(<?= FormatNumber($Page->TotalCount, Config("DEFAULT_NUMBER_FORMAT")) ?><?= $Language->phrase("RptDtlRec") ?>)</span></td></tr>
    <tr<?= $Page->rowAttributes() ?>>
<?php if ($Page->GroupColumnCount > 0) { ?>
        <td colspan="<?= $Page->GroupColumnCount ?>" class="ew-rpt-grp-aggregate"><?= $Language->phrase("RptCnt") ?></td>
<?php } ?>
<?php if ($Page->TaskID->Visible) { ?>
        <td data-field="TaskID"<?= $Page->TaskID->cellAttributes() ?>>
<span<?= $Page->TaskID->viewAttributes() ?>>
<?= $Page->TaskID->CntViewValue ?></span>
</td>
<?php } ?>
<?php if ($Page->TaskName->Visible) { ?>
        <td data-field="TaskName"<?= $Page->TaskName->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Progress->Visible) { ?>
        <td data-field="Progress"<?= $Page->Progress->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Target->Visible) { ?>
        <td data-field="Target"<?= $Page->Target->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Track->Visible) { ?>
        <td data-field="Track"<?= $Page->Track->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { ?>
        <td data-field="PlanStart"<?= $Page->PlanStart->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { ?>
        <td data-field="PlanEnd"<?= $Page->PlanEnd->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->StartDate->Visible) { ?>
        <td data-field="StartDate"<?= $Page->StartDate->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->EndDate->Visible) { ?>
        <td data-field="EndDate"<?= $Page->EndDate->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Priority->Visible) { ?>
        <td data-field="Priority"<?= $Page->Priority->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Category->Visible) { ?>
        <td data-field="Category"<?= $Page->Category->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Complete->Visible) { ?>
        <td data-field="Complete"<?= $Page->Complete->cellAttributes() ?>></td>
<?php } ?>
    </tr>
<?php } ?>
</tfoot>
</table>
</div>
<!-- /.ew-grid-middle-panel -->
<!-- Report grid (end) -->
<?php if (!$Page->isExport() && !($Page->DrillDown && $Page->TotalGroups > 0) && $Page->Pager->Visible) { ?>
<!-- Bottom pager -->
<div class="card-footer ew-grid-lower-panel">
<?= $Page->Pager->render() ?>
</div>
<?php } ?>
</div>
<!-- /.ew-grid -->
<?php } ?>
</main>
<!-- /.report-summary -->
<!-- Summary report (end) -->
<?php } ?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
</div>
<!-- /#ew-content -->
<?php } ?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
</div>
<!-- /#ew-middle -->
<?php } ?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
<!-- Bottom Container -->
<div id="ew-bottom" class="<?= $Page->BottomContentClass ?>">
<?php } ?>
<?php
if (!$DashboardReport) {
    // Set up chart drilldown
    $Page->PerformanceReport->DrillDownInPanel = $Page->DrillDownInPanel;
    echo $Page->PerformanceReport->render("ew-chart-bottom");
}
?>
<?php
if (!$DashboardReport) {
    // Set up chart drilldown
    $Page->TotalTask->DrillDownInPanel = $Page->DrillDownInPanel;
    echo $Page->TotalTask->render("ew-chart-bottom");
}
?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
</div>
<!-- /#ew-bottom -->
<?php } ?>
<?php if (!$DashboardReport && !$Page->isExport() && !$Page->DrillDown) { ?>
<div class="mb-3"><a class="ew-top-link" data-ew-action="scroll-top"><?= $Language->phrase("Top") ?></a></div>
<?php } ?>
</div>
<!-- /.ew-report -->
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<?php if (!$Page->isExport() && !$Page->DrillDown && !$DashboardReport) { ?>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php } ?>
