<?php

namespace PHPMaker2024\laundrytech;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("farticlesdelete")
        .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="farticlesdelete" id="farticlesdelete" 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="articles">
<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->articleid->Visible) { // articleid ?>
        <th class="<?= $Page->articleid->headerCellClass() ?>"><span id="elh_articles_articleid" class="articles_articleid"><?= $Page->articleid->caption() ?></span></th>
<?php } ?>
<?php if ($Page->articlename1->Visible) { // articlename1 ?>
        <th class="<?= $Page->articlename1->headerCellClass() ?>"><span id="elh_articles_articlename1" class="articles_articlename1"><?= $Page->articlename1->caption() ?></span></th>
<?php } ?>
<?php if ($Page->articlename2->Visible) { // articlename2 ?>
        <th class="<?= $Page->articlename2->headerCellClass() ?>"><span id="elh_articles_articlename2" class="articles_articlename2"><?= $Page->articlename2->caption() ?></span></th>
<?php } ?>
<?php if ($Page->categoryid->Visible) { // categoryid ?>
        <th class="<?= $Page->categoryid->headerCellClass() ?>"><span id="elh_articles_categoryid" class="articles_categoryid"><?= $Page->categoryid->caption() ?></span></th>
<?php } ?>
<?php if ($Page->weight->Visible) { // weight ?>
        <th class="<?= $Page->weight->headerCellClass() ?>"><span id="elh_articles_weight" class="articles_weight"><?= $Page->weight->caption() ?></span></th>
<?php } ?>
<?php if ($Page->owned->Visible) { // owned ?>
        <th class="<?= $Page->owned->headerCellClass() ?>"><span id="elh_articles_owned" class="articles_owned"><?= $Page->owned->caption() ?></span></th>
<?php } ?>
<?php if ($Page->customerId->Visible) { // customerId ?>
        <th class="<?= $Page->customerId->headerCellClass() ?>"><span id="elh_articles_customerId" class="articles_customerId"><?= $Page->customerId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->siteId->Visible) { // siteId ?>
        <th class="<?= $Page->siteId->headerCellClass() ?>"><span id="elh_articles_siteId" class="articles_siteId"><?= $Page->siteId->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->articleid->Visible) { // articleid ?>
        <td<?= $Page->articleid->cellAttributes() ?>>
<span id="">
<span<?= $Page->articleid->viewAttributes() ?>>
<?= $Page->articleid->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->articlename1->Visible) { // articlename1 ?>
        <td<?= $Page->articlename1->cellAttributes() ?>>
<span id="">
<span<?= $Page->articlename1->viewAttributes() ?>>
<?= $Page->articlename1->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->articlename2->Visible) { // articlename2 ?>
        <td<?= $Page->articlename2->cellAttributes() ?>>
<span id="">
<span<?= $Page->articlename2->viewAttributes() ?>>
<?= $Page->articlename2->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->categoryid->Visible) { // categoryid ?>
        <td<?= $Page->categoryid->cellAttributes() ?>>
<span id="">
<span<?= $Page->categoryid->viewAttributes() ?>>
<?= $Page->categoryid->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->weight->Visible) { // weight ?>
        <td<?= $Page->weight->cellAttributes() ?>>
<span id="">
<span<?= $Page->weight->viewAttributes() ?>>
<?= $Page->weight->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->owned->Visible) { // owned ?>
        <td<?= $Page->owned->cellAttributes() ?>>
<span id="">
<span<?= $Page->owned->viewAttributes() ?>>
<?= $Page->owned->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->siteId->Visible) { // siteId ?>
        <td<?= $Page->siteId->cellAttributes() ?>>
<span id="">
<span<?= $Page->siteId->viewAttributes() ?>>
<?= $Page->siteId->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>
