<?php

namespace PHPMaker2021\rdigital21;

// Page object
$ProyekDelete = &$Page;
?>
<script>
var currentForm, currentPageID;
var fproyekdelete;
loadjs.ready("head", function () {
    var $ = jQuery;
    // Form object
    currentPageID = ew.PAGE_ID = "delete";
    fproyekdelete = currentForm = new ew.Form("fproyekdelete", "delete");
    loadjs.done("fproyekdelete");
});
</script>
<script>
loadjs.ready("head", function () {
    // Write your table-specific client script here, no need to add script tags.
});
</script>
<script>
if (!ew.vars.tables.proyek) ew.vars.tables.proyek = <?= JsonEncode(GetClientVar("tables", "proyek")) ?>;
</script>
<?php $Page->showPageHeader(); ?>
<?php
$Page->showMessage();
?>
<form name="fproyekdelete" id="fproyekdelete" class="form-inline ew-form ew-delete-form" action="<?= CurrentPageUrl(false) ?>" method="post">
<?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="proyek">
<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">
<div class="<?= ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<table class="table ew-table">
    <thead>
    <tr class="ew-table-header">
<?php if ($Page->tahun_pelajaran->Visible) { // tahun_pelajaran ?>
        <th class="<?= $Page->tahun_pelajaran->headerCellClass() ?>"><span id="elh_proyek_tahun_pelajaran" class="proyek_tahun_pelajaran"><?= $Page->tahun_pelajaran->caption() ?></span></th>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
        <th class="<?= $Page->kelas->headerCellClass() ?>"><span id="elh_proyek_kelas" class="proyek_kelas"><?= $Page->kelas->caption() ?></span></th>
<?php } ?>
<?php if ($Page->project->Visible) { // project ?>
        <th class="<?= $Page->project->headerCellClass() ?>"><span id="elh_proyek_project" class="proyek_project"><?= $Page->project->caption() ?></span></th>
<?php } ?>
<?php if ($Page->nama_proyek->Visible) { // nama_proyek ?>
        <th class="<?= $Page->nama_proyek->headerCellClass() ?>"><span id="elh_proyek_nama_proyek" class="proyek_nama_proyek"><?= $Page->nama_proyek->caption() ?></span></th>
<?php } ?>
<?php if ($Page->tema->Visible) { // tema ?>
        <th class="<?= $Page->tema->headerCellClass() ?>"><span id="elh_proyek_tema" class="proyek_tema"><?= $Page->tema->caption() ?></span></th>
<?php } ?>
<?php if ($Page->dimensi->Visible) { // dimensi ?>
        <th class="<?= $Page->dimensi->headerCellClass() ?>"><span id="elh_proyek_dimensi" class="proyek_dimensi"><?= $Page->dimensi->caption() ?></span></th>
<?php } ?>
    </tr>
    </thead>
    <tbody>
<?php
$Page->RecordCount = 0;
$i = 0;
while (!$Page->Recordset->EOF) {
    $Page->RecordCount++;
    $Page->RowCount++;

    // Set row properties
    $Page->resetAttributes();
    $Page->RowType = ROWTYPE_VIEW; // View

    // Get the field contents
    $Page->loadRowValues($Page->Recordset);

    // Render row
    $Page->renderRow();
?>
    <tr <?= $Page->rowAttributes() ?>>
<?php if ($Page->tahun_pelajaran->Visible) { // tahun_pelajaran ?>
        <td <?= $Page->tahun_pelajaran->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_tahun_pelajaran" class="proyek_tahun_pelajaran">
<span<?= $Page->tahun_pelajaran->viewAttributes() ?>>
<?= $Page->tahun_pelajaran->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->kelas->Visible) { // kelas ?>
        <td <?= $Page->kelas->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_kelas" class="proyek_kelas">
<span<?= $Page->kelas->viewAttributes() ?>>
<?= $Page->kelas->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->project->Visible) { // project ?>
        <td <?= $Page->project->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_project" class="proyek_project">
<span<?= $Page->project->viewAttributes() ?>>
<?= $Page->project->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->nama_proyek->Visible) { // nama_proyek ?>
        <td <?= $Page->nama_proyek->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_nama_proyek" class="proyek_nama_proyek">
<span<?= $Page->nama_proyek->viewAttributes() ?>>
<?= $Page->nama_proyek->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->tema->Visible) { // tema ?>
        <td <?= $Page->tema->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_tema" class="proyek_tema">
<span<?= $Page->tema->viewAttributes() ?>>
<?= $Page->tema->getViewValue() ?></span>
</span>
</td>
<?php } ?>
<?php if ($Page->dimensi->Visible) { // dimensi ?>
        <td <?= $Page->dimensi->cellAttributes() ?>>
<span id="el<?= $Page->RowCount ?>_proyek_dimensi" class="proyek_dimensi">
<span<?= $Page->dimensi->viewAttributes() ?>><?php
 $project_id=$proyek->project_id->getViewValue();
 $gdimensi=ExecuteScalar("SELECT dimensi FROM proyek where project_id='$project_id'");
 echo count($dimensi=explode(",",$gdimensi))." Dimensi"; 
?>
</span>
</span>
</td>
<?php } ?>
    </tr>
<?php
    $Page->Recordset->moveNext();
}
$Page->Recordset->close();
?>
</tbody>
</table>
</div>
</div>
<div>
<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>
