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

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

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

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

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

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

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

// Dynamic selection lists
fclientcontactlist.lists["x_ClientID"] = <?php echo $clientcontact_list->ClientID->Lookup->toClientList() ?>;
fclientcontactlist.lists["x_ClientID"].options = <?php echo JsonEncode($clientcontact_list->ClientID->lookupOptions()) ?>;
fclientcontactlist.lists["x_ContactTypeID"] = <?php echo $clientcontact_list->ContactTypeID->Lookup->toClientList() ?>;
fclientcontactlist.lists["x_ContactTypeID"].options = <?php echo JsonEncode($clientcontact_list->ContactTypeID->lookupOptions()) ?>;
fclientcontactlist.lists["x_Primary[]"] = <?php echo $clientcontact_list->Primary->Lookup->toClientList() ?>;
fclientcontactlist.lists["x_Primary[]"].options = <?php echo JsonEncode($clientcontact_list->Primary->options(FALSE, TRUE)) ?>;

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

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

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

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

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

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

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

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

// Render list options (header, left)
$clientcontact_list->ListOptions->render("header", "left");
?>
<?php if ($clientcontact->ClientID->Visible) { // ClientID ?>
	<?php if ($clientcontact->sortUrl($clientcontact->ClientID) == "") { ?>
		<th data-name="ClientID" class="<?php echo $clientcontact->ClientID->headerCellClass() ?>"><div id="elh_clientcontact_ClientID" class="clientcontact_ClientID"><div class="ew-table-header-caption"><?php echo $clientcontact->ClientID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="ClientID" class="<?php echo $clientcontact->ClientID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientcontact->SortUrl($clientcontact->ClientID) ?>',2);"><div id="elh_clientcontact_ClientID" class="clientcontact_ClientID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientcontact->ClientID->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientcontact->ClientID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientcontact->ClientID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientcontact->ContactTypeID->Visible) { // ContactTypeID ?>
	<?php if ($clientcontact->sortUrl($clientcontact->ContactTypeID) == "") { ?>
		<th data-name="ContactTypeID" class="<?php echo $clientcontact->ContactTypeID->headerCellClass() ?>"><div id="elh_clientcontact_ContactTypeID" class="clientcontact_ContactTypeID"><div class="ew-table-header-caption"><?php echo $clientcontact->ContactTypeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="ContactTypeID" class="<?php echo $clientcontact->ContactTypeID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientcontact->SortUrl($clientcontact->ContactTypeID) ?>',2);"><div id="elh_clientcontact_ContactTypeID" class="clientcontact_ContactTypeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientcontact->ContactTypeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientcontact->ContactTypeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientcontact->ContactTypeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientcontact->Contact->Visible) { // Contact ?>
	<?php if ($clientcontact->sortUrl($clientcontact->Contact) == "") { ?>
		<th data-name="Contact" class="<?php echo $clientcontact->Contact->headerCellClass() ?>"><div id="elh_clientcontact_Contact" class="clientcontact_Contact"><div class="ew-table-header-caption"><?php echo $clientcontact->Contact->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Contact" class="<?php echo $clientcontact->Contact->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientcontact->SortUrl($clientcontact->Contact) ?>',2);"><div id="elh_clientcontact_Contact" class="clientcontact_Contact">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientcontact->Contact->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientcontact->Contact->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientcontact->Contact->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientcontact->Notes->Visible) { // Notes ?>
	<?php if ($clientcontact->sortUrl($clientcontact->Notes) == "") { ?>
		<th data-name="Notes" class="<?php echo $clientcontact->Notes->headerCellClass() ?>"><div id="elh_clientcontact_Notes" class="clientcontact_Notes"><div class="ew-table-header-caption"><?php echo $clientcontact->Notes->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Notes" class="<?php echo $clientcontact->Notes->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientcontact->SortUrl($clientcontact->Notes) ?>',2);"><div id="elh_clientcontact_Notes" class="clientcontact_Notes">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientcontact->Notes->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($clientcontact->Notes->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientcontact->Notes->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($clientcontact->Primary->Visible) { // Primary ?>
	<?php if ($clientcontact->sortUrl($clientcontact->Primary) == "") { ?>
		<th data-name="Primary" class="<?php echo $clientcontact->Primary->headerCellClass() ?>"><div id="elh_clientcontact_Primary" class="clientcontact_Primary"><div class="ew-table-header-caption"><?php echo $clientcontact->Primary->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Primary" class="<?php echo $clientcontact->Primary->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $clientcontact->SortUrl($clientcontact->Primary) ?>',2);"><div id="elh_clientcontact_Primary" class="clientcontact_Primary">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $clientcontact->Primary->caption() ?></span><span class="ew-table-header-sort"><?php if ($clientcontact->Primary->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($clientcontact->Primary->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$clientcontact_list->ListOptions->render("body", "left", $clientcontact_list->RowCnt);
?>
	<?php if ($clientcontact->ClientID->Visible) { // ClientID ?>
		<td data-name="ClientID"<?php echo $clientcontact->ClientID->cellAttributes() ?>>
<span id="el<?php echo $clientcontact_list->RowCnt ?>_clientcontact_ClientID" class="clientcontact_ClientID">
<span<?php echo $clientcontact->ClientID->viewAttributes() ?>>
<?php echo $clientcontact->ClientID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientcontact->ContactTypeID->Visible) { // ContactTypeID ?>
		<td data-name="ContactTypeID"<?php echo $clientcontact->ContactTypeID->cellAttributes() ?>>
<span id="el<?php echo $clientcontact_list->RowCnt ?>_clientcontact_ContactTypeID" class="clientcontact_ContactTypeID">
<span<?php echo $clientcontact->ContactTypeID->viewAttributes() ?>>
<?php echo $clientcontact->ContactTypeID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientcontact->Contact->Visible) { // Contact ?>
		<td data-name="Contact"<?php echo $clientcontact->Contact->cellAttributes() ?>>
<span id="el<?php echo $clientcontact_list->RowCnt ?>_clientcontact_Contact" class="clientcontact_Contact">
<span<?php echo $clientcontact->Contact->viewAttributes() ?>>
<?php if ((!EmptyString($clientcontact->Contact->getViewValue())) && $clientcontact->Contact->linkAttributes() <> "") { ?>
<a<?php echo $clientcontact->Contact->linkAttributes() ?>><?php echo $clientcontact->Contact->getViewValue() ?></a>
<?php } else { ?>
<?php echo $clientcontact->Contact->getViewValue() ?>
<?php } ?>
</span>
</span>
</td>
	<?php } ?>
	<?php if ($clientcontact->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $clientcontact->Notes->cellAttributes() ?>>
<span id="el<?php echo $clientcontact_list->RowCnt ?>_clientcontact_Notes" class="clientcontact_Notes">
<span<?php echo $clientcontact->Notes->viewAttributes() ?>>
<?php echo $clientcontact->Notes->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($clientcontact->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $clientcontact->Primary->cellAttributes() ?>>
<span id="el<?php echo $clientcontact_list->RowCnt ?>_clientcontact_Primary" class="clientcontact_Primary">
<span<?php echo $clientcontact->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($clientcontact->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $clientcontact->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $clientcontact->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
</td>
	<?php } ?>
<?php

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

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

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

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