<?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
$rooms_list = new rooms_list();

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

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

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

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

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

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

});
</script>
<?php } ?>
<?php if (!$rooms_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($rooms_list->TotalRecords > 0 && $rooms_list->ExportOptions->visible()) { ?>
<?php $rooms_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($rooms_list->ImportOptions->visible()) { ?>
<?php $rooms_list->ImportOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$rooms_list->renderOtherOptions();
?>
<?php $rooms_list->showPageHeader(); ?>
<?php
$rooms_list->showMessage();
?>
<?php if ($rooms_list->TotalRecords > 0 || $rooms->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($rooms_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> rooms">
<?php if (!$rooms_list->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$rooms_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $rooms_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $rooms_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="froomslist" id="froomslist" 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="rooms">
<div id="gmp_rooms" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($rooms_list->TotalRecords > 0 || $rooms_list->isGridEdit()) { ?>
<table id="tbl_roomslist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$rooms_list->ListOptions->render("header", "left");
?>
<?php if ($rooms_list->id->Visible) { // id ?>
	<?php if ($rooms_list->SortUrl($rooms_list->id) == "") { ?>
		<th data-name="id" class="<?php echo $rooms_list->id->headerCellClass() ?>"><div id="elh_rooms_id" class="rooms_id"><div class="ew-table-header-caption"><?php echo $rooms_list->id->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id" class="<?php echo $rooms_list->id->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->id) ?>', 1);"><div id="elh_rooms_id" class="rooms_id">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->id->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->id->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->id->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Hostel_Name->Visible) { // Hostel_Name ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Hostel_Name) == "") { ?>
		<th data-name="Hostel_Name" class="<?php echo $rooms_list->Hostel_Name->headerCellClass() ?>"><div id="elh_rooms_Hostel_Name" class="rooms_Hostel_Name"><div class="ew-table-header-caption"><?php echo $rooms_list->Hostel_Name->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Hostel_Name" class="<?php echo $rooms_list->Hostel_Name->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Hostel_Name) ?>', 1);"><div id="elh_rooms_Hostel_Name" class="rooms_Hostel_Name">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Hostel_Name->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Hostel_Name->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Hostel_Name->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Floor->Visible) { // Floor ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Floor) == "") { ?>
		<th data-name="Floor" class="<?php echo $rooms_list->Floor->headerCellClass() ?>"><div id="elh_rooms_Floor" class="rooms_Floor"><div class="ew-table-header-caption"><?php echo $rooms_list->Floor->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Floor" class="<?php echo $rooms_list->Floor->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Floor) ?>', 1);"><div id="elh_rooms_Floor" class="rooms_Floor">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Floor->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Floor->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Floor->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Room_No->Visible) { // Room_No ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Room_No) == "") { ?>
		<th data-name="Room_No" class="<?php echo $rooms_list->Room_No->headerCellClass() ?>"><div id="elh_rooms_Room_No" class="rooms_Room_No"><div class="ew-table-header-caption"><?php echo $rooms_list->Room_No->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Room_No" class="<?php echo $rooms_list->Room_No->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Room_No) ?>', 1);"><div id="elh_rooms_Room_No" class="rooms_Room_No">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Room_No->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Room_No->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Room_No->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Bed->Visible) { // Bed ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Bed) == "") { ?>
		<th data-name="Bed" class="<?php echo $rooms_list->Bed->headerCellClass() ?>"><div id="elh_rooms_Bed" class="rooms_Bed"><div class="ew-table-header-caption"><?php echo $rooms_list->Bed->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Bed" class="<?php echo $rooms_list->Bed->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Bed) ?>', 1);"><div id="elh_rooms_Bed" class="rooms_Bed">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Bed->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Bed->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Bed->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Filled->Visible) { // Filled ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Filled) == "") { ?>
		<th data-name="Filled" class="<?php echo $rooms_list->Filled->headerCellClass() ?>"><div id="elh_rooms_Filled" class="rooms_Filled"><div class="ew-table-header-caption"><?php echo $rooms_list->Filled->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Filled" class="<?php echo $rooms_list->Filled->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Filled) ?>', 1);"><div id="elh_rooms_Filled" class="rooms_Filled">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Filled->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Filled->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Filled->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Vacant->Visible) { // Vacant ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Vacant) == "") { ?>
		<th data-name="Vacant" class="<?php echo $rooms_list->Vacant->headerCellClass() ?>"><div id="elh_rooms_Vacant" class="rooms_Vacant"><div class="ew-table-header-caption"><?php echo $rooms_list->Vacant->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Vacant" class="<?php echo $rooms_list->Vacant->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Vacant) ?>', 1);"><div id="elh_rooms_Vacant" class="rooms_Vacant">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Vacant->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Vacant->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Vacant->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($rooms_list->Status->Visible) { // Status ?>
	<?php if ($rooms_list->SortUrl($rooms_list->Status) == "") { ?>
		<th data-name="Status" class="<?php echo $rooms_list->Status->headerCellClass() ?>"><div id="elh_rooms_Status" class="rooms_Status"><div class="ew-table-header-caption"><?php echo $rooms_list->Status->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Status" class="<?php echo $rooms_list->Status->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $rooms_list->SortUrl($rooms_list->Status) ?>', 1);"><div id="elh_rooms_Status" class="rooms_Status">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $rooms_list->Status->caption() ?></span><span class="ew-table-header-sort"><?php if ($rooms_list->Status->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($rooms_list->Status->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$rooms_list->ListOptions->render("body", "left", $rooms_list->RowCount);
?>
	<?php if ($rooms_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $rooms_list->id->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_id">
<span<?php echo $rooms_list->id->viewAttributes() ?>><?php echo $rooms_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Hostel_Name->Visible) { // Hostel_Name ?>
		<td data-name="Hostel_Name" <?php echo $rooms_list->Hostel_Name->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Hostel_Name">
<span<?php echo $rooms_list->Hostel_Name->viewAttributes() ?>><?php echo $rooms_list->Hostel_Name->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Floor->Visible) { // Floor ?>
		<td data-name="Floor" <?php echo $rooms_list->Floor->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Floor">
<span<?php echo $rooms_list->Floor->viewAttributes() ?>><?php echo $rooms_list->Floor->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Room_No->Visible) { // Room_No ?>
		<td data-name="Room_No" <?php echo $rooms_list->Room_No->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Room_No">
<span<?php echo $rooms_list->Room_No->viewAttributes() ?>><?php echo $rooms_list->Room_No->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Bed->Visible) { // Bed ?>
		<td data-name="Bed" <?php echo $rooms_list->Bed->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Bed">
<span<?php echo $rooms_list->Bed->viewAttributes() ?>><?php echo $rooms_list->Bed->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Filled->Visible) { // Filled ?>
		<td data-name="Filled" <?php echo $rooms_list->Filled->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Filled">
<span<?php echo $rooms_list->Filled->viewAttributes() ?>><?php echo $rooms_list->Filled->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Vacant->Visible) { // Vacant ?>
		<td data-name="Vacant" <?php echo $rooms_list->Vacant->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Vacant">
<span<?php echo $rooms_list->Vacant->viewAttributes() ?>><?php echo $rooms_list->Vacant->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($rooms_list->Status->Visible) { // Status ?>
		<td data-name="Status" <?php echo $rooms_list->Status->cellAttributes() ?>>
<span id="el<?php echo $rooms_list->RowCount ?>_rooms_Status">
<span<?php echo $rooms_list->Status->viewAttributes() ?>><?php echo $rooms_list->Status->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($rooms_list->Recordset)
	$rooms_list->Recordset->Close();
?>
<?php if (!$rooms_list->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$rooms_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $rooms_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $rooms_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($rooms_list->TotalRecords == 0 && !$rooms->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $rooms_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$rooms_list->showPageFooter();
if (Config("DEBUG"))
	echo GetDebugMessage();
?>
<?php if (!$rooms_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
$rooms_list->terminate();
?>