<?php
namespace PHPMaker2019\project_germanos;

// Write header
WriteHeader(FALSE);

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

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

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

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

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

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

// Validate form
fcourtaddressgrid.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 ($courtaddress_grid->CourtID->Required) { ?>
			elm = this.getElements("x" + infix + "_CourtID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $courtaddress->CourtID->caption(), $courtaddress->CourtID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->AddressTypeID->caption(), $courtaddress->AddressTypeID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->Address->caption(), $courtaddress->Address->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->City->caption(), $courtaddress->City->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->Region->caption(), $courtaddress->Region->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->PostalCode->caption(), $courtaddress->PostalCode->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->Country->caption(), $courtaddress->Country->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->Notes->caption(), $courtaddress->Notes->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($courtaddress_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", $courtaddress->Primary->caption(), $courtaddress->Primary->RequiredErrorMessage)) ?>");
		<?php } ?>

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

// Check empty row
fcourtaddressgrid.emptyRow = function(infix) {
	var fobj = this._form;
	if (ew.valueChanged(fobj, infix, "CourtID", 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
fcourtaddressgrid.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
fcourtaddressgrid.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
fcourtaddressgrid.lists["x_CourtID"] = <?php echo $courtaddress_grid->CourtID->Lookup->toClientList() ?>;
fcourtaddressgrid.lists["x_CourtID"].options = <?php echo JsonEncode($courtaddress_grid->CourtID->lookupOptions()) ?>;
fcourtaddressgrid.lists["x_AddressTypeID"] = <?php echo $courtaddress_grid->AddressTypeID->Lookup->toClientList() ?>;
fcourtaddressgrid.lists["x_AddressTypeID"].options = <?php echo JsonEncode($courtaddress_grid->AddressTypeID->lookupOptions()) ?>;
fcourtaddressgrid.lists["x_Primary[]"] = <?php echo $courtaddress_grid->Primary->Lookup->toClientList() ?>;
fcourtaddressgrid.lists["x_Primary[]"].options = <?php echo JsonEncode($courtaddress_grid->Primary->options(FALSE, TRUE)) ?>;

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

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

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

// Render list options (header, left)
$courtaddress_grid->ListOptions->render("header", "left");
?>
<?php if ($courtaddress->CourtID->Visible) { // CourtID ?>
	<?php if ($courtaddress->sortUrl($courtaddress->CourtID) == "") { ?>
		<th data-name="CourtID" class="<?php echo $courtaddress->CourtID->headerCellClass() ?>"><div id="elh_courtaddress_CourtID" class="courtaddress_CourtID"><div class="ew-table-header-caption"><?php echo $courtaddress->CourtID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="CourtID" class="<?php echo $courtaddress->CourtID->headerCellClass() ?>"><div><div id="elh_courtaddress_CourtID" class="courtaddress_CourtID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->CourtID->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->CourtID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->CourtID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->AddressTypeID->Visible) { // AddressTypeID ?>
	<?php if ($courtaddress->sortUrl($courtaddress->AddressTypeID) == "") { ?>
		<th data-name="AddressTypeID" class="<?php echo $courtaddress->AddressTypeID->headerCellClass() ?>"><div id="elh_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID"><div class="ew-table-header-caption"><?php echo $courtaddress->AddressTypeID->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="AddressTypeID" class="<?php echo $courtaddress->AddressTypeID->headerCellClass() ?>"><div><div id="elh_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->AddressTypeID->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->AddressTypeID->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->AddressTypeID->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Address->Visible) { // Address ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Address) == "") { ?>
		<th data-name="Address" class="<?php echo $courtaddress->Address->headerCellClass() ?>"><div id="elh_courtaddress_Address" class="courtaddress_Address"><div class="ew-table-header-caption"><?php echo $courtaddress->Address->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Address" class="<?php echo $courtaddress->Address->headerCellClass() ?>"><div><div id="elh_courtaddress_Address" class="courtaddress_Address">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Address->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Address->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Address->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->City->Visible) { // City ?>
	<?php if ($courtaddress->sortUrl($courtaddress->City) == "") { ?>
		<th data-name="City" class="<?php echo $courtaddress->City->headerCellClass() ?>"><div id="elh_courtaddress_City" class="courtaddress_City"><div class="ew-table-header-caption"><?php echo $courtaddress->City->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="City" class="<?php echo $courtaddress->City->headerCellClass() ?>"><div><div id="elh_courtaddress_City" class="courtaddress_City">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->City->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->City->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->City->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Region->Visible) { // Region ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Region) == "") { ?>
		<th data-name="Region" class="<?php echo $courtaddress->Region->headerCellClass() ?>"><div id="elh_courtaddress_Region" class="courtaddress_Region"><div class="ew-table-header-caption"><?php echo $courtaddress->Region->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Region" class="<?php echo $courtaddress->Region->headerCellClass() ?>"><div><div id="elh_courtaddress_Region" class="courtaddress_Region">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Region->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Region->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Region->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->PostalCode->Visible) { // PostalCode ?>
	<?php if ($courtaddress->sortUrl($courtaddress->PostalCode) == "") { ?>
		<th data-name="PostalCode" class="<?php echo $courtaddress->PostalCode->headerCellClass() ?>"><div id="elh_courtaddress_PostalCode" class="courtaddress_PostalCode"><div class="ew-table-header-caption"><?php echo $courtaddress->PostalCode->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="PostalCode" class="<?php echo $courtaddress->PostalCode->headerCellClass() ?>"><div><div id="elh_courtaddress_PostalCode" class="courtaddress_PostalCode">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->PostalCode->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->PostalCode->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->PostalCode->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Country->Visible) { // Country ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Country) == "") { ?>
		<th data-name="Country" class="<?php echo $courtaddress->Country->headerCellClass() ?>"><div id="elh_courtaddress_Country" class="courtaddress_Country"><div class="ew-table-header-caption"><?php echo $courtaddress->Country->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Country" class="<?php echo $courtaddress->Country->headerCellClass() ?>"><div><div id="elh_courtaddress_Country" class="courtaddress_Country">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Country->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Country->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Country->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Notes->Visible) { // Notes ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Notes) == "") { ?>
		<th data-name="Notes" class="<?php echo $courtaddress->Notes->headerCellClass() ?>"><div id="elh_courtaddress_Notes" class="courtaddress_Notes"><div class="ew-table-header-caption"><?php echo $courtaddress->Notes->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Notes" class="<?php echo $courtaddress->Notes->headerCellClass() ?>"><div><div id="elh_courtaddress_Notes" class="courtaddress_Notes">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Notes->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Notes->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Notes->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php if ($courtaddress->Primary->Visible) { // Primary ?>
	<?php if ($courtaddress->sortUrl($courtaddress->Primary) == "") { ?>
		<th data-name="Primary" class="<?php echo $courtaddress->Primary->headerCellClass() ?>"><div id="elh_courtaddress_Primary" class="courtaddress_Primary"><div class="ew-table-header-caption"><?php echo $courtaddress->Primary->caption() ?></div></div></th>
	<?php } else { ?>
		<th data-name="Primary" class="<?php echo $courtaddress->Primary->headerCellClass() ?>"><div><div id="elh_courtaddress_Primary" class="courtaddress_Primary">
			<div class="ew-table-header-btn"><span class="ew-table-header-caption"><?php echo $courtaddress->Primary->caption() ?></span><span class="ew-table-header-sort"><?php if ($courtaddress->Primary->getSort() == "ASC") { ?><i class="fa fa-sort-up"></i><?php } elseif ($courtaddress->Primary->getSort() == "DESC") { ?><i class="fa fa-sort-down"></i><?php } ?></span></div>
		</div></div></th>
	<?php } ?>
<?php } ?>
<?php

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

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

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

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

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

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

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

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

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

// Render list options (body, left)
$courtaddress_grid->ListOptions->render("body", "left", $courtaddress_grid->RowCnt);
?>
	<?php if ($courtaddress->CourtID->Visible) { // CourtID ?>
		<td data-name="CourtID"<?php echo $courtaddress->CourtID->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<?php if ($courtaddress->CourtID->getSessionValue() <> "") { ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->CourtID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_CourtID" data-value-separator="<?php echo $courtaddress->CourtID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID"<?php echo $courtaddress->CourtID->editAttributes() ?>>
		<?php echo $courtaddress->CourtID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_CourtID") ?>
	</select>
</div>
<?php echo $courtaddress->CourtID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_CourtID") ?>
</span>
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<?php if ($courtaddress->CourtID->getSessionValue() <> "") { ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->CourtID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->CurrentValue) ?>">
<?php } else { ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_CourtID" data-value-separator="<?php echo $courtaddress->CourtID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID"<?php echo $courtaddress->CourtID->editAttributes() ?>>
		<?php echo $courtaddress->CourtID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_CourtID") ?>
	</select>
</div>
<?php echo $courtaddress->CourtID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_CourtID") ?>
</span>
<?php } ?>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_CourtID" class="courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<?php echo $courtaddress->CourtID->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<input type="hidden" data-table="courtaddress" data-field="x_AddressID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressID" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($courtaddress->AddressID->CurrentValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_AddressID" name="o<?php echo $courtaddress_grid->RowIndex ?>_AddressID" id="o<?php echo $courtaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($courtaddress->AddressID->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT || $courtaddress->CurrentMode == "edit") { ?>
<input type="hidden" data-table="courtaddress" data-field="x_AddressID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressID" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressID" value="<?php echo HtmlEncode($courtaddress->AddressID->CurrentValue) ?>">
<?php } ?>
	<?php if ($courtaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID"<?php echo $courtaddress->AddressTypeID->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_AddressTypeID" class="form-group courtaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $courtaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $courtaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $courtaddress->AddressTypeID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $courtaddress->AddressTypeID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_AddressTypeID" class="form-group courtaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $courtaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $courtaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $courtaddress->AddressTypeID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $courtaddress->AddressTypeID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_AddressTypeID" class="courtaddress_AddressTypeID">
<span<?php echo $courtaddress->AddressTypeID->viewAttributes() ?>>
<?php echo $courtaddress->AddressTypeID->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->Address->Visible) { // Address ?>
		<td data-name="Address"<?php echo $courtaddress->Address->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Address" class="form-group courtaddress_Address">
<input type="text" data-table="courtaddress" data-field="x_Address" name="x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="x<?php echo $courtaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($courtaddress->Address->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Address->EditValue ?>"<?php echo $courtaddress->Address->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="o<?php echo $courtaddress_grid->RowIndex ?>_Address" id="o<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Address" class="form-group courtaddress_Address">
<input type="text" data-table="courtaddress" data-field="x_Address" name="x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="x<?php echo $courtaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($courtaddress->Address->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Address->EditValue ?>"<?php echo $courtaddress->Address->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Address" class="courtaddress_Address">
<span<?php echo $courtaddress->Address->viewAttributes() ?>>
<?php echo $courtaddress->Address->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="x<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="o<?php echo $courtaddress_grid->RowIndex ?>_Address" id="o<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Address" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->City->Visible) { // City ?>
		<td data-name="City"<?php echo $courtaddress->City->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_City" class="form-group courtaddress_City">
<input type="text" data-table="courtaddress" data-field="x_City" name="x<?php echo $courtaddress_grid->RowIndex ?>_City" id="x<?php echo $courtaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->City->getPlaceHolder()) ?>" value="<?php echo $courtaddress->City->EditValue ?>"<?php echo $courtaddress->City->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_City" name="o<?php echo $courtaddress_grid->RowIndex ?>_City" id="o<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_City" class="form-group courtaddress_City">
<input type="text" data-table="courtaddress" data-field="x_City" name="x<?php echo $courtaddress_grid->RowIndex ?>_City" id="x<?php echo $courtaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->City->getPlaceHolder()) ?>" value="<?php echo $courtaddress->City->EditValue ?>"<?php echo $courtaddress->City->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_City" class="courtaddress_City">
<span<?php echo $courtaddress->City->viewAttributes() ?>>
<?php echo $courtaddress->City->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_City" name="x<?php echo $courtaddress_grid->RowIndex ?>_City" id="x<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_City" name="o<?php echo $courtaddress_grid->RowIndex ?>_City" id="o<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_City" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_City" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_City" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_City" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->Region->Visible) { // Region ?>
		<td data-name="Region"<?php echo $courtaddress->Region->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Region" class="form-group courtaddress_Region">
<input type="text" data-table="courtaddress" data-field="x_Region" name="x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="x<?php echo $courtaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->Region->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Region->EditValue ?>"<?php echo $courtaddress->Region->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="o<?php echo $courtaddress_grid->RowIndex ?>_Region" id="o<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Region" class="form-group courtaddress_Region">
<input type="text" data-table="courtaddress" data-field="x_Region" name="x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="x<?php echo $courtaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->Region->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Region->EditValue ?>"<?php echo $courtaddress->Region->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Region" class="courtaddress_Region">
<span<?php echo $courtaddress->Region->viewAttributes() ?>>
<?php echo $courtaddress->Region->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="x<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="o<?php echo $courtaddress_grid->RowIndex ?>_Region" id="o<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Region" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode"<?php echo $courtaddress->PostalCode->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_PostalCode" class="form-group courtaddress_PostalCode">
<input type="text" data-table="courtaddress" data-field="x_PostalCode" name="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($courtaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $courtaddress->PostalCode->EditValue ?>"<?php echo $courtaddress->PostalCode->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_PostalCode" class="form-group courtaddress_PostalCode">
<input type="text" data-table="courtaddress" data-field="x_PostalCode" name="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($courtaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $courtaddress->PostalCode->EditValue ?>"<?php echo $courtaddress->PostalCode->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_PostalCode" class="courtaddress_PostalCode">
<span<?php echo $courtaddress->PostalCode->viewAttributes() ?>>
<?php echo $courtaddress->PostalCode->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->Country->Visible) { // Country ?>
		<td data-name="Country"<?php echo $courtaddress->Country->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Country" class="form-group courtaddress_Country">
<input type="text" data-table="courtaddress" data-field="x_Country" name="x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="x<?php echo $courtaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($courtaddress->Country->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Country->EditValue ?>"<?php echo $courtaddress->Country->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="o<?php echo $courtaddress_grid->RowIndex ?>_Country" id="o<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Country" class="form-group courtaddress_Country">
<input type="text" data-table="courtaddress" data-field="x_Country" name="x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="x<?php echo $courtaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($courtaddress->Country->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Country->EditValue ?>"<?php echo $courtaddress->Country->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Country" class="courtaddress_Country">
<span<?php echo $courtaddress->Country->viewAttributes() ?>>
<?php echo $courtaddress->Country->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="x<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="o<?php echo $courtaddress_grid->RowIndex ?>_Country" id="o<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Country" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes"<?php echo $courtaddress->Notes->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Notes" class="form-group courtaddress_Notes">
<input type="text" data-table="courtaddress" data-field="x_Notes" name="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($courtaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Notes->EditValue ?>"<?php echo $courtaddress->Notes->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Notes" class="form-group courtaddress_Notes">
<input type="text" data-table="courtaddress" data-field="x_Notes" name="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($courtaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Notes->EditValue ?>"<?php echo $courtaddress->Notes->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Notes" class="courtaddress_Notes">
<span<?php echo $courtaddress->Notes->viewAttributes() ?>>
<?php echo $courtaddress->Notes->getViewValue() ?></span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($courtaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary"<?php echo $courtaddress->Primary->cellAttributes() ?>>
<?php if ($courtaddress->RowType == ROWTYPE_ADD) { // Add record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Primary" class="form-group courtaddress_Primary">
<?php
$selwrk = (ConvertToBool($courtaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="courtaddress" data-field="x_Primary" name="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $courtaddress->Primary->editAttributes() ?>>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($courtaddress->Primary->OldValue) ?>">
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_EDIT) { // Edit record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Primary" class="form-group courtaddress_Primary">
<?php
$selwrk = (ConvertToBool($courtaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="courtaddress" data-field="x_Primary" name="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $courtaddress->Primary->editAttributes() ?>>
</span>
<?php } ?>
<?php if ($courtaddress->RowType == ROWTYPE_VIEW) { // View record ?>
<span id="el<?php echo $courtaddress_grid->RowCnt ?>_courtaddress_Primary" class="courtaddress_Primary">
<span<?php echo $courtaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($courtaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->getViewValue() ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->getViewValue() ?>" disabled>
<?php } ?>
</span>
</span>
<?php if (!$courtaddress->isConfirm()) { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="x<?php echo $courtaddress_grid->RowIndex ?>_Primary" id="x<?php echo $courtaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($courtaddress->Primary->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($courtaddress->Primary->OldValue) ?>">
<?php } else { ?>
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Primary" id="fcourtaddressgrid$x<?php echo $courtaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($courtaddress->Primary->FormValue) ?>">
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="fcourtaddressgrid$o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($courtaddress->Primary->OldValue) ?>">
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
<?php

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

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

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

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

// Render list options (body, left)
$courtaddress_grid->ListOptions->render("body", "left", $courtaddress_grid->RowIndex);
?>
	<?php if ($courtaddress->CourtID->Visible) { // CourtID ?>
		<td data-name="CourtID">
<?php if (!$courtaddress->isConfirm()) { ?>
<?php if ($courtaddress->CourtID->getSessionValue() <> "") { ?>
<span id="el$rowindex$_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->CourtID->ViewValue) ?>"></span>
</span>
<input type="hidden" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->CurrentValue) ?>">
<?php } else { ?>
<span id="el$rowindex$_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_CourtID" data-value-separator="<?php echo $courtaddress->CourtID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID"<?php echo $courtaddress->CourtID->editAttributes() ?>>
		<?php echo $courtaddress->CourtID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_CourtID") ?>
	</select>
</div>
<?php echo $courtaddress->CourtID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_CourtID") ?>
</span>
<?php } ?>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_CourtID" class="form-group courtaddress_CourtID">
<span<?php echo $courtaddress->CourtID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->CourtID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="x<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_CourtID" name="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" id="o<?php echo $courtaddress_grid->RowIndex ?>_CourtID" value="<?php echo HtmlEncode($courtaddress->CourtID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->AddressTypeID->Visible) { // AddressTypeID ?>
		<td data-name="AddressTypeID">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_AddressTypeID" class="form-group courtaddress_AddressTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="courtaddress" data-field="x_AddressTypeID" data-value-separator="<?php echo $courtaddress->AddressTypeID->displayValueSeparatorAttribute() ?>" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID"<?php echo $courtaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $courtaddress->AddressTypeID->selectOptionListHtml("x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID") ?>
	</select>
</div>
<?php echo $courtaddress->AddressTypeID->Lookup->getParamTag("p_x" . $courtaddress_grid->RowIndex . "_AddressTypeID") ?>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_AddressTypeID" class="form-group courtaddress_AddressTypeID">
<span<?php echo $courtaddress->AddressTypeID->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->AddressTypeID->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="x<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_AddressTypeID" name="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" id="o<?php echo $courtaddress_grid->RowIndex ?>_AddressTypeID" value="<?php echo HtmlEncode($courtaddress->AddressTypeID->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->Address->Visible) { // Address ?>
		<td data-name="Address">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_Address" class="form-group courtaddress_Address">
<input type="text" data-table="courtaddress" data-field="x_Address" name="x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="x<?php echo $courtaddress_grid->RowIndex ?>_Address" size="30" maxlength="150" placeholder="<?php echo HtmlEncode($courtaddress->Address->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Address->EditValue ?>"<?php echo $courtaddress->Address->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_Address" class="form-group courtaddress_Address">
<span<?php echo $courtaddress->Address->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->Address->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="x<?php echo $courtaddress_grid->RowIndex ?>_Address" id="x<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_Address" name="o<?php echo $courtaddress_grid->RowIndex ?>_Address" id="o<?php echo $courtaddress_grid->RowIndex ?>_Address" value="<?php echo HtmlEncode($courtaddress->Address->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->City->Visible) { // City ?>
		<td data-name="City">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_City" class="form-group courtaddress_City">
<input type="text" data-table="courtaddress" data-field="x_City" name="x<?php echo $courtaddress_grid->RowIndex ?>_City" id="x<?php echo $courtaddress_grid->RowIndex ?>_City" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->City->getPlaceHolder()) ?>" value="<?php echo $courtaddress->City->EditValue ?>"<?php echo $courtaddress->City->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_City" class="form-group courtaddress_City">
<span<?php echo $courtaddress->City->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->City->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_City" name="x<?php echo $courtaddress_grid->RowIndex ?>_City" id="x<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_City" name="o<?php echo $courtaddress_grid->RowIndex ?>_City" id="o<?php echo $courtaddress_grid->RowIndex ?>_City" value="<?php echo HtmlEncode($courtaddress->City->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->Region->Visible) { // Region ?>
		<td data-name="Region">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_Region" class="form-group courtaddress_Region">
<input type="text" data-table="courtaddress" data-field="x_Region" name="x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="x<?php echo $courtaddress_grid->RowIndex ?>_Region" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($courtaddress->Region->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Region->EditValue ?>"<?php echo $courtaddress->Region->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_Region" class="form-group courtaddress_Region">
<span<?php echo $courtaddress->Region->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->Region->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="x<?php echo $courtaddress_grid->RowIndex ?>_Region" id="x<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_Region" name="o<?php echo $courtaddress_grid->RowIndex ?>_Region" id="o<?php echo $courtaddress_grid->RowIndex ?>_Region" value="<?php echo HtmlEncode($courtaddress->Region->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->PostalCode->Visible) { // PostalCode ?>
		<td data-name="PostalCode">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_PostalCode" class="form-group courtaddress_PostalCode">
<input type="text" data-table="courtaddress" data-field="x_PostalCode" name="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" size="30" maxlength="10" placeholder="<?php echo HtmlEncode($courtaddress->PostalCode->getPlaceHolder()) ?>" value="<?php echo $courtaddress->PostalCode->EditValue ?>"<?php echo $courtaddress->PostalCode->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_PostalCode" class="form-group courtaddress_PostalCode">
<span<?php echo $courtaddress->PostalCode->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->PostalCode->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="x<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_PostalCode" name="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" id="o<?php echo $courtaddress_grid->RowIndex ?>_PostalCode" value="<?php echo HtmlEncode($courtaddress->PostalCode->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->Country->Visible) { // Country ?>
		<td data-name="Country">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_Country" class="form-group courtaddress_Country">
<input type="text" data-table="courtaddress" data-field="x_Country" name="x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="x<?php echo $courtaddress_grid->RowIndex ?>_Country" size="30" maxlength="20" placeholder="<?php echo HtmlEncode($courtaddress->Country->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Country->EditValue ?>"<?php echo $courtaddress->Country->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_Country" class="form-group courtaddress_Country">
<span<?php echo $courtaddress->Country->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->Country->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="x<?php echo $courtaddress_grid->RowIndex ?>_Country" id="x<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_Country" name="o<?php echo $courtaddress_grid->RowIndex ?>_Country" id="o<?php echo $courtaddress_grid->RowIndex ?>_Country" value="<?php echo HtmlEncode($courtaddress->Country->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->Notes->Visible) { // Notes ?>
		<td data-name="Notes">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_Notes" class="form-group courtaddress_Notes">
<input type="text" data-table="courtaddress" data-field="x_Notes" name="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" size="30" maxlength="100" placeholder="<?php echo HtmlEncode($courtaddress->Notes->getPlaceHolder()) ?>" value="<?php echo $courtaddress->Notes->EditValue ?>"<?php echo $courtaddress->Notes->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_Notes" class="form-group courtaddress_Notes">
<span<?php echo $courtaddress->Notes->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($courtaddress->Notes->ViewValue) ?>"></span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="x<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_Notes" name="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" id="o<?php echo $courtaddress_grid->RowIndex ?>_Notes" value="<?php echo HtmlEncode($courtaddress->Notes->OldValue) ?>">
</td>
	<?php } ?>
	<?php if ($courtaddress->Primary->Visible) { // Primary ?>
		<td data-name="Primary">
<?php if (!$courtaddress->isConfirm()) { ?>
<span id="el$rowindex$_courtaddress_Primary" class="form-group courtaddress_Primary">
<?php
$selwrk = (ConvertToBool($courtaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="courtaddress" data-field="x_Primary" name="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="x<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="1"<?php echo $selwrk ?><?php echo $courtaddress->Primary->editAttributes() ?>>
</span>
<?php } else { ?>
<span id="el$rowindex$_courtaddress_Primary" class="form-group courtaddress_Primary">
<span<?php echo $courtaddress->Primary->viewAttributes() ?>>
<?php if (ConvertToBool($courtaddress->Primary->CurrentValue)) { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->ViewValue ?>" disabled checked>
<?php } else { ?>
<input type="checkbox" value="<?php echo $courtaddress->Primary->ViewValue ?>" disabled>
<?php } ?>
</span>
</span>
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="x<?php echo $courtaddress_grid->RowIndex ?>_Primary" id="x<?php echo $courtaddress_grid->RowIndex ?>_Primary" value="<?php echo HtmlEncode($courtaddress->Primary->FormValue) ?>">
<?php } ?>
<input type="hidden" data-table="courtaddress" data-field="x_Primary" name="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" id="o<?php echo $courtaddress_grid->RowIndex ?>_Primary[]" value="<?php echo HtmlEncode($courtaddress->Primary->OldValue) ?>">
</td>
	<?php } ?>
<?php

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

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