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

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

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

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

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

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

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

// Dynamic selection lists
femployeecontactlist.lists["x_EmployeeID"] = <?php echo $employeecontact_list->EmployeeID->Lookup->toClientList() ?>;
femployeecontactlist.lists["x_EmployeeID"].options = <?php echo JsonEncode($employeecontact_list->EmployeeID->lookupOptions()) ?>;
femployeecontactlist.lists["x_ContactTypeID"] = <?php echo $employeecontact_list->ContactTypeID->Lookup->toClientList() ?>;
femployeecontactlist.lists["x_ContactTypeID"].options = <?php echo JsonEncode($employeecontact_list->ContactTypeID->lookupOptions()) ?>;
femployeecontactlist.lists["x_Primary[]"] = <?php echo $employeecontact_list->Primary->Lookup->toClientList() ?>;
femployeecontactlist.lists["x_Primary[]"].options = <?php echo JsonEncode($employeecontact_list->Primary->options(FALSE, TRUE)) ?>;

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

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

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

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

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

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

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

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

// Render list options (header, left)
$employeecontact_list->ListOptions->render("header", "left");
?>
<?php if ($employeecontact->EmployeeID->Visible) { // EmployeeID ?>
	<?php if ($employeecontact->sortUrl($employeecontact->EmployeeID) == "") { ?>
		<th data-name="EmployeeID" class="<?php echo $employeecontact->EmployeeID->headerCellClass() ?>"><div id="elh_employeecontact_EmployeeID" class="employeecontact_EmployeeID"><div class="ew-table-header-caption"><?php echo $employeecontact->EmployeeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="EmployeeID" class="<?php echo $employeecontact->EmployeeID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $employeecontact->SortUrl($employeecontact->EmployeeID) ?>',2);"><div id="elh_employeecontact_EmployeeID" class="employeecontact_EmployeeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $employeecontact->EmployeeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($employeecontact->EmployeeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($employeecontact->EmployeeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($employeecontact->ContactTypeID->Visible) { // ContactTypeID ?>
	<?php if ($employeecontact->sortUrl($employeecontact->ContactTypeID) == "") { ?>
		<th data-name="ContactTypeID" class="<?php echo $employeecontact->ContactTypeID->headerCellClass() ?>"><div id="elh_employeecontact_ContactTypeID" class="employeecontact_ContactTypeID"><div class="ew-table-header-caption"><?php echo $employeecontact->ContactTypeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="ContactTypeID" class="<?php echo $employeecontact->ContactTypeID->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $employeecontact->SortUrl($employeecontact->ContactTypeID) ?>',2);"><div id="elh_employeecontact_ContactTypeID" class="employeecontact_ContactTypeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $employeecontact->ContactTypeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($employeecontact->ContactTypeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($employeecontact->ContactTypeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($employeecontact->Contact->Visible) { // Contact ?>
	<?php if ($employeecontact->sortUrl($employeecontact->Contact) == "") { ?>
		<th data-name="Contact" class="<?php echo $employeecontact->Contact->headerCellClass() ?>"><div id="elh_employeecontact_Contact" class="employeecontact_Contact"><div class="ew-table-header-caption"><?php echo $employeecontact->Contact->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Contact" class="<?php echo $employeecontact->Contact->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $employeecontact->SortUrl($employeecontact->Contact) ?>',2);"><div id="elh_employeecontact_Contact" class="employeecontact_Contact">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $employeecontact->Contact->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($employeecontact->Contact->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($employeecontact->Contact->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($employeecontact->Notes->Visible) { // Notes ?>
	<?php if ($employeecontact->sortUrl($employeecontact->Notes) == "") { ?>
		<th data-name="Notes" class="<?php echo $employeecontact->Notes->headerCellClass() ?>"><div id="elh_employeecontact_Notes" class="employeecontact_Notes"><div class="ew-table-header-caption"><?php echo $employeecontact->Notes->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Notes" class="<?php echo $employeecontact->Notes->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $employeecontact->SortUrl($employeecontact->Notes) ?>',2);"><div id="elh_employeecontact_Notes" class="employeecontact_Notes">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $employeecontact->Notes->caption() ?><?php echo $Language->phrase("SrchLegend") ?></span><span class="ew-table-header-sort"><?php if ($employeecontact->Notes->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($employeecontact->Notes->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($employeecontact->Primary->Visible) { // Primary ?>
	<?php if ($employeecontact->sortUrl($employeecontact->Primary) == "") { ?>
		<th data-name="Primary" class="<?php echo $employeecontact->Primary->headerCellClass() ?>"><div id="elh_employeecontact_Primary" class="employeecontact_Primary"><div class="ew-table-header-caption"><?php echo $employeecontact->Primary->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Primary" class="<?php echo $employeecontact->Primary->headerCellClass() ?>"><div class="ew-pointer" onclick="ew.sort(event,'<?php echo $employeecontact->SortUrl($employeecontact->Primary) ?>',2);"><div id="elh_employeecontact_Primary" class="employeecontact_Primary">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $employeecontact->Primary->caption() ?></span><span class="ew-table-header-sort"><?php if ($employeecontact->Primary->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($employeecontact->Primary->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

// Render list options (body, left)
$employeecontact_list->ListOptions->render("body", "left", $employeecontact_list->RowCnt);
?>
	<?php if ($employeecontact->EmployeeID->Visible) { // EmployeeID ?>
		<td data-name="EmployeeID"<?php echo $employeecontact->EmployeeID->cellAttributes() ?>>
<span id="el<?php echo $employeecontact_list->RowCnt ?>_employeecontact_EmployeeID" class="employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<?php echo $employeecontact->EmployeeID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($employeecontact->ContactTypeID->Visible) { // ContactTypeID ?>
		<td data-name="ContactTypeID"<?php echo $employeecontact->ContactTypeID->cellAttributes() ?>>
<span id="el<?php echo $employeecontact_list->RowCnt ?>_employeecontact_ContactTypeID" class="employeecontact_ContactTypeID">
<span<?php echo $employeecontact->ContactTypeID->viewAttributes() ?>>
<?php echo $employeecontact->ContactTypeID->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($employeecontact->Contact->Visible) { // Contact ?>
		<td data-name="Contact"<?php echo $employeecontact->Contact->cellAttributes() ?>>
<span id="el<?php echo $employeecontact_list->RowCnt ?>_employeecontact_Contact" class="employeecontact_Contact">
<span<?php echo $employeecontact->Contact->viewAttributes() ?>>
<?php echo $employeecontact->Contact->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($employeecontact->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $employeecontact->Notes->cellAttributes() ?>>
<span id="el<?php echo $employeecontact_list->RowCnt ?>_employeecontact_Notes" class="employeecontact_Notes">
<span<?php echo $employeecontact->Notes->viewAttributes() ?>>
<?php echo $employeecontact->Notes->getViewValue() ?></span>
</span>
</td>
	<?php } ?>
	<?php if ($employeecontact->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $employeecontact->Primary->cellAttributes() ?>>
<span id="el<?php echo $employeecontact_list->RowCnt ?>_employeecontact_Primary" class="employeecontact_Primary">
<span<?php echo $employeecontact->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($employeecontact->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $employeecontact->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $employeecontact->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
</td>
	<?php } ?>
<?php

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

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

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

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