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

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

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

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

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

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

	// Form object for search
	fvacantlistsrch = currentSearchForm = new ew.Form("fvacantlistsrch");

	// Dynamic selection lists
	// Filters

	fvacantlistsrch.filterList = <?php echo $vacant_list->getFilterList() ?>;
	loadjs.done("fvacantlistsrch");
});
</script>
<script>
loadjs.ready("head", function() {

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

});
</script>
<?php } ?>
<?php if (!$vacant_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($vacant_list->TotalRecords > 0 && $vacant_list->ExportOptions->visible()) { ?>
<?php $vacant_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($vacant_list->ImportOptions->visible()) { ?>
<?php $vacant_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($vacant_list->SearchOptions->visible()) { ?>
<?php $vacant_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($vacant_list->FilterOptions->visible()) { ?>
<?php $vacant_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$vacant_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$vacant_list->isExport() && !$vacant->CurrentAction) { ?>
<form name="fvacantlistsrch" id="fvacantlistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<div id="fvacantlistsrch-search-panel" class="<?php echo $vacant_list->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="vacant">
	<div class="ew-extended-search">
<div id="xsr_<?php echo $vacant_list->SearchRowCount + 1 ?>" class="ew-row d-sm-flex">
	<div class="ew-quick-search input-group">
		<input type="text" name="<?php echo Config("TABLE_BASIC_SEARCH") ?>" id="<?php echo Config("TABLE_BASIC_SEARCH") ?>" class="form-control" value="<?php echo HtmlEncode($vacant_list->BasicSearch->getKeyword()) ?>" placeholder="<?php echo HtmlEncode($Language->phrase("Search")) ?>">
		<input type="hidden" name="<?php echo Config("TABLE_BASIC_SEARCH_TYPE") ?>" id="<?php echo Config("TABLE_BASIC_SEARCH_TYPE") ?>" value="<?php echo HtmlEncode($vacant_list->BasicSearch->getType()) ?>">
		<div class="input-group-append">
			<button class="btn btn-primary" name="btn-submit" id="btn-submit" type="submit"><?php echo $Language->phrase("SearchBtn") ?></button>
			<button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle dropdown-toggle-split" aria-haspopup="true" aria-expanded="false"><span id="searchtype"><?php echo $vacant_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($vacant_list->BasicSearch->getType() == "") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this);"><?php echo $Language->phrase("QuickSearchAuto") ?></a>
				<a class="dropdown-item<?php if ($vacant_list->BasicSearch->getType() == "=") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, '=');"><?php echo $Language->phrase("QuickSearchExact") ?></a>
				<a class="dropdown-item<?php if ($vacant_list->BasicSearch->getType() == "AND") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'AND');"><?php echo $Language->phrase("QuickSearchAll") ?></a>
				<a class="dropdown-item<?php if ($vacant_list->BasicSearch->getType() == "OR") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, 'OR');"><?php echo $Language->phrase("QuickSearchAny") ?></a>
			</div>
		</div>
	</div>
</div>
	</div><!-- /.ew-extended-search -->
</div><!-- /.ew-search-panel -->
</form>
<?php } ?>
<?php } ?>
<?php $vacant_list->showPageHeader(); ?>
<?php
$vacant_list->showMessage();
?>
<?php if ($vacant_list->TotalRecords > 0 || $vacant->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($vacant_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> vacant">
<?php if (!$vacant_list->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$vacant_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $vacant_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $vacant_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="fvacantlist" id="fvacantlist" 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="vacant">
<div id="gmp_vacant" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($vacant_list->TotalRecords > 0 || $vacant_list->isGridEdit()) { ?>
<table id="tbl_vacantlist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$vacant_list->ListOptions->render("header", "left");
?>
<?php if ($vacant_list->Hostel_Name->Visible) { // Hostel_Name ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Hostel_Name) == "") { ?>
		<th data-name="Hostel_Name" class="<?php echo $vacant_list->Hostel_Name->headerCellClass() ?>"><div id="elh_vacant_Hostel_Name" class="vacant_Hostel_Name"><div class="ew-table-header-caption"><?php echo $vacant_list->Hostel_Name->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Hostel_Name" class="<?php echo $vacant_list->Hostel_Name->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Hostel_Name) ?>', 1);"><div id="elh_vacant_Hostel_Name" class="vacant_Hostel_Name">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Hostel_Name->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Hostel_Name->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Hostel_Name->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($vacant_list->Floor->Visible) { // Floor ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Floor) == "") { ?>
		<th data-name="Floor" class="<?php echo $vacant_list->Floor->headerCellClass() ?>"><div id="elh_vacant_Floor" class="vacant_Floor"><div class="ew-table-header-caption"><?php echo $vacant_list->Floor->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Floor" class="<?php echo $vacant_list->Floor->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Floor) ?>', 1);"><div id="elh_vacant_Floor" class="vacant_Floor">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Floor->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Floor->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Floor->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($vacant_list->Room_No->Visible) { // Room_No ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Room_No) == "") { ?>
		<th data-name="Room_No" class="<?php echo $vacant_list->Room_No->headerCellClass() ?>"><div id="elh_vacant_Room_No" class="vacant_Room_No"><div class="ew-table-header-caption"><?php echo $vacant_list->Room_No->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Room_No" class="<?php echo $vacant_list->Room_No->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Room_No) ?>', 1);"><div id="elh_vacant_Room_No" class="vacant_Room_No">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Room_No->caption() ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Room_No->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Room_No->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($vacant_list->Bed->Visible) { // Bed ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Bed) == "") { ?>
		<th data-name="Bed" class="<?php echo $vacant_list->Bed->headerCellClass() ?>"><div id="elh_vacant_Bed" class="vacant_Bed"><div class="ew-table-header-caption"><?php echo $vacant_list->Bed->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Bed" class="<?php echo $vacant_list->Bed->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Bed) ?>', 1);"><div id="elh_vacant_Bed" class="vacant_Bed">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Bed->caption() ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Bed->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Bed->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($vacant_list->Filled->Visible) { // Filled ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Filled) == "") { ?>
		<th data-name="Filled" class="<?php echo $vacant_list->Filled->headerCellClass() ?>"><div id="elh_vacant_Filled" class="vacant_Filled"><div class="ew-table-header-caption"><?php echo $vacant_list->Filled->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Filled" class="<?php echo $vacant_list->Filled->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Filled) ?>', 1);"><div id="elh_vacant_Filled" class="vacant_Filled">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Filled->caption() ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Filled->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Filled->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($vacant_list->Vacant->Visible) { // Vacant ?>
	<?php if ($vacant_list->SortUrl($vacant_list->Vacant) == "") { ?>
		<th data-name="Vacant" class="<?php echo $vacant_list->Vacant->headerCellClass() ?>"><div id="elh_vacant_Vacant" class="vacant_Vacant"><div class="ew-table-header-caption"><?php echo $vacant_list->Vacant->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Vacant" class="<?php echo $vacant_list->Vacant->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $vacant_list->SortUrl($vacant_list->Vacant) ?>', 1);"><div id="elh_vacant_Vacant" class="vacant_Vacant">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $vacant_list->Vacant->caption() ?></span><span class="ew-table-header-sort"><?php if ($vacant_list->Vacant->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($vacant_list->Vacant->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$vacant_list->ListOptions->render("body", "left", $vacant_list->RowCount);
?>
	<?php if ($vacant_list->Hostel_Name->Visible) { // Hostel_Name ?>
		<td data-name="Hostel_Name" <?php echo $vacant_list->Hostel_Name->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Hostel_Name">
<span<?php echo $vacant_list->Hostel_Name->viewAttributes() ?>><?php echo $vacant_list->Hostel_Name->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($vacant_list->Floor->Visible) { // Floor ?>
		<td data-name="Floor" <?php echo $vacant_list->Floor->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Floor">
<span<?php echo $vacant_list->Floor->viewAttributes() ?>><?php echo $vacant_list->Floor->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($vacant_list->Room_No->Visible) { // Room_No ?>
		<td data-name="Room_No" <?php echo $vacant_list->Room_No->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Room_No">
<span<?php echo $vacant_list->Room_No->viewAttributes() ?>><?php echo $vacant_list->Room_No->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($vacant_list->Bed->Visible) { // Bed ?>
		<td data-name="Bed" <?php echo $vacant_list->Bed->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Bed">
<span<?php echo $vacant_list->Bed->viewAttributes() ?>><?php echo $vacant_list->Bed->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($vacant_list->Filled->Visible) { // Filled ?>
		<td data-name="Filled" <?php echo $vacant_list->Filled->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Filled">
<span<?php echo $vacant_list->Filled->viewAttributes() ?>><?php echo $vacant_list->Filled->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($vacant_list->Vacant->Visible) { // Vacant ?>
		<td data-name="Vacant" <?php echo $vacant_list->Vacant->cellAttributes() ?>>
<span id="el<?php echo $vacant_list->RowCount ?>_vacant_Vacant">
<span<?php echo $vacant_list->Vacant->viewAttributes() ?>><?php echo $vacant_list->Vacant->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

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