<?php

namespace PHPMaker2023\Jack_Jill_school;

// Page object
$VolontaireDelete = &$Page;
?>
<script>
var currentTable = <?= JsonEncode($Page->toClientVar()) ?>;
ew.deepAssign(ew.vars, { tables: { volontaire: currentTable } });
var currentPageID = ew.PAGE_ID = "delete";
var currentForm;
var fvolontairedelete;
loadjs.ready(["wrapper", "head"], function () {
    let $ = jQuery;
    let fields = currentTable.fields;

    // Form object
    let form = new ew.FormBuilder()
        .setId("fvolontairedelete")
        .setPageId("delete")
        .build();
    window[form.id] = form;
    currentForm = form;
    loadjs.done(form.id);
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<form name="fvolontairedelete" id="fvolontairedelete" class="ew-form ew-delete-form" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate autocomplete="on">
<?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="volontaire">
<input type="hidden" name="action" id="action" value="delete">
<?php foreach ($Page->RecKeys as $key) { ?>
<?php $keyvalue = is_array($key) ? implode(Config("COMPOSITE_KEY_SEPARATOR"), $key) : $key; ?>
<input type="hidden" name="key_m[]" value="<?= HtmlEncode($keyvalue) ?>">
<?php } ?>
<div class="card ew-card ew-grid <?= $Page->TableGridClass ?>">
<div class="card-body ew-grid-middle-panel <?= $Page->TableContainerClass ?>" style="<?= $Page->TableContainerStyle ?>">
<table class="<?= $Page->TableClass ?>">
    <thead>
    <tr class="ew-table-header">
<?php if ($Page->Carte_No->Visible) { // Carte_No ?>
        <th class="<?= $Page->Carte_No->headerCellClass() ?>"><span id="elh_volontaire_Carte_No" class="volontaire_Carte_No"><?= $Page->Carte_No->caption() ?></span></th>
<?php } ?>
<?php if ($Page->NIP->Visible) { // NIP ?>
        <th class="<?= $Page->NIP->headerCellClass() ?>"><span id="elh_volontaire_NIP" class="volontaire_NIP"><?= $Page->NIP->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Nom->Visible) { // Nom ?>
        <th class="<?= $Page->Nom->headerCellClass() ?>"><span id="elh_volontaire_Nom" class="volontaire_Nom"><?= $Page->Nom->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Prenom->Visible) { // Prenom ?>
        <th class="<?= $Page->Prenom->headerCellClass() ?>"><span id="elh_volontaire_Prenom" class="volontaire_Prenom"><?= $Page->Prenom->caption() ?></span></th>
<?php } ?>
<?php if ($Page->DateNaissance->Visible) { // DateNaissance ?>
        <th class="<?= $Page->DateNaissance->headerCellClass() ?>"><span id="elh_volontaire_DateNaissance" class="volontaire_DateNaissance"><?= $Page->DateNaissance->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Lieu->Visible) { // Lieu ?>
        <th class="<?= $Page->Lieu->headerCellClass() ?>"><span id="elh_volontaire_Lieu" class="volontaire_Lieu"><?= $Page->Lieu->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Photo->Visible) { // Photo ?>
        <th class="<?= $Page->Photo->headerCellClass() ?>"><span id="elh_volontaire_Photo" class="volontaire_Photo"><?= $Page->Photo->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { // Unique_QR ?>
        <th class="<?= $Page->Unique_QR->headerCellClass() ?>"><span id="elh_volontaire_Unique_QR" class="volontaire_Unique_QR"><?= $Page->Unique_QR->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Delivree->Visible) { // Delivree ?>
        <th class="<?= $Page->Delivree->headerCellClass() ?>"><span id="elh_volontaire_Delivree" class="volontaire_Delivree"><?= $Page->Delivree->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Expire->Visible) { // Expire ?>
        <th class="<?= $Page->Expire->headerCellClass() ?>"><span id="elh_volontaire_Expire" class="volontaire_Expire"><?= $Page->Expire->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Localite->Visible) { // Localite ?>
        <th class="<?= $Page->Localite->headerCellClass() ?>"><span id="elh_volontaire_Localite" class="volontaire_Localite"><?= $Page->Localite->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Statut->Visible) { // Statut ?>
        <th class="<?= $Page->Statut->headerCellClass() ?>"><span id="elh_volontaire_Statut" class="volontaire_Statut"><?= $Page->Statut->caption() ?></span></th>
<?php } ?>
    </tr>
    </thead>
    <tbody>
<?php
$Page->RecordCount = 0;
$i = 0;
while (!$Page->Recordset->EOF) {
    $Page->RecordCount++;
    $Page->RowCount++;

    // Set row properties
    $Page->resetAttributes();
    $Page->RowType = ROWTYPE_VIEW; // View

    // Get the field contents
    $Page->loadRowValues($Page->Recordset);

    // Render row
    $Page->renderRow();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php if ($Page->Carte_No->Visible) { // Carte_No ?>
        <td<?= $Page->Carte_No->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Carte_No" class="el_volontaire_Carte_No">
<span<?= $Page->Carte_No->viewAttributes() ?>>
<?= $Page->Carte_No->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->NIP->Visible) { // NIP ?>
        <td<?= $Page->NIP->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_NIP" class="el_volontaire_NIP">
<span<?= $Page->NIP->viewAttributes() ?>>
<?= $Page->NIP->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Nom->Visible) { // Nom ?>
        <td<?= $Page->Nom->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Nom" class="el_volontaire_Nom">
<span<?= $Page->Nom->viewAttributes() ?>>
<?= $Page->Nom->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Prenom->Visible) { // Prenom ?>
        <td<?= $Page->Prenom->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Prenom" class="el_volontaire_Prenom">
<span<?= $Page->Prenom->viewAttributes() ?>>
<?= $Page->Prenom->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->DateNaissance->Visible) { // DateNaissance ?>
        <td<?= $Page->DateNaissance->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_DateNaissance" class="el_volontaire_DateNaissance">
<span<?= $Page->DateNaissance->viewAttributes() ?>>
<?= $Page->DateNaissance->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Lieu->Visible) { // Lieu ?>
        <td<?= $Page->Lieu->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Lieu" class="el_volontaire_Lieu">
<span<?= $Page->Lieu->viewAttributes() ?>>
<?= $Page->Lieu->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Photo->Visible) { // Photo ?>
        <td<?= $Page->Photo->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Photo" class="el_volontaire_Photo">
<span>
<?= GetFileViewTag($Page->Photo, $Page->Photo->getViewValue(), false) ?>
</span>
</span>
</td>
<?php } ?>
<?php if ($Page->Unique_QR->Visible) { // Unique_QR ?>
        <td<?= $Page->Unique_QR->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Unique_QR" class="el_volontaire_Unique_QR">
<span><?= PhpBarcode::barcode(true)->show($Page->Unique_QR->CurrentValue, 'QRCODE', 60) ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Delivree->Visible) { // Delivree ?>
        <td<?= $Page->Delivree->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Delivree" class="el_volontaire_Delivree">
<span<?= $Page->Delivree->viewAttributes() ?>>
<?= $Page->Delivree->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Expire->Visible) { // Expire ?>
        <td<?= $Page->Expire->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Expire" class="el_volontaire_Expire">
<span<?= $Page->Expire->viewAttributes() ?>>
<?= $Page->Expire->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Localite->Visible) { // Localite ?>
        <td<?= $Page->Localite->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Localite" class="el_volontaire_Localite">
<span<?= $Page->Localite->viewAttributes() ?>>
<?= $Page->Localite->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Statut->Visible) { // Statut ?>
        <td<?= $Page->Statut->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_volontaire_Statut" class="el_volontaire_Statut">
<span<?= $Page->Statut->viewAttributes() ?>>
<?= $Page->Statut->getViewValue() ?></span>
</span>
</td>
<?php } ?>
    </tr>
<?php
    $Page->Recordset->moveNext();
}
$Page->Recordset->close();
?>
</tbody>
</table>
</div>
</div>
<div class="ew-buttons ew-desktop-buttons">
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?= $Language->phrase("DeleteBtn") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?= HtmlEncode(GetUrl($Page->getReturnUrl())) ?>"><?= $Language->phrase("CancelBtn") ?></button>
</div>
</form>
<?php
$Page->showPageFooter();
echo GetDebugMessage();
?>
<script>
loadjs.ready("load", function () {
    // Write your table-specific startup script here, no need to add script tags.
});
</script>
<?php if (!$Page->IsModal && !$Page->isExport()) { ?>
<script>
loadjs.ready(["wrapper", "head", "swal"],function(){$('#btn-action').on('click',function(){if(fvolontairedelete.validateFields()){ew.prompt({title: ew.language.phrase("MessageDeleteConfirm"),icon:'question',showCancelButton:true},result=>{if(result) $("#fvolontairedelete").submit();});return false;} else { ew.prompt({title: ew.language.phrase("MessageInvalidForm"), icon: 'warning', showCancelButton:false}); }});});
</script>
<?php } ?>
