<?php

namespace ProjectManagement\prjProjectManagement;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("fmasteruserdelete")
        .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="fmasteruserdelete" id="fmasteruserdelete" class="ew-form ew-delete-form" action="<?= CurrentPageUrl(false) ?>" method="post" 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="masteruser">
<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->FirstName->Visible) { // FirstName ?>
        <th class="<?= $Page->FirstName->headerCellClass() ?>"><span id="elh_masteruser_FirstName" class="masteruser_FirstName"><?= $Page->FirstName->caption() ?></span></th>
<?php } ?>
<?php if ($Page->LastName->Visible) { // LastName ?>
        <th class="<?= $Page->LastName->headerCellClass() ?>"><span id="elh_masteruser_LastName" class="masteruser_LastName"><?= $Page->LastName->caption() ?></span></th>
<?php } ?>
<?php if ($Page->FullName->Visible) { // FullName ?>
        <th class="<?= $Page->FullName->headerCellClass() ?>"><span id="elh_masteruser_FullName" class="masteruser_FullName"><?= $Page->FullName->caption() ?></span></th>
<?php } ?>
<?php if ($Page->_Username->Visible) { // Username ?>
        <th class="<?= $Page->_Username->headerCellClass() ?>"><span id="elh_masteruser__Username" class="masteruser__Username"><?= $Page->_Username->caption() ?></span></th>
<?php } ?>
<?php if ($Page->UserPassword->Visible) { // UserPassword ?>
        <th class="<?= $Page->UserPassword->headerCellClass() ?>"><span id="elh_masteruser_UserPassword" class="masteruser_UserPassword"><?= $Page->UserPassword->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Level->Visible) { // Level ?>
        <th class="<?= $Page->Level->headerCellClass() ?>"><span id="elh_masteruser_Level" class="masteruser_Level"><?= $Page->Level->caption() ?></span></th>
<?php } ?>
<?php if ($Page->_Email->Visible) { // Email ?>
        <th class="<?= $Page->_Email->headerCellClass() ?>"><span id="elh_masteruser__Email" class="masteruser__Email"><?= $Page->_Email->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Position->Visible) { // Position ?>
        <th class="<?= $Page->Position->headerCellClass() ?>"><span id="elh_masteruser_Position" class="masteruser_Position"><?= $Page->Position->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Department->Visible) { // Department ?>
        <th class="<?= $Page->Department->headerCellClass() ?>"><span id="elh_masteruser_Department" class="masteruser_Department"><?= $Page->Department->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Employee->Visible) { // Employee ?>
        <th class="<?= $Page->Employee->headerCellClass() ?>"><span id="elh_masteruser_Employee" class="masteruser_Employee"><?= $Page->Employee->caption() ?></span></th>
<?php } ?>
<?php if ($Page->WhatsAppNumber->Visible) { // WhatsAppNumber ?>
        <th class="<?= $Page->WhatsAppNumber->headerCellClass() ?>"><span id="elh_masteruser_WhatsAppNumber" class="masteruser_WhatsAppNumber"><?= $Page->WhatsAppNumber->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Active->Visible) { // Active ?>
        <th class="<?= $Page->Active->headerCellClass() ?>"><span id="elh_masteruser_Active" class="masteruser_Active"><?= $Page->Active->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <th class="<?= $Page->Created_Date->headerCellClass() ?>"><span id="elh_masteruser_Created_Date" class="masteruser_Created_Date"><?= $Page->Created_Date->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
        <th class="<?= $Page->Created_By->headerCellClass() ?>"><span id="elh_masteruser_Created_By" class="masteruser_Created_By"><?= $Page->Created_By->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
        <th class="<?= $Page->Last_Updated_Date->headerCellClass() ?>"><span id="elh_masteruser_Last_Updated_Date" class="masteruser_Last_Updated_Date"><?= $Page->Last_Updated_Date->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
        <th class="<?= $Page->Last_Updated_By->headerCellClass() ?>"><span id="elh_masteruser_Last_Updated_By" class="masteruser_Last_Updated_By"><?= $Page->Last_Updated_By->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->FirstName->Visible) { // FirstName ?>
        <td<?= $Page->FirstName->cellAttributes() ?>>
<span id="">
<span<?= $Page->FirstName->viewAttributes() ?>>
<?= $Page->FirstName->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->LastName->Visible) { // LastName ?>
        <td<?= $Page->LastName->cellAttributes() ?>>
<span id="">
<span<?= $Page->LastName->viewAttributes() ?>>
<?= $Page->LastName->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->FullName->Visible) { // FullName ?>
        <td<?= $Page->FullName->cellAttributes() ?>>
<span id="">
<span<?= $Page->FullName->viewAttributes() ?>>
<?= $Page->FullName->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->_Username->Visible) { // Username ?>
        <td<?= $Page->_Username->cellAttributes() ?>>
<span id="">
<span<?= $Page->_Username->viewAttributes() ?>>
<?= $Page->_Username->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->UserPassword->Visible) { // UserPassword ?>
        <td<?= $Page->UserPassword->cellAttributes() ?>>
<span id="">
<span<?= $Page->UserPassword->viewAttributes() ?>>
<?= $Page->UserPassword->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Level->Visible) { // Level ?>
        <td<?= $Page->Level->cellAttributes() ?>>
<span id="">
<span<?= $Page->Level->viewAttributes() ?>>
<?= $Page->Level->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->_Email->Visible) { // Email ?>
        <td<?= $Page->_Email->cellAttributes() ?>>
<span id="">
<span<?= $Page->_Email->viewAttributes() ?>>
<?= $Page->_Email->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Position->Visible) { // Position ?>
        <td<?= $Page->Position->cellAttributes() ?>>
<span id="">
<span<?= $Page->Position->viewAttributes() ?>>
<?= $Page->Position->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Department->Visible) { // Department ?>
        <td<?= $Page->Department->cellAttributes() ?>>
<span id="">
<span<?= $Page->Department->viewAttributes() ?>>
<?= $Page->Department->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Employee->Visible) { // Employee ?>
        <td<?= $Page->Employee->cellAttributes() ?>>
<span id="">
<span<?= $Page->Employee->viewAttributes() ?>>
<i class="fa-regular fa-square<?php if (ConvertToBool($Page->Employee->CurrentValue)) { ?>-check<?php } ?> ew-icon ew-boolean"></i>
</span>
</span>
</td>
<?php } ?>
<?php if ($Page->WhatsAppNumber->Visible) { // WhatsAppNumber ?>
        <td<?= $Page->WhatsAppNumber->cellAttributes() ?>>
<span id="">
<span<?= $Page->WhatsAppNumber->viewAttributes() ?>>
<?= $Page->WhatsAppNumber->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Active->Visible) { // Active ?>
        <td<?= $Page->Active->cellAttributes() ?>>
<span id="">
<span<?= $Page->Active->viewAttributes() ?>>
<i class="fa-regular fa-square<?php if (ConvertToBool($Page->Active->CurrentValue)) { ?>-check<?php } ?> ew-icon ew-boolean"></i>
</span>
</span>
</td>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <td<?= $Page->Created_Date->cellAttributes() ?>>
<span id="">
<span<?= $Page->Created_Date->viewAttributes() ?>>
<?= $Page->Created_Date->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Created_By->Visible) { // Created_By ?>
        <td<?= $Page->Created_By->cellAttributes() ?>>
<span id="">
<span<?= $Page->Created_By->viewAttributes() ?>>
<?= $Page->Created_By->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Last_Updated_Date->Visible) { // Last_Updated_Date ?>
        <td<?= $Page->Last_Updated_Date->cellAttributes() ?>>
<span id="">
<span<?= $Page->Last_Updated_Date->viewAttributes() ?>>
<?= $Page->Last_Updated_Date->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Last_Updated_By->Visible) { // Last_Updated_By ?>
        <td<?= $Page->Last_Updated_By->cellAttributes() ?>>
<span id="">
<span<?= $Page->Last_Updated_By->viewAttributes() ?>>
<?= $Page->Last_Updated_By->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>
