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

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

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

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

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

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

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

	// Dynamic selection lists
	// Filters

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

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

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

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

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

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

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

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

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

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

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

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

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

// Render list options (body, left)
$indiscipline_list->ListOptions->render("body", "left", $indiscipline_list->RowCount);
?>
	<?php if ($indiscipline_list->id->Visible) { // id ?>
		<td data-name="id" <?php echo $indiscipline_list->id->cellAttributes() ?>>
<span id="el<?php echo $indiscipline_list->RowCount ?>_indiscipline_id">
<span<?php echo $indiscipline_list->id->viewAttributes() ?>><?php echo $indiscipline_list->id->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($indiscipline_list->Indiscipline_activity->Visible) { // Indiscipline_activity ?>
		<td data-name="Indiscipline_activity" <?php echo $indiscipline_list->Indiscipline_activity->cellAttributes() ?>>
<span id="el<?php echo $indiscipline_list->RowCount ?>_indiscipline_Indiscipline_activity">
<span<?php echo $indiscipline_list->Indiscipline_activity->viewAttributes() ?>><?php echo $indiscipline_list->Indiscipline_activity->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($indiscipline_list->Status->Visible) { // Status ?>
		<td data-name="Status" <?php echo $indiscipline_list->Status->cellAttributes() ?>>
<span id="el<?php echo $indiscipline_list->RowCount ?>_indiscipline_Status">
<span<?php echo $indiscipline_list->Status->viewAttributes() ?>><?php echo $indiscipline_list->Status->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
<?php

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

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