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

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

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

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

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

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

// Validate form
flawyersedit.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 ($lawyers_edit->LawyerID->Required) { ?>
			elm = this.getElements("x" + infix + "_LawyerID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->LawyerID->caption(), $lawyers->LawyerID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->LawyerTypeID->Required) { ?>
			elm = this.getElements("x" + infix + "_LawyerTypeID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->LawyerTypeID->caption(), $lawyers->LawyerTypeID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->SyndicateNumber->Required) { ?>
			elm = this.getElements("x" + infix + "_SyndicateNumber");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->SyndicateNumber->caption(), $lawyers->SyndicateNumber->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_SyndicateNumber");
			if (elm && !ew.checkInteger(elm.value))
				return this.onError(elm, "<?php echo JsEncode($lawyers->SyndicateNumber->errorMessage()) ?>");
		<?php if ($lawyers_edit->FirmID->Required) { ?>
			elm = this.getElements("x" + infix + "_FirmID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->FirmID->caption(), $lawyers->FirmID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->TitleID->Required) { ?>
			elm = this.getElements("x" + infix + "_TitleID");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->TitleID->caption(), $lawyers->TitleID->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->FirstName->Required) { ?>
			elm = this.getElements("x" + infix + "_FirstName");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->FirstName->caption(), $lawyers->FirstName->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->MiddleName->Required) { ?>
			elm = this.getElements("x" + infix + "_MiddleName");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->MiddleName->caption(), $lawyers->MiddleName->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->LastName->Required) { ?>
			elm = this.getElements("x" + infix + "_LastName");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->LastName->caption(), $lawyers->LastName->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->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", $lawyers->Notes->caption(), $lawyers->Notes->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($lawyers_edit->Activated->Required) { ?>
			elm = this.getElements("x" + infix + "_Activated[]");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $lawyers->Activated->caption(), $lawyers->Activated->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
flawyersedit.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
flawyersedit.validateRequired = <?php echo json_encode(CLIENT_VALIDATE) ?>;

// Dynamic selection lists
flawyersedit.lists["x_LawyerTypeID"] = <?php echo $lawyers_edit->LawyerTypeID->Lookup->toClientList() ?>;
flawyersedit.lists["x_LawyerTypeID"].options = <?php echo JsonEncode($lawyers_edit->LawyerTypeID->lookupOptions()) ?>;
flawyersedit.lists["x_FirmID"] = <?php echo $lawyers_edit->FirmID->Lookup->toClientList() ?>;
flawyersedit.lists["x_FirmID"].options = <?php echo JsonEncode($lawyers_edit->FirmID->lookupOptions()) ?>;
flawyersedit.lists["x_TitleID"] = <?php echo $lawyers_edit->TitleID->Lookup->toClientList() ?>;
flawyersedit.lists["x_TitleID"].options = <?php echo JsonEncode($lawyers_edit->TitleID->lookupOptions()) ?>;
flawyersedit.lists["x_Activated[]"] = <?php echo $lawyers_edit->Activated->Lookup->toClientList() ?>;
flawyersedit.lists["x_Activated[]"].options = <?php echo JsonEncode($lawyers_edit->Activated->options(FALSE, TRUE)) ?>;

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

// Write your client script here, no need to add script tags.
</script>
<?php $lawyers_edit->showPageHeader(); ?>
<?php
$lawyers_edit->showMessage();
?>
<?php if (!$lawyers_edit->IsModal) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($lawyers_edit->Pager)) $lawyers_edit->Pager = new PrevNextPager($lawyers_edit->StartRec, $lawyers_edit->DisplayRecs, $lawyers_edit->TotalRecs, $lawyers_edit->AutoHidePager) ?>
<?php if ($lawyers_edit->Pager->RecordCount > 0 && $lawyers_edit->Pager->Visible) { ?>
<div class="ew-pager">
<span><?php echo $Language->Phrase("Page") ?>&nbsp;</span>
<div class="ew-prev-next"><div class="input-group input-group-sm">
<div class="input-group-prepend">
<!-- first page button -->
	<?php if ($lawyers_edit->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->FirstButton->Start ?>"><i class="icon-first ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerFirst") ?>"><i class="icon-first ew-icon"></i></a>
	<?php } ?>
<!-- previous page button -->
	<?php if ($lawyers_edit->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->PrevButton->Start ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerPrevious") ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } ?>
</div>
<!-- current page number -->
	<input class="form-control" type="text" name="<?php echo TABLE_PAGE_NO ?>" value="<?php echo $lawyers_edit->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($lawyers_edit->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->NextButton->Start ?>"><i class="icon-next ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerNext") ?>"><i class="icon-next ew-icon"></i></a>
	<?php } ?>
<!-- last page button -->
	<?php if ($lawyers_edit->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->LastButton->Start ?>"><i class="icon-last ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerLast") ?>"><i class="icon-last ew-icon"></i></a>
	<?php } ?>
</div>
</div>
</div>
<span>&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $lawyers_edit->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<div class="clearfix"></div>
</form>
<?php } ?>
<form name="flawyersedit" id="flawyersedit" class="<?php echo $lawyers_edit->FormClassName ?>" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($lawyers_edit->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $lawyers_edit->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="lawyers">
<input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="modal" value="<?php echo (int)$lawyers_edit->IsModal ?>">
<?php if (!$lawyers_edit->IsMobileOrModal) { ?>
<div class="ew-desktop"><!-- desktop -->
<?php } ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
<div class="ew-edit-div"><!-- page* -->
<?php } else { ?>
<table id="tbl_lawyersedit" class="table table-striped table-sm ew-desktop-table"><!-- table* -->
<?php } ?>
<?php if ($lawyers->LawyerTypeID->Visible) { // LawyerTypeID ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_LawyerTypeID" class="form-group row">
		<label id="elh_lawyers_LawyerTypeID" for="x_LawyerTypeID" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->LawyerTypeID->caption() ?><?php echo ($lawyers->LawyerTypeID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->LawyerTypeID->cellAttributes() ?>>
<span id="el_lawyers_LawyerTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_LawyerTypeID" data-value-separator="<?php echo $lawyers->LawyerTypeID->displayValueSeparatorAttribute() ?>" id="x_LawyerTypeID" name="x_LawyerTypeID"<?php echo $lawyers->LawyerTypeID->editAttributes() ?>>
		<?php echo $lawyers->LawyerTypeID->selectOptionListHtml("x_LawyerTypeID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "lawyertype") && !$lawyers->LawyerTypeID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_LawyerTypeID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->LawyerTypeID->caption() ?>" data-title="<?php echo $lawyers->LawyerTypeID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_LawyerTypeID',url:'lawyertypeaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->LawyerTypeID->Lookup->getParamTag("p_x_LawyerTypeID") ?>
</span>
<?php echo $lawyers->LawyerTypeID->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_LawyerTypeID">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_LawyerTypeID"><?php echo $lawyers->LawyerTypeID->caption() ?><?php echo ($lawyers->LawyerTypeID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->LawyerTypeID->cellAttributes() ?>>
<span id="el_lawyers_LawyerTypeID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_LawyerTypeID" data-value-separator="<?php echo $lawyers->LawyerTypeID->displayValueSeparatorAttribute() ?>" id="x_LawyerTypeID" name="x_LawyerTypeID"<?php echo $lawyers->LawyerTypeID->editAttributes() ?>>
		<?php echo $lawyers->LawyerTypeID->selectOptionListHtml("x_LawyerTypeID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "lawyertype") && !$lawyers->LawyerTypeID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_LawyerTypeID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->LawyerTypeID->caption() ?>" data-title="<?php echo $lawyers->LawyerTypeID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_LawyerTypeID',url:'lawyertypeaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->LawyerTypeID->Lookup->getParamTag("p_x_LawyerTypeID") ?>
</span>
<?php echo $lawyers->LawyerTypeID->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->SyndicateNumber->Visible) { // SyndicateNumber ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_SyndicateNumber" class="form-group row">
		<label id="elh_lawyers_SyndicateNumber" for="x_SyndicateNumber" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->SyndicateNumber->caption() ?><?php echo ($lawyers->SyndicateNumber->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->SyndicateNumber->cellAttributes() ?>>
<span id="el_lawyers_SyndicateNumber">
<input type="text" data-table="lawyers" data-field="x_SyndicateNumber" name="x_SyndicateNumber" id="x_SyndicateNumber" size="30" placeholder="<?php echo HtmlEncode($lawyers->SyndicateNumber->getPlaceHolder()) ?>" value="<?php echo $lawyers->SyndicateNumber->EditValue ?>"<?php echo $lawyers->SyndicateNumber->editAttributes() ?>>
</span>
<?php echo $lawyers->SyndicateNumber->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_SyndicateNumber">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_SyndicateNumber"><?php echo $lawyers->SyndicateNumber->caption() ?><?php echo ($lawyers->SyndicateNumber->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->SyndicateNumber->cellAttributes() ?>>
<span id="el_lawyers_SyndicateNumber">
<input type="text" data-table="lawyers" data-field="x_SyndicateNumber" name="x_SyndicateNumber" id="x_SyndicateNumber" size="30" placeholder="<?php echo HtmlEncode($lawyers->SyndicateNumber->getPlaceHolder()) ?>" value="<?php echo $lawyers->SyndicateNumber->EditValue ?>"<?php echo $lawyers->SyndicateNumber->editAttributes() ?>>
</span>
<?php echo $lawyers->SyndicateNumber->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->FirmID->Visible) { // FirmID ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_FirmID" class="form-group row">
		<label id="elh_lawyers_FirmID" for="x_FirmID" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->FirmID->caption() ?><?php echo ($lawyers->FirmID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->FirmID->cellAttributes() ?>>
<span id="el_lawyers_FirmID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_FirmID" data-value-separator="<?php echo $lawyers->FirmID->displayValueSeparatorAttribute() ?>" id="x_FirmID" name="x_FirmID"<?php echo $lawyers->FirmID->editAttributes() ?>>
		<?php echo $lawyers->FirmID->selectOptionListHtml("x_FirmID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "lawfirm") && !$lawyers->FirmID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_FirmID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->FirmID->caption() ?>" data-title="<?php echo $lawyers->FirmID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_FirmID',url:'lawfirmaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->FirmID->Lookup->getParamTag("p_x_FirmID") ?>
</span>
<?php echo $lawyers->FirmID->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_FirmID">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_FirmID"><?php echo $lawyers->FirmID->caption() ?><?php echo ($lawyers->FirmID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->FirmID->cellAttributes() ?>>
<span id="el_lawyers_FirmID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_FirmID" data-value-separator="<?php echo $lawyers->FirmID->displayValueSeparatorAttribute() ?>" id="x_FirmID" name="x_FirmID"<?php echo $lawyers->FirmID->editAttributes() ?>>
		<?php echo $lawyers->FirmID->selectOptionListHtml("x_FirmID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "lawfirm") && !$lawyers->FirmID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_FirmID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->FirmID->caption() ?>" data-title="<?php echo $lawyers->FirmID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_FirmID',url:'lawfirmaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->FirmID->Lookup->getParamTag("p_x_FirmID") ?>
</span>
<?php echo $lawyers->FirmID->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->TitleID->Visible) { // TitleID ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_TitleID" class="form-group row">
		<label id="elh_lawyers_TitleID" for="x_TitleID" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->TitleID->caption() ?><?php echo ($lawyers->TitleID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->TitleID->cellAttributes() ?>>
<span id="el_lawyers_TitleID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_TitleID" data-value-separator="<?php echo $lawyers->TitleID->displayValueSeparatorAttribute() ?>" id="x_TitleID" name="x_TitleID"<?php echo $lawyers->TitleID->editAttributes() ?>>
		<?php echo $lawyers->TitleID->selectOptionListHtml("x_TitleID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "titles") && !$lawyers->TitleID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_TitleID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->TitleID->caption() ?>" data-title="<?php echo $lawyers->TitleID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_TitleID',url:'titlesaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->TitleID->Lookup->getParamTag("p_x_TitleID") ?>
</span>
<?php echo $lawyers->TitleID->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_TitleID">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_TitleID"><?php echo $lawyers->TitleID->caption() ?><?php echo ($lawyers->TitleID->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->TitleID->cellAttributes() ?>>
<span id="el_lawyers_TitleID">
<div class="input-group">
	<select class="custom-select ew-custom-select" data-table="lawyers" data-field="x_TitleID" data-value-separator="<?php echo $lawyers->TitleID->displayValueSeparatorAttribute() ?>" id="x_TitleID" name="x_TitleID"<?php echo $lawyers->TitleID->editAttributes() ?>>
		<?php echo $lawyers->TitleID->selectOptionListHtml("x_TitleID") ?>
	</select>
<?php if (AllowAdd(CurrentProjectID() . "titles") && !$lawyers->TitleID->ReadOnly) { ?>
<div class="input-group-append"><button type="button" class="btn btn-default ew-add-opt-btn" id="aol_x_TitleID" title="<?php echo HtmlTitle($Language->phrase("AddLink")) . "&nbsp;" . $lawyers->TitleID->caption() ?>" data-title="<?php echo $lawyers->TitleID->caption() ?>" onclick="ew.addOptionDialogShow({lnk:this,el:'x_TitleID',url:'titlesaddopt.php'});"><i class="fa fa-plus ew-icon"></i></button></div>
<?php } ?>
</div>
<?php echo $lawyers->TitleID->Lookup->getParamTag("p_x_TitleID") ?>
</span>
<?php echo $lawyers->TitleID->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->FirstName->Visible) { // FirstName ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_FirstName" class="form-group row">
		<label id="elh_lawyers_FirstName" for="x_FirstName" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->FirstName->caption() ?><?php echo ($lawyers->FirstName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->FirstName->cellAttributes() ?>>
<span id="el_lawyers_FirstName">
<input type="text" data-table="lawyers" data-field="x_FirstName" name="x_FirstName" id="x_FirstName" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($lawyers->FirstName->getPlaceHolder()) ?>" value="<?php echo $lawyers->FirstName->EditValue ?>"<?php echo $lawyers->FirstName->editAttributes() ?>>
</span>
<?php echo $lawyers->FirstName->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_FirstName">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_FirstName"><?php echo $lawyers->FirstName->caption() ?><?php echo ($lawyers->FirstName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->FirstName->cellAttributes() ?>>
<span id="el_lawyers_FirstName">
<input type="text" data-table="lawyers" data-field="x_FirstName" name="x_FirstName" id="x_FirstName" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($lawyers->FirstName->getPlaceHolder()) ?>" value="<?php echo $lawyers->FirstName->EditValue ?>"<?php echo $lawyers->FirstName->editAttributes() ?>>
</span>
<?php echo $lawyers->FirstName->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->MiddleName->Visible) { // MiddleName ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_MiddleName" class="form-group row">
		<label id="elh_lawyers_MiddleName" for="x_MiddleName" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->MiddleName->caption() ?><?php echo ($lawyers->MiddleName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->MiddleName->cellAttributes() ?>>
<span id="el_lawyers_MiddleName">
<input type="text" data-table="lawyers" data-field="x_MiddleName" name="x_MiddleName" id="x_MiddleName" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($lawyers->MiddleName->getPlaceHolder()) ?>" value="<?php echo $lawyers->MiddleName->EditValue ?>"<?php echo $lawyers->MiddleName->editAttributes() ?>>
</span>
<?php echo $lawyers->MiddleName->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_MiddleName">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_MiddleName"><?php echo $lawyers->MiddleName->caption() ?><?php echo ($lawyers->MiddleName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->MiddleName->cellAttributes() ?>>
<span id="el_lawyers_MiddleName">
<input type="text" data-table="lawyers" data-field="x_MiddleName" name="x_MiddleName" id="x_MiddleName" size="30" maxlength="30" placeholder="<?php echo HtmlEncode($lawyers->MiddleName->getPlaceHolder()) ?>" value="<?php echo $lawyers->MiddleName->EditValue ?>"<?php echo $lawyers->MiddleName->editAttributes() ?>>
</span>
<?php echo $lawyers->MiddleName->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->LastName->Visible) { // LastName ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_LastName" class="form-group row">
		<label id="elh_lawyers_LastName" for="x_LastName" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->LastName->caption() ?><?php echo ($lawyers->LastName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->LastName->cellAttributes() ?>>
<span id="el_lawyers_LastName">
<input type="text" data-table="lawyers" data-field="x_LastName" name="x_LastName" id="x_LastName" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($lawyers->LastName->getPlaceHolder()) ?>" value="<?php echo $lawyers->LastName->EditValue ?>"<?php echo $lawyers->LastName->editAttributes() ?>>
</span>
<?php echo $lawyers->LastName->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_LastName">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_LastName"><?php echo $lawyers->LastName->caption() ?><?php echo ($lawyers->LastName->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->LastName->cellAttributes() ?>>
<span id="el_lawyers_LastName">
<input type="text" data-table="lawyers" data-field="x_LastName" name="x_LastName" id="x_LastName" size="30" maxlength="50" placeholder="<?php echo HtmlEncode($lawyers->LastName->getPlaceHolder()) ?>" value="<?php echo $lawyers->LastName->EditValue ?>"<?php echo $lawyers->LastName->editAttributes() ?>>
</span>
<?php echo $lawyers->LastName->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->Notes->Visible) { // Notes ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_Notes" class="form-group row">
		<label id="elh_lawyers_Notes" for="x_Notes" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->Notes->caption() ?><?php echo ($lawyers->Notes->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->Notes->cellAttributes() ?>>
<span id="el_lawyers_Notes">
<textarea data-table="lawyers" data-field="x_Notes" name="x_Notes" id="x_Notes" cols="35" rows="4" placeholder="<?php echo HtmlEncode($lawyers->Notes->getPlaceHolder()) ?>"<?php echo $lawyers->Notes->editAttributes() ?>><?php echo $lawyers->Notes->EditValue ?></textarea>
</span>
<?php echo $lawyers->Notes->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Notes">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_Notes"><?php echo $lawyers->Notes->caption() ?><?php echo ($lawyers->Notes->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->Notes->cellAttributes() ?>>
<span id="el_lawyers_Notes">
<textarea data-table="lawyers" data-field="x_Notes" name="x_Notes" id="x_Notes" cols="35" rows="4" placeholder="<?php echo HtmlEncode($lawyers->Notes->getPlaceHolder()) ?>"<?php echo $lawyers->Notes->editAttributes() ?>><?php echo $lawyers->Notes->EditValue ?></textarea>
</span>
<?php echo $lawyers->Notes->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers->Activated->Visible) { // Activated ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
	<div id="r_Activated" class="form-group row">
		<label id="elh_lawyers_Activated" class="<?php echo $lawyers_edit->LeftColumnClass ?>"><?php echo $lawyers->Activated->caption() ?><?php echo ($lawyers->Activated->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $lawyers_edit->RightColumnClass ?>"><div<?php echo $lawyers->Activated->cellAttributes() ?>>
<span id="el_lawyers_Activated">
<?php
$selwrk = (ConvertToBool($lawyers->Activated->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="lawyers" data-field="x_Activated" name="x_Activated[]" id="x_Activated[]" value="1"<?php echo $selwrk ?><?php echo $lawyers->Activated->editAttributes() ?>>
</span>
<?php echo $lawyers->Activated->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_Activated">
		<td class="<?php echo $lawyers_edit->TableLeftColumnClass ?>"><span id="elh_lawyers_Activated"><?php echo $lawyers->Activated->caption() ?><?php echo ($lawyers->Activated->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $lawyers->Activated->cellAttributes() ?>>
<span id="el_lawyers_Activated">
<?php
$selwrk = (ConvertToBool($lawyers->Activated->CurrentValue)) ? " checked" : "";
?>
<input type="checkbox" data-table="lawyers" data-field="x_Activated" name="x_Activated[]" id="x_Activated[]" value="1"<?php echo $selwrk ?><?php echo $lawyers->Activated->editAttributes() ?>>
</span>
<?php echo $lawyers->Activated->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($lawyers_edit->IsMobileOrModal) { ?>
</div><!-- /page* -->
<?php } else { ?>
</table><!-- /table* -->
<?php } ?>
<span id="el_lawyers_LawyerID">
<input type="hidden" data-table="lawyers" data-field="x_LawyerID" name="x_LawyerID" id="x_LawyerID" value="<?php echo HtmlEncode($lawyers->LawyerID->CurrentValue) ?>">
</span>
<?php if ($lawyers->getCurrentDetailTable() <> "") { ?>
<?php
	$lawyers_edit->DetailPages->ValidKeys = explode(",", $lawyers->getCurrentDetailTable());
	$firstActiveDetailTable = $lawyers_edit->DetailPages->activePageIndex();
?>
<div class="ew-detail-pages"><!-- detail-pages -->
<div class="ew-nav-tabs" id="lawyers_edit_details"><!-- tabs -->
	<ul class="<?php echo $lawyers_edit->DetailPages->navStyle() ?>"><!-- .nav -->
<?php
	if (in_array("lawyeraddress", explode(",", $lawyers->getCurrentDetailTable())) && $lawyeraddress->DetailEdit) {
		if ($firstActiveDetailTable == "" || $firstActiveDetailTable == "lawyeraddress") {
			$firstActiveDetailTable = "lawyeraddress";
		}
?>
		<li class="nav-item"><a class="nav-link<?php echo $lawyers_edit->DetailPages->pageStyle("lawyeraddress") ?>" href="#tab_lawyeraddress" data-toggle="tab"><?php echo $Language->TablePhrase("lawyeraddress", "TblCaption") ?></a></li>
<?php
	}
?>
<?php
	if (in_array("lawyercontact", explode(",", $lawyers->getCurrentDetailTable())) && $lawyercontact->DetailEdit) {
		if ($firstActiveDetailTable == "" || $firstActiveDetailTable == "lawyercontact") {
			$firstActiveDetailTable = "lawyercontact";
		}
?>
		<li class="nav-item"><a class="nav-link<?php echo $lawyers_edit->DetailPages->pageStyle("lawyercontact") ?>" href="#tab_lawyercontact" data-toggle="tab"><?php echo $Language->TablePhrase("lawyercontact", "TblCaption") ?></a></li>
<?php
	}
?>
	</ul><!-- /.nav -->
	<div class="tab-content"><!-- .tab-content -->
<?php
	if (in_array("lawyeraddress", explode(",", $lawyers->getCurrentDetailTable())) && $lawyeraddress->DetailEdit) {
		if ($firstActiveDetailTable == "" || $firstActiveDetailTable == "lawyeraddress")
			$firstActiveDetailTable = "lawyeraddress";
?>
		<div class="tab-pane<?php echo $lawyers_edit->DetailPages->pageStyle("lawyeraddress") ?>" id="tab_lawyeraddress"><!-- page* -->
<?php include_once "lawyeraddressgrid.php" ?>
		</div><!-- /page* -->
<?php } ?>
<?php
	if (in_array("lawyercontact", explode(",", $lawyers->getCurrentDetailTable())) && $lawyercontact->DetailEdit) {
		if ($firstActiveDetailTable == "" || $firstActiveDetailTable == "lawyercontact")
			$firstActiveDetailTable = "lawyercontact";
?>
		<div class="tab-pane<?php echo $lawyers_edit->DetailPages->pageStyle("lawyercontact") ?>" id="tab_lawyercontact"><!-- page* -->
<?php include_once "lawyercontactgrid.php" ?>
		</div><!-- /page* -->
<?php } ?>
	</div><!-- /.tab-content -->
</div><!-- /tabs -->
</div><!-- /detail-pages -->
<?php } ?>
<?php if (!$lawyers_edit->IsModal) { ?>
<div class="form-group row"><!-- buttons .form-group -->
	<div class="<?php echo $lawyers_edit->OffsetColumnClass ?>"><!-- buttons offset -->
<button class="btn btn-primary ew-btn" name="btn-action" id="btn-action" type="submit"><?php echo $Language->phrase("SaveBtn") ?></button>
<button class="btn btn-default ew-btn" name="btn-cancel" id="btn-cancel" type="button" data-href="<?php echo $lawyers_edit->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
	</div><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<?php } ?>
<?php if (!$lawyers_edit->IsMobileOrModal) { ?>
</div><!-- /desktop -->
<?php } ?>
<?php if (!$lawyers_edit->IsModal) { ?>
<?php if (!isset($lawyers_edit->Pager)) $lawyers_edit->Pager = new PrevNextPager($lawyers_edit->StartRec, $lawyers_edit->DisplayRecs, $lawyers_edit->TotalRecs, $lawyers_edit->AutoHidePager) ?>
<?php if ($lawyers_edit->Pager->RecordCount > 0 && $lawyers_edit->Pager->Visible) { ?>
<div class="ew-pager">
<span><?php echo $Language->Phrase("Page") ?>&nbsp;</span>
<div class="ew-prev-next"><div class="input-group input-group-sm">
<div class="input-group-prepend">
<!-- first page button -->
	<?php if ($lawyers_edit->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->FirstButton->Start ?>"><i class="icon-first ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerFirst") ?>"><i class="icon-first ew-icon"></i></a>
	<?php } ?>
<!-- previous page button -->
	<?php if ($lawyers_edit->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->PrevButton->Start ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerPrevious") ?>"><i class="icon-prev ew-icon"></i></a>
	<?php } ?>
</div>
<!-- current page number -->
	<input class="form-control" type="text" name="<?php echo TABLE_PAGE_NO ?>" value="<?php echo $lawyers_edit->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($lawyers_edit->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->NextButton->Start ?>"><i class="icon-next ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerNext") ?>"><i class="icon-next ew-icon"></i></a>
	<?php } ?>
<!-- last page button -->
	<?php if ($lawyers_edit->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $lawyers_edit->pageUrl() ?>start=<?php echo $lawyers_edit->Pager->LastButton->Start ?>"><i class="icon-last ew-icon"></i></a>
	<?php } else { ?>
	<a class="btn btn-default disabled" title="<?php echo $Language->phrase("PagerLast") ?>"><i class="icon-last ew-icon"></i></a>
	<?php } ?>
</div>
</div>
</div>
<span>&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $lawyers_edit->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<div class="clearfix"></div>
<?php } ?>
</form>
<?php
$lawyers_edit->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
$lawyers_edit->terminate();
?>
