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

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

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

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

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

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

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

	// Dynamic selection lists
	// Filters

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

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

});
</script>
<?php } ?>
<?php if (!$involvement_list->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($involvement_list->TotalRecords > 0 && $involvement_list->ExportOptions->visible()) { ?>
<?php $involvement_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($involvement_list->ImportOptions->visible()) { ?>
<?php $involvement_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($involvement_list->SearchOptions->visible()) { ?>
<?php $involvement_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($involvement_list->FilterOptions->visible()) { ?>
<?php $involvement_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php
$involvement_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$involvement_list->isExport() && !$involvement->CurrentAction) { ?>
<form name="finvolvementlistsrch" id="finvolvementlistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<div id="finvolvementlistsrch-search-panel" class="<?php echo $involvement_list->SearchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="involvement">
	<div class="ew-extended-search">
<div id="xsr_<?php echo $involvement_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($involvement_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($involvement_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 $involvement_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($involvement_list->BasicSearch->getType() == "") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this);"><?php echo $Language->phrase("QuickSearchAuto") ?></a>
				<a class="dropdown-item<?php if ($involvement_list->BasicSearch->getType() == "=") { ?> active<?php } ?>" href="#" onclick="return ew.setSearchType(this, '=');"><?php echo $Language->phrase("QuickSearchExact") ?></a>
				<a class="dropdown-item<?php if ($involvement_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 ($involvement_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 $involvement_list->showPageHeader(); ?>
<?php
$involvement_list->showMessage();
?>
<?php if ($involvement_list->TotalRecords > 0 || $involvement->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($involvement_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> involvement">
<?php if (!$involvement_list->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$involvement_list->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php echo $involvement_list->Pager->render() ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $involvement_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="finvolvementlist" id="finvolvementlist" 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="involvement">
<div id="gmp_involvement" class="<?php echo ResponsiveTableClass() ?>card-body ew-grid-middle-panel">
<?php if ($involvement_list->TotalRecords > 0 || $involvement_list->isGridEdit()) { ?>
<table id="tbl_involvementlist" class="table ew-table"><!-- .ew-table -->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$involvement_list->ListOptions->render("header", "left");
?>
<?php if ($involvement_list->id->Visible) { // id ?>
	<?php if ($involvement_list->SortUrl($involvement_list->id) == "") { ?>
		<th data-name="id" class="<?php echo $involvement_list->id->headerCellClass() ?>"><div id="elh_involvement_id" class="involvement_id"><div class="ew-table-header-caption"><?php echo $involvement_list->id->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="id" class="<?php echo $involvement_list->id->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $involvement_list->SortUrl($involvement_list->id) ?>', 1);"><div id="elh_involvement_id" class="involvement_id">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $involvement_list->id->caption() ?></span><span class="ew-table-header-sort"><?php if ($involvement_list->id->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($involvement_list->id->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($involvement_list->Activity->Visible) { // Activity ?>
	<?php if ($involvement_list->SortUrl($involvement_list->Activity) == "") { ?>
		<th data-name="Activity" class="<?php echo $involvement_list->Activity->headerCellClass() ?>"><div id="elh_involvement_Activity" class="involvement_Activity"><div class="ew-table-header-caption"><?php echo $involvement_list->Activity->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Activity" class="<?php echo $involvement_list->Activity->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $involvement_list->SortUrl($involvement_list->Activity) ?>', 1);"><div id="elh_involvement_Activity" class="involvement_Activity">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $involvement_list->Activity->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($involvement_list->Activity->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($involvement_list->Activity->getSort() == "DESC") { ?><i class="fas fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($involvement_list->Status->Visible) { // Status ?>
	<?php if ($involvement_list->SortUrl($involvement_list->Status) == "") { ?>
		<th data-name="Status" class="<?php echo $involvement_list->Status->headerCellClass() ?>"><div id="elh_involvement_Status" class="involvement_Status"><div class="ew-table-header-caption"><?php echo $involvement_list->Status->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Status" class="<?php echo $involvement_list->Status->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event, '<?php echo $involvement_list->SortUrl($involvement_list->Status) ?>', 1);"><div id="elh_involvement_Status" class="involvement_Status">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $involvement_list->Status->caption() ?></span><span class="ew-table-header-sort"><?php if ($involvement_list->Status->getSort() == "ASC") { ?><i class="fas fa-sort-up"></i><?php } elseif ($involvement_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)
$involvement_list->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
if ($involvement_list->ExportAll && $involvement_list->isExport()) {
	$involvement_list->StopRecord = $involvement_list->TotalRecords;
} else {

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

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

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

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

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

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

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

// Render list options (body, left)
$involvement_list->ListOptions->render("body", "left", $involvement_list->RowCount);
?>
	<?php if ($involvement_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $involvement_list->id->cellAttributes() ?>>
<span id="el<?php echo $involvement_list->RowCount ?>_involvement_id">
<span<?php echo $involvement_list->id->viewAttributes() ?>><?php echo $involvement_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($involvement_list->Activity->Visible) { // Activity ?>
		<td data-name="Activity" <?php echo $involvement_list->Activity->cellAttributes() ?>>
<span id="el<?php echo $involvement_list->RowCount ?>_involvement_Activity">
<span<?php echo $involvement_list->Activity->viewAttributes() ?>><?php echo $involvement_list->Activity->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($involvement_list->Status->Visible) { // Status ?>
		<td data-name="Status" <?php echo $involvement_list->Status->cellAttributes() ?>>
<span id="el<?php echo $involvement_list->RowCount ?>_involvement_Status">
<span<?php echo $involvement_list->Status->viewAttributes() ?>><?php echo $involvement_list->Status->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

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