Heray-Was-Here
Server : Apache
System : Linux hybrid3195.ca.ns.planethoster.net 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
User : alliancerealtynb ( 1004)
PHP Version : 7.4.33
Disable Function : noop
Directory :  /home/alliancerealtynb/avantmaj.alliancerealty.nb.ca/adminAR/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alliancerealtynb/avantmaj.alliancerealty.nb.ca/adminAR/classes/wp_wpl_addon_crm_contacts.php
<?php namespace PHPMaker2020\Alliance; ?>
<?php

/**
 * Table class for wp_wpl_addon_crm_contacts
 */
class wp_wpl_addon_crm_contacts 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 $user_id;
	public $last_name;
	public $first_name;
	public $field_3091;
	public $field_3090;
	public $owner;
	public $type;
	public $_private;
	public $title;
	public $gender;
	public $marital;
	public $email1;
	public $tel;
	public $birthday;
	public $mobile;
	public $field_3088;
	public $field_3187;
	public $field_3188;
	public $location1_id;
	public $location2_id;
	public $location3_id;
	public $location4_id;
	public $location5_id;
	public $location6_id;
	public $location7_id;
	public $location1_name;
	public $location2_name;
	public $location3_name;
	public $location4_name;
	public $location5_name;
	public $location6_name;
	public $location7_name;
	public $zip_id;
	public $zip_name;
	public $rating;
	public $group;
	public $logins;
	public $saved_searches;
	public $listings_viewed;
	public $last_login_date;
	public $f_3011_options;
	public $f_3011;
	public $field_3004_en_us;
	public $field_3004_fr_fr;
	public $field_3092;
	public $field_3093;
	public $field_3183;
	public $field_3184;
	public $field_3186;
	public $field_3185;
	public $field_3087;
	public $date_added;
	public $archive;

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

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

		// Update Table
		$this->UpdateTable = "`wp_wpl_addon_crm_contacts`";
		$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 = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::ORIENTATION_DEFAULT; // Page orientation (PhpSpreadsheet only)
		$this->ExportExcelPageSize = \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::PAPERSIZE_A4; // 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 = Config("DEFAULT_USER_ID_ALLOW_SECURITY"); // Default User ID allowed permissions
		$this->BasicSearch = new BasicSearch($this->TableVar);
		$this->BasicSearch->TypeDefault = "OR";

		// id
		$this->id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_id', 'id', '`id`', '`id`', 3, 11, -1, FALSE, '`id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'NO');
		$this->id->IsAutoIncrement = TRUE; // Autoincrement field
		$this->id->IsPrimaryKey = TRUE; // Primary key field
		$this->id->Sortable = TRUE; // Allow sort
		$this->id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['id'] = &$this->id;

		// user_id
		$this->user_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_user_id', 'user_id', '`user_id`', '`user_id`', 3, 11, -1, FALSE, '`user_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->user_id->Nullable = FALSE; // NOT NULL field
		$this->user_id->Required = TRUE; // Required field
		$this->user_id->Sortable = TRUE; // Allow sort
		$this->user_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['user_id'] = &$this->user_id;

		// last_name
		$this->last_name = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_last_name', 'last_name', '`last_name`', '`last_name`', 200, 100, -1, FALSE, '`last_name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->last_name->Sortable = TRUE; // Allow sort
		$this->last_name->Lookup = new Lookup('last_name', 'wp_wpl_addon_crm_contacts', TRUE, 'last_name', ["last_name","","",""], [], [], [], [], [], [], '`last_name` ASC', '');
		$this->fields['last_name'] = &$this->last_name;

		// first_name
		$this->first_name = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_first_name', 'first_name', '`first_name`', '`first_name`', 200, 100, -1, FALSE, '`first_name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->first_name->Sortable = TRUE; // Allow sort
		$this->first_name->Lookup = new Lookup('first_name', 'wp_wpl_addon_crm_contacts', TRUE, 'first_name', ["first_name","","",""], [], [], [], [], [], [], '`first_name` ASC', '');
		$this->fields['first_name'] = &$this->first_name;

		// field_3091
		$this->field_3091 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3091', 'field_3091', '`field_3091`', '`field_3091`', 200, 50, -1, FALSE, '`field_3091`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3091->Sortable = TRUE; // Allow sort
		$this->field_3091->Lookup = new Lookup('field_3091', 'wp_wpl_addon_crm_contacts', TRUE, 'field_3091', ["field_3091","","",""], [], [], [], [], [], [], '`field_3091` ASC', '');
		$this->fields['field_3091'] = &$this->field_3091;

		// field_3090
		$this->field_3090 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3090', 'field_3090', '`field_3090`', '`field_3090`', 200, 50, -1, FALSE, '`field_3090`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3090->Sortable = TRUE; // Allow sort
		$this->field_3090->Lookup = new Lookup('field_3090', 'wp_wpl_addon_crm_contacts', TRUE, 'field_3090', ["field_3090","","",""], [], [], [], [], [], [], '`field_3090` ASC', '');
		$this->fields['field_3090'] = &$this->field_3090;

		// owner
		$this->owner = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_owner', 'owner', '`owner`', '`owner`', 3, 11, -1, FALSE, '`owner`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO');
		$this->owner->Nullable = FALSE; // NOT NULL field
		$this->owner->Required = TRUE; // Required field
		$this->owner->Sortable = TRUE; // Allow sort
		$this->owner->Lookup = new Lookup('owner', 'wp_wpl_addon_crm_contacts', FALSE, '', ["","","",""], [], [], [], [], [], [], '', '');
		$this->owner->OptionCount = 3;
		$this->owner->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['owner'] = &$this->owner;

		// type
		$this->type = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_type', 'type', '`type`', '`type`', 201, 65535, -1, FALSE, '`type`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO');
		$this->type->Sortable = TRUE; // Allow sort
		$this->type->Lookup = new Lookup('type', 'wp_wpl_addon_crm_contacts', FALSE, '', ["","","",""], [], [], [], [], [], [], '', '');
		$this->type->OptionCount = 4;
		$this->fields['type'] = &$this->type;

		// private
		$this->_private = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x__private', 'private', '`private`', '`private`', 16, 1, -1, FALSE, '`private`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'CHECKBOX');
		$this->_private->Nullable = FALSE; // NOT NULL field
		$this->_private->Required = TRUE; // Required field
		$this->_private->Sortable = TRUE; // Allow sort
		$this->_private->DataType = DATATYPE_BOOLEAN;
		$this->_private->Lookup = new Lookup('private', 'wp_wpl_addon_crm_contacts', FALSE, '', ["","","",""], [], [], [], [], [], [], '', '');
		$this->_private->OptionCount = 2;
		$this->_private->DefaultErrorMessage = $Language->phrase("IncorrectField");
		$this->fields['private'] = &$this->_private;

		// title
		$this->title = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_title', 'title', '`title`', '`title`', 16, 2, -1, FALSE, '`title`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->title->Nullable = FALSE; // NOT NULL field
		$this->title->Required = TRUE; // Required field
		$this->title->Sortable = TRUE; // Allow sort
		$this->title->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['title'] = &$this->title;

		// gender
		$this->gender = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_gender', 'gender', '`gender`', '`gender`', 16, 2, -1, FALSE, '`gender`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->gender->Nullable = FALSE; // NOT NULL field
		$this->gender->Required = TRUE; // Required field
		$this->gender->Sortable = TRUE; // Allow sort
		$this->gender->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['gender'] = &$this->gender;

		// marital
		$this->marital = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_marital', 'marital', '`marital`', '`marital`', 16, 2, -1, FALSE, '`marital`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->marital->Nullable = FALSE; // NOT NULL field
		$this->marital->Required = TRUE; // Required field
		$this->marital->Sortable = TRUE; // Allow sort
		$this->marital->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['marital'] = &$this->marital;

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

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

		// birthday
		$this->birthday = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_birthday', 'birthday', '`birthday`', CastDateFieldForLike("`birthday`", 0, "DB"), 133, 10, 0, FALSE, '`birthday`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->birthday->Sortable = TRUE; // Allow sort
		$this->birthday->DefaultErrorMessage = str_replace("%s", $GLOBALS["DATE_FORMAT"], $Language->phrase("IncorrectDate"));
		$this->fields['birthday'] = &$this->birthday;

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

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

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

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

		// location1_id
		$this->location1_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location1_id', 'location1_id', '`location1_id`', '`location1_id`', 3, 11, -1, FALSE, '`location1_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location1_id->Nullable = FALSE; // NOT NULL field
		$this->location1_id->Required = TRUE; // Required field
		$this->location1_id->Sortable = TRUE; // Allow sort
		$this->location1_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location1_id'] = &$this->location1_id;

		// location2_id
		$this->location2_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location2_id', 'location2_id', '`location2_id`', '`location2_id`', 3, 11, -1, FALSE, '`location2_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location2_id->Nullable = FALSE; // NOT NULL field
		$this->location2_id->Required = TRUE; // Required field
		$this->location2_id->Sortable = FALSE; // Allow sort
		$this->location2_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location2_id'] = &$this->location2_id;

		// location3_id
		$this->location3_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location3_id', 'location3_id', '`location3_id`', '`location3_id`', 3, 11, -1, FALSE, '`location3_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location3_id->Nullable = FALSE; // NOT NULL field
		$this->location3_id->Required = TRUE; // Required field
		$this->location3_id->Sortable = TRUE; // Allow sort
		$this->location3_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location3_id'] = &$this->location3_id;

		// location4_id
		$this->location4_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location4_id', 'location4_id', '`location4_id`', '`location4_id`', 3, 11, -1, FALSE, '`location4_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location4_id->Nullable = FALSE; // NOT NULL field
		$this->location4_id->Required = TRUE; // Required field
		$this->location4_id->Sortable = TRUE; // Allow sort
		$this->location4_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location4_id'] = &$this->location4_id;

		// location5_id
		$this->location5_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location5_id', 'location5_id', '`location5_id`', '`location5_id`', 3, 11, -1, FALSE, '`location5_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location5_id->Nullable = FALSE; // NOT NULL field
		$this->location5_id->Required = TRUE; // Required field
		$this->location5_id->Sortable = TRUE; // Allow sort
		$this->location5_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location5_id'] = &$this->location5_id;

		// location6_id
		$this->location6_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location6_id', 'location6_id', '`location6_id`', '`location6_id`', 3, 11, -1, FALSE, '`location6_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location6_id->Nullable = FALSE; // NOT NULL field
		$this->location6_id->Required = TRUE; // Required field
		$this->location6_id->Sortable = TRUE; // Allow sort
		$this->location6_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location6_id'] = &$this->location6_id;

		// location7_id
		$this->location7_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location7_id', 'location7_id', '`location7_id`', '`location7_id`', 3, 11, -1, FALSE, '`location7_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location7_id->Nullable = FALSE; // NOT NULL field
		$this->location7_id->Required = TRUE; // Required field
		$this->location7_id->Sortable = TRUE; // Allow sort
		$this->location7_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['location7_id'] = &$this->location7_id;

		// location1_name
		$this->location1_name = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_location1_name', 'location1_name', '`location1_name`', '`location1_name`', 200, 50, -1, FALSE, '`location1_name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->location1_name->Sortable = FALSE; // Allow sort
		$this->fields['location1_name'] = &$this->location1_name;

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

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

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

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

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

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

		// zip_id
		$this->zip_id = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_zip_id', 'zip_id', '`zip_id`', '`zip_id`', 3, 11, -1, FALSE, '`zip_id`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->zip_id->Nullable = FALSE; // NOT NULL field
		$this->zip_id->Required = TRUE; // Required field
		$this->zip_id->Sortable = TRUE; // Allow sort
		$this->zip_id->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['zip_id'] = &$this->zip_id;

		// zip_name
		$this->zip_name = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_zip_name', 'zip_name', '`zip_name`', '`zip_name`', 200, 20, -1, FALSE, '`zip_name`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->zip_name->Sortable = FALSE; // Allow sort
		$this->fields['zip_name'] = &$this->zip_name;

		// rating
		$this->rating = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_rating', 'rating', '`rating`', '`rating`', 16, 2, -1, FALSE, '`rating`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->rating->Nullable = FALSE; // NOT NULL field
		$this->rating->Required = TRUE; // Required field
		$this->rating->Sortable = TRUE; // Allow sort
		$this->rating->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['rating'] = &$this->rating;

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

		// logins
		$this->logins = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_logins', 'logins', '`logins`', '`logins`', 3, 11, -1, FALSE, '`logins`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->logins->Nullable = FALSE; // NOT NULL field
		$this->logins->Required = TRUE; // Required field
		$this->logins->Sortable = TRUE; // Allow sort
		$this->logins->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['logins'] = &$this->logins;

		// saved_searches
		$this->saved_searches = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_saved_searches', 'saved_searches', '`saved_searches`', '`saved_searches`', 3, 11, -1, FALSE, '`saved_searches`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->saved_searches->Nullable = FALSE; // NOT NULL field
		$this->saved_searches->Required = TRUE; // Required field
		$this->saved_searches->Sortable = TRUE; // Allow sort
		$this->saved_searches->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['saved_searches'] = &$this->saved_searches;

		// listings_viewed
		$this->listings_viewed = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_listings_viewed', 'listings_viewed', '`listings_viewed`', '`listings_viewed`', 3, 11, -1, FALSE, '`listings_viewed`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->listings_viewed->Nullable = FALSE; // NOT NULL field
		$this->listings_viewed->Required = TRUE; // Required field
		$this->listings_viewed->Sortable = TRUE; // Allow sort
		$this->listings_viewed->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['listings_viewed'] = &$this->listings_viewed;

		// last_login_date
		$this->last_login_date = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_last_login_date', 'last_login_date', '`last_login_date`', CastDateFieldForLike("`last_login_date`", 0, "DB"), 135, 19, 0, FALSE, '`last_login_date`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->last_login_date->Sortable = TRUE; // Allow sort
		$this->last_login_date->DefaultErrorMessage = str_replace("%s", $GLOBALS["DATE_FORMAT"], $Language->phrase("IncorrectDate"));
		$this->fields['last_login_date'] = &$this->last_login_date;

		// f_3011_options
		$this->f_3011_options = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_f_3011_options', 'f_3011_options', '`f_3011_options`', '`f_3011_options`', 201, 65535, -1, FALSE, '`f_3011_options`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXTAREA');
		$this->f_3011_options->Sortable = TRUE; // Allow sort
		$this->fields['f_3011_options'] = &$this->f_3011_options;

		// f_3011
		$this->f_3011 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_f_3011', 'f_3011', '`f_3011`', '`f_3011`', 16, 4, -1, FALSE, '`f_3011`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->f_3011->Sortable = TRUE; // Allow sort
		$this->f_3011->DefaultErrorMessage = $Language->phrase("IncorrectInteger");
		$this->fields['f_3011'] = &$this->f_3011;

		// field_3004_en_us
		$this->field_3004_en_us = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3004_en_us', 'field_3004_en_us', '`field_3004_en_us`', '`field_3004_en_us`', 200, 255, -1, FALSE, '`field_3004_en_us`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3004_en_us->Sortable = TRUE; // Allow sort
		$this->fields['field_3004_en_us'] = &$this->field_3004_en_us;

		// field_3004_fr_fr
		$this->field_3004_fr_fr = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3004_fr_fr', 'field_3004_fr_fr', '`field_3004_fr_fr`', '`field_3004_fr_fr`', 200, 255, -1, FALSE, '`field_3004_fr_fr`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3004_fr_fr->Sortable = TRUE; // Allow sort
		$this->fields['field_3004_fr_fr'] = &$this->field_3004_fr_fr;

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

		// field_3093
		$this->field_3093 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3093', 'field_3093', '`field_3093`', CastDateFieldForLike("`field_3093`", 0, "DB"), 133, 10, 0, FALSE, '`field_3093`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3093->Sortable = TRUE; // Allow sort
		$this->field_3093->DefaultErrorMessage = str_replace("%s", $GLOBALS["DATE_FORMAT"], $Language->phrase("IncorrectDate"));
		$this->fields['field_3093'] = &$this->field_3093;

		// field_3183
		$this->field_3183 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3183', 'field_3183', '`field_3183`', '`field_3183`', 200, 50, -1, FALSE, '`field_3183`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->field_3183->Sortable = TRUE; // Allow sort
		$this->field_3183->Lookup = new Lookup('field_3183', 'wp_wpl_addon_crm_contacts', TRUE, 'field_3183', ["field_3183","","",""], [], [], [], [], [], [], '`field_3183` ASC', '');
		$this->fields['field_3183'] = &$this->field_3183;

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

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

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

		// field_3087
		$this->field_3087 = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_field_3087', 'field_3087', '`field_3087`', '`field_3087`', 201, 65535, -1, FALSE, '`field_3087`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXTAREA');
		$this->field_3087->Sortable = TRUE; // Allow sort
		$this->fields['field_3087'] = &$this->field_3087;

		// date_added
		$this->date_added = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_date_added', 'date_added', '`date_added`', CastDateFieldForLike("`date_added`", 9, "DB"), 135, 19, 9, FALSE, '`date_added`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'TEXT');
		$this->date_added->Sortable = TRUE; // Allow sort
		$this->date_added->DefaultErrorMessage = str_replace("%s", $GLOBALS["DATE_SEPARATOR"], $Language->phrase("IncorrectDateYMD"));
		$this->fields['date_added'] = &$this->date_added;

		// archive
		$this->archive = new DbField('wp_wpl_addon_crm_contacts', 'wp_wpl_addon_crm_contacts', 'x_archive', 'archive', '`archive`', '`archive`', 16, 1, -1, FALSE, '`archive`', FALSE, FALSE, FALSE, 'FORMATTED TEXT', 'RADIO');
		$this->archive->Nullable = FALSE; // NOT NULL field
		$this->archive->Sortable = TRUE; // Allow sort
		$this->archive->Lookup = new Lookup('archive', 'wp_wpl_addon_crm_contacts', FALSE, '', ["","","",""], [], [], [], [], [], [], '', '');
		$this->archive->OptionCount = 2;
		$this->archive->DefaultErrorMessage = $Language->phrase("IncorrectField");
		$this->archive->AdvancedSearch->SearchValueDefault = 0;
		$this->archive->AdvancedSearch->SearchOperatorDefault = "=";
		$this->archive->AdvancedSearch->SearchOperatorDefault2 = "";
		$this->archive->AdvancedSearch->SearchConditionDefault = "AND";
		$this->fields['archive'] = &$this->archive;
	}

	// 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-*
		}
	}

	// Multiple column sort
	public function updateSort(&$fld, $ctrl)
	{
		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);
			if ($ctrl) {
				$orderBy = $this->getSessionOrderBy();
				if (ContainsString($orderBy, $sortField . " " . $lastSort)) {
					$orderBy = str_replace($sortField . " " . $lastSort, $sortField . " " . $thisSort, $orderBy);
				} else {
					if ($orderBy != "")
						$orderBy .= ", ";
					$orderBy .= $sortField . " " . $thisSort;
				}
				$this->setSessionOrderBy($orderBy); // Save to Session
			} else {
				$this->setSessionOrderBy($sortField . " " . $thisSort); // Save to Session
			}
		} else {
			if (!$ctrl)
				$fld->setSort("");
		}
	}

	// Table level SQL
	public function getSqlFrom() // From
	{
		return ($this->SqlFrom != "") ? $this->SqlFrom : "`wp_wpl_addon_crm_contacts`";
	}
	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 : "`last_name` ASC,`first_name` ASC";
	}
	public function sqlOrderBy() // For backward compatibility
	{
		return $this->getSqlOrderBy();
	}
	public function setSqlOrderBy($v)
	{
		$this->SqlOrderBy = $v;
	}

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

	// Check if User ID security allows view all
	public function userIDAllow($id = "")
	{
		$allow = $this->UserIDAllowSecurity;
		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);
			case "lookup":
				return (($allow & 256) == 256);
			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, $c = NULL)
	{
		$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 / SELECT DISTINCT / ORDER BY
		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) && !preg_match('/\s+order\s+by\s+/i', $sql)) {
			$sqlwrk = "SELECT COUNT(*) FROM " . preg_replace($pattern, "", $sql);
		} else {
			$sqlwrk = "SELECT COUNT(*) FROM (" . $sql . ") COUNT_TABLE";
		}
		$conn = $c ?: $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) {

			// Get insert id if necessary
			$this->id->setDbValue($conn->insert_ID());
			$rs['id'] = $this->id->DbValue;
		}
		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) {
			if (array_key_exists('id', $rs))
				AddFilter($where, QuotedName('id', $this->Dbid) . '=' . QuotedValue($rs['id'], $this->id->DataType, $this->Dbid));
		}
		$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->user_id->DbValue = $row['user_id'];
		$this->last_name->DbValue = $row['last_name'];
		$this->first_name->DbValue = $row['first_name'];
		$this->field_3091->DbValue = $row['field_3091'];
		$this->field_3090->DbValue = $row['field_3090'];
		$this->owner->DbValue = $row['owner'];
		$this->type->DbValue = $row['type'];
		$this->_private->DbValue = $row['private'];
		$this->title->DbValue = $row['title'];
		$this->gender->DbValue = $row['gender'];
		$this->marital->DbValue = $row['marital'];
		$this->email1->DbValue = $row['email1'];
		$this->tel->DbValue = $row['tel'];
		$this->birthday->DbValue = $row['birthday'];
		$this->mobile->DbValue = $row['mobile'];
		$this->field_3088->DbValue = $row['field_3088'];
		$this->field_3187->DbValue = $row['field_3187'];
		$this->field_3188->DbValue = $row['field_3188'];
		$this->location1_id->DbValue = $row['location1_id'];
		$this->location2_id->DbValue = $row['location2_id'];
		$this->location3_id->DbValue = $row['location3_id'];
		$this->location4_id->DbValue = $row['location4_id'];
		$this->location5_id->DbValue = $row['location5_id'];
		$this->location6_id->DbValue = $row['location6_id'];
		$this->location7_id->DbValue = $row['location7_id'];
		$this->location1_name->DbValue = $row['location1_name'];
		$this->location2_name->DbValue = $row['location2_name'];
		$this->location3_name->DbValue = $row['location3_name'];
		$this->location4_name->DbValue = $row['location4_name'];
		$this->location5_name->DbValue = $row['location5_name'];
		$this->location6_name->DbValue = $row['location6_name'];
		$this->location7_name->DbValue = $row['location7_name'];
		$this->zip_id->DbValue = $row['zip_id'];
		$this->zip_name->DbValue = $row['zip_name'];
		$this->rating->DbValue = $row['rating'];
		$this->group->DbValue = $row['group'];
		$this->logins->DbValue = $row['logins'];
		$this->saved_searches->DbValue = $row['saved_searches'];
		$this->listings_viewed->DbValue = $row['listings_viewed'];
		$this->last_login_date->DbValue = $row['last_login_date'];
		$this->f_3011_options->DbValue = $row['f_3011_options'];
		$this->f_3011->DbValue = $row['f_3011'];
		$this->field_3004_en_us->DbValue = $row['field_3004_en_us'];
		$this->field_3004_fr_fr->DbValue = $row['field_3004_fr_fr'];
		$this->field_3092->DbValue = $row['field_3092'];
		$this->field_3093->DbValue = $row['field_3093'];
		$this->field_3183->DbValue = $row['field_3183'];
		$this->field_3184->DbValue = $row['field_3184'];
		$this->field_3186->DbValue = $row['field_3186'];
		$this->field_3185->DbValue = $row['field_3185'];
		$this->field_3087->DbValue = $row['field_3087'];
		$this->date_added->DbValue = $row['date_added'];
		$this->archive->DbValue = $row['archive'];
	}

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

	// Record filter WHERE clause
	protected function sqlKeyFilter()
	{
		return "`id` = @id@";
	}

	// Get record filter
	public function getRecordFilter($row = NULL)
	{
		$keyFilter = $this->sqlKeyFilter();
		if (is_array($row))
			$val = array_key_exists('id', $row) ? $row['id'] : NULL;
		else
			$val = $this->id->OldValue !== NULL ? $this->id->OldValue : $this->id->CurrentValue;
		if (!is_numeric($val))
			return "0=1"; // Invalid key
		if ($val == NULL)
			return "0=1"; // Invalid key
		else
			$keyFilter = str_replace("@id@", AdjustSql($val, $this->Dbid), $keyFilter); // Replace key value
		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 "wp_wpl_addon_crm_contactslist.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 == "wp_wpl_addon_crm_contactsview.php")
			return $Language->phrase("View");
		elseif ($pageName == "wp_wpl_addon_crm_contactsedit.php")
			return $Language->phrase("Edit");
		elseif ($pageName == "wp_wpl_addon_crm_contactsadd.php")
			return $Language->phrase("Add");
		else
			return "";
	}

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

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

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

	// Edit URL
	public function getEditUrl($parm = "")
	{
		$url = $this->keyUrl("wp_wpl_addon_crm_contactsedit.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("wp_wpl_addon_crm_contactsadd.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("wp_wpl_addon_crm_contactsdelete.php", $this->getUrlParm());
	}

	// Add master url
	public function addMasterUrl($url)
	{
		return $url;
	}
	public function keyToJson($htmlEncode = FALSE)
	{
		$json = "";
		$json .= "id:" . JsonEncode($this->id->CurrentValue, "number");
		$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 . "&";
		if ($this->id->CurrentValue != NULL) {
			$url .= "id=" . urlencode($this->id->CurrentValue);
		} else {
			return "javascript:ew.alert(ew.language.phrase('InvalidRecord'));";
		}
		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 {
			if (Param("id") !== NULL)
				$arKeys[] = Param("id");
			elseif (IsApi() && Key(0) !== NULL)
				$arKeys[] = Key(0);
			elseif (IsApi() && Route(2) !== NULL)
				$arKeys[] = Route(2);
			else
				$arKeys = NULL; // Do not setup

			//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) {
				if (!is_numeric($key))
					continue;
				$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 ";
			if ($setCurrent)
				$this->id->CurrentValue = $key;
			else
				$this->id->OldValue = $key;
			$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->user_id->setDbValue($rs->fields('user_id'));
		$this->last_name->setDbValue($rs->fields('last_name'));
		$this->first_name->setDbValue($rs->fields('first_name'));
		$this->field_3091->setDbValue($rs->fields('field_3091'));
		$this->field_3090->setDbValue($rs->fields('field_3090'));
		$this->owner->setDbValue($rs->fields('owner'));
		$this->type->setDbValue($rs->fields('type'));
		$this->_private->setDbValue($rs->fields('private'));
		$this->title->setDbValue($rs->fields('title'));
		$this->gender->setDbValue($rs->fields('gender'));
		$this->marital->setDbValue($rs->fields('marital'));
		$this->email1->setDbValue($rs->fields('email1'));
		$this->tel->setDbValue($rs->fields('tel'));
		$this->birthday->setDbValue($rs->fields('birthday'));
		$this->mobile->setDbValue($rs->fields('mobile'));
		$this->field_3088->setDbValue($rs->fields('field_3088'));
		$this->field_3187->setDbValue($rs->fields('field_3187'));
		$this->field_3188->setDbValue($rs->fields('field_3188'));
		$this->location1_id->setDbValue($rs->fields('location1_id'));
		$this->location2_id->setDbValue($rs->fields('location2_id'));
		$this->location3_id->setDbValue($rs->fields('location3_id'));
		$this->location4_id->setDbValue($rs->fields('location4_id'));
		$this->location5_id->setDbValue($rs->fields('location5_id'));
		$this->location6_id->setDbValue($rs->fields('location6_id'));
		$this->location7_id->setDbValue($rs->fields('location7_id'));
		$this->location1_name->setDbValue($rs->fields('location1_name'));
		$this->location2_name->setDbValue($rs->fields('location2_name'));
		$this->location3_name->setDbValue($rs->fields('location3_name'));
		$this->location4_name->setDbValue($rs->fields('location4_name'));
		$this->location5_name->setDbValue($rs->fields('location5_name'));
		$this->location6_name->setDbValue($rs->fields('location6_name'));
		$this->location7_name->setDbValue($rs->fields('location7_name'));
		$this->zip_id->setDbValue($rs->fields('zip_id'));
		$this->zip_name->setDbValue($rs->fields('zip_name'));
		$this->rating->setDbValue($rs->fields('rating'));
		$this->group->setDbValue($rs->fields('group'));
		$this->logins->setDbValue($rs->fields('logins'));
		$this->saved_searches->setDbValue($rs->fields('saved_searches'));
		$this->listings_viewed->setDbValue($rs->fields('listings_viewed'));
		$this->last_login_date->setDbValue($rs->fields('last_login_date'));
		$this->f_3011_options->setDbValue($rs->fields('f_3011_options'));
		$this->f_3011->setDbValue($rs->fields('f_3011'));
		$this->field_3004_en_us->setDbValue($rs->fields('field_3004_en_us'));
		$this->field_3004_fr_fr->setDbValue($rs->fields('field_3004_fr_fr'));
		$this->field_3092->setDbValue($rs->fields('field_3092'));
		$this->field_3093->setDbValue($rs->fields('field_3093'));
		$this->field_3183->setDbValue($rs->fields('field_3183'));
		$this->field_3184->setDbValue($rs->fields('field_3184'));
		$this->field_3186->setDbValue($rs->fields('field_3186'));
		$this->field_3185->setDbValue($rs->fields('field_3185'));
		$this->field_3087->setDbValue($rs->fields('field_3087'));
		$this->date_added->setDbValue($rs->fields('date_added'));
		$this->archive->setDbValue($rs->fields('archive'));
	}

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

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

		// Common render codes
		// id
		// user_id
		// last_name
		// first_name
		// field_3091
		// field_3090
		// owner
		// type
		// private
		// title
		// gender
		// marital
		// email1
		// tel
		// birthday
		// mobile
		// field_3088
		// field_3187
		// field_3188
		// location1_id
		// location2_id
		// location3_id
		// location4_id
		// location5_id
		// location6_id
		// location7_id
		// location1_name

		$this->location1_name->CellCssStyle = "white-space: nowrap;";

		// location2_name
		// location3_name
		// location4_name
		// location5_name
		// location6_name
		// location7_name
		// zip_id
		// zip_name

		$this->zip_name->CellCssStyle = "white-space: nowrap;";

		// rating
		// group
		// logins
		// saved_searches
		// listings_viewed
		// last_login_date
		// f_3011_options
		// f_3011
		// field_3004_en_us
		// field_3004_fr_fr
		// field_3092
		// field_3093
		// field_3183
		// field_3184
		// field_3186
		// field_3185
		// field_3087
		// date_added
		// archive
		// id

		$this->id->ViewValue = $this->id->CurrentValue;
		$this->id->ViewCustomAttributes = "";

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

		// last_name
		$this->last_name->ViewValue = $this->last_name->CurrentValue;
		$arwrk = [];
		$arwrk[1] = $this->last_name->CurrentValue;
		$this->last_name->ViewValue = $this->last_name->displayValue($arwrk);
		$this->last_name->ViewCustomAttributes = "";

		// first_name
		$this->first_name->ViewValue = $this->first_name->CurrentValue;
		$arwrk = [];
		$arwrk[1] = $this->first_name->CurrentValue;
		$this->first_name->ViewValue = $this->first_name->displayValue($arwrk);
		$this->first_name->ViewCustomAttributes = "";

		// field_3091
		$this->field_3091->ViewValue = $this->field_3091->CurrentValue;
		$arwrk = [];
		$arwrk[1] = $this->field_3091->CurrentValue;
		$this->field_3091->ViewValue = $this->field_3091->displayValue($arwrk);
		$this->field_3091->ViewCustomAttributes = "";

		// field_3090
		$this->field_3090->ViewValue = $this->field_3090->CurrentValue;
		$arwrk = [];
		$arwrk[1] = $this->field_3090->CurrentValue;
		$this->field_3090->ViewValue = $this->field_3090->displayValue($arwrk);
		$this->field_3090->ViewCustomAttributes = "";

		// owner
		if (strval($this->owner->CurrentValue) != "") {
			$this->owner->ViewValue = $this->owner->optionCaption($this->owner->CurrentValue);
		} else {
			$this->owner->ViewValue = NULL;
		}
		$this->owner->ViewCustomAttributes = "";

		// type
		if (strval($this->type->CurrentValue) != "") {
			$this->type->ViewValue = $this->type->optionCaption($this->type->CurrentValue);
		} else {
			$this->type->ViewValue = NULL;
		}
		$this->type->ViewCustomAttributes = "";

		// private
		if (ConvertToBool($this->_private->CurrentValue)) {
			$this->_private->ViewValue = $this->_private->tagCaption(1) != "" ? $this->_private->tagCaption(1) : "Yes";
		} else {
			$this->_private->ViewValue = $this->_private->tagCaption(2) != "" ? $this->_private->tagCaption(2) : "No";
		}
		$this->_private->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// location5_id
		$this->location5_id->ViewValue = $this->location5_id->CurrentValue;
		$this->location5_id->ViewValue = FormatNumber($this->location5_id->ViewValue, 0, -2, -2, -2);
		$this->location5_id->CellCssStyle .= "text-align: center;";
		$this->location5_id->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// field_3183
		$this->field_3183->ViewValue = $this->field_3183->CurrentValue;
		$arwrk = [];
		$arwrk[1] = $this->field_3183->CurrentValue;
		$this->field_3183->ViewValue = $this->field_3183->displayValue($arwrk);
		$this->field_3183->ViewCustomAttributes = "";

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

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

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

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

		// date_added
		$this->date_added->ViewValue = $this->date_added->CurrentValue;
		$this->date_added->ViewValue = FormatDateTime($this->date_added->ViewValue, 9);
		$this->date_added->ViewCustomAttributes = "";

		// archive
		if (strval($this->archive->CurrentValue) != "") {
			$this->archive->ViewValue = $this->archive->optionCaption($this->archive->CurrentValue);
		} else {
			$this->archive->ViewValue = NULL;
		}
		$this->archive->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

		// private
		$this->_private->LinkCustomAttributes = "";
		$this->_private->HrefValue = "";
		$this->_private->TooltipValue = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// archive
		$this->archive->LinkCustomAttributes = "";
		$this->archive->HrefValue = "";
		$this->archive->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->ViewCustomAttributes = "";

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

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

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

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

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

		// owner
		$this->owner->EditCustomAttributes = "";
		$this->owner->EditValue = $this->owner->options(FALSE);

		// type
		$this->type->EditCustomAttributes = "";
		$this->type->EditValue = $this->type->options(FALSE);

		// private
		$this->_private->EditCustomAttributes = "";
		$this->_private->EditValue = $this->_private->options(FALSE);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// archive
		$this->archive->EditCustomAttributes = "";
		$this->archive->EditValue = $this->archive->options(FALSE);

		// 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->last_name);
					$doc->exportCaption($this->first_name);
					$doc->exportCaption($this->field_3091);
					$doc->exportCaption($this->field_3090);
					$doc->exportCaption($this->owner);
					$doc->exportCaption($this->type);
					$doc->exportCaption($this->email1);
					$doc->exportCaption($this->tel);
					$doc->exportCaption($this->mobile);
					$doc->exportCaption($this->field_3088);
					$doc->exportCaption($this->field_3187);
					$doc->exportCaption($this->field_3188);
					$doc->exportCaption($this->field_3183);
					$doc->exportCaption($this->field_3184);
					$doc->exportCaption($this->field_3186);
					$doc->exportCaption($this->field_3185);
					$doc->exportCaption($this->field_3087);
					$doc->exportCaption($this->date_added);
					$doc->exportCaption($this->archive);
				} else {
					$doc->exportCaption($this->id);
					$doc->exportCaption($this->user_id);
					$doc->exportCaption($this->last_name);
					$doc->exportCaption($this->first_name);
					$doc->exportCaption($this->field_3091);
					$doc->exportCaption($this->field_3090);
					$doc->exportCaption($this->owner);
					$doc->exportCaption($this->_private);
					$doc->exportCaption($this->title);
					$doc->exportCaption($this->gender);
					$doc->exportCaption($this->marital);
					$doc->exportCaption($this->email1);
					$doc->exportCaption($this->tel);
					$doc->exportCaption($this->birthday);
					$doc->exportCaption($this->mobile);
					$doc->exportCaption($this->field_3088);
					$doc->exportCaption($this->field_3187);
					$doc->exportCaption($this->field_3188);
					$doc->exportCaption($this->location1_id);
					$doc->exportCaption($this->location3_id);
					$doc->exportCaption($this->location4_id);
					$doc->exportCaption($this->location5_id);
					$doc->exportCaption($this->location6_id);
					$doc->exportCaption($this->location7_id);
					$doc->exportCaption($this->location2_name);
					$doc->exportCaption($this->location3_name);
					$doc->exportCaption($this->location4_name);
					$doc->exportCaption($this->location5_name);
					$doc->exportCaption($this->location6_name);
					$doc->exportCaption($this->location7_name);
					$doc->exportCaption($this->zip_id);
					$doc->exportCaption($this->rating);
					$doc->exportCaption($this->group);
					$doc->exportCaption($this->logins);
					$doc->exportCaption($this->saved_searches);
					$doc->exportCaption($this->listings_viewed);
					$doc->exportCaption($this->last_login_date);
					$doc->exportCaption($this->f_3011);
					$doc->exportCaption($this->field_3004_en_us);
					$doc->exportCaption($this->field_3004_fr_fr);
					$doc->exportCaption($this->field_3092);
					$doc->exportCaption($this->field_3093);
					$doc->exportCaption($this->field_3183);
					$doc->exportCaption($this->field_3184);
					$doc->exportCaption($this->field_3186);
					$doc->exportCaption($this->field_3185);
					$doc->exportCaption($this->date_added);
					$doc->exportCaption($this->archive);
				}
				$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->last_name);
						$doc->exportField($this->first_name);
						$doc->exportField($this->field_3091);
						$doc->exportField($this->field_3090);
						$doc->exportField($this->owner);
						$doc->exportField($this->type);
						$doc->exportField($this->email1);
						$doc->exportField($this->tel);
						$doc->exportField($this->mobile);
						$doc->exportField($this->field_3088);
						$doc->exportField($this->field_3187);
						$doc->exportField($this->field_3188);
						$doc->exportField($this->field_3183);
						$doc->exportField($this->field_3184);
						$doc->exportField($this->field_3186);
						$doc->exportField($this->field_3185);
						$doc->exportField($this->field_3087);
						$doc->exportField($this->date_added);
						$doc->exportField($this->archive);
					} else {
						$doc->exportField($this->id);
						$doc->exportField($this->user_id);
						$doc->exportField($this->last_name);
						$doc->exportField($this->first_name);
						$doc->exportField($this->field_3091);
						$doc->exportField($this->field_3090);
						$doc->exportField($this->owner);
						$doc->exportField($this->_private);
						$doc->exportField($this->title);
						$doc->exportField($this->gender);
						$doc->exportField($this->marital);
						$doc->exportField($this->email1);
						$doc->exportField($this->tel);
						$doc->exportField($this->birthday);
						$doc->exportField($this->mobile);
						$doc->exportField($this->field_3088);
						$doc->exportField($this->field_3187);
						$doc->exportField($this->field_3188);
						$doc->exportField($this->location1_id);
						$doc->exportField($this->location3_id);
						$doc->exportField($this->location4_id);
						$doc->exportField($this->location5_id);
						$doc->exportField($this->location6_id);
						$doc->exportField($this->location7_id);
						$doc->exportField($this->location2_name);
						$doc->exportField($this->location3_name);
						$doc->exportField($this->location4_name);
						$doc->exportField($this->location5_name);
						$doc->exportField($this->location6_name);
						$doc->exportField($this->location7_name);
						$doc->exportField($this->zip_id);
						$doc->exportField($this->rating);
						$doc->exportField($this->group);
						$doc->exportField($this->logins);
						$doc->exportField($this->saved_searches);
						$doc->exportField($this->listings_viewed);
						$doc->exportField($this->last_login_date);
						$doc->exportField($this->f_3011);
						$doc->exportField($this->field_3004_en_us);
						$doc->exportField($this->field_3004_fr_fr);
						$doc->exportField($this->field_3092);
						$doc->exportField($this->field_3093);
						$doc->exportField($this->field_3183);
						$doc->exportField($this->field_3184);
						$doc->exportField($this->field_3186);
						$doc->exportField($this->field_3185);
						$doc->exportField($this->date_added);
						$doc->exportField($this->archive);
					}
					$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() {
		$id= $this->id->CurrentValue;
		$last_name=$this->last_name->CurrentValue;
		$this->last_name->ViewValue = "<a href='property_noteslist.php?showdetail=&OwnerID=".$id."'>".$last_name."</a>";

		//$this->last_name->ViewValue = "<a href='files/ContactNotes.php?OwnerID=".$id."' target='_blank'>".$last_name."</a>";
		$tel=$this->tel->CurrentValue;
		$mobile=$this->mobile->CurrentValue;
		$email1=$this->email1->CurrentValue;
		$tel2=$this->field_3187->CurrentValue;
		$mobile2=$this->field_3188->CurrentValue;
		$email2=$this->field_3088->CurrentValue;

		//$this->last_name->ViewValue = "<a href='contact_listinglist.php?id=".$id."' target='_blank'>".$this->last_name->ViewValue."</a>";
		$this->tel->ViewValue = "<a href='tel:".$tel."'>".$tel."</a>";
		$this->mobile->ViewValue = "<a href='tel:".$mobile."'>".$mobile."</a>";
		$this->email1->ViewValue = "<a href='mailto:".$email1."'>".$email1."</a>";
		$this->field_3187->ViewValue = "<a href='tel:".$tel2."'>".$tel2."</a>";
		$this->field_3188->ViewValue = "<a href='tel:".$mobile2."'>".$mobile2."</a>";
		$this->field_3088->ViewValue = "<a href='mailto:".$email2."'>".$email2."</a>";
	}

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

		// Enter your code here
	}
}
?>

Hry