<?php

namespace PHPMaker2023\Jack_Jill_school;

// Page object
$CiitiesReportSummary = &$Page;
?>
<?php if (!$Page->isExport() && !$Page->DrillDown && !$DashboardReport) { ?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { Ciities_Report: 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="fCiities_Reportsrch" id="fCiities_Reportsrch" class="ew-form ew-ext-search-form" action="<?= CurrentPageUrl(false) ?>" novalidate autocomplete="on">
<div id="fCiities_Reportsrch_search_panel" class="mb-2 mb-sm-0 <?= $Page->SearchPanelClass ?>"><!-- .ew-search-panel -->
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { Ciities_Report: currentTable } });
var currentPageID = ew.PAGE_ID = "summary";
var currentForm;
var fCiities_Reportsrch, currentSearchForm, currentAdvancedSearchForm;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery,
        fields = currentTable.fields;

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

        // Add fields
        .addFields([
            ["NIP", [], fields.NIP.isInvalid],
            ["Carte_No", [], fields.Carte_No.isInvalid],
            ["Nom", [], fields.Nom.isInvalid],
            ["Prenom", [], fields.Prenom.isInvalid],
            ["Photo", [], fields.Photo.isInvalid],
            ["DateNaissance", [], fields.DateNaissance.isInvalid],
            ["Lieu", [], fields.Lieu.isInvalid],
            ["Unique_QR", [], fields.Unique_QR.isInvalid],
            ["Localite", [], fields.Localite.isInvalid],
            ["Statut", [], fields.Statut.isInvalid],
            ["Reference", [], fields.Reference.isInvalid]
        ])
        // 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({
            "Carte_No": <?= $Page->Carte_No->toClientList($Page) ?>,
            "Unique_QR": <?= $Page->Unique_QR->toClientList($Page) ?>,
            "Localite": <?= $Page->Localite->toClientList($Page) ?>,
        })

        // Filters
        .setFilterList(<?= $Page->getFilterList() ?>)

        // Init search panel as collapsed
        .setInitSearchPanel(true)
        .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->Carte_No->Visible) { // Carte_No ?>
<?php
if (!$Page->Carte_No->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Carte_No" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Carte_No->UseFilter ? " ew-filter-field" : "" ?>">
        <div class="d-flex my-1 my-sm-0">
            <label class="ew-search-caption ew-label"><?= $Page->Carte_No->caption() ?></label>
            <div class="ew-search-operator">
<?= $Language->phrase("LIKE") ?>
<input type="hidden" name="z_Carte_No" id="z_Carte_No" value="LIKE">
</div>
        </div>
        <div id="el_Ciities_Report_Carte_No" class="ew-search-field">
<?php
if (IsRTL()) {
    $Page->Carte_No->EditAttrs["dir"] = "rtl";
}
?>
<span id="as_x_Carte_No" class="ew-auto-suggest">
    <input type="<?= $Page->Carte_No->getInputTextType() ?>" class="form-control" name="sv_x_Carte_No" id="sv_x_Carte_No" value="<?= RemoveHtml($Page->Carte_No->EditValue) ?>" autocomplete="off" size="30" maxlength="20" placeholder="<?= HtmlEncode($Page->Carte_No->getPlaceHolder()) ?>" data-placeholder="<?= HtmlEncode($Page->Carte_No->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Carte_No->formatPattern()) ?>"<?= $Page->Carte_No->editAttributes() ?>>
</span>
<selection-list hidden class="form-control" data-table="Ciities_Report" data-field="x_Carte_No" data-input="sv_x_Carte_No" data-value-separator="<?= $Page->Carte_No->displayValueSeparatorAttribute() ?>" name="x_Carte_No" id="x_Carte_No" value="<?= HtmlEncode($Page->Carte_No->AdvancedSearch->SearchValue) ?>"></selection-list>
<div class="invalid-feedback"><?= $Page->Carte_No->getErrorMessage() ?></div>
<script>
loadjs.ready("fCiities_Reportsrch", function() {
    fCiities_Reportsrch.createAutoSuggest(Object.assign({"id":"x_Carte_No","forceSelect":false}, { lookupAllDisplayFields: <?= $Page->Carte_No->Lookup->LookupAllDisplayFields ? "true" : "false" ?> }, ew.vars.tables.Ciities_Report.fields.Carte_No.autoSuggestOptions));
});
</script>
<?= $Page->Carte_No->Lookup->getParamTag($Page, "p_x_Carte_No") ?>
</div>
        <div class="d-flex my-1 my-sm-0">
        </div><!-- /.ew-search-field -->
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { // Unique_QR ?>
<?php
if (!$Page->Unique_QR->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Unique_QR" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Unique_QR->UseFilter ? " ew-filter-field" : "" ?>">
        <div class="d-flex my-1 my-sm-0">
            <label class="ew-search-caption ew-label"><?= $Page->Unique_QR->caption() ?></label>
            <div class="ew-search-operator">
<?= $Language->phrase("LIKE") ?>
<input type="hidden" name="z_Unique_QR" id="z_Unique_QR" value="LIKE">
</div>
        </div>
        <div id="el_Ciities_Report_Unique_QR" class="ew-search-field">
<?php
if (IsRTL()) {
    $Page->Unique_QR->EditAttrs["dir"] = "rtl";
}
?>
<span id="as_x_Unique_QR" class="ew-auto-suggest">
    <input type="<?= $Page->Unique_QR->getInputTextType() ?>" class="form-control" name="sv_x_Unique_QR" id="sv_x_Unique_QR" value="<?= RemoveHtml($Page->Unique_QR->EditValue) ?>" autocomplete="off" size="30" maxlength="12" placeholder="<?= HtmlEncode($Page->Unique_QR->getPlaceHolder()) ?>" data-placeholder="<?= HtmlEncode($Page->Unique_QR->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Unique_QR->formatPattern()) ?>"<?= $Page->Unique_QR->editAttributes() ?>>
</span>
<selection-list hidden class="form-control" data-table="Ciities_Report" data-field="x_Unique_QR" data-input="sv_x_Unique_QR" data-value-separator="<?= $Page->Unique_QR->displayValueSeparatorAttribute() ?>" name="x_Unique_QR" id="x_Unique_QR" value="<?= HtmlEncode($Page->Unique_QR->AdvancedSearch->SearchValue) ?>"></selection-list>
<div class="invalid-feedback"><?= $Page->Unique_QR->getErrorMessage() ?></div>
<script>
loadjs.ready("fCiities_Reportsrch", function() {
    fCiities_Reportsrch.createAutoSuggest(Object.assign({"id":"x_Unique_QR","forceSelect":false}, { lookupAllDisplayFields: <?= $Page->Unique_QR->Lookup->LookupAllDisplayFields ? "true" : "false" ?> }, ew.vars.tables.Ciities_Report.fields.Unique_QR.autoSuggestOptions));
});
</script>
<?= $Page->Unique_QR->Lookup->getParamTag($Page, "p_x_Unique_QR") ?>
</div>
        <div class="d-flex my-1 my-sm-0">
        </div><!-- /.ew-search-field -->
    </div><!-- /.col-sm-auto -->
<?php } ?>
<?php if ($Page->Localite->Visible) { // Localite ?>
<?php
if (!$Page->Localite->UseFilter) {
    $Page->SearchColumnCount++;
}
?>
    <div id="xs_Localite" class="col-sm-auto d-sm-flex align-items-start mb-3 px-0 pe-sm-2<?= $Page->Localite->UseFilter ? " ew-filter-field" : "" ?>">
        <div class="d-flex my-1 my-sm-0">
            <label class="ew-search-caption ew-label"><?= $Page->Localite->caption() ?></label>
            <div class="ew-search-operator">
<?= $Language->phrase("LIKE") ?>
<input type="hidden" name="z_Localite" id="z_Localite" value="LIKE">
</div>
        </div>
        <div id="el_Ciities_Report_Localite" class="ew-search-field">
<?php
if (IsRTL()) {
    $Page->Localite->EditAttrs["dir"] = "rtl";
}
?>
<span id="as_x_Localite" class="ew-auto-suggest">
    <input type="<?= $Page->Localite->getInputTextType() ?>" class="form-control" name="sv_x_Localite" id="sv_x_Localite" value="<?= RemoveHtml($Page->Localite->EditValue) ?>" autocomplete="off" size="30" maxlength="60" placeholder="<?= HtmlEncode($Page->Localite->getPlaceHolder()) ?>" data-placeholder="<?= HtmlEncode($Page->Localite->getPlaceHolder()) ?>" data-format-pattern="<?= HtmlEncode($Page->Localite->formatPattern()) ?>"<?= $Page->Localite->editAttributes() ?>>
</span>
<selection-list hidden class="form-control" data-table="Ciities_Report" data-field="x_Localite" data-input="sv_x_Localite" data-value-separator="<?= $Page->Localite->displayValueSeparatorAttribute() ?>" name="x_Localite" id="x_Localite" value="<?= HtmlEncode($Page->Localite->AdvancedSearch->SearchValue) ?>"></selection-list>
<div class="invalid-feedback"><?= $Page->Localite->getErrorMessage() ?></div>
<script>
loadjs.ready("fCiities_Reportsrch", function() {
    fCiities_Reportsrch.createAutoSuggest(Object.assign({"id":"x_Localite","forceSelect":false}, { lookupAllDisplayFields: <?= $Page->Localite->Lookup->LookupAllDisplayFields ? "true" : "false" ?> }, ew.vars.tables.Ciities_Report.fields.Localite.autoSuggestOptions));
});
</script>
<?= $Page->Localite->Lookup->getParamTag($Page, "p_x_Localite") ?>
</div>
        <div class="d-flex my-1 my-sm-0">
        </div><!-- /.ew-search-field -->
    </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->TotalGroups > 0) { ?>
<?php if (!$Page->isExport() && !($Page->DrillDown && $Page->TotalGroups > 0)) { ?>
<!-- Bottom pager -->
<div class="card-footer ew-grid-lower-panel">
<?= $Page->Pager->render() ?>
</div>
<?php } ?>
<?php } ?>
</div>
<!-- /.ew-grid -->
<?= $Page->PageBreakHtml ?>
<?php } ?>
<div class="<?= $Page->ReportContainerClass ?>">
<?php if (!$Page->isExport() && !($Page->DrillDown && $Page->TotalGroups > 0)) { ?>
<!-- Top pager -->
<div class="card-header ew-grid-upper-panel">
<?= $Page->Pager->render() ?>
</div>
<?php } ?>
<!-- Report grid (begin) -->
<div id="gmp_Ciities_Report" class="card-body ew-grid-middle-panel <?= $Page->TableContainerClass ?>">
<table class="<?= $Page->TableClass ?>">
<thead>
	<!-- Table header -->
    <tr class="ew-table-header">
<?php if ($Page->Localite->Visible) { ?>
    <?php if ($Page->Localite->ShowGroupHeaderAsRow) { ?>
    <th data-name="Localite">&nbsp;</th>
    <?php } else { ?>
    <th data-name="Localite" class="<?= $Page->Localite->headerCellClass() ?>"><div class="Ciities_Report_Localite"><?= $Page->renderFieldHeader($Page->Localite) ?></div></th>
    <?php } ?>
<?php } ?>
<?php if ($Page->NIP->Visible) { ?>
    <th data-name="NIP" class="<?= $Page->NIP->headerCellClass() ?>"><div class="Ciities_Report_NIP"><?= $Page->renderFieldHeader($Page->NIP) ?></div></th>
<?php } ?>
<?php if ($Page->Carte_No->Visible) { ?>
    <th data-name="Carte_No" class="<?= $Page->Carte_No->headerCellClass() ?>"><div class="Ciities_Report_Carte_No"><?= $Page->renderFieldHeader($Page->Carte_No) ?></div></th>
<?php } ?>
<?php if ($Page->Nom->Visible) { ?>
    <th data-name="Nom" class="<?= $Page->Nom->headerCellClass() ?>"><div class="Ciities_Report_Nom"><?= $Page->renderFieldHeader($Page->Nom) ?></div></th>
<?php } ?>
<?php if ($Page->Prenom->Visible) { ?>
    <th data-name="Prenom" class="<?= $Page->Prenom->headerCellClass() ?>"><div class="Ciities_Report_Prenom"><?= $Page->renderFieldHeader($Page->Prenom) ?></div></th>
<?php } ?>
<?php if ($Page->Photo->Visible) { ?>
    <th data-name="Photo" class="<?= $Page->Photo->headerCellClass() ?>"><div class="Ciities_Report_Photo"><?= $Page->renderFieldHeader($Page->Photo) ?></div></th>
<?php } ?>
<?php if ($Page->DateNaissance->Visible) { ?>
    <th data-name="DateNaissance" class="<?= $Page->DateNaissance->headerCellClass() ?>"><div class="Ciities_Report_DateNaissance"><?= $Page->renderFieldHeader($Page->DateNaissance) ?></div></th>
<?php } ?>
<?php if ($Page->Lieu->Visible) { ?>
    <th data-name="Lieu" class="<?= $Page->Lieu->headerCellClass() ?>"><div class="Ciities_Report_Lieu"><?= $Page->renderFieldHeader($Page->Lieu) ?></div></th>
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { ?>
    <th data-name="Unique_QR" class="<?= $Page->Unique_QR->headerCellClass() ?>"><div class="Ciities_Report_Unique_QR"><?= $Page->renderFieldHeader($Page->Unique_QR) ?></div></th>
<?php } ?>
<?php if ($Page->Statut->Visible) { ?>
    <th data-name="Statut" class="<?= $Page->Statut->headerCellClass() ?>"><div class="Ciities_Report_Statut"><?= $Page->renderFieldHeader($Page->Statut) ?></div></th>
<?php } ?>
<?php if ($Page->Reference->Visible) { ?>
    <th data-name="Reference" class="<?= $Page->Reference->headerCellClass() ?>"><div class="Ciities_Report_Reference"><?= $Page->renderFieldHeader($Page->Reference) ?></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->Localite, $Page->getSqlFirstGroupField(), $Page->Localite->groupValue(), $Page->Dbid);
    if ($Page->PageFirstGroupFilter != "") {
        $Page->PageFirstGroupFilter .= " OR ";
    }
    $Page->PageFirstGroupFilter .= $where;
    if ($Page->Filter != "") {
        $where = "($Page->Filter) AND ($where)";
    }
    $sql = $Page->buildReportSql($Page->getSqlSelect(), $Page->getSqlFrom(), $Page->getSqlWhere(), $Page->getSqlGroupBy(), $Page->getSqlHaving(), $Page->getSqlOrderBy(), $where, $Page->Sort);
    $rs = $sql->execute();
    $Page->DetailRecords = $rs ? $rs->fetchAll() : [];
    $Page->DetailRecordCount = count($Page->DetailRecords);
    $Page->setGroupCount($Page->DetailRecordCount, $Page->GroupCount);

    // Load detail records
    $Page->Localite->Records = &$Page->DetailRecords;
    $Page->Localite->LevelBreak = true; // Set field level break
        $Page->GroupCounter[1] = $Page->GroupCount;
        $Page->Localite->getCnt($Page->Localite->Records); // Get record count
        $Page->setGroupCount($Page->Localite->Count, $Page->GroupCounter[1]);
?>
<?php if ($Page->Localite->Visible && $Page->Localite->ShowGroupHeaderAsRow) { ?>
<?php
        // Render header row
        $Page->resetAttributes();
        $Page->RowType = ROWTYPE_TOTAL;
        $Page->RowTotalType = ROWTOTAL_GROUP;
        $Page->RowTotalSubType = ROWTOTAL_HEADER;
        $Page->RowGroupLevel = 1;
        $Page->renderRow();
?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->Localite->Visible) { ?>
        <?php $Page->Localite->CellAttrs->appendClass("ew-rpt-grp-caret"); ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes(); ?>><i class="ew-group-toggle fa-solid fa-caret-down"></i></td>
        <?php $Page->Localite->CellAttrs->removeClass("ew-rpt-grp-caret"); ?>
<?php } ?>
        <td data-field="Localite" colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount - 1) ?>"<?= $Page->Localite->cellAttributes() ?>>
            <span class="ew-summary-caption Ciities_Report_Localite"><?= $Page->renderFieldHeader($Page->Localite) ?></span><?= $Language->phrase("SummaryColon") ?><span<?= $Page->Localite->viewAttributes() ?>><?= $Page->Localite->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->Localite->Count, Config("DEFAULT_NUMBER_FORMAT")) ?></span>)</span>
        </td>
    </tr>
<?php } ?>
<?php
        $Page->RecordCount = 0; // Reset record count
        foreach ($Page->Localite->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->Localite->Visible) { ?>
    <?php if ($Page->Localite->ShowGroupHeaderAsRow) { ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes() ?>></td>
    <?php } else { ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes() ?>><span<?= $Page->Localite->viewAttributes() ?>><?= $Page->Localite->GroupViewValue ?></span></td>
    <?php } ?>
<?php } ?>
<?php if ($Page->NIP->Visible) { ?>
        <td data-field="NIP"<?= $Page->NIP->cellAttributes() ?>>
<span<?= $Page->NIP->viewAttributes() ?>>
<?= $Page->NIP->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Carte_No->Visible) { ?>
        <td data-field="Carte_No"<?= $Page->Carte_No->cellAttributes() ?>>
<span<?= $Page->Carte_No->viewAttributes() ?>>
<?= $Page->Carte_No->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Nom->Visible) { ?>
        <td data-field="Nom"<?= $Page->Nom->cellAttributes() ?>>
<span<?= $Page->Nom->viewAttributes() ?>>
<?= $Page->Nom->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Prenom->Visible) { ?>
        <td data-field="Prenom"<?= $Page->Prenom->cellAttributes() ?>>
<span<?= $Page->Prenom->viewAttributes() ?>>
<?= $Page->Prenom->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Photo->Visible) { ?>
        <td data-field="Photo"<?= $Page->Photo->cellAttributes() ?>>
<span>
<?= GetFileViewTag($Page->Photo, $Page->Photo->getViewValue(), false) ?>
</span>
</td>
<?php } ?>
<?php if ($Page->DateNaissance->Visible) { ?>
        <td data-field="DateNaissance"<?= $Page->DateNaissance->cellAttributes() ?>>
<span<?= $Page->DateNaissance->viewAttributes() ?>>
<?= $Page->DateNaissance->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Lieu->Visible) { ?>
        <td data-field="Lieu"<?= $Page->Lieu->cellAttributes() ?>>
<span<?= $Page->Lieu->viewAttributes() ?>>
<?= $Page->Lieu->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { ?>
        <td data-field="Unique_QR"<?= $Page->Unique_QR->cellAttributes() ?>>
<span<?= $Page->Unique_QR->viewAttributes() ?>><?= PhpBarcode::barcode(true)->show($Page->Unique_QR->CurrentValue, 'QRCODE', 60) ?></span>
</td>
<?php } ?>
<?php if ($Page->Statut->Visible) { ?>
        <td data-field="Statut"<?= $Page->Statut->cellAttributes() ?>>
<span<?= $Page->Statut->viewAttributes() ?>>
<?= $Page->Statut->getViewValue() ?></span>
</td>
<?php } ?>
<?php if ($Page->Reference->Visible) { ?>
        <td data-field="Reference"<?= $Page->Reference->cellAttributes() ?>>
<span<?= $Page->Reference->viewAttributes() ?>>
<?= $Page->Reference->getViewValue() ?></span>
</td>
<?php } ?>
    </tr>
<?php
    }
?>
<?php if ($Page->TotalGroups > 0) { ?>
<?php
    $Page->resetAttributes();
    $Page->RowType = ROWTYPE_TOTAL;
    $Page->RowTotalType = ROWTOTAL_GROUP;
    $Page->RowTotalSubType = ROWTOTAL_FOOTER;
    $Page->RowGroupLevel = 1;
    $Page->renderRow();
?>
<?php if ($Page->Localite->ShowCompactSummaryFooter) { ?>
    <?php if (!$Page->Localite->ShowGroupHeaderAsRow) { ?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->Localite->Visible) { ?>
    <?php if ($Page->Localite->ShowGroupHeaderAsRow) { ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes() ?>></td>
    <?php } elseif ($Page->RowGroupLevel != 1) { ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes() ?>>
        </td>
    <?php } else { ?>
        <td data-field="Localite"<?= $Page->Localite->cellAttributes() ?>>
            <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->Localite->Count, Config("DEFAULT_NUMBER_FORMAT")) ?></span></span>
        </td>
    <?php } ?>
<?php } ?>
<?php if ($Page->NIP->Visible) { ?>
        <td data-field="NIP"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Carte_No->Visible) { ?>
        <td data-field="Carte_No"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Nom->Visible) { ?>
        <td data-field="Nom"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Prenom->Visible) { ?>
        <td data-field="Prenom"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Photo->Visible) { ?>
        <td data-field="Photo"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->DateNaissance->Visible) { ?>
        <td data-field="DateNaissance"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Lieu->Visible) { ?>
        <td data-field="Lieu"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { ?>
        <td data-field="Unique_QR"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Statut->Visible) { ?>
        <td data-field="Statut"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
<?php if ($Page->Reference->Visible) { ?>
        <td data-field="Reference"<?= $Page->Localite->cellAttributes() ?>></td>
<?php } ?>
    </tr>
    <?php } ?>
<?php } else { ?>
    <tr<?= $Page->rowAttributes(); ?>>
<?php if ($Page->GroupColumnCount + $Page->DetailColumnCount > 0) { ?>
        <td colspan="<?= ($Page->GroupColumnCount + $Page->DetailColumnCount) ?>"<?= $Page->Localite->cellAttributes() ?>><?= str_replace(["%v", "%c"], [$Page->Localite->GroupViewValue, $Page->Localite->caption()], $Language->phrase("RptSumHead")) ?> <span class="ew-dir-ltr">(<?= FormatNumber($Page->Localite->Count, Config("DEFAULT_NUMBER_FORMAT")) ?><?= $Language->phrase("RptDtlRec") ?>)</span></td>
<?php } ?>
    </tr>
<?php } ?>
<?php } ?>
<?php
?>
<?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 = ROWTOTAL_GRAND;
    $Page->RowTotalSubType = ROWTOTAL_FOOTER;
    $Page->RowAttrs["class"] = "ew-rpt-grand-summary";
    $Page->renderRow();
?>
<?php if ($Page->Localite->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>
<?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>
<?php } ?>
</tfoot>
</table>
</div>
<!-- /.ew-grid-middle-panel -->
<!-- Report grid (end) -->
<?php if ($Page->TotalGroups > 0) { ?>
<?php if (!$Page->isExport() && !($Page->DrillDown && $Page->TotalGroups > 0)) { ?>
<!-- Bottom pager -->
<div class="card-footer ew-grid-lower-panel">
<?= $Page->Pager->render() ?>
</div>
<?php } ?>
<?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->CITIESCHART->DrillDownInPanel = $Page->DrillDownInPanel;
    echo $Page->CITIESCHART->render("ew-chart-bottom");
}
?>
<?php if ((!$Page->isExport() || $Page->isExport("print")) && !$DashboardReport) { ?>
</div>
<!-- /#ew-bottom -->
<?php } ?>
<?php if (!$DashboardReport && !$Page->isExport()) { ?>
<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 if (!$Ciities_Report->isExport()) { ?>
<script>
loadjs.ready("jqueryjs", function() {
	var expires = new Date(new Date().getTime() + 525600 * 60 * 1000); // expire in 525600 
	var SearchToggle = $('.ew-search-toggle'); 
	SearchToggle.on('click', function(event) { 
		event.preventDefault(); 
		if (SearchToggle.hasClass('active')) { 
			Cookies.set("Ciities_Report_searchpanel", "notactive", { path: '', expires: expires }); 
		} else { 
			Cookies.set("Ciities_Report_searchpanel", "active", { path: '', expires: expires }); 
		} 
	});
});
</script>
<?php } ?>
<?php if (!$Page->isExport()) { ?>
<script>
loadjs.ready("head", function() {
	$(".ew-grid").css("width", "100%");
	$(".sidebar, .main-sidebar, .main-header, .header-navbar, .main-menu").on("mouseenter", function(event) {
		$(".ew-grid").css("width", "100%");
	});
	$(".sidebar, .main-sidebar, .main-header, .header-navbar, .main-menu").on("mouseover", function(event) {
		$(".ew-grid").css("width", "100%");
	});
	var cssTransitionEnd = 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend';
	$('.main-header').on(cssTransitionEnd, function(event) {
		$(".ew-grid").css("width", "100%");
	});
	$(document).on('resize', function() {
		if ($('.ew-grid').length > 0) {
			$(".ew-grid").css("width", "100%");
		}
	});
	$(".nav-item.d-block").on("click", function(event) {
		$(".ew-grid").css("width", "100%");
	});
});
</script>
<?php } ?>
<?php } ?>
