<?php

namespace PHPMaker2024\laundrytech;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("fdeliverynotedelete")
        .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="fdeliverynotedelete" id="fdeliverynotedelete" 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="deliverynote">
<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->dnoteID->Visible) { // dnoteID ?>
        <th class="<?= $Page->dnoteID->headerCellClass() ?>"><span id="elh_deliverynote_dnoteID" class="deliverynote_dnoteID"><?= $Page->dnoteID->caption() ?></span></th>
<?php } ?>
<?php if ($Page->orderId->Visible) { // orderId ?>
        <th class="<?= $Page->orderId->headerCellClass() ?>"><span id="elh_deliverynote_orderId" class="deliverynote_orderId"><?= $Page->orderId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->dnoteDate->Visible) { // dnoteDate ?>
        <th class="<?= $Page->dnoteDate->headerCellClass() ?>"><span id="elh_deliverynote_dnoteDate" class="deliverynote_dnoteDate"><?= $Page->dnoteDate->caption() ?></span></th>
<?php } ?>
<?php if ($Page->dnoteValue->Visible) { // dnoteValue ?>
        <th class="<?= $Page->dnoteValue->headerCellClass() ?>"><span id="elh_deliverynote_dnoteValue" class="deliverynote_dnoteValue"><?= $Page->dnoteValue->caption() ?></span></th>
<?php } ?>
<?php if ($Page->createdOn->Visible) { // createdOn ?>
        <th class="<?= $Page->createdOn->headerCellClass() ?>"><span id="elh_deliverynote_createdOn" class="deliverynote_createdOn"><?= $Page->createdOn->caption() ?></span></th>
<?php } ?>
<?php if ($Page->createdBy->Visible) { // createdBy ?>
        <th class="<?= $Page->createdBy->headerCellClass() ?>"><span id="elh_deliverynote_createdBy" class="deliverynote_createdBy"><?= $Page->createdBy->caption() ?></span></th>
<?php } ?>
<?php if ($Page->driverId->Visible) { // driverId ?>
        <th class="<?= $Page->driverId->headerCellClass() ?>"><span id="elh_deliverynote_driverId" class="deliverynote_driverId"><?= $Page->driverId->caption() ?></span></th>
<?php } ?>
<?php if ($Page->delivered->Visible) { // delivered ?>
        <th class="<?= $Page->delivered->headerCellClass() ?>"><span id="elh_deliverynote_delivered" class="deliverynote_delivered"><?= $Page->delivered->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->dnoteID->Visible) { // dnoteID ?>
        <td<?= $Page->dnoteID->cellAttributes() ?>>
<span id="">
<span<?= $Page->dnoteID->viewAttributes() ?>>
<?= $Page->dnoteID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?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->dnoteDate->Visible) { // dnoteDate ?>
        <td<?= $Page->dnoteDate->cellAttributes() ?>>
<span id="">
<span<?= $Page->dnoteDate->viewAttributes() ?>>
<?= $Page->dnoteDate->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->dnoteValue->Visible) { // dnoteValue ?>
        <td<?= $Page->dnoteValue->cellAttributes() ?>>
<span id="">
<span<?= $Page->dnoteValue->viewAttributes() ?>>
<?= $Page->dnoteValue->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->driverId->Visible) { // driverId ?>
        <td<?= $Page->driverId->cellAttributes() ?>>
<span id="">
<span<?= $Page->driverId->viewAttributes() ?>>
<?= $Page->driverId->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->delivered->Visible) { // delivered ?>
        <td<?= $Page->delivered->cellAttributes() ?>>
<span id="">
<span<?= $Page->delivered->viewAttributes() ?>>
<?= $Page->delivered->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>
