Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceadmin/
Upload File :
Current File : /var/www/cesa.co.za/cceadmin/cstFutureStudentslist.php

<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "cstFutureStudentsinfo.php" ?>
<?php include "CCEUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php

// Create page object
$cstFutureStudents_list = new ccstFutureStudents_list();
$Page =& $cstFutureStudents_list;

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

// Page main
$cstFutureStudents_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($cstFutureStudents->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var cstFutureStudents_list = new ew_Page("cstFutureStudents_list");

// page properties
cstFutureStudents_list.PageID = "list"; // page ID
cstFutureStudents_list.FormID = "fcstFutureStudentslist"; // form ID
var EW_PAGE_ID = cstFutureStudents_list.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
cstFutureStudents_list.Form_CustomValidate =  
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
<?php if (EW_CLIENT_VALIDATE) { ?>
cstFutureStudents_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
cstFutureStudents_list.ValidateRequired = false; // no JavaScript validation
<?php } ?>

//-->
</script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->

</script>
<?php } ?>
<?php if ($cstFutureStudents->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$cstFutureStudents_list->lTotalRecs = $cstFutureStudents->SelectRecordCount();
	} else {
		if ($rs = $cstFutureStudents_list->LoadRecordset())
			$cstFutureStudents_list->lTotalRecs = $rs->RecordCount();
	}
	$cstFutureStudents_list->lStartRec = 1;
	if ($cstFutureStudents_list->lDisplayRecs <= 0 || ($cstFutureStudents->Export <> "" && $cstFutureStudents->ExportAll)) // Display all records
		$cstFutureStudents_list->lDisplayRecs = $cstFutureStudents_list->lTotalRecs;
	if (!($cstFutureStudents->Export <> "" && $cstFutureStudents->ExportAll))
		$cstFutureStudents_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $cstFutureStudents_list->LoadRecordset($cstFutureStudents_list->lStartRec-1, $cstFutureStudents_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeCUSTOMVIEW") ?><?php echo $cstFutureStudents->TableCaption() ?>
<?php if ($cstFutureStudents->Export == "" && $cstFutureStudents->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $cstFutureStudents_list->ExportPrintUrl ?>"><img src="images/print.gif" alt="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" title="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" width="16" height="16" border="0"></a>
&nbsp;&nbsp;<a href="<?php echo $cstFutureStudents_list->ExportExcelUrl ?>"><img src='images/exportxls.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a href="<?php echo $cstFutureStudents_list->ExportWordUrl ?>"><img src='images/exportdoc.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a name="emf_cstFutureStudents" id="emf_cstFutureStudents" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_cstFutureStudents',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fcstFutureStudentslist,sel:false});"><img src='images/exportemail.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
</span></p>
<?php if ($Security->CanSearch()) { ?>
<?php if ($cstFutureStudents->Export == "" && $cstFutureStudents->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(cstFutureStudents_list);" style="text-decoration: none;"><img id="cstFutureStudents_list_SearchImage" src="images/collapse.gif" alt="" width="9" height="9" border="0"></a><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("Search") ?></span><br>
<div id="cstFutureStudents_list_SearchPanel">
<form name="fcstFutureStudentslistsrch" id="fcstFutureStudentslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="cstFutureStudents">
<table class="ewBasicSearch">
	<tr>
		<td><span class="phpmaker">
			<input type="text" name="<?php echo EW_TABLE_BASIC_SEARCH ?>" id="<?php echo EW_TABLE_BASIC_SEARCH ?>" size="20" value="<?php echo ew_HtmlEncode($cstFutureStudents->getSessionBasicSearchKeyword()) ?>">
			<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">&nbsp;
			<a href="<?php echo $cstFutureStudents_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>&nbsp;
			<a href="cstFutureStudentssrch.php"><?php echo $Language->Phrase("AdvancedSearch") ?></a>&nbsp;
		</span></td>
	</tr>
	<tr>
	<td><span class="phpmaker"><label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value=""<?php if ($cstFutureStudents->getSessionBasicSearchType() == "") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("ExactPhrase") ?></label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="AND"<?php if ($cstFutureStudents->getSessionBasicSearchType() == "AND") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AllWord") ?></label>&nbsp;&nbsp;<label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="OR"<?php if ($cstFutureStudents->getSessionBasicSearchType() == "OR") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AnyWord") ?></label></span></td>
	</tr>
</table>
</form>
</div>
<?php } ?>
<?php } ?>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$cstFutureStudents_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($cstFutureStudents->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($cstFutureStudents->CurrentAction <> "gridadd" && $cstFutureStudents->CurrentAction <> "gridedit") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($cstFutureStudents_list->Pager)) $cstFutureStudents_list->Pager = new cPrevNextPager($cstFutureStudents_list->lStartRec, $cstFutureStudents_list->lDisplayRecs, $cstFutureStudents_list->lTotalRecs) ?>
<?php if ($cstFutureStudents_list->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($cstFutureStudents_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($cstFutureStudents_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $cstFutureStudents_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($cstFutureStudents_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($cstFutureStudents_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->PageCount ?></span></td>
	</tr></table>
	</td>	
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td>
	<span class="phpmaker"><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($cstFutureStudents_list->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
	</tr>
</table>
</form>
<?php } ?>
<span class="phpmaker">
</span>
</div>
<?php } ?>
<form name="fcstFutureStudentslist" id="fcstFutureStudentslist" class="ewForm" action="" method="post">
<div id="gmp_cstFutureStudents" class="ewGridMiddlePanel">
<?php if ($cstFutureStudents_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $cstFutureStudents->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

// Render list options
$cstFutureStudents_list->RenderListOptions();

// Render list options (header, left)
$cstFutureStudents_list->ListOptions->Render("header", "left");
?>
<?php if ($cstFutureStudents->FirstName->Visible) { // FirstName ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->FirstName) == "") { ?>
		<td><?php echo $cstFutureStudents->FirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->FirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->FirstName->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->FirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->FirstName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->Surname->Visible) { // Surname ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->Surname) == "") { ?>
		<td><?php echo $cstFutureStudents->Surname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->Surname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->Surname->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->Surname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->Surname->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->KnownAs->Visible) { // KnownAs ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->KnownAs) == "") { ?>
		<td><?php echo $cstFutureStudents->KnownAs->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->KnownAs) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->KnownAs->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->KnownAs->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->KnownAs->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->Organisation->Visible) { // Organisation ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->Organisation) == "") { ?>
		<td><?php echo $cstFutureStudents->Organisation->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->Organisation) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->Organisation->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->Organisation->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->StudentNumber->Visible) { // StudentNumber ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->StudentNumber) == "") { ?>
		<td><?php echo $cstFutureStudents->StudentNumber->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->StudentNumber) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->StudentNumber->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->StudentNumber->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->StudentNumber->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->ECSACategory->Visible) { // ECSACategory ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->ECSACategory) == "") { ?>
		<td><?php echo $cstFutureStudents->ECSACategory->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->ECSACategory) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->ECSACategory->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->ECSACategory->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->ECSACategory->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->Cellphone->Visible) { // Cellphone ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->Cellphone) == "") { ?>
		<td><?php echo $cstFutureStudents->Cellphone->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->Cellphone) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->Cellphone->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->Cellphone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->Cellphone->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->EmailAddress->Visible) { // EmailAddress ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->EmailAddress) == "") { ?>
		<td><?php echo $cstFutureStudents->EmailAddress->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->EmailAddress) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->EmailAddress->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->EmailAddress->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->EmailAddress->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->MentorFirstName->Visible) { // MentorFirstName ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->MentorFirstName) == "") { ?>
		<td><?php echo $cstFutureStudents->MentorFirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->MentorFirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->MentorFirstName->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->MentorFirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->MentorFirstName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstFutureStudents->MentorSurname->Visible) { // MentorSurname ?>
	<?php if ($cstFutureStudents->SortUrl($cstFutureStudents->MentorSurname) == "") { ?>
		<td><?php echo $cstFutureStudents->MentorSurname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstFutureStudents->SortUrl($cstFutureStudents->MentorSurname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstFutureStudents->MentorSurname->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstFutureStudents->MentorSurname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstFutureStudents->MentorSurname->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php

// Render list options (header, right)
$cstFutureStudents_list->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
if ($cstFutureStudents->ExportAll && $cstFutureStudents->Export <> "") {
	$cstFutureStudents_list->lStopRec = $cstFutureStudents_list->lTotalRecs;
} else {
	$cstFutureStudents_list->lStopRec = $cstFutureStudents_list->lStartRec + $cstFutureStudents_list->lDisplayRecs - 1; // Set the last record to display
}
$cstFutureStudents_list->lRecCount = $cstFutureStudents_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$bSelectLimit && $cstFutureStudents_list->lStartRec > 1)
		$rs->Move($cstFutureStudents_list->lStartRec - 1);
}

// Initialize aggregate
$cstFutureStudents->RowType = EW_ROWTYPE_AGGREGATEINIT;
$cstFutureStudents_list->RenderRow();
$cstFutureStudents_list->lRowCnt = 0;
while (($cstFutureStudents->CurrentAction == "gridadd" || !$rs->EOF) &&
	$cstFutureStudents_list->lRecCount < $cstFutureStudents_list->lStopRec) {
	$cstFutureStudents_list->lRecCount++;
	if (intval($cstFutureStudents_list->lRecCount) >= intval($cstFutureStudents_list->lStartRec)) {
		$cstFutureStudents_list->lRowCnt++;

	// Init row class and style
	$cstFutureStudents->CssClass = "";
	$cstFutureStudents->CssStyle = "";
	$cstFutureStudents->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
	if ($cstFutureStudents->CurrentAction == "gridadd") {
		$cstFutureStudents_list->LoadDefaultValues(); // Load default values
	} else {
		$cstFutureStudents_list->LoadRowValues($rs); // Load row values
	}
	$cstFutureStudents->RowType = EW_ROWTYPE_VIEW; // Render view

	// Render row
	$cstFutureStudents_list->RenderRow();

	// Render list options
	$cstFutureStudents_list->RenderListOptions();
?>
	<tr<?php echo $cstFutureStudents->RowAttributes() ?>>
<?php

// Render list options (body, left)
$cstFutureStudents_list->ListOptions->Render("body", "left");
?>
	<?php if ($cstFutureStudents->FirstName->Visible) { // FirstName ?>
		<td<?php echo $cstFutureStudents->FirstName->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->FirstName->ViewAttributes() ?>><?php echo $cstFutureStudents->FirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->Surname->Visible) { // Surname ?>
		<td<?php echo $cstFutureStudents->Surname->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->Surname->ViewAttributes() ?>><?php echo $cstFutureStudents->Surname->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->KnownAs->Visible) { // KnownAs ?>
		<td<?php echo $cstFutureStudents->KnownAs->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->KnownAs->ViewAttributes() ?>><?php echo $cstFutureStudents->KnownAs->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->Organisation->Visible) { // Organisation ?>
		<td<?php echo $cstFutureStudents->Organisation->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->Organisation->ViewAttributes() ?>><?php echo $cstFutureStudents->Organisation->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->StudentNumber->Visible) { // StudentNumber ?>
		<td<?php echo $cstFutureStudents->StudentNumber->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->StudentNumber->ViewAttributes() ?>><?php echo $cstFutureStudents->StudentNumber->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->ECSACategory->Visible) { // ECSACategory ?>
		<td<?php echo $cstFutureStudents->ECSACategory->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->ECSACategory->ViewAttributes() ?>><?php echo $cstFutureStudents->ECSACategory->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->Cellphone->Visible) { // Cellphone ?>
		<td<?php echo $cstFutureStudents->Cellphone->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->Cellphone->ViewAttributes() ?>><?php echo $cstFutureStudents->Cellphone->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->EmailAddress->Visible) { // EmailAddress ?>
		<td<?php echo $cstFutureStudents->EmailAddress->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->EmailAddress->ViewAttributes() ?>><?php echo $cstFutureStudents->EmailAddress->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->MentorFirstName->Visible) { // MentorFirstName ?>
		<td<?php echo $cstFutureStudents->MentorFirstName->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->MentorFirstName->ViewAttributes() ?>><?php echo $cstFutureStudents->MentorFirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstFutureStudents->MentorSurname->Visible) { // MentorSurname ?>
		<td<?php echo $cstFutureStudents->MentorSurname->CellAttributes() ?>>
<div<?php echo $cstFutureStudents->MentorSurname->ViewAttributes() ?>><?php echo $cstFutureStudents->MentorSurname->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php

// Render list options (body, right)
$cstFutureStudents_list->ListOptions->Render("body", "right");
?>
	</tr>
<?php
	}
	if ($cstFutureStudents->CurrentAction <> "gridadd")
		$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php

// Close recordset
if ($rs)
	$rs->Close();
?>
<?php if ($cstFutureStudents_list->lTotalRecs > 0) { ?>
<?php if ($cstFutureStudents->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($cstFutureStudents->CurrentAction <> "gridadd" && $cstFutureStudents->CurrentAction <> "gridedit") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($cstFutureStudents_list->Pager)) $cstFutureStudents_list->Pager = new cPrevNextPager($cstFutureStudents_list->lStartRec, $cstFutureStudents_list->lDisplayRecs, $cstFutureStudents_list->lTotalRecs) ?>
<?php if ($cstFutureStudents_list->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($cstFutureStudents_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($cstFutureStudents_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $cstFutureStudents_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($cstFutureStudents_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($cstFutureStudents_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $cstFutureStudents_list->PageUrl() ?>start=<?php echo $cstFutureStudents_list->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->PageCount ?></span></td>
	</tr></table>
	</td>	
	<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	<td>
	<span class="phpmaker"><?php echo $Language->Phrase("Record") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $cstFutureStudents_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($cstFutureStudents_list->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
	</tr>
</table>
</form>
<?php } ?>
<?php //if ($cstFutureStudents_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($cstFutureStudents->Export == "" && $cstFutureStudents->CurrentAction == "") { ?>
<?php } ?>
<?php if ($cstFutureStudents->Export == "") { ?>
<script language="JavaScript" type="text/javascript">
<!--

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

</script>
<?php } ?>
<?php include "footer.php" ?>
<?php
$cstFutureStudents_list->Page_Terminate();
?>
<?php

//
// Page class
//
class ccstFutureStudents_list {

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

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

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

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

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

	// Page URLs
	var $AddUrl;
	var $EditUrl;
	var $CopyUrl;
	var $DeleteUrl;
	var $ViewUrl;
	var $ListUrl;

	// Export URLs
	var $ExportPrintUrl;
	var $ExportHtmlUrl;
	var $ExportExcelUrl;
	var $ExportWordUrl;
	var $ExportXmlUrl;
	var $ExportCsvUrl;

	// Update URLs
	var $InlineAddUrl;
	var $InlineCopyUrl;
	var $InlineEditUrl;
	var $GridAddUrl;
	var $GridEditUrl;
	var $MultiDeleteUrl;
	var $MultiUpdateUrl;

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

	function setMessage($v) {
		if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
			$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
		} else {
			$_SESSION[EW_SESSION_MESSAGE] = $v;
		}
	}

	// Show message
	function ShowMessage() {
		$sMessage = $this->getMessage();
		$this->Message_Showing($sMessage);
		if ($sMessage <> "") { // Message in Session, display
			echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
			$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
		}
	}

	// Validate page request
	function IsPageRequest() {
		global $objForm, $cstFutureStudents;
		if ($cstFutureStudents->UseTokenInUrl) {
			if ($objForm)
				return ($cstFutureStudents->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($cstFutureStudents->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

	//
	// Page class constructor
	//
	function __construct() {
		global $conn, $Language;

		// Language object
		$Language = new cLanguage();

		// Table object (cstFutureStudents)
		$GLOBALS["cstFutureStudents"] = new ccstFutureStudents();

		// Initialize URLs
		$this->ExportPrintUrl = $this->PageUrl() . "export=print";
		$this->ExportExcelUrl = $this->PageUrl() . "export=excel";
		$this->ExportWordUrl = $this->PageUrl() . "export=word";
		$this->ExportHtmlUrl = $this->PageUrl() . "export=html";
		$this->ExportXmlUrl = $this->PageUrl() . "export=xml";
		$this->ExportCsvUrl = $this->PageUrl() . "export=csv";
		$this->AddUrl = $GLOBALS["cstFutureStudents"]->AddUrl();
		$this->InlineAddUrl = $this->PageUrl() . "a=add";
		$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
		$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
		$this->MultiDeleteUrl = "cstFutureStudentsdelete.php";
		$this->MultiUpdateUrl = "cstFutureStudentsupdate.php";

		// Table object (CCEUsers)
		$GLOBALS['CCEUsers'] = new cCCEUsers();

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

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

		// Start timer
		$GLOBALS["gsTimer"] = new cTimer();

		// Open connection
		$conn = ew_Connect();

		// List options
		$this->ListOptions = new cListOptions();
	}

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

		// Security
		$Security = new cAdvancedSecurity();
		if (!$Security->IsLoggedIn()) $Security->AutoLogin();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
		$Security->TablePermission_Loading();
		$Security->LoadCurrentUserLevel($this->TableName);
		$Security->TablePermission_Loaded();
		if (!$Security->IsLoggedIn()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}
		if (!$Security->CanList()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("login.php");
		}

		// Get export parameters
		if (@$_GET["export"] <> "") {
			$cstFutureStudents->Export = $_GET["export"];
		} elseif (ew_IsHttpPost()) {
			if (@$_POST["exporttype"] <> "")
				$cstFutureStudents->Export = $_POST["exporttype"];
		} else {
			$cstFutureStudents->setExportReturnUrl(ew_CurrentUrl());
		}
		$gsExport = $cstFutureStudents->Export; // Get export parameter, used in header
		$gsExportFile = $cstFutureStudents->TableVar; // Get export file, used in header
		if ($cstFutureStudents->Export == "excel") {
			header('Content-Type: application/vnd.ms-excel');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
		}
		if ($cstFutureStudents->Export == "word") {
			header('Content-Type: application/vnd.ms-word');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
		}

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

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

	//
	// Page_Terminate
	//
	function Page_Terminate($url = "") {
		global $conn;

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

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

		 // Close connection
		$conn->Close();

		// Go to URL if specified
		$this->Page_Redirecting($url);
		if ($url <> "") {
			if (!EW_DEBUG_ENABLED && ob_get_length())
				ob_end_clean();
			header("Location: " . $url);
		}
		exit();
	}

	// Class variables
	var $ListOptions; // List options
	var $lDisplayRecs = 40;
	var $lStartRec;
	var $lStopRec;
	var $lTotalRecs = 0;
	var $lRecRange = 10;
	var $sSrchWhere = ""; // Search WHERE clause
	var $lRecCnt = 0; // Record count
	var $lEditRowCnt;
	var $lRowCnt;
	var $lRowIndex; // Row index
	var $lRecPerRow = 0;
	var $lColCnt = 0;
	var $sDbMasterFilter = ""; // Master filter
	var $sDbDetailFilter = ""; // Detail filter
	var $bMasterRecordExists;	
	var $sMultiSelectKey;
	var $RestoreSearch;

	//
	// Page main
	//
	function Page_Main() {
		global $objForm, $Language, $gsSearchError, $Security, $cstFutureStudents;

		// Search filters
		$sSrchAdvanced = ""; // Advanced search filter
		$sSrchBasic = ""; // Basic search filter
		$sFilter = "";
		if ($this->IsPageRequest()) { // Validate request

			// Handle reset command
			$this->ResetCmd();

			// Set up list options
			$this->SetupListOptions();

			// Get basic search values
			$this->LoadBasicSearchValues();

			// Get and validate search values for advanced search
			$this->LoadSearchValues(); // Get search values
			if (!$this->ValidateSearch())
				$this->setMessage($gsSearchError);

			// Restore search parms from Session
			$this->RestoreSearchParms();

			// Call Recordset SearchValidated event
			$cstFutureStudents->Recordset_SearchValidated();

			// Set up sorting order
			$this->SetUpSortOrder();

			// Get basic search criteria
			if ($gsSearchError == "")
				$sSrchBasic = $this->BasicSearchWhere();

			// Get search criteria for advanced search
			if ($gsSearchError == "")
				$sSrchAdvanced = $this->AdvancedSearchWhere();
		}

		// Restore display records
		if ($cstFutureStudents->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $cstFutureStudents->getRecordsPerPage(); // Restore from Session
		} else {
			$this->lDisplayRecs = 40; // Load default
		}

		// Load Sorting Order
		$this->LoadSortOrder();

		// Build search criteria
		if ($sSrchAdvanced <> "")
			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchAdvanced . ")" : $sSrchAdvanced;
		if ($sSrchBasic <> "")
			$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchBasic. ")" : $sSrchBasic;

		// Call Recordset_Searching event
		$cstFutureStudents->Recordset_Searching($this->sSrchWhere);

		// Save search criteria
		if ($this->sSrchWhere <> "") {
			if ($sSrchBasic == "")
				$this->ResetBasicSearchParms();
			if ($sSrchAdvanced == "")
				$this->ResetAdvancedSearchParms();
			$cstFutureStudents->setSearchWhere($this->sSrchWhere); // Save to Session
			if (!$this->RestoreSearch) {
				$this->lStartRec = 1; // Reset start record counter
				$cstFutureStudents->setStartRecordNumber($this->lStartRec);
			}
		} else {
			$this->sSrchWhere = $cstFutureStudents->getSearchWhere();
		}

		// Build filter
		$sFilter = "";
		if (!$Security->CanList())
			$sFilter = "(0=1)"; // Filter all records
		if ($this->sDbDetailFilter <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
		if ($this->sSrchWhere <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;

		// Set up filter in session
		$cstFutureStudents->setSessionWhere($sFilter);
		$cstFutureStudents->CurrentFilter = "";

		// Export data only
		if (in_array($cstFutureStudents->Export, array("html","word","excel","xml","csv","email"))) {
			$this->ExportData();
			if ($cstFutureStudents->Export <> "email")
				$this->Page_Terminate(); // Terminate response
			exit();
		}
	}

	// Advanced search WHERE clause based on QueryString
	function AdvancedSearchWhere() {
		global $Security, $cstFutureStudents;
		$sWhere = "";
		if (!$Security->CanSearch()) return "";
		$this->BuildSearchSql($sWhere, $cstFutureStudents->CCEStudentID, FALSE); // CCEStudentID
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Title, FALSE); // Title
		$this->BuildSearchSql($sWhere, $cstFutureStudents->FirstName, FALSE); // FirstName
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Surname, FALSE); // Surname
		$this->BuildSearchSql($sWhere, $cstFutureStudents->KnownAs, FALSE); // KnownAs
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Organisation, FALSE); // Organisation
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OrganisationType, FALSE); // OrganisationType
		$this->BuildSearchSql($sWhere, $cstFutureStudents->LengthEmploy, FALSE); // LengthEmploy
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OtherCEFirms, FALSE); // OtherCEFirms
		$this->BuildSearchSql($sWhere, $cstFutureStudents->StudentNumber, FALSE); // StudentNumber
		$this->BuildSearchSql($sWhere, $cstFutureStudents->CCEFacilitatorID, FALSE); // CCEFacilitatorID
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Project, FALSE); // Project
		$this->BuildSearchSql($sWhere, $cstFutureStudents->ProjectDiscipline, FALSE); // ProjectDiscipline
		$this->BuildSearchSql($sWhere, $cstFutureStudents->IDNumber, FALSE); // IDNumber
		$this->BuildSearchSql($sWhere, $cstFutureStudents->ECSARegistered, FALSE); // ECSARegistered
		$this->BuildSearchSql($sWhere, $cstFutureStudents->ECSACategory, FALSE); // ECSACategory
		$this->BuildSearchSql($sWhere, $cstFutureStudents->ECSANumber, FALSE); // ECSANumber
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OtherStatutoryBodyRegistered, FALSE); // OtherStatutoryBodyRegistered
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OtherStatutoryBodyName, FALSE); // OtherStatutoryBodyName
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OtherStatutoryBodyNumber, FALSE); // OtherStatutoryBodyNumber
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Age, FALSE); // Age
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HighestQual, FALSE); // HighestQual
		$this->BuildSearchSql($sWhere, $cstFutureStudents->AreaDiscipline, FALSE); // AreaDiscipline
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Telephone, FALSE); // Telephone
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Cellphone, FALSE); // Cellphone
		$this->BuildSearchSql($sWhere, $cstFutureStudents->EmailAddress, FALSE); // EmailAddress
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HomeAddress, FALSE); // HomeAddress
		$this->BuildSearchSql($sWhere, $cstFutureStudents->WorkAddress, FALSE); // WorkAddress
		$this->BuildSearchSql($sWhere, $cstFutureStudents->PostalAddress, FALSE); // PostalAddress
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Designation, FALSE); // Designation
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Department, FALSE); // Department
		$this->BuildSearchSql($sWhere, $cstFutureStudents->CESAMemberFirm, FALSE); // CESAMemberFirm
		$this->BuildSearchSql($sWhere, $cstFutureStudents->CESAAccountNo, FALSE); // CESAAccountNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->VATNo, FALSE); // VATNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->DietaryRequirements, FALSE); // DietaryRequirements
		$this->BuildSearchSql($sWhere, $cstFutureStudents->OrderNo, FALSE); // OrderNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByName, FALSE); // BookedByName
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByDesignation, FALSE); // BookedByDesignation
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByTelNo, FALSE); // BookedByTelNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByFaxNo, FALSE); // BookedByFaxNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByCellNo, FALSE); // BookedByCellNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BookedByEmail, FALSE); // BookedByEmail
		$this->BuildSearchSql($sWhere, $cstFutureStudents->WebUsername, FALSE); // WebUsername
		$this->BuildSearchSql($sWhere, $cstFutureStudents->WebPassword, FALSE); // WebPassword
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorDesig, FALSE); // MentorDesig
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorTel, FALSE); // MentorTel
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorCell, FALSE); // MentorCell
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorEmail, FALSE); // MentorEmail
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HRManagerName, FALSE); // HRManagerName
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HRManagerDesignation, FALSE); // HRManagerDesignation
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HRManagerTelNo, FALSE); // HRManagerTelNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HRManagerCellNo, FALSE); // HRManagerCellNo
		$this->BuildSearchSql($sWhere, $cstFutureStudents->HRManagerEmail, FALSE); // HRManagerEmail
		$this->BuildSearchSql($sWhere, $cstFutureStudents->BlockAccess, FALSE); // BlockAccess
		$this->BuildSearchSql($sWhere, $cstFutureStudents->Archived, FALSE); // Archived
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorFirstName, FALSE); // MentorFirstName
		$this->BuildSearchSql($sWhere, $cstFutureStudents->MentorSurname, FALSE); // MentorSurname

		// Set up search parm
		if ($sWhere <> "") {
			$this->SetSearchParm($cstFutureStudents->CCEStudentID); // CCEStudentID
			$this->SetSearchParm($cstFutureStudents->Title); // Title
			$this->SetSearchParm($cstFutureStudents->FirstName); // FirstName
			$this->SetSearchParm($cstFutureStudents->Surname); // Surname
			$this->SetSearchParm($cstFutureStudents->KnownAs); // KnownAs
			$this->SetSearchParm($cstFutureStudents->Organisation); // Organisation
			$this->SetSearchParm($cstFutureStudents->OrganisationType); // OrganisationType
			$this->SetSearchParm($cstFutureStudents->LengthEmploy); // LengthEmploy
			$this->SetSearchParm($cstFutureStudents->OtherCEFirms); // OtherCEFirms
			$this->SetSearchParm($cstFutureStudents->StudentNumber); // StudentNumber
			$this->SetSearchParm($cstFutureStudents->CCEFacilitatorID); // CCEFacilitatorID
			$this->SetSearchParm($cstFutureStudents->Project); // Project
			$this->SetSearchParm($cstFutureStudents->ProjectDiscipline); // ProjectDiscipline
			$this->SetSearchParm($cstFutureStudents->IDNumber); // IDNumber
			$this->SetSearchParm($cstFutureStudents->ECSARegistered); // ECSARegistered
			$this->SetSearchParm($cstFutureStudents->ECSACategory); // ECSACategory
			$this->SetSearchParm($cstFutureStudents->ECSANumber); // ECSANumber
			$this->SetSearchParm($cstFutureStudents->OtherStatutoryBodyRegistered); // OtherStatutoryBodyRegistered
			$this->SetSearchParm($cstFutureStudents->OtherStatutoryBodyName); // OtherStatutoryBodyName
			$this->SetSearchParm($cstFutureStudents->OtherStatutoryBodyNumber); // OtherStatutoryBodyNumber
			$this->SetSearchParm($cstFutureStudents->Age); // Age
			$this->SetSearchParm($cstFutureStudents->HighestQual); // HighestQual
			$this->SetSearchParm($cstFutureStudents->AreaDiscipline); // AreaDiscipline
			$this->SetSearchParm($cstFutureStudents->Telephone); // Telephone
			$this->SetSearchParm($cstFutureStudents->Cellphone); // Cellphone
			$this->SetSearchParm($cstFutureStudents->EmailAddress); // EmailAddress
			$this->SetSearchParm($cstFutureStudents->HomeAddress); // HomeAddress
			$this->SetSearchParm($cstFutureStudents->WorkAddress); // WorkAddress
			$this->SetSearchParm($cstFutureStudents->PostalAddress); // PostalAddress
			$this->SetSearchParm($cstFutureStudents->Designation); // Designation
			$this->SetSearchParm($cstFutureStudents->Department); // Department
			$this->SetSearchParm($cstFutureStudents->CESAMemberFirm); // CESAMemberFirm
			$this->SetSearchParm($cstFutureStudents->CESAAccountNo); // CESAAccountNo
			$this->SetSearchParm($cstFutureStudents->VATNo); // VATNo
			$this->SetSearchParm($cstFutureStudents->DietaryRequirements); // DietaryRequirements
			$this->SetSearchParm($cstFutureStudents->OrderNo); // OrderNo
			$this->SetSearchParm($cstFutureStudents->BookedByName); // BookedByName
			$this->SetSearchParm($cstFutureStudents->BookedByDesignation); // BookedByDesignation
			$this->SetSearchParm($cstFutureStudents->BookedByTelNo); // BookedByTelNo
			$this->SetSearchParm($cstFutureStudents->BookedByFaxNo); // BookedByFaxNo
			$this->SetSearchParm($cstFutureStudents->BookedByCellNo); // BookedByCellNo
			$this->SetSearchParm($cstFutureStudents->BookedByEmail); // BookedByEmail
			$this->SetSearchParm($cstFutureStudents->WebUsername); // WebUsername
			$this->SetSearchParm($cstFutureStudents->WebPassword); // WebPassword
			$this->SetSearchParm($cstFutureStudents->MentorDesig); // MentorDesig
			$this->SetSearchParm($cstFutureStudents->MentorTel); // MentorTel
			$this->SetSearchParm($cstFutureStudents->MentorCell); // MentorCell
			$this->SetSearchParm($cstFutureStudents->MentorEmail); // MentorEmail
			$this->SetSearchParm($cstFutureStudents->HRManagerName); // HRManagerName
			$this->SetSearchParm($cstFutureStudents->HRManagerDesignation); // HRManagerDesignation
			$this->SetSearchParm($cstFutureStudents->HRManagerTelNo); // HRManagerTelNo
			$this->SetSearchParm($cstFutureStudents->HRManagerCellNo); // HRManagerCellNo
			$this->SetSearchParm($cstFutureStudents->HRManagerEmail); // HRManagerEmail
			$this->SetSearchParm($cstFutureStudents->BlockAccess); // BlockAccess
			$this->SetSearchParm($cstFutureStudents->Archived); // Archived
			$this->SetSearchParm($cstFutureStudents->MentorFirstName); // MentorFirstName
			$this->SetSearchParm($cstFutureStudents->MentorSurname); // MentorSurname
		}
		return $sWhere;
	}

	// Build search SQL
	function BuildSearchSql(&$Where, &$Fld, $MultiValue) {
		$FldParm = substr($Fld->FldVar, 2);		
		$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
		$FldOpr = $Fld->AdvancedSearch->SearchOperator; // @$_GET["z_$FldParm"]
		$FldCond = $Fld->AdvancedSearch->SearchCondition; // @$_GET["v_$FldParm"]
		$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
		$FldOpr2 = $Fld->AdvancedSearch->SearchOperator2; // @$_GET["w_$FldParm"]
		$sWrk = "";

		//$FldVal = ew_StripSlashes($FldVal);
		if (is_array($FldVal)) $FldVal = implode(",", $FldVal);

		//$FldVal2 = ew_StripSlashes($FldVal2);
		if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
		$FldOpr = strtoupper(trim($FldOpr));
		if ($FldOpr == "") $FldOpr = "=";
		$FldOpr2 = strtoupper(trim($FldOpr2));
		if ($FldOpr2 == "") $FldOpr2 = "=";
		if (EW_SEARCH_MULTI_VALUE_OPTION == 1 || $FldOpr <> "LIKE" ||
			($FldOpr2 <> "LIKE" && $FldVal2 <> ""))
			$MultiValue = FALSE;
		if ($MultiValue) {
			$sWrk1 = ($FldVal <> "") ? ew_GetMultiSearchSql($Fld, $FldVal) : ""; // Field value 1
			$sWrk2 = ($FldVal2 <> "") ? ew_GetMultiSearchSql($Fld, $FldVal2) : ""; // Field value 2
			$sWrk = $sWrk1; // Build final SQL
			if ($sWrk2 <> "")
				$sWrk = ($sWrk <> "") ? "($sWrk) $FldCond ($sWrk2)" : $sWrk2;
		} else {
			$FldVal = $this->ConvertSearchValue($Fld, $FldVal);
			$FldVal2 = $this->ConvertSearchValue($Fld, $FldVal2);
			$sWrk = ew_GetSearchSql($Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2);
		}
		if ($sWrk <> "") {
			if ($Where <> "") $Where .= " AND ";
			$Where .= "(" . $sWrk . ")";
		}
	}

	// Set search parameters
	function SetSearchParm(&$Fld) {
		global $cstFutureStudents;
		$FldParm = substr($Fld->FldVar, 2);
		$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
		$FldVal = ew_StripSlashes($FldVal);
		if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
		$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
		$FldVal2 = ew_StripSlashes($FldVal2);
		if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
		$cstFutureStudents->setAdvancedSearch("x_$FldParm", $FldVal);
		$cstFutureStudents->setAdvancedSearch("z_$FldParm", $Fld->AdvancedSearch->SearchOperator); // @$_GET["z_$FldParm"]
		$cstFutureStudents->setAdvancedSearch("v_$FldParm", $Fld->AdvancedSearch->SearchCondition); // @$_GET["v_$FldParm"]
		$cstFutureStudents->setAdvancedSearch("y_$FldParm", $FldVal2);
		$cstFutureStudents->setAdvancedSearch("w_$FldParm", $Fld->AdvancedSearch->SearchOperator2); // @$_GET["w_$FldParm"]
	}

	// Get search parameters
	function GetSearchParm(&$Fld) {
		global $cstFutureStudents;
		$FldParm = substr($Fld->FldVar, 2);
		$Fld->AdvancedSearch->SearchValue = $cstFutureStudents->GetAdvancedSearch("x_$FldParm");
		$Fld->AdvancedSearch->SearchOperator = $cstFutureStudents->GetAdvancedSearch("z_$FldParm");
		$Fld->AdvancedSearch->SearchCondition = $cstFutureStudents->GetAdvancedSearch("v_$FldParm");
		$Fld->AdvancedSearch->SearchValue2 = $cstFutureStudents->GetAdvancedSearch("y_$FldParm");
		$Fld->AdvancedSearch->SearchOperator2 = $cstFutureStudents->GetAdvancedSearch("w_$FldParm");
	}

	// Convert search value
	function ConvertSearchValue(&$Fld, $FldVal) {
		$Value = $FldVal;
		if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) {
			if ($FldVal <> "") $Value = ($FldVal == "1") ? $Fld->TrueValue : $Fld->FalseValue;
		} elseif ($Fld->FldDataType == EW_DATATYPE_DATE) {
			if ($FldVal <> "") $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat);
		}
		return $Value;
	}

	// Return basic search SQL
	function BasicSearchSQL($Keyword) {
		global $cstFutureStudents;
		$sKeyword = ew_AdjustSql($Keyword);
		$sWhere = "";
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Title, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->FirstName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Surname, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->KnownAs, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Organisation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->OrganisationType, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->LengthEmploy, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->OtherCEFirms, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->StudentNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->ProjectDiscipline, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->IDNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->ECSARegistered, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->ECSACategory, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->ECSANumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->OtherStatutoryBodyName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->OtherStatutoryBodyNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HighestQual, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->AreaDiscipline, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Telephone, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Cellphone, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->EmailAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HomeAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->WorkAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->PostalAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Designation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->Department, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->CESAMemberFirm, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->CESAAccountNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->VATNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->DietaryRequirements, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->IDFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->CVFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->QualCertificate1, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->QualCertificate2, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->QualCertificate3, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MemorandumFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->AgreementFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->OrderNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByDesignation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByTelNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByFaxNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByCellNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BookedByEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->WebUsername, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->WebPassword, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorDesig, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorTel, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorCell, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HRManagerName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HRManagerDesignation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HRManagerTelNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HRManagerCellNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->HRManagerEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->BlockAccess, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorFirstName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstFutureStudents->MentorSurname, $Keyword);
		return $sWhere;
	}

	// Build basic search SQL
	function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {
		$sFldExpression = ($Fld->FldVirtualExpression <> "") ? $Fld->FldVirtualExpression : $Fld->FldExpression;
		$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;
		if ($lFldDataType == EW_DATATYPE_NUMBER) {
			$sWrk = $sFldExpression . " = " . ew_QuotedValue($Keyword, $lFldDataType);
		} else {
			$sWrk = $sFldExpression . " LIKE " . ew_QuotedValue("%" . $Keyword . "%", $lFldDataType);
		}
		if ($Where <> "") $Where .= " OR ";
		$Where .= $sWrk;
	}

	// Return basic search WHERE clause based on search keyword and type
	function BasicSearchWhere() {
		global $Security, $cstFutureStudents;
		$sSearchStr = "";
		if (!$Security->CanSearch()) return "";
		$sSearchKeyword = $cstFutureStudents->BasicSearchKeyword;
		$sSearchType = $cstFutureStudents->BasicSearchType;
		if ($sSearchKeyword <> "") {
			$sSearch = trim($sSearchKeyword);
			if ($sSearchType <> "") {
				while (strpos($sSearch, "  ") !== FALSE)
					$sSearch = str_replace("  ", " ", $sSearch);
				$arKeyword = explode(" ", trim($sSearch));
				foreach ($arKeyword as $sKeyword) {
					if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " ";
					$sSearchStr .= "(" . $this->BasicSearchSQL($sKeyword) . ")";
				}
			} else {
				$sSearchStr = $this->BasicSearchSQL($sSearch);
			}
		}
		if ($sSearchKeyword <> "") {
			$cstFutureStudents->setSessionBasicSearchKeyword($sSearchKeyword);
			$cstFutureStudents->setSessionBasicSearchType($sSearchType);
		}
		return $sSearchStr;
	}

	// Clear all search parameters
	function ResetSearchParms() {
		global $cstFutureStudents;

		// Clear search WHERE clause
		$this->sSrchWhere = "";
		$cstFutureStudents->setSearchWhere($this->sSrchWhere);

		// Clear basic search parameters
		$this->ResetBasicSearchParms();

		// Clear advanced search parameters
		$this->ResetAdvancedSearchParms();
	}

	// Clear all basic search parameters
	function ResetBasicSearchParms() {
		global $cstFutureStudents;
		$cstFutureStudents->setSessionBasicSearchKeyword("");
		$cstFutureStudents->setSessionBasicSearchType("");
	}

	// Clear all advanced search parameters
	function ResetAdvancedSearchParms() {
		global $cstFutureStudents;
		$cstFutureStudents->setAdvancedSearch("x_CCEStudentID", "");
		$cstFutureStudents->setAdvancedSearch("x_Title", "");
		$cstFutureStudents->setAdvancedSearch("x_FirstName", "");
		$cstFutureStudents->setAdvancedSearch("x_Surname", "");
		$cstFutureStudents->setAdvancedSearch("x_KnownAs", "");
		$cstFutureStudents->setAdvancedSearch("x_Organisation", "");
		$cstFutureStudents->setAdvancedSearch("x_OrganisationType", "");
		$cstFutureStudents->setAdvancedSearch("x_LengthEmploy", "");
		$cstFutureStudents->setAdvancedSearch("x_OtherCEFirms", "");
		$cstFutureStudents->setAdvancedSearch("x_StudentNumber", "");
		$cstFutureStudents->setAdvancedSearch("x_CCEFacilitatorID", "");
		$cstFutureStudents->setAdvancedSearch("x_Project", "");
		$cstFutureStudents->setAdvancedSearch("x_ProjectDiscipline", "");
		$cstFutureStudents->setAdvancedSearch("x_IDNumber", "");
		$cstFutureStudents->setAdvancedSearch("x_ECSARegistered", "");
		$cstFutureStudents->setAdvancedSearch("x_ECSACategory", "");
		$cstFutureStudents->setAdvancedSearch("x_ECSANumber", "");
		$cstFutureStudents->setAdvancedSearch("x_OtherStatutoryBodyRegistered", "");
		$cstFutureStudents->setAdvancedSearch("x_OtherStatutoryBodyName", "");
		$cstFutureStudents->setAdvancedSearch("x_OtherStatutoryBodyNumber", "");
		$cstFutureStudents->setAdvancedSearch("x_Age", "");
		$cstFutureStudents->setAdvancedSearch("x_HighestQual", "");
		$cstFutureStudents->setAdvancedSearch("x_AreaDiscipline", "");
		$cstFutureStudents->setAdvancedSearch("x_Telephone", "");
		$cstFutureStudents->setAdvancedSearch("x_Cellphone", "");
		$cstFutureStudents->setAdvancedSearch("x_EmailAddress", "");
		$cstFutureStudents->setAdvancedSearch("x_HomeAddress", "");
		$cstFutureStudents->setAdvancedSearch("x_WorkAddress", "");
		$cstFutureStudents->setAdvancedSearch("x_PostalAddress", "");
		$cstFutureStudents->setAdvancedSearch("x_Designation", "");
		$cstFutureStudents->setAdvancedSearch("x_Department", "");
		$cstFutureStudents->setAdvancedSearch("x_CESAMemberFirm", "");
		$cstFutureStudents->setAdvancedSearch("x_CESAAccountNo", "");
		$cstFutureStudents->setAdvancedSearch("x_VATNo", "");
		$cstFutureStudents->setAdvancedSearch("x_DietaryRequirements", "");
		$cstFutureStudents->setAdvancedSearch("x_OrderNo", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByName", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByDesignation", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByTelNo", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByFaxNo", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByCellNo", "");
		$cstFutureStudents->setAdvancedSearch("x_BookedByEmail", "");
		$cstFutureStudents->setAdvancedSearch("x_WebUsername", "");
		$cstFutureStudents->setAdvancedSearch("x_WebPassword", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorDesig", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorTel", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorCell", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorEmail", "");
		$cstFutureStudents->setAdvancedSearch("x_HRManagerName", "");
		$cstFutureStudents->setAdvancedSearch("x_HRManagerDesignation", "");
		$cstFutureStudents->setAdvancedSearch("x_HRManagerTelNo", "");
		$cstFutureStudents->setAdvancedSearch("x_HRManagerCellNo", "");
		$cstFutureStudents->setAdvancedSearch("x_HRManagerEmail", "");
		$cstFutureStudents->setAdvancedSearch("x_BlockAccess", "");
		$cstFutureStudents->setAdvancedSearch("x_Archived", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorFirstName", "");
		$cstFutureStudents->setAdvancedSearch("x_MentorSurname", "");
	}

	// Restore all search parameters
	function RestoreSearchParms() {
		global $cstFutureStudents;
		$bRestore = TRUE;
		if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCEStudentID"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Title"] <> "") $bRestore = FALSE;
		if (@$_GET["x_FirstName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Surname"] <> "") $bRestore = FALSE;
		if (@$_GET["x_KnownAs"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Organisation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OrganisationType"] <> "") $bRestore = FALSE;
		if (@$_GET["x_LengthEmploy"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OtherCEFirms"] <> "") $bRestore = FALSE;
		if (@$_GET["x_StudentNumber"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCEFacilitatorID"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Project"] <> "") $bRestore = FALSE;
		if (@$_GET["x_ProjectDiscipline"] <> "") $bRestore = FALSE;
		if (@$_GET["x_IDNumber"] <> "") $bRestore = FALSE;
		if (@$_GET["x_ECSARegistered"] <> "") $bRestore = FALSE;
		if (@$_GET["x_ECSACategory"] <> "") $bRestore = FALSE;
		if (@$_GET["x_ECSANumber"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OtherStatutoryBodyRegistered"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OtherStatutoryBodyName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OtherStatutoryBodyNumber"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Age"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HighestQual"] <> "") $bRestore = FALSE;
		if (@$_GET["x_AreaDiscipline"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Telephone"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Cellphone"] <> "") $bRestore = FALSE;
		if (@$_GET["x_EmailAddress"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HomeAddress"] <> "") $bRestore = FALSE;
		if (@$_GET["x_WorkAddress"] <> "") $bRestore = FALSE;
		if (@$_GET["x_PostalAddress"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Designation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Department"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CESAMemberFirm"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CESAAccountNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_VATNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_DietaryRequirements"] <> "") $bRestore = FALSE;
		if (@$_GET["x_OrderNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByDesignation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByTelNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByFaxNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByCellNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BookedByEmail"] <> "") $bRestore = FALSE;
		if (@$_GET["x_WebUsername"] <> "") $bRestore = FALSE;
		if (@$_GET["x_WebPassword"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorDesig"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorTel"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorCell"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorEmail"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HRManagerName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HRManagerDesignation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HRManagerTelNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HRManagerCellNo"] <> "") $bRestore = FALSE;
		if (@$_GET["x_HRManagerEmail"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BlockAccess"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Archived"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorFirstName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorSurname"] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

			// Restore basic search values
			$cstFutureStudents->BasicSearchKeyword = $cstFutureStudents->getSessionBasicSearchKeyword();
			$cstFutureStudents->BasicSearchType = $cstFutureStudents->getSessionBasicSearchType();

			// Restore advanced search values
			$this->GetSearchParm($cstFutureStudents->CCEStudentID);
			$this->GetSearchParm($cstFutureStudents->Title);
			$this->GetSearchParm($cstFutureStudents->FirstName);
			$this->GetSearchParm($cstFutureStudents->Surname);
			$this->GetSearchParm($cstFutureStudents->KnownAs);
			$this->GetSearchParm($cstFutureStudents->Organisation);
			$this->GetSearchParm($cstFutureStudents->OrganisationType);
			$this->GetSearchParm($cstFutureStudents->LengthEmploy);
			$this->GetSearchParm($cstFutureStudents->OtherCEFirms);
			$this->GetSearchParm($cstFutureStudents->StudentNumber);
			$this->GetSearchParm($cstFutureStudents->CCEFacilitatorID);
			$this->GetSearchParm($cstFutureStudents->Project);
			$this->GetSearchParm($cstFutureStudents->ProjectDiscipline);
			$this->GetSearchParm($cstFutureStudents->IDNumber);
			$this->GetSearchParm($cstFutureStudents->ECSARegistered);
			$this->GetSearchParm($cstFutureStudents->ECSACategory);
			$this->GetSearchParm($cstFutureStudents->ECSANumber);
			$this->GetSearchParm($cstFutureStudents->OtherStatutoryBodyRegistered);
			$this->GetSearchParm($cstFutureStudents->OtherStatutoryBodyName);
			$this->GetSearchParm($cstFutureStudents->OtherStatutoryBodyNumber);
			$this->GetSearchParm($cstFutureStudents->Age);
			$this->GetSearchParm($cstFutureStudents->HighestQual);
			$this->GetSearchParm($cstFutureStudents->AreaDiscipline);
			$this->GetSearchParm($cstFutureStudents->Telephone);
			$this->GetSearchParm($cstFutureStudents->Cellphone);
			$this->GetSearchParm($cstFutureStudents->EmailAddress);
			$this->GetSearchParm($cstFutureStudents->HomeAddress);
			$this->GetSearchParm($cstFutureStudents->WorkAddress);
			$this->GetSearchParm($cstFutureStudents->PostalAddress);
			$this->GetSearchParm($cstFutureStudents->Designation);
			$this->GetSearchParm($cstFutureStudents->Department);
			$this->GetSearchParm($cstFutureStudents->CESAMemberFirm);
			$this->GetSearchParm($cstFutureStudents->CESAAccountNo);
			$this->GetSearchParm($cstFutureStudents->VATNo);
			$this->GetSearchParm($cstFutureStudents->DietaryRequirements);
			$this->GetSearchParm($cstFutureStudents->OrderNo);
			$this->GetSearchParm($cstFutureStudents->BookedByName);
			$this->GetSearchParm($cstFutureStudents->BookedByDesignation);
			$this->GetSearchParm($cstFutureStudents->BookedByTelNo);
			$this->GetSearchParm($cstFutureStudents->BookedByFaxNo);
			$this->GetSearchParm($cstFutureStudents->BookedByCellNo);
			$this->GetSearchParm($cstFutureStudents->BookedByEmail);
			$this->GetSearchParm($cstFutureStudents->WebUsername);
			$this->GetSearchParm($cstFutureStudents->WebPassword);
			$this->GetSearchParm($cstFutureStudents->MentorDesig);
			$this->GetSearchParm($cstFutureStudents->MentorTel);
			$this->GetSearchParm($cstFutureStudents->MentorCell);
			$this->GetSearchParm($cstFutureStudents->MentorEmail);
			$this->GetSearchParm($cstFutureStudents->HRManagerName);
			$this->GetSearchParm($cstFutureStudents->HRManagerDesignation);
			$this->GetSearchParm($cstFutureStudents->HRManagerTelNo);
			$this->GetSearchParm($cstFutureStudents->HRManagerCellNo);
			$this->GetSearchParm($cstFutureStudents->HRManagerEmail);
			$this->GetSearchParm($cstFutureStudents->BlockAccess);
			$this->GetSearchParm($cstFutureStudents->Archived);
			$this->GetSearchParm($cstFutureStudents->MentorFirstName);
			$this->GetSearchParm($cstFutureStudents->MentorSurname);
		}
	}

	// Set up sort parameters
	function SetUpSortOrder() {
		global $cstFutureStudents;

		// Check for Ctrl pressed
		$bCtrl = (@$_GET["ctrl"] <> "");

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$cstFutureStudents->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$cstFutureStudents->CurrentOrderType = @$_GET["ordertype"];
			$cstFutureStudents->UpdateSort($cstFutureStudents->FirstName, $bCtrl); // FirstName
			$cstFutureStudents->UpdateSort($cstFutureStudents->Surname, $bCtrl); // Surname
			$cstFutureStudents->UpdateSort($cstFutureStudents->KnownAs, $bCtrl); // KnownAs
			$cstFutureStudents->UpdateSort($cstFutureStudents->Organisation, $bCtrl); // Organisation
			$cstFutureStudents->UpdateSort($cstFutureStudents->StudentNumber, $bCtrl); // StudentNumber
			$cstFutureStudents->UpdateSort($cstFutureStudents->ECSACategory, $bCtrl); // ECSACategory
			$cstFutureStudents->UpdateSort($cstFutureStudents->Cellphone, $bCtrl); // Cellphone
			$cstFutureStudents->UpdateSort($cstFutureStudents->EmailAddress, $bCtrl); // EmailAddress
			$cstFutureStudents->UpdateSort($cstFutureStudents->MentorFirstName, $bCtrl); // MentorFirstName
			$cstFutureStudents->UpdateSort($cstFutureStudents->MentorSurname, $bCtrl); // MentorSurname
			$cstFutureStudents->setStartRecordNumber(1); // Reset start position
		}
	}

	// Load sort order parameters
	function LoadSortOrder() {
		global $cstFutureStudents;
		$sOrderBy = $cstFutureStudents->getSessionOrderBy(); // Get ORDER BY from Session
		if ($sOrderBy == "") {
			if ($cstFutureStudents->SqlOrderBy() <> "") {
				$sOrderBy = $cstFutureStudents->SqlOrderBy();
				$cstFutureStudents->setSessionOrderBy($sOrderBy);
			}
		}
	}

	// Reset command
	// cmd=reset (Reset search parameters)
	// cmd=resetall (Reset search and master/detail parameters)
	// cmd=resetsort (Reset sort parameters)
	function ResetCmd() {
		global $cstFutureStudents;

		// Get reset command
		if (@$_GET["cmd"] <> "") {
			$sCmd = $_GET["cmd"];

			// Reset search criteria
			if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall")
				$this->ResetSearchParms();

			// Reset sorting order
			if (strtolower($sCmd) == "resetsort") {
				$sOrderBy = "";
				$cstFutureStudents->setSessionOrderBy($sOrderBy);
				$cstFutureStudents->FirstName->setSort("");
				$cstFutureStudents->Surname->setSort("");
				$cstFutureStudents->KnownAs->setSort("");
				$cstFutureStudents->Organisation->setSort("");
				$cstFutureStudents->StudentNumber->setSort("");
				$cstFutureStudents->ECSACategory->setSort("");
				$cstFutureStudents->Cellphone->setSort("");
				$cstFutureStudents->EmailAddress->setSort("");
				$cstFutureStudents->MentorFirstName->setSort("");
				$cstFutureStudents->MentorSurname->setSort("");
			}

			// Reset start position
			$this->lStartRec = 1;
			$cstFutureStudents->setStartRecordNumber($this->lStartRec);
		}
	}

	// Set up list options
	function SetupListOptions() {
		global $Security, $cstFutureStudents;

		// "view"
		$this->ListOptions->Add("view");
		$item =& $this->ListOptions->Items["view"];
		$item->CssStyle = "white-space: nowrap;";
		$item->Visible = $Security->CanView();
		$item->OnLeft = FALSE;

		// Call ListOptions_Load event
		$this->ListOptions_Load();
		if ($cstFutureStudents->Export <> "" ||
			$cstFutureStudents->CurrentAction == "gridadd" ||
			$cstFutureStudents->CurrentAction == "gridedit")
			$this->ListOptions->HideAllOptions();
	}

	// Render list options
	function RenderListOptions() {
		global $Security, $Language, $cstFutureStudents;
		$this->ListOptions->LoadDefault();

		// "view"
		$oListOpt =& $this->ListOptions->Items["view"];
		if ($Security->CanView() && $oListOpt->Visible)
			$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . "<img src=\"images/view.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
		$this->RenderListOptionsExt();

		// Call ListOptions_Rendered event
		$this->ListOptions_Rendered();
	}

	function RenderListOptionsExt() {
		global $Security, $Language, $cstFutureStudents;
	}

	// Set up starting record parameters
	function SetUpStartRec() {
		global $cstFutureStudents;
		if ($this->lDisplayRecs == 0)
			return;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
				$this->lStartRec = $_GET[EW_TABLE_START_REC];
				$cstFutureStudents->setStartRecordNumber($this->lStartRec);
			} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
				$this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
				if (is_numeric($this->nPageNo)) {
					$this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
					if ($this->lStartRec <= 0) {
						$this->lStartRec = 1;
					} elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
						$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
					}
					$cstFutureStudents->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $cstFutureStudents->getStartRecordNumber();

		// Check if correct start record counter
		if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
			$this->lStartRec = 1; // Reset start record counter
			$cstFutureStudents->setStartRecordNumber($this->lStartRec);
		} elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
			$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
			$cstFutureStudents->setStartRecordNumber($this->lStartRec);
		} elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
			$this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
			$cstFutureStudents->setStartRecordNumber($this->lStartRec);
		}
	}

	// Load basic search values
	function LoadBasicSearchValues() {
		global $cstFutureStudents;
		$cstFutureStudents->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];
		$cstFutureStudents->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];
	}

	//  Load search values for validation
	function LoadSearchValues() {
		global $objForm, $cstFutureStudents;

		// Load search values
		// CCEStudentID

		$cstFutureStudents->CCEStudentID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCEStudentID"]);
		$cstFutureStudents->CCEStudentID->AdvancedSearch->SearchOperator = @$_GET["z_CCEStudentID"];

		// Title
		$cstFutureStudents->Title->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Title"]);
		$cstFutureStudents->Title->AdvancedSearch->SearchOperator = @$_GET["z_Title"];

		// FirstName
		$cstFutureStudents->FirstName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_FirstName"]);
		$cstFutureStudents->FirstName->AdvancedSearch->SearchOperator = @$_GET["z_FirstName"];

		// Surname
		$cstFutureStudents->Surname->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Surname"]);
		$cstFutureStudents->Surname->AdvancedSearch->SearchOperator = @$_GET["z_Surname"];

		// KnownAs
		$cstFutureStudents->KnownAs->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_KnownAs"]);
		$cstFutureStudents->KnownAs->AdvancedSearch->SearchOperator = @$_GET["z_KnownAs"];

		// Organisation
		$cstFutureStudents->Organisation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Organisation"]);
		$cstFutureStudents->Organisation->AdvancedSearch->SearchOperator = @$_GET["z_Organisation"];

		// OrganisationType
		$cstFutureStudents->OrganisationType->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OrganisationType"]);
		$cstFutureStudents->OrganisationType->AdvancedSearch->SearchOperator = @$_GET["z_OrganisationType"];

		// LengthEmploy
		$cstFutureStudents->LengthEmploy->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_LengthEmploy"]);
		$cstFutureStudents->LengthEmploy->AdvancedSearch->SearchOperator = @$_GET["z_LengthEmploy"];

		// OtherCEFirms
		$cstFutureStudents->OtherCEFirms->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OtherCEFirms"]);
		$cstFutureStudents->OtherCEFirms->AdvancedSearch->SearchOperator = @$_GET["z_OtherCEFirms"];

		// StudentNumber
		$cstFutureStudents->StudentNumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_StudentNumber"]);
		$cstFutureStudents->StudentNumber->AdvancedSearch->SearchOperator = @$_GET["z_StudentNumber"];

		// CCEFacilitatorID
		$cstFutureStudents->CCEFacilitatorID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCEFacilitatorID"]);
		$cstFutureStudents->CCEFacilitatorID->AdvancedSearch->SearchOperator = @$_GET["z_CCEFacilitatorID"];

		// Project
		$cstFutureStudents->Project->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Project"]);
		$cstFutureStudents->Project->AdvancedSearch->SearchOperator = @$_GET["z_Project"];

		// ProjectDiscipline
		$cstFutureStudents->ProjectDiscipline->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ProjectDiscipline"]);
		$cstFutureStudents->ProjectDiscipline->AdvancedSearch->SearchOperator = @$_GET["z_ProjectDiscipline"];

		// IDNumber
		$cstFutureStudents->IDNumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_IDNumber"]);
		$cstFutureStudents->IDNumber->AdvancedSearch->SearchOperator = @$_GET["z_IDNumber"];

		// ECSARegistered
		$cstFutureStudents->ECSARegistered->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ECSARegistered"]);
		$cstFutureStudents->ECSARegistered->AdvancedSearch->SearchOperator = @$_GET["z_ECSARegistered"];

		// ECSACategory
		$cstFutureStudents->ECSACategory->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ECSACategory"]);
		$cstFutureStudents->ECSACategory->AdvancedSearch->SearchOperator = @$_GET["z_ECSACategory"];

		// ECSANumber
		$cstFutureStudents->ECSANumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ECSANumber"]);
		$cstFutureStudents->ECSANumber->AdvancedSearch->SearchOperator = @$_GET["z_ECSANumber"];

		// OtherStatutoryBodyRegistered
		$cstFutureStudents->OtherStatutoryBodyRegistered->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OtherStatutoryBodyRegistered"]);
		$cstFutureStudents->OtherStatutoryBodyRegistered->AdvancedSearch->SearchOperator = @$_GET["z_OtherStatutoryBodyRegistered"];

		// OtherStatutoryBodyName
		$cstFutureStudents->OtherStatutoryBodyName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OtherStatutoryBodyName"]);
		$cstFutureStudents->OtherStatutoryBodyName->AdvancedSearch->SearchOperator = @$_GET["z_OtherStatutoryBodyName"];

		// OtherStatutoryBodyNumber
		$cstFutureStudents->OtherStatutoryBodyNumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OtherStatutoryBodyNumber"]);
		$cstFutureStudents->OtherStatutoryBodyNumber->AdvancedSearch->SearchOperator = @$_GET["z_OtherStatutoryBodyNumber"];

		// Age
		$cstFutureStudents->Age->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Age"]);
		$cstFutureStudents->Age->AdvancedSearch->SearchOperator = @$_GET["z_Age"];

		// HighestQual
		$cstFutureStudents->HighestQual->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HighestQual"]);
		$cstFutureStudents->HighestQual->AdvancedSearch->SearchOperator = @$_GET["z_HighestQual"];

		// AreaDiscipline
		$cstFutureStudents->AreaDiscipline->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_AreaDiscipline"]);
		$cstFutureStudents->AreaDiscipline->AdvancedSearch->SearchOperator = @$_GET["z_AreaDiscipline"];

		// Telephone
		$cstFutureStudents->Telephone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Telephone"]);
		$cstFutureStudents->Telephone->AdvancedSearch->SearchOperator = @$_GET["z_Telephone"];

		// Cellphone
		$cstFutureStudents->Cellphone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Cellphone"]);
		$cstFutureStudents->Cellphone->AdvancedSearch->SearchOperator = @$_GET["z_Cellphone"];

		// EmailAddress
		$cstFutureStudents->EmailAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EmailAddress"]);
		$cstFutureStudents->EmailAddress->AdvancedSearch->SearchOperator = @$_GET["z_EmailAddress"];

		// HomeAddress
		$cstFutureStudents->HomeAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HomeAddress"]);
		$cstFutureStudents->HomeAddress->AdvancedSearch->SearchOperator = @$_GET["z_HomeAddress"];

		// WorkAddress
		$cstFutureStudents->WorkAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WorkAddress"]);
		$cstFutureStudents->WorkAddress->AdvancedSearch->SearchOperator = @$_GET["z_WorkAddress"];

		// PostalAddress
		$cstFutureStudents->PostalAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_PostalAddress"]);
		$cstFutureStudents->PostalAddress->AdvancedSearch->SearchOperator = @$_GET["z_PostalAddress"];

		// Designation
		$cstFutureStudents->Designation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Designation"]);
		$cstFutureStudents->Designation->AdvancedSearch->SearchOperator = @$_GET["z_Designation"];

		// Department
		$cstFutureStudents->Department->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Department"]);
		$cstFutureStudents->Department->AdvancedSearch->SearchOperator = @$_GET["z_Department"];

		// CESAMemberFirm
		$cstFutureStudents->CESAMemberFirm->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CESAMemberFirm"]);
		$cstFutureStudents->CESAMemberFirm->AdvancedSearch->SearchOperator = @$_GET["z_CESAMemberFirm"];

		// CESAAccountNo
		$cstFutureStudents->CESAAccountNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CESAAccountNo"]);
		$cstFutureStudents->CESAAccountNo->AdvancedSearch->SearchOperator = @$_GET["z_CESAAccountNo"];

		// VATNo
		$cstFutureStudents->VATNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_VATNo"]);
		$cstFutureStudents->VATNo->AdvancedSearch->SearchOperator = @$_GET["z_VATNo"];

		// DietaryRequirements
		$cstFutureStudents->DietaryRequirements->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_DietaryRequirements"]);
		$cstFutureStudents->DietaryRequirements->AdvancedSearch->SearchOperator = @$_GET["z_DietaryRequirements"];

		// OrderNo
		$cstFutureStudents->OrderNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_OrderNo"]);
		$cstFutureStudents->OrderNo->AdvancedSearch->SearchOperator = @$_GET["z_OrderNo"];

		// BookedByName
		$cstFutureStudents->BookedByName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByName"]);
		$cstFutureStudents->BookedByName->AdvancedSearch->SearchOperator = @$_GET["z_BookedByName"];

		// BookedByDesignation
		$cstFutureStudents->BookedByDesignation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByDesignation"]);
		$cstFutureStudents->BookedByDesignation->AdvancedSearch->SearchOperator = @$_GET["z_BookedByDesignation"];

		// BookedByTelNo
		$cstFutureStudents->BookedByTelNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByTelNo"]);
		$cstFutureStudents->BookedByTelNo->AdvancedSearch->SearchOperator = @$_GET["z_BookedByTelNo"];

		// BookedByFaxNo
		$cstFutureStudents->BookedByFaxNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByFaxNo"]);
		$cstFutureStudents->BookedByFaxNo->AdvancedSearch->SearchOperator = @$_GET["z_BookedByFaxNo"];

		// BookedByCellNo
		$cstFutureStudents->BookedByCellNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByCellNo"]);
		$cstFutureStudents->BookedByCellNo->AdvancedSearch->SearchOperator = @$_GET["z_BookedByCellNo"];

		// BookedByEmail
		$cstFutureStudents->BookedByEmail->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BookedByEmail"]);
		$cstFutureStudents->BookedByEmail->AdvancedSearch->SearchOperator = @$_GET["z_BookedByEmail"];

		// WebUsername
		$cstFutureStudents->WebUsername->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WebUsername"]);
		$cstFutureStudents->WebUsername->AdvancedSearch->SearchOperator = @$_GET["z_WebUsername"];

		// WebPassword
		$cstFutureStudents->WebPassword->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WebPassword"]);
		$cstFutureStudents->WebPassword->AdvancedSearch->SearchOperator = @$_GET["z_WebPassword"];

		// MentorDesig
		$cstFutureStudents->MentorDesig->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorDesig"]);
		$cstFutureStudents->MentorDesig->AdvancedSearch->SearchOperator = @$_GET["z_MentorDesig"];

		// MentorTel
		$cstFutureStudents->MentorTel->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorTel"]);
		$cstFutureStudents->MentorTel->AdvancedSearch->SearchOperator = @$_GET["z_MentorTel"];

		// MentorCell
		$cstFutureStudents->MentorCell->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorCell"]);
		$cstFutureStudents->MentorCell->AdvancedSearch->SearchOperator = @$_GET["z_MentorCell"];

		// MentorEmail
		$cstFutureStudents->MentorEmail->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorEmail"]);
		$cstFutureStudents->MentorEmail->AdvancedSearch->SearchOperator = @$_GET["z_MentorEmail"];

		// HRManagerName
		$cstFutureStudents->HRManagerName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HRManagerName"]);
		$cstFutureStudents->HRManagerName->AdvancedSearch->SearchOperator = @$_GET["z_HRManagerName"];

		// HRManagerDesignation
		$cstFutureStudents->HRManagerDesignation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HRManagerDesignation"]);
		$cstFutureStudents->HRManagerDesignation->AdvancedSearch->SearchOperator = @$_GET["z_HRManagerDesignation"];

		// HRManagerTelNo
		$cstFutureStudents->HRManagerTelNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HRManagerTelNo"]);
		$cstFutureStudents->HRManagerTelNo->AdvancedSearch->SearchOperator = @$_GET["z_HRManagerTelNo"];

		// HRManagerCellNo
		$cstFutureStudents->HRManagerCellNo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HRManagerCellNo"]);
		$cstFutureStudents->HRManagerCellNo->AdvancedSearch->SearchOperator = @$_GET["z_HRManagerCellNo"];

		// HRManagerEmail
		$cstFutureStudents->HRManagerEmail->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_HRManagerEmail"]);
		$cstFutureStudents->HRManagerEmail->AdvancedSearch->SearchOperator = @$_GET["z_HRManagerEmail"];

		// BlockAccess
		$cstFutureStudents->BlockAccess->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BlockAccess"]);
		$cstFutureStudents->BlockAccess->AdvancedSearch->SearchOperator = @$_GET["z_BlockAccess"];

		// Archived
		$cstFutureStudents->Archived->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Archived"]);
		$cstFutureStudents->Archived->AdvancedSearch->SearchOperator = @$_GET["z_Archived"];

		// MentorFirstName
		$cstFutureStudents->MentorFirstName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorFirstName"]);
		$cstFutureStudents->MentorFirstName->AdvancedSearch->SearchOperator = @$_GET["z_MentorFirstName"];

		// MentorSurname
		$cstFutureStudents->MentorSurname->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorSurname"]);
		$cstFutureStudents->MentorSurname->AdvancedSearch->SearchOperator = @$_GET["z_MentorSurname"];
	}

	// Load recordset
	function LoadRecordset($offset = -1, $rowcnt = -1) {
		global $conn, $cstFutureStudents;

		// Call Recordset Selecting event
		$cstFutureStudents->Recordset_Selecting($cstFutureStudents->CurrentFilter);

		// Load List page SQL
		$sSql = $cstFutureStudents->SelectSQL();
		if ($offset > -1 && $rowcnt > -1)
			$sSql .= " LIMIT $offset, $rowcnt";

		// Load recordset
		$rs = ew_LoadRecordset($sSql);

		// Call Recordset Selected event
		$cstFutureStudents->Recordset_Selected($rs);
		return $rs;
	}

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

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

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

			// Call Row Selected event
			$cstFutureStudents->Row_Selected($rs);
			$rs->Close();
		}
		return $res;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $cstFutureStudents;
		$cstFutureStudents->CCEStudentID->setDbValue($rs->fields('CCEStudentID'));
		$cstFutureStudents->Title->setDbValue($rs->fields('Title'));
		$cstFutureStudents->FirstName->setDbValue($rs->fields('FirstName'));
		$cstFutureStudents->Surname->setDbValue($rs->fields('Surname'));
		$cstFutureStudents->KnownAs->setDbValue($rs->fields('KnownAs'));
		$cstFutureStudents->Organisation->setDbValue($rs->fields('Organisation'));
		$cstFutureStudents->OrganisationType->setDbValue($rs->fields('OrganisationType'));
		$cstFutureStudents->LengthEmploy->setDbValue($rs->fields('LengthEmploy'));
		$cstFutureStudents->OtherCEFirms->setDbValue($rs->fields('OtherCEFirms'));
		$cstFutureStudents->StudentNumber->setDbValue($rs->fields('StudentNumber'));
		$cstFutureStudents->CCEFacilitatorID->setDbValue($rs->fields('CCEFacilitatorID'));
		$cstFutureStudents->Project->setDbValue($rs->fields('Project'));
		$cstFutureStudents->ProjectDiscipline->setDbValue($rs->fields('ProjectDiscipline'));
		$cstFutureStudents->IDNumber->setDbValue($rs->fields('IDNumber'));
		$cstFutureStudents->ECSARegistered->setDbValue($rs->fields('ECSARegistered'));
		$cstFutureStudents->ECSACategory->setDbValue($rs->fields('ECSACategory'));
		$cstFutureStudents->ECSANumber->setDbValue($rs->fields('ECSANumber'));
		$cstFutureStudents->OtherStatutoryBodyRegistered->setDbValue($rs->fields('OtherStatutoryBodyRegistered'));
		$cstFutureStudents->OtherStatutoryBodyName->setDbValue($rs->fields('OtherStatutoryBodyName'));
		$cstFutureStudents->OtherStatutoryBodyNumber->setDbValue($rs->fields('OtherStatutoryBodyNumber'));
		$cstFutureStudents->Age->setDbValue($rs->fields('Age'));
		$cstFutureStudents->HighestQual->setDbValue($rs->fields('HighestQual'));
		$cstFutureStudents->AreaDiscipline->setDbValue($rs->fields('AreaDiscipline'));
		$cstFutureStudents->Telephone->setDbValue($rs->fields('Telephone'));
		$cstFutureStudents->Cellphone->setDbValue($rs->fields('Cellphone'));
		$cstFutureStudents->EmailAddress->setDbValue($rs->fields('EmailAddress'));
		$cstFutureStudents->HomeAddress->setDbValue($rs->fields('HomeAddress'));
		$cstFutureStudents->WorkAddress->setDbValue($rs->fields('WorkAddress'));
		$cstFutureStudents->PostalAddress->setDbValue($rs->fields('PostalAddress'));
		$cstFutureStudents->Designation->setDbValue($rs->fields('Designation'));
		$cstFutureStudents->Department->setDbValue($rs->fields('Department'));
		$cstFutureStudents->CESAMemberFirm->setDbValue($rs->fields('CESAMemberFirm'));
		$cstFutureStudents->CESAAccountNo->setDbValue($rs->fields('CESAAccountNo'));
		$cstFutureStudents->VATNo->setDbValue($rs->fields('VATNo'));
		$cstFutureStudents->DietaryRequirements->setDbValue($rs->fields('DietaryRequirements'));
		$cstFutureStudents->IDFile->Upload->DbValue = $rs->fields('IDFile');
		$cstFutureStudents->CVFile->Upload->DbValue = $rs->fields('CVFile');
		$cstFutureStudents->QualCertificate1->Upload->DbValue = $rs->fields('QualCertificate1');
		$cstFutureStudents->QualCertificate2->Upload->DbValue = $rs->fields('QualCertificate2');
		$cstFutureStudents->QualCertificate3->Upload->DbValue = $rs->fields('QualCertificate3');
		$cstFutureStudents->MemorandumFile->Upload->DbValue = $rs->fields('MemorandumFile');
		$cstFutureStudents->AgreementFile->Upload->DbValue = $rs->fields('AgreementFile');
		$cstFutureStudents->OrderNo->setDbValue($rs->fields('OrderNo'));
		$cstFutureStudents->BookedByName->setDbValue($rs->fields('BookedByName'));
		$cstFutureStudents->BookedByDesignation->setDbValue($rs->fields('BookedByDesignation'));
		$cstFutureStudents->BookedByTelNo->setDbValue($rs->fields('BookedByTelNo'));
		$cstFutureStudents->BookedByFaxNo->setDbValue($rs->fields('BookedByFaxNo'));
		$cstFutureStudents->BookedByCellNo->setDbValue($rs->fields('BookedByCellNo'));
		$cstFutureStudents->BookedByEmail->setDbValue($rs->fields('BookedByEmail'));
		$cstFutureStudents->WebUsername->setDbValue($rs->fields('WebUsername'));
		$cstFutureStudents->WebPassword->setDbValue($rs->fields('WebPassword'));
		$cstFutureStudents->MentorDesig->setDbValue($rs->fields('MentorDesig'));
		$cstFutureStudents->MentorTel->setDbValue($rs->fields('MentorTel'));
		$cstFutureStudents->MentorCell->setDbValue($rs->fields('MentorCell'));
		$cstFutureStudents->MentorEmail->setDbValue($rs->fields('MentorEmail'));
		$cstFutureStudents->HRManagerName->setDbValue($rs->fields('HRManagerName'));
		$cstFutureStudents->HRManagerDesignation->setDbValue($rs->fields('HRManagerDesignation'));
		$cstFutureStudents->HRManagerTelNo->setDbValue($rs->fields('HRManagerTelNo'));
		$cstFutureStudents->HRManagerCellNo->setDbValue($rs->fields('HRManagerCellNo'));
		$cstFutureStudents->HRManagerEmail->setDbValue($rs->fields('HRManagerEmail'));
		$cstFutureStudents->BlockAccess->setDbValue($rs->fields('BlockAccess'));
		$cstFutureStudents->Archived->setDbValue($rs->fields('Archived'));
		$cstFutureStudents->MentorFirstName->setDbValue($rs->fields('MentorFirstName'));
		$cstFutureStudents->MentorSurname->setDbValue($rs->fields('MentorSurname'));
	}

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

		// Initialize URLs
		$this->ViewUrl = $cstFutureStudents->ViewUrl();
		$this->EditUrl = $cstFutureStudents->EditUrl();
		$this->InlineEditUrl = $cstFutureStudents->InlineEditUrl();
		$this->CopyUrl = $cstFutureStudents->CopyUrl();
		$this->InlineCopyUrl = $cstFutureStudents->InlineCopyUrl();
		$this->DeleteUrl = $cstFutureStudents->DeleteUrl();

		// Call Row_Rendering event
		$cstFutureStudents->Row_Rendering();

		// Common render codes for all row types
		// FirstName

		$cstFutureStudents->FirstName->CellCssStyle = ""; $cstFutureStudents->FirstName->CellCssClass = "";
		$cstFutureStudents->FirstName->CellAttrs = array(); $cstFutureStudents->FirstName->ViewAttrs = array(); $cstFutureStudents->FirstName->EditAttrs = array();

		// Surname
		$cstFutureStudents->Surname->CellCssStyle = ""; $cstFutureStudents->Surname->CellCssClass = "";
		$cstFutureStudents->Surname->CellAttrs = array(); $cstFutureStudents->Surname->ViewAttrs = array(); $cstFutureStudents->Surname->EditAttrs = array();

		// KnownAs
		$cstFutureStudents->KnownAs->CellCssStyle = ""; $cstFutureStudents->KnownAs->CellCssClass = "";
		$cstFutureStudents->KnownAs->CellAttrs = array(); $cstFutureStudents->KnownAs->ViewAttrs = array(); $cstFutureStudents->KnownAs->EditAttrs = array();

		// Organisation
		$cstFutureStudents->Organisation->CellCssStyle = ""; $cstFutureStudents->Organisation->CellCssClass = "";
		$cstFutureStudents->Organisation->CellAttrs = array(); $cstFutureStudents->Organisation->ViewAttrs = array(); $cstFutureStudents->Organisation->EditAttrs = array();

		// StudentNumber
		$cstFutureStudents->StudentNumber->CellCssStyle = ""; $cstFutureStudents->StudentNumber->CellCssClass = "";
		$cstFutureStudents->StudentNumber->CellAttrs = array(); $cstFutureStudents->StudentNumber->ViewAttrs = array(); $cstFutureStudents->StudentNumber->EditAttrs = array();

		// ECSACategory
		$cstFutureStudents->ECSACategory->CellCssStyle = ""; $cstFutureStudents->ECSACategory->CellCssClass = "";
		$cstFutureStudents->ECSACategory->CellAttrs = array(); $cstFutureStudents->ECSACategory->ViewAttrs = array(); $cstFutureStudents->ECSACategory->EditAttrs = array();

		// Cellphone
		$cstFutureStudents->Cellphone->CellCssStyle = ""; $cstFutureStudents->Cellphone->CellCssClass = "";
		$cstFutureStudents->Cellphone->CellAttrs = array(); $cstFutureStudents->Cellphone->ViewAttrs = array(); $cstFutureStudents->Cellphone->EditAttrs = array();

		// EmailAddress
		$cstFutureStudents->EmailAddress->CellCssStyle = ""; $cstFutureStudents->EmailAddress->CellCssClass = "";
		$cstFutureStudents->EmailAddress->CellAttrs = array(); $cstFutureStudents->EmailAddress->ViewAttrs = array(); $cstFutureStudents->EmailAddress->EditAttrs = array();

		// MentorFirstName
		$cstFutureStudents->MentorFirstName->CellCssStyle = ""; $cstFutureStudents->MentorFirstName->CellCssClass = "";
		$cstFutureStudents->MentorFirstName->CellAttrs = array(); $cstFutureStudents->MentorFirstName->ViewAttrs = array(); $cstFutureStudents->MentorFirstName->EditAttrs = array();

		// MentorSurname
		$cstFutureStudents->MentorSurname->CellCssStyle = ""; $cstFutureStudents->MentorSurname->CellCssClass = "";
		$cstFutureStudents->MentorSurname->CellAttrs = array(); $cstFutureStudents->MentorSurname->ViewAttrs = array(); $cstFutureStudents->MentorSurname->EditAttrs = array();
		if ($cstFutureStudents->RowType == EW_ROWTYPE_VIEW) { // View row

			// Title
			$cstFutureStudents->Title->ViewValue = $cstFutureStudents->Title->CurrentValue;
			$cstFutureStudents->Title->CssStyle = "";
			$cstFutureStudents->Title->CssClass = "";
			$cstFutureStudents->Title->ViewCustomAttributes = "";

			// FirstName
			$cstFutureStudents->FirstName->ViewValue = $cstFutureStudents->FirstName->CurrentValue;
			$cstFutureStudents->FirstName->CssStyle = "";
			$cstFutureStudents->FirstName->CssClass = "";
			$cstFutureStudents->FirstName->ViewCustomAttributes = "";

			// Surname
			$cstFutureStudents->Surname->ViewValue = $cstFutureStudents->Surname->CurrentValue;
			$cstFutureStudents->Surname->CssStyle = "";
			$cstFutureStudents->Surname->CssClass = "";
			$cstFutureStudents->Surname->ViewCustomAttributes = "";

			// KnownAs
			$cstFutureStudents->KnownAs->ViewValue = $cstFutureStudents->KnownAs->CurrentValue;
			$cstFutureStudents->KnownAs->CssStyle = "";
			$cstFutureStudents->KnownAs->CssClass = "";
			$cstFutureStudents->KnownAs->ViewCustomAttributes = "";

			// Organisation
			$cstFutureStudents->Organisation->ViewValue = $cstFutureStudents->Organisation->CurrentValue;
			$cstFutureStudents->Organisation->CssStyle = "";
			$cstFutureStudents->Organisation->CssClass = "";
			$cstFutureStudents->Organisation->ViewCustomAttributes = "";

			// OrganisationType
			$cstFutureStudents->OrganisationType->ViewValue = $cstFutureStudents->OrganisationType->CurrentValue;
			$cstFutureStudents->OrganisationType->CssStyle = "";
			$cstFutureStudents->OrganisationType->CssClass = "";
			$cstFutureStudents->OrganisationType->ViewCustomAttributes = "";

			// LengthEmploy
			$cstFutureStudents->LengthEmploy->ViewValue = $cstFutureStudents->LengthEmploy->CurrentValue;
			$cstFutureStudents->LengthEmploy->CssStyle = "";
			$cstFutureStudents->LengthEmploy->CssClass = "";
			$cstFutureStudents->LengthEmploy->ViewCustomAttributes = "";

			// StudentNumber
			$cstFutureStudents->StudentNumber->ViewValue = $cstFutureStudents->StudentNumber->CurrentValue;
			$cstFutureStudents->StudentNumber->CssStyle = "";
			$cstFutureStudents->StudentNumber->CssClass = "";
			$cstFutureStudents->StudentNumber->ViewCustomAttributes = "";

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

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

			// ProjectDiscipline
			$cstFutureStudents->ProjectDiscipline->ViewValue = $cstFutureStudents->ProjectDiscipline->CurrentValue;
			$cstFutureStudents->ProjectDiscipline->CssStyle = "";
			$cstFutureStudents->ProjectDiscipline->CssClass = "";
			$cstFutureStudents->ProjectDiscipline->ViewCustomAttributes = "";

			// IDNumber
			$cstFutureStudents->IDNumber->ViewValue = $cstFutureStudents->IDNumber->CurrentValue;
			$cstFutureStudents->IDNumber->CssStyle = "";
			$cstFutureStudents->IDNumber->CssClass = "";
			$cstFutureStudents->IDNumber->ViewCustomAttributes = "mso-number-format:General";

			// ECSARegistered
			if (strval($cstFutureStudents->ECSARegistered->CurrentValue) <> "") {
				switch ($cstFutureStudents->ECSARegistered->CurrentValue) {
					case "c":
						$cstFutureStudents->ECSARegistered->ViewValue = "Yes - Candidate Engineer";
						break;
					case "p":
						$cstFutureStudents->ECSARegistered->ViewValue = "Yes - Professional Engineer";
						break;
					case "n":
						$cstFutureStudents->ECSARegistered->ViewValue = "No";
						break;
					case "y":
						$cstFutureStudents->ECSARegistered->ViewValue = "Yes";
						break;
					default:
						$cstFutureStudents->ECSARegistered->ViewValue = $cstFutureStudents->ECSARegistered->CurrentValue;
				}
			} else {
				$cstFutureStudents->ECSARegistered->ViewValue = NULL;
			}
			$cstFutureStudents->ECSARegistered->CssStyle = "";
			$cstFutureStudents->ECSARegistered->CssClass = "";
			$cstFutureStudents->ECSARegistered->ViewCustomAttributes = "";

			// ECSACategory
			$cstFutureStudents->ECSACategory->ViewValue = $cstFutureStudents->ECSACategory->CurrentValue;
			$cstFutureStudents->ECSACategory->CssStyle = "";
			$cstFutureStudents->ECSACategory->CssClass = "";
			$cstFutureStudents->ECSACategory->ViewCustomAttributes = "";

			// ECSANumber
			$cstFutureStudents->ECSANumber->ViewValue = $cstFutureStudents->ECSANumber->CurrentValue;
			$cstFutureStudents->ECSANumber->CssStyle = "";
			$cstFutureStudents->ECSANumber->CssClass = "";
			$cstFutureStudents->ECSANumber->ViewCustomAttributes = "";

			// OtherStatutoryBodyRegistered
			if (strval($cstFutureStudents->OtherStatutoryBodyRegistered->CurrentValue) <> "") {
				switch ($cstFutureStudents->OtherStatutoryBodyRegistered->CurrentValue) {
					case "1":
						$cstFutureStudents->OtherStatutoryBodyRegistered->ViewValue = "Yes";
						break;
					case "0":
						$cstFutureStudents->OtherStatutoryBodyRegistered->ViewValue = "No";
						break;
					default:
						$cstFutureStudents->OtherStatutoryBodyRegistered->ViewValue = $cstFutureStudents->OtherStatutoryBodyRegistered->CurrentValue;
				}
			} else {
				$cstFutureStudents->OtherStatutoryBodyRegistered->ViewValue = NULL;
			}
			$cstFutureStudents->OtherStatutoryBodyRegistered->CssStyle = "";
			$cstFutureStudents->OtherStatutoryBodyRegistered->CssClass = "";
			$cstFutureStudents->OtherStatutoryBodyRegistered->ViewCustomAttributes = "";

			// OtherStatutoryBodyName
			$cstFutureStudents->OtherStatutoryBodyName->ViewValue = $cstFutureStudents->OtherStatutoryBodyName->CurrentValue;
			$cstFutureStudents->OtherStatutoryBodyName->CssStyle = "";
			$cstFutureStudents->OtherStatutoryBodyName->CssClass = "";
			$cstFutureStudents->OtherStatutoryBodyName->ViewCustomAttributes = "";

			// OtherStatutoryBodyNumber
			$cstFutureStudents->OtherStatutoryBodyNumber->ViewValue = $cstFutureStudents->OtherStatutoryBodyNumber->CurrentValue;
			$cstFutureStudents->OtherStatutoryBodyNumber->CssStyle = "";
			$cstFutureStudents->OtherStatutoryBodyNumber->CssClass = "";
			$cstFutureStudents->OtherStatutoryBodyNumber->ViewCustomAttributes = "";

			// Age
			if (strval($cstFutureStudents->Age->CurrentValue) <> "") {
				switch ($cstFutureStudents->Age->CurrentValue) {
					case "1":
						$cstFutureStudents->Age->ViewValue = "Yes";
						break;
					case "0":
						$cstFutureStudents->Age->ViewValue = "No";
						break;
					default:
						$cstFutureStudents->Age->ViewValue = $cstFutureStudents->Age->CurrentValue;
				}
			} else {
				$cstFutureStudents->Age->ViewValue = NULL;
			}
			$cstFutureStudents->Age->CssStyle = "";
			$cstFutureStudents->Age->CssClass = "";
			$cstFutureStudents->Age->ViewCustomAttributes = "";

			// HighestQual
			$cstFutureStudents->HighestQual->ViewValue = $cstFutureStudents->HighestQual->CurrentValue;
			$cstFutureStudents->HighestQual->CssStyle = "";
			$cstFutureStudents->HighestQual->CssClass = "";
			$cstFutureStudents->HighestQual->ViewCustomAttributes = "";

			// AreaDiscipline
			$cstFutureStudents->AreaDiscipline->ViewValue = $cstFutureStudents->AreaDiscipline->CurrentValue;
			$cstFutureStudents->AreaDiscipline->CssStyle = "";
			$cstFutureStudents->AreaDiscipline->CssClass = "";
			$cstFutureStudents->AreaDiscipline->ViewCustomAttributes = "";

			// Telephone
			$cstFutureStudents->Telephone->ViewValue = $cstFutureStudents->Telephone->CurrentValue;
			$cstFutureStudents->Telephone->CssStyle = "";
			$cstFutureStudents->Telephone->CssClass = "";
			$cstFutureStudents->Telephone->ViewCustomAttributes = "mso-number-format:General";

			// Cellphone
			$cstFutureStudents->Cellphone->ViewValue = $cstFutureStudents->Cellphone->CurrentValue;
			$cstFutureStudents->Cellphone->CssStyle = "";
			$cstFutureStudents->Cellphone->CssClass = "";
			$cstFutureStudents->Cellphone->ViewCustomAttributes = "mso-number-format:General";

			// EmailAddress
			$cstFutureStudents->EmailAddress->ViewValue = $cstFutureStudents->EmailAddress->CurrentValue;
			$cstFutureStudents->EmailAddress->CssStyle = "";
			$cstFutureStudents->EmailAddress->CssClass = "";
			$cstFutureStudents->EmailAddress->ViewCustomAttributes = "";

			// HomeAddress
			$cstFutureStudents->HomeAddress->ViewValue = $cstFutureStudents->HomeAddress->CurrentValue;
			$cstFutureStudents->HomeAddress->CssStyle = "";
			$cstFutureStudents->HomeAddress->CssClass = "";
			$cstFutureStudents->HomeAddress->ViewCustomAttributes = "";

			// WorkAddress
			$cstFutureStudents->WorkAddress->ViewValue = $cstFutureStudents->WorkAddress->CurrentValue;
			$cstFutureStudents->WorkAddress->CssStyle = "";
			$cstFutureStudents->WorkAddress->CssClass = "";
			$cstFutureStudents->WorkAddress->ViewCustomAttributes = "";

			// PostalAddress
			$cstFutureStudents->PostalAddress->ViewValue = $cstFutureStudents->PostalAddress->CurrentValue;
			$cstFutureStudents->PostalAddress->CssStyle = "";
			$cstFutureStudents->PostalAddress->CssClass = "";
			$cstFutureStudents->PostalAddress->ViewCustomAttributes = "";

			// Designation
			$cstFutureStudents->Designation->ViewValue = $cstFutureStudents->Designation->CurrentValue;
			$cstFutureStudents->Designation->CssStyle = "";
			$cstFutureStudents->Designation->CssClass = "";
			$cstFutureStudents->Designation->ViewCustomAttributes = "";

			// Department
			$cstFutureStudents->Department->ViewValue = $cstFutureStudents->Department->CurrentValue;
			$cstFutureStudents->Department->CssStyle = "";
			$cstFutureStudents->Department->CssClass = "";
			$cstFutureStudents->Department->ViewCustomAttributes = "";

			// CESAMemberFirm
			if (strval($cstFutureStudents->CESAMemberFirm->CurrentValue) <> "") {
				switch ($cstFutureStudents->CESAMemberFirm->CurrentValue) {
					case "y":
						$cstFutureStudents->CESAMemberFirm->ViewValue = "Yes";
						break;
					case "n":
						$cstFutureStudents->CESAMemberFirm->ViewValue = "No";
						break;
					default:
						$cstFutureStudents->CESAMemberFirm->ViewValue = $cstFutureStudents->CESAMemberFirm->CurrentValue;
				}
			} else {
				$cstFutureStudents->CESAMemberFirm->ViewValue = NULL;
			}
			$cstFutureStudents->CESAMemberFirm->CssStyle = "";
			$cstFutureStudents->CESAMemberFirm->CssClass = "";
			$cstFutureStudents->CESAMemberFirm->ViewCustomAttributes = "";

			// CESAAccountNo
			$cstFutureStudents->CESAAccountNo->ViewValue = $cstFutureStudents->CESAAccountNo->CurrentValue;
			$cstFutureStudents->CESAAccountNo->CssStyle = "";
			$cstFutureStudents->CESAAccountNo->CssClass = "";
			$cstFutureStudents->CESAAccountNo->ViewCustomAttributes = "";

			// VATNo
			$cstFutureStudents->VATNo->ViewValue = $cstFutureStudents->VATNo->CurrentValue;
			$cstFutureStudents->VATNo->CssStyle = "";
			$cstFutureStudents->VATNo->CssClass = "";
			$cstFutureStudents->VATNo->ViewCustomAttributes = "mso-number-format:General";

			// DietaryRequirements
			$cstFutureStudents->DietaryRequirements->ViewValue = $cstFutureStudents->DietaryRequirements->CurrentValue;
			$cstFutureStudents->DietaryRequirements->CssStyle = "";
			$cstFutureStudents->DietaryRequirements->CssClass = "";
			$cstFutureStudents->DietaryRequirements->ViewCustomAttributes = "";

			// IDFile
			if (!ew_Empty($cstFutureStudents->IDFile->Upload->DbValue)) {
				$cstFutureStudents->IDFile->ViewValue = $cstFutureStudents->IDFile->Upload->DbValue;
			} else {
				$cstFutureStudents->IDFile->ViewValue = "";
			}
			$cstFutureStudents->IDFile->CssStyle = "";
			$cstFutureStudents->IDFile->CssClass = "";
			$cstFutureStudents->IDFile->ViewCustomAttributes = "";

			// CVFile
			if (!ew_Empty($cstFutureStudents->CVFile->Upload->DbValue)) {
				$cstFutureStudents->CVFile->ViewValue = $cstFutureStudents->CVFile->Upload->DbValue;
			} else {
				$cstFutureStudents->CVFile->ViewValue = "";
			}
			$cstFutureStudents->CVFile->CssStyle = "";
			$cstFutureStudents->CVFile->CssClass = "";
			$cstFutureStudents->CVFile->ViewCustomAttributes = "";

			// QualCertificate1
			if (!ew_Empty($cstFutureStudents->QualCertificate1->Upload->DbValue)) {
				$cstFutureStudents->QualCertificate1->ViewValue = $cstFutureStudents->QualCertificate1->Upload->DbValue;
			} else {
				$cstFutureStudents->QualCertificate1->ViewValue = "";
			}
			$cstFutureStudents->QualCertificate1->CssStyle = "";
			$cstFutureStudents->QualCertificate1->CssClass = "";
			$cstFutureStudents->QualCertificate1->ViewCustomAttributes = "";

			// QualCertificate2
			if (!ew_Empty($cstFutureStudents->QualCertificate2->Upload->DbValue)) {
				$cstFutureStudents->QualCertificate2->ViewValue = $cstFutureStudents->QualCertificate2->Upload->DbValue;
			} else {
				$cstFutureStudents->QualCertificate2->ViewValue = "";
			}
			$cstFutureStudents->QualCertificate2->CssStyle = "";
			$cstFutureStudents->QualCertificate2->CssClass = "";
			$cstFutureStudents->QualCertificate2->ViewCustomAttributes = "";

			// QualCertificate3
			if (!ew_Empty($cstFutureStudents->QualCertificate3->Upload->DbValue)) {
				$cstFutureStudents->QualCertificate3->ViewValue = $cstFutureStudents->QualCertificate3->Upload->DbValue;
			} else {
				$cstFutureStudents->QualCertificate3->ViewValue = "";
			}
			$cstFutureStudents->QualCertificate3->CssStyle = "";
			$cstFutureStudents->QualCertificate3->CssClass = "";
			$cstFutureStudents->QualCertificate3->ViewCustomAttributes = "";

			// MemorandumFile
			if (!ew_Empty($cstFutureStudents->MemorandumFile->Upload->DbValue)) {
				$cstFutureStudents->MemorandumFile->ViewValue = $cstFutureStudents->MemorandumFile->Upload->DbValue;
			} else {
				$cstFutureStudents->MemorandumFile->ViewValue = "";
			}
			$cstFutureStudents->MemorandumFile->CssStyle = "";
			$cstFutureStudents->MemorandumFile->CssClass = "";
			$cstFutureStudents->MemorandumFile->ViewCustomAttributes = "";

			// AgreementFile
			if (!ew_Empty($cstFutureStudents->AgreementFile->Upload->DbValue)) {
				$cstFutureStudents->AgreementFile->ViewValue = $cstFutureStudents->AgreementFile->Upload->DbValue;
			} else {
				$cstFutureStudents->AgreementFile->ViewValue = "";
			}
			$cstFutureStudents->AgreementFile->CssStyle = "";
			$cstFutureStudents->AgreementFile->CssClass = "";
			$cstFutureStudents->AgreementFile->ViewCustomAttributes = "";

			// OrderNo
			$cstFutureStudents->OrderNo->ViewValue = $cstFutureStudents->OrderNo->CurrentValue;
			$cstFutureStudents->OrderNo->CssStyle = "";
			$cstFutureStudents->OrderNo->CssClass = "";
			$cstFutureStudents->OrderNo->ViewCustomAttributes = "";

			// BookedByName
			$cstFutureStudents->BookedByName->ViewValue = $cstFutureStudents->BookedByName->CurrentValue;
			$cstFutureStudents->BookedByName->CssStyle = "";
			$cstFutureStudents->BookedByName->CssClass = "";
			$cstFutureStudents->BookedByName->ViewCustomAttributes = "";

			// BookedByDesignation
			$cstFutureStudents->BookedByDesignation->ViewValue = $cstFutureStudents->BookedByDesignation->CurrentValue;
			$cstFutureStudents->BookedByDesignation->CssStyle = "";
			$cstFutureStudents->BookedByDesignation->CssClass = "";
			$cstFutureStudents->BookedByDesignation->ViewCustomAttributes = "";

			// BookedByTelNo
			$cstFutureStudents->BookedByTelNo->ViewValue = $cstFutureStudents->BookedByTelNo->CurrentValue;
			$cstFutureStudents->BookedByTelNo->CssStyle = "";
			$cstFutureStudents->BookedByTelNo->CssClass = "";
			$cstFutureStudents->BookedByTelNo->ViewCustomAttributes = "mso-number-format:General";

			// BookedByFaxNo
			$cstFutureStudents->BookedByFaxNo->ViewValue = $cstFutureStudents->BookedByFaxNo->CurrentValue;
			$cstFutureStudents->BookedByFaxNo->CssStyle = "";
			$cstFutureStudents->BookedByFaxNo->CssClass = "";
			$cstFutureStudents->BookedByFaxNo->ViewCustomAttributes = "mso-number-format:General";

			// BookedByCellNo
			$cstFutureStudents->BookedByCellNo->ViewValue = $cstFutureStudents->BookedByCellNo->CurrentValue;
			$cstFutureStudents->BookedByCellNo->CssStyle = "";
			$cstFutureStudents->BookedByCellNo->CssClass = "";
			$cstFutureStudents->BookedByCellNo->ViewCustomAttributes = "mso-number-format:General";

			// BookedByEmail
			$cstFutureStudents->BookedByEmail->ViewValue = $cstFutureStudents->BookedByEmail->CurrentValue;
			$cstFutureStudents->BookedByEmail->CssStyle = "";
			$cstFutureStudents->BookedByEmail->CssClass = "";
			$cstFutureStudents->BookedByEmail->ViewCustomAttributes = "";

			// WebUsername
			$cstFutureStudents->WebUsername->ViewValue = $cstFutureStudents->WebUsername->CurrentValue;
			$cstFutureStudents->WebUsername->CssStyle = "";
			$cstFutureStudents->WebUsername->CssClass = "";
			$cstFutureStudents->WebUsername->ViewCustomAttributes = "";

			// WebPassword
			$cstFutureStudents->WebPassword->ViewValue = $cstFutureStudents->WebPassword->CurrentValue;
			$cstFutureStudents->WebPassword->CssStyle = "";
			$cstFutureStudents->WebPassword->CssClass = "";
			$cstFutureStudents->WebPassword->ViewCustomAttributes = "";

			// MentorDesig
			$cstFutureStudents->MentorDesig->ViewValue = $cstFutureStudents->MentorDesig->CurrentValue;
			$cstFutureStudents->MentorDesig->CssStyle = "";
			$cstFutureStudents->MentorDesig->CssClass = "";
			$cstFutureStudents->MentorDesig->ViewCustomAttributes = "";

			// MentorTel
			$cstFutureStudents->MentorTel->ViewValue = $cstFutureStudents->MentorTel->CurrentValue;
			$cstFutureStudents->MentorTel->CssStyle = "";
			$cstFutureStudents->MentorTel->CssClass = "";
			$cstFutureStudents->MentorTel->ViewCustomAttributes = "";

			// MentorCell
			$cstFutureStudents->MentorCell->ViewValue = $cstFutureStudents->MentorCell->CurrentValue;
			$cstFutureStudents->MentorCell->CssStyle = "";
			$cstFutureStudents->MentorCell->CssClass = "";
			$cstFutureStudents->MentorCell->ViewCustomAttributes = "";

			// MentorEmail
			$cstFutureStudents->MentorEmail->ViewValue = $cstFutureStudents->MentorEmail->CurrentValue;
			$cstFutureStudents->MentorEmail->CssStyle = "";
			$cstFutureStudents->MentorEmail->CssClass = "";
			$cstFutureStudents->MentorEmail->ViewCustomAttributes = "";

			// HRManagerName
			$cstFutureStudents->HRManagerName->ViewValue = $cstFutureStudents->HRManagerName->CurrentValue;
			$cstFutureStudents->HRManagerName->CssStyle = "";
			$cstFutureStudents->HRManagerName->CssClass = "";
			$cstFutureStudents->HRManagerName->ViewCustomAttributes = "";

			// HRManagerDesignation
			$cstFutureStudents->HRManagerDesignation->ViewValue = $cstFutureStudents->HRManagerDesignation->CurrentValue;
			$cstFutureStudents->HRManagerDesignation->CssStyle = "";
			$cstFutureStudents->HRManagerDesignation->CssClass = "";
			$cstFutureStudents->HRManagerDesignation->ViewCustomAttributes = "";

			// HRManagerTelNo
			$cstFutureStudents->HRManagerTelNo->ViewValue = $cstFutureStudents->HRManagerTelNo->CurrentValue;
			$cstFutureStudents->HRManagerTelNo->CssStyle = "";
			$cstFutureStudents->HRManagerTelNo->CssClass = "";
			$cstFutureStudents->HRManagerTelNo->ViewCustomAttributes = "";

			// HRManagerCellNo
			$cstFutureStudents->HRManagerCellNo->ViewValue = $cstFutureStudents->HRManagerCellNo->CurrentValue;
			$cstFutureStudents->HRManagerCellNo->CssStyle = "";
			$cstFutureStudents->HRManagerCellNo->CssClass = "";
			$cstFutureStudents->HRManagerCellNo->ViewCustomAttributes = "";

			// HRManagerEmail
			$cstFutureStudents->HRManagerEmail->ViewValue = $cstFutureStudents->HRManagerEmail->CurrentValue;
			$cstFutureStudents->HRManagerEmail->CssStyle = "";
			$cstFutureStudents->HRManagerEmail->CssClass = "";
			$cstFutureStudents->HRManagerEmail->ViewCustomAttributes = "";

			// BlockAccess
			if (strval($cstFutureStudents->BlockAccess->CurrentValue) <> "") {
				switch ($cstFutureStudents->BlockAccess->CurrentValue) {
					case "y":
						$cstFutureStudents->BlockAccess->ViewValue = "Yes";
						break;
					case "n":
						$cstFutureStudents->BlockAccess->ViewValue = "No";
						break;
					default:
						$cstFutureStudents->BlockAccess->ViewValue = $cstFutureStudents->BlockAccess->CurrentValue;
				}
			} else {
				$cstFutureStudents->BlockAccess->ViewValue = NULL;
			}
			$cstFutureStudents->BlockAccess->CssStyle = "";
			$cstFutureStudents->BlockAccess->CssClass = "";
			$cstFutureStudents->BlockAccess->ViewCustomAttributes = "";

			// Archived
			if (strval($cstFutureStudents->Archived->CurrentValue) <> "") {
				$cstFutureStudents->Archived->ViewValue = "";
				$arwrk = explode(",", strval($cstFutureStudents->Archived->CurrentValue));
				for ($ari = 0; $ari < count($arwrk); $ari++) {
					switch (trim($arwrk[$ari])) {
						case "1":
							$cstFutureStudents->Archived->ViewValue .= "Yes";
							break;
						default:
							$cstFutureStudents->Archived->ViewValue .= trim($arwrk[$ari]);
					}
					if ($ari < count($arwrk)-1) $cstFutureStudents->Archived->ViewValue .= ew_ViewOptionSeparator($ari);
				}
			} else {
				$cstFutureStudents->Archived->ViewValue = NULL;
			}
			$cstFutureStudents->Archived->CssStyle = "";
			$cstFutureStudents->Archived->CssClass = "";
			$cstFutureStudents->Archived->ViewCustomAttributes = "";

			// MentorFirstName
			$cstFutureStudents->MentorFirstName->ViewValue = $cstFutureStudents->MentorFirstName->CurrentValue;
			$cstFutureStudents->MentorFirstName->CssStyle = "";
			$cstFutureStudents->MentorFirstName->CssClass = "";
			$cstFutureStudents->MentorFirstName->ViewCustomAttributes = "";

			// MentorSurname
			$cstFutureStudents->MentorSurname->ViewValue = $cstFutureStudents->MentorSurname->CurrentValue;
			$cstFutureStudents->MentorSurname->CssStyle = "";
			$cstFutureStudents->MentorSurname->CssClass = "";
			$cstFutureStudents->MentorSurname->ViewCustomAttributes = "";

			// FirstName
			$cstFutureStudents->FirstName->HrefValue = "";
			$cstFutureStudents->FirstName->TooltipValue = "";

			// Surname
			$cstFutureStudents->Surname->HrefValue = "";
			$cstFutureStudents->Surname->TooltipValue = "";

			// KnownAs
			$cstFutureStudents->KnownAs->HrefValue = "";
			$cstFutureStudents->KnownAs->TooltipValue = "";

			// Organisation
			$cstFutureStudents->Organisation->HrefValue = "";
			$cstFutureStudents->Organisation->TooltipValue = "";

			// StudentNumber
			$cstFutureStudents->StudentNumber->HrefValue = "";
			$cstFutureStudents->StudentNumber->TooltipValue = "";

			// ECSACategory
			$cstFutureStudents->ECSACategory->HrefValue = "";
			$cstFutureStudents->ECSACategory->TooltipValue = "";

			// Cellphone
			$cstFutureStudents->Cellphone->HrefValue = "";
			$cstFutureStudents->Cellphone->TooltipValue = "";

			// EmailAddress
			$cstFutureStudents->EmailAddress->HrefValue = "";
			$cstFutureStudents->EmailAddress->TooltipValue = "";

			// MentorFirstName
			$cstFutureStudents->MentorFirstName->HrefValue = "";
			$cstFutureStudents->MentorFirstName->TooltipValue = "";

			// MentorSurname
			$cstFutureStudents->MentorSurname->HrefValue = "";
			$cstFutureStudents->MentorSurname->TooltipValue = "";
		}

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

	// Validate search
	function ValidateSearch() {
		global $gsSearchError, $cstFutureStudents;

		// Initialize
		$gsSearchError = "";

		// Check if validation required
		if (!EW_SERVER_VALIDATE)
			return TRUE;

		// Return validate result
		$ValidateSearch = ($gsSearchError == "");

		// Call Form_CustomValidate event
		$sFormCustomError = "";
		$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
		if ($sFormCustomError <> "") {
			if ($gsSearchError <> "") $gsSearchError .= "<br>";
			$gsSearchError .= $sFormCustomError;
		}
		return $ValidateSearch;
	}

	// Load advanced search
	function LoadAdvancedSearch() {
		global $cstFutureStudents;
		$cstFutureStudents->CCEStudentID->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_CCEStudentID");
		$cstFutureStudents->Title->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Title");
		$cstFutureStudents->FirstName->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_FirstName");
		$cstFutureStudents->Surname->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Surname");
		$cstFutureStudents->KnownAs->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_KnownAs");
		$cstFutureStudents->Organisation->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Organisation");
		$cstFutureStudents->OrganisationType->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OrganisationType");
		$cstFutureStudents->LengthEmploy->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_LengthEmploy");
		$cstFutureStudents->OtherCEFirms->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OtherCEFirms");
		$cstFutureStudents->StudentNumber->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_StudentNumber");
		$cstFutureStudents->CCEFacilitatorID->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_CCEFacilitatorID");
		$cstFutureStudents->Project->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Project");
		$cstFutureStudents->ProjectDiscipline->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_ProjectDiscipline");
		$cstFutureStudents->IDNumber->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_IDNumber");
		$cstFutureStudents->ECSARegistered->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_ECSARegistered");
		$cstFutureStudents->ECSACategory->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_ECSACategory");
		$cstFutureStudents->ECSANumber->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_ECSANumber");
		$cstFutureStudents->OtherStatutoryBodyRegistered->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OtherStatutoryBodyRegistered");
		$cstFutureStudents->OtherStatutoryBodyName->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OtherStatutoryBodyName");
		$cstFutureStudents->OtherStatutoryBodyNumber->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OtherStatutoryBodyNumber");
		$cstFutureStudents->Age->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Age");
		$cstFutureStudents->HighestQual->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HighestQual");
		$cstFutureStudents->AreaDiscipline->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_AreaDiscipline");
		$cstFutureStudents->Telephone->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Telephone");
		$cstFutureStudents->Cellphone->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Cellphone");
		$cstFutureStudents->EmailAddress->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_EmailAddress");
		$cstFutureStudents->HomeAddress->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HomeAddress");
		$cstFutureStudents->WorkAddress->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_WorkAddress");
		$cstFutureStudents->PostalAddress->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_PostalAddress");
		$cstFutureStudents->Designation->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Designation");
		$cstFutureStudents->Department->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Department");
		$cstFutureStudents->CESAMemberFirm->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_CESAMemberFirm");
		$cstFutureStudents->CESAAccountNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_CESAAccountNo");
		$cstFutureStudents->VATNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_VATNo");
		$cstFutureStudents->DietaryRequirements->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_DietaryRequirements");
		$cstFutureStudents->OrderNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_OrderNo");
		$cstFutureStudents->BookedByName->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByName");
		$cstFutureStudents->BookedByDesignation->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByDesignation");
		$cstFutureStudents->BookedByTelNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByTelNo");
		$cstFutureStudents->BookedByFaxNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByFaxNo");
		$cstFutureStudents->BookedByCellNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByCellNo");
		$cstFutureStudents->BookedByEmail->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BookedByEmail");
		$cstFutureStudents->WebUsername->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_WebUsername");
		$cstFutureStudents->WebPassword->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_WebPassword");
		$cstFutureStudents->MentorDesig->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorDesig");
		$cstFutureStudents->MentorTel->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorTel");
		$cstFutureStudents->MentorCell->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorCell");
		$cstFutureStudents->MentorEmail->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorEmail");
		$cstFutureStudents->HRManagerName->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HRManagerName");
		$cstFutureStudents->HRManagerDesignation->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HRManagerDesignation");
		$cstFutureStudents->HRManagerTelNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HRManagerTelNo");
		$cstFutureStudents->HRManagerCellNo->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HRManagerCellNo");
		$cstFutureStudents->HRManagerEmail->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_HRManagerEmail");
		$cstFutureStudents->BlockAccess->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_BlockAccess");
		$cstFutureStudents->Archived->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_Archived");
		$cstFutureStudents->MentorFirstName->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorFirstName");
		$cstFutureStudents->MentorSurname->AdvancedSearch->SearchValue = $cstFutureStudents->getAdvancedSearch("x_MentorSurname");
	}

	// Export data in HTML/CSV/Word/Excel/XML/Email format
	function ExportData() {
		global $cstFutureStudents;
		$utf8 = FALSE;
		$bSelectLimit = EW_SELECT_LIMIT;

		// Load recordset
		if ($bSelectLimit) {
			$this->lTotalRecs = $cstFutureStudents->SelectRecordCount();
		} else {
			if ($rs = $this->LoadRecordset())
				$this->lTotalRecs = $rs->RecordCount();
		}
		$this->lStartRec = 1;

		// Export all
		if ($cstFutureStudents->ExportAll) {
			$this->lDisplayRecs = $this->lTotalRecs;
			$this->lStopRec = $this->lTotalRecs;
		} else { // Export one page only
			$this->SetUpStartRec(); // Set up start record position

			// Set the last record to display
			if ($this->lDisplayRecs < 0) {
				$this->lStopRec = $this->lTotalRecs;
			} else {
				$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
			}
		}
		if ($bSelectLimit)
			$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);
		if (!$rs) {
			header("Content-Type:"); // Remove header
			header("Content-Disposition:");
			$this->ShowMessage();
			return;
		}
		if ($cstFutureStudents->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($cstFutureStudents, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($cstFutureStudents->Title);
				$ExportDoc->ExportCaption($cstFutureStudents->FirstName);
				$ExportDoc->ExportCaption($cstFutureStudents->Surname);
				$ExportDoc->ExportCaption($cstFutureStudents->KnownAs);
				$ExportDoc->ExportCaption($cstFutureStudents->Organisation);
				$ExportDoc->ExportCaption($cstFutureStudents->OrganisationType);
				$ExportDoc->ExportCaption($cstFutureStudents->LengthEmploy);
				$ExportDoc->ExportCaption($cstFutureStudents->StudentNumber);
				$ExportDoc->ExportCaption($cstFutureStudents->CCEFacilitatorID);
				$ExportDoc->ExportCaption($cstFutureStudents->Project);
				$ExportDoc->ExportCaption($cstFutureStudents->ProjectDiscipline);
				$ExportDoc->ExportCaption($cstFutureStudents->IDNumber);
				$ExportDoc->ExportCaption($cstFutureStudents->ECSARegistered);
				$ExportDoc->ExportCaption($cstFutureStudents->ECSACategory);
				$ExportDoc->ExportCaption($cstFutureStudents->ECSANumber);
				$ExportDoc->ExportCaption($cstFutureStudents->OtherStatutoryBodyRegistered);
				$ExportDoc->ExportCaption($cstFutureStudents->OtherStatutoryBodyName);
				$ExportDoc->ExportCaption($cstFutureStudents->OtherStatutoryBodyNumber);
				$ExportDoc->ExportCaption($cstFutureStudents->Age);
				$ExportDoc->ExportCaption($cstFutureStudents->HighestQual);
				$ExportDoc->ExportCaption($cstFutureStudents->AreaDiscipline);
				$ExportDoc->ExportCaption($cstFutureStudents->Telephone);
				$ExportDoc->ExportCaption($cstFutureStudents->Cellphone);
				$ExportDoc->ExportCaption($cstFutureStudents->EmailAddress);
				$ExportDoc->ExportCaption($cstFutureStudents->HomeAddress);
				$ExportDoc->ExportCaption($cstFutureStudents->WorkAddress);
				$ExportDoc->ExportCaption($cstFutureStudents->PostalAddress);
				$ExportDoc->ExportCaption($cstFutureStudents->Designation);
				$ExportDoc->ExportCaption($cstFutureStudents->Department);
				$ExportDoc->ExportCaption($cstFutureStudents->CESAMemberFirm);
				$ExportDoc->ExportCaption($cstFutureStudents->CESAAccountNo);
				$ExportDoc->ExportCaption($cstFutureStudents->VATNo);
				$ExportDoc->ExportCaption($cstFutureStudents->DietaryRequirements);
				$ExportDoc->ExportCaption($cstFutureStudents->IDFile);
				$ExportDoc->ExportCaption($cstFutureStudents->CVFile);
				$ExportDoc->ExportCaption($cstFutureStudents->QualCertificate1);
				$ExportDoc->ExportCaption($cstFutureStudents->QualCertificate2);
				$ExportDoc->ExportCaption($cstFutureStudents->QualCertificate3);
				$ExportDoc->ExportCaption($cstFutureStudents->MemorandumFile);
				$ExportDoc->ExportCaption($cstFutureStudents->AgreementFile);
				$ExportDoc->ExportCaption($cstFutureStudents->OrderNo);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByName);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByDesignation);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByTelNo);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByFaxNo);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByCellNo);
				$ExportDoc->ExportCaption($cstFutureStudents->BookedByEmail);
				$ExportDoc->ExportCaption($cstFutureStudents->WebUsername);
				$ExportDoc->ExportCaption($cstFutureStudents->WebPassword);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorDesig);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorTel);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorCell);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorEmail);
				$ExportDoc->ExportCaption($cstFutureStudents->HRManagerName);
				$ExportDoc->ExportCaption($cstFutureStudents->HRManagerDesignation);
				$ExportDoc->ExportCaption($cstFutureStudents->HRManagerTelNo);
				$ExportDoc->ExportCaption($cstFutureStudents->HRManagerCellNo);
				$ExportDoc->ExportCaption($cstFutureStudents->HRManagerEmail);
				$ExportDoc->ExportCaption($cstFutureStudents->BlockAccess);
				$ExportDoc->ExportCaption($cstFutureStudents->Archived);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorFirstName);
				$ExportDoc->ExportCaption($cstFutureStudents->MentorSurname);
				$ExportDoc->EndExportRow();
			}
		}

		// Move to first record
		$this->lRecCnt = $this->lStartRec - 1;
		if (!$rs->EOF) {
			$rs->MoveFirst();
			if (!$bSelectLimit && $this->lStartRec > 1)
				$rs->Move($this->lStartRec - 1);
		}
		while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
			$this->lRecCnt++;
			if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
				$this->LoadRowValues($rs);

				// Render row
				$cstFutureStudents->CssClass = "";
				$cstFutureStudents->CssStyle = "";
				$cstFutureStudents->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($cstFutureStudents->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('Title', $cstFutureStudents->Title->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('FirstName', $cstFutureStudents->FirstName->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Surname', $cstFutureStudents->Surname->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('KnownAs', $cstFutureStudents->KnownAs->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Organisation', $cstFutureStudents->Organisation->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('OrganisationType', $cstFutureStudents->OrganisationType->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('LengthEmploy', $cstFutureStudents->LengthEmploy->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('StudentNumber', $cstFutureStudents->StudentNumber->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('CCEFacilitatorID', $cstFutureStudents->CCEFacilitatorID->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Project', $cstFutureStudents->Project->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('ProjectDiscipline', $cstFutureStudents->ProjectDiscipline->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('IDNumber', $cstFutureStudents->IDNumber->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('ECSARegistered', $cstFutureStudents->ECSARegistered->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('ECSACategory', $cstFutureStudents->ECSACategory->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('ECSANumber', $cstFutureStudents->ECSANumber->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyRegistered', $cstFutureStudents->OtherStatutoryBodyRegistered->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyName', $cstFutureStudents->OtherStatutoryBodyName->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyNumber', $cstFutureStudents->OtherStatutoryBodyNumber->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Age', $cstFutureStudents->Age->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HighestQual', $cstFutureStudents->HighestQual->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('AreaDiscipline', $cstFutureStudents->AreaDiscipline->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Telephone', $cstFutureStudents->Telephone->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Cellphone', $cstFutureStudents->Cellphone->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('EmailAddress', $cstFutureStudents->EmailAddress->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HomeAddress', $cstFutureStudents->HomeAddress->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('WorkAddress', $cstFutureStudents->WorkAddress->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('PostalAddress', $cstFutureStudents->PostalAddress->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Designation', $cstFutureStudents->Designation->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Department', $cstFutureStudents->Department->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('CESAMemberFirm', $cstFutureStudents->CESAMemberFirm->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('CESAAccountNo', $cstFutureStudents->CESAAccountNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('VATNo', $cstFutureStudents->VATNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('DietaryRequirements', $cstFutureStudents->DietaryRequirements->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('IDFile', $cstFutureStudents->IDFile->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('CVFile', $cstFutureStudents->CVFile->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate1', $cstFutureStudents->QualCertificate1->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate2', $cstFutureStudents->QualCertificate2->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate3', $cstFutureStudents->QualCertificate3->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MemorandumFile', $cstFutureStudents->MemorandumFile->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('AgreementFile', $cstFutureStudents->AgreementFile->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('OrderNo', $cstFutureStudents->OrderNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByName', $cstFutureStudents->BookedByName->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByDesignation', $cstFutureStudents->BookedByDesignation->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByTelNo', $cstFutureStudents->BookedByTelNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByFaxNo', $cstFutureStudents->BookedByFaxNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByCellNo', $cstFutureStudents->BookedByCellNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BookedByEmail', $cstFutureStudents->BookedByEmail->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('WebUsername', $cstFutureStudents->WebUsername->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('WebPassword', $cstFutureStudents->WebPassword->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorDesig', $cstFutureStudents->MentorDesig->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorTel', $cstFutureStudents->MentorTel->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorCell', $cstFutureStudents->MentorCell->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorEmail', $cstFutureStudents->MentorEmail->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerName', $cstFutureStudents->HRManagerName->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerDesignation', $cstFutureStudents->HRManagerDesignation->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerTelNo', $cstFutureStudents->HRManagerTelNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerCellNo', $cstFutureStudents->HRManagerCellNo->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerEmail', $cstFutureStudents->HRManagerEmail->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('BlockAccess', $cstFutureStudents->BlockAccess->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('Archived', $cstFutureStudents->Archived->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorFirstName', $cstFutureStudents->MentorFirstName->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
					$XmlDoc->AddField('MentorSurname', $cstFutureStudents->MentorSurname->ExportValue($cstFutureStudents->Export, $cstFutureStudents->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($cstFutureStudents->Title);
					$ExportDoc->ExportField($cstFutureStudents->FirstName);
					$ExportDoc->ExportField($cstFutureStudents->Surname);
					$ExportDoc->ExportField($cstFutureStudents->KnownAs);
					$ExportDoc->ExportField($cstFutureStudents->Organisation);
					$ExportDoc->ExportField($cstFutureStudents->OrganisationType);
					$ExportDoc->ExportField($cstFutureStudents->LengthEmploy);
					$ExportDoc->ExportField($cstFutureStudents->StudentNumber);
					$ExportDoc->ExportField($cstFutureStudents->CCEFacilitatorID);
					$ExportDoc->ExportField($cstFutureStudents->Project);
					$ExportDoc->ExportField($cstFutureStudents->ProjectDiscipline);
					$ExportDoc->ExportField($cstFutureStudents->IDNumber);
					$ExportDoc->ExportField($cstFutureStudents->ECSARegistered);
					$ExportDoc->ExportField($cstFutureStudents->ECSACategory);
					$ExportDoc->ExportField($cstFutureStudents->ECSANumber);
					$ExportDoc->ExportField($cstFutureStudents->OtherStatutoryBodyRegistered);
					$ExportDoc->ExportField($cstFutureStudents->OtherStatutoryBodyName);
					$ExportDoc->ExportField($cstFutureStudents->OtherStatutoryBodyNumber);
					$ExportDoc->ExportField($cstFutureStudents->Age);
					$ExportDoc->ExportField($cstFutureStudents->HighestQual);
					$ExportDoc->ExportField($cstFutureStudents->AreaDiscipline);
					$ExportDoc->ExportField($cstFutureStudents->Telephone);
					$ExportDoc->ExportField($cstFutureStudents->Cellphone);
					$ExportDoc->ExportField($cstFutureStudents->EmailAddress);
					$ExportDoc->ExportField($cstFutureStudents->HomeAddress);
					$ExportDoc->ExportField($cstFutureStudents->WorkAddress);
					$ExportDoc->ExportField($cstFutureStudents->PostalAddress);
					$ExportDoc->ExportField($cstFutureStudents->Designation);
					$ExportDoc->ExportField($cstFutureStudents->Department);
					$ExportDoc->ExportField($cstFutureStudents->CESAMemberFirm);
					$ExportDoc->ExportField($cstFutureStudents->CESAAccountNo);
					$ExportDoc->ExportField($cstFutureStudents->VATNo);
					$ExportDoc->ExportField($cstFutureStudents->DietaryRequirements);
					$ExportDoc->ExportField($cstFutureStudents->IDFile);
					$ExportDoc->ExportField($cstFutureStudents->CVFile);
					$ExportDoc->ExportField($cstFutureStudents->QualCertificate1);
					$ExportDoc->ExportField($cstFutureStudents->QualCertificate2);
					$ExportDoc->ExportField($cstFutureStudents->QualCertificate3);
					$ExportDoc->ExportField($cstFutureStudents->MemorandumFile);
					$ExportDoc->ExportField($cstFutureStudents->AgreementFile);
					$ExportDoc->ExportField($cstFutureStudents->OrderNo);
					$ExportDoc->ExportField($cstFutureStudents->BookedByName);
					$ExportDoc->ExportField($cstFutureStudents->BookedByDesignation);
					$ExportDoc->ExportField($cstFutureStudents->BookedByTelNo);
					$ExportDoc->ExportField($cstFutureStudents->BookedByFaxNo);
					$ExportDoc->ExportField($cstFutureStudents->BookedByCellNo);
					$ExportDoc->ExportField($cstFutureStudents->BookedByEmail);
					$ExportDoc->ExportField($cstFutureStudents->WebUsername);
					$ExportDoc->ExportField($cstFutureStudents->WebPassword);
					$ExportDoc->ExportField($cstFutureStudents->MentorDesig);
					$ExportDoc->ExportField($cstFutureStudents->MentorTel);
					$ExportDoc->ExportField($cstFutureStudents->MentorCell);
					$ExportDoc->ExportField($cstFutureStudents->MentorEmail);
					$ExportDoc->ExportField($cstFutureStudents->HRManagerName);
					$ExportDoc->ExportField($cstFutureStudents->HRManagerDesignation);
					$ExportDoc->ExportField($cstFutureStudents->HRManagerTelNo);
					$ExportDoc->ExportField($cstFutureStudents->HRManagerCellNo);
					$ExportDoc->ExportField($cstFutureStudents->HRManagerEmail);
					$ExportDoc->ExportField($cstFutureStudents->BlockAccess);
					$ExportDoc->ExportField($cstFutureStudents->Archived);
					$ExportDoc->ExportField($cstFutureStudents->MentorFirstName);
					$ExportDoc->ExportField($cstFutureStudents->MentorSurname);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($cstFutureStudents->Export <> "xml")
			$ExportDoc->ExportFooter();

		// Close recordset
		$rs->Close();

		// Clean output buffer
		if (!EW_DEBUG_ENABLED && ob_get_length())
			ob_end_clean();

		// Write BOM if utf-8
		if ($utf8 && !in_array($cstFutureStudents->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

		// Write debug message if enabled
		if (EW_DEBUG_ENABLED)
			echo ew_DebugMsg();

		// Output data
		if ($cstFutureStudents->Export == "xml") {
			header("Content-Type: text/xml");
			echo $XmlDoc->XML();
		} elseif ($cstFutureStudents->Export == "email") {
			$this->ExportEmail($ExportDoc->Text);
			$this->Page_Terminate($cstFutureStudents->ExportReturnUrl());
		} else {
			echo $ExportDoc->Text;
		}
	}

	// Export email
	function ExportEmail($EmailContent) {
		global $Language, $cstFutureStudents;
		$sSender = @$_GET["sender"];
		$sRecipient = @$_GET["recipient"];
		$sCc = @$_GET["cc"];
		$sBcc = @$_GET["bcc"];
		$sContentType = @$_GET["contenttype"];

		// Subject
		$sSubject = ew_StripSlashes(@$_GET["subject"]);
		$sEmailSubject = $sSubject;

		// Message
		$sContent = ew_StripSlashes(@$_GET["message"]);
		$sEmailMessage = $sContent;

		// Check sender
		if ($sSender == "") {
			$this->setMessage($Language->Phrase("EnterSenderEmail"));
			return;
		}
		if (!ew_CheckEmail($sSender)) {
			$this->setMessage($Language->Phrase("EnterProperSenderEmail"));
			return;
		}

		// Check recipient
		if (!ew_CheckEmailList($sRecipient, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperRecipientEmail"));
			return;
		}

		// Check cc
		if (!ew_CheckEmailList($sCc, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperCcEmail"));
			return;
		}

		// Check bcc
		if (!ew_CheckEmailList($sBcc, EW_MAX_EMAIL_RECIPIENT)) {
			$this->setMessage($Language->Phrase("EnterProperBccEmail"));
			return;
		}

		// Check email sent count
		if (!isset($_SESSION[EW_EXPORT_EMAIL_COUNTER]))
			$_SESSION[EW_EXPORT_EMAIL_COUNTER] = 0;
		if (intval($_SESSION[EW_EXPORT_EMAIL_COUNTER]) > EW_MAX_EMAIL_SENT_COUNT) {
			$this->setMessage($Language->Phrase("ExceedMaxEmailExport"));
			return;
		}
		if ($sEmailMessage <> "") {
			$sEmailMessage = ew_RemoveXSS($sEmailMessage);
			$sEmailMessage .= ($sContentType == "url") ? "\r\n\r\n" : "<br><br>";
		}
		if ($sContentType == "url") {
			$sUrl = ew_ConvertFullUrl(ew_CurrentPage() . "?" . $this->ExportQueryString());
			$sEmailMessage .= $sUrl; // send URL only
		} else {
			$sEmailMessage .= $EmailContent; // send HTML
		}

		// Send email
		$Email = new cEmail();
		$Email->Sender = $sSender; // Sender
		$Email->Recipient = $sRecipient; // Recipient
		$Email->Cc = $sCc; // Cc
		$Email->Bcc = $sBcc; // Bcc
		$Email->Subject = $sEmailSubject; // Subject
		$Email->Content = $sEmailMessage; // Content
		$Email->Format = ($sContentType == "url") ? "text" : "html";
		$Email->Charset = EW_EMAIL_CHARSET;
		$EventArgs = array();
		$bEmailSent = FALSE;
		if ($cstFutureStudents->Email_Sending($Email, $EventArgs))
			$bEmailSent = $Email->Send();

		// Check email sent status
		if ($bEmailSent) {

			// Update email sent count
			$_SESSION[EW_EXPORT_EMAIL_COUNTER]++;

			// Sent email success
			$this->setMessage($Language->Phrase("SendEmailSuccess"));
		} else {

			// Sent email failure
			$this->setMessage($Email->SendErrDescription);
		}
	}

	// Export QueryString
	function ExportQueryString() {
		global $cstFutureStudents;

		// Initialize
		$sQry = "export=html";

		// Build QueryString for search
		if ($cstFutureStudents->getSessionBasicSearchKeyword() <> "") {
			$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $cstFutureStudents->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $cstFutureStudents->getSessionBasicSearchType();
		}
		$this->AddSearchQueryString($sQry, $cstFutureStudents->CCEStudentID); // CCEStudentID
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Title); // Title
		$this->AddSearchQueryString($sQry, $cstFutureStudents->FirstName); // FirstName
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Surname); // Surname
		$this->AddSearchQueryString($sQry, $cstFutureStudents->KnownAs); // KnownAs
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Organisation); // Organisation
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OrganisationType); // OrganisationType
		$this->AddSearchQueryString($sQry, $cstFutureStudents->LengthEmploy); // LengthEmploy
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OtherCEFirms); // OtherCEFirms
		$this->AddSearchQueryString($sQry, $cstFutureStudents->StudentNumber); // StudentNumber
		$this->AddSearchQueryString($sQry, $cstFutureStudents->CCEFacilitatorID); // CCEFacilitatorID
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Project); // Project
		$this->AddSearchQueryString($sQry, $cstFutureStudents->ProjectDiscipline); // ProjectDiscipline
		$this->AddSearchQueryString($sQry, $cstFutureStudents->IDNumber); // IDNumber
		$this->AddSearchQueryString($sQry, $cstFutureStudents->ECSARegistered); // ECSARegistered
		$this->AddSearchQueryString($sQry, $cstFutureStudents->ECSACategory); // ECSACategory
		$this->AddSearchQueryString($sQry, $cstFutureStudents->ECSANumber); // ECSANumber
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OtherStatutoryBodyRegistered); // OtherStatutoryBodyRegistered
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OtherStatutoryBodyName); // OtherStatutoryBodyName
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OtherStatutoryBodyNumber); // OtherStatutoryBodyNumber
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Age); // Age
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HighestQual); // HighestQual
		$this->AddSearchQueryString($sQry, $cstFutureStudents->AreaDiscipline); // AreaDiscipline
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Telephone); // Telephone
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Cellphone); // Cellphone
		$this->AddSearchQueryString($sQry, $cstFutureStudents->EmailAddress); // EmailAddress
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HomeAddress); // HomeAddress
		$this->AddSearchQueryString($sQry, $cstFutureStudents->WorkAddress); // WorkAddress
		$this->AddSearchQueryString($sQry, $cstFutureStudents->PostalAddress); // PostalAddress
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Designation); // Designation
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Department); // Department
		$this->AddSearchQueryString($sQry, $cstFutureStudents->CESAMemberFirm); // CESAMemberFirm
		$this->AddSearchQueryString($sQry, $cstFutureStudents->CESAAccountNo); // CESAAccountNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->VATNo); // VATNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->DietaryRequirements); // DietaryRequirements
		$this->AddSearchQueryString($sQry, $cstFutureStudents->OrderNo); // OrderNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByName); // BookedByName
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByDesignation); // BookedByDesignation
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByTelNo); // BookedByTelNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByFaxNo); // BookedByFaxNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByCellNo); // BookedByCellNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BookedByEmail); // BookedByEmail
		$this->AddSearchQueryString($sQry, $cstFutureStudents->WebUsername); // WebUsername
		$this->AddSearchQueryString($sQry, $cstFutureStudents->WebPassword); // WebPassword
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorDesig); // MentorDesig
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorTel); // MentorTel
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorCell); // MentorCell
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorEmail); // MentorEmail
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HRManagerName); // HRManagerName
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HRManagerDesignation); // HRManagerDesignation
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HRManagerTelNo); // HRManagerTelNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HRManagerCellNo); // HRManagerCellNo
		$this->AddSearchQueryString($sQry, $cstFutureStudents->HRManagerEmail); // HRManagerEmail
		$this->AddSearchQueryString($sQry, $cstFutureStudents->BlockAccess); // BlockAccess
		$this->AddSearchQueryString($sQry, $cstFutureStudents->Archived); // Archived
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorFirstName); // MentorFirstName
		$this->AddSearchQueryString($sQry, $cstFutureStudents->MentorSurname); // MentorSurname

		// Build QueryString for pager
		$sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . $cstFutureStudents->getRecordsPerPage() . "&" . EW_TABLE_START_REC . "=" . $cstFutureStudents->getStartRecordNumber();
		return $sQry;
	}

	// Add search QueryString
	function AddSearchQueryString(&$Qry, &$Fld) {
		global $cstFutureStudents;
		$FldParm = substr($Fld->FldVar, 2);
		$FldSearchValue = $cstFutureStudents->GetAdvancedSearch("x_" . $FldParm);
		if (strval($FldSearchValue) <> "") {
			$Qry .= "&x_" . $FldParm . "=" . FldSearchValue .
				"&z_" . $FldParm . "=" . $cstFutureStudents->GetAdvancedSearch("z_" . $FldParm);
		}
		$FldSearchValue2 = $cstFutureStudents->GetAdvancedSearch("y_" . $FldParm);
		if (strval($FldSearchValue2) <> "") {
			$Qry .= "&v_" . $FldParm . "=" . $cstFutureStudents->GetAdvancedSearch("v_" . $FldParm) .
				"&y_" . $FldParm . "=" . $FldSearchValue2 .
				"&w_" . $FldParm . "=" . $cstFutureStudents->GetAdvancedSearch("w_" . $FldParm);
		}
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

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

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

	}

	// Message Showing event
	function Message_Showing(&$msg) {

		// Example:
		//$msg = "your new message";

	}

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

		// Return error message in CustomError
		return TRUE;
	}

	// ListOptions Load event
	function ListOptions_Load() {

		// Example: 
		//$this->ListOptions->Add("new");
		//$this->ListOptions->Items["new"]->OnLeft = TRUE; // Link on left
		//$this->ListOptions->MoveItem("new", 0); // Move to first column

	}

	// ListOptions Rendered event
	function ListOptions_Rendered() {

		// Example: 
		//$this->ListOptions->Items["new"]->Body = "xxx";

	}
}
?>