Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceadmin/
Upload File :
Current File : /var/www/cesa.co.za/cceadmin/cstArchivedStudentsAlllist.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 "cstArchivedStudentsAllinfo.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
$cstArchivedStudentsAll_list = new ccstArchivedStudentsAll_list();
$Page =& $cstArchivedStudentsAll_list;

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

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

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

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

// extend page with validate function for search
cstArchivedStudentsAll_list.ValidateSearch = function(fobj) {
	ew_PostAutoSuggest(fobj);
	if (this.ValidateRequired) {
		var infix = "";

		// Call Form Custom Validate event
		if (!this.Form_CustomValidate(fobj))
			return false;
	}
	for (var i=0; i<fobj.elements.length; i++) {
		var elem = fobj.elements[i];
		if (elem.name.substring(0,2) == "s_" || elem.name.substring(0,3) == "sv_")
			elem.value = "";
	}
	return true;
}

// extend page with Form_CustomValidate function
cstArchivedStudentsAll_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) { ?>
cstArchivedStudentsAll_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
cstArchivedStudentsAll_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 ($cstArchivedStudentsAll->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$cstArchivedStudentsAll_list->lTotalRecs = $cstArchivedStudentsAll->SelectRecordCount();
	} else {
		if ($rs = $cstArchivedStudentsAll_list->LoadRecordset())
			$cstArchivedStudentsAll_list->lTotalRecs = $rs->RecordCount();
	}
	$cstArchivedStudentsAll_list->lStartRec = 1;
	if ($cstArchivedStudentsAll_list->lDisplayRecs <= 0 || ($cstArchivedStudentsAll->Export <> "" && $cstArchivedStudentsAll->ExportAll)) // Display all records
		$cstArchivedStudentsAll_list->lDisplayRecs = $cstArchivedStudentsAll_list->lTotalRecs;
	if (!($cstArchivedStudentsAll->Export <> "" && $cstArchivedStudentsAll->ExportAll))
		$cstArchivedStudentsAll_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $cstArchivedStudentsAll_list->LoadRecordset($cstArchivedStudentsAll_list->lStartRec-1, $cstArchivedStudentsAll_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeCUSTOMVIEW") ?><?php echo $cstArchivedStudentsAll->TableCaption() ?>
<?php if ($cstArchivedStudentsAll->Export == "" && $cstArchivedStudentsAll->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_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_cstArchivedStudentsAll" id="emf_cstArchivedStudentsAll" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_cstArchivedStudentsAll',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fcstArchivedStudentsAlllist,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 ($cstArchivedStudentsAll->Export == "" && $cstArchivedStudentsAll->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(cstArchivedStudentsAll_list);" style="text-decoration: none;"><img id="cstArchivedStudentsAll_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="cstArchivedStudentsAll_list_SearchPanel">
<form name="fcstArchivedStudentsAlllistsrch" id="fcstArchivedStudentsAlllistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>" onsubmit="return cstArchivedStudentsAll_list.ValidateSearch(this);">
<input type="hidden" id="t" name="t" value="cstArchivedStudentsAll">
<?php
if ($gsSearchError == "")
	$cstArchivedStudentsAll_list->LoadAdvancedSearch(); // Load advanced search

// Render for search
$cstArchivedStudentsAll->RowType = EW_ROWTYPE_SEARCH;

// Render row
$cstArchivedStudentsAll_list->RenderRow();
?>
<table class="ewBasicSearch">
	<tr>
		<td><span class="phpmaker"><?php echo $cstArchivedStudentsAll->FirstName->FldCaption() ?></span></td>
		<td><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_FirstName" id="z_FirstName" value="LIKE"></span></td>
		<td>			
			<div style="white-space: nowrap;">
				<span class="phpmaker" style="float: left;">
<input type="text" name="x_FirstName" id="x_FirstName" title="<?php echo $cstArchivedStudentsAll->FirstName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $cstArchivedStudentsAll->FirstName->EditValue ?>"<?php echo $cstArchivedStudentsAll->FirstName->EditAttributes() ?>>
</span>
			</div>
		</td>
	</tr>
	<tr>
		<td><span class="phpmaker"><?php echo $cstArchivedStudentsAll->Surname->FldCaption() ?></span></td>
		<td><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_Surname" id="z_Surname" value="LIKE"></span></td>
		<td>			
			<div style="white-space: nowrap;">
				<span class="phpmaker" style="float: left;">
<input type="text" name="x_Surname" id="x_Surname" title="<?php echo $cstArchivedStudentsAll->Surname->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $cstArchivedStudentsAll->Surname->EditValue ?>"<?php echo $cstArchivedStudentsAll->Surname->EditAttributes() ?>>
</span>
			</div>
		</td>
	</tr>
	<tr>
		<td><span class="phpmaker"><?php echo $cstArchivedStudentsAll->EmailAddress->FldCaption() ?></span></td>
		<td><span class="ewSearchOpr"><?php echo $Language->Phrase("LIKE") ?><input type="hidden" name="z_EmailAddress" id="z_EmailAddress" value="LIKE"></span></td>
		<td>			
			<div style="white-space: nowrap;">
				<span class="phpmaker" style="float: left;">
<input type="text" name="x_EmailAddress" id="x_EmailAddress" title="<?php echo $cstArchivedStudentsAll->EmailAddress->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $cstArchivedStudentsAll->EmailAddress->EditValue ?>"<?php echo $cstArchivedStudentsAll->EmailAddress->EditAttributes() ?>>
</span>
			</div>
		</td>
	</tr>
	<tr>
		<td><span class="phpmaker"><?php echo $cstArchivedStudentsAll->CCECourseScheduleID->FldCaption() ?></span></td>
		<td><span class="ewSearchOpr"><?php echo $Language->Phrase("=") ?><input type="hidden" name="z_CCECourseScheduleID" id="z_CCECourseScheduleID" value="="></span></td>
		<td>			
			<div style="white-space: nowrap;">
				<span class="phpmaker" style="float: left;">
<select id="x_CCECourseScheduleID" name="x_CCECourseScheduleID" title="<?php echo $cstArchivedStudentsAll->CCECourseScheduleID->FldTitle() ?>"<?php echo $cstArchivedStudentsAll->CCECourseScheduleID->EditAttributes() ?>>
<?php
if (is_array($cstArchivedStudentsAll->CCECourseScheduleID->EditValue)) {
	$arwrk = $cstArchivedStudentsAll->CCECourseScheduleID->EditValue;
	$rowswrk = count($arwrk);
	$emptywrk = TRUE;
	for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
		$selwrk = (strval($cstArchivedStudentsAll->CCECourseScheduleID->AdvancedSearch->SearchValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
		if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
	}
}
?>
</select>
</span>
			</div>
		</td>
	</tr>
</table>
<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($cstArchivedStudentsAll->getSessionBasicSearchKeyword()) ?>">
			<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">&nbsp;
			<a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></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 ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->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();
$cstArchivedStudentsAll_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($cstArchivedStudentsAll->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($cstArchivedStudentsAll->CurrentAction <> "gridadd" && $cstArchivedStudentsAll->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($cstArchivedStudentsAll_list->Pager)) $cstArchivedStudentsAll_list->Pager = new cPrevNextPager($cstArchivedStudentsAll_list->lStartRec, $cstArchivedStudentsAll_list->lDisplayRecs, $cstArchivedStudentsAll_list->lTotalRecs) ?>
<?php if ($cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($cstArchivedStudentsAll_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $cstArchivedStudentsAll_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $cstArchivedStudentsAll_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($cstArchivedStudentsAll_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="fcstArchivedStudentsAlllist" id="fcstArchivedStudentsAlllist" class="ewForm" action="" method="post">
<div id="gmp_cstArchivedStudentsAll" class="ewGridMiddlePanel">
<?php if ($cstArchivedStudentsAll_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $cstArchivedStudentsAll->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

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

// Render list options (header, left)
$cstArchivedStudentsAll_list->ListOptions->Render("header", "left");
?>
<?php if ($cstArchivedStudentsAll->FirstName->Visible) { // FirstName ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->FirstName) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->FirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->FirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->FirstName->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->FirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->Surname->Visible) { // Surname ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Surname) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->Surname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Surname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->Surname->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->Surname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->KnownAs->Visible) { // KnownAs ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->KnownAs) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->KnownAs->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->KnownAs) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->KnownAs->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->KnownAs->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->Organisation->Visible) { // Organisation ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Organisation) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->Organisation->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Organisation) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->Organisation->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->StudentNumber->Visible) { // StudentNumber ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->StudentNumber) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->StudentNumber->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->StudentNumber) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->StudentNumber->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->StudentNumber->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->Age->Visible) { // Age ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Age) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->Age->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Age) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->Age->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->Age->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->Age->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstArchivedStudentsAll->Cellphone->Visible) { // Cellphone ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Cellphone) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->Cellphone->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Cellphone) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->Cellphone->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->Cellphone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->EmailAddress->Visible) { // EmailAddress ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->EmailAddress) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->EmailAddress->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->EmailAddress) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->EmailAddress->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->EmailAddress->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->BlockAccess->Visible) { // BlockAccess ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->BlockAccess) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->BlockAccess->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->BlockAccess) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->BlockAccess->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->BlockAccess->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->BlockAccess->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstArchivedStudentsAll->Achieved->Visible) { // Achieved ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Achieved) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->Achieved->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->Achieved) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->Achieved->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->Achieved->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->Achieved->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstArchivedStudentsAll->ReasonForLeaving->Visible) { // ReasonForLeaving ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->ReasonForLeaving) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->ReasonForLeaving->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->ReasonForLeaving) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->ReasonForLeaving->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->ReasonForLeaving->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->ReasonForLeaving->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstArchivedStudentsAll->CCECourseScheduleID->Visible) { // CCECourseScheduleID ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->CCECourseScheduleID) == "") { ?>
		<td><?php echo $cstArchivedStudentsAll->CCECourseScheduleID->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->CCECourseScheduleID) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstArchivedStudentsAll->CCECourseScheduleID->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->CCECourseScheduleID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->CCECourseScheduleID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstArchivedStudentsAll->EditStudent->Visible) { // EditStudent ?>
	<?php if ($cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->EditStudent) == "") { ?>
		<td style="white-space: nowrap;"><?php echo $cstArchivedStudentsAll->EditStudent->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstArchivedStudentsAll->SortUrl($cstArchivedStudentsAll->EditStudent) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn" style="white-space: nowrap;"><thead><tr><td><?php echo $cstArchivedStudentsAll->EditStudent->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstArchivedStudentsAll->EditStudent->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstArchivedStudentsAll->EditStudent->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)
$cstArchivedStudentsAll_list->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
if ($cstArchivedStudentsAll->ExportAll && $cstArchivedStudentsAll->Export <> "") {
	$cstArchivedStudentsAll_list->lStopRec = $cstArchivedStudentsAll_list->lTotalRecs;
} else {
	$cstArchivedStudentsAll_list->lStopRec = $cstArchivedStudentsAll_list->lStartRec + $cstArchivedStudentsAll_list->lDisplayRecs - 1; // Set the last record to display
}
$cstArchivedStudentsAll_list->lRecCount = $cstArchivedStudentsAll_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$bSelectLimit && $cstArchivedStudentsAll_list->lStartRec > 1)
		$rs->Move($cstArchivedStudentsAll_list->lStartRec - 1);
}

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

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

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

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

// Render list options (body, left)
$cstArchivedStudentsAll_list->ListOptions->Render("body", "left");
?>
	<?php if ($cstArchivedStudentsAll->FirstName->Visible) { // FirstName ?>
		<td<?php echo $cstArchivedStudentsAll->FirstName->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->FirstName->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->FirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->Surname->Visible) { // Surname ?>
		<td<?php echo $cstArchivedStudentsAll->Surname->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->Surname->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->Surname->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->KnownAs->Visible) { // KnownAs ?>
		<td<?php echo $cstArchivedStudentsAll->KnownAs->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->KnownAs->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->KnownAs->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->Organisation->Visible) { // Organisation ?>
		<td<?php echo $cstArchivedStudentsAll->Organisation->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->Organisation->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->Organisation->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->StudentNumber->Visible) { // StudentNumber ?>
		<td<?php echo $cstArchivedStudentsAll->StudentNumber->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->StudentNumber->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->StudentNumber->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->Age->Visible) { // Age ?>
		<td<?php echo $cstArchivedStudentsAll->Age->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->Age->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->Age->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->Cellphone->Visible) { // Cellphone ?>
		<td<?php echo $cstArchivedStudentsAll->Cellphone->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->Cellphone->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->Cellphone->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->EmailAddress->Visible) { // EmailAddress ?>
		<td<?php echo $cstArchivedStudentsAll->EmailAddress->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->EmailAddress->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->EmailAddress->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->BlockAccess->Visible) { // BlockAccess ?>
		<td<?php echo $cstArchivedStudentsAll->BlockAccess->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->BlockAccess->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->BlockAccess->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->Achieved->Visible) { // Achieved ?>
		<td<?php echo $cstArchivedStudentsAll->Achieved->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->Achieved->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->Achieved->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->ReasonForLeaving->Visible) { // ReasonForLeaving ?>
		<td<?php echo $cstArchivedStudentsAll->ReasonForLeaving->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->ReasonForLeaving->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->ReasonForLeaving->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->CCECourseScheduleID->Visible) { // CCECourseScheduleID ?>
		<td<?php echo $cstArchivedStudentsAll->CCECourseScheduleID->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->CCECourseScheduleID->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->CCECourseScheduleID->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstArchivedStudentsAll->EditStudent->Visible) { // EditStudent ?>
		<td<?php echo $cstArchivedStudentsAll->EditStudent->CellAttributes() ?>>
<div<?php echo $cstArchivedStudentsAll->EditStudent->ViewAttributes() ?>><?php echo $cstArchivedStudentsAll->EditStudent->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($rs)
	$rs->Close();
?>
<?php if ($cstArchivedStudentsAll_list->lTotalRecs > 0) { ?>
<?php if ($cstArchivedStudentsAll->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($cstArchivedStudentsAll->CurrentAction <> "gridadd" && $cstArchivedStudentsAll->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($cstArchivedStudentsAll_list->Pager)) $cstArchivedStudentsAll_list->Pager = new cPrevNextPager($cstArchivedStudentsAll_list->lStartRec, $cstArchivedStudentsAll_list->lDisplayRecs, $cstArchivedStudentsAll_list->lTotalRecs) ?>
<?php if ($cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($cstArchivedStudentsAll_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $cstArchivedStudentsAll_list->PageUrl() ?>start=<?php echo $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_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 $cstArchivedStudentsAll_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $cstArchivedStudentsAll_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $cstArchivedStudentsAll_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($cstArchivedStudentsAll_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 ($cstArchivedStudentsAll_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($cstArchivedStudentsAll->Export == "" && $cstArchivedStudentsAll->CurrentAction == "") { ?>
<?php } ?>
<?php if ($cstArchivedStudentsAll->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
$cstArchivedStudentsAll_list->Page_Terminate();
?>
<?php

//
// Page class
//
class ccstArchivedStudentsAll_list {

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

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

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

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

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		global $cstArchivedStudentsAll;
		if ($cstArchivedStudentsAll->UseTokenInUrl) $PageUrl .= "t=" . $cstArchivedStudentsAll->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, $cstArchivedStudentsAll;
		if ($cstArchivedStudentsAll->UseTokenInUrl) {
			if ($objForm)
				return ($cstArchivedStudentsAll->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($cstArchivedStudentsAll->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

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

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

		// Table object (cstArchivedStudentsAll)
		$GLOBALS["cstArchivedStudentsAll"] = new ccstArchivedStudentsAll();

		// 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["cstArchivedStudentsAll"]->AddUrl();
		$this->InlineAddUrl = $this->PageUrl() . "a=add";
		$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
		$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
		$this->MultiDeleteUrl = "cstArchivedStudentsAlldelete.php";
		$this->MultiUpdateUrl = "cstArchivedStudentsAllupdate.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", 'cstArchivedStudentsAll', 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 $cstArchivedStudentsAll;

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

		// 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
			$cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $cstArchivedStudentsAll->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
		$cstArchivedStudentsAll->Recordset_Searching($this->sSrchWhere);

		// Save search criteria
		if ($this->sSrchWhere <> "") {
			if ($sSrchBasic == "")
				$this->ResetBasicSearchParms();
			if ($sSrchAdvanced == "")
				$this->ResetAdvancedSearchParms();
			$cstArchivedStudentsAll->setSearchWhere($this->sSrchWhere); // Save to Session
			if (!$this->RestoreSearch) {
				$this->lStartRec = 1; // Reset start record counter
				$cstArchivedStudentsAll->setStartRecordNumber($this->lStartRec);
			}
		} else {
			$this->sSrchWhere = $cstArchivedStudentsAll->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
		$cstArchivedStudentsAll->setSessionWhere($sFilter);
		$cstArchivedStudentsAll->CurrentFilter = "";

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

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

		// Set up search parm
		if ($sWhere <> "") {
			$this->SetSearchParm($cstArchivedStudentsAll->CCEStudentID); // CCEStudentID
			$this->SetSearchParm($cstArchivedStudentsAll->Title); // Title
			$this->SetSearchParm($cstArchivedStudentsAll->FirstName); // FirstName
			$this->SetSearchParm($cstArchivedStudentsAll->Surname); // Surname
			$this->SetSearchParm($cstArchivedStudentsAll->KnownAs); // KnownAs
			$this->SetSearchParm($cstArchivedStudentsAll->Organisation); // Organisation
			$this->SetSearchParm($cstArchivedStudentsAll->OrganisationType); // OrganisationType
			$this->SetSearchParm($cstArchivedStudentsAll->StudentNumber); // StudentNumber
			$this->SetSearchParm($cstArchivedStudentsAll->CCEFacilitatorID); // CCEFacilitatorID
			$this->SetSearchParm($cstArchivedStudentsAll->Project); // Project
			$this->SetSearchParm($cstArchivedStudentsAll->ProjectDiscipline); // ProjectDiscipline
			$this->SetSearchParm($cstArchivedStudentsAll->IDNumber); // IDNumber
			$this->SetSearchParm($cstArchivedStudentsAll->ECSARegistered); // ECSARegistered
			$this->SetSearchParm($cstArchivedStudentsAll->ECSACategory); // ECSACategory
			$this->SetSearchParm($cstArchivedStudentsAll->ECSANumber); // ECSANumber
			$this->SetSearchParm($cstArchivedStudentsAll->OtherStatutoryBodyRegistered); // OtherStatutoryBodyRegistered
			$this->SetSearchParm($cstArchivedStudentsAll->OtherStatutoryBodyName); // OtherStatutoryBodyName
			$this->SetSearchParm($cstArchivedStudentsAll->OtherStatutoryBodyNumber); // OtherStatutoryBodyNumber
			$this->SetSearchParm($cstArchivedStudentsAll->Age); // Age
			$this->SetSearchParm($cstArchivedStudentsAll->HighestQual); // HighestQual
			$this->SetSearchParm($cstArchivedStudentsAll->AreaDiscipline); // AreaDiscipline
			$this->SetSearchParm($cstArchivedStudentsAll->Telephone); // Telephone
			$this->SetSearchParm($cstArchivedStudentsAll->Cellphone); // Cellphone
			$this->SetSearchParm($cstArchivedStudentsAll->EmailAddress); // EmailAddress
			$this->SetSearchParm($cstArchivedStudentsAll->HomeAddress); // HomeAddress
			$this->SetSearchParm($cstArchivedStudentsAll->WorkAddress); // WorkAddress
			$this->SetSearchParm($cstArchivedStudentsAll->PostalAddress); // PostalAddress
			$this->SetSearchParm($cstArchivedStudentsAll->Designation); // Designation
			$this->SetSearchParm($cstArchivedStudentsAll->Department); // Department
			$this->SetSearchParm($cstArchivedStudentsAll->CESAAccountNo); // CESAAccountNo
			$this->SetSearchParm($cstArchivedStudentsAll->VATNo); // VATNo
			$this->SetSearchParm($cstArchivedStudentsAll->DietaryRequirements); // DietaryRequirements
			$this->SetSearchParm($cstArchivedStudentsAll->OrderNo); // OrderNo
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByName); // BookedByName
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByDesignation); // BookedByDesignation
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByTelNo); // BookedByTelNo
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByFaxNo); // BookedByFaxNo
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByCellNo); // BookedByCellNo
			$this->SetSearchParm($cstArchivedStudentsAll->BookedByEmail); // BookedByEmail
			$this->SetSearchParm($cstArchivedStudentsAll->WebUsername); // WebUsername
			$this->SetSearchParm($cstArchivedStudentsAll->WebPassword); // WebPassword
			$this->SetSearchParm($cstArchivedStudentsAll->MentorName); // MentorName
			$this->SetSearchParm($cstArchivedStudentsAll->MentorDesig); // MentorDesig
			$this->SetSearchParm($cstArchivedStudentsAll->MentorTel); // MentorTel
			$this->SetSearchParm($cstArchivedStudentsAll->MentorCell); // MentorCell
			$this->SetSearchParm($cstArchivedStudentsAll->MentorEmail); // MentorEmail
			$this->SetSearchParm($cstArchivedStudentsAll->HRManagerName); // HRManagerName
			$this->SetSearchParm($cstArchivedStudentsAll->HRManagerDesignation); // HRManagerDesignation
			$this->SetSearchParm($cstArchivedStudentsAll->HRManagerTelNo); // HRManagerTelNo
			$this->SetSearchParm($cstArchivedStudentsAll->HRManagerCellNo); // HRManagerCellNo
			$this->SetSearchParm($cstArchivedStudentsAll->HRManagerEmail); // HRManagerEmail
			$this->SetSearchParm($cstArchivedStudentsAll->LengthEmploy); // LengthEmploy
			$this->SetSearchParm($cstArchivedStudentsAll->BlockAccess); // BlockAccess
			$this->SetSearchParm($cstArchivedStudentsAll->Achieved); // Achieved
			$this->SetSearchParm($cstArchivedStudentsAll->ReasonForLeaving); // ReasonForLeaving
			$this->SetSearchParm($cstArchivedStudentsAll->CCECourseScheduleID); // CCECourseScheduleID
			$this->SetSearchParm($cstArchivedStudentsAll->EditStudent); // EditStudent
			$this->SetSearchParm($cstArchivedStudentsAll->Archived); // Archived
			$this->SetSearchParm($cstArchivedStudentsAll->Cancelled); // Cancelled
			$this->SetSearchParm($cstArchivedStudentsAll->CancelledReason); // CancelledReason
		}
		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 $cstArchivedStudentsAll;
		$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);
		$cstArchivedStudentsAll->setAdvancedSearch("x_$FldParm", $FldVal);
		$cstArchivedStudentsAll->setAdvancedSearch("z_$FldParm", $Fld->AdvancedSearch->SearchOperator); // @$_GET["z_$FldParm"]
		$cstArchivedStudentsAll->setAdvancedSearch("v_$FldParm", $Fld->AdvancedSearch->SearchCondition); // @$_GET["v_$FldParm"]
		$cstArchivedStudentsAll->setAdvancedSearch("y_$FldParm", $FldVal2);
		$cstArchivedStudentsAll->setAdvancedSearch("w_$FldParm", $Fld->AdvancedSearch->SearchOperator2); // @$_GET["w_$FldParm"]
	}

	// Get search parameters
	function GetSearchParm(&$Fld) {
		global $cstArchivedStudentsAll;
		$FldParm = substr($Fld->FldVar, 2);
		$Fld->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->GetAdvancedSearch("x_$FldParm");
		$Fld->AdvancedSearch->SearchOperator = $cstArchivedStudentsAll->GetAdvancedSearch("z_$FldParm");
		$Fld->AdvancedSearch->SearchCondition = $cstArchivedStudentsAll->GetAdvancedSearch("v_$FldParm");
		$Fld->AdvancedSearch->SearchValue2 = $cstArchivedStudentsAll->GetAdvancedSearch("y_$FldParm");
		$Fld->AdvancedSearch->SearchOperator2 = $cstArchivedStudentsAll->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 $cstArchivedStudentsAll;
		$sKeyword = ew_AdjustSql($Keyword);
		$sWhere = "";
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Title, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->FirstName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Surname, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->KnownAs, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Organisation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->OrganisationType, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->StudentNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ProjectDiscipline, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->IDNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ECSARegistered, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ECSACategory, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ECSANumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->OtherStatutoryBodyName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->OtherStatutoryBodyNumber, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HighestQual, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->AreaDiscipline, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Telephone, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Cellphone, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->EmailAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HomeAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->WorkAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->PostalAddress, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Designation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Department, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->CESAAccountNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->VATNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->DietaryRequirements, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->CVFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->QualCertificate1, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->QualCertificate2, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->QualCertificate3, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MemorandumFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->AgreementFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->OrderNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByDesignation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByTelNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByFaxNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByCellNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BookedByEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->WebUsername, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->WebPassword, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MentorName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MentorDesig, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MentorTel, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MentorCell, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->MentorEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HRManagerName, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HRManagerDesignation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HRManagerTelNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HRManagerCellNo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->HRManagerEmail, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->LengthEmploy, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->BlockAccess, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ResultLetter, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->IDFile, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->ReasonForLeaving, $Keyword);
		if (is_numeric($Keyword)) $this->BuildBasicSearchSQL($sWhere, $cstArchivedStudentsAll->Cancelled, $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, $cstArchivedStudentsAll;
		$sSearchStr = "";
		if (!$Security->CanSearch()) return "";
		$sSearchKeyword = $cstArchivedStudentsAll->BasicSearchKeyword;
		$sSearchType = $cstArchivedStudentsAll->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 <> "") {
			$cstArchivedStudentsAll->setSessionBasicSearchKeyword($sSearchKeyword);
			$cstArchivedStudentsAll->setSessionBasicSearchType($sSearchType);
		}
		return $sSearchStr;
	}

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

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

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

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

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

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

	// Restore all search parameters
	function RestoreSearchParms() {
		global $cstArchivedStudentsAll;
		$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_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_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_MentorName"] <> "") $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_LengthEmploy"] <> "") $bRestore = FALSE;
		if (@$_GET["x_BlockAccess"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Achieved"] <> "") $bRestore = FALSE;
		if (@$_GET["x_ReasonForLeaving"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCECourseScheduleID"] <> "") $bRestore = FALSE;
		if (@$_GET["x_EditStudent"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Archived"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Cancelled"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CancelledReason"] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

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

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

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

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

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$cstArchivedStudentsAll->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$cstArchivedStudentsAll->CurrentOrderType = @$_GET["ordertype"];
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->FirstName, $bCtrl); // FirstName
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->Surname, $bCtrl); // Surname
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->KnownAs, $bCtrl); // KnownAs
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->Organisation, $bCtrl); // Organisation
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->StudentNumber, $bCtrl); // StudentNumber
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->Age, $bCtrl); // Age
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->Cellphone, $bCtrl); // Cellphone
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->EmailAddress, $bCtrl); // EmailAddress
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->BlockAccess, $bCtrl); // BlockAccess
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->Achieved, $bCtrl); // Achieved
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->ReasonForLeaving, $bCtrl); // ReasonForLeaving
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->CCECourseScheduleID, $bCtrl); // CCECourseScheduleID
			$cstArchivedStudentsAll->UpdateSort($cstArchivedStudentsAll->EditStudent, $bCtrl); // EditStudent
			$cstArchivedStudentsAll->setStartRecordNumber(1); // Reset start position
		}
	}

	// Load sort order parameters
	function LoadSortOrder() {
		global $cstArchivedStudentsAll;
		$sOrderBy = $cstArchivedStudentsAll->getSessionOrderBy(); // Get ORDER BY from Session
		if ($sOrderBy == "") {
			if ($cstArchivedStudentsAll->SqlOrderBy() <> "") {
				$sOrderBy = $cstArchivedStudentsAll->SqlOrderBy();
				$cstArchivedStudentsAll->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 $cstArchivedStudentsAll;

		// 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 = "";
				$cstArchivedStudentsAll->setSessionOrderBy($sOrderBy);
				$cstArchivedStudentsAll->FirstName->setSort("");
				$cstArchivedStudentsAll->Surname->setSort("");
				$cstArchivedStudentsAll->KnownAs->setSort("");
				$cstArchivedStudentsAll->Organisation->setSort("");
				$cstArchivedStudentsAll->StudentNumber->setSort("");
				$cstArchivedStudentsAll->Age->setSort("");
				$cstArchivedStudentsAll->Cellphone->setSort("");
				$cstArchivedStudentsAll->EmailAddress->setSort("");
				$cstArchivedStudentsAll->BlockAccess->setSort("");
				$cstArchivedStudentsAll->Achieved->setSort("");
				$cstArchivedStudentsAll->ReasonForLeaving->setSort("");
				$cstArchivedStudentsAll->CCECourseScheduleID->setSort("");
				$cstArchivedStudentsAll->EditStudent->setSort("");
			}

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

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

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

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

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

	// Render list options
	function RenderListOptions() {
		global $Security, $Language, $cstArchivedStudentsAll;
		$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>";

		// "detail_cstStudentAssigArchived"
		$oListOpt =& $this->ListOptions->Items["detail_cstStudentAssigArchived"];
		if ($Security->AllowList('cstStudentAssigArchived')) {
			$oListOpt->Body = "<img src=\"images/detail.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("DetailLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("DetailLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . $Language->TablePhrase("cstStudentAssigArchived", "TblCaption");
			$oListOpt->Body = "<a href=\"cstStudentAssigArchivedlist.php?" . EW_TABLE_SHOW_MASTER . "=cstArchivedStudentsAll&CCEStudentID=" . urlencode(strval($cstArchivedStudentsAll->CCEStudentID->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";
		}
		$this->RenderListOptionsExt();

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

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

	// Set up starting record parameters
	function SetUpStartRec() {
		global $cstArchivedStudentsAll;
		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];
				$cstArchivedStudentsAll->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;
					}
					$cstArchivedStudentsAll->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $cstArchivedStudentsAll->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
			$cstArchivedStudentsAll->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
			$cstArchivedStudentsAll->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
			$cstArchivedStudentsAll->setStartRecordNumber($this->lStartRec);
		}
	}

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

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

		// Load search values
		// CCEStudentID

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// MentorName
		$cstArchivedStudentsAll->MentorName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorName"]);
		$cstArchivedStudentsAll->MentorName->AdvancedSearch->SearchOperator = @$_GET["z_MentorName"];

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

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

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

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

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

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

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

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

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

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

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

		// Achieved
		$cstArchivedStudentsAll->Achieved->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Achieved"]);
		$cstArchivedStudentsAll->Achieved->AdvancedSearch->SearchOperator = @$_GET["z_Achieved"];

		// ReasonForLeaving
		$cstArchivedStudentsAll->ReasonForLeaving->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ReasonForLeaving"]);
		$cstArchivedStudentsAll->ReasonForLeaving->AdvancedSearch->SearchOperator = @$_GET["z_ReasonForLeaving"];

		// CCECourseScheduleID
		$cstArchivedStudentsAll->CCECourseScheduleID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCECourseScheduleID"]);
		$cstArchivedStudentsAll->CCECourseScheduleID->AdvancedSearch->SearchOperator = @$_GET["z_CCECourseScheduleID"];

		// EditStudent
		$cstArchivedStudentsAll->EditStudent->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EditStudent"]);
		$cstArchivedStudentsAll->EditStudent->AdvancedSearch->SearchOperator = @$_GET["z_EditStudent"];

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

		// Cancelled
		$cstArchivedStudentsAll->Cancelled->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Cancelled"]);
		$cstArchivedStudentsAll->Cancelled->AdvancedSearch->SearchOperator = @$_GET["z_Cancelled"];

		// CancelledReason
		$cstArchivedStudentsAll->CancelledReason->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CancelledReason"]);
		$cstArchivedStudentsAll->CancelledReason->AdvancedSearch->SearchOperator = @$_GET["z_CancelledReason"];
	}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		// Age
		$cstArchivedStudentsAll->Age->CellCssStyle = ""; $cstArchivedStudentsAll->Age->CellCssClass = "";
		$cstArchivedStudentsAll->Age->CellAttrs = array(); $cstArchivedStudentsAll->Age->ViewAttrs = array(); $cstArchivedStudentsAll->Age->EditAttrs = array();

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

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

		// BlockAccess
		$cstArchivedStudentsAll->BlockAccess->CellCssStyle = ""; $cstArchivedStudentsAll->BlockAccess->CellCssClass = "";
		$cstArchivedStudentsAll->BlockAccess->CellAttrs = array(); $cstArchivedStudentsAll->BlockAccess->ViewAttrs = array(); $cstArchivedStudentsAll->BlockAccess->EditAttrs = array();

		// Achieved
		$cstArchivedStudentsAll->Achieved->CellCssStyle = ""; $cstArchivedStudentsAll->Achieved->CellCssClass = "";
		$cstArchivedStudentsAll->Achieved->CellAttrs = array(); $cstArchivedStudentsAll->Achieved->ViewAttrs = array(); $cstArchivedStudentsAll->Achieved->EditAttrs = array();

		// ReasonForLeaving
		$cstArchivedStudentsAll->ReasonForLeaving->CellCssStyle = ""; $cstArchivedStudentsAll->ReasonForLeaving->CellCssClass = "";
		$cstArchivedStudentsAll->ReasonForLeaving->CellAttrs = array(); $cstArchivedStudentsAll->ReasonForLeaving->ViewAttrs = array(); $cstArchivedStudentsAll->ReasonForLeaving->EditAttrs = array();

		// CCECourseScheduleID
		$cstArchivedStudentsAll->CCECourseScheduleID->CellCssStyle = ""; $cstArchivedStudentsAll->CCECourseScheduleID->CellCssClass = "";
		$cstArchivedStudentsAll->CCECourseScheduleID->CellAttrs = array(); $cstArchivedStudentsAll->CCECourseScheduleID->ViewAttrs = array(); $cstArchivedStudentsAll->CCECourseScheduleID->EditAttrs = array();

		// EditStudent
		$cstArchivedStudentsAll->EditStudent->CellCssStyle = "white-space: nowrap;"; $cstArchivedStudentsAll->EditStudent->CellCssClass = "";
		$cstArchivedStudentsAll->EditStudent->CellAttrs = array(); $cstArchivedStudentsAll->EditStudent->ViewAttrs = array(); $cstArchivedStudentsAll->EditStudent->EditAttrs = array();
		if ($cstArchivedStudentsAll->RowType == EW_ROWTYPE_VIEW) { // View row

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

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

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

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

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

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

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

			// CCEFacilitatorID
			if (strval($cstArchivedStudentsAll->CCEFacilitatorID->CurrentValue) <> "") {
				$sFilterWrk = "`FacilitatorID` = " . ew_AdjustSql($cstArchivedStudentsAll->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
					$cstArchivedStudentsAll->CCEFacilitatorID->ViewValue = $rswrk->fields('FacilitatorName');
					$rswrk->Close();
				} else {
					$cstArchivedStudentsAll->CCEFacilitatorID->ViewValue = $cstArchivedStudentsAll->CCEFacilitatorID->CurrentValue;
				}
			} else {
				$cstArchivedStudentsAll->CCEFacilitatorID->ViewValue = NULL;
			}
			$cstArchivedStudentsAll->CCEFacilitatorID->CssStyle = "";
			$cstArchivedStudentsAll->CCEFacilitatorID->CssClass = "";
			$cstArchivedStudentsAll->CCEFacilitatorID->ViewCustomAttributes = "";

			// Project
			if (strval($cstArchivedStudentsAll->Project->CurrentValue) <> "") {
				$sFilterWrk = "`CCEProjectID` = " . ew_AdjustSql($cstArchivedStudentsAll->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
					$cstArchivedStudentsAll->Project->ViewValue = $rswrk->fields('Project');
					$rswrk->Close();
				} else {
					$cstArchivedStudentsAll->Project->ViewValue = $cstArchivedStudentsAll->Project->CurrentValue;
				}
			} else {
				$cstArchivedStudentsAll->Project->ViewValue = NULL;
			}
			$cstArchivedStudentsAll->Project->CssStyle = "";
			$cstArchivedStudentsAll->Project->CssClass = "";
			$cstArchivedStudentsAll->Project->ViewCustomAttributes = "";

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

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

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

			// ECSACategory
			if (strval($cstArchivedStudentsAll->ECSACategory->CurrentValue) <> "") {
				$sFilterWrk = "`PicklistValue` = '" . ew_AdjustSql($cstArchivedStudentsAll->ECSACategory->CurrentValue) . "'";
			$sSqlWrk = "SELECT `PicklistLabel` FROM `Picklists`";
			$sWhereWrk = "";
			if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
			$sWhereWrk .= "(" . "`Picklists`.`PicklistType` = 'ECSA Registration Categories'" . ")";
			if ($sFilterWrk <> "") {
				if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
				$sWhereWrk .= "(" . $sFilterWrk . ")";
			}
			if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
			$sSqlWrk .= " ORDER BY `DisplayOrder` Asc";
				$rswrk = $conn->Execute($sSqlWrk);
				if ($rswrk && !$rswrk->EOF) { // Lookup values found
					$cstArchivedStudentsAll->ECSACategory->ViewValue = $rswrk->fields('PicklistLabel');
					$rswrk->Close();
				} else {
					$cstArchivedStudentsAll->ECSACategory->ViewValue = $cstArchivedStudentsAll->ECSACategory->CurrentValue;
				}
			} else {
				$cstArchivedStudentsAll->ECSACategory->ViewValue = NULL;
			}
			$cstArchivedStudentsAll->ECSACategory->CssStyle = "";
			$cstArchivedStudentsAll->ECSACategory->CssClass = "";
			$cstArchivedStudentsAll->ECSACategory->ViewCustomAttributes = "";

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

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

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

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

			// Age
			$cstArchivedStudentsAll->Age->ViewValue = $cstArchivedStudentsAll->Age->CurrentValue;
			$cstArchivedStudentsAll->Age->CssStyle = "";
			$cstArchivedStudentsAll->Age->CssClass = "";
			$cstArchivedStudentsAll->Age->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

			// MentorName
			$cstArchivedStudentsAll->MentorName->ViewValue = $cstArchivedStudentsAll->MentorName->CurrentValue;
			$cstArchivedStudentsAll->MentorName->CssStyle = "";
			$cstArchivedStudentsAll->MentorName->CssClass = "";
			$cstArchivedStudentsAll->MentorName->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

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

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

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

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

			// ReasonForLeaving
			$cstArchivedStudentsAll->ReasonForLeaving->ViewValue = $cstArchivedStudentsAll->ReasonForLeaving->CurrentValue;
			$cstArchivedStudentsAll->ReasonForLeaving->CssStyle = "";
			$cstArchivedStudentsAll->ReasonForLeaving->CssClass = "";
			$cstArchivedStudentsAll->ReasonForLeaving->ViewCustomAttributes = "";

			// CCECourseScheduleID
			if (strval($cstArchivedStudentsAll->CCECourseScheduleID->CurrentValue) <> "") {
				$sFilterWrk = "CCECourseSchedules.CCECourseScheduleID = " . ew_AdjustSql($cstArchivedStudentsAll->CCECourseScheduleID->CurrentValue) . "";
			$sSqlWrk = "SELECT Year(CCECourseSchedules.StartDate) AS `CourseYear` FROM CCECourseSchedules";
			$sWhereWrk = "";
			if ($sFilterWrk <> "") {
				if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
				$sWhereWrk .= "(" . $sFilterWrk . ")";
			}
			if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
				$rswrk = $conn->Execute($sSqlWrk);
				if ($rswrk && !$rswrk->EOF) { // Lookup values found
					$cstArchivedStudentsAll->CCECourseScheduleID->ViewValue = $rswrk->fields('CourseYear');
					$rswrk->Close();
				} else {
					$cstArchivedStudentsAll->CCECourseScheduleID->ViewValue = $cstArchivedStudentsAll->CCECourseScheduleID->CurrentValue;
				}
			} else {
				$cstArchivedStudentsAll->CCECourseScheduleID->ViewValue = NULL;
			}
			$cstArchivedStudentsAll->CCECourseScheduleID->CssStyle = "";
			$cstArchivedStudentsAll->CCECourseScheduleID->CssClass = "";
			$cstArchivedStudentsAll->CCECourseScheduleID->ViewCustomAttributes = "";

			// EditStudent
			$cstArchivedStudentsAll->EditStudent->ViewValue = $cstArchivedStudentsAll->EditStudent->CurrentValue;
			$cstArchivedStudentsAll->EditStudent->CssStyle = "";
			$cstArchivedStudentsAll->EditStudent->CssClass = "";
			$cstArchivedStudentsAll->EditStudent->ViewCustomAttributes = "";

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

			// Cancelled
			$cstArchivedStudentsAll->Cancelled->ViewValue = $cstArchivedStudentsAll->Cancelled->CurrentValue;
			$cstArchivedStudentsAll->Cancelled->CssStyle = "";
			$cstArchivedStudentsAll->Cancelled->CssClass = "";
			$cstArchivedStudentsAll->Cancelled->ViewCustomAttributes = "";

			// CancelledReason
			$cstArchivedStudentsAll->CancelledReason->ViewValue = $cstArchivedStudentsAll->CancelledReason->CurrentValue;
			$cstArchivedStudentsAll->CancelledReason->CssStyle = "";
			$cstArchivedStudentsAll->CancelledReason->CssClass = "";
			$cstArchivedStudentsAll->CancelledReason->ViewCustomAttributes = "";

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

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

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

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

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

			// Age
			$cstArchivedStudentsAll->Age->HrefValue = "";
			$cstArchivedStudentsAll->Age->TooltipValue = "";

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

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

			// BlockAccess
			$cstArchivedStudentsAll->BlockAccess->HrefValue = "";
			$cstArchivedStudentsAll->BlockAccess->TooltipValue = "";

			// Achieved
			$cstArchivedStudentsAll->Achieved->HrefValue = "";
			$cstArchivedStudentsAll->Achieved->TooltipValue = "";

			// ReasonForLeaving
			$cstArchivedStudentsAll->ReasonForLeaving->HrefValue = "";
			$cstArchivedStudentsAll->ReasonForLeaving->TooltipValue = "";

			// CCECourseScheduleID
			$cstArchivedStudentsAll->CCECourseScheduleID->HrefValue = "";
			$cstArchivedStudentsAll->CCECourseScheduleID->TooltipValue = "";

			// EditStudent
			$cstArchivedStudentsAll->EditStudent->HrefValue = "";
			$cstArchivedStudentsAll->EditStudent->TooltipValue = "";
		} elseif ($cstArchivedStudentsAll->RowType == EW_ROWTYPE_SEARCH) { // Search row

			// FirstName
			$cstArchivedStudentsAll->FirstName->EditCustomAttributes = "";
			$cstArchivedStudentsAll->FirstName->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->FirstName->AdvancedSearch->SearchValue);

			// Surname
			$cstArchivedStudentsAll->Surname->EditCustomAttributes = "";
			$cstArchivedStudentsAll->Surname->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->Surname->AdvancedSearch->SearchValue);

			// KnownAs
			$cstArchivedStudentsAll->KnownAs->EditCustomAttributes = "";
			$cstArchivedStudentsAll->KnownAs->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->KnownAs->AdvancedSearch->SearchValue);

			// Organisation
			$cstArchivedStudentsAll->Organisation->EditCustomAttributes = "";
			$cstArchivedStudentsAll->Organisation->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->Organisation->AdvancedSearch->SearchValue);

			// StudentNumber
			$cstArchivedStudentsAll->StudentNumber->EditCustomAttributes = "";
			$cstArchivedStudentsAll->StudentNumber->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->StudentNumber->AdvancedSearch->SearchValue);

			// Age
			$cstArchivedStudentsAll->Age->EditCustomAttributes = "";
			$cstArchivedStudentsAll->Age->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->Age->AdvancedSearch->SearchValue);

			// Cellphone
			$cstArchivedStudentsAll->Cellphone->EditCustomAttributes = "";
			$cstArchivedStudentsAll->Cellphone->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->Cellphone->AdvancedSearch->SearchValue);

			// EmailAddress
			$cstArchivedStudentsAll->EmailAddress->EditCustomAttributes = "";
			$cstArchivedStudentsAll->EmailAddress->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->EmailAddress->AdvancedSearch->SearchValue);

			// BlockAccess
			$cstArchivedStudentsAll->BlockAccess->EditCustomAttributes = "";
			$arwrk = array();
			$arwrk[] = array("y", "Yes");
			$arwrk[] = array("n", "No");
			$cstArchivedStudentsAll->BlockAccess->EditValue = $arwrk;

			// Achieved
			$cstArchivedStudentsAll->Achieved->EditCustomAttributes = "";
			$arwrk = array();
			$arwrk[] = array("1", "Yes");
			$cstArchivedStudentsAll->Achieved->EditValue = $arwrk;

			// ReasonForLeaving
			$cstArchivedStudentsAll->ReasonForLeaving->EditCustomAttributes = "";
			$cstArchivedStudentsAll->ReasonForLeaving->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->ReasonForLeaving->AdvancedSearch->SearchValue);

			// CCECourseScheduleID
			$cstArchivedStudentsAll->CCECourseScheduleID->EditCustomAttributes = "";
				$sFilterWrk = "";
			$sSqlWrk = "SELECT CCECourseSchedules.CCECourseScheduleID, Year(CCECourseSchedules.StartDate), '' AS Disp2Fld, '' AS SelectFilterFld FROM CCECourseSchedules";
			$sWhereWrk = "";
			if ($sFilterWrk <> "") {
				if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
				$sWhereWrk .= "(" . $sFilterWrk . ")";
			}
			if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
			$rswrk = $conn->Execute($sSqlWrk);
			$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
			if ($rswrk) $rswrk->Close();
			array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
			$cstArchivedStudentsAll->CCECourseScheduleID->EditValue = $arwrk;

			// EditStudent
			$cstArchivedStudentsAll->EditStudent->EditCustomAttributes = "";
			$cstArchivedStudentsAll->EditStudent->EditValue = ew_HtmlEncode($cstArchivedStudentsAll->EditStudent->AdvancedSearch->SearchValue);
		}

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

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

		// 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 $cstArchivedStudentsAll;
		$cstArchivedStudentsAll->CCEStudentID->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_CCEStudentID");
		$cstArchivedStudentsAll->Title->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Title");
		$cstArchivedStudentsAll->FirstName->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_FirstName");
		$cstArchivedStudentsAll->Surname->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Surname");
		$cstArchivedStudentsAll->KnownAs->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_KnownAs");
		$cstArchivedStudentsAll->Organisation->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Organisation");
		$cstArchivedStudentsAll->OrganisationType->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_OrganisationType");
		$cstArchivedStudentsAll->StudentNumber->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_StudentNumber");
		$cstArchivedStudentsAll->CCEFacilitatorID->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_CCEFacilitatorID");
		$cstArchivedStudentsAll->Project->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Project");
		$cstArchivedStudentsAll->ProjectDiscipline->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_ProjectDiscipline");
		$cstArchivedStudentsAll->IDNumber->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_IDNumber");
		$cstArchivedStudentsAll->ECSARegistered->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_ECSARegistered");
		$cstArchivedStudentsAll->ECSACategory->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_ECSACategory");
		$cstArchivedStudentsAll->ECSANumber->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_ECSANumber");
		$cstArchivedStudentsAll->OtherStatutoryBodyRegistered->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_OtherStatutoryBodyRegistered");
		$cstArchivedStudentsAll->OtherStatutoryBodyName->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_OtherStatutoryBodyName");
		$cstArchivedStudentsAll->OtherStatutoryBodyNumber->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_OtherStatutoryBodyNumber");
		$cstArchivedStudentsAll->Age->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Age");
		$cstArchivedStudentsAll->HighestQual->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HighestQual");
		$cstArchivedStudentsAll->AreaDiscipline->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_AreaDiscipline");
		$cstArchivedStudentsAll->Telephone->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Telephone");
		$cstArchivedStudentsAll->Cellphone->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Cellphone");
		$cstArchivedStudentsAll->EmailAddress->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_EmailAddress");
		$cstArchivedStudentsAll->HomeAddress->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HomeAddress");
		$cstArchivedStudentsAll->WorkAddress->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_WorkAddress");
		$cstArchivedStudentsAll->PostalAddress->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_PostalAddress");
		$cstArchivedStudentsAll->Designation->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Designation");
		$cstArchivedStudentsAll->Department->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Department");
		$cstArchivedStudentsAll->CESAAccountNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_CESAAccountNo");
		$cstArchivedStudentsAll->VATNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_VATNo");
		$cstArchivedStudentsAll->DietaryRequirements->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_DietaryRequirements");
		$cstArchivedStudentsAll->OrderNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_OrderNo");
		$cstArchivedStudentsAll->BookedByName->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByName");
		$cstArchivedStudentsAll->BookedByDesignation->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByDesignation");
		$cstArchivedStudentsAll->BookedByTelNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByTelNo");
		$cstArchivedStudentsAll->BookedByFaxNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByFaxNo");
		$cstArchivedStudentsAll->BookedByCellNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByCellNo");
		$cstArchivedStudentsAll->BookedByEmail->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BookedByEmail");
		$cstArchivedStudentsAll->WebUsername->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_WebUsername");
		$cstArchivedStudentsAll->WebPassword->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_WebPassword");
		$cstArchivedStudentsAll->MentorName->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_MentorName");
		$cstArchivedStudentsAll->MentorDesig->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_MentorDesig");
		$cstArchivedStudentsAll->MentorTel->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_MentorTel");
		$cstArchivedStudentsAll->MentorCell->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_MentorCell");
		$cstArchivedStudentsAll->MentorEmail->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_MentorEmail");
		$cstArchivedStudentsAll->HRManagerName->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HRManagerName");
		$cstArchivedStudentsAll->HRManagerDesignation->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HRManagerDesignation");
		$cstArchivedStudentsAll->HRManagerTelNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HRManagerTelNo");
		$cstArchivedStudentsAll->HRManagerCellNo->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HRManagerCellNo");
		$cstArchivedStudentsAll->HRManagerEmail->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_HRManagerEmail");
		$cstArchivedStudentsAll->LengthEmploy->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_LengthEmploy");
		$cstArchivedStudentsAll->BlockAccess->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_BlockAccess");
		$cstArchivedStudentsAll->Achieved->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Achieved");
		$cstArchivedStudentsAll->ReasonForLeaving->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_ReasonForLeaving");
		$cstArchivedStudentsAll->CCECourseScheduleID->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_CCECourseScheduleID");
		$cstArchivedStudentsAll->EditStudent->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_EditStudent");
		$cstArchivedStudentsAll->Archived->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Archived");
		$cstArchivedStudentsAll->Cancelled->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_Cancelled");
		$cstArchivedStudentsAll->CancelledReason->AdvancedSearch->SearchValue = $cstArchivedStudentsAll->getAdvancedSearch("x_CancelledReason");
	}

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

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

		// Export all
		if ($cstArchivedStudentsAll->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 ($cstArchivedStudentsAll->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($cstArchivedStudentsAll, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Title);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->FirstName);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Surname);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->KnownAs);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Organisation);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->OrganisationType);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->StudentNumber);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->CCEFacilitatorID);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Project);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ProjectDiscipline);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->IDNumber);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ECSARegistered);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ECSACategory);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ECSANumber);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->OtherStatutoryBodyRegistered);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->OtherStatutoryBodyName);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->OtherStatutoryBodyNumber);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Age);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HighestQual);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->AreaDiscipline);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Telephone);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Cellphone);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->EmailAddress);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HomeAddress);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->WorkAddress);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->PostalAddress);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Designation);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Department);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->CESAAccountNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->VATNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->DietaryRequirements);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->CVFile);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->QualCertificate1);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->QualCertificate2);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->QualCertificate3);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MemorandumFile);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->AgreementFile);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->OrderNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByName);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByDesignation);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByTelNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByFaxNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByCellNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BookedByEmail);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->WebUsername);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->WebPassword);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MentorName);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MentorDesig);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MentorTel);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MentorCell);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->MentorEmail);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HRManagerName);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HRManagerDesignation);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HRManagerTelNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HRManagerCellNo);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->HRManagerEmail);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->LengthEmploy);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->BlockAccess);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ResultLetter);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Achieved);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->IDFile);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->ReasonForLeaving);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->CCECourseScheduleID);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Archived);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->Cancelled);
				$ExportDoc->ExportCaption($cstArchivedStudentsAll->CancelledReason);
				$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
				$cstArchivedStudentsAll->CssClass = "";
				$cstArchivedStudentsAll->CssStyle = "";
				$cstArchivedStudentsAll->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($cstArchivedStudentsAll->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('Title', $cstArchivedStudentsAll->Title->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('FirstName', $cstArchivedStudentsAll->FirstName->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Surname', $cstArchivedStudentsAll->Surname->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('KnownAs', $cstArchivedStudentsAll->KnownAs->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Organisation', $cstArchivedStudentsAll->Organisation->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('OrganisationType', $cstArchivedStudentsAll->OrganisationType->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('StudentNumber', $cstArchivedStudentsAll->StudentNumber->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('CCEFacilitatorID', $cstArchivedStudentsAll->CCEFacilitatorID->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Project', $cstArchivedStudentsAll->Project->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ProjectDiscipline', $cstArchivedStudentsAll->ProjectDiscipline->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('IDNumber', $cstArchivedStudentsAll->IDNumber->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ECSARegistered', $cstArchivedStudentsAll->ECSARegistered->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ECSACategory', $cstArchivedStudentsAll->ECSACategory->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ECSANumber', $cstArchivedStudentsAll->ECSANumber->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyRegistered', $cstArchivedStudentsAll->OtherStatutoryBodyRegistered->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyName', $cstArchivedStudentsAll->OtherStatutoryBodyName->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('OtherStatutoryBodyNumber', $cstArchivedStudentsAll->OtherStatutoryBodyNumber->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Age', $cstArchivedStudentsAll->Age->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HighestQual', $cstArchivedStudentsAll->HighestQual->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('AreaDiscipline', $cstArchivedStudentsAll->AreaDiscipline->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Telephone', $cstArchivedStudentsAll->Telephone->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Cellphone', $cstArchivedStudentsAll->Cellphone->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('EmailAddress', $cstArchivedStudentsAll->EmailAddress->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HomeAddress', $cstArchivedStudentsAll->HomeAddress->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('WorkAddress', $cstArchivedStudentsAll->WorkAddress->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('PostalAddress', $cstArchivedStudentsAll->PostalAddress->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Designation', $cstArchivedStudentsAll->Designation->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Department', $cstArchivedStudentsAll->Department->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('CESAAccountNo', $cstArchivedStudentsAll->CESAAccountNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('VATNo', $cstArchivedStudentsAll->VATNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('DietaryRequirements', $cstArchivedStudentsAll->DietaryRequirements->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('CVFile', $cstArchivedStudentsAll->CVFile->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate1', $cstArchivedStudentsAll->QualCertificate1->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate2', $cstArchivedStudentsAll->QualCertificate2->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('QualCertificate3', $cstArchivedStudentsAll->QualCertificate3->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MemorandumFile', $cstArchivedStudentsAll->MemorandumFile->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('AgreementFile', $cstArchivedStudentsAll->AgreementFile->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('OrderNo', $cstArchivedStudentsAll->OrderNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByName', $cstArchivedStudentsAll->BookedByName->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByDesignation', $cstArchivedStudentsAll->BookedByDesignation->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByTelNo', $cstArchivedStudentsAll->BookedByTelNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByFaxNo', $cstArchivedStudentsAll->BookedByFaxNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByCellNo', $cstArchivedStudentsAll->BookedByCellNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BookedByEmail', $cstArchivedStudentsAll->BookedByEmail->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('WebUsername', $cstArchivedStudentsAll->WebUsername->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('WebPassword', $cstArchivedStudentsAll->WebPassword->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MentorName', $cstArchivedStudentsAll->MentorName->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MentorDesig', $cstArchivedStudentsAll->MentorDesig->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MentorTel', $cstArchivedStudentsAll->MentorTel->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MentorCell', $cstArchivedStudentsAll->MentorCell->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('MentorEmail', $cstArchivedStudentsAll->MentorEmail->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerName', $cstArchivedStudentsAll->HRManagerName->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerDesignation', $cstArchivedStudentsAll->HRManagerDesignation->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerTelNo', $cstArchivedStudentsAll->HRManagerTelNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerCellNo', $cstArchivedStudentsAll->HRManagerCellNo->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('HRManagerEmail', $cstArchivedStudentsAll->HRManagerEmail->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('LengthEmploy', $cstArchivedStudentsAll->LengthEmploy->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('BlockAccess', $cstArchivedStudentsAll->BlockAccess->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ResultLetter', $cstArchivedStudentsAll->ResultLetter->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Achieved', $cstArchivedStudentsAll->Achieved->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('IDFile', $cstArchivedStudentsAll->IDFile->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('ReasonForLeaving', $cstArchivedStudentsAll->ReasonForLeaving->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('CCECourseScheduleID', $cstArchivedStudentsAll->CCECourseScheduleID->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Archived', $cstArchivedStudentsAll->Archived->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('Cancelled', $cstArchivedStudentsAll->Cancelled->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
					$XmlDoc->AddField('CancelledReason', $cstArchivedStudentsAll->CancelledReason->ExportValue($cstArchivedStudentsAll->Export, $cstArchivedStudentsAll->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($cstArchivedStudentsAll->Title);
					$ExportDoc->ExportField($cstArchivedStudentsAll->FirstName);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Surname);
					$ExportDoc->ExportField($cstArchivedStudentsAll->KnownAs);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Organisation);
					$ExportDoc->ExportField($cstArchivedStudentsAll->OrganisationType);
					$ExportDoc->ExportField($cstArchivedStudentsAll->StudentNumber);
					$ExportDoc->ExportField($cstArchivedStudentsAll->CCEFacilitatorID);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Project);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ProjectDiscipline);
					$ExportDoc->ExportField($cstArchivedStudentsAll->IDNumber);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ECSARegistered);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ECSACategory);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ECSANumber);
					$ExportDoc->ExportField($cstArchivedStudentsAll->OtherStatutoryBodyRegistered);
					$ExportDoc->ExportField($cstArchivedStudentsAll->OtherStatutoryBodyName);
					$ExportDoc->ExportField($cstArchivedStudentsAll->OtherStatutoryBodyNumber);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Age);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HighestQual);
					$ExportDoc->ExportField($cstArchivedStudentsAll->AreaDiscipline);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Telephone);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Cellphone);
					$ExportDoc->ExportField($cstArchivedStudentsAll->EmailAddress);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HomeAddress);
					$ExportDoc->ExportField($cstArchivedStudentsAll->WorkAddress);
					$ExportDoc->ExportField($cstArchivedStudentsAll->PostalAddress);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Designation);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Department);
					$ExportDoc->ExportField($cstArchivedStudentsAll->CESAAccountNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->VATNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->DietaryRequirements);
					$ExportDoc->ExportField($cstArchivedStudentsAll->CVFile);
					$ExportDoc->ExportField($cstArchivedStudentsAll->QualCertificate1);
					$ExportDoc->ExportField($cstArchivedStudentsAll->QualCertificate2);
					$ExportDoc->ExportField($cstArchivedStudentsAll->QualCertificate3);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MemorandumFile);
					$ExportDoc->ExportField($cstArchivedStudentsAll->AgreementFile);
					$ExportDoc->ExportField($cstArchivedStudentsAll->OrderNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByName);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByDesignation);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByTelNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByFaxNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByCellNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BookedByEmail);
					$ExportDoc->ExportField($cstArchivedStudentsAll->WebUsername);
					$ExportDoc->ExportField($cstArchivedStudentsAll->WebPassword);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MentorName);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MentorDesig);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MentorTel);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MentorCell);
					$ExportDoc->ExportField($cstArchivedStudentsAll->MentorEmail);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HRManagerName);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HRManagerDesignation);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HRManagerTelNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HRManagerCellNo);
					$ExportDoc->ExportField($cstArchivedStudentsAll->HRManagerEmail);
					$ExportDoc->ExportField($cstArchivedStudentsAll->LengthEmploy);
					$ExportDoc->ExportField($cstArchivedStudentsAll->BlockAccess);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ResultLetter);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Achieved);
					$ExportDoc->ExportField($cstArchivedStudentsAll->IDFile);
					$ExportDoc->ExportField($cstArchivedStudentsAll->ReasonForLeaving);
					$ExportDoc->ExportField($cstArchivedStudentsAll->CCECourseScheduleID);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Archived);
					$ExportDoc->ExportField($cstArchivedStudentsAll->Cancelled);
					$ExportDoc->ExportField($cstArchivedStudentsAll->CancelledReason);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($cstArchivedStudentsAll->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($cstArchivedStudentsAll->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

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

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

	// Export email
	function ExportEmail($EmailContent) {
		global $Language, $cstArchivedStudentsAll;
		$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 ($cstArchivedStudentsAll->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 $cstArchivedStudentsAll;

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

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

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

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

	}
}
?>