<?php

namespace PHPMaker2024\laundrytech;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("fcustomersitesdelete")
        .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="fcustomersitesdelete" id="fcustomersitesdelete" class="ew-form ew-delete-form" action="<?= CurrentPageUrl(false) ?>" method="post" novalidate 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="customersites">
<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->siteId->Visible) { // siteId ?>
        <th class="<?= $Page->siteId->headerCellClass() ?>"><span id="elh_customersites_siteId" class="customersites_siteId"><?= $Page->siteId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->SiteName->Visible) { // SiteName ?>
        <th class="<?= $Page->SiteName->headerCellClass() ?>"><span id="elh_customersites_SiteName" class="customersites_SiteName"><?= $Page->SiteName->caption() ?></span></th>
<?php } ?>
<?php if ($Page->customerId->Visible) { // customerId ?>
        <th class="<?= $Page->customerId->headerCellClass() ?>"><span id="elh_customersites_customerId" class="customersites_customerId"><?= $Page->customerId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->address->Visible) { // address ?>
        <th class="<?= $Page->address->headerCellClass() ?>"><span id="elh_customersites_address" class="customersites_address"><?= $Page->address->caption() ?></span></th>
<?php } ?>
<?php if ($Page->city->Visible) { // city ?>
        <th class="<?= $Page->city->headerCellClass() ?>"><span id="elh_customersites_city" class="customersites_city"><?= $Page->city->caption() ?></span></th>
<?php } ?>
<?php if ($Page->postcode->Visible) { // postcode ?>
        <th class="<?= $Page->postcode->headerCellClass() ?>"><span id="elh_customersites_postcode" class="customersites_postcode"><?= $Page->postcode->caption() ?></span></th>
<?php } ?>
<?php if ($Page->country->Visible) { // country ?>
        <th class="<?= $Page->country->headerCellClass() ?>"><span id="elh_customersites_country" class="customersites_country"><?= $Page->country->caption() ?></span></th>
<?php } ?>
<?php if ($Page->phone1->Visible) { // phone1 ?>
        <th class="<?= $Page->phone1->headerCellClass() ?>"><span id="elh_customersites_phone1" class="customersites_phone1"><?= $Page->phone1->caption() ?></span></th>
<?php } ?>
<?php if ($Page->phone2->Visible) { // phone2 ?>
        <th class="<?= $Page->phone2->headerCellClass() ?>"><span id="elh_customersites_phone2" class="customersites_phone2"><?= $Page->phone2->caption() ?></span></th>
<?php } ?>
<?php if ($Page->emailaddress->Visible) { // emailaddress ?>
        <th class="<?= $Page->emailaddress->headerCellClass() ?>"><span id="elh_customersites_emailaddress" class="customersites_emailaddress"><?= $Page->emailaddress->caption() ?></span></th>
<?php } ?>
    </tr>
    </thead>
    <tbody>
<?php
$Page->RecordCount = 0;
$i = 0;
while ($Page->fetch()) {
    $Page->RecordCount++;
    $Page->RowCount++;

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

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

    // Render row
    $Page->renderRow();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php if ($Page->siteId->Visible) { // siteId ?>
        <td<?= $Page->siteId->cellAttributes() ?>>
<span id="">
<span<?= $Page->siteId->viewAttributes() ?>>
<?= $Page->siteId->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->SiteName->Visible) { // SiteName ?>
        <td<?= $Page->SiteName->cellAttributes() ?>>
<span id="">
<span<?= $Page->SiteName->viewAttributes() ?>>
<?= $Page->SiteName->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->customerId->Visible) { // customerId ?>
        <td<?= $Page->customerId->cellAttributes() ?>>
<span id="">
<span<?= $Page->customerId->viewAttributes() ?>>
<?= $Page->customerId->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->address->Visible) { // address ?>
        <td<?= $Page->address->cellAttributes() ?>>
<span id="">
<span<?= $Page->address->viewAttributes() ?>>
<?= $Page->address->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->city->Visible) { // city ?>
        <td<?= $Page->city->cellAttributes() ?>>
<span id="">
<span<?= $Page->city->viewAttributes() ?>>
<?= $Page->city->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->postcode->Visible) { // postcode ?>
        <td<?= $Page->postcode->cellAttributes() ?>>
<span id="">
<span<?= $Page->postcode->viewAttributes() ?>>
<?= $Page->postcode->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->country->Visible) { // country ?>
        <td<?= $Page->country->cellAttributes() ?>>
<span id="">
<span<?= $Page->country->viewAttributes() ?>>
<?= $Page->country->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->phone1->Visible) { // phone1 ?>
        <td<?= $Page->phone1->cellAttributes() ?>>
<span id="">
<span<?= $Page->phone1->viewAttributes() ?>>
<?= $Page->phone1->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->phone2->Visible) { // phone2 ?>
        <td<?= $Page->phone2->cellAttributes() ?>>
<span id="">
<span<?= $Page->phone2->viewAttributes() ?>>
<?= $Page->phone2->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->emailaddress->Visible) { // emailaddress ?>
        <td<?= $Page->emailaddress->cellAttributes() ?>>
<span id="">
<span<?= $Page->emailaddress->viewAttributes() ?>>
<?= $Page->emailaddress->getViewValue() ?></span>
</span>
</td>
<?php } ?>
    </tr>
<?php
}
$Page->Recordset?->free();
?>
</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>
