<?php
namespace PHPMaker2019\project_germanos;

// 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
$courtaddress_list = new courtaddress_list();

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

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

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

// Page Rendering event
$courtaddress_list->Page_Render();
?>
<?php include_once "header.php" ?>
<?php if (!$courtaddress->isExport()) { ?>
<script>

// Form object
currentPageID = ew.PAGE_ID = "list";
var fcourtaddresslist = currentForm = new ew.Form("fcourtaddresslist", "list");
fcourtaddresslist.formKeyCountName = '<?php echo $courtaddress_list->FormKeyCountName ?>';

// Form_CustomValidate event
fcourtaddresslist.Form_CustomValidate = function(fobj) { // DO NOT CHANGE THIS LINE!

	// Your custom validation code here, return false if invalid.
	return true;
}

// Use JavaScript validation or not
fcourtaddresslist.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
fcourtaddresslist.lists["x_CourtID"] = <?php echo $courtaddress_list->CourtID->Lookup->toClientList() ?>;
fcourtaddresslist.lists["x_CourtID"].options = <?php echo JsonEncode($courtaddress_list->CourtID->lookupOptions()) ?>;
fcourtaddresslist.lists["x_AddressTypeID"] = <?php echo $courtaddress_list->AddressTypeID->Lookup->toClientList() ?>;
fcourtaddresslist.lists["x_AddressTypeID"].options = <?php echo JsonEncode($courtaddress_list->AddressTypeID->lookupOptions()) ?>;
fcourtaddresslist.lists["x_Primary[]"] = <?php echo $courtaddress_list->Primary->Lookup->toClientList() ?>;
fcourtaddresslist.lists["x_Primary[]"].options = <?php echo JsonEncode($courtaddress_list->Primary->options(FALSE, TRUE)) ?>;

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

// Validate function for search
fcourtaddresslistsrch.validate = function(fobj) {
	if (!this.validateRequired)
		return true; // Ignore validation
	fobj = fobj || this._form;
	var infix = "";

	// Fire Form_CustomValidate event
	if (!this.Form_CustomValidate(fobj))
		return false;
	return true;
}

// Form_CustomValidate event
fcourtaddresslistsrch.Form_CustomValidate = function(fobj) { // DO NOT CHANGE THIS LINE!

	// Your custom validation code here, return false if invalid.
	return true;
}

// Use JavaScript validation or not
fcourtaddresslistsrch.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
fcourtaddresslistsrch.lists["x_Primary[]"] = <?php echo $courtaddress_list->Primary->Lookup->toClientList() ?>;
fcourtaddresslistsrch.lists["x_Primary[]"].options = <?php echo JsonEncode($courtaddress_list->Primary->options(FALSE, TRUE)) ?>;

// Filters
fcourtaddresslistsrch.filterList = <?php echo $courtaddress_list->getFilterList() ?>;
</script>
<script src="phpjs/ewscrolltable.js"></script>
<style type="text/css">
.ew-table-preview-row { /* main table preview row color */
	background-color: #FFFFFF; /* preview row color */
}
.ew-table-preview-row .ew-grid {
	display: table;
}
</style>
<div id="ew-preview" class="d-none"><!-- preview -->
	<div class="ew-nav-tabs"><!-- .ew-nav-tabs -->
		<ul class="nav nav-tabs"></ul>
		<div class="tab-content"><!-- .tab-content -->
			<div class="tab-pane fade active show"></div>
		</div><!-- /.tab-content -->
	</div><!-- /.ew-nav-tabs -->
</div><!-- /preview -->
<script src="phpjs/ewpreview.js"></script>
<script>
ew.PREVIEW_PLACEMENT = ew.CSS_FLIP ? "left" : "right";
ew.PREVIEW_SINGLE_ROW = false;
ew.PREVIEW_OVERLAY = true;
</script>
<script>

// Write your client script here, no need to add script tags.
</script>
<?php } ?>
<?php if (!$courtaddress->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($courtaddress_list->TotalRecs > 0 && $courtaddress_list->ExportOptions->visible()) { ?>
<?php $courtaddress_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($courtaddress_list->ImportOptions->visible()) { ?>
<?php $courtaddress_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($courtaddress_list->SearchOptions->visible()) { ?>
<?php $courtaddress_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($courtaddress_list->FilterOptions->visible()) { ?>
<?php $courtaddress_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if (!$courtaddress->isExport() || EXPORT_MASTER_RECORD && $courtaddress->isExport("print")) { ?>
<?php
if ($courtaddress_list->DbMasterFilter <> "" && $courtaddress->getCurrentMasterTable() == "courts") {
	if ($courtaddress_list->MasterRecordExists) {
		include_once "courtsmaster.php";
	}
}
?>
<?php } ?>
<?php
$courtaddress_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$courtaddress->isExport() && !$courtaddress->CurrentAction) { ?>
<form name="fcourtaddresslistsrch" id="fcourtaddresslistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<?php $searchPanelClass = ($courtaddress_list->SearchWhere <> "") ? " show" : " show"; ?>
<div id="fcourtaddresslistsrch-search-panel" class="ew-search-panel collapse<?php echo $searchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="courtaddress">
	<div class="ew-basic-search">
<?php
if ($SearchError == "")
	$courtaddress_list->LoadAdvancedSearch(); // Load advanced search

// Render for search
$courtaddress->RowType = ROWTYPE_SEARCH;

// Render row
$courtaddress->resetAttributes();
$courtaddress_list->renderRow();
?>
<div id="xsr_1" class="ew-row d-sm-flex">
<?php if ($courtaddress->Primary->Visible) { // Primary ?>
	<div id="xsc_Primary" class="ew-cell form-group">
		<label class="ew-search-caption ew-label"><?php echo $courtaddress->Primary->caption() ?></label>
		<span class="ew-search-operator"><?php echo $Language->phrase("=") ?><input type="hidden" name="z_Primary" id="z_Primary" value="="></span>
		<span class="ew-search-field">
<?php
$selwrk = (ConvertToBool($courtaddress->Primary->AdvancedSearch->SearchValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="courtaddress" data-field="x_Primary" name="x_Primary[]" id="x_Primary[]" value="1"<?php echo $selwrk ?><?php echo $courtaddress->Primary->editAttributes() ?>>
</span>
	</div>
<?php } ?>
</div>
<div id="xsr_2" class="ew-row d-sm-flex">
	<div class="ew-quick-search input-group">
		<input type="text" name="<?php echo TABLE_BASIC_SEARCH ?>" id="<?php echo TABLE_BASIC_SEARCH ?>" class="form-control" value="<?php echo HtmlEncode($courtaddress_list->BasicSearch->getKeyword()) ?>" placeholder="<?php echo HtmlEncode($Language->phrase("Search")) ?>">
		<input type="hidden" name="<?php echo TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo TABLE_BASIC_SEARCH_TYPE ?>" value="<?php echo HtmlEncode($courtaddress_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 $courtaddress_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($courtaddress_list->BasicSearch->getType() == "") echo " active"; ?>" href="javascript:void(0);" onclick="ew.setSearchType(this)"><?php echo $Language->phrase("QuickSearchAuto") ?></a>
				<a class="dropdown-item<?php if ($courtaddress_list->BasicSearch->getType() == "=") echo " active"; ?>" href="javascript:void(0);" onclick="ew.setSearchType(this,'=')"><?php echo $Language->phrase("QuickSearchExact") ?></a>
				<a class="dropdown-item<?php if ($courtaddress_list->BasicSearch->getType() == "AND") echo " active"; ?>" href="javascript:void(0);" onclick="ew.setSearchType(this,'AND')"><?php echo $Language->phrase("QuickSearchAll") ?></a>
				<a class="dropdown-item<?php if ($courtaddress_list->BasicSearch->getType() == "OR") echo " active"; ?>" href="javascript:void(0);" onclick="ew.setSearchType(this,'OR')"><?php echo $Language->phrase("QuickSearchAny") ?></a>
			</div>
		</div>
	</div>
</div>
	</div>
</div>
</form>
<?php } ?>
<?php } ?>
<?php $courtaddress_list->showPageHeader(); ?>
<?php
$courtaddress_list->showMessage();
?>
<?php if ($courtaddress_list->TotalRecs > 0 || $courtaddress->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($courtaddress_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> courtaddress">
<?php if (!$courtaddress->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$courtaddress->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($courtaddress_list->Pager)) $courtaddress_list->Pager = new PrevNextPager($courtaddress_list->StartRec, $courtaddress_list->DisplayRecs, $courtaddress_list->TotalRecs, $courtaddress_list->AutoHidePager) ?>
<?php if ($courtaddress_list->Pager->RecordCount > 0 && $courtaddress_list->Pager->Visible) { ?>
<div class="ew-pager">
<span><?php echo $Language->Phrase("Page") ?>&nbsp;</span>
<div class="ew-prev-next"><div class="input-group input-group-sm">
<div class="input-group-prepend">
<!-- first page button -->
	<?php if ($courtaddress_list->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->FirstButton->Start ?>"><i class="icon-first ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerFirst") ?>"><i class="icon-first ew-icon"></i></a>
	<?php } ?>
<!-- previous page button -->
	<?php if ($courtaddress_list->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->PrevButton->Start ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerPrevious") ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } ?>
</div>
<!-- current page number -->
	<input class="form-control" type="text" name="<?php echo TABLE_PAGE_NO ?>" value="<?php echo $courtaddress_list->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($courtaddress_list->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->NextButton->Start ?>"><i class="icon-next ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerNext") ?>"><i class="icon-next ew-icon"></i></a>
	<?php } ?>
<!-- last page button -->
	<?php if ($courtaddress_list->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->LastButton->Start ?>"><i class="icon-last ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerLast") ?>"><i class="icon-last ew-icon"></i></a>
	<?php } ?>
</div>
</div>
</div>
<span>&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $courtaddress_list->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if ($courtaddress_list->Pager->RecordCount > 0) { ?>
<div class="ew-pager ew-rec">
	<span><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $courtaddress_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $courtaddress_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $courtaddress_list->Pager->RecordCount ?></span>
</div>
<?php } ?>
<?php if ($courtaddress_list->TotalRecs > 0 && (!$courtaddress_list->AutoHidePageSizeSelector || $courtaddress_list->Pager->Visible)) { ?>
<div class="ew-pager">
<input type="hidden" name="t" value="courtaddress">
<select name="<?php echo TABLE_REC_PER_PAGE ?>" class="form-control form-control-sm ew-tooltip" title="<?php echo $Language->phrase("RecordsPerPage") ?>" onchange="this.form.submit();">
<option value="5"<?php if ($courtaddress_list->DisplayRecs == 5) { ?> selected<?php } ?>>5</option>
<option value="10"<?php if ($courtaddress_list->DisplayRecs == 10) { ?> selected<?php } ?>>10</option>
<option value="20"<?php if ($courtaddress_list->DisplayRecs == 20) { ?> selected<?php } ?>>20</option>
<option value="30"<?php if ($courtaddress_list->DisplayRecs == 30) { ?> selected<?php } ?>>30</option>
<option value="40"<?php if ($courtaddress_list->DisplayRecs == 40) { ?> selected<?php } ?>>40</option>
<option value="50"<?php if ($courtaddress_list->DisplayRecs == 50) { ?> selected<?php } ?>>50</option>
<option value="100"<?php if ($courtaddress_list->DisplayRecs == 100) { ?> selected<?php } ?>>100</option>
<option value="200"<?php if ($courtaddress_list->DisplayRecs == 200) { ?> selected<?php } ?>>200</option>
<option value="500"<?php if ($courtaddress_list->DisplayRecs == 500) { ?> selected<?php } ?>>500</option>
<option value="ALL"<?php if ($courtaddress->getRecordsPerPage() == -1) { ?> selected<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select>
</div>
<?php } ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $courtaddress_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="fcourtaddresslist" id="fcourtaddresslist" class="form-inline ew-form ew-list-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($courtaddress_list->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $courtaddress_list->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="courtaddress">
<?php if ($courtaddress->getCurrentMasterTable() == "courts" && $courtaddress->CurrentAction) { ?>
<input type="hidden" name="<?php echo TABLE_SHOW_MASTER ?>" value="courts">
<input type="hidden" name="fk_CourtID" value="<?php echo $courtaddress->CourtID->getSessionValue() ?>">
<?php } ?>
<div id="gmp_courtaddress" class="<?php if (IsResponsiveLayout()) { ?>table-responsive <?php } ?>card-body ew-grid-middle-panel">
<?php if ($courtaddress_list->TotalRecs > 0 || $courtaddress->isGridEdit()) { ?>
<table id="tbl_courtaddresslist" class="table ew-table"><!-- .ew-table ##-->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$courtaddress_list->ListOptions->render("header", "left");
?>
<?php if ($courtaddress->CourtID->Visible) { // CourtID ?>
	<?php if ($courtaddress->sortUrl($courtaddress->CourtID) == "") { ?>
		<th data-name="CourtID" class="<?php echo $courtaddress->CourtID->headerCellClass() ?>"><div id="elh_courtaddress_CourtID" class="courtaddress_CourtID"><div class="ew-table-header-caption"><?php echo $courtaddress->CourtID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="CourtID" class="<?php echo $courtaddress->CourtID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->CourtID) ?>',2);"><div id="elh_courtaddress_CourtID" class="courtaddress_CourtID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->CourtID->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->CourtID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->CourtID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->AddressTypeID->Visible) { // AddressTypeID ?>
	<?php if ($courtaddress->sortUrl($courtaddress->AddressTypeID) == "") { ?>
		<th data-name="AddressTypeID" class="<?php echo $courtaddress->AddressTypeID->headerCellClass() ?>"><div id="elh_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID"><div class="ew-table-header-caption"><?php echo $courtaddress->AddressTypeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AddressTypeID" class="<?php echo $courtaddress->AddressTypeID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->AddressTypeID) ?>',2);"><div id="elh_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->AddressTypeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->AddressTypeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->AddressTypeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Address->Visible) { // Address ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Address) == "") { ?>
		<th data-name="Address" class="<?php echo $courtaddress->Address->headerCellClass() ?>"><div id="elh_courtaddress_Address" class="courtaddress_Address"><div class="ew-table-header-caption"><?php echo $courtaddress->Address->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Address" class="<?php echo $courtaddress->Address->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->Address) ?>',2);"><div id="elh_courtaddress_Address" class="courtaddress_Address">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Address->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Address->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Address->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->City->Visible) { // City ?>
	<?php if ($courtaddress->sortUrl($courtaddress->City) == "") { ?>
		<th data-name="City" class="<?php echo $courtaddress->City->headerCellClass() ?>"><div id="elh_courtaddress_City" class="courtaddress_City"><div class="ew-table-header-caption"><?php echo $courtaddress->City->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="City" class="<?php echo $courtaddress->City->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->City) ?>',2);"><div id="elh_courtaddress_City" class="courtaddress_City">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->City->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->City->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->City->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Region->Visible) { // Region ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Region) == "") { ?>
		<th data-name="Region" class="<?php echo $courtaddress->Region->headerCellClass() ?>"><div id="elh_courtaddress_Region" class="courtaddress_Region"><div class="ew-table-header-caption"><?php echo $courtaddress->Region->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Region" class="<?php echo $courtaddress->Region->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->Region) ?>',2);"><div id="elh_courtaddress_Region" class="courtaddress_Region">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Region->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Region->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Region->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->PostalCode->Visible) { // PostalCode ?>
	<?php if ($courtaddress->sortUrl($courtaddress->PostalCode) == "") { ?>
		<th data-name="PostalCode" class="<?php echo $courtaddress->PostalCode->headerCellClass() ?>"><div id="elh_courtaddress_PostalCode" class="courtaddress_PostalCode"><div class="ew-table-header-caption"><?php echo $courtaddress->PostalCode->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="PostalCode" class="<?php echo $courtaddress->PostalCode->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->PostalCode) ?>',2);"><div id="elh_courtaddress_PostalCode" class="courtaddress_PostalCode">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->PostalCode->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->PostalCode->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->PostalCode->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Country->Visible) { // Country ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Country) == "") { ?>
		<th data-name="Country" class="<?php echo $courtaddress->Country->headerCellClass() ?>"><div id="elh_courtaddress_Country" class="courtaddress_Country"><div class="ew-table-header-caption"><?php echo $courtaddress->Country->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Country" class="<?php echo $courtaddress->Country->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->Country) ?>',2);"><div id="elh_courtaddress_Country" class="courtaddress_Country">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Country->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Country->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Country->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Notes->Visible) { // Notes ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Notes) == "") { ?>
		<th data-name="Notes" class="<?php echo $courtaddress->Notes->headerCellClass() ?>"><div id="elh_courtaddress_Notes" class="courtaddress_Notes"><div class="ew-table-header-caption"><?php echo $courtaddress->Notes->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Notes" class="<?php echo $courtaddress->Notes->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->Notes) ?>',2);"><div id="elh_courtaddress_Notes" class="courtaddress_Notes">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Notes->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Notes->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Notes->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Primary->Visible) { // Primary ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Primary) == "") { ?>
		<th data-name="Primary" class="<?php echo $courtaddress->Primary->headerCellClass() ?>"><div id="elh_courtaddress_Primary" class="courtaddress_Primary"><div class="ew-table-header-caption"><?php echo $courtaddress->Primary->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Primary" class="<?php echo $courtaddress->Primary->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $courtaddress->SortUrl($courtaddress->Primary) ?>',2);"><div id="elh_courtaddress_Primary" class="courtaddress_Primary">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Primary->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Primary->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Primary->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

	// Set the last record to display
	if ($courtaddress_list->TotalRecs > $courtaddress_list->StartRec + $courtaddress_list->DisplayRecs - 1)
		$courtaddress_list->StopRec = $courtaddress_list->StartRec + $courtaddress_list->DisplayRecs - 1;
	else
		$courtaddress_list->StopRec = $courtaddress_list->TotalRecs;
}
$courtaddress_list->RecCnt = $courtaddress_list->StartRec - 1;
if ($courtaddress_list->Recordset && !$courtaddress_list->Recordset->EOF) {
	$courtaddress_list->Recordset->moveFirst();
	$selectLimit = $courtaddress_list->UseSelectLimit;
	if (!$selectLimit && $courtaddress_list->StartRec > 1)
		$courtaddress_list->Recordset->move($courtaddress_list->StartRec - 1);
} elseif (!$courtaddress->AllowAddDeleteRow && $courtaddress_list->StopRec == 0) {
	$courtaddress_list->StopRec = $courtaddress->GridAddRowCount;
}

// Initialize aggregate
$courtaddress->RowType = ROWTYPE_AGGREGATEINIT;
$courtaddress->resetAttributes();
$courtaddress_list->renderRow();
while ($courtaddress_list->RecCnt < $courtaddress_list->StopRec) {
	$courtaddress_list->RecCnt++;
	if ($courtaddress_list->RecCnt >= $courtaddress_list->StartRec) {
		$courtaddress_list->RowCnt++;

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

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

		// Set up row id / data-rowindex
		$courtaddress->RowAttrs = array_merge($courtaddress->RowAttrs, array('data-rowindex'=>$courtaddress_list->RowCnt, 'id'=>'r' . $courtaddress_list->RowCnt . '_courtaddress', 'data-rowtype'=>$courtaddress->RowType));

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

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

// Render list options (body, left)
$courtaddress_list->ListOptions->render("body", "left", $courtaddress_list->RowCnt);
?>
	<?php if ($courtaddress->CourtID->Visible) { // CourtID ?>
		<td data-name="CourtID"<?php echo $courtaddress->CourtID->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_CourtID" class="courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<?php echo $courtaddress->CourtID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID"<?php echo $courtaddress->AddressTypeID->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID">
<span<?php echo $courtaddress->AddressTypeID->viewAttributes() ?>>
<?php echo $courtaddress->AddressTypeID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->Address->Visible) { // Address ?>
		<td data-name="Address"<?php echo $courtaddress->Address->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_Address" class="courtaddress_Address">
<span<?php echo $courtaddress->Address->viewAttributes() ?>>
<?php echo $courtaddress->Address->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->City->Visible) { // City ?>
		<td data-name="City"<?php echo $courtaddress->City->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_City" class="courtaddress_City">
<span<?php echo $courtaddress->City->viewAttributes() ?>>
<?php echo $courtaddress->City->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->Region->Visible) { // Region ?>
		<td data-name="Region"<?php echo $courtaddress->Region->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_Region" class="courtaddress_Region">
<span<?php echo $courtaddress->Region->viewAttributes() ?>>
<?php echo $courtaddress->Region->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode"<?php echo $courtaddress->PostalCode->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_PostalCode" class="courtaddress_PostalCode">
<span<?php echo $courtaddress->PostalCode->viewAttributes() ?>>
<?php echo $courtaddress->PostalCode->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->Country->Visible) { // Country ?>
		<td data-name="Country"<?php echo $courtaddress->Country->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_Country" class="courtaddress_Country">
<span<?php echo $courtaddress->Country->viewAttributes() ?>>
<?php echo $courtaddress->Country->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $courtaddress->Notes->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_Notes" class="courtaddress_Notes">
<span<?php echo $courtaddress->Notes->viewAttributes() ?>>
<?php echo $courtaddress->Notes->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($courtaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $courtaddress->Primary->cellAttributes() ?>>
<span id="el<?php echo $courtaddress_list->RowCnt ?>_courtaddress_Primary" class="courtaddress_Primary">
<span<?php echo $courtaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($courtaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($courtaddress_list->Recordset)
	$courtaddress_list->Recordset->Close();
?>
<?php if (!$courtaddress->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$courtaddress->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($courtaddress_list->Pager)) $courtaddress_list->Pager = new PrevNextPager($courtaddress_list->StartRec, $courtaddress_list->DisplayRecs, $courtaddress_list->TotalRecs, $courtaddress_list->AutoHidePager) ?>
<?php if ($courtaddress_list->Pager->RecordCount > 0 && $courtaddress_list->Pager->Visible) { ?>
<div class="ew-pager">
<span><?php echo $Language->Phrase("Page") ?>&nbsp;</span>
<div class="ew-prev-next"><div class="input-group input-group-sm">
<div class="input-group-prepend">
<!-- first page button -->
	<?php if ($courtaddress_list->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->FirstButton->Start ?>"><i class="icon-first ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerFirst") ?>"><i class="icon-first ew-icon"></i></a>
	<?php } ?>
<!-- previous page button -->
	<?php if ($courtaddress_list->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->PrevButton->Start ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerPrevious") ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } ?>
</div>
<!-- current page number -->
	<input class="form-control" type="text" name="<?php echo TABLE_PAGE_NO ?>" value="<?php echo $courtaddress_list->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($courtaddress_list->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->NextButton->Start ?>"><i class="icon-next ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerNext") ?>"><i class="icon-next ew-icon"></i></a>
	<?php } ?>
<!-- last page button -->
	<?php if ($courtaddress_list->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $courtaddress_list->pageUrl() ?>start=<?php echo $courtaddress_list->Pager->LastButton->Start ?>"><i class="icon-last ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerLast") ?>"><i class="icon-last ew-icon"></i></a>
	<?php } ?>
</div>
</div>
</div>
<span>&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $courtaddress_list->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if ($courtaddress_list->Pager->RecordCount > 0) { ?>
<div class="ew-pager ew-rec">
	<span><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $courtaddress_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $courtaddress_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $courtaddress_list->Pager->RecordCount ?></span>
</div>
<?php } ?>
<?php if ($courtaddress_list->TotalRecs > 0 && (!$courtaddress_list->AutoHidePageSizeSelector || $courtaddress_list->Pager->Visible)) { ?>
<div class="ew-pager">
<input type="hidden" name="t" value="courtaddress">
<select name="<?php echo TABLE_REC_PER_PAGE ?>" class="form-control form-control-sm ew-tooltip" title="<?php echo $Language->phrase("RecordsPerPage") ?>" onchange="this.form.submit();">
<option value="5"<?php if ($courtaddress_list->DisplayRecs == 5) { ?> selected<?php } ?>>5</option>
<option value="10"<?php if ($courtaddress_list->DisplayRecs == 10) { ?> selected<?php } ?>>10</option>
<option value="20"<?php if ($courtaddress_list->DisplayRecs == 20) { ?> selected<?php } ?>>20</option>
<option value="30"<?php if ($courtaddress_list->DisplayRecs == 30) { ?> selected<?php } ?>>30</option>
<option value="40"<?php if ($courtaddress_list->DisplayRecs == 40) { ?> selected<?php } ?>>40</option>
<option value="50"<?php if ($courtaddress_list->DisplayRecs == 50) { ?> selected<?php } ?>>50</option>
<option value="100"<?php if ($courtaddress_list->DisplayRecs == 100) { ?> selected<?php } ?>>100</option>
<option value="200"<?php if ($courtaddress_list->DisplayRecs == 200) { ?> selected<?php } ?>>200</option>
<option value="500"<?php if ($courtaddress_list->DisplayRecs == 500) { ?> selected<?php } ?>>500</option>
<option value="ALL"<?php if ($courtaddress->getRecordsPerPage() == -1) { ?> selected<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select>
</div>
<?php } ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $courtaddress_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($courtaddress_list->TotalRecs == 0 && !$courtaddress->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $courtaddress_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$courtaddress_list->showPageFooter();
if (DEBUG_ENABLED)
	echo GetDebugMessage();
?>
<?php if (!$courtaddress->isExport()) { ?>
<script>

// Write your table-specific startup script here
// document.write("page loaded");

</script>
<?php if (!$courtaddress->isExport()) { ?>
<script>
ew.scrollableTable("gmp_courtaddress", "", "");
</script>
<?php } ?>
<?php } ?>
<?php include_once "footer.php" ?>
<?php
$courtaddress_list->terminate();
?>
