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

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

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

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

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

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

// Validate form
ftmp_erroredit.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 ($tmp_error_edit->id->Required) { ?>
			elm = this.getElements("x" + infix + "_id");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $tmp_error->id->caption(), $tmp_error->id->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($tmp_error_edit->error_date->Required) { ?>
			elm = this.getElements("x" + infix + "_error_date");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $tmp_error->error_date->caption(), $tmp_error->error_date->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_error_date");
			if (elm && !ew.checkDateDef(elm.value))
				return this.onError(elm, "<?php echo JsEncode($tmp_error->error_date->errorMessage()) ?>");
		<?php if ($tmp_error_edit->error_desc->Required) { ?>
			elm = this.getElements("x" + infix + "_error_desc");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $tmp_error->error_desc->caption(), $tmp_error->error_desc->RequiredErrorMessage)) ?>");
		<?php } ?>
		<?php if ($tmp_error_edit->audit_time->Required) { ?>
			elm = this.getElements("x" + infix + "_audit_time");
			if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
				return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $tmp_error->audit_time->caption(), $tmp_error->audit_time->RequiredErrorMessage)) ?>");
		<?php } ?>
			elm = this.getElements("x" + infix + "_audit_time");
			if (elm && !ew.checkDateDef(elm.value))
				return this.onError(elm, "<?php echo JsEncode($tmp_error->audit_time->errorMessage()) ?>");

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

// Dynamic selection lists
// Form object for search

</script>
<script>

// Write your client script here, no need to add script tags.
</script>
<?php $tmp_error_edit->showPageHeader(); ?>
<?php
$tmp_error_edit->showMessage();
?>
<?php if (!$tmp_error_edit->IsModal) { ?>
<form name="ew-pager-form" class="form-inline ew-form ew-pager-form" action="<?php echo CurrentPageName() ?>">
<?php if (!isset($tmp_error_edit->Pager)) $tmp_error_edit->Pager = new PrevNextPager($tmp_error_edit->StartRec, $tmp_error_edit->DisplayRecs, $tmp_error_edit->TotalRecs, $tmp_error_edit->AutoHidePager) ?>
<?php if ($tmp_error_edit->Pager->RecordCount > 0 && $tmp_error_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 ($tmp_error_edit->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 ($tmp_error_edit->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 $tmp_error_edit->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($tmp_error_edit->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 ($tmp_error_edit->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 $tmp_error_edit->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<div class="clearfix"></div>
</form>
<?php } ?>
<form name="ftmp_erroredit" id="ftmp_erroredit" class="<?php echo $tmp_error_edit->FormClassName ?>" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($tmp_error_edit->CheckToken) { ?>
<input type="hidden" name="<?php echo TOKEN_NAME ?>" value="<?php echo $tmp_error_edit->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="tmp_error">
<input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="modal" value="<?php echo (int)$tmp_error_edit->IsModal ?>">
<?php if (!$tmp_error_edit->IsMobileOrModal) { ?>
<div class="ew-desktop"><!-- desktop -->
<?php } ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
<div class="ew-edit-div"><!-- page* -->
<?php } else { ?>
<table id="tbl_tmp_erroredit" class="table table-striped table-sm ew-desktop-table"><!-- table* -->
<?php } ?>
<?php if ($tmp_error->id->Visible) { // id ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
	<div id="r_id" class="form-group row">
		<label id="elh_tmp_error_id" class="<?php echo $tmp_error_edit->LeftColumnClass ?>"><?php echo $tmp_error->id->caption() ?><?php echo ($tmp_error->id->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $tmp_error_edit->RightColumnClass ?>"><div<?php echo $tmp_error->id->cellAttributes() ?>>
<span id="el_tmp_error_id">
<span<?php echo $tmp_error->id->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($tmp_error->id->EditValue) ?>"></span>
</span>
<input type="hidden" data-table="tmp_error" data-field="x_id" name="x_id" id="x_id" value="<?php echo HtmlEncode($tmp_error->id->CurrentValue) ?>">
<?php echo $tmp_error->id->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_id">
		<td class="<?php echo $tmp_error_edit->TableLeftColumnClass ?>"><span id="elh_tmp_error_id"><?php echo $tmp_error->id->caption() ?><?php echo ($tmp_error->id->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $tmp_error->id->cellAttributes() ?>>
<span id="el_tmp_error_id">
<span<?php echo $tmp_error->id->viewAttributes() ?>>
<input type="text" readonly class="form-control-plaintext" value="<?php echo RemoveHtml($tmp_error->id->EditValue) ?>"></span>
</span>
<input type="hidden" data-table="tmp_error" data-field="x_id" name="x_id" id="x_id" value="<?php echo HtmlEncode($tmp_error->id->CurrentValue) ?>">
<?php echo $tmp_error->id->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($tmp_error->error_date->Visible) { // error_date ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
	<div id="r_error_date" class="form-group row">
		<label id="elh_tmp_error_error_date" for="x_error_date" class="<?php echo $tmp_error_edit->LeftColumnClass ?>"><?php echo $tmp_error->error_date->caption() ?><?php echo ($tmp_error->error_date->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $tmp_error_edit->RightColumnClass ?>"><div<?php echo $tmp_error->error_date->cellAttributes() ?>>
<span id="el_tmp_error_error_date">
<input type="text" data-table="tmp_error" data-field="x_error_date" name="x_error_date" id="x_error_date" placeholder="<?php echo HtmlEncode($tmp_error->error_date->getPlaceHolder()) ?>" value="<?php echo $tmp_error->error_date->EditValue ?>"<?php echo $tmp_error->error_date->editAttributes() ?>>
<?php if (!$tmp_error->error_date->ReadOnly && !$tmp_error->error_date->Disabled && !isset($tmp_error->error_date->EditAttrs["readonly"]) && !isset($tmp_error->error_date->EditAttrs["disabled"])) { ?>
<script>
ew.createDateTimePicker("ftmp_erroredit", "x_error_date", {"ignoreReadonly":true,"useCurrent":false,"format":0});
</script>
<?php } ?>
</span>
<?php echo $tmp_error->error_date->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_error_date">
		<td class="<?php echo $tmp_error_edit->TableLeftColumnClass ?>"><span id="elh_tmp_error_error_date"><?php echo $tmp_error->error_date->caption() ?><?php echo ($tmp_error->error_date->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $tmp_error->error_date->cellAttributes() ?>>
<span id="el_tmp_error_error_date">
<input type="text" data-table="tmp_error" data-field="x_error_date" name="x_error_date" id="x_error_date" placeholder="<?php echo HtmlEncode($tmp_error->error_date->getPlaceHolder()) ?>" value="<?php echo $tmp_error->error_date->EditValue ?>"<?php echo $tmp_error->error_date->editAttributes() ?>>
<?php if (!$tmp_error->error_date->ReadOnly && !$tmp_error->error_date->Disabled && !isset($tmp_error->error_date->EditAttrs["readonly"]) && !isset($tmp_error->error_date->EditAttrs["disabled"])) { ?>
<script>
ew.createDateTimePicker("ftmp_erroredit", "x_error_date", {"ignoreReadonly":true,"useCurrent":false,"format":0});
</script>
<?php } ?>
</span>
<?php echo $tmp_error->error_date->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($tmp_error->error_desc->Visible) { // error_desc ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
	<div id="r_error_desc" class="form-group row">
		<label id="elh_tmp_error_error_desc" for="x_error_desc" class="<?php echo $tmp_error_edit->LeftColumnClass ?>"><?php echo $tmp_error->error_desc->caption() ?><?php echo ($tmp_error->error_desc->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $tmp_error_edit->RightColumnClass ?>"><div<?php echo $tmp_error->error_desc->cellAttributes() ?>>
<span id="el_tmp_error_error_desc">
<textarea data-table="tmp_error" data-field="x_error_desc" name="x_error_desc" id="x_error_desc" cols="35" rows="4" placeholder="<?php echo HtmlEncode($tmp_error->error_desc->getPlaceHolder()) ?>"<?php echo $tmp_error->error_desc->editAttributes() ?>><?php echo $tmp_error->error_desc->EditValue ?></textarea>
</span>
<?php echo $tmp_error->error_desc->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_error_desc">
		<td class="<?php echo $tmp_error_edit->TableLeftColumnClass ?>"><span id="elh_tmp_error_error_desc"><?php echo $tmp_error->error_desc->caption() ?><?php echo ($tmp_error->error_desc->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $tmp_error->error_desc->cellAttributes() ?>>
<span id="el_tmp_error_error_desc">
<textarea data-table="tmp_error" data-field="x_error_desc" name="x_error_desc" id="x_error_desc" cols="35" rows="4" placeholder="<?php echo HtmlEncode($tmp_error->error_desc->getPlaceHolder()) ?>"<?php echo $tmp_error->error_desc->editAttributes() ?>><?php echo $tmp_error->error_desc->EditValue ?></textarea>
</span>
<?php echo $tmp_error->error_desc->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($tmp_error->audit_time->Visible) { // audit_time ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
	<div id="r_audit_time" class="form-group row">
		<label id="elh_tmp_error_audit_time" for="x_audit_time" class="<?php echo $tmp_error_edit->LeftColumnClass ?>"><?php echo $tmp_error->audit_time->caption() ?><?php echo ($tmp_error->audit_time->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $tmp_error_edit->RightColumnClass ?>"><div<?php echo $tmp_error->audit_time->cellAttributes() ?>>
<span id="el_tmp_error_audit_time">
<input type="text" data-table="tmp_error" data-field="x_audit_time" name="x_audit_time" id="x_audit_time" placeholder="<?php echo HtmlEncode($tmp_error->audit_time->getPlaceHolder()) ?>" value="<?php echo $tmp_error->audit_time->EditValue ?>"<?php echo $tmp_error->audit_time->editAttributes() ?>>
<?php if (!$tmp_error->audit_time->ReadOnly && !$tmp_error->audit_time->Disabled && !isset($tmp_error->audit_time->EditAttrs["readonly"]) && !isset($tmp_error->audit_time->EditAttrs["disabled"])) { ?>
<script>
ew.createDateTimePicker("ftmp_erroredit", "x_audit_time", {"ignoreReadonly":true,"useCurrent":false,"format":0});
</script>
<?php } ?>
</span>
<?php echo $tmp_error->audit_time->CustomMsg ?></div></div>
	</div>
<?php } else { ?>
	<tr id="r_audit_time">
		<td class="<?php echo $tmp_error_edit->TableLeftColumnClass ?>"><span id="elh_tmp_error_audit_time"><?php echo $tmp_error->audit_time->caption() ?><?php echo ($tmp_error->audit_time->Required) ? $Language->phrase("FieldRequiredIndicator") : "" ?></span></td>
		<td<?php echo $tmp_error->audit_time->cellAttributes() ?>>
<span id="el_tmp_error_audit_time">
<input type="text" data-table="tmp_error" data-field="x_audit_time" name="x_audit_time" id="x_audit_time" placeholder="<?php echo HtmlEncode($tmp_error->audit_time->getPlaceHolder()) ?>" value="<?php echo $tmp_error->audit_time->EditValue ?>"<?php echo $tmp_error->audit_time->editAttributes() ?>>
<?php if (!$tmp_error->audit_time->ReadOnly && !$tmp_error->audit_time->Disabled && !isset($tmp_error->audit_time->EditAttrs["readonly"]) && !isset($tmp_error->audit_time->EditAttrs["disabled"])) { ?>
<script>
ew.createDateTimePicker("ftmp_erroredit", "x_audit_time", {"ignoreReadonly":true,"useCurrent":false,"format":0});
</script>
<?php } ?>
</span>
<?php echo $tmp_error->audit_time->CustomMsg ?></td>
	</tr>
<?php } ?>
<?php } ?>
<?php if ($tmp_error_edit->IsMobileOrModal) { ?>
</div><!-- /page* -->
<?php } else { ?>
</table><!-- /table* -->
<?php } ?>
<?php if (!$tmp_error_edit->IsModal) { ?>
<div class="form-group row"><!-- buttons .form-group -->
	<div class="<?php echo $tmp_error_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 $tmp_error_edit->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
	</div><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<?php } ?>
<?php if (!$tmp_error_edit->IsMobileOrModal) { ?>
</div><!-- /desktop -->
<?php } ?>
<?php if (!$tmp_error_edit->IsModal) { ?>
<?php if (!isset($tmp_error_edit->Pager)) $tmp_error_edit->Pager = new PrevNextPager($tmp_error_edit->StartRec, $tmp_error_edit->DisplayRecs, $tmp_error_edit->TotalRecs, $tmp_error_edit->AutoHidePager) ?>
<?php if ($tmp_error_edit->Pager->RecordCount > 0 && $tmp_error_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 ($tmp_error_edit->Pager->FirstButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerFirst") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 ($tmp_error_edit->Pager->PrevButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerPrevious") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 $tmp_error_edit->Pager->CurrentPage ?>">
<div class="input-group-append">
<!-- next page button -->
	<?php if ($tmp_error_edit->Pager->NextButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerNext") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 ($tmp_error_edit->Pager->LastButton->Enabled) { ?>
	<a class="btn btn-default" title="<?php echo $Language->phrase("PagerLast") ?>" href="<?php echo $tmp_error_edit->pageUrl() ?>start=<?php echo $tmp_error_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 $tmp_error_edit->Pager->PageCount ?></span>
<div class="clearfix"></div>
</div>
<?php } ?>
<div class="clearfix"></div>
<?php } ?>
</form>
<?php
$tmp_error_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
$tmp_error_edit->terminate();
?>
