<?php

namespace PHPMaker2024\laundrytech;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("fordersdelete")
        .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="fordersdelete" id="fordersdelete" 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="orders">
<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->orderid->Visible) { // orderid ?>
        <th class="<?= $Page->orderid->headerCellClass() ?>"><span id="elh_orders_orderid" class="orders_orderid"><?= $Page->orderid->caption() ?></span></th>
<?php } ?>
<?php if ($Page->customerid->Visible) { // customerid ?>
        <th class="<?= $Page->customerid->headerCellClass() ?>"><span id="elh_orders_customerid" class="orders_customerid"><?= $Page->customerid->caption() ?></span></th>
<?php } ?>
<?php if ($Page->bookingdatetime->Visible) { // bookingdatetime ?>
        <th class="<?= $Page->bookingdatetime->headerCellClass() ?>"><span id="elh_orders_bookingdatetime" class="orders_bookingdatetime"><?= $Page->bookingdatetime->caption() ?></span></th>
<?php } ?>
<?php if ($Page->dueby->Visible) { // dueby ?>
        <th class="<?= $Page->dueby->headerCellClass() ?>"><span id="elh_orders_dueby" class="orders_dueby"><?= $Page->dueby->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ordertype->Visible) { // ordertype ?>
        <th class="<?= $Page->ordertype->headerCellClass() ?>"><span id="elh_orders_ordertype" class="orders_ordertype"><?= $Page->ordertype->caption() ?></span></th>
<?php } ?>
<?php if ($Page->invoiced->Visible) { // invoiced ?>
        <th class="<?= $Page->invoiced->headerCellClass() ?>"><span id="elh_orders_invoiced" class="orders_invoiced"><?= $Page->invoiced->caption() ?></span></th>
<?php } ?>
<?php if ($Page->paid->Visible) { // paid ?>
        <th class="<?= $Page->paid->headerCellClass() ?>"><span id="elh_orders_paid" class="orders_paid"><?= $Page->paid->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ordervalue->Visible) { // ordervalue ?>
        <th class="<?= $Page->ordervalue->headerCellClass() ?>"><span id="elh_orders_ordervalue" class="orders_ordervalue"><?= $Page->ordervalue->caption() ?></span></th>
<?php } ?>
<?php if ($Page->jobType->Visible) { // jobType ?>
        <th class="<?= $Page->jobType->headerCellClass() ?>"><span id="elh_orders_jobType" class="orders_jobType"><?= $Page->jobType->caption() ?></span></th>
<?php } ?>
<?php if ($Page->createdOn->Visible) { // createdOn ?>
        <th class="<?= $Page->createdOn->headerCellClass() ?>"><span id="elh_orders_createdOn" class="orders_createdOn"><?= $Page->createdOn->caption() ?></span></th>
<?php } ?>
<?php if ($Page->createdBy->Visible) { // createdBy ?>
        <th class="<?= $Page->createdBy->headerCellClass() ?>"><span id="elh_orders_createdBy" class="orders_createdBy"><?= $Page->createdBy->caption() ?></span></th>
<?php } ?>
<?php if ($Page->siteId->Visible) { // siteId ?>
        <th class="<?= $Page->siteId->headerCellClass() ?>"><span id="elh_orders_siteId" class="orders_siteId"><?= $Page->siteId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->pickupComplete->Visible) { // pickupComplete ?>
        <th class="<?= $Page->pickupComplete->headerCellClass() ?>"><span id="elh_orders_pickupComplete" class="orders_pickupComplete"><?= $Page->pickupComplete->caption() ?></span></th>
<?php } ?>
<?php if ($Page->pickupDatetime->Visible) { // pickupDatetime ?>
        <th class="<?= $Page->pickupDatetime->headerCellClass() ?>"><span id="elh_orders_pickupDatetime" class="orders_pickupDatetime"><?= $Page->pickupDatetime->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->orderid->Visible) { // orderid ?>
        <td<?= $Page->orderid->cellAttributes() ?>>
<span id="">
<span<?= $Page->orderid->viewAttributes() ?>>
<?= $Page->orderid->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->bookingdatetime->Visible) { // bookingdatetime ?>
        <td<?= $Page->bookingdatetime->cellAttributes() ?>>
<span id="">
<span<?= $Page->bookingdatetime->viewAttributes() ?>>
<?= $Page->bookingdatetime->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->dueby->Visible) { // dueby ?>
        <td<?= $Page->dueby->cellAttributes() ?>>
<span id="">
<span<?= $Page->dueby->viewAttributes() ?>>
<?= $Page->dueby->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ordertype->Visible) { // ordertype ?>
        <td<?= $Page->ordertype->cellAttributes() ?>>
<span id="">
<span<?= $Page->ordertype->viewAttributes() ?>>
<?= $Page->ordertype->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->invoiced->Visible) { // invoiced ?>
        <td<?= $Page->invoiced->cellAttributes() ?>>
<span id="">
<span<?= $Page->invoiced->viewAttributes() ?>>
<?= $Page->invoiced->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->paid->Visible) { // paid ?>
        <td<?= $Page->paid->cellAttributes() ?>>
<span id="">
<span<?= $Page->paid->viewAttributes() ?>>
<?= $Page->paid->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ordervalue->Visible) { // ordervalue ?>
        <td<?= $Page->ordervalue->cellAttributes() ?>>
<span id="">
<span<?= $Page->ordervalue->viewAttributes() ?>>
<?= $Page->ordervalue->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->jobType->Visible) { // jobType ?>
        <td<?= $Page->jobType->cellAttributes() ?>>
<span id="">
<span<?= $Page->jobType->viewAttributes() ?>>
<?= $Page->jobType->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->createdOn->Visible) { // createdOn ?>
        <td<?= $Page->createdOn->cellAttributes() ?>>
<span id="">
<span<?= $Page->createdOn->viewAttributes() ?>>
<?= $Page->createdOn->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->createdBy->Visible) { // createdBy ?>
        <td<?= $Page->createdBy->cellAttributes() ?>>
<span id="">
<span<?= $Page->createdBy->viewAttributes() ?>>
<?= $Page->createdBy->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 } ?>
<?php if ($Page->pickupComplete->Visible) { // pickupComplete ?>
        <td<?= $Page->pickupComplete->cellAttributes() ?>>
<span id="">
<span<?= $Page->pickupComplete->viewAttributes() ?>>
<?= $Page->pickupComplete->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->pickupDatetime->Visible) { // pickupDatetime ?>
        <td<?= $Page->pickupDatetime->cellAttributes() ?>>
<span id="">
<span<?= $Page->pickupDatetime->viewAttributes() ?>>
<?= $Page->pickupDatetime->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>
