<?php
namespace PHPMaker2019\project_germanos;

// Session
if (session_status() !== PHP_SESSION_ACTIVE)
	session_start(); // Init session data

// Output buffering
ob_start(); 

// Autoload
include_once "autoload.php";
?>
<?php

// Write header
WriteHeader(FALSE);

// Create page object
$clientaddress_add = new clientaddress_add();

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

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

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

// Page Rendering event
$clientaddress_add->Page_Render();
?>
<?php include_once "header.php" ?>
<script>

// Form object
currentPageID = ew.PAGE_ID = "add";
var fclientaddressadd = currentForm = new ew.Form("fclientaddressadd", "add");

// Validate form
fclientaddressadd.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);
		<?php if ($clientaddress_add->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_add->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_add->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_add->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_add->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_add->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_add->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_add->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_add->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;
	}

	// Process detail forms
	var dfs = $fobj.find("input[name='detailpage']").get();
	for (var i = 0; i < dfs.length; i++) {
		var df = dfs[i], val = df.value;
		if (val && ew.forms[val])
			if (!ew.forms[val].validate())
				return false;
	}
	return true;
}

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

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

// Form object for search
</script>
<script>

// Write your client script here, no need to add script tags.
</script>
<?php $clientaddress_add->showPageHeader(); ?>
<?php
$clientaddress_add->showMessage();
?>
<form name="fclientaddressadd" id="fclientaddressadd" class="<?php echo $clientaddress_add->FormClassName ?>" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($clientaddress_add->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $clientaddress_add->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="clientaddress">
<input type="hidden" name="action" id="action" value="insert">
<input type="hidden" name="modal" value="<?php echo (int)$clientaddress_add->IsModal ?>">
<?php if ($clientaddress->getCurrentMasterTable() == "clients") { ?>
<input type="hidden" name="<?php echo TABLE_SHOW_MASTER ?>" value="clients">
<input type="hidden" name="fk_ClientID" value="<?php echo $clientaddress->ClientID->getSessionValue() ?>">
<?php } ?>
<?php if (!$clientaddress_add->IsMobileOrModal) { ?>
<div class="ew-desktop"><!-- desktop -->
<?php } ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
<div class="ew-add-div"><!-- page* -->
<?php } else { ?>
<table id="tbl_clientaddressadd" class="table table-striped table-sm ew-desktop-table"><!-- table* -->
<?php } ?>
<?php if ($clientaddress->ClientID->Visible) { // ClientID ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_ClientID" class="form-group row">
		<label id="elh_clientaddress_ClientID" for="x_ClientID" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->ClientID->caption() ?><?php echo ($clientaddress->ClientID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->ClientID->cellAttributes() ?>>
<?php if ($clientaddress->ClientID->getSessionValue() <> "") { ?>
<span id="el_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_ClientID" name="x_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->CurrentValue) ?>">
<?php } else { ?>
<span id="el_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_ClientID" name="x_ClientID"<?php echo $clientaddress->ClientID->editAttributes() ?>>
		<?php echo $clientaddress->ClientID->selectOptionListHtml("x_ClientID") ?>
	</select>
</div>
<?php echo $clientaddress->ClientID->Lookup->getParamTag("p_x_ClientID") ?>
</span>
<?php } ?>
<?php echo $clientaddress->ClientID->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_ClientID">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_ClientID"><?php echo $clientaddress->ClientID->caption() ?><?php echo ($clientaddress->ClientID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->ClientID->cellAttributes() ?>>
<?php if ($clientaddress->ClientID->getSessionValue() <> "") { ?>
<span id="el_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_ClientID" name="x_ClientID" value="<?php echo HtmlEncode($clientaddress->ClientID->CurrentValue) ?>">
<?php } else { ?>
<span id="el_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_ClientID" name="x_ClientID"<?php echo $clientaddress->ClientID->editAttributes() ?>>
		<?php echo $clientaddress->ClientID->selectOptionListHtml("x_ClientID") ?>
	</select>
</div>
<?php echo $clientaddress->ClientID->Lookup->getParamTag("p_x_ClientID") ?>
</span>
<?php } ?>
<?php echo $clientaddress->ClientID->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->AddressTypeID->Visible) { // AddressTypeID ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_AddressTypeID" class="form-group row">
		<label id="elh_clientaddress_AddressTypeID" for="x_AddressTypeID" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->AddressTypeID->caption() ?><?php echo ($clientaddress->AddressTypeID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->AddressTypeID->cellAttributes() ?>>
<span id="el_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_AddressTypeID" name="x_AddressTypeID"<?php echo $clientaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $clientaddress->AddressTypeID->selectOptionListHtml("x_AddressTypeID") ?>
	</select>
</div>
<?php echo $clientaddress->AddressTypeID->Lookup->getParamTag("p_x_AddressTypeID") ?>
</span>
<?php echo $clientaddress->AddressTypeID->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_AddressTypeID">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_AddressTypeID"><?php echo $clientaddress->AddressTypeID->caption() ?><?php echo ($clientaddress->AddressTypeID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->AddressTypeID->cellAttributes() ?>>
<span id="el_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_AddressTypeID" name="x_AddressTypeID"<?php echo $clientaddress->AddressTypeID->editAttributes() ?>>
		<?php echo $clientaddress->AddressTypeID->selectOptionListHtml("x_AddressTypeID") ?>
	</select>
</div>
<?php echo $clientaddress->AddressTypeID->Lookup->getParamTag("p_x_AddressTypeID") ?>
</span>
<?php echo $clientaddress->AddressTypeID->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->Address->Visible) { // Address ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_Address" class="form-group row">
		<label id="elh_clientaddress_Address" for="x_Address" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->Address->caption() ?><?php echo ($clientaddress->Address->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->Address->cellAttributes() ?>>
<span id="el_clientaddress_Address">
<input type="text" data-table="clientaddress" data-field="x_Address" name="x_Address" id="x_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 echo $clientaddress->Address->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Address">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_Address"><?php echo $clientaddress->Address->caption() ?><?php echo ($clientaddress->Address->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->Address->cellAttributes() ?>>
<span id="el_clientaddress_Address">
<input type="text" data-table="clientaddress" data-field="x_Address" name="x_Address" id="x_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 echo $clientaddress->Address->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->City->Visible) { // City ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_City" class="form-group row">
		<label id="elh_clientaddress_City" for="x_City" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->City->caption() ?><?php echo ($clientaddress->City->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->City->cellAttributes() ?>>
<span id="el_clientaddress_City">
<input type="text" data-table="clientaddress" data-field="x_City" name="x_City" id="x_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 echo $clientaddress->City->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_City">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_City"><?php echo $clientaddress->City->caption() ?><?php echo ($clientaddress->City->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->City->cellAttributes() ?>>
<span id="el_clientaddress_City">
<input type="text" data-table="clientaddress" data-field="x_City" name="x_City" id="x_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 echo $clientaddress->City->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->Region->Visible) { // Region ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_Region" class="form-group row">
		<label id="elh_clientaddress_Region" for="x_Region" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->Region->caption() ?><?php echo ($clientaddress->Region->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->Region->cellAttributes() ?>>
<span id="el_clientaddress_Region">
<input type="text" data-table="clientaddress" data-field="x_Region" name="x_Region" id="x_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 echo $clientaddress->Region->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Region">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_Region"><?php echo $clientaddress->Region->caption() ?><?php echo ($clientaddress->Region->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->Region->cellAttributes() ?>>
<span id="el_clientaddress_Region">
<input type="text" data-table="clientaddress" data-field="x_Region" name="x_Region" id="x_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 echo $clientaddress->Region->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->PostalCode->Visible) { // PostalCode ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_PostalCode" class="form-group row">
		<label id="elh_clientaddress_PostalCode" for="x_PostalCode" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->PostalCode->caption() ?><?php echo ($clientaddress->PostalCode->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->PostalCode->cellAttributes() ?>>
<span id="el_clientaddress_PostalCode">
<input type="text" data-table="clientaddress" data-field="x_PostalCode" name="x_PostalCode" id="x_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 echo $clientaddress->PostalCode->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_PostalCode">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_PostalCode"><?php echo $clientaddress->PostalCode->caption() ?><?php echo ($clientaddress->PostalCode->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->PostalCode->cellAttributes() ?>>
<span id="el_clientaddress_PostalCode">
<input type="text" data-table="clientaddress" data-field="x_PostalCode" name="x_PostalCode" id="x_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 echo $clientaddress->PostalCode->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->Country->Visible) { // Country ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_Country" class="form-group row">
		<label id="elh_clientaddress_Country" for="x_Country" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->Country->caption() ?><?php echo ($clientaddress->Country->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->Country->cellAttributes() ?>>
<span id="el_clientaddress_Country">
<input type="text" data-table="clientaddress" data-field="x_Country" name="x_Country" id="x_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 echo $clientaddress->Country->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Country">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_Country"><?php echo $clientaddress->Country->caption() ?><?php echo ($clientaddress->Country->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->Country->cellAttributes() ?>>
<span id="el_clientaddress_Country">
<input type="text" data-table="clientaddress" data-field="x_Country" name="x_Country" id="x_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 echo $clientaddress->Country->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->Notes->Visible) { // Notes ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_Notes" class="form-group row">
		<label id="elh_clientaddress_Notes" for="x_Notes" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->Notes->caption() ?><?php echo ($clientaddress->Notes->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->Notes->cellAttributes() ?>>
<span id="el_clientaddress_Notes">
<input type="text" data-table="clientaddress" data-field="x_Notes" name="x_Notes" id="x_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 echo $clientaddress->Notes->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Notes">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_Notes"><?php echo $clientaddress->Notes->caption() ?><?php echo ($clientaddress->Notes->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->Notes->cellAttributes() ?>>
<span id="el_clientaddress_Notes">
<input type="text" data-table="clientaddress" data-field="x_Notes" name="x_Notes" id="x_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 echo $clientaddress->Notes->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress->Primary->Visible) { // Primary ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
	<div id="r_Primary" class="form-group row">
		<label id="elh_clientaddress_Primary" class="<?php echo $clientaddress_add->LeftColumnClass ?>"><?php echo $clientaddress->Primary->caption() ?><?php echo ($clientaddress->Primary->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $clientaddress_add->RightColumnClass ?>"><div<?php echo $clientaddress->Primary->cellAttributes() ?>>
<span id="el_clientaddress_Primary">
<?php
$selwrk = (ConvertToBool($clientaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x_Primary[]" id="x_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->Primary->editAttributes() ?>>
</span>
<?php echo $clientaddress->Primary->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Primary">
		<td class="<?php echo $clientaddress_add->TableLeftColumnClass ?>"><span id="elh_clientaddress_Primary"><?php echo $clientaddress->Primary->caption() ?><?php echo ($clientaddress->Primary->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $clientaddress->Primary->cellAttributes() ?>>
<span id="el_clientaddress_Primary">
<?php
$selwrk = (ConvertToBool($clientaddress->Primary->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="clientaddress" data-field="x_Primary" name="x_Primary[]" id="x_Primary[]" value="1"<?php echo $selwrk ?><?php echo $clientaddress->Primary->editAttributes() ?>>
</span>
<?php echo $clientaddress->Primary->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($clientaddress_add->IsMobileOrModal) { ?>
</div><!-- /page* -->
<?php } else { ?>
</table><!-- /table* -->
<?php } ?>
<?php if (!$clientaddress_add->IsModal) { ?>
<div class="form-group row"><!-- buttons .form-group -->
	<div class="<?php echo $clientaddress_add->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?php echo $Language->phrase("AddBtn") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?php echo $clientaddress_add->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
	</div><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<?php } ?>
<?php if (!$clientaddress_add->IsMobileOrModal) { ?>
</div><!-- /desktop -->
<?php } ?>
</form>
<?php
$clientaddress_add->showPageFooter();
if (DEBUG_ENABLED)
	echo GetDebugMessage();
?>
<script>

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

</script>
<?php include_once "footer.php" ?>
<?php
$clientaddress_add->terminate();
?>
