<?php
namespace PHPMaker2020\hostelmgr20;

// Session
if (session_status() !== PHP_SESSION_ACTIVE)
	session_start(); // Init session data

// Output buffering
ob_start();

// Autoload
include_once "autoload.php";
?>
<?php

// Write header
WriteHeader(FALSE);

// Create page object
$reswardens_list = new reswardens_list();

// Run the page
$reswardens_list->run();

// Setup login status
SetupLoginStatus();
SetClientVar("login", LoginStatus());

// Global Page Rendering event (in userfn*.php)
Page_Rendering();

// Page Rendering event
$reswardens_list->Page_Render();
?>
<?php include_once "header.php"; ?>
<?php if (!$reswardens_list->isExport()) { ?>
<script>
var freswardenslist, currentPageID;
loadjs.ready("head", function() {

	// Form object
	currentPageID = ew.PAGE_ID = "list";
	freswardenslist = currentForm = new ew.Form("freswardenslist", "list");
	freswardenslist.formKeyCountName = '<?php echo $reswardens_list->FormKeyCountName ?>';
	loadjs.done("freswardenslist");
});
</script>
<script>
loadjs.ready("head", function() {

	// Client script
	// Write your client script here, no need to add script tags.

});
</script>
<?php } ?>
<?php if (!$reswardens_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($reswardens_list->TotalRecords > 0 && $reswardens_list->ExportOptions->visible()) { ?>
<?php $reswardens_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($reswardens_list->ImportOptions->visible()) { ?>
<?php $reswardens_list->ImportOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$reswardens_list->renderOtherOptions();
?>
<?php $reswardens_list->showPageHeader(); ?>
<?php
$reswardens_list->showMessage();
?>
<?php if ($reswardens_list->TotalRecords > 0 || $reswardens->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($reswardens_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> reswardens">
<?php if (!$reswardens_list->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$reswardens_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $reswardens_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $reswardens_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="freswardenslist" id="freswardenslist" class="form-inline ew-form ew-list-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($Page->CheckToken) { ?>
<input type="hidden" name="<?php echo Config("TOKEN_NAME") ?>" value="<?php echo $Page->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="reswardens">
<div id="gmp_reswardens" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($reswardens_list->TotalRecords > 0 || $reswardens_list->isGridEdit()) { ?>
<table id="tbl_reswardenslist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

// Header row
$reswardens->RowType = ROWTYPE_HEADER;

// Render list options
$reswardens_list->renderListOptions();

// Render list options (header, left)
$reswardens_list->ListOptions->render("header", "left");
?>
<?php if ($reswardens_list->id->Visible) { // id ?>
	<?php if ($reswardens_list->SortUrl($reswardens_list->id) == "") { ?>
		<th data-name="id" class="<?php echo $reswardens_list->id->headerCellClass() ?>"><div id="elh_reswardens_id" class="reswardens_id"><div class="ew-table-header-caption"><?php echo $reswardens_list->id->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id" class="<?php echo $reswardens_list->id->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $reswardens_list->SortUrl($reswardens_list->id) ?>', 1);"><div id="elh_reswardens_id" class="reswardens_id">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $reswardens_list->id->caption() ?></span><span class="ew-table-header-sort"><?php if ($reswardens_list->id->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($reswardens_list->id->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($reswardens_list->Hostel->Visible) { // Hostel ?>
	<?php if ($reswardens_list->SortUrl($reswardens_list->Hostel) == "") { ?>
		<th data-name="Hostel" class="<?php echo $reswardens_list->Hostel->headerCellClass() ?>"><div id="elh_reswardens_Hostel" class="reswardens_Hostel"><div class="ew-table-header-caption"><?php echo $reswardens_list->Hostel->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Hostel" class="<?php echo $reswardens_list->Hostel->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $reswardens_list->SortUrl($reswardens_list->Hostel) ?>', 1);"><div id="elh_reswardens_Hostel" class="reswardens_Hostel">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $reswardens_list->Hostel->caption() ?></span><span class="ew-table-header-sort"><?php if ($reswardens_list->Hostel->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($reswardens_list->Hostel->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($reswardens_list->Floor->Visible) { // Floor ?>
	<?php if ($reswardens_list->SortUrl($reswardens_list->Floor) == "") { ?>
		<th data-name="Floor" class="<?php echo $reswardens_list->Floor->headerCellClass() ?>"><div id="elh_reswardens_Floor" class="reswardens_Floor"><div class="ew-table-header-caption"><?php echo $reswardens_list->Floor->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Floor" class="<?php echo $reswardens_list->Floor->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $reswardens_list->SortUrl($reswardens_list->Floor) ?>', 1);"><div id="elh_reswardens_Floor" class="reswardens_Floor">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $reswardens_list->Floor->caption() ?></span><span class="ew-table-header-sort"><?php if ($reswardens_list->Floor->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($reswardens_list->Floor->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($reswardens_list->ResWarden->Visible) { // ResWarden ?>
	<?php if ($reswardens_list->SortUrl($reswardens_list->ResWarden) == "") { ?>
		<th data-name="ResWarden" class="<?php echo $reswardens_list->ResWarden->headerCellClass() ?>"><div id="elh_reswardens_ResWarden" class="reswardens_ResWarden"><div class="ew-table-header-caption"><?php echo $reswardens_list->ResWarden->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="ResWarden" class="<?php echo $reswardens_list->ResWarden->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $reswardens_list->SortUrl($reswardens_list->ResWarden) ?>', 1);"><div id="elh_reswardens_ResWarden" class="reswardens_ResWarden">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $reswardens_list->ResWarden->caption() ?></span><span class="ew-table-header-sort"><?php if ($reswardens_list->ResWarden->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($reswardens_list->ResWarden->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

// Render list options (header, right)
$reswardens_list->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
if ($reswardens_list->ExportAll && $reswardens_list->isExport()) {
	$reswardens_list->StopRecord = $reswardens_list->TotalRecords;
} else {

	// Set the last record to display
	if ($reswardens_list->TotalRecords > $reswardens_list->StartRecord + $reswardens_list->DisplayRecords - 1)
		$reswardens_list->StopRecord = $reswardens_list->StartRecord + $reswardens_list->DisplayRecords - 1;
	else
		$reswardens_list->StopRecord = $reswardens_list->TotalRecords;
}
$reswardens_list->RecordCount = $reswardens_list->StartRecord - 1;
if ($reswardens_list->Recordset && !$reswardens_list->Recordset->EOF) {
	$reswardens_list->Recordset->moveFirst();
	$selectLimit = $reswardens_list->UseSelectLimit;
	if (!$selectLimit && $reswardens_list->StartRecord > 1)
		$reswardens_list->Recordset->move($reswardens_list->StartRecord - 1);
} elseif (!$reswardens->AllowAddDeleteRow && $reswardens_list->StopRecord == 0) {
	$reswardens_list->StopRecord = $reswardens->GridAddRowCount;
}

// Initialize aggregate
$reswardens->RowType = ROWTYPE_AGGREGATEINIT;
$reswardens->resetAttributes();
$reswardens_list->renderRow();
while ($reswardens_list->RecordCount < $reswardens_list->StopRecord) {
	$reswardens_list->RecordCount++;
	if ($reswardens_list->RecordCount >= $reswardens_list->StartRecord) {
		$reswardens_list->RowCount++;

		// Set up key count
		$reswardens_list->KeyCount = $reswardens_list->RowIndex;

		// Init row class and style
		$reswardens->resetAttributes();
		$reswardens->CssClass = "";
		if ($reswardens_list->isGridAdd()) {
		} else {
			$reswardens_list->loadRowValues($reswardens_list->Recordset); // Load row values
		}
		$reswardens->RowType = ROWTYPE_VIEW; // Render view

		// Set up row id / data-rowindex
		$reswardens->RowAttrs->merge(["data-rowindex" => $reswardens_list->RowCount, "id" => "r" . $reswardens_list->RowCount . "_reswardens", "data-rowtype" => $reswardens->RowType]);

		// Render row
		$reswardens_list->renderRow();

		// Render list options
		$reswardens_list->renderListOptions();
?>
	<tr <?php echo $reswardens->rowAttributes() ?>>
<?php

// Render list options (body, left)
$reswardens_list->ListOptions->render("body", "left", $reswardens_list->RowCount);
?>
	<?php if ($reswardens_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $reswardens_list->id->cellAttributes() ?>>
<span id="el<?php echo $reswardens_list->RowCount ?>_reswardens_id">
<span<?php echo $reswardens_list->id->viewAttributes() ?>><?php echo $reswardens_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($reswardens_list->Hostel->Visible) { // Hostel ?>
		<td data-name="Hostel" <?php echo $reswardens_list->Hostel->cellAttributes() ?>>
<span id="el<?php echo $reswardens_list->RowCount ?>_reswardens_Hostel">
<span<?php echo $reswardens_list->Hostel->viewAttributes() ?>><?php echo $reswardens_list->Hostel->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($reswardens_list->Floor->Visible) { // Floor ?>
		<td data-name="Floor" <?php echo $reswardens_list->Floor->cellAttributes() ?>>
<span id="el<?php echo $reswardens_list->RowCount ?>_reswardens_Floor">
<span<?php echo $reswardens_list->Floor->viewAttributes() ?>><?php echo $reswardens_list->Floor->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($reswardens_list->ResWarden->Visible) { // ResWarden ?>
		<td data-name="ResWarden" <?php echo $reswardens_list->ResWarden->cellAttributes() ?>>
<span id="el<?php echo $reswardens_list->RowCount ?>_reswardens_ResWarden">
<span<?php echo $reswardens_list->ResWarden->viewAttributes() ?>><?php echo $reswardens_list->ResWarden->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$reswardens_list->ListOptions->render("body", "right", $reswardens_list->RowCount);
?>
	</tr>
<?php
	}
	if (!$reswardens_list->isGridAdd())
		$reswardens_list->Recordset->moveNext();
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php } ?>
</div><!-- /.ew-grid-middle-panel -->
<?php if (!$reswardens->CurrentAction) { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
</form><!-- /.ew-list-form -->
<?php

// Close recordset
if ($reswardens_list->Recordset)
	$reswardens_list->Recordset->Close();
?>
<?php if (!$reswardens_list->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$reswardens_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $reswardens_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $reswardens_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($reswardens_list->TotalRecords == 0 && !$reswardens->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $reswardens_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$reswardens_list->showPageFooter();
if (Config("DEBUG"))
	echo GetDebugMessage();
?>
<?php if (!$reswardens_list->isExport()) { ?>
<script>
loadjs.ready("load", function() {

	// Startup script
	// Write your table-specific startup script here
	// console.log("page loaded");

});
</script>
<?php } ?>
<?php include_once "footer.php"; ?>
<?php
$reswardens_list->terminate();
?>