<?php
if (session_id() == "") session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include_once "ewcfg12.php" ?>
<?php include_once ((EW_USE_ADODB) ? "adodb5/adodb.inc.php" : "ewmysql12.php") ?>
<?php include_once "phpfn12.php" ?>
<?php include_once "consulta_final_2021info.php" ?>
<?php include_once "userfn12.php" ?>
<?php

//
// Page class
//

$consulta_final_2021_add = NULL; // Initialize page object first

class cconsulta_final_2021_add extends cconsulta_final_2021 {

	// Page ID
	var $PageID = 'add';

	// Project ID
	var $ProjectID = "{612F4CEC-277D-477B-ABAC-2B8738F52202}";

	// Table name
	var $TableName = 'consulta_final_2021';

	// Page object name
	var $PageObjName = 'consulta_final_2021_add';

	// Page name
	function PageName() {
		return ew_CurrentPage();
	}

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		if ($this->UseTokenInUrl) $PageUrl .= "t=" . $this->TableVar . "&"; // Add page token
		return $PageUrl;
	}

	// Message
	function getMessage() {
		return @$_SESSION[EW_SESSION_MESSAGE];
	}

	function setMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_MESSAGE], $v);
	}

	function getFailureMessage() {
		return @$_SESSION[EW_SESSION_FAILURE_MESSAGE];
	}

	function setFailureMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_FAILURE_MESSAGE], $v);
	}

	function getSuccessMessage() {
		return @$_SESSION[EW_SESSION_SUCCESS_MESSAGE];
	}

	function setSuccessMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_SUCCESS_MESSAGE], $v);
	}

	function getWarningMessage() {
		return @$_SESSION[EW_SESSION_WARNING_MESSAGE];
	}

	function setWarningMessage($v) {
		ew_AddMessage($_SESSION[EW_SESSION_WARNING_MESSAGE], $v);
	}

	// Methods to clear message
	function ClearMessage() {
		$_SESSION[EW_SESSION_MESSAGE] = "";
	}

	function ClearFailureMessage() {
		$_SESSION[EW_SESSION_FAILURE_MESSAGE] = "";
	}

	function ClearSuccessMessage() {
		$_SESSION[EW_SESSION_SUCCESS_MESSAGE] = "";
	}

	function ClearWarningMessage() {
		$_SESSION[EW_SESSION_WARNING_MESSAGE] = "";
	}

	function ClearMessages() {
		$_SESSION[EW_SESSION_MESSAGE] = "";
		$_SESSION[EW_SESSION_FAILURE_MESSAGE] = "";
		$_SESSION[EW_SESSION_SUCCESS_MESSAGE] = "";
		$_SESSION[EW_SESSION_WARNING_MESSAGE] = "";
	}

	// Show message
	function ShowMessage() {
		$hidden = FALSE;
		$html = "";

		// Message
		$sMessage = $this->getMessage();
		$this->Message_Showing($sMessage, "");
		if ($sMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sMessage;
			$html .= "<div class=\"alert alert-info ewInfo\">" . $sMessage . "</div>";
			$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
		}

		// Warning message
		$sWarningMessage = $this->getWarningMessage();
		$this->Message_Showing($sWarningMessage, "warning");
		if ($sWarningMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sWarningMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sWarningMessage;
			$html .= "<div class=\"alert alert-warning ewWarning\">" . $sWarningMessage . "</div>";
			$_SESSION[EW_SESSION_WARNING_MESSAGE] = ""; // Clear message in Session
		}

		// Success message
		$sSuccessMessage = $this->getSuccessMessage();
		$this->Message_Showing($sSuccessMessage, "success");
		if ($sSuccessMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sSuccessMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sSuccessMessage;
			$html .= "<div class=\"alert alert-success ewSuccess\">" . $sSuccessMessage . "</div>";
			$_SESSION[EW_SESSION_SUCCESS_MESSAGE] = ""; // Clear message in Session
		}

		// Failure message
		$sErrorMessage = $this->getFailureMessage();
		$this->Message_Showing($sErrorMessage, "failure");
		if ($sErrorMessage <> "") { // Message in Session, display
			if (!$hidden)
				$sErrorMessage = "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>" . $sErrorMessage;
			$html .= "<div class=\"alert alert-danger ewError\">" . $sErrorMessage . "</div>";
			$_SESSION[EW_SESSION_FAILURE_MESSAGE] = ""; // Clear message in Session
		}
		echo "<div class=\"ewMessageDialog\"" . (($hidden) ? " style=\"display: none;\"" : "") . ">" . $html . "</div>";
	}
	var $PageHeader;
	var $PageFooter;

	// Show Page Header
	function ShowPageHeader() {
		$sHeader = $this->PageHeader;
		$this->Page_DataRendering($sHeader);
		if ($sHeader <> "") { // Header exists, display
			echo "<p>" . $sHeader . "</p>";
		}
	}

	// Show Page Footer
	function ShowPageFooter() {
		$sFooter = $this->PageFooter;
		$this->Page_DataRendered($sFooter);
		if ($sFooter <> "") { // Footer exists, display
			echo "<p>" . $sFooter . "</p>";
		}
	}

	// Validate page request
	function IsPageRequest() {
		global $objForm;
		if ($this->UseTokenInUrl) {
			if ($objForm)
				return ($this->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($this->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}
	var $Token = "";
	var $TokenTimeout = 0;
	var $CheckToken = EW_CHECK_TOKEN;
	var $CheckTokenFn = "ew_CheckToken";
	var $CreateTokenFn = "ew_CreateToken";

	// Valid Post
	function ValidPost() {
		if (!$this->CheckToken || !ew_IsHttpPost())
			return TRUE;
		if (!isset($_POST[EW_TOKEN_NAME]))
			return FALSE;
		$fn = $this->CheckTokenFn;
		if (is_callable($fn))
			return $fn($_POST[EW_TOKEN_NAME], $this->TokenTimeout);
		return FALSE;
	}

	// Create Token
	function CreateToken() {
		global $gsToken;
		if ($this->CheckToken) {
			$fn = $this->CreateTokenFn;
			if ($this->Token == "" && is_callable($fn)) // Create token
				$this->Token = $fn();
			$gsToken = $this->Token; // Save to global variable
		}
	}

	//
	// Page class constructor
	//
	function __construct() {
		global $conn, $Language;
		$GLOBALS["Page"] = &$this;
		$this->TokenTimeout = ew_SessionTimeoutTime();

		// Language object
		if (!isset($Language)) $Language = new cLanguage();

		// Parent constuctor
		parent::__construct();

		// Table object (consulta_final_2021)
		if (!isset($GLOBALS["consulta_final_2021"]) || get_class($GLOBALS["consulta_final_2021"]) == "cconsulta_final_2021") {
			$GLOBALS["consulta_final_2021"] = &$this;
			$GLOBALS["Table"] = &$GLOBALS["consulta_final_2021"];
		}

		// Page ID
		if (!defined("EW_PAGE_ID"))
			define("EW_PAGE_ID", 'add', TRUE);

		// Table name (for backward compatibility)
		if (!defined("EW_TABLE_NAME"))
			define("EW_TABLE_NAME", 'consulta_final_2021', TRUE);

		// Start timer
		if (!isset($GLOBALS["gTimer"])) $GLOBALS["gTimer"] = new cTimer();

		// Open connection
		if (!isset($conn)) $conn = ew_Connect($this->DBID);
	}

	// 
	//  Page_Init
	//
	function Page_Init() {
		global $gsExport, $gsCustomExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;

		// Create form object
		$objForm = new cFormObj();
		$this->CurrentAction = (@$_GET["a"] <> "") ? $_GET["a"] : @$_POST["a_list"]; // Set up current action

		// Global Page Loading event (in userfn*.php)
		Page_Loading();

		// Page Load event
		$this->Page_Load();

		// Check token
		if (!$this->ValidPost()) {
			echo $Language->Phrase("InvalidPostRequest");
			$this->Page_Terminate();
			exit();
		}

		// Process auto fill
		if (@$_POST["ajax"] == "autofill") {
			$results = $this->GetAutoFill(@$_POST["name"], @$_POST["q"]);
			if ($results) {

				// Clean output buffer
				if (!EW_DEBUG_ENABLED && ob_get_length())
					ob_end_clean();
				echo $results;
				$this->Page_Terminate();
				exit();
			}
		}

		// Create Token
		$this->CreateToken();
	}

	//
	// Page_Terminate
	//
	function Page_Terminate($url = "") {
		global $gsExportFile, $gTmpImages;

		// Page Unload event
		$this->Page_Unload();

		// Global Page Unloaded event (in userfn*.php)
		Page_Unloaded();

		// Export
		global $EW_EXPORT, $consulta_final_2021;
		if ($this->CustomExport <> "" && $this->CustomExport == $this->Export && array_key_exists($this->CustomExport, $EW_EXPORT)) {
				$sContent = ob_get_contents();
			if ($gsExportFile == "") $gsExportFile = $this->TableVar;
			$class = $EW_EXPORT[$this->CustomExport];
			if (class_exists($class)) {
				$doc = new $class($consulta_final_2021);
				$doc->Text = $sContent;
				if ($this->Export == "email")
					echo $this->ExportEmail($doc->Text);
				else
					$doc->Export();
				ew_DeleteTmpImages(); // Delete temp images
				exit();
			}
		}
		$this->Page_Redirecting($url);

		 // Close connection
		ew_CloseConn();

		// Go to URL if specified
		if ($url <> "") {
			if (!EW_DEBUG_ENABLED && ob_get_length())
				ob_end_clean();
			header("Location: " . $url);
		}
		exit();
	}
	var $FormClassName = "form-horizontal ewForm ewAddForm";
	var $DbMasterFilter = "";
	var $DbDetailFilter = "";
	var $StartRec;
	var $Priv = 0;
	var $OldRecordset;
	var $CopyRecord;

	// 
	// Page main
	//
	function Page_Main() {
		global $objForm, $Language, $gsFormError;

		// Process form if post back
		if (@$_POST["a_add"] <> "") {
			$this->CurrentAction = $_POST["a_add"]; // Get form action
			$this->CopyRecord = $this->LoadOldRecord(); // Load old recordset
			$this->LoadFormValues(); // Load form values
		} else { // Not post back

			// Load key values from QueryString
			$this->CopyRecord = TRUE;
			if (@$_GET["Identificacion"] != "") {
				$this->Identificacion->setQueryStringValue($_GET["Identificacion"]);
				$this->setKey("Identificacion", $this->Identificacion->CurrentValue); // Set up key
			} else {
				$this->setKey("Identificacion", ""); // Clear key
				$this->CopyRecord = FALSE;
			}
			if ($this->CopyRecord) {
				$this->CurrentAction = "C"; // Copy record
			} else {
				$this->CurrentAction = "I"; // Display blank record
			}
		}

		// Set up Breadcrumb
		$this->SetupBreadcrumb();

		// Validate form if post back
		if (@$_POST["a_add"] <> "") {
			if (!$this->ValidateForm()) {
				$this->CurrentAction = "I"; // Form error, reset action
				$this->EventCancelled = TRUE; // Event cancelled
				$this->RestoreFormValues(); // Restore form values
				$this->setFailureMessage($gsFormError);
			}
		} else {
			if ($this->CurrentAction == "I") // Load default values for blank record
				$this->LoadDefaultValues();
		}

		// Perform action based on action code
		switch ($this->CurrentAction) {
			case "I": // Blank record, no action required
				break;
			case "C": // Copy an existing record
				if (!$this->LoadRow()) { // Load record based on key
					if ($this->getFailureMessage() == "") $this->setFailureMessage($Language->Phrase("NoRecord")); // No record found
					$this->Page_Terminate("consulta_final_2021list.php"); // No matching record, return to list
				}
				break;
			case "A": // Add new record
				$this->SendEmail = TRUE; // Send email on add success
				if ($this->AddRow($this->OldRecordset)) { // Add successful
					if ($this->getSuccessMessage() == "")
						$this->setSuccessMessage($Language->Phrase("AddSuccess")); // Set up success message
					$sReturnUrl = $this->getReturnUrl();
					if (ew_GetPageName($sReturnUrl) == "consulta_final_2021list.php")
						$sReturnUrl = $this->AddMasterUrl($sReturnUrl); // List page, return to list page with correct master key if necessary
					elseif (ew_GetPageName($sReturnUrl) == "consulta_final_2021view.php")
						$sReturnUrl = $this->GetViewUrl(); // View page, return to view page with keyurl directly
					$this->Page_Terminate($sReturnUrl); // Clean up and return
				} else {
					$this->EventCancelled = TRUE; // Event cancelled
					$this->RestoreFormValues(); // Add failed, restore form values
				}
		}

		// Render row based on row type
		$this->RowType = EW_ROWTYPE_ADD; // Render add type

		// Render row
		$this->ResetAttrs();
		$this->RenderRow();
	}

	// Get upload files
	function GetUploadFiles() {
		global $objForm, $Language;

		// Get upload data
	}

	// Load default values
	function LoadDefaultValues() {
		$this->Numero_id_usuario->CurrentValue = NULL;
		$this->Numero_id_usuario->OldValue = $this->Numero_id_usuario->CurrentValue;
		$this->Fecha_consulta->CurrentValue = NULL;
		$this->Fecha_consulta->OldValue = $this->Fecha_consulta->CurrentValue;
		$this->Codigo_prestador->CurrentValue = NULL;
		$this->Codigo_prestador->OldValue = $this->Codigo_prestador->CurrentValue;
		$this->Codigo_consulta->CurrentValue = NULL;
		$this->Codigo_consulta->OldValue = $this->Codigo_consulta->CurrentValue;
		$this->Codigo_diagnostico->CurrentValue = NULL;
		$this->Codigo_diagnostico->OldValue = $this->Codigo_diagnostico->CurrentValue;
		$this->Tipo_diagnostico_principal->CurrentValue = NULL;
		$this->Tipo_diagnostico_principal->OldValue = $this->Tipo_diagnostico_principal->CurrentValue;
		$this->Edad->CurrentValue = NULL;
		$this->Edad->OldValue = $this->Edad->CurrentValue;
		$this->Sexo->CurrentValue = NULL;
		$this->Sexo->OldValue = $this->Sexo->CurrentValue;
		$this->Unidad_edad->CurrentValue = NULL;
		$this->Unidad_edad->OldValue = $this->Unidad_edad->CurrentValue;
		$this->Zona_residencia->CurrentValue = NULL;
		$this->Zona_residencia->OldValue = $this->Zona_residencia->CurrentValue;
		$this->Tipo_Usuario->CurrentValue = NULL;
		$this->Tipo_Usuario->OldValue = $this->Tipo_Usuario->CurrentValue;
		$this->Tipo_doc->CurrentValue = NULL;
		$this->Tipo_doc->OldValue = $this->Tipo_doc->CurrentValue;
		$this->idconsulta->CurrentValue = NULL;
		$this->idconsulta->OldValue = $this->idconsulta->CurrentValue;
		$this->Causa_Completa->CurrentValue = NULL;
		$this->Causa_Completa->OldValue = $this->Causa_Completa->CurrentValue;
		$this->Id->CurrentValue = NULL;
		$this->Id->OldValue = $this->Id->CurrentValue;
		$this->Letra->CurrentValue = NULL;
		$this->Letra->OldValue = $this->Letra->CurrentValue;
		$this->Numero->CurrentValue = NULL;
		$this->Numero->OldValue = $this->Numero->CurrentValue;
		$this->Codigo_tres->CurrentValue = NULL;
		$this->Codigo_tres->OldValue = $this->Codigo_tres->CurrentValue;
		$this->Titulo_codigo_tres->CurrentValue = NULL;
		$this->Titulo_codigo_tres->OldValue = $this->Titulo_codigo_tres->CurrentValue;
		$this->Codigo->CurrentValue = NULL;
		$this->Codigo->OldValue = $this->Codigo->CurrentValue;
		$this->Contador->CurrentValue = NULL;
		$this->Contador->OldValue = $this->Contador->CurrentValue;
	}

	// Load form values
	function LoadFormValues() {

		// Load from form
		global $objForm;
		if (!$this->Numero_id_usuario->FldIsDetailKey) {
			$this->Numero_id_usuario->setFormValue($objForm->GetValue("x_Numero_id_usuario"));
		}
		if (!$this->Fecha_consulta->FldIsDetailKey) {
			$this->Fecha_consulta->setFormValue($objForm->GetValue("x_Fecha_consulta"));
		}
		if (!$this->Codigo_prestador->FldIsDetailKey) {
			$this->Codigo_prestador->setFormValue($objForm->GetValue("x_Codigo_prestador"));
		}
		if (!$this->Codigo_consulta->FldIsDetailKey) {
			$this->Codigo_consulta->setFormValue($objForm->GetValue("x_Codigo_consulta"));
		}
		if (!$this->Codigo_diagnostico->FldIsDetailKey) {
			$this->Codigo_diagnostico->setFormValue($objForm->GetValue("x_Codigo_diagnostico"));
		}
		if (!$this->Tipo_diagnostico_principal->FldIsDetailKey) {
			$this->Tipo_diagnostico_principal->setFormValue($objForm->GetValue("x_Tipo_diagnostico_principal"));
		}
		if (!$this->Edad->FldIsDetailKey) {
			$this->Edad->setFormValue($objForm->GetValue("x_Edad"));
		}
		if (!$this->Sexo->FldIsDetailKey) {
			$this->Sexo->setFormValue($objForm->GetValue("x_Sexo"));
		}
		if (!$this->Unidad_edad->FldIsDetailKey) {
			$this->Unidad_edad->setFormValue($objForm->GetValue("x_Unidad_edad"));
		}
		if (!$this->Zona_residencia->FldIsDetailKey) {
			$this->Zona_residencia->setFormValue($objForm->GetValue("x_Zona_residencia"));
		}
		if (!$this->Tipo_Usuario->FldIsDetailKey) {
			$this->Tipo_Usuario->setFormValue($objForm->GetValue("x_Tipo_Usuario"));
		}
		if (!$this->Tipo_doc->FldIsDetailKey) {
			$this->Tipo_doc->setFormValue($objForm->GetValue("x_Tipo_doc"));
		}
		if (!$this->idconsulta->FldIsDetailKey) {
			$this->idconsulta->setFormValue($objForm->GetValue("x_idconsulta"));
		}
		if (!$this->Causa_Completa->FldIsDetailKey) {
			$this->Causa_Completa->setFormValue($objForm->GetValue("x_Causa_Completa"));
		}
		if (!$this->Id->FldIsDetailKey) {
			$this->Id->setFormValue($objForm->GetValue("x_Id"));
		}
		if (!$this->Letra->FldIsDetailKey) {
			$this->Letra->setFormValue($objForm->GetValue("x_Letra"));
		}
		if (!$this->Numero->FldIsDetailKey) {
			$this->Numero->setFormValue($objForm->GetValue("x_Numero"));
		}
		if (!$this->Codigo_tres->FldIsDetailKey) {
			$this->Codigo_tres->setFormValue($objForm->GetValue("x_Codigo_tres"));
		}
		if (!$this->Titulo_codigo_tres->FldIsDetailKey) {
			$this->Titulo_codigo_tres->setFormValue($objForm->GetValue("x_Titulo_codigo_tres"));
		}
		if (!$this->Codigo->FldIsDetailKey) {
			$this->Codigo->setFormValue($objForm->GetValue("x_Codigo"));
		}
		if (!$this->Contador->FldIsDetailKey) {
			$this->Contador->setFormValue($objForm->GetValue("x_Contador"));
		}
	}

	// Restore form values
	function RestoreFormValues() {
		global $objForm;
		$this->LoadOldRecord();
		$this->Numero_id_usuario->CurrentValue = $this->Numero_id_usuario->FormValue;
		$this->Fecha_consulta->CurrentValue = $this->Fecha_consulta->FormValue;
		$this->Codigo_prestador->CurrentValue = $this->Codigo_prestador->FormValue;
		$this->Codigo_consulta->CurrentValue = $this->Codigo_consulta->FormValue;
		$this->Codigo_diagnostico->CurrentValue = $this->Codigo_diagnostico->FormValue;
		$this->Tipo_diagnostico_principal->CurrentValue = $this->Tipo_diagnostico_principal->FormValue;
		$this->Edad->CurrentValue = $this->Edad->FormValue;
		$this->Sexo->CurrentValue = $this->Sexo->FormValue;
		$this->Unidad_edad->CurrentValue = $this->Unidad_edad->FormValue;
		$this->Zona_residencia->CurrentValue = $this->Zona_residencia->FormValue;
		$this->Tipo_Usuario->CurrentValue = $this->Tipo_Usuario->FormValue;
		$this->Tipo_doc->CurrentValue = $this->Tipo_doc->FormValue;
		$this->idconsulta->CurrentValue = $this->idconsulta->FormValue;
		$this->Causa_Completa->CurrentValue = $this->Causa_Completa->FormValue;
		$this->Id->CurrentValue = $this->Id->FormValue;
		$this->Letra->CurrentValue = $this->Letra->FormValue;
		$this->Numero->CurrentValue = $this->Numero->FormValue;
		$this->Codigo_tres->CurrentValue = $this->Codigo_tres->FormValue;
		$this->Titulo_codigo_tres->CurrentValue = $this->Titulo_codigo_tres->FormValue;
		$this->Codigo->CurrentValue = $this->Codigo->FormValue;
		$this->Contador->CurrentValue = $this->Contador->FormValue;
	}

	// Load row based on key values
	function LoadRow() {
		global $Security, $Language;
		$sFilter = $this->KeyFilter();

		// Call Row Selecting event
		$this->Row_Selecting($sFilter);

		// Load SQL based on filter
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		$conn = &$this->Connection();
		$res = FALSE;
		$rs = ew_LoadRecordset($sSql, $conn);
		if ($rs && !$rs->EOF) {
			$res = TRUE;
			$this->LoadRowValues($rs); // Load row values
			$rs->Close();
		}
		return $res;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		if (!$rs || $rs->EOF) return;

		// Call Row Selected event
		$row = &$rs->fields;
		$this->Row_Selected($row);
		$this->Numero_id_usuario->setDbValue($rs->fields('Numero_id_usuario'));
		$this->Fecha_consulta->setDbValue($rs->fields('Fecha_consulta'));
		$this->Codigo_prestador->setDbValue($rs->fields('Codigo_prestador'));
		$this->Codigo_consulta->setDbValue($rs->fields('Codigo_consulta'));
		$this->Codigo_diagnostico->setDbValue($rs->fields('Codigo_diagnostico'));
		$this->Tipo_diagnostico_principal->setDbValue($rs->fields('Tipo_diagnostico_principal'));
		$this->Edad->setDbValue($rs->fields('Edad'));
		$this->Sexo->setDbValue($rs->fields('Sexo'));
		$this->Unidad_edad->setDbValue($rs->fields('Unidad_edad'));
		$this->Zona_residencia->setDbValue($rs->fields('Zona_residencia'));
		$this->Tipo_Usuario->setDbValue($rs->fields('Tipo_Usuario'));
		$this->Tipo_doc->setDbValue($rs->fields('Tipo_doc'));
		$this->idconsulta->setDbValue($rs->fields('idconsulta'));
		$this->Causa_Completa->setDbValue($rs->fields('Causa_Completa'));
		$this->Id->setDbValue($rs->fields('Id'));
		$this->Letra->setDbValue($rs->fields('Letra'));
		$this->Numero->setDbValue($rs->fields('Numero'));
		$this->Codigo_tres->setDbValue($rs->fields('Codigo_tres'));
		$this->Titulo_codigo_tres->setDbValue($rs->fields('Titulo_codigo_tres'));
		$this->Codigo->setDbValue($rs->fields('Codigo'));
		$this->Contador->setDbValue($rs->fields('Contador'));
		$this->Identificacion->setDbValue($rs->fields('Identificacion'));
	}

	// Load DbValue from recordset
	function LoadDbValues(&$rs) {
		if (!$rs || !is_array($rs) && $rs->EOF) return;
		$row = is_array($rs) ? $rs : $rs->fields;
		$this->Numero_id_usuario->DbValue = $row['Numero_id_usuario'];
		$this->Fecha_consulta->DbValue = $row['Fecha_consulta'];
		$this->Codigo_prestador->DbValue = $row['Codigo_prestador'];
		$this->Codigo_consulta->DbValue = $row['Codigo_consulta'];
		$this->Codigo_diagnostico->DbValue = $row['Codigo_diagnostico'];
		$this->Tipo_diagnostico_principal->DbValue = $row['Tipo_diagnostico_principal'];
		$this->Edad->DbValue = $row['Edad'];
		$this->Sexo->DbValue = $row['Sexo'];
		$this->Unidad_edad->DbValue = $row['Unidad_edad'];
		$this->Zona_residencia->DbValue = $row['Zona_residencia'];
		$this->Tipo_Usuario->DbValue = $row['Tipo_Usuario'];
		$this->Tipo_doc->DbValue = $row['Tipo_doc'];
		$this->idconsulta->DbValue = $row['idconsulta'];
		$this->Causa_Completa->DbValue = $row['Causa_Completa'];
		$this->Id->DbValue = $row['Id'];
		$this->Letra->DbValue = $row['Letra'];
		$this->Numero->DbValue = $row['Numero'];
		$this->Codigo_tres->DbValue = $row['Codigo_tres'];
		$this->Titulo_codigo_tres->DbValue = $row['Titulo_codigo_tres'];
		$this->Codigo->DbValue = $row['Codigo'];
		$this->Contador->DbValue = $row['Contador'];
		$this->Identificacion->DbValue = $row['Identificacion'];
	}

	// Load old record
	function LoadOldRecord() {

		// Load key values from Session
		$bValidKey = TRUE;
		if (strval($this->getKey("Identificacion")) <> "")
			$this->Identificacion->CurrentValue = $this->getKey("Identificacion"); // Identificacion
		else
			$bValidKey = FALSE;

		// Load old recordset
		if ($bValidKey) {
			$this->CurrentFilter = $this->KeyFilter();
			$sSql = $this->SQL();
			$conn = &$this->Connection();
			$this->OldRecordset = ew_LoadRecordset($sSql, $conn);
			$this->LoadRowValues($this->OldRecordset); // Load row values
		} else {
			$this->OldRecordset = NULL;
		}
		return $bValidKey;
	}

	// Render row values based on field settings
	function RenderRow() {
		global $Security, $Language, $gsLanguage;

		// Initialize URLs
		// Call Row_Rendering event

		$this->Row_Rendering();

		// Common render codes for all row types
		// Numero_id_usuario
		// Fecha_consulta
		// Codigo_prestador
		// Codigo_consulta
		// Codigo_diagnostico
		// Tipo_diagnostico_principal
		// Edad
		// Sexo
		// Unidad_edad
		// Zona_residencia
		// Tipo_Usuario
		// Tipo_doc
		// idconsulta
		// Causa_Completa
		// Id
		// Letra
		// Numero
		// Codigo_tres
		// Titulo_codigo_tres
		// Codigo
		// Contador
		// Identificacion

		if ($this->RowType == EW_ROWTYPE_VIEW) { // View row

		// Numero_id_usuario
		$this->Numero_id_usuario->ViewValue = $this->Numero_id_usuario->CurrentValue;
		$this->Numero_id_usuario->ViewCustomAttributes = "";

		// Fecha_consulta
		$this->Fecha_consulta->ViewValue = $this->Fecha_consulta->CurrentValue;
		$this->Fecha_consulta->ViewCustomAttributes = "";

		// Codigo_prestador
		$this->Codigo_prestador->ViewValue = $this->Codigo_prestador->CurrentValue;
		$this->Codigo_prestador->ViewCustomAttributes = "";

		// Codigo_consulta
		$this->Codigo_consulta->ViewValue = $this->Codigo_consulta->CurrentValue;
		$this->Codigo_consulta->ViewCustomAttributes = "";

		// Codigo_diagnostico
		$this->Codigo_diagnostico->ViewValue = $this->Codigo_diagnostico->CurrentValue;
		$this->Codigo_diagnostico->ViewCustomAttributes = "";

		// Tipo_diagnostico_principal
		$this->Tipo_diagnostico_principal->ViewValue = $this->Tipo_diagnostico_principal->CurrentValue;
		$this->Tipo_diagnostico_principal->ViewCustomAttributes = "";

		// Edad
		$this->Edad->ViewValue = $this->Edad->CurrentValue;
		$this->Edad->ViewCustomAttributes = "";

		// Sexo
		$this->Sexo->ViewValue = $this->Sexo->CurrentValue;
		$this->Sexo->ViewCustomAttributes = "";

		// Unidad_edad
		$this->Unidad_edad->ViewValue = $this->Unidad_edad->CurrentValue;
		$this->Unidad_edad->ViewCustomAttributes = "";

		// Zona_residencia
		$this->Zona_residencia->ViewValue = $this->Zona_residencia->CurrentValue;
		$this->Zona_residencia->ViewCustomAttributes = "";

		// Tipo_Usuario
		$this->Tipo_Usuario->ViewValue = $this->Tipo_Usuario->CurrentValue;
		$this->Tipo_Usuario->ViewCustomAttributes = "";

		// Tipo_doc
		$this->Tipo_doc->ViewValue = $this->Tipo_doc->CurrentValue;
		$this->Tipo_doc->ViewCustomAttributes = "";

		// idconsulta
		$this->idconsulta->ViewValue = $this->idconsulta->CurrentValue;
		$this->idconsulta->ViewCustomAttributes = "";

		// Causa_Completa
		$this->Causa_Completa->ViewValue = $this->Causa_Completa->CurrentValue;
		$this->Causa_Completa->ViewCustomAttributes = "";

		// Id
		$this->Id->ViewValue = $this->Id->CurrentValue;
		$this->Id->ViewCustomAttributes = "";

		// Letra
		$this->Letra->ViewValue = $this->Letra->CurrentValue;
		$this->Letra->ViewCustomAttributes = "";

		// Numero
		$this->Numero->ViewValue = $this->Numero->CurrentValue;
		$this->Numero->ViewCustomAttributes = "";

		// Codigo_tres
		$this->Codigo_tres->ViewValue = $this->Codigo_tres->CurrentValue;
		$this->Codigo_tres->ViewCustomAttributes = "";

		// Titulo_codigo_tres
		$this->Titulo_codigo_tres->ViewValue = $this->Titulo_codigo_tres->CurrentValue;
		$this->Titulo_codigo_tres->ViewCustomAttributes = "";

		// Codigo
		$this->Codigo->ViewValue = $this->Codigo->CurrentValue;
		$this->Codigo->ViewCustomAttributes = "";

		// Contador
		$this->Contador->ViewValue = $this->Contador->CurrentValue;
		$this->Contador->ViewCustomAttributes = "";

		// Identificacion
		$this->Identificacion->ViewValue = $this->Identificacion->CurrentValue;
		$this->Identificacion->ViewCustomAttributes = "";

			// Numero_id_usuario
			$this->Numero_id_usuario->LinkCustomAttributes = "";
			$this->Numero_id_usuario->HrefValue = "";
			$this->Numero_id_usuario->TooltipValue = "";

			// Fecha_consulta
			$this->Fecha_consulta->LinkCustomAttributes = "";
			$this->Fecha_consulta->HrefValue = "";
			$this->Fecha_consulta->TooltipValue = "";

			// Codigo_prestador
			$this->Codigo_prestador->LinkCustomAttributes = "";
			$this->Codigo_prestador->HrefValue = "";
			$this->Codigo_prestador->TooltipValue = "";

			// Codigo_consulta
			$this->Codigo_consulta->LinkCustomAttributes = "";
			$this->Codigo_consulta->HrefValue = "";
			$this->Codigo_consulta->TooltipValue = "";

			// Codigo_diagnostico
			$this->Codigo_diagnostico->LinkCustomAttributes = "";
			$this->Codigo_diagnostico->HrefValue = "";
			$this->Codigo_diagnostico->TooltipValue = "";

			// Tipo_diagnostico_principal
			$this->Tipo_diagnostico_principal->LinkCustomAttributes = "";
			$this->Tipo_diagnostico_principal->HrefValue = "";
			$this->Tipo_diagnostico_principal->TooltipValue = "";

			// Edad
			$this->Edad->LinkCustomAttributes = "";
			$this->Edad->HrefValue = "";
			$this->Edad->TooltipValue = "";

			// Sexo
			$this->Sexo->LinkCustomAttributes = "";
			$this->Sexo->HrefValue = "";
			$this->Sexo->TooltipValue = "";

			// Unidad_edad
			$this->Unidad_edad->LinkCustomAttributes = "";
			$this->Unidad_edad->HrefValue = "";
			$this->Unidad_edad->TooltipValue = "";

			// Zona_residencia
			$this->Zona_residencia->LinkCustomAttributes = "";
			$this->Zona_residencia->HrefValue = "";
			$this->Zona_residencia->TooltipValue = "";

			// Tipo_Usuario
			$this->Tipo_Usuario->LinkCustomAttributes = "";
			$this->Tipo_Usuario->HrefValue = "";
			$this->Tipo_Usuario->TooltipValue = "";

			// Tipo_doc
			$this->Tipo_doc->LinkCustomAttributes = "";
			$this->Tipo_doc->HrefValue = "";
			$this->Tipo_doc->TooltipValue = "";

			// idconsulta
			$this->idconsulta->LinkCustomAttributes = "";
			$this->idconsulta->HrefValue = "";
			$this->idconsulta->TooltipValue = "";

			// Causa_Completa
			$this->Causa_Completa->LinkCustomAttributes = "";
			$this->Causa_Completa->HrefValue = "";
			$this->Causa_Completa->TooltipValue = "";

			// Id
			$this->Id->LinkCustomAttributes = "";
			$this->Id->HrefValue = "";
			$this->Id->TooltipValue = "";

			// Letra
			$this->Letra->LinkCustomAttributes = "";
			$this->Letra->HrefValue = "";
			$this->Letra->TooltipValue = "";

			// Numero
			$this->Numero->LinkCustomAttributes = "";
			$this->Numero->HrefValue = "";
			$this->Numero->TooltipValue = "";

			// Codigo_tres
			$this->Codigo_tres->LinkCustomAttributes = "";
			$this->Codigo_tres->HrefValue = "";
			$this->Codigo_tres->TooltipValue = "";

			// Titulo_codigo_tres
			$this->Titulo_codigo_tres->LinkCustomAttributes = "";
			$this->Titulo_codigo_tres->HrefValue = "";
			$this->Titulo_codigo_tres->TooltipValue = "";

			// Codigo
			$this->Codigo->LinkCustomAttributes = "";
			$this->Codigo->HrefValue = "";
			$this->Codigo->TooltipValue = "";

			// Contador
			$this->Contador->LinkCustomAttributes = "";
			$this->Contador->HrefValue = "";
			$this->Contador->TooltipValue = "";
		} elseif ($this->RowType == EW_ROWTYPE_ADD) { // Add row

			// Numero_id_usuario
			$this->Numero_id_usuario->EditAttrs["class"] = "form-control";
			$this->Numero_id_usuario->EditCustomAttributes = "";
			$this->Numero_id_usuario->EditValue = ew_HtmlEncode($this->Numero_id_usuario->CurrentValue);
			$this->Numero_id_usuario->PlaceHolder = ew_RemoveHtml($this->Numero_id_usuario->FldCaption());

			// Fecha_consulta
			$this->Fecha_consulta->EditAttrs["class"] = "form-control";
			$this->Fecha_consulta->EditCustomAttributes = "";
			$this->Fecha_consulta->EditValue = ew_HtmlEncode($this->Fecha_consulta->CurrentValue);
			$this->Fecha_consulta->PlaceHolder = ew_RemoveHtml($this->Fecha_consulta->FldCaption());

			// Codigo_prestador
			$this->Codigo_prestador->EditAttrs["class"] = "form-control";
			$this->Codigo_prestador->EditCustomAttributes = "";
			$this->Codigo_prestador->EditValue = ew_HtmlEncode($this->Codigo_prestador->CurrentValue);
			$this->Codigo_prestador->PlaceHolder = ew_RemoveHtml($this->Codigo_prestador->FldCaption());

			// Codigo_consulta
			$this->Codigo_consulta->EditAttrs["class"] = "form-control";
			$this->Codigo_consulta->EditCustomAttributes = "";
			$this->Codigo_consulta->EditValue = ew_HtmlEncode($this->Codigo_consulta->CurrentValue);
			$this->Codigo_consulta->PlaceHolder = ew_RemoveHtml($this->Codigo_consulta->FldCaption());

			// Codigo_diagnostico
			$this->Codigo_diagnostico->EditAttrs["class"] = "form-control";
			$this->Codigo_diagnostico->EditCustomAttributes = "";
			$this->Codigo_diagnostico->EditValue = ew_HtmlEncode($this->Codigo_diagnostico->CurrentValue);
			$this->Codigo_diagnostico->PlaceHolder = ew_RemoveHtml($this->Codigo_diagnostico->FldCaption());

			// Tipo_diagnostico_principal
			$this->Tipo_diagnostico_principal->EditAttrs["class"] = "form-control";
			$this->Tipo_diagnostico_principal->EditCustomAttributes = "";
			$this->Tipo_diagnostico_principal->EditValue = ew_HtmlEncode($this->Tipo_diagnostico_principal->CurrentValue);
			$this->Tipo_diagnostico_principal->PlaceHolder = ew_RemoveHtml($this->Tipo_diagnostico_principal->FldCaption());

			// Edad
			$this->Edad->EditAttrs["class"] = "form-control";
			$this->Edad->EditCustomAttributes = "";
			$this->Edad->EditValue = ew_HtmlEncode($this->Edad->CurrentValue);
			$this->Edad->PlaceHolder = ew_RemoveHtml($this->Edad->FldCaption());

			// Sexo
			$this->Sexo->EditAttrs["class"] = "form-control";
			$this->Sexo->EditCustomAttributes = "";
			$this->Sexo->EditValue = ew_HtmlEncode($this->Sexo->CurrentValue);
			$this->Sexo->PlaceHolder = ew_RemoveHtml($this->Sexo->FldCaption());

			// Unidad_edad
			$this->Unidad_edad->EditAttrs["class"] = "form-control";
			$this->Unidad_edad->EditCustomAttributes = "";
			$this->Unidad_edad->EditValue = ew_HtmlEncode($this->Unidad_edad->CurrentValue);
			$this->Unidad_edad->PlaceHolder = ew_RemoveHtml($this->Unidad_edad->FldCaption());

			// Zona_residencia
			$this->Zona_residencia->EditAttrs["class"] = "form-control";
			$this->Zona_residencia->EditCustomAttributes = "";
			$this->Zona_residencia->EditValue = ew_HtmlEncode($this->Zona_residencia->CurrentValue);
			$this->Zona_residencia->PlaceHolder = ew_RemoveHtml($this->Zona_residencia->FldCaption());

			// Tipo_Usuario
			$this->Tipo_Usuario->EditAttrs["class"] = "form-control";
			$this->Tipo_Usuario->EditCustomAttributes = "";
			$this->Tipo_Usuario->EditValue = ew_HtmlEncode($this->Tipo_Usuario->CurrentValue);
			$this->Tipo_Usuario->PlaceHolder = ew_RemoveHtml($this->Tipo_Usuario->FldCaption());

			// Tipo_doc
			$this->Tipo_doc->EditAttrs["class"] = "form-control";
			$this->Tipo_doc->EditCustomAttributes = "";
			$this->Tipo_doc->EditValue = ew_HtmlEncode($this->Tipo_doc->CurrentValue);
			$this->Tipo_doc->PlaceHolder = ew_RemoveHtml($this->Tipo_doc->FldCaption());

			// idconsulta
			$this->idconsulta->EditAttrs["class"] = "form-control";
			$this->idconsulta->EditCustomAttributes = "";
			$this->idconsulta->EditValue = ew_HtmlEncode($this->idconsulta->CurrentValue);
			$this->idconsulta->PlaceHolder = ew_RemoveHtml($this->idconsulta->FldCaption());

			// Causa_Completa
			$this->Causa_Completa->EditAttrs["class"] = "form-control";
			$this->Causa_Completa->EditCustomAttributes = "";
			$this->Causa_Completa->EditValue = ew_HtmlEncode($this->Causa_Completa->CurrentValue);
			$this->Causa_Completa->PlaceHolder = ew_RemoveHtml($this->Causa_Completa->FldCaption());

			// Id
			$this->Id->EditAttrs["class"] = "form-control";
			$this->Id->EditCustomAttributes = "";
			$this->Id->EditValue = ew_HtmlEncode($this->Id->CurrentValue);
			$this->Id->PlaceHolder = ew_RemoveHtml($this->Id->FldCaption());

			// Letra
			$this->Letra->EditAttrs["class"] = "form-control";
			$this->Letra->EditCustomAttributes = "";
			$this->Letra->EditValue = ew_HtmlEncode($this->Letra->CurrentValue);
			$this->Letra->PlaceHolder = ew_RemoveHtml($this->Letra->FldCaption());

			// Numero
			$this->Numero->EditAttrs["class"] = "form-control";
			$this->Numero->EditCustomAttributes = "";
			$this->Numero->EditValue = ew_HtmlEncode($this->Numero->CurrentValue);
			$this->Numero->PlaceHolder = ew_RemoveHtml($this->Numero->FldCaption());

			// Codigo_tres
			$this->Codigo_tres->EditAttrs["class"] = "form-control";
			$this->Codigo_tres->EditCustomAttributes = "";
			$this->Codigo_tres->EditValue = ew_HtmlEncode($this->Codigo_tres->CurrentValue);
			$this->Codigo_tres->PlaceHolder = ew_RemoveHtml($this->Codigo_tres->FldCaption());

			// Titulo_codigo_tres
			$this->Titulo_codigo_tres->EditAttrs["class"] = "form-control";
			$this->Titulo_codigo_tres->EditCustomAttributes = "";
			$this->Titulo_codigo_tres->EditValue = ew_HtmlEncode($this->Titulo_codigo_tres->CurrentValue);
			$this->Titulo_codigo_tres->PlaceHolder = ew_RemoveHtml($this->Titulo_codigo_tres->FldCaption());

			// Codigo
			$this->Codigo->EditAttrs["class"] = "form-control";
			$this->Codigo->EditCustomAttributes = "";
			$this->Codigo->EditValue = ew_HtmlEncode($this->Codigo->CurrentValue);
			$this->Codigo->PlaceHolder = ew_RemoveHtml($this->Codigo->FldCaption());

			// Contador
			$this->Contador->EditAttrs["class"] = "form-control";
			$this->Contador->EditCustomAttributes = "";
			$this->Contador->EditValue = ew_HtmlEncode($this->Contador->CurrentValue);
			$this->Contador->PlaceHolder = ew_RemoveHtml($this->Contador->FldCaption());

			// Add refer script
			// Numero_id_usuario

			$this->Numero_id_usuario->LinkCustomAttributes = "";
			$this->Numero_id_usuario->HrefValue = "";

			// Fecha_consulta
			$this->Fecha_consulta->LinkCustomAttributes = "";
			$this->Fecha_consulta->HrefValue = "";

			// Codigo_prestador
			$this->Codigo_prestador->LinkCustomAttributes = "";
			$this->Codigo_prestador->HrefValue = "";

			// Codigo_consulta
			$this->Codigo_consulta->LinkCustomAttributes = "";
			$this->Codigo_consulta->HrefValue = "";

			// Codigo_diagnostico
			$this->Codigo_diagnostico->LinkCustomAttributes = "";
			$this->Codigo_diagnostico->HrefValue = "";

			// Tipo_diagnostico_principal
			$this->Tipo_diagnostico_principal->LinkCustomAttributes = "";
			$this->Tipo_diagnostico_principal->HrefValue = "";

			// Edad
			$this->Edad->LinkCustomAttributes = "";
			$this->Edad->HrefValue = "";

			// Sexo
			$this->Sexo->LinkCustomAttributes = "";
			$this->Sexo->HrefValue = "";

			// Unidad_edad
			$this->Unidad_edad->LinkCustomAttributes = "";
			$this->Unidad_edad->HrefValue = "";

			// Zona_residencia
			$this->Zona_residencia->LinkCustomAttributes = "";
			$this->Zona_residencia->HrefValue = "";

			// Tipo_Usuario
			$this->Tipo_Usuario->LinkCustomAttributes = "";
			$this->Tipo_Usuario->HrefValue = "";

			// Tipo_doc
			$this->Tipo_doc->LinkCustomAttributes = "";
			$this->Tipo_doc->HrefValue = "";

			// idconsulta
			$this->idconsulta->LinkCustomAttributes = "";
			$this->idconsulta->HrefValue = "";

			// Causa_Completa
			$this->Causa_Completa->LinkCustomAttributes = "";
			$this->Causa_Completa->HrefValue = "";

			// Id
			$this->Id->LinkCustomAttributes = "";
			$this->Id->HrefValue = "";

			// Letra
			$this->Letra->LinkCustomAttributes = "";
			$this->Letra->HrefValue = "";

			// Numero
			$this->Numero->LinkCustomAttributes = "";
			$this->Numero->HrefValue = "";

			// Codigo_tres
			$this->Codigo_tres->LinkCustomAttributes = "";
			$this->Codigo_tres->HrefValue = "";

			// Titulo_codigo_tres
			$this->Titulo_codigo_tres->LinkCustomAttributes = "";
			$this->Titulo_codigo_tres->HrefValue = "";

			// Codigo
			$this->Codigo->LinkCustomAttributes = "";
			$this->Codigo->HrefValue = "";

			// Contador
			$this->Contador->LinkCustomAttributes = "";
			$this->Contador->HrefValue = "";
		}
		if ($this->RowType == EW_ROWTYPE_ADD ||
			$this->RowType == EW_ROWTYPE_EDIT ||
			$this->RowType == EW_ROWTYPE_SEARCH) { // Add / Edit / Search row
			$this->SetupFieldTitles();
		}

		// Call Row Rendered event
		if ($this->RowType <> EW_ROWTYPE_AGGREGATEINIT)
			$this->Row_Rendered();
	}

	// Validate form
	function ValidateForm() {
		global $Language, $gsFormError;

		// Initialize form error message
		$gsFormError = "";

		// Check if validation required
		if (!EW_SERVER_VALIDATE)
			return ($gsFormError == "");
		if (!$this->Numero_id_usuario->FldIsDetailKey && !is_null($this->Numero_id_usuario->FormValue) && $this->Numero_id_usuario->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Numero_id_usuario->FldCaption(), $this->Numero_id_usuario->ReqErrMsg));
		}
		if (!$this->Fecha_consulta->FldIsDetailKey && !is_null($this->Fecha_consulta->FormValue) && $this->Fecha_consulta->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Fecha_consulta->FldCaption(), $this->Fecha_consulta->ReqErrMsg));
		}
		if (!$this->Codigo_prestador->FldIsDetailKey && !is_null($this->Codigo_prestador->FormValue) && $this->Codigo_prestador->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Codigo_prestador->FldCaption(), $this->Codigo_prestador->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Codigo_prestador->FormValue)) {
			ew_AddMessage($gsFormError, $this->Codigo_prestador->FldErrMsg());
		}
		if (!$this->Codigo_consulta->FldIsDetailKey && !is_null($this->Codigo_consulta->FormValue) && $this->Codigo_consulta->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Codigo_consulta->FldCaption(), $this->Codigo_consulta->ReqErrMsg));
		}
		if (!$this->Codigo_diagnostico->FldIsDetailKey && !is_null($this->Codigo_diagnostico->FormValue) && $this->Codigo_diagnostico->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Codigo_diagnostico->FldCaption(), $this->Codigo_diagnostico->ReqErrMsg));
		}
		if (!$this->Tipo_diagnostico_principal->FldIsDetailKey && !is_null($this->Tipo_diagnostico_principal->FormValue) && $this->Tipo_diagnostico_principal->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Tipo_diagnostico_principal->FldCaption(), $this->Tipo_diagnostico_principal->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Tipo_diagnostico_principal->FormValue)) {
			ew_AddMessage($gsFormError, $this->Tipo_diagnostico_principal->FldErrMsg());
		}
		if (!$this->Edad->FldIsDetailKey && !is_null($this->Edad->FormValue) && $this->Edad->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Edad->FldCaption(), $this->Edad->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Edad->FormValue)) {
			ew_AddMessage($gsFormError, $this->Edad->FldErrMsg());
		}
		if (!$this->Sexo->FldIsDetailKey && !is_null($this->Sexo->FormValue) && $this->Sexo->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Sexo->FldCaption(), $this->Sexo->ReqErrMsg));
		}
		if (!$this->Unidad_edad->FldIsDetailKey && !is_null($this->Unidad_edad->FormValue) && $this->Unidad_edad->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Unidad_edad->FldCaption(), $this->Unidad_edad->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Unidad_edad->FormValue)) {
			ew_AddMessage($gsFormError, $this->Unidad_edad->FldErrMsg());
		}
		if (!$this->Zona_residencia->FldIsDetailKey && !is_null($this->Zona_residencia->FormValue) && $this->Zona_residencia->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Zona_residencia->FldCaption(), $this->Zona_residencia->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Tipo_Usuario->FormValue)) {
			ew_AddMessage($gsFormError, $this->Tipo_Usuario->FldErrMsg());
		}
		if (!$this->Tipo_doc->FldIsDetailKey && !is_null($this->Tipo_doc->FormValue) && $this->Tipo_doc->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Tipo_doc->FldCaption(), $this->Tipo_doc->ReqErrMsg));
		}
		if (!$this->idconsulta->FldIsDetailKey && !is_null($this->idconsulta->FormValue) && $this->idconsulta->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->idconsulta->FldCaption(), $this->idconsulta->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->idconsulta->FormValue)) {
			ew_AddMessage($gsFormError, $this->idconsulta->FldErrMsg());
		}
		if (!$this->Causa_Completa->FldIsDetailKey && !is_null($this->Causa_Completa->FormValue) && $this->Causa_Completa->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Causa_Completa->FldCaption(), $this->Causa_Completa->ReqErrMsg));
		}
		if (!$this->Letra->FldIsDetailKey && !is_null($this->Letra->FormValue) && $this->Letra->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Letra->FldCaption(), $this->Letra->ReqErrMsg));
		}
		if (!$this->Numero->FldIsDetailKey && !is_null($this->Numero->FormValue) && $this->Numero->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Numero->FldCaption(), $this->Numero->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Numero->FormValue)) {
			ew_AddMessage($gsFormError, $this->Numero->FldErrMsg());
		}
		if (!$this->Codigo_tres->FldIsDetailKey && !is_null($this->Codigo_tres->FormValue) && $this->Codigo_tres->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Codigo_tres->FldCaption(), $this->Codigo_tres->ReqErrMsg));
		}
		if (!$this->Titulo_codigo_tres->FldIsDetailKey && !is_null($this->Titulo_codigo_tres->FormValue) && $this->Titulo_codigo_tres->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Titulo_codigo_tres->FldCaption(), $this->Titulo_codigo_tres->ReqErrMsg));
		}
		if (!$this->Codigo->FldIsDetailKey && !is_null($this->Codigo->FormValue) && $this->Codigo->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Codigo->FldCaption(), $this->Codigo->ReqErrMsg));
		}
		if (!$this->Contador->FldIsDetailKey && !is_null($this->Contador->FormValue) && $this->Contador->FormValue == "") {
			ew_AddMessage($gsFormError, str_replace("%s", $this->Contador->FldCaption(), $this->Contador->ReqErrMsg));
		}
		if (!ew_CheckInteger($this->Contador->FormValue)) {
			ew_AddMessage($gsFormError, $this->Contador->FldErrMsg());
		}

		// Return validate result
		$ValidateForm = ($gsFormError == "");

		// Call Form_CustomValidate event
		$sFormCustomError = "";
		$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
		if ($sFormCustomError <> "") {
			ew_AddMessage($gsFormError, $sFormCustomError);
		}
		return $ValidateForm;
	}

	// Add record
	function AddRow($rsold = NULL) {
		global $Language, $Security;
		$conn = &$this->Connection();

		// Load db values from rsold
		if ($rsold) {
			$this->LoadDbValues($rsold);
		}
		$rsnew = array();

		// Numero_id_usuario
		$this->Numero_id_usuario->SetDbValueDef($rsnew, $this->Numero_id_usuario->CurrentValue, "", FALSE);

		// Fecha_consulta
		$this->Fecha_consulta->SetDbValueDef($rsnew, $this->Fecha_consulta->CurrentValue, "", FALSE);

		// Codigo_prestador
		$this->Codigo_prestador->SetDbValueDef($rsnew, $this->Codigo_prestador->CurrentValue, 0, FALSE);

		// Codigo_consulta
		$this->Codigo_consulta->SetDbValueDef($rsnew, $this->Codigo_consulta->CurrentValue, "", FALSE);

		// Codigo_diagnostico
		$this->Codigo_diagnostico->SetDbValueDef($rsnew, $this->Codigo_diagnostico->CurrentValue, "", FALSE);

		// Tipo_diagnostico_principal
		$this->Tipo_diagnostico_principal->SetDbValueDef($rsnew, $this->Tipo_diagnostico_principal->CurrentValue, 0, FALSE);

		// Edad
		$this->Edad->SetDbValueDef($rsnew, $this->Edad->CurrentValue, 0, FALSE);

		// Sexo
		$this->Sexo->SetDbValueDef($rsnew, $this->Sexo->CurrentValue, "", FALSE);

		// Unidad_edad
		$this->Unidad_edad->SetDbValueDef($rsnew, $this->Unidad_edad->CurrentValue, 0, FALSE);

		// Zona_residencia
		$this->Zona_residencia->SetDbValueDef($rsnew, $this->Zona_residencia->CurrentValue, "", FALSE);

		// Tipo_Usuario
		$this->Tipo_Usuario->SetDbValueDef($rsnew, $this->Tipo_Usuario->CurrentValue, NULL, FALSE);

		// Tipo_doc
		$this->Tipo_doc->SetDbValueDef($rsnew, $this->Tipo_doc->CurrentValue, "", FALSE);

		// idconsulta
		$this->idconsulta->SetDbValueDef($rsnew, $this->idconsulta->CurrentValue, 0, FALSE);

		// Causa_Completa
		$this->Causa_Completa->SetDbValueDef($rsnew, $this->Causa_Completa->CurrentValue, "", FALSE);

		// Id
		$this->Id->SetDbValueDef($rsnew, $this->Id->CurrentValue, NULL, FALSE);

		// Letra
		$this->Letra->SetDbValueDef($rsnew, $this->Letra->CurrentValue, "", FALSE);

		// Numero
		$this->Numero->SetDbValueDef($rsnew, $this->Numero->CurrentValue, 0, FALSE);

		// Codigo_tres
		$this->Codigo_tres->SetDbValueDef($rsnew, $this->Codigo_tres->CurrentValue, "", FALSE);

		// Titulo_codigo_tres
		$this->Titulo_codigo_tres->SetDbValueDef($rsnew, $this->Titulo_codigo_tres->CurrentValue, "", FALSE);

		// Codigo
		$this->Codigo->SetDbValueDef($rsnew, $this->Codigo->CurrentValue, "", FALSE);

		// Contador
		$this->Contador->SetDbValueDef($rsnew, $this->Contador->CurrentValue, 0, FALSE);

		// Call Row Inserting event
		$rs = ($rsold == NULL) ? NULL : $rsold->fields;
		$bInsertRow = $this->Row_Inserting($rs, $rsnew);
		if ($bInsertRow) {
			$conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"];
			$AddRow = $this->Insert($rsnew);
			$conn->raiseErrorFn = '';
			if ($AddRow) {

				// Get insert id if necessary
				$this->Identificacion->setDbValue($conn->Insert_ID());
				$rsnew['Identificacion'] = $this->Identificacion->DbValue;
			}
		} else {
			if ($this->getSuccessMessage() <> "" || $this->getFailureMessage() <> "") {

				// Use the message, do nothing
			} elseif ($this->CancelMessage <> "") {
				$this->setFailureMessage($this->CancelMessage);
				$this->CancelMessage = "";
			} else {
				$this->setFailureMessage($Language->Phrase("InsertCancelled"));
			}
			$AddRow = FALSE;
		}
		if ($AddRow) {

			// Call Row Inserted event
			$rs = ($rsold == NULL) ? NULL : $rsold->fields;
			$this->Row_Inserted($rs, $rsnew);
		}
		return $AddRow;
	}

	// Set up Breadcrumb
	function SetupBreadcrumb() {
		global $Breadcrumb, $Language;
		$Breadcrumb = new cBreadcrumb();
		$url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/")+1);
		$Breadcrumb->Add("list", $this->TableVar, $this->AddMasterUrl("consulta_final_2021list.php"), "", $this->TableVar, TRUE);
		$PageId = ($this->CurrentAction == "C") ? "Copy" : "Add";
		$Breadcrumb->Add("add", $PageId, $url);
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

	// Page Redirecting event
	function Page_Redirecting(&$url) {

		// Example:
		//$url = "your URL";

	}

	// Message Showing event
	// $type = ''|'success'|'failure'|'warning'
	function Message_Showing(&$msg, $type) {
		if ($type == 'success') {

			//$msg = "your success message";
		} elseif ($type == 'failure') {

			//$msg = "your failure message";
		} elseif ($type == 'warning') {

			//$msg = "your warning message";
		} else {

			//$msg = "your message";
		}
	}

	// Page Render event
	function Page_Render() {

		//echo "Page Render";
	}

	// Page Data Rendering event
	function Page_DataRendering(&$header) {

		// Example:
		//$header = "your header";

	}

	// Page Data Rendered event
	function Page_DataRendered(&$footer) {

		// Example:
		//$footer = "your footer";

	}

	// Form Custom Validate event
	function Form_CustomValidate(&$CustomError) {

		// Return error message in CustomError
		return TRUE;
	}
}
?>
<?php ew_Header(FALSE) ?>
<?php

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

// Page init
$consulta_final_2021_add->Page_Init();

// Page main
$consulta_final_2021_add->Page_Main();

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

// Page Rendering event
$consulta_final_2021_add->Page_Render();
?>
<?php include_once "header.php" ?>
<script type="text/javascript">

// Form object
var CurrentPageID = EW_PAGE_ID = "add";
var CurrentForm = fconsulta_final_2021add = new ew_Form("fconsulta_final_2021add", "add");

// Validate form
fconsulta_final_2021add.Validate = function() {
	if (!this.ValidateRequired)
		return true; // Ignore validation
	var $ = jQuery, fobj = this.GetForm(), $fobj = $(fobj);
	if ($fobj.find("#a_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 = $fobj.find("#a_list").val() == "gridinsert";
	for (var i = startcnt; i <= rowcnt; i++) {
		var infix = ($k[0]) ? String(i) : "";
		$fobj.data("rowindex", infix);
			elm = this.GetElements("x" + infix + "_Numero_id_usuario");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Numero_id_usuario->FldCaption(), $consulta_final_2021->Numero_id_usuario->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Fecha_consulta");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Fecha_consulta->FldCaption(), $consulta_final_2021->Fecha_consulta->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Codigo_prestador");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Codigo_prestador->FldCaption(), $consulta_final_2021->Codigo_prestador->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Codigo_prestador");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Codigo_prestador->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Codigo_consulta");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Codigo_consulta->FldCaption(), $consulta_final_2021->Codigo_consulta->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Codigo_diagnostico");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Codigo_diagnostico->FldCaption(), $consulta_final_2021->Codigo_diagnostico->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Tipo_diagnostico_principal");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Tipo_diagnostico_principal->FldCaption(), $consulta_final_2021->Tipo_diagnostico_principal->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Tipo_diagnostico_principal");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Tipo_diagnostico_principal->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Edad");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Edad->FldCaption(), $consulta_final_2021->Edad->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Edad");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Edad->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Sexo");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Sexo->FldCaption(), $consulta_final_2021->Sexo->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Unidad_edad");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Unidad_edad->FldCaption(), $consulta_final_2021->Unidad_edad->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Unidad_edad");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Unidad_edad->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Zona_residencia");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Zona_residencia->FldCaption(), $consulta_final_2021->Zona_residencia->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Tipo_Usuario");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Tipo_Usuario->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Tipo_doc");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Tipo_doc->FldCaption(), $consulta_final_2021->Tipo_doc->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_idconsulta");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->idconsulta->FldCaption(), $consulta_final_2021->idconsulta->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_idconsulta");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->idconsulta->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Causa_Completa");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Causa_Completa->FldCaption(), $consulta_final_2021->Causa_Completa->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Letra");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Letra->FldCaption(), $consulta_final_2021->Letra->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Numero");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Numero->FldCaption(), $consulta_final_2021->Numero->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Numero");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Numero->FldErrMsg()) ?>");
			elm = this.GetElements("x" + infix + "_Codigo_tres");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Codigo_tres->FldCaption(), $consulta_final_2021->Codigo_tres->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Titulo_codigo_tres");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Titulo_codigo_tres->FldCaption(), $consulta_final_2021->Titulo_codigo_tres->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Codigo");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Codigo->FldCaption(), $consulta_final_2021->Codigo->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Contador");
			if (elm && !ew_IsHidden(elm) && !ew_HasValue(elm))
				return this.OnError(elm, "<?php echo ew_JsEncode2(str_replace("%s", $consulta_final_2021->Contador->FldCaption(), $consulta_final_2021->Contador->ReqErrMsg)) ?>");
			elm = this.GetElements("x" + infix + "_Contador");
			if (elm && !ew_CheckInteger(elm.value))
				return this.OnError(elm, "<?php echo ew_JsEncode2($consulta_final_2021->Contador->FldErrMsg()) ?>");

			// 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 && ewForms[val])
			if (!ewForms[val].Validate())
				return false;
	}
	return true;
}

// Form_CustomValidate event
fconsulta_final_2021add.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
<?php if (EW_CLIENT_VALIDATE) { ?>
fconsulta_final_2021add.ValidateRequired = true;
<?php } else { ?>
fconsulta_final_2021add.ValidateRequired = false; 
<?php } ?>

// Dynamic selection lists
// Form object for search

</script>
<script type="text/javascript">

// Write your client script here, no need to add script tags.
</script>
<div class="ewToolbar">
<?php $Breadcrumb->Render(); ?>
<?php echo $Language->SelectionForm(); ?>
<div class="clearfix"></div>
</div>
<?php $consulta_final_2021_add->ShowPageHeader(); ?>
<?php
$consulta_final_2021_add->ShowMessage();
?>
<form name="fconsulta_final_2021add" id="fconsulta_final_2021add" class="<?php echo $consulta_final_2021_add->FormClassName ?>" action="<?php echo ew_CurrentPage() ?>" method="post">
<?php if ($consulta_final_2021_add->CheckToken) { ?>
<input type="hidden" name="<?php echo EW_TOKEN_NAME ?>" value="<?php echo $consulta_final_2021_add->Token ?>">
<?php } ?>
<input type="hidden" name="t" value="consulta_final_2021">
<input type="hidden" name="a_add" id="a_add" value="A">
<div>
<?php if ($consulta_final_2021->Numero_id_usuario->Visible) { // Numero_id_usuario ?>
	<div id="r_Numero_id_usuario" class="form-group">
		<label id="elh_consulta_final_2021_Numero_id_usuario" for="x_Numero_id_usuario" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Numero_id_usuario->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Numero_id_usuario->CellAttributes() ?>>
<span id="el_consulta_final_2021_Numero_id_usuario">
<input type="text" data-table="consulta_final_2021" data-field="x_Numero_id_usuario" name="x_Numero_id_usuario" id="x_Numero_id_usuario" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Numero_id_usuario->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Numero_id_usuario->EditValue ?>"<?php echo $consulta_final_2021->Numero_id_usuario->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Numero_id_usuario->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Fecha_consulta->Visible) { // Fecha_consulta ?>
	<div id="r_Fecha_consulta" class="form-group">
		<label id="elh_consulta_final_2021_Fecha_consulta" for="x_Fecha_consulta" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Fecha_consulta->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Fecha_consulta->CellAttributes() ?>>
<span id="el_consulta_final_2021_Fecha_consulta">
<input type="text" data-table="consulta_final_2021" data-field="x_Fecha_consulta" name="x_Fecha_consulta" id="x_Fecha_consulta" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Fecha_consulta->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Fecha_consulta->EditValue ?>"<?php echo $consulta_final_2021->Fecha_consulta->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Fecha_consulta->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Codigo_prestador->Visible) { // Codigo_prestador ?>
	<div id="r_Codigo_prestador" class="form-group">
		<label id="elh_consulta_final_2021_Codigo_prestador" for="x_Codigo_prestador" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Codigo_prestador->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Codigo_prestador->CellAttributes() ?>>
<span id="el_consulta_final_2021_Codigo_prestador">
<input type="text" data-table="consulta_final_2021" data-field="x_Codigo_prestador" name="x_Codigo_prestador" id="x_Codigo_prestador" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Codigo_prestador->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Codigo_prestador->EditValue ?>"<?php echo $consulta_final_2021->Codigo_prestador->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Codigo_prestador->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Codigo_consulta->Visible) { // Codigo_consulta ?>
	<div id="r_Codigo_consulta" class="form-group">
		<label id="elh_consulta_final_2021_Codigo_consulta" for="x_Codigo_consulta" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Codigo_consulta->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Codigo_consulta->CellAttributes() ?>>
<span id="el_consulta_final_2021_Codigo_consulta">
<input type="text" data-table="consulta_final_2021" data-field="x_Codigo_consulta" name="x_Codigo_consulta" id="x_Codigo_consulta" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Codigo_consulta->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Codigo_consulta->EditValue ?>"<?php echo $consulta_final_2021->Codigo_consulta->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Codigo_consulta->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Codigo_diagnostico->Visible) { // Codigo_diagnostico ?>
	<div id="r_Codigo_diagnostico" class="form-group">
		<label id="elh_consulta_final_2021_Codigo_diagnostico" for="x_Codigo_diagnostico" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Codigo_diagnostico->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Codigo_diagnostico->CellAttributes() ?>>
<span id="el_consulta_final_2021_Codigo_diagnostico">
<input type="text" data-table="consulta_final_2021" data-field="x_Codigo_diagnostico" name="x_Codigo_diagnostico" id="x_Codigo_diagnostico" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Codigo_diagnostico->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Codigo_diagnostico->EditValue ?>"<?php echo $consulta_final_2021->Codigo_diagnostico->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Codigo_diagnostico->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Tipo_diagnostico_principal->Visible) { // Tipo_diagnostico_principal ?>
	<div id="r_Tipo_diagnostico_principal" class="form-group">
		<label id="elh_consulta_final_2021_Tipo_diagnostico_principal" for="x_Tipo_diagnostico_principal" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Tipo_diagnostico_principal->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Tipo_diagnostico_principal->CellAttributes() ?>>
<span id="el_consulta_final_2021_Tipo_diagnostico_principal">
<input type="text" data-table="consulta_final_2021" data-field="x_Tipo_diagnostico_principal" name="x_Tipo_diagnostico_principal" id="x_Tipo_diagnostico_principal" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Tipo_diagnostico_principal->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Tipo_diagnostico_principal->EditValue ?>"<?php echo $consulta_final_2021->Tipo_diagnostico_principal->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Tipo_diagnostico_principal->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Edad->Visible) { // Edad ?>
	<div id="r_Edad" class="form-group">
		<label id="elh_consulta_final_2021_Edad" for="x_Edad" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Edad->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Edad->CellAttributes() ?>>
<span id="el_consulta_final_2021_Edad">
<input type="text" data-table="consulta_final_2021" data-field="x_Edad" name="x_Edad" id="x_Edad" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Edad->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Edad->EditValue ?>"<?php echo $consulta_final_2021->Edad->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Edad->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Sexo->Visible) { // Sexo ?>
	<div id="r_Sexo" class="form-group">
		<label id="elh_consulta_final_2021_Sexo" for="x_Sexo" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Sexo->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Sexo->CellAttributes() ?>>
<span id="el_consulta_final_2021_Sexo">
<input type="text" data-table="consulta_final_2021" data-field="x_Sexo" name="x_Sexo" id="x_Sexo" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Sexo->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Sexo->EditValue ?>"<?php echo $consulta_final_2021->Sexo->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Sexo->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Unidad_edad->Visible) { // Unidad_edad ?>
	<div id="r_Unidad_edad" class="form-group">
		<label id="elh_consulta_final_2021_Unidad_edad" for="x_Unidad_edad" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Unidad_edad->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Unidad_edad->CellAttributes() ?>>
<span id="el_consulta_final_2021_Unidad_edad">
<input type="text" data-table="consulta_final_2021" data-field="x_Unidad_edad" name="x_Unidad_edad" id="x_Unidad_edad" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Unidad_edad->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Unidad_edad->EditValue ?>"<?php echo $consulta_final_2021->Unidad_edad->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Unidad_edad->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Zona_residencia->Visible) { // Zona_residencia ?>
	<div id="r_Zona_residencia" class="form-group">
		<label id="elh_consulta_final_2021_Zona_residencia" for="x_Zona_residencia" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Zona_residencia->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Zona_residencia->CellAttributes() ?>>
<span id="el_consulta_final_2021_Zona_residencia">
<input type="text" data-table="consulta_final_2021" data-field="x_Zona_residencia" name="x_Zona_residencia" id="x_Zona_residencia" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Zona_residencia->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Zona_residencia->EditValue ?>"<?php echo $consulta_final_2021->Zona_residencia->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Zona_residencia->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Tipo_Usuario->Visible) { // Tipo_Usuario ?>
	<div id="r_Tipo_Usuario" class="form-group">
		<label id="elh_consulta_final_2021_Tipo_Usuario" for="x_Tipo_Usuario" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Tipo_Usuario->FldCaption() ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Tipo_Usuario->CellAttributes() ?>>
<span id="el_consulta_final_2021_Tipo_Usuario">
<input type="text" data-table="consulta_final_2021" data-field="x_Tipo_Usuario" name="x_Tipo_Usuario" id="x_Tipo_Usuario" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Tipo_Usuario->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Tipo_Usuario->EditValue ?>"<?php echo $consulta_final_2021->Tipo_Usuario->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Tipo_Usuario->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Tipo_doc->Visible) { // Tipo_doc ?>
	<div id="r_Tipo_doc" class="form-group">
		<label id="elh_consulta_final_2021_Tipo_doc" for="x_Tipo_doc" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Tipo_doc->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Tipo_doc->CellAttributes() ?>>
<span id="el_consulta_final_2021_Tipo_doc">
<input type="text" data-table="consulta_final_2021" data-field="x_Tipo_doc" name="x_Tipo_doc" id="x_Tipo_doc" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Tipo_doc->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Tipo_doc->EditValue ?>"<?php echo $consulta_final_2021->Tipo_doc->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Tipo_doc->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->idconsulta->Visible) { // idconsulta ?>
	<div id="r_idconsulta" class="form-group">
		<label id="elh_consulta_final_2021_idconsulta" for="x_idconsulta" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->idconsulta->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->idconsulta->CellAttributes() ?>>
<span id="el_consulta_final_2021_idconsulta">
<input type="text" data-table="consulta_final_2021" data-field="x_idconsulta" name="x_idconsulta" id="x_idconsulta" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->idconsulta->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->idconsulta->EditValue ?>"<?php echo $consulta_final_2021->idconsulta->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->idconsulta->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Causa_Completa->Visible) { // Causa_Completa ?>
	<div id="r_Causa_Completa" class="form-group">
		<label id="elh_consulta_final_2021_Causa_Completa" for="x_Causa_Completa" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Causa_Completa->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Causa_Completa->CellAttributes() ?>>
<span id="el_consulta_final_2021_Causa_Completa">
<textarea data-table="consulta_final_2021" data-field="x_Causa_Completa" name="x_Causa_Completa" id="x_Causa_Completa" cols="35" rows="4" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Causa_Completa->getPlaceHolder()) ?>"<?php echo $consulta_final_2021->Causa_Completa->EditAttributes() ?>><?php echo $consulta_final_2021->Causa_Completa->EditValue ?></textarea>
</span>
<?php echo $consulta_final_2021->Causa_Completa->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Id->Visible) { // Id ?>
	<div id="r_Id" class="form-group">
		<label id="elh_consulta_final_2021_Id" for="x_Id" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Id->FldCaption() ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Id->CellAttributes() ?>>
<span id="el_consulta_final_2021_Id">
<input type="text" data-table="consulta_final_2021" data-field="x_Id" name="x_Id" id="x_Id" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Id->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Id->EditValue ?>"<?php echo $consulta_final_2021->Id->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Id->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Letra->Visible) { // Letra ?>
	<div id="r_Letra" class="form-group">
		<label id="elh_consulta_final_2021_Letra" for="x_Letra" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Letra->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Letra->CellAttributes() ?>>
<span id="el_consulta_final_2021_Letra">
<input type="text" data-table="consulta_final_2021" data-field="x_Letra" name="x_Letra" id="x_Letra" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Letra->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Letra->EditValue ?>"<?php echo $consulta_final_2021->Letra->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Letra->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Numero->Visible) { // Numero ?>
	<div id="r_Numero" class="form-group">
		<label id="elh_consulta_final_2021_Numero" for="x_Numero" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Numero->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Numero->CellAttributes() ?>>
<span id="el_consulta_final_2021_Numero">
<input type="text" data-table="consulta_final_2021" data-field="x_Numero" name="x_Numero" id="x_Numero" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Numero->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Numero->EditValue ?>"<?php echo $consulta_final_2021->Numero->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Numero->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Codigo_tres->Visible) { // Codigo_tres ?>
	<div id="r_Codigo_tres" class="form-group">
		<label id="elh_consulta_final_2021_Codigo_tres" for="x_Codigo_tres" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Codigo_tres->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Codigo_tres->CellAttributes() ?>>
<span id="el_consulta_final_2021_Codigo_tres">
<input type="text" data-table="consulta_final_2021" data-field="x_Codigo_tres" name="x_Codigo_tres" id="x_Codigo_tres" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Codigo_tres->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Codigo_tres->EditValue ?>"<?php echo $consulta_final_2021->Codigo_tres->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Codigo_tres->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Titulo_codigo_tres->Visible) { // Titulo_codigo_tres ?>
	<div id="r_Titulo_codigo_tres" class="form-group">
		<label id="elh_consulta_final_2021_Titulo_codigo_tres" for="x_Titulo_codigo_tres" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Titulo_codigo_tres->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Titulo_codigo_tres->CellAttributes() ?>>
<span id="el_consulta_final_2021_Titulo_codigo_tres">
<input type="text" data-table="consulta_final_2021" data-field="x_Titulo_codigo_tres" name="x_Titulo_codigo_tres" id="x_Titulo_codigo_tres" size="30" maxlength="190" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Titulo_codigo_tres->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Titulo_codigo_tres->EditValue ?>"<?php echo $consulta_final_2021->Titulo_codigo_tres->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Titulo_codigo_tres->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Codigo->Visible) { // Codigo ?>
	<div id="r_Codigo" class="form-group">
		<label id="elh_consulta_final_2021_Codigo" for="x_Codigo" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Codigo->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Codigo->CellAttributes() ?>>
<span id="el_consulta_final_2021_Codigo">
<input type="text" data-table="consulta_final_2021" data-field="x_Codigo" name="x_Codigo" id="x_Codigo" size="30" maxlength="150" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Codigo->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Codigo->EditValue ?>"<?php echo $consulta_final_2021->Codigo->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Codigo->CustomMsg ?></div></div>
	</div>
<?php } ?>
<?php if ($consulta_final_2021->Contador->Visible) { // Contador ?>
	<div id="r_Contador" class="form-group">
		<label id="elh_consulta_final_2021_Contador" for="x_Contador" class="col-sm-2 control-label ewLabel"><?php echo $consulta_final_2021->Contador->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></label>
		<div class="col-sm-10"><div<?php echo $consulta_final_2021->Contador->CellAttributes() ?>>
<span id="el_consulta_final_2021_Contador">
<input type="text" data-table="consulta_final_2021" data-field="x_Contador" name="x_Contador" id="x_Contador" size="30" placeholder="<?php echo ew_HtmlEncode($consulta_final_2021->Contador->getPlaceHolder()) ?>" value="<?php echo $consulta_final_2021->Contador->EditValue ?>"<?php echo $consulta_final_2021->Contador->EditAttributes() ?>>
</span>
<?php echo $consulta_final_2021->Contador->CustomMsg ?></div></div>
	</div>
<?php } ?>
</div>
<div class="form-group">
	<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-primary ewButton" name="btnAction" id="btnAction" type="submit"><?php echo $Language->Phrase("AddBtn") ?></button>
<button class="btn btn-default ewButton" name="btnCancel" id="btnCancel" type="button" data-href="<?php echo $consulta_final_2021_add->getReturnUrl() ?>"><?php echo $Language->Phrase("CancelBtn") ?></button>
	</div>
</div>
</form>
<script type="text/javascript">
fconsulta_final_2021add.Init();
</script>
<?php
$consulta_final_2021_add->ShowPageFooter();
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
?>
<script type="text/javascript">

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

</script>
<?php include_once "footer.php" ?>
<?php
$consulta_final_2021_add->Page_Terminate();
?>
