Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/echasl23/
Upload File :
Current File : /var/www/cesa.co.za/echasl23/AwardsEntriesinfo.php

<?php

// Global variable for table object
$AwardsEntries = NULL;

//
// Table class for AwardsEntries
//
class cAwardsEntries {
	var $TableVar = 'AwardsEntries';
	var $TableName = 'AwardsEntries';
	var $TableType = 'TABLE';
	var $AwardsEntryID;
	var $DateCreated;
	var $AwardYear;
	var $PreEntry;
	var $Firm_Name;
	var $Award_Category;
	var $Start_Date;
	var $Project_Name;
	var $Completion_Date;
	var $Lead_Consultant_Name;
	var $Lead_Consultant_Tel;
	var $Lead_Consultant_Mobile;
	var $Lead_Consultant_Email;
	var $Role_In_Project;
	var $JV_Partners;
	var $JV_Consent;
	var $Nominee_Name;
	var $Nominee_Consent;
	var $Description_Sent;
	var $Contact_Name;
	var $Contact_Job_Title;
	var $Contact_Tel;
	var $Contact_Email;
	var $A1_Poster_Required;
	var $Quantity;
	var $ExternalFormID;
	var $ExternalEntryID;
	var $PreEntryHTML;
	var $Contact_Mobile;
	var $FullEntryHTML;
	var $fields = array();
	var $UseTokenInUrl = EW_USE_TOKEN_IN_URL;
	var $Export; // Export
	var $ExportOriginalValue = EW_EXPORT_ORIGINAL_VALUE;
	var $ExportAll = TRUE;
	var $SendEmail; // Send email
	var $TableCustomInnerHtml; // Custom inner HTML
	var $BasicSearchKeyword; // Basic search keyword
	var $BasicSearchType; // Basic search type
	var $CurrentFilter; // Current filter
	var $CurrentOrder; // Current order
	var $CurrentOrderType; // Current order type
	var $RowType; // Row type
	var $CssClass; // CSS class
	var $CssStyle; // CSS style
	var $RowAttrs = array(); // Row custom attributes
	var $TableFilter = "";
	var $CurrentAction; // Current action
	var $UpdateConflict; // Update conflict
	var $EventName; // Event name
	var $EventCancelled; // Event cancelled
	var $CancelMessage; // Cancel message

	//
	// Table class constructor
	//
	function __construct() {
		global $Language;

		// AwardsEntryID
		$this->AwardsEntryID = new cField('AwardsEntries', 'AwardsEntries', 'x_AwardsEntryID', 'AwardsEntryID', '`AwardsEntryID`', 3, -1, FALSE, '`AwardsEntryID`', FALSE);
		$this->AwardsEntryID->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['AwardsEntryID'] =& $this->AwardsEntryID;

		// DateCreated
		$this->DateCreated = new cField('AwardsEntries', 'AwardsEntries', 'x_DateCreated', 'DateCreated', '`DateCreated`', 135, 5, FALSE, '`DateCreated`', FALSE);
		$this->DateCreated->FldDefaultErrMsg = str_replace("%s", "/", $Language->Phrase("IncorrectDateYMD"));
		$this->fields['DateCreated'] =& $this->DateCreated;

		// AwardYear
		$this->AwardYear = new cField('AwardsEntries', 'AwardsEntries', 'x_AwardYear', 'AwardYear', '`AwardYear`', 3, -1, FALSE, '`AwardYear`', FALSE);
		$this->AwardYear->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['AwardYear'] =& $this->AwardYear;

		// PreEntry
		$this->PreEntry = new cField('AwardsEntries', 'AwardsEntries', 'x_PreEntry', 'PreEntry', '`PreEntry`', 16, -1, FALSE, '`PreEntry`', FALSE);
		$this->PreEntry->FldDefaultErrMsg = $Language->Phrase("IncorrectInteger");
		$this->fields['PreEntry'] =& $this->PreEntry;

		// Firm_Name
		$this->Firm_Name = new cField('AwardsEntries', 'AwardsEntries', 'x_Firm_Name', 'Firm_Name', '`Firm_Name`', 200, -1, FALSE, '`Firm_Name`', FALSE);
		$this->fields['Firm_Name'] =& $this->Firm_Name;

		// Award_Category
		$this->Award_Category = new cField('AwardsEntries', 'AwardsEntries', 'x_Award_Category', 'Award_Category', '`Award_Category`', 200, -1, FALSE, '`Award_Category`', FALSE);
		$this->fields['Award_Category'] =& $this->Award_Category;

		// Start_Date
		$this->Start_Date = new cField('AwardsEntries', 'AwardsEntries', 'x_Start_Date', 'Start_Date', '`Start_Date`', 200, -1, FALSE, '`Start_Date`', FALSE);
		$this->fields['Start_Date'] =& $this->Start_Date;

		// Project_Name
		$this->Project_Name = new cField('AwardsEntries', 'AwardsEntries', 'x_Project_Name', 'Project_Name', '`Project_Name`', 200, -1, FALSE, '`Project_Name`', FALSE);
		$this->fields['Project_Name'] =& $this->Project_Name;

		// Completion_Date
		$this->Completion_Date = new cField('AwardsEntries', 'AwardsEntries', 'x_Completion_Date', 'Completion_Date', '`Completion_Date`', 200, -1, FALSE, '`Completion_Date`', FALSE);
		$this->fields['Completion_Date'] =& $this->Completion_Date;

		// Lead_Consultant_Name
		$this->Lead_Consultant_Name = new cField('AwardsEntries', 'AwardsEntries', 'x_Lead_Consultant_Name', 'Lead_Consultant_Name', '`Lead_Consultant_Name`', 200, -1, FALSE, '`Lead_Consultant_Name`', FALSE);
		$this->fields['Lead_Consultant_Name'] =& $this->Lead_Consultant_Name;

		// Lead_Consultant_Tel
		$this->Lead_Consultant_Tel = new cField('AwardsEntries', 'AwardsEntries', 'x_Lead_Consultant_Tel', 'Lead_Consultant_Tel', '`Lead_Consultant_Tel`', 200, -1, FALSE, '`Lead_Consultant_Tel`', FALSE);
		$this->fields['Lead_Consultant_Tel'] =& $this->Lead_Consultant_Tel;

		// Lead_Consultant_Mobile
		$this->Lead_Consultant_Mobile = new cField('AwardsEntries', 'AwardsEntries', 'x_Lead_Consultant_Mobile', 'Lead_Consultant_Mobile', '`Lead_Consultant_Mobile`', 200, -1, FALSE, '`Lead_Consultant_Mobile`', FALSE);
		$this->fields['Lead_Consultant_Mobile'] =& $this->Lead_Consultant_Mobile;

		// Lead_Consultant_Email
		$this->Lead_Consultant_Email = new cField('AwardsEntries', 'AwardsEntries', 'x_Lead_Consultant_Email', 'Lead_Consultant_Email', '`Lead_Consultant_Email`', 200, -1, FALSE, '`Lead_Consultant_Email`', FALSE);
		$this->fields['Lead_Consultant_Email'] =& $this->Lead_Consultant_Email;

		// Role_In_Project
		$this->Role_In_Project = new cField('AwardsEntries', 'AwardsEntries', 'x_Role_In_Project', 'Role_In_Project', '`Role_In_Project`', 200, -1, FALSE, '`Role_In_Project`', FALSE);
		$this->fields['Role_In_Project'] =& $this->Role_In_Project;

		// JV_Partners
		$this->JV_Partners = new cField('AwardsEntries', 'AwardsEntries', 'x_JV_Partners', 'JV_Partners', '`JV_Partners`', 201, -1, FALSE, '`JV_Partners`', FALSE);
		$this->fields['JV_Partners'] =& $this->JV_Partners;

		// JV_Consent
		$this->JV_Consent = new cField('AwardsEntries', 'AwardsEntries', 'x_JV_Consent', 'JV_Consent', '`JV_Consent`', 201, -1, FALSE, '`JV_Consent`', FALSE);
		$this->fields['JV_Consent'] =& $this->JV_Consent;

		// Nominee_Name
		$this->Nominee_Name = new cField('AwardsEntries', 'AwardsEntries', 'x_Nominee_Name', 'Nominee_Name', '`Nominee_Name`', 200, -1, FALSE, '`Nominee_Name`', FALSE);
		$this->fields['Nominee_Name'] =& $this->Nominee_Name;

		// Nominee_Consent
		$this->Nominee_Consent = new cField('AwardsEntries', 'AwardsEntries', 'x_Nominee_Consent', 'Nominee_Consent', '`Nominee_Consent`', 200, -1, FALSE, '`Nominee_Consent`', FALSE);
		$this->fields['Nominee_Consent'] =& $this->Nominee_Consent;

		// Description_Sent
		$this->Description_Sent = new cField('AwardsEntries', 'AwardsEntries', 'x_Description_Sent', 'Description_Sent', '`Description_Sent`', 200, -1, FALSE, '`Description_Sent`', FALSE);
		$this->fields['Description_Sent'] =& $this->Description_Sent;

		// Contact_Name
		$this->Contact_Name = new cField('AwardsEntries', 'AwardsEntries', 'x_Contact_Name', 'Contact_Name', '`Contact_Name`', 200, -1, FALSE, '`Contact_Name`', FALSE);
		$this->fields['Contact_Name'] =& $this->Contact_Name;

		// Contact_Job_Title
		$this->Contact_Job_Title = new cField('AwardsEntries', 'AwardsEntries', 'x_Contact_Job_Title', 'Contact_Job_Title', '`Contact_Job_Title`', 200, -1, FALSE, '`Contact_Job_Title`', FALSE);
		$this->fields['Contact_Job_Title'] =& $this->Contact_Job_Title;

		// Contact_Tel
		$this->Contact_Tel = new cField('AwardsEntries', 'AwardsEntries', 'x_Contact_Tel', 'Contact_Tel', '`Contact_Tel`', 200, -1, FALSE, '`Contact_Tel`', FALSE);
		$this->fields['Contact_Tel'] =& $this->Contact_Tel;

		// Contact_Email
		$this->Contact_Email = new cField('AwardsEntries', 'AwardsEntries', 'x_Contact_Email', 'Contact_Email', '`Contact_Email`', 200, -1, FALSE, '`Contact_Email`', FALSE);
		$this->fields['Contact_Email'] =& $this->Contact_Email;

		// A1_Poster_Required
		$this->A1_Poster_Required = new cField('AwardsEntries', 'AwardsEntries', 'x_A1_Poster_Required', 'A1_Poster_Required', '`A1_Poster_Required`', 200, -1, FALSE, '`A1_Poster_Required`', FALSE);
		$this->fields['A1_Poster_Required'] =& $this->A1_Poster_Required;

		// Quantity
		$this->Quantity = new cField('AwardsEntries', 'AwardsEntries', 'x_Quantity', 'Quantity', '`Quantity`', 200, -1, FALSE, '`Quantity`', FALSE);
		$this->fields['Quantity'] =& $this->Quantity;

		// ExternalFormID
		$this->ExternalFormID = new cField('AwardsEntries', 'AwardsEntries', 'x_ExternalFormID', 'ExternalFormID', '`ExternalFormID`', 200, -1, FALSE, '`ExternalFormID`', FALSE);
		$this->fields['ExternalFormID'] =& $this->ExternalFormID;

		// ExternalEntryID
		$this->ExternalEntryID = new cField('AwardsEntries', 'AwardsEntries', 'x_ExternalEntryID', 'ExternalEntryID', '`ExternalEntryID`', 200, -1, FALSE, '`ExternalEntryID`', FALSE);
		$this->fields['ExternalEntryID'] =& $this->ExternalEntryID;

		// PreEntryHTML
		$this->PreEntryHTML = new cField('AwardsEntries', 'AwardsEntries', 'x_PreEntryHTML', 'PreEntryHTML', '`PreEntryHTML`', 201, -1, FALSE, '`PreEntryHTML`', FALSE);
		$this->PreEntryHTML->TruncateMemoRemoveHtml = TRUE;
		$this->fields['PreEntryHTML'] =& $this->PreEntryHTML;

		// Contact_Mobile
		$this->Contact_Mobile = new cField('AwardsEntries', 'AwardsEntries', 'x_Contact_Mobile', 'Contact_Mobile', '`Contact_Mobile`', 200, -1, FALSE, '`Contact_Mobile`', FALSE);
		$this->fields['Contact_Mobile'] =& $this->Contact_Mobile;

		// FullEntryHTML
		$this->FullEntryHTML = new cField('AwardsEntries', 'AwardsEntries', 'x_FullEntryHTML', 'FullEntryHTML', '`FullEntryHTML`', 201, -1, FALSE, '`FullEntryHTML`', FALSE);
		$this->FullEntryHTML->TruncateMemoRemoveHtml = TRUE;
		$this->fields['FullEntryHTML'] =& $this->FullEntryHTML;
	}

	// Table caption
	function TableCaption() {
		global $Language;
		return $Language->TablePhrase($this->TableVar, "TblCaption");
	}

	// Page caption
	function PageCaption($Page) {
		global $Language;
		$Caption = $Language->TablePhrase($this->TableVar, "TblPageCaption" . $Page);
		if ($Caption == "") $Caption = "Page " . $Page;
		return $Caption;
	}

	// Export return page
	function ExportReturnUrl() {
		$url = @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_EXPORT_RETURN_URL];
		return ($url <> "") ? $url : ew_CurrentPage();
	}

	function setExportReturnUrl($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_EXPORT_RETURN_URL] = $v;
	}

	// Records per page
	function getRecordsPerPage() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE];
	}

	function setRecordsPerPage($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_REC_PER_PAGE] = $v;
	}

	// Start record number
	function getStartRecordNumber() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC];
	}

	function setStartRecordNumber($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_START_REC] = $v;
	}

	// Search highlight name
	function HighlightName() {
		return "AwardsEntries_Highlight";
	}

	// Advanced search
	function getAdvancedSearch($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld];
	}

	function setAdvancedSearch($fld, $v) {
		if (@$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] <> $v) {
			$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ADVANCED_SEARCH . "_" . $fld] = $v;
		}
	}

	// Basic search keyword
	function getSessionBasicSearchKeyword() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH];
	}

	function setSessionBasicSearchKeyword($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH] = $v;
	}

	// Basic search type
	function getSessionBasicSearchType() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE];
	}

	function setSessionBasicSearchType($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_BASIC_SEARCH_TYPE] = $v;
	}

	// Search WHERE clause
	function getSearchWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE];
	}

	function setSearchWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_SEARCH_WHERE] = $v;
	}

	// Multiple column sort
	function UpdateSort(&$ofld, $ctrl) {
		if ($this->CurrentOrder == $ofld->FldName) {
			$sSortField = $ofld->FldExpression;
			$sLastSort = $ofld->getSort();
			if ($this->CurrentOrderType == "ASC" || $this->CurrentOrderType == "DESC") {
				$sThisSort = $this->CurrentOrderType;
			} else {
				$sThisSort = ($sLastSort == "ASC") ? "DESC" : "ASC";
			}
			$ofld->setSort($sThisSort);
			if ($ctrl) {
				$sOrderBy = $this->getSessionOrderBy();
				if (strpos($sOrderBy, $sSortField . " " . $sLastSort) !== FALSE) {
					$sOrderBy = str_replace($sSortField . " " . $sLastSort, $sSortField . " " . $sThisSort, $sOrderBy);
				} else {
					if ($sOrderBy <> "") $sOrderBy .= ", ";
					$sOrderBy .= $sSortField . " " . $sThisSort;
				}
				$this->setSessionOrderBy($sOrderBy); // Save to Session
			} else {
				$this->setSessionOrderBy($sSortField . " " . $sThisSort); // Save to Session
			}
		} else {
			if (!$ctrl) $ofld->setSort("");
		}
	}

	// Session WHERE clause
	function getSessionWhere() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE];
	}

	function setSessionWhere($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_WHERE] = $v;
	}

	// Session ORDER BY
	function getSessionOrderBy() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY];
	}

	function setSessionOrderBy($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_ORDER_BY] = $v;
	}

	// Session key
	function getKey($fld) {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld];
	}

	function setKey($fld, $v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_KEY . "_" . $fld] = $v;
	}

	// Table level SQL
	function SqlFrom() { // From
		return "`AwardsEntries`";
	}

	function SqlSelect() { // Select
		return "SELECT * FROM " . $this->SqlFrom();
	}

	function SqlWhere() { // Where
		$sWhere = "";
		$this->TableFilter = "";
		if ($this->TableFilter <> "") {
			if ($sWhere <> "") $sWhere = "(" . $sWhere . ") AND (";
			$sWhere .= "(" . $this->TableFilter . ")";
		}
		return $sWhere;
	}

	function SqlGroupBy() { // Group By
		return "";
	}

	function SqlHaving() { // Having
		return "";
	}

	function SqlOrderBy() { // Order By
		return "`DateCreated` DESC";
	}

	// Check if Anonymous User is allowed
	function AllowAnonymousUser() {
		switch (EW_PAGE_ID) {
			case "add":
			case "register":
			case "addopt":
				return FALSE;
			case "edit":
			case "update":
				return FALSE;
			case "delete":
				return FALSE;
			case "view":
				return FALSE;
			case "search":
				return FALSE;
			default:
				return FALSE;
		}
	}

	// Apply User ID filters
	function ApplyUserIDFilters($sFilter) {
		return $sFilter;
	}

	// Get SQL
	function GetSQL($where, $orderby) {
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$where, $orderby);
	}

	// Table SQL
	function SQL() {
		$sFilter = $this->CurrentFilter;
		$sFilter = $this->ApplyUserIDFilters($sFilter);
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(),
			$this->SqlGroupBy(), $this->SqlHaving(), $this->SqlOrderBy(),
			$sFilter, $sSort);
	}

	// Table SQL with List page filter
	function SelectSQL() {
		$sFilter = $this->getSessionWhere();
		if ($this->CurrentFilter <> "") {
			if ($sFilter <> "") $sFilter = "(" . $sFilter . ") AND ";
			$sFilter .= "(" . $this->CurrentFilter . ")";
		}
		$sFilter = $this->ApplyUserIDFilters($sFilter);
		$sSort = $this->getSessionOrderBy();
		return ew_BuildSelectSql($this->SqlSelect(), $this->SqlWhere(), $this->SqlGroupBy(),
			$this->SqlHaving(), $this->SqlOrderBy(), $sFilter, $sSort);
	}

	// Try to get record count
	function TryGetRecordCount($sSql) {
		global $conn;
		$cnt = -1;
		if ($this->TableType == 'TABLE' || $this->TableType == 'VIEW') {
			$sSql = "SELECT COUNT(*) FROM" . substr($sSql, 13);
		} else {
			$sSql = "SELECT COUNT(*) FROM (" . $sSql . ") EW_COUNT_TABLE";
		}
		if ($rs = $conn->Execute($sSql)) {
			if (!$rs->EOF && $rs->FieldCount() > 0) {
				$cnt = $rs->fields[0];
				$rs->Close();
			}
		}
		return intval($cnt);
	}

	// Get record count based on filter (for detail record count in master table pages)
	function LoadRecordCount($sFilter) {
		$origFilter = $this->CurrentFilter;
		$this->CurrentFilter = $sFilter;
		$this->Recordset_Selecting($this->CurrentFilter);
		$sSql = $this->SQL();
		$cnt = $this->TryGetRecordCount($sSql);
		if ($cnt == -1) {
			if ($rs = $this->LoadRs($this->CurrentFilter)) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $origFilter;
		return intval($cnt);
	}

	// Get record count (for current List page)
	function SelectRecordCount() {
		global $conn;
		$origFilter = $this->CurrentFilter;
		$this->Recordset_Selecting($this->CurrentFilter);
		$sSql = $this->SelectSQL();
		$cnt = $this->TryGetRecordCount($sSql);
		if ($cnt == -1) {
			if ($rs = $conn->Execute($this->SelectSQL())) {
				$cnt = $rs->RecordCount();
				$rs->Close();
			}
		}
		$this->CurrentFilter = $origFilter;
		return intval($cnt);
	}

	// INSERT statement
	function InsertSQL(&$rs) {
		global $conn;
		$names = "";
		$values = "";
		foreach ($rs as $name => $value) {
			$names .= $this->fields[$name]->FldExpression . ",";
			$values .= ew_QuotedValue($value, $this->fields[$name]->FldDataType) . ",";
		}
		if (substr($names, -1) == ",") $names = substr($names, 0, strlen($names)-1);
		if (substr($values, -1) == ",") $values = substr($values, 0, strlen($values)-1);
		return "INSERT INTO `AwardsEntries` ($names) VALUES ($values)";
	}

	// UPDATE statement
	function UpdateSQL(&$rs) {
		global $conn;
		$SQL = "UPDATE `AwardsEntries` SET ";
		foreach ($rs as $name => $value) {
			$SQL .= $this->fields[$name]->FldExpression . "=";
			$SQL .= ew_QuotedValue($value, $this->fields[$name]->FldDataType) . ",";
		}
		if (substr($SQL, -1) == ",") $SQL = substr($SQL, 0, strlen($SQL)-1);
		if ($this->CurrentFilter <> "")	$SQL .= " WHERE " . $this->CurrentFilter;
		return $SQL;
	}

	// DELETE statement
	function DeleteSQL(&$rs) {
		$SQL = "DELETE FROM `AwardsEntries` WHERE ";
		$SQL .= ew_QuotedName('AwardsEntryID') . '=' . ew_QuotedValue($rs['AwardsEntryID'], $this->AwardsEntryID->FldDataType) . ' AND ';
		if (substr($SQL, -5) == " AND ") $SQL = substr($SQL, 0, strlen($SQL)-5);
		if ($this->CurrentFilter <> "")	$SQL .= " AND " . $this->CurrentFilter;
		return $SQL;
	}

	// Key filter WHERE clause
	function SqlKeyFilter() {
		return "`AwardsEntryID` = @AwardsEntryID@";
	}

	// Key filter
	function KeyFilter() {
		$sKeyFilter = $this->SqlKeyFilter();
		if (!is_numeric($this->AwardsEntryID->CurrentValue))
			$sKeyFilter = "0=1"; // Invalid key
		$sKeyFilter = str_replace("@AwardsEntryID@", ew_AdjustSql($this->AwardsEntryID->CurrentValue), $sKeyFilter); // Replace key value
		return $sKeyFilter;
	}

	// Return page URL
	function getReturnUrl() {
		$name = EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL;

		// Get referer URL automatically
		if (ew_ServerVar("HTTP_REFERER") <> "" && ew_ReferPage() <> ew_CurrentPage() && ew_ReferPage() <> "login.php") // Referer not same page or login page
			$_SESSION[$name] = ew_ServerVar("HTTP_REFERER"); // Save to Session
		if (@$_SESSION[$name] <> "") {
			return $_SESSION[$name];
		} else {
			return "AwardsEntrieslist.php";
		}
	}

	function setReturnUrl($v) {
		$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_RETURN_URL] = $v;
	}

	// List URL
	function ListUrl() {
		return "AwardsEntrieslist.php";
	}

	// View URL
	function ViewUrl() {
		return $this->KeyUrl("AwardsEntriesview.php", $this->UrlParm());
	}

	// Add URL
	function AddUrl() {
		$AddUrl = "AwardsEntriesadd.php";
		$sUrlParm = $this->UrlParm();
		if ($sUrlParm <> "")
			$AddUrl .= "?" . $sUrlParm;
		return $AddUrl;
	}

	// Edit URL
	function EditUrl() {
		return $this->KeyUrl("AwardsEntriesedit.php", $this->UrlParm());
	}

	// Inline edit URL
	function InlineEditUrl() {
		return $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=edit"));
	}

	// Copy URL
	function CopyUrl() {
		return $this->KeyUrl("AwardsEntriesadd.php", $this->UrlParm());
	}

	// Inline copy URL
	function InlineCopyUrl() {
		return $this->KeyUrl(ew_CurrentPage(), $this->UrlParm("a=copy"));
	}

	// Delete URL
	function DeleteUrl() {
		return $this->KeyUrl("AwardsEntriesdelete.php", $this->UrlParm());
	}

	// Add key value to URL
	function KeyUrl($url, $parm = "") {
		$sUrl = $url . "?";
		if ($parm <> "") $sUrl .= $parm . "&";
		if (!is_null($this->AwardsEntryID->CurrentValue)) {
			$sUrl .= "AwardsEntryID=" . urlencode($this->AwardsEntryID->CurrentValue);
		} else {
			return "javascript:alert(ewLanguage.Phrase(\"InvalidRecord\"));";
		}
		return $sUrl;
	}

	// Sort URL
	function SortUrl(&$fld) {
		if ($this->CurrentAction <> "" || $this->Export <> "" ||
			in_array($fld->FldType, array(128, 204, 205))) { // Unsortable data type
				return "";
		} elseif ($fld->Sortable) {
			$sUrlParm = $this->UrlParm("order=" . urlencode($fld->FldName) . "&ordertype=" . $fld->ReverseSort());
			return ew_CurrentPage() . "?" . $sUrlParm;
		} else {
			return "";
		}
	}

	// Add URL parameter
	function UrlParm($parm = "") {
		$UrlParm = ($this->UseTokenInUrl) ? "t=AwardsEntries" : "";
		if ($parm <> "") {
			if ($UrlParm <> "")
				$UrlParm .= "&";
			$UrlParm .= $parm;
		}
		return $UrlParm;
	}

	// Load rows based on filter
	function &LoadRs($sFilter) {
		global $conn;

		// Set up filter (SQL WHERE clause) and get return SQL
		$this->CurrentFilter = $sFilter;
		$sSql = $this->SQL();
		return $conn->Execute($sSql);
	}

	// Load row values from recordset
	function LoadListRowValues(&$rs) {
		$this->AwardsEntryID->setDbValue($rs->fields('AwardsEntryID'));
		$this->DateCreated->setDbValue($rs->fields('DateCreated'));
		$this->AwardYear->setDbValue($rs->fields('AwardYear'));
		$this->PreEntry->setDbValue($rs->fields('PreEntry'));
		$this->Firm_Name->setDbValue($rs->fields('Firm_Name'));
		$this->Award_Category->setDbValue($rs->fields('Award_Category'));
		$this->Start_Date->setDbValue($rs->fields('Start_Date'));
		$this->Project_Name->setDbValue($rs->fields('Project_Name'));
		$this->Completion_Date->setDbValue($rs->fields('Completion_Date'));
		$this->Lead_Consultant_Name->setDbValue($rs->fields('Lead_Consultant_Name'));
		$this->Lead_Consultant_Tel->setDbValue($rs->fields('Lead_Consultant_Tel'));
		$this->Lead_Consultant_Mobile->setDbValue($rs->fields('Lead_Consultant_Mobile'));
		$this->Lead_Consultant_Email->setDbValue($rs->fields('Lead_Consultant_Email'));
		$this->Role_In_Project->setDbValue($rs->fields('Role_In_Project'));
		$this->JV_Partners->setDbValue($rs->fields('JV_Partners'));
		$this->JV_Consent->setDbValue($rs->fields('JV_Consent'));
		$this->Nominee_Name->setDbValue($rs->fields('Nominee_Name'));
		$this->Nominee_Consent->setDbValue($rs->fields('Nominee_Consent'));
		$this->Description_Sent->setDbValue($rs->fields('Description_Sent'));
		$this->Contact_Name->setDbValue($rs->fields('Contact_Name'));
		$this->Contact_Job_Title->setDbValue($rs->fields('Contact_Job_Title'));
		$this->Contact_Tel->setDbValue($rs->fields('Contact_Tel'));
		$this->Contact_Email->setDbValue($rs->fields('Contact_Email'));
		$this->A1_Poster_Required->setDbValue($rs->fields('A1_Poster_Required'));
		$this->Quantity->setDbValue($rs->fields('Quantity'));
		$this->ExternalFormID->setDbValue($rs->fields('ExternalFormID'));
		$this->ExternalEntryID->setDbValue($rs->fields('ExternalEntryID'));
		$this->PreEntryHTML->setDbValue($rs->fields('PreEntryHTML'));
		$this->Contact_Mobile->setDbValue($rs->fields('Contact_Mobile'));
		$this->FullEntryHTML->setDbValue($rs->fields('FullEntryHTML'));
	}

	// Render list row values
	function RenderListRow() {
		global $conn, $Security;

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

   // Common render codes
		// DateCreated

		$this->DateCreated->CellCssStyle = ""; $this->DateCreated->CellCssClass = "";
		$this->DateCreated->CellAttrs = array(); $this->DateCreated->ViewAttrs = array(); $this->DateCreated->EditAttrs = array();

		// AwardYear
		$this->AwardYear->CellCssStyle = ""; $this->AwardYear->CellCssClass = "";
		$this->AwardYear->CellAttrs = array(); $this->AwardYear->ViewAttrs = array(); $this->AwardYear->EditAttrs = array();

		// PreEntry
		$this->PreEntry->CellCssStyle = ""; $this->PreEntry->CellCssClass = "";
		$this->PreEntry->CellAttrs = array(); $this->PreEntry->ViewAttrs = array(); $this->PreEntry->EditAttrs = array();

		// Firm_Name
		$this->Firm_Name->CellCssStyle = ""; $this->Firm_Name->CellCssClass = "";
		$this->Firm_Name->CellAttrs = array(); $this->Firm_Name->ViewAttrs = array(); $this->Firm_Name->EditAttrs = array();

		// Award_Category
		$this->Award_Category->CellCssStyle = ""; $this->Award_Category->CellCssClass = "";
		$this->Award_Category->CellAttrs = array(); $this->Award_Category->ViewAttrs = array(); $this->Award_Category->EditAttrs = array();

		// Start_Date
		$this->Start_Date->CellCssStyle = ""; $this->Start_Date->CellCssClass = "";
		$this->Start_Date->CellAttrs = array(); $this->Start_Date->ViewAttrs = array(); $this->Start_Date->EditAttrs = array();

		// Project_Name
		$this->Project_Name->CellCssStyle = ""; $this->Project_Name->CellCssClass = "";
		$this->Project_Name->CellAttrs = array(); $this->Project_Name->ViewAttrs = array(); $this->Project_Name->EditAttrs = array();

		// Completion_Date
		$this->Completion_Date->CellCssStyle = ""; $this->Completion_Date->CellCssClass = "";
		$this->Completion_Date->CellAttrs = array(); $this->Completion_Date->ViewAttrs = array(); $this->Completion_Date->EditAttrs = array();

		// Lead_Consultant_Name
		$this->Lead_Consultant_Name->CellCssStyle = ""; $this->Lead_Consultant_Name->CellCssClass = "";
		$this->Lead_Consultant_Name->CellAttrs = array(); $this->Lead_Consultant_Name->ViewAttrs = array(); $this->Lead_Consultant_Name->EditAttrs = array();

		// Lead_Consultant_Tel
		$this->Lead_Consultant_Tel->CellCssStyle = ""; $this->Lead_Consultant_Tel->CellCssClass = "";
		$this->Lead_Consultant_Tel->CellAttrs = array(); $this->Lead_Consultant_Tel->ViewAttrs = array(); $this->Lead_Consultant_Tel->EditAttrs = array();

		// Lead_Consultant_Mobile
		$this->Lead_Consultant_Mobile->CellCssStyle = ""; $this->Lead_Consultant_Mobile->CellCssClass = "";
		$this->Lead_Consultant_Mobile->CellAttrs = array(); $this->Lead_Consultant_Mobile->ViewAttrs = array(); $this->Lead_Consultant_Mobile->EditAttrs = array();

		// Lead_Consultant_Email
		$this->Lead_Consultant_Email->CellCssStyle = ""; $this->Lead_Consultant_Email->CellCssClass = "";
		$this->Lead_Consultant_Email->CellAttrs = array(); $this->Lead_Consultant_Email->ViewAttrs = array(); $this->Lead_Consultant_Email->EditAttrs = array();

		// Role_In_Project
		$this->Role_In_Project->CellCssStyle = ""; $this->Role_In_Project->CellCssClass = "";
		$this->Role_In_Project->CellAttrs = array(); $this->Role_In_Project->ViewAttrs = array(); $this->Role_In_Project->EditAttrs = array();

		// JV_Partners
		$this->JV_Partners->CellCssStyle = ""; $this->JV_Partners->CellCssClass = "";
		$this->JV_Partners->CellAttrs = array(); $this->JV_Partners->ViewAttrs = array(); $this->JV_Partners->EditAttrs = array();

		// Nominee_Name
		$this->Nominee_Name->CellCssStyle = ""; $this->Nominee_Name->CellCssClass = "";
		$this->Nominee_Name->CellAttrs = array(); $this->Nominee_Name->ViewAttrs = array(); $this->Nominee_Name->EditAttrs = array();

		// Nominee_Consent
		$this->Nominee_Consent->CellCssStyle = ""; $this->Nominee_Consent->CellCssClass = "";
		$this->Nominee_Consent->CellAttrs = array(); $this->Nominee_Consent->ViewAttrs = array(); $this->Nominee_Consent->EditAttrs = array();

		// Description_Sent
		$this->Description_Sent->CellCssStyle = ""; $this->Description_Sent->CellCssClass = "";
		$this->Description_Sent->CellAttrs = array(); $this->Description_Sent->ViewAttrs = array(); $this->Description_Sent->EditAttrs = array();

		// Contact_Name
		$this->Contact_Name->CellCssStyle = ""; $this->Contact_Name->CellCssClass = "";
		$this->Contact_Name->CellAttrs = array(); $this->Contact_Name->ViewAttrs = array(); $this->Contact_Name->EditAttrs = array();

		// Contact_Job_Title
		$this->Contact_Job_Title->CellCssStyle = ""; $this->Contact_Job_Title->CellCssClass = "";
		$this->Contact_Job_Title->CellAttrs = array(); $this->Contact_Job_Title->ViewAttrs = array(); $this->Contact_Job_Title->EditAttrs = array();

		// Contact_Tel
		$this->Contact_Tel->CellCssStyle = ""; $this->Contact_Tel->CellCssClass = "";
		$this->Contact_Tel->CellAttrs = array(); $this->Contact_Tel->ViewAttrs = array(); $this->Contact_Tel->EditAttrs = array();

		// Contact_Email
		$this->Contact_Email->CellCssStyle = ""; $this->Contact_Email->CellCssClass = "";
		$this->Contact_Email->CellAttrs = array(); $this->Contact_Email->ViewAttrs = array(); $this->Contact_Email->EditAttrs = array();

		// A1_Poster_Required
		$this->A1_Poster_Required->CellCssStyle = ""; $this->A1_Poster_Required->CellCssClass = "";
		$this->A1_Poster_Required->CellAttrs = array(); $this->A1_Poster_Required->ViewAttrs = array(); $this->A1_Poster_Required->EditAttrs = array();

		// Quantity
		$this->Quantity->CellCssStyle = ""; $this->Quantity->CellCssClass = "";
		$this->Quantity->CellAttrs = array(); $this->Quantity->ViewAttrs = array(); $this->Quantity->EditAttrs = array();

		// Contact_Mobile
		$this->Contact_Mobile->CellCssStyle = ""; $this->Contact_Mobile->CellCssClass = "";
		$this->Contact_Mobile->CellAttrs = array(); $this->Contact_Mobile->ViewAttrs = array(); $this->Contact_Mobile->EditAttrs = array();

		// DateCreated
		$this->DateCreated->ViewValue = $this->DateCreated->CurrentValue;
		$this->DateCreated->ViewValue = ew_FormatDateTime($this->DateCreated->ViewValue, 5);
		$this->DateCreated->CssStyle = "";
		$this->DateCreated->CssClass = "";
		$this->DateCreated->ViewCustomAttributes = "";

		// AwardYear
		$this->AwardYear->ViewValue = $this->AwardYear->CurrentValue;
		$this->AwardYear->CssStyle = "";
		$this->AwardYear->CssClass = "";
		$this->AwardYear->ViewCustomAttributes = "";

		// PreEntry
		if (strval($this->PreEntry->CurrentValue) <> "") {
			switch ($this->PreEntry->CurrentValue) {
				case "1":
					$this->PreEntry->ViewValue = "Pre-Entry";
					break;
				case "0":
					$this->PreEntry->ViewValue = "Full Entry";
					break;
				default:
					$this->PreEntry->ViewValue = $this->PreEntry->CurrentValue;
			}
		} else {
			$this->PreEntry->ViewValue = NULL;
		}
		$this->PreEntry->CssStyle = "";
		$this->PreEntry->CssClass = "";
		$this->PreEntry->ViewCustomAttributes = "";

		// Firm_Name
		$this->Firm_Name->ViewValue = $this->Firm_Name->CurrentValue;
		$this->Firm_Name->CssStyle = "";
		$this->Firm_Name->CssClass = "";
		$this->Firm_Name->ViewCustomAttributes = "";

		// Award_Category
		$this->Award_Category->ViewValue = $this->Award_Category->CurrentValue;
		if (strval($this->Award_Category->CurrentValue) <> "") {
			$sFilterWrk = "`Award_Category` = '" . ew_AdjustSql($this->Award_Category->CurrentValue) . "'";
		$sSqlWrk = "SELECT DISTINCT `Award_Category` FROM `AwardsEntries`";
		$sWhereWrk = "";
		if ($sFilterWrk <> "") {
			if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
			$sWhereWrk .= "(" . $sFilterWrk . ")";
		}
		if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
		$sSqlWrk .= " ORDER BY `Award_Category` Asc";
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk && !$rswrk->EOF) { // Lookup values found
				$this->Award_Category->ViewValue = $rswrk->fields('Award_Category');
				$rswrk->Close();
			} else {
				$this->Award_Category->ViewValue = $this->Award_Category->CurrentValue;
			}
		} else {
			$this->Award_Category->ViewValue = NULL;
		}
		$this->Award_Category->CssStyle = "";
		$this->Award_Category->CssClass = "";
		$this->Award_Category->ViewCustomAttributes = "";

		// Start_Date
		$this->Start_Date->ViewValue = $this->Start_Date->CurrentValue;
		$this->Start_Date->CssStyle = "";
		$this->Start_Date->CssClass = "";
		$this->Start_Date->ViewCustomAttributes = "";

		// Project_Name
		$this->Project_Name->ViewValue = $this->Project_Name->CurrentValue;
		$this->Project_Name->CssStyle = "";
		$this->Project_Name->CssClass = "";
		$this->Project_Name->ViewCustomAttributes = "";

		// Completion_Date
		$this->Completion_Date->ViewValue = $this->Completion_Date->CurrentValue;
		$this->Completion_Date->CssStyle = "";
		$this->Completion_Date->CssClass = "";
		$this->Completion_Date->ViewCustomAttributes = "";

		// Lead_Consultant_Name
		$this->Lead_Consultant_Name->ViewValue = $this->Lead_Consultant_Name->CurrentValue;
		$this->Lead_Consultant_Name->CssStyle = "";
		$this->Lead_Consultant_Name->CssClass = "";
		$this->Lead_Consultant_Name->ViewCustomAttributes = "";

		// Lead_Consultant_Tel
		$this->Lead_Consultant_Tel->ViewValue = $this->Lead_Consultant_Tel->CurrentValue;
		$this->Lead_Consultant_Tel->CssStyle = "";
		$this->Lead_Consultant_Tel->CssClass = "";
		$this->Lead_Consultant_Tel->ViewCustomAttributes = "";

		// Lead_Consultant_Mobile
		$this->Lead_Consultant_Mobile->ViewValue = $this->Lead_Consultant_Mobile->CurrentValue;
		$this->Lead_Consultant_Mobile->CssStyle = "";
		$this->Lead_Consultant_Mobile->CssClass = "";
		$this->Lead_Consultant_Mobile->ViewCustomAttributes = "";

		// Lead_Consultant_Email
		$this->Lead_Consultant_Email->ViewValue = $this->Lead_Consultant_Email->CurrentValue;
		$this->Lead_Consultant_Email->CssStyle = "";
		$this->Lead_Consultant_Email->CssClass = "";
		$this->Lead_Consultant_Email->ViewCustomAttributes = "";

		// Role_In_Project
		$this->Role_In_Project->ViewValue = $this->Role_In_Project->CurrentValue;
		$this->Role_In_Project->CssStyle = "";
		$this->Role_In_Project->CssClass = "";
		$this->Role_In_Project->ViewCustomAttributes = "";

		// JV_Partners
		$this->JV_Partners->ViewValue = $this->JV_Partners->CurrentValue;
		$this->JV_Partners->CssStyle = "";
		$this->JV_Partners->CssClass = "";
		$this->JV_Partners->ViewCustomAttributes = "";

		// Nominee_Name
		$this->Nominee_Name->ViewValue = $this->Nominee_Name->CurrentValue;
		$this->Nominee_Name->CssStyle = "";
		$this->Nominee_Name->CssClass = "";
		$this->Nominee_Name->ViewCustomAttributes = "";

		// Nominee_Consent
		$this->Nominee_Consent->ViewValue = $this->Nominee_Consent->CurrentValue;
		$this->Nominee_Consent->CssStyle = "";
		$this->Nominee_Consent->CssClass = "";
		$this->Nominee_Consent->ViewCustomAttributes = "";

		// Description_Sent
		$this->Description_Sent->ViewValue = $this->Description_Sent->CurrentValue;
		$this->Description_Sent->CssStyle = "";
		$this->Description_Sent->CssClass = "";
		$this->Description_Sent->ViewCustomAttributes = "";

		// Contact_Name
		$this->Contact_Name->ViewValue = $this->Contact_Name->CurrentValue;
		$this->Contact_Name->CssStyle = "";
		$this->Contact_Name->CssClass = "";
		$this->Contact_Name->ViewCustomAttributes = "";

		// Contact_Job_Title
		$this->Contact_Job_Title->ViewValue = $this->Contact_Job_Title->CurrentValue;
		$this->Contact_Job_Title->CssStyle = "";
		$this->Contact_Job_Title->CssClass = "";
		$this->Contact_Job_Title->ViewCustomAttributes = "";

		// Contact_Tel
		$this->Contact_Tel->ViewValue = $this->Contact_Tel->CurrentValue;
		$this->Contact_Tel->CssStyle = "";
		$this->Contact_Tel->CssClass = "";
		$this->Contact_Tel->ViewCustomAttributes = "";

		// Contact_Email
		$this->Contact_Email->ViewValue = $this->Contact_Email->CurrentValue;
		$this->Contact_Email->CssStyle = "";
		$this->Contact_Email->CssClass = "";
		$this->Contact_Email->ViewCustomAttributes = "";

		// A1_Poster_Required
		$this->A1_Poster_Required->ViewValue = $this->A1_Poster_Required->CurrentValue;
		$this->A1_Poster_Required->CssStyle = "";
		$this->A1_Poster_Required->CssClass = "";
		$this->A1_Poster_Required->ViewCustomAttributes = "";

		// Quantity
		$this->Quantity->ViewValue = $this->Quantity->CurrentValue;
		$this->Quantity->CssStyle = "";
		$this->Quantity->CssClass = "";
		$this->Quantity->ViewCustomAttributes = "";

		// Contact_Mobile
		$this->Contact_Mobile->ViewValue = $this->Contact_Mobile->CurrentValue;
		$this->Contact_Mobile->CssStyle = "";
		$this->Contact_Mobile->CssClass = "";
		$this->Contact_Mobile->ViewCustomAttributes = "";

		// DateCreated
		$this->DateCreated->HrefValue = "";
		$this->DateCreated->TooltipValue = "";

		// AwardYear
		$this->AwardYear->HrefValue = "";
		$this->AwardYear->TooltipValue = "";

		// PreEntry
		$this->PreEntry->HrefValue = "";
		$this->PreEntry->TooltipValue = "";

		// Firm_Name
		$this->Firm_Name->HrefValue = "";
		$this->Firm_Name->TooltipValue = "";

		// Award_Category
		$this->Award_Category->HrefValue = "";
		$this->Award_Category->TooltipValue = "";

		// Start_Date
		$this->Start_Date->HrefValue = "";
		$this->Start_Date->TooltipValue = "";

		// Project_Name
		$this->Project_Name->HrefValue = "";
		$this->Project_Name->TooltipValue = "";

		// Completion_Date
		$this->Completion_Date->HrefValue = "";
		$this->Completion_Date->TooltipValue = "";

		// Lead_Consultant_Name
		$this->Lead_Consultant_Name->HrefValue = "";
		$this->Lead_Consultant_Name->TooltipValue = "";

		// Lead_Consultant_Tel
		$this->Lead_Consultant_Tel->HrefValue = "";
		$this->Lead_Consultant_Tel->TooltipValue = "";

		// Lead_Consultant_Mobile
		$this->Lead_Consultant_Mobile->HrefValue = "";
		$this->Lead_Consultant_Mobile->TooltipValue = "";

		// Lead_Consultant_Email
		$this->Lead_Consultant_Email->HrefValue = "";
		$this->Lead_Consultant_Email->TooltipValue = "";

		// Role_In_Project
		$this->Role_In_Project->HrefValue = "";
		$this->Role_In_Project->TooltipValue = "";

		// JV_Partners
		$this->JV_Partners->HrefValue = "";
		$this->JV_Partners->TooltipValue = "";

		// Nominee_Name
		$this->Nominee_Name->HrefValue = "";
		$this->Nominee_Name->TooltipValue = "";

		// Nominee_Consent
		$this->Nominee_Consent->HrefValue = "";
		$this->Nominee_Consent->TooltipValue = "";

		// Description_Sent
		$this->Description_Sent->HrefValue = "";
		$this->Description_Sent->TooltipValue = "";

		// Contact_Name
		$this->Contact_Name->HrefValue = "";
		$this->Contact_Name->TooltipValue = "";

		// Contact_Job_Title
		$this->Contact_Job_Title->HrefValue = "";
		$this->Contact_Job_Title->TooltipValue = "";

		// Contact_Tel
		$this->Contact_Tel->HrefValue = "";
		$this->Contact_Tel->TooltipValue = "";

		// Contact_Email
		$this->Contact_Email->HrefValue = "";
		$this->Contact_Email->TooltipValue = "";

		// A1_Poster_Required
		$this->A1_Poster_Required->HrefValue = "";
		$this->A1_Poster_Required->TooltipValue = "";

		// Quantity
		$this->Quantity->HrefValue = "";
		$this->Quantity->TooltipValue = "";

		// Contact_Mobile
		$this->Contact_Mobile->HrefValue = "";
		$this->Contact_Mobile->TooltipValue = "";

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

	// Aggregate list row values
	function AggregateListRowValues() {
	}

	// Aggregate list row (for rendering)
	function AggregateListRow() {
	}

	// Row styles
	function RowStyles() {
		$sAtt = "";
		$sStyle = trim($this->CssStyle);
		if (@$this->RowAttrs["style"] <> "")
			$sStyle .= " " . $this->RowAttrs["style"];
		$sClass = trim($this->CssClass);
		if (@$this->RowAttrs["class"] <> "")
			$sClass .= " " . $this->RowAttrs["class"];
		if (trim($sStyle) <> "")
			$sAtt .= " style=\"" . trim($sStyle) . "\"";
		if (trim($sClass) <> "")
			$sAtt .= " class=\"" . trim($sClass) . "\"";
		return $sAtt;
	}

	// Row attributes
	function RowAttributes() {
		$sAtt = $this->RowStyles();
		if ($this->Export == "") {
			foreach ($this->RowAttrs as $k => $v) {
				if ($k <> "class" && $k <> "style" && trim($v) <> "")
					$sAtt .= " " . $k . "=\"" . trim($v) . "\"";
			}
		}
		return $sAtt;
	}

	// Field object by name
	function fields($fldname) {
		return $this->fields[$fldname];
	}

	// 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 Rendering event
	function Row_Rendering() {

		// Enter your code here	
	}

	// Row Rendered event
	function Row_Rendered() {

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

	}

	// Row Inserting event
	function Row_Inserting(&$rs) {

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

		return TRUE;
	}

	// Row Inserted event
	function Row_Inserted(&$rs) {

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

	// 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;
	}
}
?>