<?php
namespace PHPMaker2020\project2;

// 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
$kp_pago_edit = new kp_pago_edit();

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

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

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

// Page Rendering event
$kp_pago_edit->Page_Render();
?>
<?php include_once "header.php"; ?>
<script>
var fkp_pagoedit, currentPageID;
loadjs.ready("head", function() {

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

	// Validate form
	fkp_pagoedit.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 ($kp_pago_edit->idpago->Required) { ?>
				elm = this.getElements("x" + infix + "_idpago");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->idpago->caption(), $kp_pago_edit->idpago->RequiredErrorMessage)) ?>");
			<?php } ?>
			<?php if ($kp_pago_edit->idinteresado->Required) { ?>
				elm = this.getElements("x" + infix + "_idinteresado");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->idinteresado->caption(), $kp_pago_edit->idinteresado->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_idinteresado");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->idinteresado->errorMessage()) ?>");
			<?php if ($kp_pago_edit->monto->Required) { ?>
				elm = this.getElements("x" + infix + "_monto");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->monto->caption(), $kp_pago_edit->monto->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_monto");
				if (elm && !ew.checkNumber(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->monto->errorMessage()) ?>");
			<?php if ($kp_pago_edit->estado->Required) { ?>
				elm = this.getElements("x" + infix + "_estado");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->estado->caption(), $kp_pago_edit->estado->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_estado");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->estado->errorMessage()) ?>");
			<?php if ($kp_pago_edit->acciones->Required) { ?>
				elm = this.getElements("x" + infix + "_acciones");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->acciones->caption(), $kp_pago_edit->acciones->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_acciones");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->acciones->errorMessage()) ?>");
			<?php if ($kp_pago_edit->idusuario->Required) { ?>
				elm = this.getElements("x" + infix + "_idusuario");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->idusuario->caption(), $kp_pago_edit->idusuario->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_idusuario");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->idusuario->errorMessage()) ?>");
			<?php if ($kp_pago_edit->fecha->Required) { ?>
				elm = this.getElements("x" + infix + "_fecha");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->fecha->caption(), $kp_pago_edit->fecha->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_fecha");
				if (elm && !ew.checkDateDef(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->fecha->errorMessage()) ?>");
			<?php if ($kp_pago_edit->num_cuota->Required) { ?>
				elm = this.getElements("x" + infix + "_num_cuota");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->num_cuota->caption(), $kp_pago_edit->num_cuota->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_num_cuota");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->num_cuota->errorMessage()) ?>");
			<?php if ($kp_pago_edit->codcliente->Required) { ?>
				elm = this.getElements("x" + infix + "_codcliente");
				if (elm && !ew.isHidden(elm) && !ew.hasValue(elm))
					return this.onError(elm, "<?php echo JsEncode(str_replace("%s", $kp_pago_edit->codcliente->caption(), $kp_pago_edit->codcliente->RequiredErrorMessage)) ?>");
			<?php } ?>
				elm = this.getElements("x" + infix + "_codcliente");
				if (elm && !ew.checkInteger(elm.value))
					return this.onError(elm, "<?php echo JsEncode($kp_pago_edit->codcliente->errorMessage()) ?>");

				// Call 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
	fkp_pagoedit.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
	fkp_pagoedit.validateRequired = <?php echo Config("CLIENT_VALIDATE") ? "true" : "false" ?>;

	// Dynamic selection lists
	loadjs.done("fkp_pagoedit");
});
</script>
<script>
loadjs.ready("head", function() {

	// Client script
	// Write your client script here, no need to add script tags.

});
</script>
<?php $kp_pago_edit->showPageHeader(); ?>
<?php
$kp_pago_edit->showMessage();
?>
<form name="fkp_pagoedit" id="fkp_pagoedit" class="<?php echo $kp_pago_edit->FormClassName ?>" action="<?php echo CurrentPageName() ?>" method="post">
<?php if ($Page->CheckToken) { ?>
<input type="hidden" name="<?php echo Config("TOKEN_NAME") ?>" value="<?php echo $Page->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="kp_pago">
<input type="hidden" name="action" id="action" value="update">
<input type="hidden" name="modal" value="<?php echo (int)$kp_pago_edit->IsModal ?>">
<div class="ew-edit-div"><!-- page* -->
<?php if ($kp_pago_edit->idpago->Visible) { // idpago ?>
	<div id="r_idpago" class="form-group row">
		<label id="elh_kp_pago_idpago" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->idpago->caption() ?><?php echo $kp_pago_edit->idpago->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->idpago->cellAttributes() ?>>
<span id="el_kp_pago_idpago">
<span<?php echo $kp_pago_edit->idpago->viewAttributes() ?>><input type="text" readonly class="form-control-plaintext" value="<?php echo HtmlEncode(RemoveHtml($kp_pago_edit->idpago->EditValue)) ?>"></span>
</span>
<input type="hidden" data-table="kp_pago" data-field="x_idpago" name="x_idpago" id="x_idpago" value="<?php echo HtmlEncode($kp_pago_edit->idpago->CurrentValue) ?>">
<?php echo $kp_pago_edit->idpago->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->idinteresado->Visible) { // idinteresado ?>
	<div id="r_idinteresado" class="form-group row">
		<label id="elh_kp_pago_idinteresado" for="x_idinteresado" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->idinteresado->caption() ?><?php echo $kp_pago_edit->idinteresado->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->idinteresado->cellAttributes() ?>>
<span id="el_kp_pago_idinteresado">
<input type="text" data-table="kp_pago" data-field="x_idinteresado" name="x_idinteresado" id="x_idinteresado" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->idinteresado->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->idinteresado->EditValue ?>"<?php echo $kp_pago_edit->idinteresado->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->idinteresado->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->monto->Visible) { // monto ?>
	<div id="r_monto" class="form-group row">
		<label id="elh_kp_pago_monto" for="x_monto" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->monto->caption() ?><?php echo $kp_pago_edit->monto->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->monto->cellAttributes() ?>>
<span id="el_kp_pago_monto">
<input type="text" data-table="kp_pago" data-field="x_monto" name="x_monto" id="x_monto" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->monto->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->monto->EditValue ?>"<?php echo $kp_pago_edit->monto->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->monto->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->estado->Visible) { // estado ?>
	<div id="r_estado" class="form-group row">
		<label id="elh_kp_pago_estado" for="x_estado" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->estado->caption() ?><?php echo $kp_pago_edit->estado->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->estado->cellAttributes() ?>>
<span id="el_kp_pago_estado">
<input type="text" data-table="kp_pago" data-field="x_estado" name="x_estado" id="x_estado" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->estado->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->estado->EditValue ?>"<?php echo $kp_pago_edit->estado->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->estado->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->acciones->Visible) { // acciones ?>
	<div id="r_acciones" class="form-group row">
		<label id="elh_kp_pago_acciones" for="x_acciones" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->acciones->caption() ?><?php echo $kp_pago_edit->acciones->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->acciones->cellAttributes() ?>>
<span id="el_kp_pago_acciones">
<input type="text" data-table="kp_pago" data-field="x_acciones" name="x_acciones" id="x_acciones" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->acciones->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->acciones->EditValue ?>"<?php echo $kp_pago_edit->acciones->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->acciones->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->idusuario->Visible) { // idusuario ?>
	<div id="r_idusuario" class="form-group row">
		<label id="elh_kp_pago_idusuario" for="x_idusuario" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->idusuario->caption() ?><?php echo $kp_pago_edit->idusuario->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->idusuario->cellAttributes() ?>>
<span id="el_kp_pago_idusuario">
<input type="text" data-table="kp_pago" data-field="x_idusuario" name="x_idusuario" id="x_idusuario" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->idusuario->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->idusuario->EditValue ?>"<?php echo $kp_pago_edit->idusuario->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->idusuario->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->fecha->Visible) { // fecha ?>
	<div id="r_fecha" class="form-group row">
		<label id="elh_kp_pago_fecha" for="x_fecha" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->fecha->caption() ?><?php echo $kp_pago_edit->fecha->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->fecha->cellAttributes() ?>>
<span id="el_kp_pago_fecha">
<input type="text" data-table="kp_pago" data-field="x_fecha" name="x_fecha" id="x_fecha" maxlength="19" placeholder="<?php echo HtmlEncode($kp_pago_edit->fecha->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->fecha->EditValue ?>"<?php echo $kp_pago_edit->fecha->editAttributes() ?>>
<?php if (!$kp_pago_edit->fecha->ReadOnly && !$kp_pago_edit->fecha->Disabled && !isset($kp_pago_edit->fecha->EditAttrs["readonly"]) && !isset($kp_pago_edit->fecha->EditAttrs["disabled"])) { ?>
<script>
loadjs.ready(["fkp_pagoedit", "datetimepicker"], function() {
	ew.createDateTimePicker("fkp_pagoedit", "x_fecha", {"ignoreReadonly":true,"useCurrent":false,"format":0});
});
</script>
<?php } ?>
</span>
<?php echo $kp_pago_edit->fecha->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->num_cuota->Visible) { // num_cuota ?>
	<div id="r_num_cuota" class="form-group row">
		<label id="elh_kp_pago_num_cuota" for="x_num_cuota" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->num_cuota->caption() ?><?php echo $kp_pago_edit->num_cuota->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->num_cuota->cellAttributes() ?>>
<span id="el_kp_pago_num_cuota">
<input type="text" data-table="kp_pago" data-field="x_num_cuota" name="x_num_cuota" id="x_num_cuota" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->num_cuota->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->num_cuota->EditValue ?>"<?php echo $kp_pago_edit->num_cuota->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->num_cuota->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($kp_pago_edit->codcliente->Visible) { // codcliente ?>
	<div id="r_codcliente" class="form-group row">
		<label id="elh_kp_pago_codcliente" for="x_codcliente" class="<?php echo $kp_pago_edit->LeftColumnClass ?>"><?php echo $kp_pago_edit->codcliente->caption() ?><?php echo $kp_pago_edit->codcliente->Required ? $Language->phrase("FieldRequiredIndicator") : "" ?></label>
		<div class="<?php echo $kp_pago_edit->RightColumnClass ?>"><div <?php echo $kp_pago_edit->codcliente->cellAttributes() ?>>
<span id="el_kp_pago_codcliente">
<input type="text" data-table="kp_pago" data-field="x_codcliente" name="x_codcliente" id="x_codcliente" size="30" maxlength="11" placeholder="<?php echo HtmlEncode($kp_pago_edit->codcliente->getPlaceHolder()) ?>" value="<?php echo $kp_pago_edit->codcliente->EditValue ?>"<?php echo $kp_pago_edit->codcliente->editAttributes() ?>>
</span>
<?php echo $kp_pago_edit->codcliente->CustomMsg ?></div></div>
	</div>
<?php } ?>
</div><!-- /page* -->
<?php if (!$kp_pago_edit->IsModal) { ?>
<div class="form-group row"><!-- buttons .form-group -->
	<div class="<?php echo $kp_pago_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 $kp_pago_edit->getReturnUrl() ?>"><?php echo $Language->phrase("CancelBtn") ?></button>
	</div><!-- /buttons offset -->
</div><!-- /buttons .form-group -->
<?php } ?>
</form>
<?php
$kp_pago_edit->showPageFooter();
if (Config("DEBUG"))
	echo GetDebugMessage();
?>
<script>
loadjs.ready("load", function() {

	// Startup script
	// Write your table-specific startup script here
	// console.log("page loaded");

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