<?php

namespace ProjectManagement\prjProjectManagement;

// Page object
$ProjecttemplatepaymentprocessPreview = &$Page;
?>
<script>
ew.deepAssign(ew.vars, { tables: { projecttemplatepaymentprocess: <?= JsonEncode($Page->toClientVar()) ?> } });
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php $Page->showPageHeader(); ?>
<?php if ($Page->TotalRecords > 0) { ?>
<div class="card ew-grid <?= $Page->TableGridClass ?>"><!-- .card -->
<div class="card-body ew-preview-middle-panel ew-grid-middle-panel <?= $Page->TableContainerClass ?>" style="<?= $Page->TableContainerStyle ?>"><!-- .card-body -->
<table class="<?= $Page->TableClass ?>"><!-- .table -->
    <thead><!-- Table header -->
        <tr class="ew-table-header">
<?php
// Render list options
$Page->renderListOptions();

// Render list options (header, left)
$Page->ListOptions->render("header", "left");
?>
<?php if ($Page->DocumentName->Visible) { // DocumentName ?>
    <?php if (!$Page->DocumentName->Sortable || !$Page->sortUrl($Page->DocumentName)) { ?>
        <th class="<?= $Page->DocumentName->headerCellClass() ?>"><?= $Page->DocumentName->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->DocumentName->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->DocumentName->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->DocumentName->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->DocumentName->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->DocumentName->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->PICClient->Visible) { // PICClient ?>
    <?php if (!$Page->PICClient->Sortable || !$Page->sortUrl($Page->PICClient)) { ?>
        <th class="<?= $Page->PICClient->headerCellClass() ?>"><?= $Page->PICClient->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->PICClient->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->PICClient->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->PICClient->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->PICClient->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->PICClient->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->FileName->Visible) { // FileName ?>
    <?php if (!$Page->FileName->Sortable || !$Page->sortUrl($Page->FileName)) { ?>
        <th class="<?= $Page->FileName->headerCellClass() ?>"><?= $Page->FileName->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->FileName->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->FileName->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->FileName->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->FileName->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->FileName->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->templateid->Visible) { // templateid ?>
    <?php if (!$Page->templateid->Sortable || !$Page->sortUrl($Page->templateid)) { ?>
        <th class="<?= $Page->templateid->headerCellClass() ?>"><?= $Page->templateid->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->templateid->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->templateid->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->templateid->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->templateid->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->templateid->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
    <?php if (!$Page->Created_Date->Sortable || !$Page->sortUrl($Page->Created_Date)) { ?>
        <th class="<?= $Page->Created_Date->headerCellClass() ?>"><?= $Page->Created_Date->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->Created_Date->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->Created_Date->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->Created_Date->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->Created_Date->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->Created_Date->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
    <?php if (!$Page->Created_By->Sortable || !$Page->sortUrl($Page->Created_By)) { ?>
        <th class="<?= $Page->Created_By->headerCellClass() ?>"><?= $Page->Created_By->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->Created_By->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->Created_By->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->Created_By->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->Created_By->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->Created_By->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
    <?php if (!$Page->Last_Updated_Date->Sortable || !$Page->sortUrl($Page->Last_Updated_Date)) { ?>
        <th class="<?= $Page->Last_Updated_Date->headerCellClass() ?>"><?= $Page->Last_Updated_Date->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->Last_Updated_Date->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->Last_Updated_Date->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->Last_Updated_Date->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->Last_Updated_Date->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->Last_Updated_Date->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
    <?php if (!$Page->Last_Updated_By->Sortable || !$Page->sortUrl($Page->Last_Updated_By)) { ?>
        <th class="<?= $Page->Last_Updated_By->headerCellClass() ?>"><?= $Page->Last_Updated_By->caption() ?></th>
    <?php } else { ?>
        <th class="<?= $Page->Last_Updated_By->headerCellClass() ?>"><div role="button" data-table="projecttemplatepaymentprocess" data-sort="<?= HtmlEncode($Page->Last_Updated_By->Name) ?>" data-sort-type="1" data-sort-order="<?= $Page->Last_Updated_By->getNextSort() ?>">
            <div class="ew-table-header-btn">
                <span class="ew-table-header-caption"><?= $Page->Last_Updated_By->caption() ?></span>
                <span class="ew-table-header-sort"><?= $Page->Last_Updated_By->getSortIcon() ?></span>
            </div>
        </th>
    <?php } ?>
<?php } ?>
<?php
// Render list options (header, right)
$Page->ListOptions->render("header", "right");
?>
        </tr>
    </thead>
    <tbody><!-- Table body -->
<?php
$Page->RecordCount = 0;
$Page->RowCount = 0;
while ($Page->fetch()) {
    // Init row class and style
    $Page->RecordCount++;
    $Page->RowCount++;
    $Page->CssStyle = "";
    $Page->loadListRowValues($Page->CurrentRow);

    // Render row
    $Page->RowType = RowType::PREVIEW; // Preview record
    $Page->resetAttributes();
    $Page->renderListRow();

    // Set up row attributes
    $Page->RowAttrs->merge([
        "data-rowindex" => $Page->RowCount,
        "class" => ($Page->RowCount % 2 != 1) ? "ew-table-alt-row" : "",

        // Add row attributes for expandable row
        "data-widget" => "expandable-table",
        "aria-expanded" => "false",
    ]);

    // Render list options
    $Page->renderListOptions();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php
// Render list options (body, left)
$Page->ListOptions->render("body", "left", $Page->RowCount);
?>
<?php if ($Page->DocumentName->Visible) { // DocumentName ?>
        <!-- DocumentName -->
        <td<?= $Page->DocumentName->cellAttributes() ?>>
<span<?= $Page->DocumentName->viewAttributes() ?>>
<?= $Page->DocumentName->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->PICClient->Visible) { // PICClient ?>
        <!-- PICClient -->
        <td<?= $Page->PICClient->cellAttributes() ?>>
<span<?= $Page->PICClient->viewAttributes() ?>>
<?= $Page->PICClient->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->FileName->Visible) { // FileName ?>
        <!-- FileName -->
        <td<?= $Page->FileName->cellAttributes() ?>>
<span<?= $Page->FileName->viewAttributes() ?>>
<?= GetFileViewTag($Page->FileName, $Page->FileName->getViewValue(), false) ?>
</span>
</td>
<?php } ?>
<?php if ($Page->templateid->Visible) { // templateid ?>
        <!-- templateid -->
        <td<?= $Page->templateid->cellAttributes() ?>>
<span<?= $Page->templateid->viewAttributes() ?>>
<?= $Page->templateid->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <!-- Created_Date -->
        <td<?= $Page->Created_Date->cellAttributes() ?>>
<span<?= $Page->Created_Date->viewAttributes() ?>>
<?= $Page->Created_Date->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
        <!-- Created_By -->
        <td<?= $Page->Created_By->cellAttributes() ?>>
<span<?= $Page->Created_By->viewAttributes() ?>>
<?= $Page->Created_By->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
        <!-- Last_Updated_Date -->
        <td<?= $Page->Last_Updated_Date->cellAttributes() ?>>
<span<?= $Page->Last_Updated_Date->viewAttributes() ?>>
<?= $Page->Last_Updated_Date->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
        <!-- Last_Updated_By -->
        <td<?= $Page->Last_Updated_By->cellAttributes() ?>>
<span<?= $Page->Last_Updated_By->viewAttributes() ?>>
<?= $Page->Last_Updated_By->getViewValue() ?></span>
</td>
<?php } ?>
<?php
// Render list options (body, right)
$Page->ListOptions->render("body", "right", $Page->RowCount);
?>
    </tr>
<?php
} // while
?>
    </tbody>
</table><!-- /.table -->
</div><!-- /.card-body -->
<div class="card-footer ew-grid-lower-panel ew-preview-lower-panel"><!-- .card-footer -->
<?= $Page->Pager->render() ?>
<?php if ($Page->OtherOptions->visible()) { ?>
<div class="ew-preview-other-options">
<?php
    foreach ($Page->OtherOptions as $option) {
        $option->render("body");
    }
?>
</div>
<?php } ?>
</div><!-- /.card-footer -->
</div><!-- /.card -->
<?php } else { // No record ?>
<div class="card border-0"><!-- .card -->
<div class="ew-detail-count"><?= $Language->phrase("NoRecord") ?></div>
<?php if ($Page->OtherOptions->visible()) { ?>
<div class="ew-preview-other-options">
<?php
    foreach ($Page->OtherOptions as $option) {
        $option->render("body");
    }
?>
</div>
<?php } ?>
</div><!-- /.card -->
<?php } ?>
<?php
foreach ($Page->DetailCounts as $detailTblVar => $detailCount) {
?>
<div class="ew-detail-count d-none" data-table="<?= $detailTblVar ?>" data-count="<?= $detailCount ?>"><?= FormatInteger($detailCount) ?></div>
<?php
}
?>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<?php
$Page->Recordset?->free();
?>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
