Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cpdadmin/
Upload File :
Current File : /var/www/cesa.co.za/cpdadmin/CPDTrainingMaterialinfo.php

<?php

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

//
// Table class for CPDTrainingMaterial
//
class cCPDTrainingMaterial {
	var $TableVar = 'CPDTrainingMaterial';
	var $TableName = 'CPDTrainingMaterial';
	var $TableType = 'TABLE';
	var $MaterialID;
	var $ProviderID;
	var $Subject;
	var $RenewOrNew;
	var $Status;
	var $Duration;
	var $DurationUnit;
	var $DurationType;
	var $Level;
	var $NQFLevel;
	var $EventDescription;
	var $CourseBrochure;
	var $ActivityProgramme;
	var $LearningOutcomesFile;
	var $TrainingManualLink;
	var $PresentationLink;
	var $HandOutsLink;
	var $FeedbackForm;
	var $LearningOutcomes;
	var $ModeOfDelivery;
	var $TargetAudience;
	var $Objectives;
	var $Promotion;
	var $Motivation;
	var $AccredNum;
	var $PrevAccredNum;
	var $DateApproved;
	var $DateExpires;
	var $Certification;
	var $CPD;
	var $InvoiceCode;
	var $InvoiceNumber;
	var $Cost;
	var $CostToDelegate;
	var $DepositAmt;
	var $InvoiceFile;
	var $InvoiceDate;
	var $DatePaid;
	var $ProofOfPayment;
	var $EvaluatorID;
	var $EvaluatorID2;
	var $EvaluatorID3;
	var $EvaluatorFee;
	var $EvaluatorFeeAmount;
	var $EvaluatorFeeDate;
	var $EvaluatorInvoice;
	var $EvaluatorTimesheet;
	var $StartDate;
	var $Other_Validator;
	var $Provider_URL;
	var $Notional_Hours;
	var $Category_Reg;
	var $Discipline;
	var $Sub_Discipline;
	var $Activity_Nature;
	var $Instances;
	var $RemoteUpload;
	var $LocalUpload;
	var $AssessmentDoc;
	var $ResponsiblePersonFirstName;
	var $ResponsiblePersonLastName;
	var $ResponsiblePersonEMailAddress;
	var $ResponsibleBillingAddress;
	var $ResponsiblePersonContactNumber;
	var $ResponsibleVATNumber;
	var $Comments;
	var $Archived;
	var $Presenter1Title;
	var $Presenter1FirstName;
	var $Presenter1Surname;
	var $Presenter1Phone;
	var $Presenter1Email;
	var $Presenter1ID;
	var $Presenter1CV;
	var $Presenter1SLA;
	var $Presenter1IDDoc;
	var $Presenter2Title;
	var $Presenter2FirstName;
	var $Presenter2Surname;
	var $Presenter2Phone;
	var $Presenter2Email;
	var $Presenter2ID;
	var $Presenter2CV;
	var $Presenter2SLA;
	var $Presenter2IDDoc;
	var $Presenter3Title;
	var $Presenter3FirstName;
	var $Presenter3Surname;
	var $Presenter3Phone;
	var $Presenter3Email;
	var $Presenter3ID;
	var $Presenter3CV;
	var $Presenter3SLA;
	var $Presenter3IDDoc;
	var $NumReminders;
	var $LastReminder;
	var $DateCreated;
	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;

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

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

		// Subject
		$this->Subject = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Subject', 'Subject', '`Subject`', 200, -1, FALSE, '`Subject`', FALSE);
		$this->fields['Subject'] =& $this->Subject;

		// RenewOrNew
		$this->RenewOrNew = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_RenewOrNew', 'RenewOrNew', '`RenewOrNew`', 200, -1, FALSE, '`RenewOrNew`', FALSE);
		$this->fields['RenewOrNew'] =& $this->RenewOrNew;

		// Status
		$this->Status = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Status', 'Status', '`Status`', 200, -1, FALSE, '`Status`', FALSE);
		$this->fields['Status'] =& $this->Status;

		// Duration
		$this->Duration = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Duration', 'Duration', '`Duration`', 131, -1, FALSE, '`Duration`', FALSE);
		$this->Duration->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['Duration'] =& $this->Duration;

		// DurationUnit
		$this->DurationUnit = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_DurationUnit', 'DurationUnit', '`DurationUnit`', 200, -1, FALSE, '`DurationUnit`', FALSE);
		$this->fields['DurationUnit'] =& $this->DurationUnit;

		// DurationType
		$this->DurationType = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_DurationType', 'DurationType', '`DurationType`', 202, -1, FALSE, '`DurationType`', FALSE);
		$this->fields['DurationType'] =& $this->DurationType;

		// Level
		$this->Level = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Level', 'Level', '`Level`', 200, -1, FALSE, '`Level`', FALSE);
		$this->fields['Level'] =& $this->Level;

		// NQFLevel
		$this->NQFLevel = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_NQFLevel', 'NQFLevel', '`NQFLevel`', 200, -1, FALSE, '`NQFLevel`', FALSE);
		$this->fields['NQFLevel'] =& $this->NQFLevel;

		// EventDescription
		$this->EventDescription = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_EventDescription', 'EventDescription', '`EventDescription`', 201, -1, FALSE, '`EventDescription`', FALSE);
		$this->EventDescription->TruncateMemoRemoveHtml = TRUE;
		$this->fields['EventDescription'] =& $this->EventDescription;

		// CourseBrochure
		$this->CourseBrochure = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_CourseBrochure', 'CourseBrochure', '`CourseBrochure`', 200, -1, TRUE, '`CourseBrochure`', FALSE);
		$this->CourseBrochure->UploadPath = "../uploads";
		$this->fields['CourseBrochure'] =& $this->CourseBrochure;

		// ActivityProgramme
		$this->ActivityProgramme = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ActivityProgramme', 'ActivityProgramme', '`ActivityProgramme`', 200, -1, TRUE, '`ActivityProgramme`', FALSE);
		$this->ActivityProgramme->UploadPath = "../uploads";
		$this->fields['ActivityProgramme'] =& $this->ActivityProgramme;

		// LearningOutcomesFile
		$this->LearningOutcomesFile = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_LearningOutcomesFile', 'LearningOutcomesFile', '`LearningOutcomesFile`', 200, -1, TRUE, '`LearningOutcomesFile`', FALSE);
		$this->LearningOutcomesFile->UploadPath = "../uploads";
		$this->fields['LearningOutcomesFile'] =& $this->LearningOutcomesFile;

		// TrainingManualLink
		$this->TrainingManualLink = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_TrainingManualLink', 'TrainingManualLink', '`TrainingManualLink`', 200, -1, FALSE, '`TrainingManualLink`', FALSE);
		$this->fields['TrainingManualLink'] =& $this->TrainingManualLink;

		// PresentationLink
		$this->PresentationLink = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_PresentationLink', 'PresentationLink', '`PresentationLink`', 200, -1, FALSE, '`PresentationLink`', FALSE);
		$this->fields['PresentationLink'] =& $this->PresentationLink;

		// HandOutsLink
		$this->HandOutsLink = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_HandOutsLink', 'HandOutsLink', '`HandOutsLink`', 200, -1, FALSE, '`HandOutsLink`', FALSE);
		$this->fields['HandOutsLink'] =& $this->HandOutsLink;

		// FeedbackForm
		$this->FeedbackForm = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_FeedbackForm', 'FeedbackForm', '`FeedbackForm`', 200, -1, TRUE, '`FeedbackForm`', FALSE);
		$this->FeedbackForm->UploadPath = "../uploads";
		$this->fields['FeedbackForm'] =& $this->FeedbackForm;

		// LearningOutcomes
		$this->LearningOutcomes = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_LearningOutcomes', 'LearningOutcomes', '`LearningOutcomes`', 201, -1, FALSE, '`LearningOutcomes`', FALSE);
		$this->fields['LearningOutcomes'] =& $this->LearningOutcomes;

		// ModeOfDelivery
		$this->ModeOfDelivery = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ModeOfDelivery', 'ModeOfDelivery', '`ModeOfDelivery`', 200, -1, FALSE, '`ModeOfDelivery`', FALSE);
		$this->fields['ModeOfDelivery'] =& $this->ModeOfDelivery;

		// TargetAudience
		$this->TargetAudience = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_TargetAudience', 'TargetAudience', '`TargetAudience`', 201, -1, FALSE, '`TargetAudience`', FALSE);
		$this->fields['TargetAudience'] =& $this->TargetAudience;

		// Objectives
		$this->Objectives = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Objectives', 'Objectives', '`Objectives`', 201, -1, FALSE, '`Objectives`', FALSE);
		$this->fields['Objectives'] =& $this->Objectives;

		// Promotion
		$this->Promotion = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Promotion', 'Promotion', '`Promotion`', 200, -1, FALSE, '`Promotion`', FALSE);
		$this->fields['Promotion'] =& $this->Promotion;

		// Motivation
		$this->Motivation = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Motivation', 'Motivation', '`Motivation`', 201, -1, FALSE, '`Motivation`', FALSE);
		$this->fields['Motivation'] =& $this->Motivation;

		// AccredNum
		$this->AccredNum = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_AccredNum', 'AccredNum', '`AccredNum`', 200, -1, FALSE, '`AccredNum`', FALSE);
		$this->fields['AccredNum'] =& $this->AccredNum;

		// PrevAccredNum
		$this->PrevAccredNum = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_PrevAccredNum', 'PrevAccredNum', '`PrevAccredNum`', 200, -1, FALSE, '`PrevAccredNum`', FALSE);
		$this->fields['PrevAccredNum'] =& $this->PrevAccredNum;

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

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

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

		// CPD
		$this->CPD = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_CPD', 'CPD', '`CPD`', 200, -1, FALSE, '`CPD`', FALSE);
		$this->fields['CPD'] =& $this->CPD;

		// InvoiceCode
		$this->InvoiceCode = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_InvoiceCode', 'InvoiceCode', '`InvoiceCode`', 200, -1, FALSE, '`InvoiceCode`', FALSE);
		$this->fields['InvoiceCode'] =& $this->InvoiceCode;

		// InvoiceNumber
		$this->InvoiceNumber = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_InvoiceNumber', 'InvoiceNumber', '`InvoiceNumber`', 200, -1, FALSE, '`InvoiceNumber`', FALSE);
		$this->fields['InvoiceNumber'] =& $this->InvoiceNumber;

		// Cost
		$this->Cost = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Cost', 'Cost', '`Cost`', 131, -1, FALSE, '`Cost`', FALSE);
		$this->Cost->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['Cost'] =& $this->Cost;

		// CostToDelegate
		$this->CostToDelegate = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_CostToDelegate', 'CostToDelegate', '`CostToDelegate`', 131, -1, FALSE, '`CostToDelegate`', FALSE);
		$this->CostToDelegate->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['CostToDelegate'] =& $this->CostToDelegate;

		// DepositAmt
		$this->DepositAmt = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_DepositAmt', 'DepositAmt', '`DepositAmt`', 131, -1, FALSE, '`DepositAmt`', FALSE);
		$this->DepositAmt->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['DepositAmt'] =& $this->DepositAmt;

		// InvoiceFile
		$this->InvoiceFile = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_InvoiceFile', 'InvoiceFile', '`InvoiceFile`', 200, -1, TRUE, '`InvoiceFile`', FALSE);
		$this->InvoiceFile->UploadPath = "uploads";
		$this->fields['InvoiceFile'] =& $this->InvoiceFile;

		// InvoiceDate
		$this->InvoiceDate = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_InvoiceDate', 'InvoiceDate', '`InvoiceDate`', 133, 5, FALSE, '`InvoiceDate`', FALSE);
		$this->InvoiceDate->FldDefaultErrMsg = str_replace("%s", "/", $Language->Phrase("IncorrectDateYMD"));
		$this->fields['InvoiceDate'] =& $this->InvoiceDate;

		// DatePaid
		$this->DatePaid = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_DatePaid', 'DatePaid', '`DatePaid`', 133, 5, FALSE, '`DatePaid`', FALSE);
		$this->DatePaid->FldDefaultErrMsg = str_replace("%s", "/", $Language->Phrase("IncorrectDateYMD"));
		$this->fields['DatePaid'] =& $this->DatePaid;

		// ProofOfPayment
		$this->ProofOfPayment = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ProofOfPayment', 'ProofOfPayment', '`ProofOfPayment`', 200, -1, TRUE, '`ProofOfPayment`', FALSE);
		$this->ProofOfPayment->UploadPath = "../uploads";
		$this->fields['ProofOfPayment'] =& $this->ProofOfPayment;

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

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

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

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

		// EvaluatorFeeAmount
		$this->EvaluatorFeeAmount = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_EvaluatorFeeAmount', 'EvaluatorFeeAmount', '`EvaluatorFeeAmount`', 131, -1, FALSE, '`EvaluatorFeeAmount`', FALSE);
		$this->EvaluatorFeeAmount->FldDefaultErrMsg = $Language->Phrase("IncorrectFloat");
		$this->fields['EvaluatorFeeAmount'] =& $this->EvaluatorFeeAmount;

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

		// EvaluatorInvoice
		$this->EvaluatorInvoice = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_EvaluatorInvoice', 'EvaluatorInvoice', '`EvaluatorInvoice`', 200, -1, TRUE, '`EvaluatorInvoice`', FALSE);
		$this->EvaluatorInvoice->UploadPath = "../uploads";
		$this->fields['EvaluatorInvoice'] =& $this->EvaluatorInvoice;

		// EvaluatorTimesheet
		$this->EvaluatorTimesheet = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_EvaluatorTimesheet', 'EvaluatorTimesheet', '`EvaluatorTimesheet`', 200, -1, TRUE, '`EvaluatorTimesheet`', FALSE);
		$this->EvaluatorTimesheet->UploadPath = "../uploads";
		$this->fields['EvaluatorTimesheet'] =& $this->EvaluatorTimesheet;

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

		// Other_Validator
		$this->Other_Validator = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Other_Validator', 'Other_Validator', '`Other_Validator`', 200, -1, FALSE, '`Other_Validator`', FALSE);
		$this->fields['Other_Validator'] =& $this->Other_Validator;

		// Provider_URL
		$this->Provider_URL = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Provider_URL', 'Provider_URL', '`Provider_URL`', 200, -1, FALSE, '`Provider_URL`', FALSE);
		$this->fields['Provider_URL'] =& $this->Provider_URL;

		// Notional_Hours
		$this->Notional_Hours = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Notional_Hours', 'Notional_Hours', '`Notional_Hours`', 200, -1, FALSE, '`Notional_Hours`', FALSE);
		$this->fields['Notional_Hours'] =& $this->Notional_Hours;

		// Category_Reg
		$this->Category_Reg = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Category_Reg', 'Category_Reg', '`Category_Reg`', 200, -1, FALSE, '`Category_Reg`', FALSE);
		$this->fields['Category_Reg'] =& $this->Category_Reg;

		// Discipline
		$this->Discipline = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Discipline', 'Discipline', '`Discipline`', 200, -1, FALSE, '`Discipline`', FALSE);
		$this->fields['Discipline'] =& $this->Discipline;

		// Sub_Discipline
		$this->Sub_Discipline = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Sub_Discipline', 'Sub_Discipline', '`Sub_Discipline`', 200, -1, FALSE, '`Sub_Discipline`', FALSE);
		$this->fields['Sub_Discipline'] =& $this->Sub_Discipline;

		// Activity_Nature
		$this->Activity_Nature = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Activity_Nature', 'Activity_Nature', '`Activity_Nature`', 200, -1, FALSE, '`Activity_Nature`', FALSE);
		$this->fields['Activity_Nature'] =& $this->Activity_Nature;

		// Instances
		$this->Instances = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Instances', 'Instances', '`Instances`', 200, -1, FALSE, '`Instances`', FALSE);
		$this->fields['Instances'] =& $this->Instances;

		// RemoteUpload
		$this->RemoteUpload = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_RemoteUpload', 'RemoteUpload', '`RemoteUpload`', 200, -1, FALSE, '`RemoteUpload`', FALSE);
		$this->fields['RemoteUpload'] =& $this->RemoteUpload;

		// LocalUpload
		$this->LocalUpload = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_LocalUpload', 'LocalUpload', '`LocalUpload`', 200, -1, FALSE, '`LocalUpload`', FALSE);
		$this->fields['LocalUpload'] =& $this->LocalUpload;

		// AssessmentDoc
		$this->AssessmentDoc = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_AssessmentDoc', 'AssessmentDoc', '`AssessmentDoc`', 200, -1, TRUE, '`AssessmentDoc`', FALSE);
		$this->AssessmentDoc->UploadPath = "uploads";
		$this->fields['AssessmentDoc'] =& $this->AssessmentDoc;

		// ResponsiblePersonFirstName
		$this->ResponsiblePersonFirstName = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsiblePersonFirstName', 'ResponsiblePersonFirstName', '`ResponsiblePersonFirstName`', 200, -1, FALSE, '`ResponsiblePersonFirstName`', FALSE);
		$this->fields['ResponsiblePersonFirstName'] =& $this->ResponsiblePersonFirstName;

		// ResponsiblePersonLastName
		$this->ResponsiblePersonLastName = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsiblePersonLastName', 'ResponsiblePersonLastName', '`ResponsiblePersonLastName`', 200, -1, FALSE, '`ResponsiblePersonLastName`', FALSE);
		$this->fields['ResponsiblePersonLastName'] =& $this->ResponsiblePersonLastName;

		// ResponsiblePersonEMailAddress
		$this->ResponsiblePersonEMailAddress = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsiblePersonEMailAddress', 'ResponsiblePersonEMailAddress', '`ResponsiblePersonEMailAddress`', 200, -1, FALSE, '`ResponsiblePersonEMailAddress`', FALSE);
		$this->fields['ResponsiblePersonEMailAddress'] =& $this->ResponsiblePersonEMailAddress;

		// ResponsibleBillingAddress
		$this->ResponsibleBillingAddress = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsibleBillingAddress', 'ResponsibleBillingAddress', '`ResponsibleBillingAddress`', 201, -1, FALSE, '`ResponsibleBillingAddress`', FALSE);
		$this->fields['ResponsibleBillingAddress'] =& $this->ResponsibleBillingAddress;

		// ResponsiblePersonContactNumber
		$this->ResponsiblePersonContactNumber = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsiblePersonContactNumber', 'ResponsiblePersonContactNumber', '`ResponsiblePersonContactNumber`', 200, -1, FALSE, '`ResponsiblePersonContactNumber`', FALSE);
		$this->fields['ResponsiblePersonContactNumber'] =& $this->ResponsiblePersonContactNumber;

		// ResponsibleVATNumber
		$this->ResponsibleVATNumber = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_ResponsibleVATNumber', 'ResponsibleVATNumber', '`ResponsibleVATNumber`', 200, -1, FALSE, '`ResponsibleVATNumber`', FALSE);
		$this->fields['ResponsibleVATNumber'] =& $this->ResponsibleVATNumber;

		// Comments
		$this->Comments = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Comments', 'Comments', '`Comments`', 201, -1, FALSE, '`Comments`', FALSE);
		$this->fields['Comments'] =& $this->Comments;

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

		// Presenter1Title
		$this->Presenter1Title = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1Title', 'Presenter1Title', '`Presenter1Title`', 200, -1, FALSE, '`Presenter1Title`', FALSE);
		$this->fields['Presenter1Title'] =& $this->Presenter1Title;

		// Presenter1FirstName
		$this->Presenter1FirstName = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1FirstName', 'Presenter1FirstName', '`Presenter1FirstName`', 200, -1, FALSE, '`Presenter1FirstName`', FALSE);
		$this->fields['Presenter1FirstName'] =& $this->Presenter1FirstName;

		// Presenter1Surname
		$this->Presenter1Surname = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1Surname', 'Presenter1Surname', '`Presenter1Surname`', 200, -1, FALSE, '`Presenter1Surname`', FALSE);
		$this->fields['Presenter1Surname'] =& $this->Presenter1Surname;

		// Presenter1Phone
		$this->Presenter1Phone = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1Phone', 'Presenter1Phone', '`Presenter1Phone`', 200, -1, FALSE, '`Presenter1Phone`', FALSE);
		$this->fields['Presenter1Phone'] =& $this->Presenter1Phone;

		// Presenter1Email
		$this->Presenter1Email = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1Email', 'Presenter1Email', '`Presenter1Email`', 200, -1, FALSE, '`Presenter1Email`', FALSE);
		$this->fields['Presenter1Email'] =& $this->Presenter1Email;

		// Presenter1ID
		$this->Presenter1ID = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1ID', 'Presenter1ID', '`Presenter1ID`', 200, -1, FALSE, '`Presenter1ID`', FALSE);
		$this->fields['Presenter1ID'] =& $this->Presenter1ID;

		// Presenter1CV
		$this->Presenter1CV = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1CV', 'Presenter1CV', '`Presenter1CV`', 200, -1, TRUE, '`Presenter1CV`', FALSE);
		$this->Presenter1CV->UploadPath = "../uploads";
		$this->fields['Presenter1CV'] =& $this->Presenter1CV;

		// Presenter1SLA
		$this->Presenter1SLA = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1SLA', 'Presenter1SLA', '`Presenter1SLA`', 200, -1, TRUE, '`Presenter1SLA`', FALSE);
		$this->Presenter1SLA->UploadPath = "../uploads";
		$this->fields['Presenter1SLA'] =& $this->Presenter1SLA;

		// Presenter1IDDoc
		$this->Presenter1IDDoc = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter1IDDoc', 'Presenter1IDDoc', '`Presenter1IDDoc`', 200, -1, TRUE, '`Presenter1IDDoc`', FALSE);
		$this->Presenter1IDDoc->UploadPath = "../uploads";
		$this->fields['Presenter1IDDoc'] =& $this->Presenter1IDDoc;

		// Presenter2Title
		$this->Presenter2Title = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2Title', 'Presenter2Title', '`Presenter2Title`', 200, -1, FALSE, '`Presenter2Title`', FALSE);
		$this->fields['Presenter2Title'] =& $this->Presenter2Title;

		// Presenter2FirstName
		$this->Presenter2FirstName = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2FirstName', 'Presenter2FirstName', '`Presenter2FirstName`', 200, -1, FALSE, '`Presenter2FirstName`', FALSE);
		$this->fields['Presenter2FirstName'] =& $this->Presenter2FirstName;

		// Presenter2Surname
		$this->Presenter2Surname = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2Surname', 'Presenter2Surname', '`Presenter2Surname`', 200, -1, FALSE, '`Presenter2Surname`', FALSE);
		$this->fields['Presenter2Surname'] =& $this->Presenter2Surname;

		// Presenter2Phone
		$this->Presenter2Phone = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2Phone', 'Presenter2Phone', '`Presenter2Phone`', 200, -1, FALSE, '`Presenter2Phone`', FALSE);
		$this->fields['Presenter2Phone'] =& $this->Presenter2Phone;

		// Presenter2Email
		$this->Presenter2Email = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2Email', 'Presenter2Email', '`Presenter2Email`', 200, -1, FALSE, '`Presenter2Email`', FALSE);
		$this->fields['Presenter2Email'] =& $this->Presenter2Email;

		// Presenter2ID
		$this->Presenter2ID = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2ID', 'Presenter2ID', '`Presenter2ID`', 200, -1, FALSE, '`Presenter2ID`', FALSE);
		$this->fields['Presenter2ID'] =& $this->Presenter2ID;

		// Presenter2CV
		$this->Presenter2CV = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2CV', 'Presenter2CV', '`Presenter2CV`', 200, -1, TRUE, '`Presenter2CV`', FALSE);
		$this->Presenter2CV->UploadPath = "../uploads";
		$this->fields['Presenter2CV'] =& $this->Presenter2CV;

		// Presenter2SLA
		$this->Presenter2SLA = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2SLA', 'Presenter2SLA', '`Presenter2SLA`', 200, -1, TRUE, '`Presenter2SLA`', FALSE);
		$this->Presenter2SLA->UploadPath = "../uploads";
		$this->fields['Presenter2SLA'] =& $this->Presenter2SLA;

		// Presenter2IDDoc
		$this->Presenter2IDDoc = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter2IDDoc', 'Presenter2IDDoc', '`Presenter2IDDoc`', 200, -1, TRUE, '`Presenter2IDDoc`', FALSE);
		$this->Presenter2IDDoc->UploadPath = "../uploads";
		$this->fields['Presenter2IDDoc'] =& $this->Presenter2IDDoc;

		// Presenter3Title
		$this->Presenter3Title = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3Title', 'Presenter3Title', '`Presenter3Title`', 200, -1, FALSE, '`Presenter3Title`', FALSE);
		$this->fields['Presenter3Title'] =& $this->Presenter3Title;

		// Presenter3FirstName
		$this->Presenter3FirstName = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3FirstName', 'Presenter3FirstName', '`Presenter3FirstName`', 200, -1, FALSE, '`Presenter3FirstName`', FALSE);
		$this->fields['Presenter3FirstName'] =& $this->Presenter3FirstName;

		// Presenter3Surname
		$this->Presenter3Surname = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3Surname', 'Presenter3Surname', '`Presenter3Surname`', 200, -1, FALSE, '`Presenter3Surname`', FALSE);
		$this->fields['Presenter3Surname'] =& $this->Presenter3Surname;

		// Presenter3Phone
		$this->Presenter3Phone = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3Phone', 'Presenter3Phone', '`Presenter3Phone`', 200, -1, FALSE, '`Presenter3Phone`', FALSE);
		$this->fields['Presenter3Phone'] =& $this->Presenter3Phone;

		// Presenter3Email
		$this->Presenter3Email = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3Email', 'Presenter3Email', '`Presenter3Email`', 200, -1, FALSE, '`Presenter3Email`', FALSE);
		$this->fields['Presenter3Email'] =& $this->Presenter3Email;

		// Presenter3ID
		$this->Presenter3ID = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3ID', 'Presenter3ID', '`Presenter3ID`', 200, -1, FALSE, '`Presenter3ID`', FALSE);
		$this->fields['Presenter3ID'] =& $this->Presenter3ID;

		// Presenter3CV
		$this->Presenter3CV = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3CV', 'Presenter3CV', '`Presenter3CV`', 200, -1, TRUE, '`Presenter3CV`', FALSE);
		$this->Presenter3CV->UploadPath = "../uploads";
		$this->fields['Presenter3CV'] =& $this->Presenter3CV;

		// Presenter3SLA
		$this->Presenter3SLA = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3SLA', 'Presenter3SLA', '`Presenter3SLA`', 200, -1, TRUE, '`Presenter3SLA`', FALSE);
		$this->Presenter3SLA->UploadPath = "../uploads";
		$this->fields['Presenter3SLA'] =& $this->Presenter3SLA;

		// Presenter3IDDoc
		$this->Presenter3IDDoc = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_Presenter3IDDoc', 'Presenter3IDDoc', '`Presenter3IDDoc`', 200, -1, TRUE, '`Presenter3IDDoc`', FALSE);
		$this->Presenter3IDDoc->UploadPath = "../uploads";
		$this->fields['Presenter3IDDoc'] =& $this->Presenter3IDDoc;

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

		// LastReminder
		$this->LastReminder = new cField('CPDTrainingMaterial', 'CPDTrainingMaterial', 'x_LastReminder', 'LastReminder', '`LastReminder`', 133, 5, FALSE, '`LastReminder`', FALSE);
		$this->LastReminder->FldDefaultErrMsg = str_replace("%s", "/", $Language->Phrase("IncorrectDateYMD"));
		$this->fields['LastReminder'] =& $this->LastReminder;

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

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

	// Current master table name
	function getCurrentMasterTable() {
		return @$_SESSION[EW_PROJECT_NAME . "_" . $this->TableVar . "_" . EW_TABLE_MASTER_TABLE];
	}

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

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

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

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

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

	// Master filter
	function SqlMasterFilter_CPDServiceProvider() {
		return "`CPDProviderID`=@CPDProviderID@";
	}

	// Detail filter
	function SqlDetailFilter_CPDServiceProvider() {
		return "`ProviderID`=@ProviderID@";
	}

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

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

	function SqlWhere() { // Where
		$sWhere = "";
		$this->TableFilter = CPDFilterTMForAssessor();
		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 "`Subject` ASC,`AccredNum` ASC";
	}

	// 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 `CPDTrainingMaterial` ($names) VALUES ($values)";
	}

	// UPDATE statement
	function UpdateSQL(&$rs) {
		global $conn;
		$SQL = "UPDATE `CPDTrainingMaterial` 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 `CPDTrainingMaterial` WHERE ";
		$SQL .= ew_QuotedName('MaterialID') . '=' . ew_QuotedValue($rs['MaterialID'], $this->MaterialID->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 "`MaterialID` = @MaterialID@";
	}

	// Key filter
	function KeyFilter() {
		$sKeyFilter = $this->SqlKeyFilter();
		if (!is_numeric($this->MaterialID->CurrentValue))
			$sKeyFilter = "0=1"; // Invalid key
		$sKeyFilter = str_replace("@MaterialID@", ew_AdjustSql($this->MaterialID->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 "CPDTrainingMateriallist.php";
		}
	}

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

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

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

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

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

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

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

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

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

	// Add key value to URL
	function KeyUrl($url, $parm = "") {
		$sUrl = $url . "?";
		if ($parm <> "") $sUrl .= $parm . "&";
		if (!is_null($this->MaterialID->CurrentValue)) {
			$sUrl .= "MaterialID=" . urlencode($this->MaterialID->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=CPDTrainingMaterial" : "";
		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->MaterialID->setDbValue($rs->fields('MaterialID'));
		$this->ProviderID->setDbValue($rs->fields('ProviderID'));
		$this->Subject->setDbValue($rs->fields('Subject'));
		$this->RenewOrNew->setDbValue($rs->fields('RenewOrNew'));
		$this->Status->setDbValue($rs->fields('Status'));
		$this->Duration->setDbValue($rs->fields('Duration'));
		$this->DurationUnit->setDbValue($rs->fields('DurationUnit'));
		$this->DurationType->setDbValue($rs->fields('DurationType'));
		$this->Level->setDbValue($rs->fields('Level'));
		$this->NQFLevel->setDbValue($rs->fields('NQFLevel'));
		$this->EventDescription->setDbValue($rs->fields('EventDescription'));
		$this->CourseBrochure->Upload->DbValue = $rs->fields('CourseBrochure');
		$this->ActivityProgramme->Upload->DbValue = $rs->fields('ActivityProgramme');
		$this->LearningOutcomesFile->Upload->DbValue = $rs->fields('LearningOutcomesFile');
		$this->TrainingManualLink->setDbValue($rs->fields('TrainingManualLink'));
		$this->PresentationLink->setDbValue($rs->fields('PresentationLink'));
		$this->HandOutsLink->setDbValue($rs->fields('HandOutsLink'));
		$this->FeedbackForm->Upload->DbValue = $rs->fields('FeedbackForm');
		$this->LearningOutcomes->setDbValue($rs->fields('LearningOutcomes'));
		$this->ModeOfDelivery->setDbValue($rs->fields('ModeOfDelivery'));
		$this->TargetAudience->setDbValue($rs->fields('TargetAudience'));
		$this->Objectives->setDbValue($rs->fields('Objectives'));
		$this->Promotion->setDbValue($rs->fields('Promotion'));
		$this->Motivation->setDbValue($rs->fields('Motivation'));
		$this->AccredNum->setDbValue($rs->fields('AccredNum'));
		$this->PrevAccredNum->setDbValue($rs->fields('PrevAccredNum'));
		$this->DateApproved->setDbValue($rs->fields('DateApproved'));
		$this->DateExpires->setDbValue($rs->fields('DateExpires'));
		$this->Certification->setDbValue($rs->fields('Certification'));
		$this->CPD->setDbValue($rs->fields('CPD'));
		$this->InvoiceCode->setDbValue($rs->fields('InvoiceCode'));
		$this->InvoiceNumber->setDbValue($rs->fields('InvoiceNumber'));
		$this->Cost->setDbValue($rs->fields('Cost'));
		$this->CostToDelegate->setDbValue($rs->fields('CostToDelegate'));
		$this->DepositAmt->setDbValue($rs->fields('DepositAmt'));
		$this->InvoiceFile->Upload->DbValue = $rs->fields('InvoiceFile');
		$this->InvoiceDate->setDbValue($rs->fields('InvoiceDate'));
		$this->DatePaid->setDbValue($rs->fields('DatePaid'));
		$this->ProofOfPayment->Upload->DbValue = $rs->fields('ProofOfPayment');
		$this->EvaluatorID->setDbValue($rs->fields('EvaluatorID'));
		$this->EvaluatorID2->setDbValue($rs->fields('EvaluatorID2'));
		$this->EvaluatorID3->setDbValue($rs->fields('EvaluatorID3'));
		$this->EvaluatorFee->setDbValue($rs->fields('EvaluatorFee'));
		$this->EvaluatorFeeAmount->setDbValue($rs->fields('EvaluatorFeeAmount'));
		$this->EvaluatorFeeDate->setDbValue($rs->fields('EvaluatorFeeDate'));
		$this->EvaluatorInvoice->Upload->DbValue = $rs->fields('EvaluatorInvoice');
		$this->EvaluatorTimesheet->Upload->DbValue = $rs->fields('EvaluatorTimesheet');
		$this->StartDate->setDbValue($rs->fields('StartDate'));
		$this->Other_Validator->setDbValue($rs->fields('Other_Validator'));
		$this->Provider_URL->setDbValue($rs->fields('Provider_URL'));
		$this->Notional_Hours->setDbValue($rs->fields('Notional_Hours'));
		$this->Category_Reg->setDbValue($rs->fields('Category_Reg'));
		$this->Discipline->setDbValue($rs->fields('Discipline'));
		$this->Sub_Discipline->setDbValue($rs->fields('Sub_Discipline'));
		$this->Activity_Nature->setDbValue($rs->fields('Activity_Nature'));
		$this->Instances->setDbValue($rs->fields('Instances'));
		$this->RemoteUpload->setDbValue($rs->fields('RemoteUpload'));
		$this->LocalUpload->setDbValue($rs->fields('LocalUpload'));
		$this->AssessmentDoc->Upload->DbValue = $rs->fields('AssessmentDoc');
		$this->ResponsiblePersonFirstName->setDbValue($rs->fields('ResponsiblePersonFirstName'));
		$this->ResponsiblePersonLastName->setDbValue($rs->fields('ResponsiblePersonLastName'));
		$this->ResponsiblePersonEMailAddress->setDbValue($rs->fields('ResponsiblePersonEMailAddress'));
		$this->ResponsibleBillingAddress->setDbValue($rs->fields('ResponsibleBillingAddress'));
		$this->ResponsiblePersonContactNumber->setDbValue($rs->fields('ResponsiblePersonContactNumber'));
		$this->ResponsibleVATNumber->setDbValue($rs->fields('ResponsibleVATNumber'));
		$this->Comments->setDbValue($rs->fields('Comments'));
		$this->Archived->setDbValue($rs->fields('Archived'));
		$this->Presenter1Title->setDbValue($rs->fields('Presenter1Title'));
		$this->Presenter1FirstName->setDbValue($rs->fields('Presenter1FirstName'));
		$this->Presenter1Surname->setDbValue($rs->fields('Presenter1Surname'));
		$this->Presenter1Phone->setDbValue($rs->fields('Presenter1Phone'));
		$this->Presenter1Email->setDbValue($rs->fields('Presenter1Email'));
		$this->Presenter1ID->setDbValue($rs->fields('Presenter1ID'));
		$this->Presenter1CV->Upload->DbValue = $rs->fields('Presenter1CV');
		$this->Presenter1SLA->Upload->DbValue = $rs->fields('Presenter1SLA');
		$this->Presenter1IDDoc->Upload->DbValue = $rs->fields('Presenter1IDDoc');
		$this->Presenter2Title->setDbValue($rs->fields('Presenter2Title'));
		$this->Presenter2FirstName->setDbValue($rs->fields('Presenter2FirstName'));
		$this->Presenter2Surname->setDbValue($rs->fields('Presenter2Surname'));
		$this->Presenter2Phone->setDbValue($rs->fields('Presenter2Phone'));
		$this->Presenter2Email->setDbValue($rs->fields('Presenter2Email'));
		$this->Presenter2ID->setDbValue($rs->fields('Presenter2ID'));
		$this->Presenter2CV->Upload->DbValue = $rs->fields('Presenter2CV');
		$this->Presenter2SLA->Upload->DbValue = $rs->fields('Presenter2SLA');
		$this->Presenter2IDDoc->Upload->DbValue = $rs->fields('Presenter2IDDoc');
		$this->Presenter3Title->setDbValue($rs->fields('Presenter3Title'));
		$this->Presenter3FirstName->setDbValue($rs->fields('Presenter3FirstName'));
		$this->Presenter3Surname->setDbValue($rs->fields('Presenter3Surname'));
		$this->Presenter3Phone->setDbValue($rs->fields('Presenter3Phone'));
		$this->Presenter3Email->setDbValue($rs->fields('Presenter3Email'));
		$this->Presenter3ID->setDbValue($rs->fields('Presenter3ID'));
		$this->Presenter3CV->Upload->DbValue = $rs->fields('Presenter3CV');
		$this->Presenter3SLA->Upload->DbValue = $rs->fields('Presenter3SLA');
		$this->Presenter3IDDoc->Upload->DbValue = $rs->fields('Presenter3IDDoc');
		$this->NumReminders->setDbValue($rs->fields('NumReminders'));
		$this->LastReminder->setDbValue($rs->fields('LastReminder'));
		$this->DateCreated->setDbValue($rs->fields('DateCreated'));
	}

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

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

   // Common render codes
		// ProviderID

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

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

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

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

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

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

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

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

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

		// ProviderID
		if (strval($this->ProviderID->CurrentValue) <> "") {
			$sFilterWrk = "`CPDProviderID` = " . ew_AdjustSql($this->ProviderID->CurrentValue) . "";
		$sSqlWrk = "SELECT `CompanyName`, `SPNumber` FROM `CPDServiceProvider`";
		$sWhereWrk = "";
		if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
		$sWhereWrk .= "(" . "Archived=0" . ")";
		if ($sFilterWrk <> "") {
			if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
			$sWhereWrk .= "(" . $sFilterWrk . ")";
		}
		if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
		$sSqlWrk .= " ORDER BY `CompanyName`";
			$rswrk = $conn->Execute($sSqlWrk);
			if ($rswrk && !$rswrk->EOF) { // Lookup values found
				$this->ProviderID->ViewValue = $rswrk->fields('CompanyName');
				$this->ProviderID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('SPNumber');
				$rswrk->Close();
			} else {
				$this->ProviderID->ViewValue = $this->ProviderID->CurrentValue;
			}
		} else {
			$this->ProviderID->ViewValue = NULL;
		}
		$this->ProviderID->CssStyle = "";
		$this->ProviderID->CssClass = "";
		$this->ProviderID->ViewCustomAttributes = "";

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

		// RenewOrNew
		if (strval($this->RenewOrNew->CurrentValue) <> "") {
			switch ($this->RenewOrNew->CurrentValue) {
				case "n":
					$this->RenewOrNew->ViewValue = "New";
					break;
				case "r":
					$this->RenewOrNew->ViewValue = "Renewal";
					break;
				default:
					$this->RenewOrNew->ViewValue = $this->RenewOrNew->CurrentValue;
			}
		} else {
			$this->RenewOrNew->ViewValue = NULL;
		}
		$this->RenewOrNew->CssStyle = "";
		$this->RenewOrNew->CssClass = "";
		$this->RenewOrNew->ViewCustomAttributes = "";

		// Status
		if (strval($this->Status->CurrentValue) <> "") {
			switch ($this->Status->CurrentValue) {
				case "Pending":
					$this->Status->ViewValue = "Pending";
					break;
				case "Approved":
					$this->Status->ViewValue = "Approved";
					break;
				case "Declined":
					$this->Status->ViewValue = "Declined";
					break;
				case "Suspended":
					$this->Status->ViewValue = "Suspended";
					break;
				case "Discontinued":
					$this->Status->ViewValue = "Discontinued";
					break;
				default:
					$this->Status->ViewValue = $this->Status->CurrentValue;
			}
		} else {
			$this->Status->ViewValue = NULL;
		}
		$this->Status->CssStyle = "";
		$this->Status->CssClass = "";
		$this->Status->ViewCustomAttributes = "";

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

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

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

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

		// 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 = "";

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

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

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

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

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

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

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

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

		// DateCreated
		$this->DateCreated->HrefValue = "";
		$this->DateCreated->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"
        CPDTMReviewDone($rs);
}                         

	// 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";
        CPDTMReviewDone($rsold);
}          

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