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

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

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

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

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

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

// Form_CustomValidate event
fclientaddresslist.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
fclientaddresslist.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
fclientaddresslist.lists["x_ClientID"] = <?php echo $clientaddress_list->ClientID->Lookup->toClientList() ?>;
fclientaddresslist.lists["x_ClientID"].options = <?php echo JsonEncode($clientaddress_list->ClientID->lookupOptions()) ?>;
fclientaddresslist.lists["x_AddressTypeID"] = <?php echo $clientaddress_list->AddressTypeID->Lookup->toClientList() ?>;
fclientaddresslist.lists["x_AddressTypeID"].options = <?php echo JsonEncode($clientaddress_list->AddressTypeID->lookupOptions()) ?>;
fclientaddresslist.lists["x_Primary[]"] = <?php echo $clientaddress_list->Primary->Lookup->toClientList() ?>;
fclientaddresslist.lists["x_Primary[]"].options = <?php echo JsonEncode($clientaddress_list->Primary->options(FALSE, TRUE)) ?>;

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

// Validate function for search
fclientaddresslistsrch.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
fclientaddresslistsrch.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
fclientaddresslistsrch.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

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

// Filters
fclientaddresslistsrch.filterList = <?php echo $clientaddress_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 (!$clientaddress->isExport()) { ?>
<div class="btn-toolbar ew-toolbar">
<?php if ($clientaddress_list->TotalRecs > 0 && $clientaddress_list->ExportOptions->visible()) { ?>
<?php $clientaddress_list->ExportOptions->render("body") ?>
<?php } ?>
<?php if ($clientaddress_list->ImportOptions->visible()) { ?>
<?php $clientaddress_list->ImportOptions->render("body") ?>
<?php } ?>
<?php if ($clientaddress_list->SearchOptions->visible()) { ?>
<?php $clientaddress_list->SearchOptions->render("body") ?>
<?php } ?>
<?php if ($clientaddress_list->FilterOptions->visible()) { ?>
<?php $clientaddress_list->FilterOptions->render("body") ?>
<?php } ?>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if (!$clientaddress->isExport() || EXPORT_MASTER_RECORD && $clientaddress->isExport("print")) { ?>
<?php
if ($clientaddress_list->DbMasterFilter <> "" && $clientaddress->getCurrentMasterTable() == "clients") {
	if ($clientaddress_list->MasterRecordExists) {
		include_once "clientsmaster.php";
	}
}
?>
<?php } ?>
<?php
$clientaddress_list->renderOtherOptions();
?>
<?php if ($Security->CanSearch()) { ?>
<?php if (!$clientaddress->isExport() && !$clientaddress->CurrentAction) { ?>
<form name="fclientaddresslistsrch" id="fclientaddresslistsrch" class="form-inline ew-form ew-ext-search-form" action="<?php echo CurrentPageName() ?>">
<?php $searchPanelClass = ($clientaddress_list->SearchWhere <> "") ? " show" : " show"; ?>
<div id="fclientaddresslistsrch-search-panel" class="ew-search-panel collapse<?php echo $searchPanelClass ?>">
<input type="hidden" name="cmd" value="search">
<input type="hidden" name="t" value="clientaddress">
	<div class="ew-basic-search">
<?php
if ($SearchError == "")
	$clientaddress_list->LoadAdvancedSearch(); // Load advanced search

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

// Render row
$clientaddress->resetAttributes();
$clientaddress_list->renderRow();
?>
<div id="xsr_1" class="ew-row d-sm-flex">
<?php if ($clientaddress->Primary->Visible) { // Primary ?>
	<div id="xsc_Primary" class="ew-cell form-group">
		<label class="ew-search-caption ew-label"><?php echo $clientaddress->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($clientaddress->Primary->AdvancedSearch->SearchValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x_Primary[]" id="x_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->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($clientaddress_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($clientaddress_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 $clientaddress_list->BasicSearch->getTypeNameShort() ?></span></button>
			<div class="dropdown-menu dropdown-menu-right">
				<a class="dropdown-item<?php if ($clientaddress_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 ($clientaddress_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 ($clientaddress_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 ($clientaddress_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 $clientaddress_list->showPageHeader(); ?>
<?php
$clientaddress_list->showMessage();
?>
<?php if ($clientaddress_list->TotalRecs > 0 || $clientaddress->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($clientaddress_list->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> clientaddress">
<?php if (!$clientaddress->isExport()) { ?>
<div class="card-header ew-grid-upper-panel">
<?php if (!$clientaddress->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($clientaddress_list->Pager)) $clientaddress_list->Pager = new PrevNextPager($clientaddress_list->StartRec, $clientaddress_list->DisplayRecs, $clientaddress_list->TotalRecs, $clientaddress_list->AutoHidePager) ?>
<?php if ($clientaddress_list->Pager->RecordCount > 0 && $clientaddress_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 ($clientaddress_list->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 ($clientaddress_list->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 $clientaddress_list->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($clientaddress_list->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 ($clientaddress_list->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 $clientaddress_list->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if ($clientaddress_list->Pager->RecordCount > 0) { ?>
<div class="ew-pager ew-rec">
	<span><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $clientaddress_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $clientaddress_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $clientaddress_list->Pager->RecordCount ?></span>
</div>
<?php } ?>
<?php if ($clientaddress_list->TotalRecs > 0 && (!$clientaddress_list->AutoHidePageSizeSelector || $clientaddress_list->Pager->Visible)) { ?>
<div class="ew-pager">
<input type="hidden" name="t" value="clientaddress">
<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 ($clientaddress_list->DisplayRecs == 5) { ?> selected<?php } ?>>5</option>
<option value="10"<?php if ($clientaddress_list->DisplayRecs == 10) { ?> selected<?php } ?>>10</option>
<option value="20"<?php if ($clientaddress_list->DisplayRecs == 20) { ?> selected<?php } ?>>20</option>
<option value="30"<?php if ($clientaddress_list->DisplayRecs == 30) { ?> selected<?php } ?>>30</option>
<option value="40"<?php if ($clientaddress_list->DisplayRecs == 40) { ?> selected<?php } ?>>40</option>
<option value="50"<?php if ($clientaddress_list->DisplayRecs == 50) { ?> selected<?php } ?>>50</option>
<option value="100"<?php if ($clientaddress_list->DisplayRecs == 100) { ?> selected<?php } ?>>100</option>
<option value="200"<?php if ($clientaddress_list->DisplayRecs == 200) { ?> selected<?php } ?>>200</option>
<option value="500"<?php if ($clientaddress_list->DisplayRecs == 500) { ?> selected<?php } ?>>500</option>
<option value="ALL"<?php if ($clientaddress->getRecordsPerPage() == -1) { ?> selected<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select>
</div>
<?php } ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $clientaddress_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
<form name="fclientaddresslist" id="fclientaddresslist" class="form-inline ew-form ew-list-form" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($clientaddress_list->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $clientaddress_list->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="clientaddress">
<?php if ($clientaddress->getCurrentMasterTable() == "clients" && $clientaddress->CurrentAction) { ?>
<input type="hidden" name="<?php echo TABLE_SHOW_MASTER ?>" value="clients">
<input type="hidden" name="fk_ClientID" value="<?php echo $clientaddress->ClientID->getSessionValue() ?>">
<?php } ?>
<div id="gmp_clientaddress" class="<?php if (IsResponsiveLayout()) { ?>table-responsive <?php } ?>card-body ew-grid-middle-panel">
<?php if ($clientaddress_list->TotalRecs > 0 || $clientaddress->isGridEdit()) { ?>
<table id="tbl_clientaddresslist" class="table ew-table"><!-- .ew-table ##-->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$clientaddress_list->ListOptions->render("header", "left");
?>
<?php if ($clientaddress->ClientID->Visible) { // ClientID ?>
	<?php if ($clientaddress->sortUrl($clientaddress->ClientID) == "") { ?>
		<th data-name="ClientID" class="<?php echo $clientaddress->ClientID->headerCellClass() ?>"><div id="elh_clientaddress_ClientID" class="clientaddress_ClientID"><div class="ew-table-header-caption"><?php echo $clientaddress->ClientID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="ClientID" class="<?php echo $clientaddress->ClientID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->ClientID) ?>',2);"><div id="elh_clientaddress_ClientID" class="clientaddress_ClientID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->ClientID->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->ClientID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->ClientID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->AddressTypeID->Visible) { // AddressTypeID ?>
	<?php if ($clientaddress->sortUrl($clientaddress->AddressTypeID) == "") { ?>
		<th data-name="AddressTypeID" class="<?php echo $clientaddress->AddressTypeID->headerCellClass() ?>"><div id="elh_clientaddress_AddressTypeID" class="clientaddress_AddressTypeID"><div class="ew-table-header-caption"><?php echo $clientaddress->AddressTypeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AddressTypeID" class="<?php echo $clientaddress->AddressTypeID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->AddressTypeID) ?>',2);"><div id="elh_clientaddress_AddressTypeID" class="clientaddress_AddressTypeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->AddressTypeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->AddressTypeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->AddressTypeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->Address->Visible) { // Address ?>
	<?php if ($clientaddress->sortUrl($clientaddress->Address) == "") { ?>
		<th data-name="Address" class="<?php echo $clientaddress->Address->headerCellClass() ?>"><div id="elh_clientaddress_Address" class="clientaddress_Address"><div class="ew-table-header-caption"><?php echo $clientaddress->Address->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Address" class="<?php echo $clientaddress->Address->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->Address) ?>',2);"><div id="elh_clientaddress_Address" class="clientaddress_Address">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->Address->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->Address->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->Address->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->City->Visible) { // City ?>
	<?php if ($clientaddress->sortUrl($clientaddress->City) == "") { ?>
		<th data-name="City" class="<?php echo $clientaddress->City->headerCellClass() ?>"><div id="elh_clientaddress_City" class="clientaddress_City"><div class="ew-table-header-caption"><?php echo $clientaddress->City->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="City" class="<?php echo $clientaddress->City->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->City) ?>',2);"><div id="elh_clientaddress_City" class="clientaddress_City">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->City->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->City->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->City->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->Region->Visible) { // Region ?>
	<?php if ($clientaddress->sortUrl($clientaddress->Region) == "") { ?>
		<th data-name="Region" class="<?php echo $clientaddress->Region->headerCellClass() ?>"><div id="elh_clientaddress_Region" class="clientaddress_Region"><div class="ew-table-header-caption"><?php echo $clientaddress->Region->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Region" class="<?php echo $clientaddress->Region->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->Region) ?>',2);"><div id="elh_clientaddress_Region" class="clientaddress_Region">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->Region->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->Region->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->Region->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->PostalCode->Visible) { // PostalCode ?>
	<?php if ($clientaddress->sortUrl($clientaddress->PostalCode) == "") { ?>
		<th data-name="PostalCode" class="<?php echo $clientaddress->PostalCode->headerCellClass() ?>"><div id="elh_clientaddress_PostalCode" class="clientaddress_PostalCode"><div class="ew-table-header-caption"><?php echo $clientaddress->PostalCode->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="PostalCode" class="<?php echo $clientaddress->PostalCode->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->PostalCode) ?>',2);"><div id="elh_clientaddress_PostalCode" class="clientaddress_PostalCode">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->PostalCode->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->PostalCode->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->PostalCode->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->Country->Visible) { // Country ?>
	<?php if ($clientaddress->sortUrl($clientaddress->Country) == "") { ?>
		<th data-name="Country" class="<?php echo $clientaddress->Country->headerCellClass() ?>"><div id="elh_clientaddress_Country" class="clientaddress_Country"><div class="ew-table-header-caption"><?php echo $clientaddress->Country->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Country" class="<?php echo $clientaddress->Country->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->Country) ?>',2);"><div id="elh_clientaddress_Country" class="clientaddress_Country">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->Country->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->Country->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->Country->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->Notes->Visible) { // Notes ?>
	<?php if ($clientaddress->sortUrl($clientaddress->Notes) == "") { ?>
		<th data-name="Notes" class="<?php echo $clientaddress->Notes->headerCellClass() ?>"><div id="elh_clientaddress_Notes" class="clientaddress_Notes"><div class="ew-table-header-caption"><?php echo $clientaddress->Notes->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Notes" class="<?php echo $clientaddress->Notes->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->Notes) ?>',2);"><div id="elh_clientaddress_Notes" class="clientaddress_Notes">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->Notes->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->Notes->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->Notes->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientaddress->Primary->Visible) { // Primary ?>
	<?php if ($clientaddress->sortUrl($clientaddress->Primary) == "") { ?>
		<th data-name="Primary" class="<?php echo $clientaddress->Primary->headerCellClass() ?>"><div id="elh_clientaddress_Primary" class="clientaddress_Primary"><div class="ew-table-header-caption"><?php echo $clientaddress->Primary->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Primary" class="<?php echo $clientaddress->Primary->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientaddress->SortUrl($clientaddress->Primary) ?>',2);"><div id="elh_clientaddress_Primary" class="clientaddress_Primary">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientaddress->Primary->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientaddress->Primary->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientaddress->Primary->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$clientaddress_list->ListOptions->render("body", "left", $clientaddress_list->RowCnt);
?>
	<?php if ($clientaddress->ClientID->Visible) { // ClientID ?>
		<td data-name="ClientID"<?php echo $clientaddress->ClientID->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_ClientID" class="clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<?php echo $clientaddress->ClientID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID"<?php echo $clientaddress->AddressTypeID->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_AddressTypeID" class="clientaddress_AddressTypeID">
<span<?php echo $clientaddress->AddressTypeID->viewAttributes() ?>>
<?php echo $clientaddress->AddressTypeID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->Address->Visible) { // Address ?>
		<td data-name="Address"<?php echo $clientaddress->Address->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_Address" class="clientaddress_Address">
<span<?php echo $clientaddress->Address->viewAttributes() ?>>
<?php echo $clientaddress->Address->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->City->Visible) { // City ?>
		<td data-name="City"<?php echo $clientaddress->City->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_City" class="clientaddress_City">
<span<?php echo $clientaddress->City->viewAttributes() ?>>
<?php echo $clientaddress->City->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->Region->Visible) { // Region ?>
		<td data-name="Region"<?php echo $clientaddress->Region->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_Region" class="clientaddress_Region">
<span<?php echo $clientaddress->Region->viewAttributes() ?>>
<?php echo $clientaddress->Region->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode"<?php echo $clientaddress->PostalCode->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_PostalCode" class="clientaddress_PostalCode">
<span<?php echo $clientaddress->PostalCode->viewAttributes() ?>>
<?php echo $clientaddress->PostalCode->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->Country->Visible) { // Country ?>
		<td data-name="Country"<?php echo $clientaddress->Country->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_Country" class="clientaddress_Country">
<span<?php echo $clientaddress->Country->viewAttributes() ?>>
<?php echo $clientaddress->Country->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $clientaddress->Notes->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_Notes" class="clientaddress_Notes">
<span<?php echo $clientaddress->Notes->viewAttributes() ?>>
<?php echo $clientaddress->Notes->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $clientaddress->Primary->cellAttributes() ?>>
<span id="el<?php echo $clientaddress_list->RowCnt ?>_clientaddress_Primary" class="clientaddress_Primary">
<span<?php echo $clientaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($clientaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($clientaddress_list->Recordset)
	$clientaddress_list->Recordset->Close();
?>
<?php if (!$clientaddress->isExport()) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php if (!$clientaddress->isGridAdd()) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($clientaddress_list->Pager)) $clientaddress_list->Pager = new PrevNextPager($clientaddress_list->StartRec, $clientaddress_list->DisplayRecs, $clientaddress_list->TotalRecs, $clientaddress_list->AutoHidePager) ?>
<?php if ($clientaddress_list->Pager->RecordCount > 0 && $clientaddress_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 ($clientaddress_list->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 ($clientaddress_list->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 $clientaddress_list->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($clientaddress_list->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 ($clientaddress_list->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $clientaddress_list->pageUrl() ?>start=<?php echo $clientaddress_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 $clientaddress_list->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<?php if ($clientaddress_list->Pager->RecordCount > 0) { ?>
<div class="ew-pager ew-rec">
	<span><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $clientaddress_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $clientaddress_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $clientaddress_list->Pager->RecordCount ?></span>
</div>
<?php } ?>
<?php if ($clientaddress_list->TotalRecs > 0 && (!$clientaddress_list->AutoHidePageSizeSelector || $clientaddress_list->Pager->Visible)) { ?>
<div class="ew-pager">
<input type="hidden" name="t" value="clientaddress">
<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 ($clientaddress_list->DisplayRecs == 5) { ?> selected<?php } ?>>5</option>
<option value="10"<?php if ($clientaddress_list->DisplayRecs == 10) { ?> selected<?php } ?>>10</option>
<option value="20"<?php if ($clientaddress_list->DisplayRecs == 20) { ?> selected<?php } ?>>20</option>
<option value="30"<?php if ($clientaddress_list->DisplayRecs == 30) { ?> selected<?php } ?>>30</option>
<option value="40"<?php if ($clientaddress_list->DisplayRecs == 40) { ?> selected<?php } ?>>40</option>
<option value="50"<?php if ($clientaddress_list->DisplayRecs == 50) { ?> selected<?php } ?>>50</option>
<option value="100"<?php if ($clientaddress_list->DisplayRecs == 100) { ?> selected<?php } ?>>100</option>
<option value="200"<?php if ($clientaddress_list->DisplayRecs == 200) { ?> selected<?php } ?>>200</option>
<option value="500"<?php if ($clientaddress_list->DisplayRecs == 500) { ?> selected<?php } ?>>500</option>
<option value="ALL"<?php if ($clientaddress->getRecordsPerPage() == -1) { ?> selected<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select>
</div>
<?php } ?>
</form>
<?php } ?>
<div class="ew-list-other-options">
<?php $clientaddress_list->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
</div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($clientaddress_list->TotalRecs == 0 && !$clientaddress->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $clientaddress_list->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$clientaddress_list->showPageFooter();
if (DEBUG_ENABLED)
	echo GetDebugMessage();
?>
<?php if (!$clientaddress->isExport()) { ?>
<script>

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

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