<?php namespace PHPMaker2020\project2; ?>
<?php

/**
 * Table class for interested
 */
class interested extends DbTable
{
	protected $SqlFrom = "";
	protected $SqlSelect = "";
	protected $SqlSelectList = "";
	protected $SqlWhere = "";
	protected $SqlGroupBy = "";
	protected $SqlHaving = "";
	protected $SqlOrderBy = "";
	public $UseSessionForListSql = TRUE;

	// Column CSS classes
	public $LeftColumnClass = "col-sm-2 col-form-label ew-label";
	public $RightColumnClass = "col-sm-10";
	public $OffsetColumnClass = "col-sm-10 offset-sm-2";
	public $TableLeftColumnClass = "w-col-2";

	// Export
	public $ExportDoc;

	// Fields
	public $id;
	public $fecha;
	public $_email;
	public $cursos;
	public $categorias;
	public $nombres;
	public $apellidos;
	public $direccion;
	public $ciudad;
	public $provincia;
	public $pais;
	public $telefono;
	public $tipo_certificado;
	public $tipo_pago;
	public $nombretarjeta;
	public $numerotarjeta;
	public $mes;
	public $anio;
	public $tipo_tarjeta;
	public $nombrepaypal;
	public $montopaypal;
	public $emailpaypal;
	public $don;
	public $tipo_condicion;

	// Constructor
	public function __construct()
	{
		global $Language, $CurrentLanguage;
		parent::__construct();

		// Language object
		if (!isset($Language))
			$Language = new Language();
		$this->TableVar = 'interested';
		$this->TableName = 'interested';
		$this->TableType = 'TABLE';

		// Update Table
		$this->UpdateTable = "`interested`";
		$this->Dbid = 'DB';
		$this->ExportAll = TRUE;
		$this->ExportPageBreakCount = 0; // Page break per every n record (PDF only)
		$this->ExportPageOrientation = "portrait"; // Page orientation (PDF only)
		$this->ExportPageSize = "a4"; // Page size (PDF only)
		$this->ExportExcelPageOrientation = ""; // Page orientation (PhpSpreadsheet only)
		$this->ExportExcelPageSize = ""; // Page size (PhpSpreadsheet only)
		$this->ExportWordPageOrientation = "portrait"; // Page orientation (PHPWord only)
		$this->ExportWordColumnWidth = NULL; // Cell width (PHPWord only)
		$this->DetailAdd = FALSE; // Allow detail add
		$this->DetailEdit = FALSE; // Allow detail edit
		$this->DetailView = FALSE; // Allow detail view
		$this->ShowMultipleDetails = FALSE; // Show multiple details
		$this->GridAddRowCount = 5;
		$this->AllowAddDeleteRow = TRUE; // Allow add/delete row
		$this->UserIDAllowSecurity = 0; // User ID Allow
		$this->BasicSearch = new BasicSearch($this->TableVar);

		// id
		$this->id = new DbField('interested', 'interested', 'x_id', 'id', '`id`', '`id`', 19, 10, -1, FALSE, '`id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->id->Nullable = FALSE; // NOT NULL field
		$this->id->Required = TRUE; // Required field
		$this->id->Sortable = TRUE; // Allow sort
		$this->id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['id'] = &$this->id;

		// fecha
		$this->fecha = new DbField('interested', 'interested', 'x_fecha', 'fecha', '`fecha`', CastDateFieldForLike("`fecha`", 0, "DB"), 135, 19, 0, FALSE, '`fecha`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->fecha->Nullable = FALSE; // NOT NULL field
		$this->fecha->Required = TRUE; // Required field
		$this->fecha->Sortable = TRUE; // Allow sort
		$this->fecha->DefaultErrorMessage = str_replace("%s", $GLOBALS["DATE_FORMAT"], $Language->phrase("IncorrectDate"));
		$this->fields['fecha'] = &$this->fecha;

		// email
		$this->_email = new DbField('interested', 'interested', 'x__email', 'email', '`email`', '`email`', 200, 100, -1, FALSE, '`email`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->_email->Sortable = TRUE; // Allow sort
		$this->fields['email'] = &$this->_email;

		// cursos
		$this->cursos = new DbField('interested', 'interested', 'x_cursos', 'cursos', '`cursos`', '`cursos`', 3, 11, -1, FALSE, '`cursos`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->cursos->Sortable = TRUE; // Allow sort
		$this->cursos->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['cursos'] = &$this->cursos;

		// categorias
		$this->categorias = new DbField('interested', 'interested', 'x_categorias', 'categorias', '`categorias`', '`categorias`', 3, 11, -1, FALSE, '`categorias`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->categorias->Sortable = TRUE; // Allow sort
		$this->categorias->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['categorias'] = &$this->categorias;

		// nombres
		$this->nombres = new DbField('interested', 'interested', 'x_nombres', 'nombres', '`nombres`', '`nombres`', 200, 50, -1, FALSE, '`nombres`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->nombres->Sortable = TRUE; // Allow sort
		$this->fields['nombres'] = &$this->nombres;

		// apellidos
		$this->apellidos = new DbField('interested', 'interested', 'x_apellidos', 'apellidos', '`apellidos`', '`apellidos`', 200, 200, -1, FALSE, '`apellidos`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->apellidos->Sortable = TRUE; // Allow sort
		$this->fields['apellidos'] = &$this->apellidos;

		// direccion
		$this->direccion = new DbField('interested', 'interested', 'x_direccion', 'direccion', '`direccion`', '`direccion`', 200, 200, -1, FALSE, '`direccion`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->direccion->Sortable = TRUE; // Allow sort
		$this->fields['direccion'] = &$this->direccion;

		// ciudad
		$this->ciudad = new DbField('interested', 'interested', 'x_ciudad', 'ciudad', '`ciudad`', '`ciudad`', 200, 200, -1, FALSE, '`ciudad`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->ciudad->Sortable = TRUE; // Allow sort
		$this->fields['ciudad'] = &$this->ciudad;

		// provincia
		$this->provincia = new DbField('interested', 'interested', 'x_provincia', 'provincia', '`provincia`', '`provincia`', 200, 100, -1, FALSE, '`provincia`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->provincia->Sortable = TRUE; // Allow sort
		$this->fields['provincia'] = &$this->provincia;

		// pais
		$this->pais = new DbField('interested', 'interested', 'x_pais', 'pais', '`pais`', '`pais`', 200, 20, -1, FALSE, '`pais`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->pais->Sortable = TRUE; // Allow sort
		$this->fields['pais'] = &$this->pais;

		// telefono
		$this->telefono = new DbField('interested', 'interested', 'x_telefono', 'telefono', '`telefono`', '`telefono`', 200, 64, -1, FALSE, '`telefono`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->telefono->Sortable = TRUE; // Allow sort
		$this->fields['telefono'] = &$this->telefono;

		// tipo_certificado
		$this->tipo_certificado = new DbField('interested', 'interested', 'x_tipo_certificado', 'tipo_certificado', '`tipo_certificado`', '`tipo_certificado`', 3, 11, -1, FALSE, '`tipo_certificado`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->tipo_certificado->Sortable = TRUE; // Allow sort
		$this->tipo_certificado->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['tipo_certificado'] = &$this->tipo_certificado;

		// tipo_pago
		$this->tipo_pago = new DbField('interested', 'interested', 'x_tipo_pago', 'tipo_pago', '`tipo_pago`', '`tipo_pago`', 3, 11, -1, FALSE, '`tipo_pago`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->tipo_pago->Sortable = TRUE; // Allow sort
		$this->tipo_pago->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['tipo_pago'] = &$this->tipo_pago;

		// nombretarjeta
		$this->nombretarjeta = new DbField('interested', 'interested', 'x_nombretarjeta', 'nombretarjeta', '`nombretarjeta`', '`nombretarjeta`', 200, 200, -1, FALSE, '`nombretarjeta`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->nombretarjeta->Sortable = TRUE; // Allow sort
		$this->fields['nombretarjeta'] = &$this->nombretarjeta;

		// numerotarjeta
		$this->numerotarjeta = new DbField('interested', 'interested', 'x_numerotarjeta', 'numerotarjeta', '`numerotarjeta`', '`numerotarjeta`', 200, 200, -1, FALSE, '`numerotarjeta`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->numerotarjeta->Sortable = TRUE; // Allow sort
		$this->fields['numerotarjeta'] = &$this->numerotarjeta;

		// mes
		$this->mes = new DbField('interested', 'interested', 'x_mes', 'mes', '`mes`', '`mes`', 200, 200, -1, FALSE, '`mes`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->mes->Sortable = TRUE; // Allow sort
		$this->fields['mes'] = &$this->mes;

		// anio
		$this->anio = new DbField('interested', 'interested', 'x_anio', 'anio', '`anio`', '`anio`', 200, 200, -1, FALSE, '`anio`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->anio->Sortable = TRUE; // Allow sort
		$this->fields['anio'] = &$this->anio;

		// tipo_tarjeta
		$this->tipo_tarjeta = new DbField('interested', 'interested', 'x_tipo_tarjeta', 'tipo_tarjeta', '`tipo_tarjeta`', '`tipo_tarjeta`', 200, 110, -1, FALSE, '`tipo_tarjeta`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->tipo_tarjeta->Sortable = TRUE; // Allow sort
		$this->fields['tipo_tarjeta'] = &$this->tipo_tarjeta;

		// nombrepaypal
		$this->nombrepaypal = new DbField('interested', 'interested', 'x_nombrepaypal', 'nombrepaypal', '`nombrepaypal`', '`nombrepaypal`', 200, 20, -1, FALSE, '`nombrepaypal`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->nombrepaypal->Sortable = TRUE; // Allow sort
		$this->fields['nombrepaypal'] = &$this->nombrepaypal;

		// montopaypal
		$this->montopaypal = new DbField('interested', 'interested', 'x_montopaypal', 'montopaypal', '`montopaypal`', '`montopaypal`', 200, 64, -1, FALSE, '`montopaypal`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->montopaypal->Sortable = TRUE; // Allow sort
		$this->fields['montopaypal'] = &$this->montopaypal;

		// emailpaypal
		$this->emailpaypal = new DbField('interested', 'interested', 'x_emailpaypal', 'emailpaypal', '`emailpaypal`', '`emailpaypal`', 200, 200, -1, FALSE, '`emailpaypal`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->emailpaypal->Sortable = TRUE; // Allow sort
		$this->fields['emailpaypal'] = &$this->emailpaypal;

		// don
		$this->don = new DbField('interested', 'interested', 'x_don', 'don', '`don`', '`don`', 200, 20, -1, FALSE, '`don`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->don->Sortable = TRUE; // Allow sort
		$this->fields['don'] = &$this->don;

		// tipo_condicion
		$this->tipo_condicion = new DbField('interested', 'interested', 'x_tipo_condicion', 'tipo_condicion', '`tipo_condicion`', '`tipo_condicion`', 3, 11, -1, FALSE, '`tipo_condicion`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->tipo_condicion->Sortable = TRUE; // Allow sort
		$this->tipo_condicion->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['tipo_condicion'] = &$this->tipo_condicion;
	}

	// Field Visibility
	public function getFieldVisibility($fldParm)
	{
		global $Security;
		return $this->$fldParm->Visible; // Returns original value
	}

	// Set left column class (must be predefined col-*-* classes of Bootstrap grid system)
	function setLeftColumnClass($class)
	{
		if (preg_match('/^col\-(\w+)\-(\d+)$/', $class, $match)) {
			$this->LeftColumnClass = $class . " col-form-label ew-label";
			$this->RightColumnClass = "col-" . $match[1] . "-" . strval(12 - (int)$match[2]);
			$this->OffsetColumnClass = $this->RightColumnClass . " " . str_replace("col-", "offset-", $class);
			$this->TableLeftColumnClass = preg_replace('/^col-\w+-(\d+)$/', "w-col-$1", $class); // Change to w-col-*
		}
	}

	// Single column sort
	public function updateSort(&$fld)
	{
		if ($this->CurrentOrder == $fld->Name) {
			$sortField = $fld->Expression;
			$lastSort = $fld->getSort();
			if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
				$thisSort = $this->CurrentOrderType;
			} else {
				$thisSort = ($lastSort == "ASC") ? "DESC" : "ASC";
			}
			$fld->setSort($thisSort);
			$this->setSessionOrderBy($sortField . " " . $thisSort); // Save to Session
		} else {
			$fld->setSort("");
		}
	}

	// Table level SQL
	public function getSqlFrom() // From
	{
		return ($this->SqlFrom != "") ? $this->SqlFrom : "`interested`";
	}
	public function sqlFrom() // For backward compatibility
	{
		return $this->getSqlFrom();
	}
	public function setSqlFrom($v)
	{
		$this->SqlFrom = $v;
	}
	public function getSqlSelect() // Select
	{
		return ($this->SqlSelect != "") ? $this->SqlSelect : "SELECT * FROM " . $this->getSqlFrom();
	}
	public function sqlSelect() // For backward compatibility
	{
		return $this->getSqlSelect();
	}
	public function setSqlSelect($v)
	{
		$this->SqlSelect = $v;
	}
	public function getSqlWhere() // Where
	{
		$where = ($this->SqlWhere != "") ? $this->SqlWhere : "";
		$this->TableFilter = "";
		AddFilter($where, $this->TableFilter);
		return $where;
	}
	public function sqlWhere() // For backward compatibility
	{
		return $this->getSqlWhere();
	}
	public function setSqlWhere($v)
	{
		$this->SqlWhere = $v;
	}
	public function getSqlGroupBy() // Group By
	{
		return ($this->SqlGroupBy != "") ? $this->SqlGroupBy : "";
	}
	public function sqlGroupBy() // For backward compatibility
	{
		return $this->getSqlGroupBy();
	}
	public function setSqlGroupBy($v)
	{
		$this->SqlGroupBy = $v;
	}
	public function getSqlHaving() // Having
	{
		return ($this->SqlHaving != "") ? $this->SqlHaving : "";
	}
	public function sqlHaving() // For backward compatibility
	{
		return $this->getSqlHaving();
	}
	public function setSqlHaving($v)
	{
		$this->SqlHaving = $v;
	}
	public function getSqlOrderBy() // Order By
	{
		return ($this->SqlOrderBy != "") ? $this->SqlOrderBy : "";
	}
	public function sqlOrderBy() // For backward compatibility
	{
		return $this->getSqlOrderBy();
	}
	public function setSqlOrderBy($v)
	{
		$this->SqlOrderBy = $v;
	}

	// Apply User ID filters
	public function applyUserIDFilters($filter)
	{
		return $filter;
	}

	// Check if User ID security allows view all
	public function userIDAllow($id = "")
	{
		$allow = Config("USER_ID_ALLOW");
		switch ($id) {
			case "add":
			case "copy":
			case "gridadd":
			case "register":
			case "addopt":
				return (($allow & 1) == 1);
			case "edit":
			case "gridedit":
			case "update":
			case "changepwd":
			case "forgotpwd":
				return (($allow & 4) == 4);
			case "delete":
				return (($allow & 2) == 2);
			case "view":
				return (($allow & 32) == 32);
			case "search":
				return (($allow & 64) == 64);
			default:
				return (($allow & 8) == 8);
		}
	}

	// Get recordset
	public function getRecordset($sql, $rowcnt = -1, $offset = -1)
	{
		$conn = $this->getConnection();
		$conn->raiseErrorFn = Config("ERROR_FUNC");
		$rs = $conn->selectLimit($sql, $rowcnt, $offset);
		$conn->raiseErrorFn = "";
		return $rs;
	}

	// Get record count
	public function getRecordCount($sql)
	{
		$cnt = -1;
		$rs = NULL;
		$sql = preg_replace('/\/\*BeginOrderBy\*\/[\s\S]+\/\*EndOrderBy\*\//', "", $sql); // Remove ORDER BY clause (MSSQL)
		$pattern = '/^SELECT\s([\s\S]+)\sFROM\s/i';

		// Skip Custom View / SubQuery and SELECT DISTINCT
		if (($this->TableType == 'TABLE' || $this->TableType == 'VIEW' || $this->TableType == 'LINKTABLE') &&
			preg_match($pattern, $sql) && !preg_match('/\(\s*(SELECT[^)]+)\)/i', $sql) && !preg_match('/^\s*select\s+distinct\s+/i', $sql)) {
			$sqlwrk = "SELECT COUNT(*) FROM " . preg_replace($pattern, "", $sql);
		} else {
			$sqlwrk = "SELECT COUNT(*) FROM (" . $sql . ") COUNT_TABLE";
		}
		$conn = $this->getConnection();
		if ($rs = $conn->execute($sqlwrk)) {
			if (!$rs->EOF && $rs->FieldCount() > 0) {
				$cnt = $rs->fields[0];
				$rs->close();
			}
			return (int)$cnt;
		}

		// Unable to get count, get record count directly
		if ($rs = $conn->execute($sql)) {
			$cnt = $rs->RecordCount();
			$rs->close();
			return (int)$cnt;
		}
		return $cnt;
	}

	// Get SQL
	public function getSql($where, $orderBy = "")
	{
		return BuildSelectSql($this->getSqlSelect(), $this->getSqlWhere(),
			$this->getSqlGroupBy(), $this->getSqlHaving(), $this->getSqlOrderBy(),
			$where, $orderBy);
	}

	// Table SQL
	public function getCurrentSql()
	{
		$filter = $this->CurrentFilter;
		$filter = $this->applyUserIDFilters($filter);
		$sort = $this->getSessionOrderBy();
		return $this->getSql($filter, $sort);
	}

	// Table SQL with List page filter
	public function getListSql()
	{
		$filter = $this->UseSessionForListSql ? $this->getSessionWhere() : "";
		AddFilter($filter, $this->CurrentFilter);
		$filter = $this->applyUserIDFilters($filter);
		$this->Recordset_Selecting($filter);
		$select = $this->getSqlSelect();
		$sort = $this->UseSessionForListSql ? $this->getSessionOrderBy() : "";
		return BuildSelectSql($select, $this->getSqlWhere(), $this->getSqlGroupBy(),
			$this->getSqlHaving(), $this->getSqlOrderBy(), $filter, $sort);
	}

	// Get ORDER BY clause
	public function getOrderBy()
	{
		$sort = $this->getSessionOrderBy();
		return BuildSelectSql("", "", "", "", $this->getSqlOrderBy(), "", $sort);
	}

	// Get record count based on filter (for detail record count in master table pages)
	public function loadRecordCount($filter)
	{
		$origFilter = $this->CurrentFilter;
		$this->CurrentFilter = $filter;
		$this->Recordset_Selecting($this->CurrentFilter);
		$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : "SELECT * FROM " . $this->getSqlFrom();
		$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : "";
		$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : "";
		$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, "", $this->CurrentFilter, "");
		$cnt = $this->getRecordCount($sql);
		$this->CurrentFilter = $origFilter;
		return $cnt;
	}

	// Get record count (for current List page)
	public function listRecordCount()
	{
		$filter = $this->getSessionWhere();
		AddFilter($filter, $this->CurrentFilter);
		$filter = $this->applyUserIDFilters($filter);
		$this->Recordset_Selecting($filter);
		$select = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlSelect() : "SELECT * FROM " . $this->getSqlFrom();
		$groupBy = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlGroupBy() : "";
		$having = $this->TableType == 'CUSTOMVIEW' ? $this->getSqlHaving() : "";
		$sql = BuildSelectSql($select, $this->getSqlWhere(), $groupBy, $having, "", $filter, "");
		$cnt = $this->getRecordCount($sql);
		return $cnt;
	}

	// INSERT statement
	protected function insertSql(&$rs)
	{
		$names = "";
		$values = "";
		foreach ($rs as $name => $value) {
			if (!isset($this->fields[$name]) || $this->fields[$name]->IsCustom)
				continue;
			$names .= $this->fields[$name]->Expression . ",";
			$values .= QuotedValue($value, $this->fields[$name]->DataType, $this->Dbid) . ",";
		}
		$names = preg_replace('/,+$/', "", $names);
		$values = preg_replace('/,+$/', "", $values);
		return "INSERT INTO " . $this->UpdateTable . " ($names) VALUES ($values)";
	}

	// Insert
	public function insert(&$rs)
	{
		$conn = $this->getConnection();
		$success = $conn->execute($this->insertSql($rs));
		if ($success) {
		}
		return $success;
	}

	// UPDATE statement
	protected function updateSql(&$rs, $where = "", $curfilter = TRUE)
	{
		$sql = "UPDATE " . $this->UpdateTable . " SET ";
		foreach ($rs as $name => $value) {
			if (!isset($this->fields[$name]) || $this->fields[$name]->IsCustom || $this->fields[$name]->IsAutoIncrement)
				continue;
			$sql .= $this->fields[$name]->Expression . "=";
			$sql .= QuotedValue($value, $this->fields[$name]->DataType, $this->Dbid) . ",";
		}
		$sql = preg_replace('/,+$/', "", $sql);
		$filter = ($curfilter) ? $this->CurrentFilter : "";
		if (is_array($where))
			$where = $this->arrayToFilter($where);
		AddFilter($filter, $where);
		if ($filter != "")
			$sql .= " WHERE " . $filter;
		return $sql;
	}

	// Update
	public function update(&$rs, $where = "", $rsold = NULL, $curfilter = TRUE)
	{
		$conn = $this->getConnection();
		$success = $conn->execute($this->updateSql($rs, $where, $curfilter));
		return $success;
	}

	// DELETE statement
	protected function deleteSql(&$rs, $where = "", $curfilter = TRUE)
	{
		$sql = "DELETE FROM " . $this->UpdateTable . " WHERE ";
		if (is_array($where))
			$where = $this->arrayToFilter($where);
		if ($rs) {
		}
		$filter = ($curfilter) ? $this->CurrentFilter : "";
		AddFilter($filter, $where);
		if ($filter != "")
			$sql .= $filter;
		else
			$sql .= "0=1"; // Avoid delete
		return $sql;
	}

	// Delete
	public function delete(&$rs, $where = "", $curfilter = FALSE)
	{
		$success = TRUE;
		$conn = $this->getConnection();
		if ($success)
			$success = $conn->execute($this->deleteSql($rs, $where, $curfilter));
		return $success;
	}

	// Load DbValue from recordset or array
	protected function loadDbValues(&$rs)
	{
		if (!$rs || !is_array($rs) && $rs->EOF)
			return;
		$row = is_array($rs) ? $rs : $rs->fields;
		$this->id->DbValue = $row['id'];
		$this->fecha->DbValue = $row['fecha'];
		$this->_email->DbValue = $row['email'];
		$this->cursos->DbValue = $row['cursos'];
		$this->categorias->DbValue = $row['categorias'];
		$this->nombres->DbValue = $row['nombres'];
		$this->apellidos->DbValue = $row['apellidos'];
		$this->direccion->DbValue = $row['direccion'];
		$this->ciudad->DbValue = $row['ciudad'];
		$this->provincia->DbValue = $row['provincia'];
		$this->pais->DbValue = $row['pais'];
		$this->telefono->DbValue = $row['telefono'];
		$this->tipo_certificado->DbValue = $row['tipo_certificado'];
		$this->tipo_pago->DbValue = $row['tipo_pago'];
		$this->nombretarjeta->DbValue = $row['nombretarjeta'];
		$this->numerotarjeta->DbValue = $row['numerotarjeta'];
		$this->mes->DbValue = $row['mes'];
		$this->anio->DbValue = $row['anio'];
		$this->tipo_tarjeta->DbValue = $row['tipo_tarjeta'];
		$this->nombrepaypal->DbValue = $row['nombrepaypal'];
		$this->montopaypal->DbValue = $row['montopaypal'];
		$this->emailpaypal->DbValue = $row['emailpaypal'];
		$this->don->DbValue = $row['don'];
		$this->tipo_condicion->DbValue = $row['tipo_condicion'];
	}

	// Delete uploaded files
	public function deleteUploadedFiles($row)
	{
		$this->loadDbValues($row);
	}

	// Record filter WHERE clause
	protected function sqlKeyFilter()
	{
		return "";
	}

	// Get record filter
	public function getRecordFilter($row = NULL)
	{
		$keyFilter = $this->sqlKeyFilter();
		return $keyFilter;
	}

	// Return page URL
	public function getReturnUrl()
	{
		$name = PROJECT_NAME . "_" . $this->TableVar . "_" . Config("TABLE_RETURN_URL");

		// Get referer URL automatically
		if (ServerVar("HTTP_REFERER") != "" && ReferPageName() != CurrentPageName() && ReferPageName() != "login.php") // Referer not same page or login page
			$_SESSION[$name] = ServerVar("HTTP_REFERER"); // Save to Session
		if (@$_SESSION[$name] != "") {
			return $_SESSION[$name];
		} else {
			return "interestedlist.php";
		}
	}
	public function setReturnUrl($v)
	{
		$_SESSION[PROJECT_NAME . "_" . $this->TableVar . "_" . Config("TABLE_RETURN_URL")] = $v;
	}

	// Get modal caption
	public function getModalCaption($pageName)
	{
		global $Language;
		if ($pageName == "interestedview.php")
			return $Language->phrase("View");
		elseif ($pageName == "interestededit.php")
			return $Language->phrase("Edit");
		elseif ($pageName == "interestedadd.php")
			return $Language->phrase("Add");
		else
			return "";
	}

	// List URL
	public function getListUrl()
	{
		return "interestedlist.php";
	}

	// View URL
	public function getViewUrl($parm = "")
	{
		if ($parm != "")
			$url = $this->keyUrl("interestedview.php", $this->getUrlParm($parm));
		else
			$url = $this->keyUrl("interestedview.php", $this->getUrlParm(Config("TABLE_SHOW_DETAIL") . "="));
		return $this->addMasterUrl($url);
	}

	// Add URL
	public function getAddUrl($parm = "")
	{
		if ($parm != "")
			$url = "interestedadd.php?" . $this->getUrlParm($parm);
		else
			$url = "interestedadd.php";
		return $this->addMasterUrl($url);
	}

	// Edit URL
	public function getEditUrl($parm = "")
	{
		$url = $this->keyUrl("interestededit.php", $this->getUrlParm($parm));
		return $this->addMasterUrl($url);
	}

	// Inline edit URL
	public function getInlineEditUrl()
	{
		$url = $this->keyUrl(CurrentPageName(), $this->getUrlParm("action=edit"));
		return $this->addMasterUrl($url);
	}

	// Copy URL
	public function getCopyUrl($parm = "")
	{
		$url = $this->keyUrl("interestedadd.php", $this->getUrlParm($parm));
		return $this->addMasterUrl($url);
	}

	// Inline copy URL
	public function getInlineCopyUrl()
	{
		$url = $this->keyUrl(CurrentPageName(), $this->getUrlParm("action=copy"));
		return $this->addMasterUrl($url);
	}

	// Delete URL
	public function getDeleteUrl()
	{
		return $this->keyUrl("interesteddelete.php", $this->getUrlParm());
	}

	// Add master url
	public function addMasterUrl($url)
	{
		return $url;
	}
	public function keyToJson($htmlEncode = FALSE)
	{
		$json = "";
		$json = "{" . $json . "}";
		if ($htmlEncode)
			$json = HtmlEncode($json);
		return $json;
	}

	// Add key value to URL
	public function keyUrl($url, $parm = "")
	{
		$url = $url . "?";
		if ($parm != "")
			$url .= $parm . "&";
		return $url;
	}

	// Sort URL
	public function sortUrl(&$fld)
	{
		if ($this->CurrentAction || $this->isExport() ||
			in_array($fld->Type, [128, 204, 205])) { // Unsortable data type
				return "";
		} elseif ($fld->Sortable) {
			$urlParm = $this->getUrlParm("order=" . urlencode($fld->Name) . "&amp;ordertype=" . $fld->reverseSort());
			return $this->addMasterUrl(CurrentPageName() . "?" . $urlParm);
		} else {
			return "";
		}
	}

	// Get record keys from Post/Get/Session
	public function getRecordKeys()
	{
		$arKeys = [];
		$arKey = [];
		if (Param("key_m") !== NULL) {
			$arKeys = Param("key_m");
			$cnt = count($arKeys);
		} else {

			//return $arKeys; // Do not return yet, so the values will also be checked by the following code
		}

		// Check keys
		$ar = [];
		if (is_array($arKeys)) {
			foreach ($arKeys as $key) {
				$ar[] = $key;
			}
		}
		return $ar;
	}

	// Get filter from record keys
	public function getFilterFromRecordKeys($setCurrent = TRUE)
	{
		$arKeys = $this->getRecordKeys();
		$keyFilter = "";
		foreach ($arKeys as $key) {
			if ($keyFilter != "") $keyFilter .= " OR ";
			$keyFilter .= "(" . $this->getRecordFilter() . ")";
		}
		return $keyFilter;
	}

	// Load rows based on filter
	public function &loadRs($filter)
	{

		// Set up filter (WHERE Clause)
		$sql = $this->getSql($filter);
		$conn = $this->getConnection();
		$rs = $conn->execute($sql);
		return $rs;
	}

	// Load row values from recordset
	public function loadListRowValues(&$rs)
	{
		$this->id->setDbValue($rs->fields('id'));
		$this->fecha->setDbValue($rs->fields('fecha'));
		$this->_email->setDbValue($rs->fields('email'));
		$this->cursos->setDbValue($rs->fields('cursos'));
		$this->categorias->setDbValue($rs->fields('categorias'));
		$this->nombres->setDbValue($rs->fields('nombres'));
		$this->apellidos->setDbValue($rs->fields('apellidos'));
		$this->direccion->setDbValue($rs->fields('direccion'));
		$this->ciudad->setDbValue($rs->fields('ciudad'));
		$this->provincia->setDbValue($rs->fields('provincia'));
		$this->pais->setDbValue($rs->fields('pais'));
		$this->telefono->setDbValue($rs->fields('telefono'));
		$this->tipo_certificado->setDbValue($rs->fields('tipo_certificado'));
		$this->tipo_pago->setDbValue($rs->fields('tipo_pago'));
		$this->nombretarjeta->setDbValue($rs->fields('nombretarjeta'));
		$this->numerotarjeta->setDbValue($rs->fields('numerotarjeta'));
		$this->mes->setDbValue($rs->fields('mes'));
		$this->anio->setDbValue($rs->fields('anio'));
		$this->tipo_tarjeta->setDbValue($rs->fields('tipo_tarjeta'));
		$this->nombrepaypal->setDbValue($rs->fields('nombrepaypal'));
		$this->montopaypal->setDbValue($rs->fields('montopaypal'));
		$this->emailpaypal->setDbValue($rs->fields('emailpaypal'));
		$this->don->setDbValue($rs->fields('don'));
		$this->tipo_condicion->setDbValue($rs->fields('tipo_condicion'));
	}

	// Render list row values
	public function renderListRow()
	{
		global $Security, $CurrentLanguage, $Language;

		// Call Row Rendering event
		$this->Row_Rendering();

		// Common render codes
		// id
		// fecha
		// email
		// cursos
		// categorias
		// nombres
		// apellidos
		// direccion
		// ciudad
		// provincia
		// pais
		// telefono
		// tipo_certificado
		// tipo_pago
		// nombretarjeta
		// numerotarjeta
		// mes
		// anio
		// tipo_tarjeta
		// nombrepaypal
		// montopaypal
		// emailpaypal
		// don
		// tipo_condicion
		// id

		$this->id->ViewValue = $this->id->CurrentValue;
		$this->id->ViewValue = FormatNumber($this->id->ViewValue, 0, -2, -2, -2);
		$this->id->ViewCustomAttributes = "";

		// fecha
		$this->fecha->ViewValue = $this->fecha->CurrentValue;
		$this->fecha->ViewValue = FormatDateTime($this->fecha->ViewValue, 0);
		$this->fecha->ViewCustomAttributes = "";

		// email
		$this->_email->ViewValue = $this->_email->CurrentValue;
		$this->_email->ViewCustomAttributes = "";

		// cursos
		$this->cursos->ViewValue = $this->cursos->CurrentValue;
		$this->cursos->ViewValue = FormatNumber($this->cursos->ViewValue, 0, -2, -2, -2);
		$this->cursos->ViewCustomAttributes = "";

		// categorias
		$this->categorias->ViewValue = $this->categorias->CurrentValue;
		$this->categorias->ViewValue = FormatNumber($this->categorias->ViewValue, 0, -2, -2, -2);
		$this->categorias->ViewCustomAttributes = "";

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

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

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

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

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

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

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

		// tipo_certificado
		$this->tipo_certificado->ViewValue = $this->tipo_certificado->CurrentValue;
		$this->tipo_certificado->ViewValue = FormatNumber($this->tipo_certificado->ViewValue, 0, -2, -2, -2);
		$this->tipo_certificado->ViewCustomAttributes = "";

		// tipo_pago
		$this->tipo_pago->ViewValue = $this->tipo_pago->CurrentValue;
		$this->tipo_pago->ViewValue = FormatNumber($this->tipo_pago->ViewValue, 0, -2, -2, -2);
		$this->tipo_pago->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

		// tipo_condicion
		$this->tipo_condicion->ViewValue = $this->tipo_condicion->CurrentValue;
		$this->tipo_condicion->ViewValue = FormatNumber($this->tipo_condicion->ViewValue, 0, -2, -2, -2);
		$this->tipo_condicion->ViewCustomAttributes = "";

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

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

		// email
		$this->_email->LinkCustomAttributes = "";
		$this->_email->HrefValue = "";
		$this->_email->TooltipValue = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// Call Row Rendered event
		$this->Row_Rendered();

		// Save data for Custom Template
		$this->Rows[] = $this->customTemplateFieldValues();
	}

	// Render edit row values
	public function renderEditRow()
	{
		global $Security, $CurrentLanguage, $Language;

		// Call Row Rendering event
		$this->Row_Rendering();

		// id
		$this->id->EditAttrs["class"] = "form-control";
		$this->id->EditCustomAttributes = "";
		$this->id->EditValue = $this->id->CurrentValue;
		$this->id->PlaceHolder = RemoveHtml($this->id->caption());

		// fecha
		$this->fecha->EditAttrs["class"] = "form-control";
		$this->fecha->EditCustomAttributes = "";
		$this->fecha->EditValue = FormatDateTime($this->fecha->CurrentValue, 8);
		$this->fecha->PlaceHolder = RemoveHtml($this->fecha->caption());

		// email
		$this->_email->EditAttrs["class"] = "form-control";
		$this->_email->EditCustomAttributes = "";
		if (!$this->_email->Raw)
			$this->_email->CurrentValue = HtmlDecode($this->_email->CurrentValue);
		$this->_email->EditValue = $this->_email->CurrentValue;
		$this->_email->PlaceHolder = RemoveHtml($this->_email->caption());

		// cursos
		$this->cursos->EditAttrs["class"] = "form-control";
		$this->cursos->EditCustomAttributes = "";
		$this->cursos->EditValue = $this->cursos->CurrentValue;
		$this->cursos->PlaceHolder = RemoveHtml($this->cursos->caption());

		// categorias
		$this->categorias->EditAttrs["class"] = "form-control";
		$this->categorias->EditCustomAttributes = "";
		$this->categorias->EditValue = $this->categorias->CurrentValue;
		$this->categorias->PlaceHolder = RemoveHtml($this->categorias->caption());

		// nombres
		$this->nombres->EditAttrs["class"] = "form-control";
		$this->nombres->EditCustomAttributes = "";
		if (!$this->nombres->Raw)
			$this->nombres->CurrentValue = HtmlDecode($this->nombres->CurrentValue);
		$this->nombres->EditValue = $this->nombres->CurrentValue;
		$this->nombres->PlaceHolder = RemoveHtml($this->nombres->caption());

		// apellidos
		$this->apellidos->EditAttrs["class"] = "form-control";
		$this->apellidos->EditCustomAttributes = "";
		if (!$this->apellidos->Raw)
			$this->apellidos->CurrentValue = HtmlDecode($this->apellidos->CurrentValue);
		$this->apellidos->EditValue = $this->apellidos->CurrentValue;
		$this->apellidos->PlaceHolder = RemoveHtml($this->apellidos->caption());

		// direccion
		$this->direccion->EditAttrs["class"] = "form-control";
		$this->direccion->EditCustomAttributes = "";
		if (!$this->direccion->Raw)
			$this->direccion->CurrentValue = HtmlDecode($this->direccion->CurrentValue);
		$this->direccion->EditValue = $this->direccion->CurrentValue;
		$this->direccion->PlaceHolder = RemoveHtml($this->direccion->caption());

		// ciudad
		$this->ciudad->EditAttrs["class"] = "form-control";
		$this->ciudad->EditCustomAttributes = "";
		if (!$this->ciudad->Raw)
			$this->ciudad->CurrentValue = HtmlDecode($this->ciudad->CurrentValue);
		$this->ciudad->EditValue = $this->ciudad->CurrentValue;
		$this->ciudad->PlaceHolder = RemoveHtml($this->ciudad->caption());

		// provincia
		$this->provincia->EditAttrs["class"] = "form-control";
		$this->provincia->EditCustomAttributes = "";
		if (!$this->provincia->Raw)
			$this->provincia->CurrentValue = HtmlDecode($this->provincia->CurrentValue);
		$this->provincia->EditValue = $this->provincia->CurrentValue;
		$this->provincia->PlaceHolder = RemoveHtml($this->provincia->caption());

		// pais
		$this->pais->EditAttrs["class"] = "form-control";
		$this->pais->EditCustomAttributes = "";
		if (!$this->pais->Raw)
			$this->pais->CurrentValue = HtmlDecode($this->pais->CurrentValue);
		$this->pais->EditValue = $this->pais->CurrentValue;
		$this->pais->PlaceHolder = RemoveHtml($this->pais->caption());

		// telefono
		$this->telefono->EditAttrs["class"] = "form-control";
		$this->telefono->EditCustomAttributes = "";
		if (!$this->telefono->Raw)
			$this->telefono->CurrentValue = HtmlDecode($this->telefono->CurrentValue);
		$this->telefono->EditValue = $this->telefono->CurrentValue;
		$this->telefono->PlaceHolder = RemoveHtml($this->telefono->caption());

		// tipo_certificado
		$this->tipo_certificado->EditAttrs["class"] = "form-control";
		$this->tipo_certificado->EditCustomAttributes = "";
		$this->tipo_certificado->EditValue = $this->tipo_certificado->CurrentValue;
		$this->tipo_certificado->PlaceHolder = RemoveHtml($this->tipo_certificado->caption());

		// tipo_pago
		$this->tipo_pago->EditAttrs["class"] = "form-control";
		$this->tipo_pago->EditCustomAttributes = "";
		$this->tipo_pago->EditValue = $this->tipo_pago->CurrentValue;
		$this->tipo_pago->PlaceHolder = RemoveHtml($this->tipo_pago->caption());

		// nombretarjeta
		$this->nombretarjeta->EditAttrs["class"] = "form-control";
		$this->nombretarjeta->EditCustomAttributes = "";
		if (!$this->nombretarjeta->Raw)
			$this->nombretarjeta->CurrentValue = HtmlDecode($this->nombretarjeta->CurrentValue);
		$this->nombretarjeta->EditValue = $this->nombretarjeta->CurrentValue;
		$this->nombretarjeta->PlaceHolder = RemoveHtml($this->nombretarjeta->caption());

		// numerotarjeta
		$this->numerotarjeta->EditAttrs["class"] = "form-control";
		$this->numerotarjeta->EditCustomAttributes = "";
		if (!$this->numerotarjeta->Raw)
			$this->numerotarjeta->CurrentValue = HtmlDecode($this->numerotarjeta->CurrentValue);
		$this->numerotarjeta->EditValue = $this->numerotarjeta->CurrentValue;
		$this->numerotarjeta->PlaceHolder = RemoveHtml($this->numerotarjeta->caption());

		// mes
		$this->mes->EditAttrs["class"] = "form-control";
		$this->mes->EditCustomAttributes = "";
		if (!$this->mes->Raw)
			$this->mes->CurrentValue = HtmlDecode($this->mes->CurrentValue);
		$this->mes->EditValue = $this->mes->CurrentValue;
		$this->mes->PlaceHolder = RemoveHtml($this->mes->caption());

		// anio
		$this->anio->EditAttrs["class"] = "form-control";
		$this->anio->EditCustomAttributes = "";
		if (!$this->anio->Raw)
			$this->anio->CurrentValue = HtmlDecode($this->anio->CurrentValue);
		$this->anio->EditValue = $this->anio->CurrentValue;
		$this->anio->PlaceHolder = RemoveHtml($this->anio->caption());

		// tipo_tarjeta
		$this->tipo_tarjeta->EditAttrs["class"] = "form-control";
		$this->tipo_tarjeta->EditCustomAttributes = "";
		if (!$this->tipo_tarjeta->Raw)
			$this->tipo_tarjeta->CurrentValue = HtmlDecode($this->tipo_tarjeta->CurrentValue);
		$this->tipo_tarjeta->EditValue = $this->tipo_tarjeta->CurrentValue;
		$this->tipo_tarjeta->PlaceHolder = RemoveHtml($this->tipo_tarjeta->caption());

		// nombrepaypal
		$this->nombrepaypal->EditAttrs["class"] = "form-control";
		$this->nombrepaypal->EditCustomAttributes = "";
		if (!$this->nombrepaypal->Raw)
			$this->nombrepaypal->CurrentValue = HtmlDecode($this->nombrepaypal->CurrentValue);
		$this->nombrepaypal->EditValue = $this->nombrepaypal->CurrentValue;
		$this->nombrepaypal->PlaceHolder = RemoveHtml($this->nombrepaypal->caption());

		// montopaypal
		$this->montopaypal->EditAttrs["class"] = "form-control";
		$this->montopaypal->EditCustomAttributes = "";
		if (!$this->montopaypal->Raw)
			$this->montopaypal->CurrentValue = HtmlDecode($this->montopaypal->CurrentValue);
		$this->montopaypal->EditValue = $this->montopaypal->CurrentValue;
		$this->montopaypal->PlaceHolder = RemoveHtml($this->montopaypal->caption());

		// emailpaypal
		$this->emailpaypal->EditAttrs["class"] = "form-control";
		$this->emailpaypal->EditCustomAttributes = "";
		if (!$this->emailpaypal->Raw)
			$this->emailpaypal->CurrentValue = HtmlDecode($this->emailpaypal->CurrentValue);
		$this->emailpaypal->EditValue = $this->emailpaypal->CurrentValue;
		$this->emailpaypal->PlaceHolder = RemoveHtml($this->emailpaypal->caption());

		// don
		$this->don->EditAttrs["class"] = "form-control";
		$this->don->EditCustomAttributes = "";
		if (!$this->don->Raw)
			$this->don->CurrentValue = HtmlDecode($this->don->CurrentValue);
		$this->don->EditValue = $this->don->CurrentValue;
		$this->don->PlaceHolder = RemoveHtml($this->don->caption());

		// tipo_condicion
		$this->tipo_condicion->EditAttrs["class"] = "form-control";
		$this->tipo_condicion->EditCustomAttributes = "";
		$this->tipo_condicion->EditValue = $this->tipo_condicion->CurrentValue;
		$this->tipo_condicion->PlaceHolder = RemoveHtml($this->tipo_condicion->caption());

		// Call Row Rendered event
		$this->Row_Rendered();
	}

	// Aggregate list row values
	public function aggregateListRowValues()
	{
	}

	// Aggregate list row (for rendering)
	public function aggregateListRow()
	{

		// Call Row Rendered event
		$this->Row_Rendered();
	}

	// Export data in HTML/CSV/Word/Excel/Email/PDF format
	public function exportDocument($doc, $recordset, $startRec = 1, $stopRec = 1, $exportPageType = "")
	{
		if (!$recordset || !$doc)
			return;
		if (!$doc->ExportCustom) {

			// Write header
			$doc->exportTableHeader();
			if ($doc->Horizontal) { // Horizontal format, write header
				$doc->beginExportRow();
				if ($exportPageType == "view") {
					$doc->exportCaption($this->id);
					$doc->exportCaption($this->fecha);
					$doc->exportCaption($this->_email);
					$doc->exportCaption($this->cursos);
					$doc->exportCaption($this->categorias);
					$doc->exportCaption($this->nombres);
					$doc->exportCaption($this->apellidos);
					$doc->exportCaption($this->direccion);
					$doc->exportCaption($this->ciudad);
					$doc->exportCaption($this->provincia);
					$doc->exportCaption($this->pais);
					$doc->exportCaption($this->telefono);
					$doc->exportCaption($this->tipo_certificado);
					$doc->exportCaption($this->tipo_pago);
					$doc->exportCaption($this->nombretarjeta);
					$doc->exportCaption($this->numerotarjeta);
					$doc->exportCaption($this->mes);
					$doc->exportCaption($this->anio);
					$doc->exportCaption($this->tipo_tarjeta);
					$doc->exportCaption($this->nombrepaypal);
					$doc->exportCaption($this->montopaypal);
					$doc->exportCaption($this->emailpaypal);
					$doc->exportCaption($this->don);
					$doc->exportCaption($this->tipo_condicion);
				} else {
					$doc->exportCaption($this->id);
					$doc->exportCaption($this->fecha);
					$doc->exportCaption($this->_email);
					$doc->exportCaption($this->cursos);
					$doc->exportCaption($this->categorias);
					$doc->exportCaption($this->nombres);
					$doc->exportCaption($this->apellidos);
					$doc->exportCaption($this->direccion);
					$doc->exportCaption($this->ciudad);
					$doc->exportCaption($this->provincia);
					$doc->exportCaption($this->pais);
					$doc->exportCaption($this->telefono);
					$doc->exportCaption($this->tipo_certificado);
					$doc->exportCaption($this->tipo_pago);
					$doc->exportCaption($this->nombretarjeta);
					$doc->exportCaption($this->numerotarjeta);
					$doc->exportCaption($this->mes);
					$doc->exportCaption($this->anio);
					$doc->exportCaption($this->tipo_tarjeta);
					$doc->exportCaption($this->nombrepaypal);
					$doc->exportCaption($this->montopaypal);
					$doc->exportCaption($this->emailpaypal);
					$doc->exportCaption($this->don);
					$doc->exportCaption($this->tipo_condicion);
				}
				$doc->endExportRow();
			}
		}

		// Move to first record
		$recCnt = $startRec - 1;
		if (!$recordset->EOF) {
			$recordset->moveFirst();
			if ($startRec > 1)
				$recordset->move($startRec - 1);
		}
		while (!$recordset->EOF && $recCnt < $stopRec) {
			$recCnt++;
			if ($recCnt >= $startRec) {
				$rowCnt = $recCnt - $startRec + 1;

				// Page break
				if ($this->ExportPageBreakCount > 0) {
					if ($rowCnt > 1 && ($rowCnt - 1) % $this->ExportPageBreakCount == 0)
						$doc->exportPageBreak();
				}
				$this->loadListRowValues($recordset);

				// Render row
				$this->RowType = ROWTYPE_VIEW; // Render view
				$this->resetAttributes();
				$this->renderListRow();
				if (!$doc->ExportCustom) {
					$doc->beginExportRow($rowCnt); // Allow CSS styles if enabled
					if ($exportPageType == "view") {
						$doc->exportField($this->id);
						$doc->exportField($this->fecha);
						$doc->exportField($this->_email);
						$doc->exportField($this->cursos);
						$doc->exportField($this->categorias);
						$doc->exportField($this->nombres);
						$doc->exportField($this->apellidos);
						$doc->exportField($this->direccion);
						$doc->exportField($this->ciudad);
						$doc->exportField($this->provincia);
						$doc->exportField($this->pais);
						$doc->exportField($this->telefono);
						$doc->exportField($this->tipo_certificado);
						$doc->exportField($this->tipo_pago);
						$doc->exportField($this->nombretarjeta);
						$doc->exportField($this->numerotarjeta);
						$doc->exportField($this->mes);
						$doc->exportField($this->anio);
						$doc->exportField($this->tipo_tarjeta);
						$doc->exportField($this->nombrepaypal);
						$doc->exportField($this->montopaypal);
						$doc->exportField($this->emailpaypal);
						$doc->exportField($this->don);
						$doc->exportField($this->tipo_condicion);
					} else {
						$doc->exportField($this->id);
						$doc->exportField($this->fecha);
						$doc->exportField($this->_email);
						$doc->exportField($this->cursos);
						$doc->exportField($this->categorias);
						$doc->exportField($this->nombres);
						$doc->exportField($this->apellidos);
						$doc->exportField($this->direccion);
						$doc->exportField($this->ciudad);
						$doc->exportField($this->provincia);
						$doc->exportField($this->pais);
						$doc->exportField($this->telefono);
						$doc->exportField($this->tipo_certificado);
						$doc->exportField($this->tipo_pago);
						$doc->exportField($this->nombretarjeta);
						$doc->exportField($this->numerotarjeta);
						$doc->exportField($this->mes);
						$doc->exportField($this->anio);
						$doc->exportField($this->tipo_tarjeta);
						$doc->exportField($this->nombrepaypal);
						$doc->exportField($this->montopaypal);
						$doc->exportField($this->emailpaypal);
						$doc->exportField($this->don);
						$doc->exportField($this->tipo_condicion);
					}
					$doc->endExportRow($rowCnt);
				}
			}

			// Call Row Export server event
			if ($doc->ExportCustom)
				$this->Row_Export($recordset->fields);
			$recordset->moveNext();
		}
		if (!$doc->ExportCustom) {
			$doc->exportTableFooter();
		}
	}

	// Get file data
	public function getFileData($fldparm, $key, $resize, $width = 0, $height = 0)
	{

		// No binary fields
		return FALSE;
	}

	// Table level events
	// Recordset Selecting event
	function Recordset_Selecting(&$filter) {

		// Enter your code here
	}

	// Recordset Selected event
	function Recordset_Selected(&$rs) {

		//echo "Recordset Selected";
	}

	// Recordset Search Validated event
	function Recordset_SearchValidated() {

		// Example:
		//$this->MyField1->AdvancedSearch->SearchValue = "your search criteria"; // Search value

	}

	// Recordset Searching event
	function Recordset_Searching(&$filter) {

		// Enter your code here
	}

	// Row_Selecting event
	function Row_Selecting(&$filter) {

		// Enter your code here
	}

	// Row Selected event
	function Row_Selected(&$rs) {

		//echo "Row Selected";
	}

	// Row Inserting event
	function Row_Inserting($rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to FALSE

		return TRUE;
	}

	// Row Inserted event
	function Row_Inserted($rsold, &$rsnew) {

		//echo "Row Inserted"
	}

	// Row Updating event
	function Row_Updating($rsold, &$rsnew) {

		// Enter your code here
		// To cancel, set return value to FALSE

		return TRUE;
	}

	// Row Updated event
	function Row_Updated($rsold, &$rsnew) {

		//echo "Row Updated";
	}

	// Row Update Conflict event
	function Row_UpdateConflict($rsold, &$rsnew) {

		// Enter your code here
		// To ignore conflict, set return value to FALSE

		return TRUE;
	}

	// Grid Inserting event
	function Grid_Inserting() {

		// Enter your code here
		// To reject grid insert, set return value to FALSE

		return TRUE;
	}

	// Grid Inserted event
	function Grid_Inserted($rsnew) {

		//echo "Grid Inserted";
	}

	// Grid Updating event
	function Grid_Updating($rsold) {

		// Enter your code here
		// To reject grid update, set return value to FALSE

		return TRUE;
	}

	// Grid Updated event
	function Grid_Updated($rsold, $rsnew) {

		//echo "Grid Updated";
	}

	// Row Deleting event
	function Row_Deleting(&$rs) {

		// Enter your code here
		// To cancel, set return value to False

		return TRUE;
	}

	// Row Deleted event
	function Row_Deleted(&$rs) {

		//echo "Row Deleted";
	}

	// Email Sending event
	function Email_Sending($email, &$args) {

		//var_dump($email); var_dump($args); exit();
		return TRUE;
	}

	// Lookup Selecting event
	function Lookup_Selecting($fld, &$filter) {

		//var_dump($fld->Name, $fld->Lookup, $filter); // Uncomment to view the filter
		// Enter your code here

	}

	// Row Rendering event
	function Row_Rendering() {

		// Enter your code here
	}

	// Row Rendered event
	function Row_Rendered() {

		// To view properties of field class, use:
		//var_dump($this-><FieldName>);

	}

	// User ID Filtering event
	function UserID_Filtering(&$filter) {

		// Enter your code here
	}
}
?>