<?php

namespace ProjectManagement\prjProjectManagement;

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

    // Form object
    let form = new ew.FormBuilder()
        .setId("fmasterprojectdelete")
        .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="fmasterprojectdelete" id="fmasterprojectdelete" 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="masterproject">
<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->ProjectName->Visible) { // ProjectName ?>
        <th class="<?= $Page->ProjectName->headerCellClass() ?>"><span id="elh_masterproject_ProjectName" class="masterproject_ProjectName"><?= $Page->ProjectName->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { // PlanStart ?>
        <th class="<?= $Page->PlanStart->headerCellClass() ?>"><span id="elh_masterproject_PlanStart" class="masterproject_PlanStart"><?= $Page->PlanStart->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { // PlanEnd ?>
        <th class="<?= $Page->PlanEnd->headerCellClass() ?>"><span id="elh_masterproject_PlanEnd" class="masterproject_PlanEnd"><?= $Page->PlanEnd->caption() ?></span></th>
<?php } ?>
<?php if ($Page->StartDate->Visible) { // StartDate ?>
        <th class="<?= $Page->StartDate->headerCellClass() ?>"><span id="elh_masterproject_StartDate" class="masterproject_StartDate"><?= $Page->StartDate->caption() ?></span></th>
<?php } ?>
<?php if ($Page->EndDate->Visible) { // EndDate ?>
        <th class="<?= $Page->EndDate->headerCellClass() ?>"><span id="elh_masterproject_EndDate" class="masterproject_EndDate"><?= $Page->EndDate->caption() ?></span></th>
<?php } ?>
<?php if ($Page->WarrantyEnd->Visible) { // WarrantyEnd ?>
        <th class="<?= $Page->WarrantyEnd->headerCellClass() ?>"><span id="elh_masterproject_WarrantyEnd" class="masterproject_WarrantyEnd"><?= $Page->WarrantyEnd->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Status->Visible) { // Status ?>
        <th class="<?= $Page->Status->headerCellClass() ?>"><span id="elh_masterproject_Status" class="masterproject_Status"><?= $Page->Status->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Progress->Visible) { // Progress ?>
        <th class="<?= $Page->Progress->headerCellClass() ?>"><span id="elh_masterproject_Progress" class="masterproject_Progress"><?= $Page->Progress->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Target->Visible) { // Target ?>
        <th class="<?= $Page->Target->headerCellClass() ?>"><span id="elh_masterproject_Target" class="masterproject_Target"><?= $Page->Target->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Track->Visible) { // Track ?>
        <th class="<?= $Page->Track->headerCellClass() ?>"><span id="elh_masterproject_Track" class="masterproject_Track"><?= $Page->Track->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PaymentProgress->Visible) { // PaymentProgress ?>
        <th class="<?= $Page->PaymentProgress->headerCellClass() ?>"><span id="elh_masterproject_PaymentProgress" class="masterproject_PaymentProgress"><?= $Page->PaymentProgress->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PaymentDate->Visible) { // PaymentDate ?>
        <th class="<?= $Page->PaymentDate->headerCellClass() ?>"><span id="elh_masterproject_PaymentDate" class="masterproject_PaymentDate"><?= $Page->PaymentDate->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PaymentComplete->Visible) { // PaymentComplete ?>
        <th class="<?= $Page->PaymentComplete->headerCellClass() ?>"><span id="elh_masterproject_PaymentComplete" class="masterproject_PaymentComplete"><?= $Page->PaymentComplete->caption() ?></span></th>
<?php } ?>
<?php if ($Page->AgingPayment->Visible) { // AgingPayment ?>
        <th class="<?= $Page->AgingPayment->headerCellClass() ?>"><span id="elh_masterproject_AgingPayment" class="masterproject_AgingPayment"><?= $Page->AgingPayment->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ClientID->Visible) { // ClientID ?>
        <th class="<?= $Page->ClientID->headerCellClass() ?>"><span id="elh_masterproject_ClientID" class="masterproject_ClientID"><?= $Page->ClientID->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ManagerID->Visible) { // ManagerID ?>
        <th class="<?= $Page->ManagerID->headerCellClass() ?>"><span id="elh_masterproject_ManagerID" class="masterproject_ManagerID"><?= $Page->ManagerID->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ProjectTemplateID->Visible) { // ProjectTemplateID ?>
        <th class="<?= $Page->ProjectTemplateID->headerCellClass() ?>"><span id="elh_masterproject_ProjectTemplateID" class="masterproject_ProjectTemplateID"><?= $Page->ProjectTemplateID->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Priority->Visible) { // Priority ?>
        <th class="<?= $Page->Priority->headerCellClass() ?>"><span id="elh_masterproject_Priority" class="masterproject_Priority"><?= $Page->Priority->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ProjectValue->Visible) { // ProjectValue ?>
        <th class="<?= $Page->ProjectValue->headerCellClass() ?>"><span id="elh_masterproject_ProjectValue" class="masterproject_ProjectValue"><?= $Page->ProjectValue->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ProjectDebt->Visible) { // ProjectDebt ?>
        <th class="<?= $Page->ProjectDebt->headerCellClass() ?>"><span id="elh_masterproject_ProjectDebt" class="masterproject_ProjectDebt"><?= $Page->ProjectDebt->caption() ?></span></th>
<?php } ?>
<?php if ($Page->PONumber->Visible) { // PONumber ?>
        <th class="<?= $Page->PONumber->headerCellClass() ?>"><span id="elh_masterproject_PONumber" class="masterproject_PONumber"><?= $Page->PONumber->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ClearingDate->Visible) { // ClearingDate ?>
        <th class="<?= $Page->ClearingDate->headerCellClass() ?>"><span id="elh_masterproject_ClearingDate" class="masterproject_ClearingDate"><?= $Page->ClearingDate->caption() ?></span></th>
<?php } ?>
<?php if ($Page->ClearingAging->Visible) { // ClearingAging ?>
        <th class="<?= $Page->ClearingAging->headerCellClass() ?>"><span id="elh_masterproject_ClearingAging" class="masterproject_ClearingAging"><?= $Page->ClearingAging->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Active->Visible) { // Active ?>
        <th class="<?= $Page->Active->headerCellClass() ?>"><span id="elh_masterproject_Active" class="masterproject_Active"><?= $Page->Active->caption() ?></span></th>
<?php } ?>
<?php if ($Page->Created_Date->Visible) { // Created_Date ?>
        <th class="<?= $Page->Created_Date->headerCellClass() ?>"><span id="elh_masterproject_Created_Date" class="masterproject_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_masterproject_Created_By" class="masterproject_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_masterproject_Last_Updated_Date" class="masterproject_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_masterproject_Last_Updated_By" class="masterproject_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->ProjectName->Visible) { // ProjectName ?>
        <td<?= $Page->ProjectName->cellAttributes() ?>>
<span id="">
<span<?= $Page->ProjectName->viewAttributes() ?>>
<?= $Page->ProjectName->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PlanStart->Visible) { // PlanStart ?>
        <td<?= $Page->PlanStart->cellAttributes() ?>>
<span id="">
<span<?= $Page->PlanStart->viewAttributes() ?>>
<?= $Page->PlanStart->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PlanEnd->Visible) { // PlanEnd ?>
        <td<?= $Page->PlanEnd->cellAttributes() ?>>
<span id="">
<span<?= $Page->PlanEnd->viewAttributes() ?>>
<?= $Page->PlanEnd->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->StartDate->Visible) { // StartDate ?>
        <td<?= $Page->StartDate->cellAttributes() ?>>
<span id="">
<span<?= $Page->StartDate->viewAttributes() ?>>
<?= $Page->StartDate->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->EndDate->Visible) { // EndDate ?>
        <td<?= $Page->EndDate->cellAttributes() ?>>
<span id="">
<span<?= $Page->EndDate->viewAttributes() ?>>
<?= $Page->EndDate->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->WarrantyEnd->Visible) { // WarrantyEnd ?>
        <td<?= $Page->WarrantyEnd->cellAttributes() ?>>
<span id="">
<span<?= $Page->WarrantyEnd->viewAttributes() ?>>
<?= $Page->WarrantyEnd->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Status->Visible) { // Status ?>
        <td<?= $Page->Status->cellAttributes() ?>>
<span id="">
<span<?= $Page->Status->viewAttributes() ?>>
<?= $Page->Status->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Progress->Visible) { // Progress ?>
        <td<?= $Page->Progress->cellAttributes() ?>>
<span id="">
<span<?= $Page->Progress->viewAttributes() ?>>
<?= $Page->Progress->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Target->Visible) { // Target ?>
        <td<?= $Page->Target->cellAttributes() ?>>
<span id="">
<span<?= $Page->Target->viewAttributes() ?>>
<?= $Page->Target->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Track->Visible) { // Track ?>
        <td<?= $Page->Track->cellAttributes() ?>>
<span id="">
<span<?= $Page->Track->viewAttributes() ?>>
<?= $Page->Track->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PaymentProgress->Visible) { // PaymentProgress ?>
        <td<?= $Page->PaymentProgress->cellAttributes() ?>>
<span id="">
<span<?= $Page->PaymentProgress->viewAttributes() ?>>
<?= $Page->PaymentProgress->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PaymentDate->Visible) { // PaymentDate ?>
        <td<?= $Page->PaymentDate->cellAttributes() ?>>
<span id="">
<span<?= $Page->PaymentDate->viewAttributes() ?>>
<?= $Page->PaymentDate->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PaymentComplete->Visible) { // PaymentComplete ?>
        <td<?= $Page->PaymentComplete->cellAttributes() ?>>
<span id="">
<span<?= $Page->PaymentComplete->viewAttributes() ?>>
<?= $Page->PaymentComplete->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->AgingPayment->Visible) { // AgingPayment ?>
        <td<?= $Page->AgingPayment->cellAttributes() ?>>
<span id="">
<span<?= $Page->AgingPayment->viewAttributes() ?>>
<?= $Page->AgingPayment->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ClientID->Visible) { // ClientID ?>
        <td<?= $Page->ClientID->cellAttributes() ?>>
<span id="">
<span<?= $Page->ClientID->viewAttributes() ?>>
<?= $Page->ClientID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ManagerID->Visible) { // ManagerID ?>
        <td<?= $Page->ManagerID->cellAttributes() ?>>
<span id="">
<span<?= $Page->ManagerID->viewAttributes() ?>>
<?= $Page->ManagerID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ProjectTemplateID->Visible) { // ProjectTemplateID ?>
        <td<?= $Page->ProjectTemplateID->cellAttributes() ?>>
<span id="">
<span<?= $Page->ProjectTemplateID->viewAttributes() ?>>
<?= $Page->ProjectTemplateID->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->Priority->Visible) { // Priority ?>
        <td<?= $Page->Priority->cellAttributes() ?>>
<span id="">
<span<?= $Page->Priority->viewAttributes() ?>>
<?= $Page->Priority->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ProjectValue->Visible) { // ProjectValue ?>
        <td<?= $Page->ProjectValue->cellAttributes() ?>>
<span id="">
<span<?= $Page->ProjectValue->viewAttributes() ?>>
<?= $Page->ProjectValue->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ProjectDebt->Visible) { // ProjectDebt ?>
        <td<?= $Page->ProjectDebt->cellAttributes() ?>>
<span id="">
<span<?= $Page->ProjectDebt->viewAttributes() ?>>
<?= $Page->ProjectDebt->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->PONumber->Visible) { // PONumber ?>
        <td<?= $Page->PONumber->cellAttributes() ?>>
<span id="">
<span<?= $Page->PONumber->viewAttributes() ?>>
<?= $Page->PONumber->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ClearingDate->Visible) { // ClearingDate ?>
        <td<?= $Page->ClearingDate->cellAttributes() ?>>
<span id="">
<span<?= $Page->ClearingDate->viewAttributes() ?>>
<?= $Page->ClearingDate->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->ClearingAging->Visible) { // ClearingAging ?>
        <td<?= $Page->ClearingAging->cellAttributes() ?>>
<span id="">
<span<?= $Page->ClearingAging->viewAttributes() ?>>
<?= $Page->ClearingAging->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>
