<?php
namespace PHPMaker2019\project_germanos;

// Write header
WriteHeader(FALSE);

// Create page object
if (!isset($employeecontact_grid))
	$employeecontact_grid = new employeecontact_grid();

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

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

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

// Page Rendering event
$employeecontact_grid->Page_Render();
?>
<?php if (!$employeecontact->isExport()) { ?>
<script>

// Form object
var femployeecontactgrid = new ew.Form("femployeecontactgrid", "grid");
femployeecontactgrid.formKeyCountName = '<?php echo $employeecontact_grid->FormKeyCountName ?>';

// Validate form
femployeecontactgrid.validate = function() {
	if (!this.validateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.getForm(), $fobj = $(fobj);
	if ($fobj.find("#confirm").val() == "F")
		return true;
	var elm, felm, uelm, addcnt = 0;
	var $k = $fobj.find("#" + this.formKeyCountName); // Get key_count
	var rowcnt = ($k[0]) ? parseInt($k.val(), 10) : 1;
	var startcnt = (rowcnt == 0) ? 0 : 1; // Check rowcnt == 0 => Inline-Add
	var gridinsert = ["insert", "gridinsert"].includes($fobj.find("#action").val()) && $k[0];
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
		var checkrow = (gridinsert) ? !this.emptyRow(infix) : true;
		if (checkrow) {
			addcnt++;
		<?php if ($employeecontact_grid->EmployeeID->Required) { ?>
			elm = this.getElements("x" + infix + "_EmployeeID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $employeecontact->EmployeeID->caption(), $employeecontact->EmployeeID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($employeecontact_grid->ContactTypeID->Required) { ?>
			elm = this.getElements("x" + infix + "_ContactTypeID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $employeecontact->ContactTypeID->caption(), $employeecontact->ContactTypeID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($employeecontact_grid->Contact->Required) { ?>
			elm = this.getElements("x" + infix + "_Contact");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $employeecontact->Contact->caption(), $employeecontact->Contact->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($employeecontact_grid->Notes->Required) { ?>
			elm = this.getElements("x" + infix + "_Notes");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $employeecontact->Notes->caption(), $employeecontact->Notes->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($employeecontact_grid->Primary->Required) { ?>
			elm = this.getElements("x" + infix + "_Primary[]");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $employeecontact->Primary->caption(), $employeecontact->Primary->RequiredErrorMessage)) ?>");
		<?php } ?>

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

// Check empty row
femployeecontactgrid.emptyRow = function(infix) {
	var fobj = this._form;
	if (ew.valueChanged(fobj, infix, "EmployeeID", false)) return false;
	if (ew.valueChanged(fobj, infix, "ContactTypeID", false)) return false;
	if (ew.valueChanged(fobj, infix, "Contact", false)) return false;
	if (ew.valueChanged(fobj, infix, "Notes", false)) return false;
	if (ew.valueChanged(fobj, infix, "Primary[]", true)) return false;
	return true;
}

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

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

// Form object for search
</script>
<script src="phpjs/ewscrolltable.js"></script>
<?php } ?>
<?php
$employeecontact_grid->renderOtherOptions();
?>
<?php $employeecontact_grid->showPageHeader(); ?>
<?php
$employeecontact_grid->showMessage();
?>
<?php if ($employeecontact_grid->TotalRecs > 0 || $employeecontact->CurrentAction) { ?>
<div class="card ew-card ew-grid<?php if ($employeecontact_grid->isAddOrEdit()) { ?> ew-grid-add-edit<?php } ?> employeecontact">
<?php if ($employeecontact_grid->ShowOtherOptions) { ?>
<div class="card-header ew-grid-upper-panel">
<?php $employeecontact_grid->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<div id="femployeecontactgrid" class="ew-form ew-list-form form-inline">
<div id="gmp_employeecontact" class="<?php if (IsResponsiveLayout()) { ?>table-responsive <?php } ?>card-body ew-grid-middle-panel">
<table id="tbl_employeecontactgrid" class="table ew-table"><!-- .ew-table ##-->
<thead>
	<tr class="ew-table-header">
<?php

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

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

// Render list options (header, left)
$employeecontact_grid->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><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><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><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() ?></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><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() ?></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><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_grid->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$employeecontact_grid->StartRec = 1;
$employeecontact_grid->StopRec = $employeecontact_grid->TotalRecs; // Show all records

// Restore number of post back records
if ($CurrentForm && $employeecontact_grid->EventCancelled) {
	$CurrentForm->Index = -1;
	if ($CurrentForm->hasValue($employeecontact_grid->FormKeyCountName) && ($employeecontact->isGridAdd() || $employeecontact->isGridEdit() || $employeecontact->isConfirm())) {
		$employeecontact_grid->KeyCount = $CurrentForm->getValue($employeecontact_grid->FormKeyCountName);
		$employeecontact_grid->StopRec = $employeecontact_grid->StartRec + $employeecontact_grid->KeyCount - 1;
	}
}
$employeecontact_grid->RecCnt = $employeecontact_grid->StartRec - 1;
if ($employeecontact_grid->Recordset && !$employeecontact_grid->Recordset->EOF) {
	$employeecontact_grid->Recordset->moveFirst();
	$selectLimit = $employeecontact_grid->UseSelectLimit;
	if (!$selectLimit && $employeecontact_grid->StartRec > 1)
		$employeecontact_grid->Recordset->move($employeecontact_grid->StartRec - 1);
} elseif (!$employeecontact->AllowAddDeleteRow && $employeecontact_grid->StopRec == 0) {
	$employeecontact_grid->StopRec = $employeecontact->GridAddRowCount;
}

// Initialize aggregate
$employeecontact->RowType = ROWTYPE_AGGREGATEINIT;
$employeecontact->resetAttributes();
$employeecontact_grid->renderRow();
if ($employeecontact->isGridAdd())
	$employeecontact_grid->RowIndex = 0;
if ($employeecontact->isGridEdit())
	$employeecontact_grid->RowIndex = 0;
while ($employeecontact_grid->RecCnt < $employeecontact_grid->StopRec) {
	$employeecontact_grid->RecCnt++;
	if ($employeecontact_grid->RecCnt >= $employeecontact_grid->StartRec) {
		$employeecontact_grid->RowCnt++;
		if ($employeecontact->isGridAdd() || $employeecontact->isGridEdit() || $employeecontact->isConfirm()) {
			$employeecontact_grid->RowIndex++;
			$CurrentForm->Index = $employeecontact_grid->RowIndex;
			if ($CurrentForm->hasValue($employeecontact_grid->FormActionName) && $employeecontact_grid->EventCancelled)
				$employeecontact_grid->RowAction = strval($CurrentForm->getValue($employeecontact_grid->FormActionName));
			elseif ($employeecontact->isGridAdd())
				$employeecontact_grid->RowAction = "insert";
			else
				$employeecontact_grid->RowAction = "";
		}

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

		// Init row class and style
		$employeecontact->resetAttributes();
		$employeecontact->CssClass = "";
		if ($employeecontact->isGridAdd()) {
			if ($employeecontact->CurrentMode == "copy") {
				$employeecontact_grid->loadRowValues($employeecontact_grid->Recordset); // Load row values
				$employeecontact_grid->setRecordKey($employeecontact_grid->RowOldKey, $employeecontact_grid->Recordset); // Set old record key
			} else {
				$employeecontact_grid->loadRowValues(); // Load default values
				$employeecontact_grid->RowOldKey = ""; // Clear old key value
			}
		} else {
			$employeecontact_grid->loadRowValues($employeecontact_grid->Recordset); // Load row values
		}
		$employeecontact->RowType = ROWTYPE_VIEW; // Render view
		if ($employeecontact->isGridAdd()) // Grid add
			$employeecontact->RowType = ROWTYPE_ADD; // Render add
		if ($employeecontact->isGridAdd() && $employeecontact->EventCancelled && !$CurrentForm->hasValue("k_blankrow")) // Insert failed
			$employeecontact_grid->restoreCurrentRowFormValues($employeecontact_grid->RowIndex); // Restore form values
		if ($employeecontact->isGridEdit()) { // Grid edit
			if ($employeecontact->EventCancelled)
				$employeecontact_grid->restoreCurrentRowFormValues($employeecontact_grid->RowIndex); // Restore form values
			if ($employeecontact_grid->RowAction == "insert")
				$employeecontact->RowType = ROWTYPE_ADD; // Render add
			else
				$employeecontact->RowType = ROWTYPE_EDIT; // Render edit
		}
		if ($employeecontact->isGridEdit() && ($employeecontact->RowType == ROWTYPE_EDIT || $employeecontact->RowType == ROWTYPE_ADD) && $employeecontact->EventCancelled) // Update failed
			$employeecontact_grid->restoreCurrentRowFormValues($employeecontact_grid->RowIndex); // Restore form values
		if ($employeecontact->RowType == ROWTYPE_EDIT) // Edit row
			$employeecontact_grid->EditRowCnt++;
		if ($employeecontact->isConfirm()) // Confirm row
			$employeecontact_grid->restoreCurrentRowFormValues($employeecontact_grid->RowIndex); // Restore form values

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

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

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

		// Skip delete row / empty row for confirm page
		if ($employeecontact_grid->RowAction <> "delete" && $employeecontact_grid->RowAction <> "insertdelete" && !($employeecontact_grid->RowAction == "insert" && $employeecontact->isConfirm() && $employeecontact_grid->emptyRow())) {
?>
	<tr<?php echo $employeecontact->rowAttributes() ?>>
<?php

// Render list options (body, left)
$employeecontact_grid->ListOptions->render("body", "left", $employeecontact_grid->RowCnt);
?>
	<?php if ($employeecontact->EmployeeID->Visible) { // EmployeeID ?>
		<td data-name="EmployeeID"<?php echo $employeecontact->EmployeeID->cellAttributes() ?>>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<?php if ($employeecontact->EmployeeID->getSessionValue() <> "") { ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->EmployeeID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_EmployeeID" data-value-separator="<?php echo $employeecontact->EmployeeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID"<?php echo $employeecontact->EmployeeID->editAttributes() ?>>
		<?php echo $employeecontact->EmployeeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID") ?>
	</select>
</div>
<?php echo $employeecontact->EmployeeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_EmployeeID") ?>
</span>
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT) { // Edit record ?>
<?php if ($employeecontact->EmployeeID->getSessionValue() <> "") { ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->EmployeeID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_EmployeeID" data-value-separator="<?php echo $employeecontact->EmployeeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID"<?php echo $employeecontact->EmployeeID->editAttributes() ?>>
		<?php echo $employeecontact->EmployeeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID") ?>
	</select>
</div>
<?php echo $employeecontact->EmployeeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_EmployeeID") ?>
</span>
<?php } ?>
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_EmployeeID" class="employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<?php echo $employeecontact->EmployeeID->getViewValue() ?></span>
</span>
<?php if (!$employeecontact->isConfirm()) { ?>
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-table="employeecontact" data-field="x_ContactID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactID" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactID" value="<?php echo HtmlEncode($employeecontact->ContactID->CurrentValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_ContactID" name="o<?php echo $employeecontact_grid->RowIndex ?>_ContactID" id="o<?php echo $employeecontact_grid->RowIndex ?>_ContactID" value="<?php echo HtmlEncode($employeecontact->ContactID->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT || $employeecontact->CurrentMode == "edit") { ?>
<input type="hidden" data-table="employeecontact" data-field="x_ContactID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactID" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactID" value="<?php echo HtmlEncode($employeecontact->ContactID->CurrentValue) ?>">
<?php } ?>
	<?php if ($employeecontact->ContactTypeID->Visible) { // ContactTypeID ?>
		<td data-name="ContactTypeID"<?php echo $employeecontact->ContactTypeID->cellAttributes() ?>>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_ContactTypeID" class="form-group employeecontact_ContactTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_ContactTypeID" data-value-separator="<?php echo $employeecontact->ContactTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID"<?php echo $employeecontact->ContactTypeID->editAttributes() ?>>
		<?php echo $employeecontact->ContactTypeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID") ?>
	</select>
</div>
<?php echo $employeecontact->ContactTypeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_ContactTypeID") ?>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_ContactTypeID" class="form-group employeecontact_ContactTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_ContactTypeID" data-value-separator="<?php echo $employeecontact->ContactTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID"<?php echo $employeecontact->ContactTypeID->editAttributes() ?>>
		<?php echo $employeecontact->ContactTypeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID") ?>
	</select>
</div>
<?php echo $employeecontact->ContactTypeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_ContactTypeID") ?>
</span>
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_ContactTypeID" class="employeecontact_ContactTypeID">
<span<?php echo $employeecontact->ContactTypeID->viewAttributes() ?>>
<?php echo $employeecontact->ContactTypeID->getViewValue() ?></span>
</span>
<?php if (!$employeecontact->isConfirm()) { ?>
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($employeecontact->Contact->Visible) { // Contact ?>
		<td data-name="Contact"<?php echo $employeecontact->Contact->cellAttributes() ?>>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Contact" class="form-group employeecontact_Contact">
<input type="text" data-table="employeecontact" data-field="x_Contact" name="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($employeecontact->Contact->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Contact->EditValue ?>"<?php echo $employeecontact->Contact->editAttributes() ?>>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Contact" class="form-group employeecontact_Contact">
<input type="text" data-table="employeecontact" data-field="x_Contact" name="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($employeecontact->Contact->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Contact->EditValue ?>"<?php echo $employeecontact->Contact->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Contact" class="employeecontact_Contact">
<span<?php echo $employeecontact->Contact->viewAttributes() ?>>
<?php echo $employeecontact->Contact->getViewValue() ?></span>
</span>
<?php if (!$employeecontact->isConfirm()) { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($employeecontact->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $employeecontact->Notes->cellAttributes() ?>>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Notes" class="form-group employeecontact_Notes">
<input type="text" data-table="employeecontact" data-field="x_Notes" name="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($employeecontact->Notes->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Notes->EditValue ?>"<?php echo $employeecontact->Notes->editAttributes() ?>>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Notes" class="form-group employeecontact_Notes">
<input type="text" data-table="employeecontact" data-field="x_Notes" name="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($employeecontact->Notes->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Notes->EditValue ?>"<?php echo $employeecontact->Notes->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Notes" class="employeecontact_Notes">
<span<?php echo $employeecontact->Notes->viewAttributes() ?>>
<?php echo $employeecontact->Notes->getViewValue() ?></span>
</span>
<?php if (!$employeecontact->isConfirm()) { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($employeecontact->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $employeecontact->Primary->cellAttributes() ?>>
<?php if ($employeecontact->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Primary" class="form-group employeecontact_Primary">
<?php
$selwrk = (ConvertToBool($employeecontact->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="employeecontact" data-field="x_Primary" name="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $employeecontact->Primary->editAttributes() ?>>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($employeecontact->Primary->OldValue) ?>">
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $employeecontact_grid->RowCnt ?>_employeecontact_Primary" class="form-group employeecontact_Primary">
<?php
$selwrk = (ConvertToBool($employeecontact->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="employeecontact" data-field="x_Primary" name="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $employeecontact->Primary->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($employeecontact->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $employeecontact_grid->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>
<?php if (!$employeecontact->isConfirm()) { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="x<?php echo $employeecontact_grid->RowIndex ?>_Primary" id="x<?php echo $employeecontact_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($employeecontact->Primary->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($employeecontact->Primary->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Primary" id="femployeecontactgrid$x<?php echo $employeecontact_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($employeecontact->Primary->FormValue) ?>">
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="femployeecontactgrid$o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($employeecontact->Primary->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$employeecontact_grid->ListOptions->render("body", "right", $employeecontact_grid->RowCnt);
?>
	</tr>
<?php if ($employeecontact->RowType == ROWTYPE_ADD || $employeecontact->RowType == ROWTYPE_EDIT) { ?>
<script>
femployeecontactgrid.updateLists(<?php echo $employeecontact_grid->RowIndex ?>);
</script>
<?php } ?>
<?php
	}
	} // End delete row checking
	if (!$employeecontact->isGridAdd() || $employeecontact->CurrentMode == "copy")
		if (!$employeecontact_grid->Recordset->EOF)
			$employeecontact_grid->Recordset->moveNext();
}
?>
<?php
	if ($employeecontact->CurrentMode == "add" || $employeecontact->CurrentMode == "copy" || $employeecontact->CurrentMode == "edit") {
		$employeecontact_grid->RowIndex = '$rowindex$';
		$employeecontact_grid->loadRowValues();

		// Set row properties
		$employeecontact->resetAttributes();
		$employeecontact->RowAttrs = array_merge($employeecontact->RowAttrs, array('data-rowindex'=>$employeecontact_grid->RowIndex, 'id'=>'r0_employeecontact', 'data-rowtype'=>ROWTYPE_ADD));
		AppendClass($employeecontact->RowAttrs["class"], "ew-template");
		$employeecontact->RowType = ROWTYPE_ADD;

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

		// Render list options
		$employeecontact_grid->renderListOptions();
		$employeecontact_grid->StartRowCnt = 0;
?>
	<tr<?php echo $employeecontact->rowAttributes() ?>>
<?php

// Render list options (body, left)
$employeecontact_grid->ListOptions->render("body", "left", $employeecontact_grid->RowIndex);
?>
	<?php if ($employeecontact->EmployeeID->Visible) { // EmployeeID ?>
		<td data-name="EmployeeID">
<?php if (!$employeecontact->isConfirm()) { ?>
<?php if ($employeecontact->EmployeeID->getSessionValue() <> "") { ?>
<span id="el$rowindex$_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->EmployeeID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->CurrentValue) ?>">
<?php } else { ?>
<span id="el$rowindex$_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_EmployeeID" data-value-separator="<?php echo $employeecontact->EmployeeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID"<?php echo $employeecontact->EmployeeID->editAttributes() ?>>
		<?php echo $employeecontact->EmployeeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID") ?>
	</select>
</div>
<?php echo $employeecontact->EmployeeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_EmployeeID") ?>
</span>
<?php } ?>
<?php } else { ?>
<span id="el$rowindex$_employeecontact_EmployeeID" class="form-group employeecontact_EmployeeID">
<span<?php echo $employeecontact->EmployeeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->EmployeeID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="x<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_EmployeeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_EmployeeID" value="<?php echo HtmlEncode($employeecontact->EmployeeID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($employeecontact->ContactTypeID->Visible) { // ContactTypeID ?>
		<td data-name="ContactTypeID">
<?php if (!$employeecontact->isConfirm()) { ?>
<span id="el$rowindex$_employeecontact_ContactTypeID" class="form-group employeecontact_ContactTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="employeecontact" data-field="x_ContactTypeID" data-value-separator="<?php echo $employeecontact->ContactTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID"<?php echo $employeecontact->ContactTypeID->editAttributes() ?>>
		<?php echo $employeecontact->ContactTypeID->selectOptionListHtml("x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID") ?>
	</select>
</div>
<?php echo $employeecontact->ContactTypeID->Lookup->getParamTag("p_x" . $employeecontact_grid->RowIndex . "_ContactTypeID") ?>
</span>
<?php } else { ?>
<span id="el$rowindex$_employeecontact_ContactTypeID" class="form-group employeecontact_ContactTypeID">
<span<?php echo $employeecontact->ContactTypeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->ContactTypeID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="x<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_ContactTypeID" name="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" id="o<?php echo $employeecontact_grid->RowIndex ?>_ContactTypeID" value="<?php echo HtmlEncode($employeecontact->ContactTypeID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($employeecontact->Contact->Visible) { // Contact ?>
		<td data-name="Contact">
<?php if (!$employeecontact->isConfirm()) { ?>
<span id="el$rowindex$_employeecontact_Contact" class="form-group employeecontact_Contact">
<input type="text" data-table="employeecontact" data-field="x_Contact" name="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($employeecontact->Contact->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Contact->EditValue ?>"<?php echo $employeecontact->Contact->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_employeecontact_Contact" class="form-group employeecontact_Contact">
<span<?php echo $employeecontact->Contact->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->Contact->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="x<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_Contact" name="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" id="o<?php echo $employeecontact_grid->RowIndex ?>_Contact" value="<?php echo HtmlEncode($employeecontact->Contact->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($employeecontact->Notes->Visible) { // Notes ?>
		<td data-name="Notes">
<?php if (!$employeecontact->isConfirm()) { ?>
<span id="el$rowindex$_employeecontact_Notes" class="form-group employeecontact_Notes">
<input type="text" data-table="employeecontact" data-field="x_Notes" name="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($employeecontact->Notes->getPlaceHolder()) ?>" value="<?php echo $employeecontact->Notes->EditValue ?>"<?php echo $employeecontact->Notes->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_employeecontact_Notes" class="form-group employeecontact_Notes">
<span<?php echo $employeecontact->Notes->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($employeecontact->Notes->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="x<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_Notes" name="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" id="o<?php echo $employeecontact_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($employeecontact->Notes->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($employeecontact->Primary->Visible) { // Primary ?>
		<td data-name="Primary">
<?php if (!$employeecontact->isConfirm()) { ?>
<span id="el$rowindex$_employeecontact_Primary" class="form-group employeecontact_Primary">
<?php
$selwrk = (ConvertToBool($employeecontact->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="employeecontact" data-field="x_Primary" name="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="x<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $employeecontact->Primary->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_employeecontact_Primary" class="form-group employeecontact_Primary">
<span<?php echo $employeecontact->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($employeecontact->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $employeecontact->Primary->ViewValue ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $employeecontact->Primary->ViewValue ?>" disabled>
<?php } ?>
</span>
</span>
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="x<?php echo $employeecontact_grid->RowIndex ?>_Primary" id="x<?php echo $employeecontact_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($employeecontact->Primary->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="employeecontact" data-field="x_Primary" name="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" id="o<?php echo $employeecontact_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($employeecontact->Primary->OldValue) ?>">
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$employeecontact_grid->ListOptions->render("body", "right", $employeecontact_grid->RowIndex);
?>
<script>
femployeecontactgrid.updateLists(<?php echo $employeecontact_grid->RowIndex ?>);
</script>
	</tr>
<?php
}
?>
</tbody>
</table><!-- /.ew-table -->
<?php if ($employeecontact->CurrentMode == "add" || $employeecontact->CurrentMode == "copy") { ?>
<input type="hidden" name="<?php echo $employeecontact_grid->FormKeyCountName ?>" id="<?php echo $employeecontact_grid->FormKeyCountName ?>" value="<?php echo $employeecontact_grid->KeyCount ?>">
<?php echo $employeecontact_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($employeecontact->CurrentMode == "edit") { ?>
<input type="hidden" name="<?php echo $employeecontact_grid->FormKeyCountName ?>" id="<?php echo $employeecontact_grid->FormKeyCountName ?>" value="<?php echo $employeecontact_grid->KeyCount ?>">
<?php echo $employeecontact_grid->MultiSelectKey ?>
<?php } ?>
<?php if ($employeecontact->CurrentMode == "") { ?>
<input type="hidden" name="action" id="action" value="">
<?php } ?>
<input type="hidden" name="detailpage" value="femployeecontactgrid">
</div><!-- /.ew-grid-middle-panel -->
<?php

// Close recordset
if ($employeecontact_grid->Recordset)
	$employeecontact_grid->Recordset->Close();
?>
</div>
<?php if ($employeecontact_grid->ShowOtherOptions) { ?>
<div class="card-footer ew-grid-lower-panel">
<?php $employeecontact_grid->OtherOptions->render("body", "bottom") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
</div><!-- /.ew-grid -->
<?php } ?>
<?php if ($employeecontact_grid->TotalRecs == 0 && !$employeecontact->CurrentAction) { // Show other options ?>
<div class="ew-list-other-options">
<?php $employeecontact_grid->OtherOptions->render("body") ?>
</div>
<div class="clearfix"></div>
<?php } ?>
<?php
$employeecontact_grid->terminate();
?>
<?php if (!$employeecontact->isExport()) { ?>
<script>
ew.scrollableTable("gmp_employeecontact", "", "");
</script>
<?php } ?>
