<?php

namespace ProjectManagement\prjProjectManagement;

// Page object
$ProjectdocumentsList = &$Page;
?>
<?php if (!$Page->isExport()) { ?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { projectdocuments: currentTable } });
var currentPageID = ew.PAGE_ID = "list";
var currentForm;
var <?= $Page->FormName ?>;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("<?= $Page->FormName ?>")
        .setPageId("list")
        .setSubmitWithFetch(<?= $Page->UseAjaxActions ? "true" : "false" ?>)
        .setFormKeyCountName("<?= $Page->FormKeyCountName ?>")

        // Dynamic selection lists
        .setLists({
            "DocDate": <?= $Page->DocDate->toClientList($Page) ?>,
            "DocumentTitle": <?= $Page->DocumentTitle->toClientList($Page) ?>,
            "DocumentFile": <?= $Page->DocumentFile->toClientList($Page) ?>,
            "DocumentType": <?= $Page->DocumentType->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) ?>,
        })
        .build();
    window[form.id] = form;
    currentForm = form;
    loadjs.done(form.id);
});
</script>
<script>
ew.PREVIEW_SELECTOR ??= ".ew-preview-btn";
ew.PREVIEW_TYPE ??= "row";
ew.PREVIEW_NAV_STYLE ??= "tabs"; // tabs/pills/underline
ew.PREVIEW_MODAL_CLASS ??= "modal modal-fullscreen-sm-down";
ew.PREVIEW_ROW ??= true;
ew.PREVIEW_SINGLE_ROW ??= false;
ew.PREVIEW || ew.ready("head", ew.PATH_BASE + "js/preview.min.js?v=24.6.2", "preview");
</script>
<script>
window.Tabulator || loadjs([
    ew.PATH_BASE + "js/tabulator.min.js?v=24.6.4",
    ew.PATH_BASE + "css/<?= CssFile("tabulator_bootstrap5.css", false) ?>?v=24.6.4"
], "import");
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php } ?>
<?php if (!$Page->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($Page->TotalRecords > 0 && $Page->ExportOptions->visible()) { ?>
<?php $Page->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($Page->ImportOptions->visible()) { ?>
<?php $Page->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($Page->SearchOptions->visible()) { ?>
<?php $Page->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($Page->FilterOptions->visible()) { ?>
<?php $Page->FilterOptions->render("body") ?>
<?php } ?>
</div>
<?php } ?>
<?php if (!$Page->isExport() || Config("EXPORT_MASTER_RECORD") && $Page->isExport("print")) { ?>
<?php
if ($Page->DbMasterFilter != "" && $Page->getCurrentMasterTable() == "masterproject") {
    if ($Page->MasterRecordExists) {
        include_once "views/MasterprojectMaster.php";
    }
}
?>
<?php } ?>
<?php if ($Page->ShowCurrentFilter) { ?>
<?php $Page->showFilterList() ?>
<?php } ?>
<?php if (!$Page->IsModal) { ?>
<form name="fprojectdocumentssrch" id="fprojectdocumentssrch" class="ew-form ew-ext-search-form" action="<?= CurrentPageUrl(false) ?>" autocomplete="off">
<div id="fprojectdocumentssrch_search_panel" class="mb-2 mb-sm-0 <?= $Page->SearchPanelClass ?>"><!-- .ew-search-panel -->
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { projectdocuments: currentTable } });
var currentForm;
var fprojectdocumentssrch, currentSearchForm, currentAdvancedSearchForm;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery,
        fields = currentTable.fields;

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

        // Add fields
        .addFields([
        ])
        // 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({
            "DocDate": <?= $Page->DocDate->toClientList($Page) ?>,
            "DocumentTitle": <?= $Page->DocumentTitle->toClientList($Page) ?>,
            "DocumentFile": <?= $Page->DocumentFile->toClientList($Page) ?>,
            "DocumentType": <?= $Page->DocumentType->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;
    currentSearchForm = 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->DocDate->Visible) { // DocDate ?>
<?php
if (!$Page->DocDate->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_DocDate" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->DocDate->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_DocDate"
            name="x_DocDate[]"
            class="form-control ew-select<?= $Page->DocDate->isInvalidClass() ?>"
            data-select2-id="fprojectdocumentssrch_x_DocDate"
            data-table="projectdocuments"
            data-field="x_DocDate"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->DocDate->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->DocDate->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->DocDate->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->DocDate->editAttributes() ?>>
            <?= $Page->DocDate->selectOptionListHtml("x_DocDate", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->DocDate->getErrorMessage(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_DocDate",
                selectId: "fprojectdocumentssrch_x_DocDate",
                ajax: { id: "x_DocDate", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.fields.DocDate.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->DocumentTitle->Visible) { // DocumentTitle ?>
<?php
if (!$Page->DocumentTitle->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_DocumentTitle" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->DocumentTitle->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_DocumentTitle"
            name="x_DocumentTitle[]"
            class="form-control ew-select<?= $Page->DocumentTitle->isInvalidClass() ?>"
            data-select2-id="fprojectdocumentssrch_x_DocumentTitle"
            data-table="projectdocuments"
            data-field="x_DocumentTitle"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->DocumentTitle->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->DocumentTitle->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->DocumentTitle->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->DocumentTitle->editAttributes() ?>>
            <?= $Page->DocumentTitle->selectOptionListHtml("x_DocumentTitle", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->DocumentTitle->getErrorMessage(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_DocumentTitle",
                selectId: "fprojectdocumentssrch_x_DocumentTitle",
                ajax: { id: "x_DocumentTitle", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.fields.DocumentTitle.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->DocumentFile->Visible) { // DocumentFile ?>
<?php
if (!$Page->DocumentFile->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_DocumentFile" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->DocumentFile->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_DocumentFile"
            name="x_DocumentFile[]"
            class="form-control ew-select<?= $Page->DocumentFile->isInvalidClass() ?>"
            data-select2-id="fprojectdocumentssrch_x_DocumentFile"
            data-table="projectdocuments"
            data-field="x_DocumentFile"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->DocumentFile->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->DocumentFile->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->DocumentFile->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->DocumentFile->editAttributes() ?>>
            <?= $Page->DocumentFile->selectOptionListHtml("x_DocumentFile", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->DocumentFile->getErrorMessage(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_DocumentFile",
                selectId: "fprojectdocumentssrch_x_DocumentFile",
                ajax: { id: "x_DocumentFile", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.fields.DocumentFile.filterOptions);
            ew.createFilter(options);
        });
        </script>
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->DocumentType->Visible) { // DocumentType ?>
<?php
if (!$Page->DocumentType->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_DocumentType" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->DocumentType->UseFilter ? " ew-filter-field" : "" ?>">
        <select
            id="x_DocumentType"
            name="x_DocumentType[]"
            class="form-control ew-select<?= $Page->DocumentType->isInvalidClass() ?>"
            data-select2-id="fprojectdocumentssrch_x_DocumentType"
            data-table="projectdocuments"
            data-field="x_DocumentType"
            data-caption="<?= HtmlEncode(RemoveHtml($Page->DocumentType->caption())) ?>"
            data-filter="true"
            multiple
            size="1"
            data-value-separator="<?= $Page->DocumentType->displayValueSeparatorAttribute() ?>"
            data-placeholder="<?= HtmlEncode($Page->DocumentType->getPlaceHolder()) ?>"
            data-ew-action="update-options"
            <?= $Page->DocumentType->editAttributes() ?>>
            <?= $Page->DocumentType->selectOptionListHtml("x_DocumentType", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->DocumentType->getErrorMessage(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_DocumentType",
                selectId: "fprojectdocumentssrch_x_DocumentType",
                ajax: { id: "x_DocumentType", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.fields.DocumentType.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="fprojectdocumentssrch_x__ProjectID"
            data-table="projectdocuments"
            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()) ?>"
            data-ew-action="update-options"
            <?= $Page->_ProjectID->editAttributes() ?>>
            <?= $Page->_ProjectID->selectOptionListHtml("x__ProjectID", true) ?>
        </select>
        <div class="invalid-feedback"><?= $Page->_ProjectID->getErrorMessage(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x__ProjectID",
                selectId: "fprojectdocumentssrch_x__ProjectID",
                ajax: { id: "x__ProjectID", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.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="fprojectdocumentssrch_x_Created_Date"
            data-table="projectdocuments"
            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(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_Created_Date",
                selectId: "fprojectdocumentssrch_x_Created_Date",
                ajax: { id: "x_Created_Date", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.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="fprojectdocumentssrch_x_Created_By"
            data-table="projectdocuments"
            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(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_Created_By",
                selectId: "fprojectdocumentssrch_x_Created_By",
                ajax: { id: "x_Created_By", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.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="fprojectdocumentssrch_x_Last_Updated_Date"
            data-table="projectdocuments"
            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(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_Last_Updated_Date",
                selectId: "fprojectdocumentssrch_x_Last_Updated_Date",
                ajax: { id: "x_Last_Updated_Date", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.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="fprojectdocumentssrch_x_Last_Updated_By"
            data-table="projectdocuments"
            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(false) ?></div>
        <script>
        loadjs.ready("fprojectdocumentssrch", function() {
            var options = {
                name: "x_Last_Updated_By",
                selectId: "fprojectdocumentssrch_x_Last_Updated_By",
                ajax: { id: "x_Last_Updated_By", form: "fprojectdocumentssrch", limit: ew.FILTER_PAGE_SIZE, data: { ajax: "filter" } }
            };
            options = Object.assign({}, ew.filterOptions, options, ew.vars.tables.projectdocuments.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 -->
<!-- template for quick search in navbar -->
<script id="navbar-basic-search" type="text/html" class="ew-js-template" data-name="search" data-seq="10" data-data="menu" data-target="#ew-navbar-end" data-method="prependTo">
    <li class="nav-item navbar-basic-search">
        <a class="nav-link" data-widget="navbar-search" href="#" role="button">
            <i class="fa-solid fa-magnifying-glass"></i>
        </a>
        <div class="navbar-search-block">
            <div class="ew-basic-search input-group input-group-sm">
                <input type="text" name="<?= Config("TABLE_BASIC_SEARCH") ?>" id="<?= Config("TABLE_BASIC_SEARCH") ?>" class="form-control form-control-navbar ew-basic-search-keyword" form="fprojectdocumentssrch" value="<?= HtmlEncode($Page->BasicSearch->getKeyword()) ?>" placeholder="<?= HtmlEncode($Language->phrase("Search")) ?>" aria-label="<?= HtmlEncode($Language->phrase("Search")) ?>">
                <input type="hidden" name="<?= Config("TABLE_BASIC_SEARCH_TYPE") ?>" id="<?= Config("TABLE_BASIC_SEARCH_TYPE") ?>" class="form-control-navbar ew-basic-search-type" form="fprojectdocumentssrch" value="<?= HtmlEncode($Page->BasicSearch->getType()) ?>">
                <button class="btn btn-navbar" form="fprojectdocumentssrch" type="submit">
                    <i class="fa-solid fa-magnifying-glass"></i>
                </button>
                <button type="button" data-bs-toggle="dropdown" class="btn btn-navbar dropdown-toggle" aria-haspopup="true" aria-expanded="false">
                    <span id="searchtype"><?= $Page->BasicSearch->getTypeNameShort() ?></span>
                </button>
                <div class="dropdown-menu dropdown-menu-end">
                    <button type="button" class="dropdown-item<?= $Page->BasicSearch->getType() == "" ? " active" : "" ?>" form="fprojectdocumentssrch" data-ew-action="search-type"><?= $Language->phrase("QuickSearchAuto") ?></button>
                    <button type="button" class="dropdown-item<?= $Page->BasicSearch->getType() == "=" ? " active" : "" ?>" form="fprojectdocumentssrch" data-ew-action="search-type" data-search-type="="><?= $Language->phrase("QuickSearchExact") ?></button>
                    <button type="button" class="dropdown-item<?= $Page->BasicSearch->getType() == "AND" ? " active" : "" ?>" form="fprojectdocumentssrch" data-ew-action="search-type" data-search-type="AND"><?= $Language->phrase("QuickSearchAll") ?></button>
                    <button type="button" class="dropdown-item<?= $Page->BasicSearch->getType() == "OR" ? " active" : "" ?>" form="fprojectdocumentssrch" data-ew-action="search-type" data-search-type="OR"><?= $Language->phrase("QuickSearchAny") ?></button>
                </div>
                <button class="btn btn-navbar" type="button" data-widget="navbar-search">
                    <i class="fa-solid fa-xmark"></i>
                </button>
            </div>
        </div>
    </li>
</script>
</div><!-- /.ew-extended-search -->
<?php } ?>
<?php } ?>
</div><!-- /.ew-search-panel -->
</form>
<?php } ?>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<main class="list<?= ($Page->TotalRecords == 0 && !$Page->isAdd()) ? " ew-no-record" : "" ?>">
<div id="ew-header-options">
<?php $Page->HeaderOptions?->render("body") ?>
</div>
<div id="ew-list">
<?php if ($Page->TotalRecords > 0 || $Page->CurrentAction) { ?>
<div class="card ew-card ew-grid<?= $Page->isAddOrEdit() ? " ew-grid-add-edit" : "" ?> <?= $Page->TableGridClass ?>">
<form name="<?= $Page->FormName ?>" id="<?= $Page->FormName ?>" class="ew-form ew-list-form" action="<?= $Page->PageAction ?>" method="post" autocomplete="off">
<?php if (Config("CHECK_TOKEN")) { ?>
<input type="hidden" name="<?= $TokenNameKey ?>" value="<?= $TokenName ?>"><!-- CSRF token name -->
<input type="hidden" name="<?= $TokenValueKey ?>" value="<?= $TokenValue ?>"><!-- CSRF token value -->
<?php } ?>
<input type="hidden" name="t" value="projectdocuments">
<?php if ($Page->IsModal) { ?>
<input type="hidden" name="modal" value="1">
<?php } ?>
<?php if ($Page->getCurrentMasterTable() == "masterproject" && $Page->CurrentAction) { ?>
<input type="hidden" name="<?= Config("TABLE_SHOW_MASTER") ?>" value="masterproject">
<input type="hidden" name="fk__ProjectID" value="<?= HtmlEncode($Page->_ProjectID->getSessionValue()) ?>">
<?php } ?>
<div id="gmp_projectdocuments" class="card-body ew-grid-middle-panel <?= $Page->TableContainerClass ?>" style="<?= $Page->TableContainerStyle ?>">
<?php if ($Page->TotalRecords > 0 || $Page->isGridEdit() || $Page->isMultiEdit()) { ?>
<table id="tbl_projectdocumentslist" class="<?= $Page->TableClass ?>"><!-- .ew-table -->
<thead>
    <tr class="ew-table-header">
<?php
// Header row
$Page->RowType = RowType::HEADER;

// Render list options
$Page->renderListOptions();

// Render list options (header, left)
$Page->ListOptions->render("header", "left");
?>
<?php if ($Page->DocDate->Visible) { // DocDate ?>
        <th data-name="DocDate" class="<?= $Page->DocDate->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_DocDate" class="projectdocuments_DocDate"><?= $Page->renderFieldHeader($Page->DocDate) ?></div></th>
<?php } ?>
<?php if ($Page->DocumentTitle->Visible) { // DocumentTitle ?>
        <th data-name="DocumentTitle" class="<?= $Page->DocumentTitle->headerCellClass() ?>"><div id="elh_projectdocuments_DocumentTitle" class="projectdocuments_DocumentTitle"><?= $Page->renderFieldHeader($Page->DocumentTitle) ?></div></th>
<?php } ?>
<?php if ($Page->DocumentFile->Visible) { // DocumentFile ?>
        <th data-name="DocumentFile" class="<?= $Page->DocumentFile->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_DocumentFile" class="projectdocuments_DocumentFile"><?= $Page->renderFieldHeader($Page->DocumentFile) ?></div></th>
<?php } ?>
<?php if ($Page->DocumentType->Visible) { // DocumentType ?>
        <th data-name="DocumentType" class="<?= $Page->DocumentType->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_DocumentType" class="projectdocuments_DocumentType"><?= $Page->renderFieldHeader($Page->DocumentType) ?></div></th>
<?php } ?>
<?php if ($Page->_ProjectID->Visible) { // ProjectID ?>
        <th data-name="_ProjectID" class="<?= $Page->_ProjectID->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments__ProjectID" class="projectdocuments__ProjectID"><?= $Page->renderFieldHeader($Page->_ProjectID) ?></div></th>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <th data-name="Created_Date" class="<?= $Page->Created_Date->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_Created_Date" class="projectdocuments_Created_Date"><?= $Page->renderFieldHeader($Page->Created_Date) ?></div></th>
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
        <th data-name="Created_By" class="<?= $Page->Created_By->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_Created_By" class="projectdocuments_Created_By"><?= $Page->renderFieldHeader($Page->Created_By) ?></div></th>
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
        <th data-name="Last_Updated_Date" class="<?= $Page->Last_Updated_Date->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_Last_Updated_Date" class="projectdocuments_Last_Updated_Date"><?= $Page->renderFieldHeader($Page->Last_Updated_Date) ?></div></th>
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
        <th data-name="Last_Updated_By" class="<?= $Page->Last_Updated_By->headerCellClass() ?>" style="white-space: nowrap;"><div id="elh_projectdocuments_Last_Updated_By" class="projectdocuments_Last_Updated_By"><?= $Page->renderFieldHeader($Page->Last_Updated_By) ?></div></th>
<?php } ?>
<?php
// Render list options (header, right)
$Page->ListOptions->render("header", "right");
?>
    </tr>
</thead>
<tbody data-page="<?= $Page->getPageNumber() ?>">
<?php
$Page->setupGrid();
while ($Page->RecordCount < $Page->StopRecord || $Page->RowIndex === '$rowindex$') {
    if (
        $Page->CurrentRow !== false &&
        $Page->RowIndex !== '$rowindex$' &&
        (!$Page->isGridAdd() || $Page->CurrentMode == "copy") &&
        (!(($Page->isCopy() || $Page->isAdd()) && $Page->RowIndex == 0))
    ) {
        $Page->fetch();
    }
    $Page->RecordCount++;
    if ($Page->RecordCount >= $Page->StartRecord) {
        $Page->setupRow();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php
// Render list options (body, left)
$Page->ListOptions->render("body", "left", $Page->RowCount);
?>
    <?php if ($Page->DocDate->Visible) { // DocDate ?>
        <td data-name="DocDate"<?= $Page->DocDate->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_DocDate" class="el_projectdocuments_DocDate">
<span<?= $Page->DocDate->viewAttributes() ?>>
<?= $Page->DocDate->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->DocumentTitle->Visible) { // DocumentTitle ?>
        <td data-name="DocumentTitle"<?= $Page->DocumentTitle->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_DocumentTitle" class="el_projectdocuments_DocumentTitle">
<span<?= $Page->DocumentTitle->viewAttributes() ?>>
<?= $Page->DocumentTitle->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->DocumentFile->Visible) { // DocumentFile ?>
        <td data-name="DocumentFile"<?= $Page->DocumentFile->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_DocumentFile" class="el_projectdocuments_DocumentFile">
<span<?= $Page->DocumentFile->viewAttributes() ?>>
<?= GetFileViewTag($Page->DocumentFile, $Page->DocumentFile->getViewValue(), false) ?>
</span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->DocumentType->Visible) { // DocumentType ?>
        <td data-name="DocumentType"<?= $Page->DocumentType->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_DocumentType" class="el_projectdocuments_DocumentType">
<span<?= $Page->DocumentType->viewAttributes() ?>>
<?= $Page->DocumentType->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->_ProjectID->Visible) { // ProjectID ?>
        <td data-name="_ProjectID"<?= $Page->_ProjectID->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments__ProjectID" class="el_projectdocuments__ProjectID">
<span<?= $Page->_ProjectID->viewAttributes() ?>>
<?= $Page->_ProjectID->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <td data-name="Created_Date"<?= $Page->Created_Date->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_Created_Date" class="el_projectdocuments_Created_Date">
<span<?= $Page->Created_Date->viewAttributes() ?>>
<?= $Page->Created_Date->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->Created_By->Visible) { // Created_By ?>
        <td data-name="Created_By"<?= $Page->Created_By->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_Created_By" class="el_projectdocuments_Created_By">
<span<?= $Page->Created_By->viewAttributes() ?>>
<?= $Page->Created_By->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
        <td data-name="Last_Updated_Date"<?= $Page->Last_Updated_Date->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_Last_Updated_Date" class="el_projectdocuments_Last_Updated_Date">
<span<?= $Page->Last_Updated_Date->viewAttributes() ?>>
<?= $Page->Last_Updated_Date->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
    <?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
        <td data-name="Last_Updated_By"<?= $Page->Last_Updated_By->cellAttributes() ?>>
<span id="el<?= $Page->RowIndex == '$rowindex$' ? '$rowindex$' : $Page->RowCount ?>_projectdocuments_Last_Updated_By" class="el_projectdocuments_Last_Updated_By">
<span<?= $Page->Last_Updated_By->viewAttributes() ?>>
<?= $Page->Last_Updated_By->getViewValue() ?></span>
</span>
</td>
    <?php } ?>
<?php
// Render list options (body, right)
$Page->ListOptions->render("body", "right", $Page->RowCount);
?>
    </tr>
<?php
    }

    // Reset for template row
    if ($Page->RowIndex === '$rowindex$') {
        $Page->RowIndex = 0;
    }
    // Reset inline add/copy row
    if (($Page->isCopy() || $Page->isAdd()) && $Page->RowIndex == 0) {
        $Page->RowIndex = 1;
    }
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php } ?>
</div><!-- /.ew-grid-middle-panel -->
<?php if (!$Page->CurrentAction && !$Page->UseAjaxActions) { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
</form><!-- /.ew-list-form -->
<?php
// Close result set
$Page->Recordset?->free();
?>
<?php if (!$Page->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$Page->isGridAdd() && !($Page->isGridEdit() && $Page->ModalGridEdit) && !$Page->isMultiEdit()) { ?>
<?= $Page->Pager->render() ?>
<?php } ?>
<div class="ew-list-other-options">
<?php $Page->OtherOptions->render("body", "bottom") ?>
</div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } else { ?>
<div class="ew-list-other-options">
<?php $Page->OtherOptions->render("body") ?>
</div>
<?php } ?>
</div>
<div id="ew-footer-options">
<?php $Page->FooterOptions?->render("body") ?>
</div>
</main>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<?php if (!$Page->isExport()) { ?>
<script>
// Field event handlers
loadjs.ready("head", function() {
    ew.addEventHandlers("projectdocuments");
});
</script>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php } ?>
