<?php
namespace PHPMaker2019\project_germanos;

// Write header
WriteHeader(FALSE);

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

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

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

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

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

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

// Validate form
fclientaddressgrid.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 ($clientaddress_grid->ClientID->Required) { ?>
			elm = this.getElements("x" + infix + "_ClientID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->ClientID->caption(), $clientaddress->ClientID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->AddressTypeID->Required) { ?>
			elm = this.getElements("x" + infix + "_AddressTypeID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->AddressTypeID->caption(), $clientaddress->AddressTypeID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->Address->Required) { ?>
			elm = this.getElements("x" + infix + "_Address");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->Address->caption(), $clientaddress->Address->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->City->Required) { ?>
			elm = this.getElements("x" + infix + "_City");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->City->caption(), $clientaddress->City->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->Region->Required) { ?>
			elm = this.getElements("x" + infix + "_Region");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->Region->caption(), $clientaddress->Region->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->PostalCode->Required) { ?>
			elm = this.getElements("x" + infix + "_PostalCode");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->PostalCode->caption(), $clientaddress->PostalCode->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_grid->Country->Required) { ?>
			elm = this.getElements("x" + infix + "_Country");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $clientaddress->Country->caption(), $clientaddress->Country->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_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", $clientaddress->Notes->caption(), $clientaddress->Notes->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($clientaddress_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", $clientaddress->Primary->caption(), $clientaddress->Primary->RequiredErrorMessage)) ?>");
		<?php } ?>

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

// Check empty row
fclientaddressgrid.emptyRow = function(infix) {
	var fobj = this._form;
	if (ew.valueChanged(fobj, infix, "ClientID", false)) return false;
	if (ew.valueChanged(fobj, infix, "AddressTypeID", false)) return false;
	if (ew.valueChanged(fobj, infix, "Address", false)) return false;
	if (ew.valueChanged(fobj, infix, "City", false)) return false;
	if (ew.valueChanged(fobj, infix, "Region", false)) return false;
	if (ew.valueChanged(fobj, infix, "PostalCode", false)) return false;
	if (ew.valueChanged(fobj, infix, "Country", 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
fclientaddressgrid.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
fclientaddressgrid.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

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

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

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

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

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

// Render list options (header, right)
$clientaddress_grid->ListOptions->render("header", "right");
?>
	</tr>
</thead>
<tbody>
<?php
$clientaddress_grid->StartRec = 1;
$clientaddress_grid->StopRec = $clientaddress_grid->TotalRecs; // Show all records

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

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

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

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

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

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

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

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

// Render list options (body, left)
$clientaddress_grid->ListOptions->render("body", "left", $clientaddress_grid->RowCnt);
?>
	<?php if ($clientaddress->ClientID->Visible) { // ClientID ?>
		<td data-name="ClientID"<?php echo $clientaddress->ClientID->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<?php if ($clientaddress->ClientID->getSessionValue() <> "") { ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->ClientID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_ClientID" data-value-separator="<?php echo $clientaddress->ClientID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID"<?php echo $clientaddress->ClientID->editAttributes() ?>>
		<?php echo $clientaddress->ClientID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_ClientID") ?>
	</select>
</div>
<?php echo $clientaddress->ClientID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_ClientID") ?>
</span>
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<?php if ($clientaddress->ClientID->getSessionValue() <> "") { ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->ClientID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_ClientID" data-value-separator="<?php echo $clientaddress->ClientID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID"<?php echo $clientaddress->ClientID->editAttributes() ?>>
		<?php echo $clientaddress->ClientID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_ClientID") ?>
	</select>
</div>
<?php echo $clientaddress->ClientID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_ClientID") ?>
</span>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_ClientID" class="clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<?php echo $clientaddress->ClientID->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-table="clientaddress" data-field="x_AddressID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressID" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($clientaddress->AddressID->CurrentValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_AddressID" name="o<?php echo $clientaddress_grid->RowIndex ?>_AddressID" id="o<?php echo $clientaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($clientaddress->AddressID->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT || $clientaddress->CurrentMode == "edit") { ?>
<input type="hidden" data-table="clientaddress" data-field="x_AddressID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressID" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($clientaddress->AddressID->CurrentValue) ?>">
<?php } ?>
	<?php if ($clientaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID"<?php echo $clientaddress->AddressTypeID->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_AddressTypeID" class="form-group clientaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $clientaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $clientaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $clientaddress->AddressTypeID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $clientaddress->AddressTypeID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_AddressTypeID" class="form-group clientaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $clientaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $clientaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $clientaddress->AddressTypeID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $clientaddress->AddressTypeID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_AddressTypeID" class="clientaddress_AddressTypeID">
<span<?php echo $clientaddress->AddressTypeID->viewAttributes() ?>>
<?php echo $clientaddress->AddressTypeID->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->Address->Visible) { // Address ?>
		<td data-name="Address"<?php echo $clientaddress->Address->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Address" class="form-group clientaddress_Address">
<input type="text" data-table="clientaddress" data-field="x_Address" name="x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="x<?php echo $clientaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($clientaddress->Address->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Address->EditValue ?>"<?php echo $clientaddress->Address->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="o<?php echo $clientaddress_grid->RowIndex ?>_Address" id="o<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Address" class="form-group clientaddress_Address">
<input type="text" data-table="clientaddress" data-field="x_Address" name="x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="x<?php echo $clientaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($clientaddress->Address->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Address->EditValue ?>"<?php echo $clientaddress->Address->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Address" class="clientaddress_Address">
<span<?php echo $clientaddress->Address->viewAttributes() ?>>
<?php echo $clientaddress->Address->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="x<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="o<?php echo $clientaddress_grid->RowIndex ?>_Address" id="o<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Address" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->City->Visible) { // City ?>
		<td data-name="City"<?php echo $clientaddress->City->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_City" class="form-group clientaddress_City">
<input type="text" data-table="clientaddress" data-field="x_City" name="x<?php echo $clientaddress_grid->RowIndex ?>_City" id="x<?php echo $clientaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->City->getPlaceHolder()) ?>" value="<?php echo $clientaddress->City->EditValue ?>"<?php echo $clientaddress->City->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_City" name="o<?php echo $clientaddress_grid->RowIndex ?>_City" id="o<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_City" class="form-group clientaddress_City">
<input type="text" data-table="clientaddress" data-field="x_City" name="x<?php echo $clientaddress_grid->RowIndex ?>_City" id="x<?php echo $clientaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->City->getPlaceHolder()) ?>" value="<?php echo $clientaddress->City->EditValue ?>"<?php echo $clientaddress->City->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_City" class="clientaddress_City">
<span<?php echo $clientaddress->City->viewAttributes() ?>>
<?php echo $clientaddress->City->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_City" name="x<?php echo $clientaddress_grid->RowIndex ?>_City" id="x<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_City" name="o<?php echo $clientaddress_grid->RowIndex ?>_City" id="o<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_City" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_City" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_City" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_City" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->Region->Visible) { // Region ?>
		<td data-name="Region"<?php echo $clientaddress->Region->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Region" class="form-group clientaddress_Region">
<input type="text" data-table="clientaddress" data-field="x_Region" name="x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="x<?php echo $clientaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->Region->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Region->EditValue ?>"<?php echo $clientaddress->Region->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="o<?php echo $clientaddress_grid->RowIndex ?>_Region" id="o<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Region" class="form-group clientaddress_Region">
<input type="text" data-table="clientaddress" data-field="x_Region" name="x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="x<?php echo $clientaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->Region->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Region->EditValue ?>"<?php echo $clientaddress->Region->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Region" class="clientaddress_Region">
<span<?php echo $clientaddress->Region->viewAttributes() ?>>
<?php echo $clientaddress->Region->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="x<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="o<?php echo $clientaddress_grid->RowIndex ?>_Region" id="o<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Region" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode"<?php echo $clientaddress->PostalCode->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_PostalCode" class="form-group clientaddress_PostalCode">
<input type="text" data-table="clientaddress" data-field="x_PostalCode" name="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($clientaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $clientaddress->PostalCode->EditValue ?>"<?php echo $clientaddress->PostalCode->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_PostalCode" class="form-group clientaddress_PostalCode">
<input type="text" data-table="clientaddress" data-field="x_PostalCode" name="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($clientaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $clientaddress->PostalCode->EditValue ?>"<?php echo $clientaddress->PostalCode->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_PostalCode" class="clientaddress_PostalCode">
<span<?php echo $clientaddress->PostalCode->viewAttributes() ?>>
<?php echo $clientaddress->PostalCode->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->Country->Visible) { // Country ?>
		<td data-name="Country"<?php echo $clientaddress->Country->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Country" class="form-group clientaddress_Country">
<input type="text" data-table="clientaddress" data-field="x_Country" name="x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="x<?php echo $clientaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($clientaddress->Country->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Country->EditValue ?>"<?php echo $clientaddress->Country->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="o<?php echo $clientaddress_grid->RowIndex ?>_Country" id="o<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Country" class="form-group clientaddress_Country">
<input type="text" data-table="clientaddress" data-field="x_Country" name="x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="x<?php echo $clientaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($clientaddress->Country->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Country->EditValue ?>"<?php echo $clientaddress->Country->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Country" class="clientaddress_Country">
<span<?php echo $clientaddress->Country->viewAttributes() ?>>
<?php echo $clientaddress->Country->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="x<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="o<?php echo $clientaddress_grid->RowIndex ?>_Country" id="o<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Country" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $clientaddress->Notes->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Notes" class="form-group clientaddress_Notes">
<input type="text" data-table="clientaddress" data-field="x_Notes" name="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($clientaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Notes->EditValue ?>"<?php echo $clientaddress->Notes->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Notes" class="form-group clientaddress_Notes">
<input type="text" data-table="clientaddress" data-field="x_Notes" name="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($clientaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Notes->EditValue ?>"<?php echo $clientaddress->Notes->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Notes" class="clientaddress_Notes">
<span<?php echo $clientaddress->Notes->viewAttributes() ?>>
<?php echo $clientaddress->Notes->getViewValue() ?></span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($clientaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $clientaddress->Primary->cellAttributes() ?>>
<?php if ($clientaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Primary" class="form-group clientaddress_Primary">
<?php
$selwrk = (ConvertToBool($clientaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->Primary->editAttributes() ?>>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($clientaddress->Primary->OldValue) ?>">
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Primary" class="form-group clientaddress_Primary">
<?php
$selwrk = (ConvertToBool($clientaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->Primary->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($clientaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $clientaddress_grid->RowCnt ?>_clientaddress_Primary" class="clientaddress_Primary">
<span<?php echo $clientaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($clientaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
<?php if (!$clientaddress->isConfirm()) { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="x<?php echo $clientaddress_grid->RowIndex ?>_Primary" id="x<?php echo $clientaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($clientaddress->Primary->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($clientaddress->Primary->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Primary" id="fclientaddressgrid$x<?php echo $clientaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($clientaddress->Primary->FormValue) ?>">
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="fclientaddressgrid$o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($clientaddress->Primary->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php

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

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

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

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

// Render list options (body, left)
$clientaddress_grid->ListOptions->render("body", "left", $clientaddress_grid->RowIndex);
?>
	<?php if ($clientaddress->ClientID->Visible) { // ClientID ?>
		<td data-name="ClientID">
<?php if (!$clientaddress->isConfirm()) { ?>
<?php if ($clientaddress->ClientID->getSessionValue() <> "") { ?>
<span id="el$rowindex$_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->ClientID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->CurrentValue) ?>">
<?php } else { ?>
<span id="el$rowindex$_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_ClientID" data-value-separator="<?php echo $clientaddress->ClientID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID"<?php echo $clientaddress->ClientID->editAttributes() ?>>
		<?php echo $clientaddress->ClientID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_ClientID") ?>
	</select>
</div>
<?php echo $clientaddress->ClientID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_ClientID") ?>
</span>
<?php } ?>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_ClientID" class="form-group clientaddress_ClientID">
<span<?php echo $clientaddress->ClientID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->ClientID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="x<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_ClientID" name="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" id="o<?php echo $clientaddress_grid->RowIndex ?>_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_AddressTypeID" class="form-group clientaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="clientaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $clientaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $clientaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $clientaddress->AddressTypeID->selectOptionListHtml("x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $clientaddress->AddressTypeID->Lookup->getParamTag("p_x" . $clientaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_AddressTypeID" class="form-group clientaddress_AddressTypeID">
<span<?php echo $clientaddress->AddressTypeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->AddressTypeID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="x<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_AddressTypeID" name="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $clientaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($clientaddress->AddressTypeID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->Address->Visible) { // Address ?>
		<td data-name="Address">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_Address" class="form-group clientaddress_Address">
<input type="text" data-table="clientaddress" data-field="x_Address" name="x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="x<?php echo $clientaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($clientaddress->Address->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Address->EditValue ?>"<?php echo $clientaddress->Address->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_Address" class="form-group clientaddress_Address">
<span<?php echo $clientaddress->Address->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->Address->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="x<?php echo $clientaddress_grid->RowIndex ?>_Address" id="x<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_Address" name="o<?php echo $clientaddress_grid->RowIndex ?>_Address" id="o<?php echo $clientaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($clientaddress->Address->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->City->Visible) { // City ?>
		<td data-name="City">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_City" class="form-group clientaddress_City">
<input type="text" data-table="clientaddress" data-field="x_City" name="x<?php echo $clientaddress_grid->RowIndex ?>_City" id="x<?php echo $clientaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->City->getPlaceHolder()) ?>" value="<?php echo $clientaddress->City->EditValue ?>"<?php echo $clientaddress->City->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_City" class="form-group clientaddress_City">
<span<?php echo $clientaddress->City->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->City->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_City" name="x<?php echo $clientaddress_grid->RowIndex ?>_City" id="x<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_City" name="o<?php echo $clientaddress_grid->RowIndex ?>_City" id="o<?php echo $clientaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($clientaddress->City->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->Region->Visible) { // Region ?>
		<td data-name="Region">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_Region" class="form-group clientaddress_Region">
<input type="text" data-table="clientaddress" data-field="x_Region" name="x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="x<?php echo $clientaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($clientaddress->Region->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Region->EditValue ?>"<?php echo $clientaddress->Region->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_Region" class="form-group clientaddress_Region">
<span<?php echo $clientaddress->Region->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->Region->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="x<?php echo $clientaddress_grid->RowIndex ?>_Region" id="x<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_Region" name="o<?php echo $clientaddress_grid->RowIndex ?>_Region" id="o<?php echo $clientaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($clientaddress->Region->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_PostalCode" class="form-group clientaddress_PostalCode">
<input type="text" data-table="clientaddress" data-field="x_PostalCode" name="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($clientaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $clientaddress->PostalCode->EditValue ?>"<?php echo $clientaddress->PostalCode->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_PostalCode" class="form-group clientaddress_PostalCode">
<span<?php echo $clientaddress->PostalCode->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->PostalCode->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_PostalCode" name="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $clientaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($clientaddress->PostalCode->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->Country->Visible) { // Country ?>
		<td data-name="Country">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_Country" class="form-group clientaddress_Country">
<input type="text" data-table="clientaddress" data-field="x_Country" name="x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="x<?php echo $clientaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($clientaddress->Country->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Country->EditValue ?>"<?php echo $clientaddress->Country->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_Country" class="form-group clientaddress_Country">
<span<?php echo $clientaddress->Country->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->Country->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="x<?php echo $clientaddress_grid->RowIndex ?>_Country" id="x<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_Country" name="o<?php echo $clientaddress_grid->RowIndex ?>_Country" id="o<?php echo $clientaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($clientaddress->Country->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_Notes" class="form-group clientaddress_Notes">
<input type="text" data-table="clientaddress" data-field="x_Notes" name="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($clientaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $clientaddress->Notes->EditValue ?>"<?php echo $clientaddress->Notes->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_Notes" class="form-group clientaddress_Notes">
<span<?php echo $clientaddress->Notes->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($clientaddress->Notes->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="x<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_Notes" name="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" id="o<?php echo $clientaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($clientaddress->Notes->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($clientaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary">
<?php if (!$clientaddress->isConfirm()) { ?>
<span id="el$rowindex$_clientaddress_Primary" class="form-group clientaddress_Primary">
<?php
$selwrk = (ConvertToBool($clientaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->Primary->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_clientaddress_Primary" class="form-group clientaddress_Primary">
<span<?php echo $clientaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($clientaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->ViewValue ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $clientaddress->Primary->ViewValue ?>" disabled>
<?php } ?>
</span>
</span>
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="x<?php echo $clientaddress_grid->RowIndex ?>_Primary" id="x<?php echo $clientaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($clientaddress->Primary->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="clientaddress" data-field="x_Primary" name="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $clientaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($clientaddress->Primary->OldValue) ?>">
</td>
	<?php } ?>
<?php

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

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