Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/ccmadmin/
Upload File :
Current File : /var/www/cesa.co.za/ccmadmin/cstCandMilestoneslist.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 "cstCandMilestonesinfo.php" ?>
<?php include "CCMUsersinfo.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
$cstCandMilestones_list = new ccstCandMilestones_list();
$Page =& $cstCandMilestones_list;

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

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

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

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

// extend page with Form_CustomValidate function
cstCandMilestones_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) { ?>
cstCandMilestones_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
cstCandMilestones_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 ($cstCandMilestones->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$cstCandMilestones_list->lTotalRecs = $cstCandMilestones->SelectRecordCount();
	} else {
		if ($rs = $cstCandMilestones_list->LoadRecordset())
			$cstCandMilestones_list->lTotalRecs = $rs->RecordCount();
	}
	$cstCandMilestones_list->lStartRec = 1;
	if ($cstCandMilestones_list->lDisplayRecs <= 0 || ($cstCandMilestones->Export <> "" && $cstCandMilestones->ExportAll)) // Display all records
		$cstCandMilestones_list->lDisplayRecs = $cstCandMilestones_list->lTotalRecs;
	if (!($cstCandMilestones->Export <> "" && $cstCandMilestones->ExportAll))
		$cstCandMilestones_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $cstCandMilestones_list->LoadRecordset($cstCandMilestones_list->lStartRec-1, $cstCandMilestones_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeCUSTOMVIEW") ?><?php echo $cstCandMilestones->TableCaption() ?>
<?php if ($cstCandMilestones->Export == "" && $cstCandMilestones->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $cstCandMilestones_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 $cstCandMilestones_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 $cstCandMilestones_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_cstCandMilestones" id="emf_cstCandMilestones" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_cstCandMilestones',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fcstCandMilestoneslist,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 ($cstCandMilestones->Export == "" && $cstCandMilestones->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(cstCandMilestones_list);" style="text-decoration: none;"><img id="cstCandMilestones_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="cstCandMilestones_list_SearchPanel">
<form name="fcstCandMilestoneslistsrch" id="fcstCandMilestoneslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="cstCandMilestones">
<table class="ewBasicSearch">
	<tr>
		<td><span class="phpmaker">
			<a href="<?php echo $cstCandMilestones_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>&nbsp;
			<a href="cstCandMilestonessrch.php"><?php echo $Language->Phrase("AdvancedSearch") ?></a>&nbsp;
		</span></td>
	</tr>
</table>
</form>
</div>
<?php } ?>
<?php } ?>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$cstCandMilestones_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($cstCandMilestones->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($cstCandMilestones->CurrentAction <> "gridadd" && $cstCandMilestones->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($cstCandMilestones_list->Pager)) $cstCandMilestones_list->Pager = new cPrevNextPager($cstCandMilestones_list->lStartRec, $cstCandMilestones_list->lDisplayRecs, $cstCandMilestones_list->lTotalRecs) ?>
<?php if ($cstCandMilestones_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 ($cstCandMilestones_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $cstCandMilestones_list->PageUrl() ?>start=<?php echo $cstCandMilestones_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 ($cstCandMilestones_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $cstCandMilestones_list->PageUrl() ?>start=<?php echo $cstCandMilestones_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 $cstCandMilestones_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($cstCandMilestones_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $cstCandMilestones_list->PageUrl() ?>start=<?php echo $cstCandMilestones_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 ($cstCandMilestones_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $cstCandMilestones_list->PageUrl() ?>start=<?php echo $cstCandMilestones_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 $cstCandMilestones_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 $cstCandMilestones_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $cstCandMilestones_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $cstCandMilestones_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($cstCandMilestones_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="fcstCandMilestoneslist" id="fcstCandMilestoneslist" class="ewForm" action="" method="post">
<div id="gmp_cstCandMilestones" class="ewGridMiddlePanel">
<?php if ($cstCandMilestones_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $cstCandMilestones->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

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

// Render list options (header, left)
$cstCandMilestones_list->ListOptions->Render("header", "left");
?>
<?php if ($cstCandMilestones->FirstName->Visible) { // FirstName ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->FirstName) == "") { ?>
		<td><?php echo $cstCandMilestones->FirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->FirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->FirstName->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->FirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->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 ($cstCandMilestones->Surname->Visible) { // Surname ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->Surname) == "") { ?>
		<td><?php echo $cstCandMilestones->Surname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->Surname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->Surname->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->Surname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->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 ($cstCandMilestones->MentorFirstName->Visible) { // MentorFirstName ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->MentorFirstName) == "") { ?>
		<td><?php echo $cstCandMilestones->MentorFirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->MentorFirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->MentorFirstName->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->MentorFirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->MentorFirstName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->MentorSurname->Visible) { // MentorSurname ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->MentorSurname) == "") { ?>
		<td><?php echo $cstCandMilestones->MentorSurname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->MentorSurname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->MentorSurname->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->MentorSurname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->MentorSurname->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->EmployerFirstName->Visible) { // EmployerFirstName ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->EmployerFirstName) == "") { ?>
		<td><?php echo $cstCandMilestones->EmployerFirstName->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->EmployerFirstName) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->EmployerFirstName->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->EmployerFirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->EmployerFirstName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->EmployerSurname->Visible) { // EmployerSurname ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->EmployerSurname) == "") { ?>
		<td><?php echo $cstCandMilestones->EmployerSurname->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->EmployerSurname) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->EmployerSurname->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->EmployerSurname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->EmployerSurname->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->Organisation->Visible) { // Organisation ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->Organisation) == "") { ?>
		<td><?php echo $cstCandMilestones->Organisation->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->Organisation) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->Organisation->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->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 ($cstCandMilestones->MilestoneNum->Visible) { // MilestoneNum ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->MilestoneNum) == "") { ?>
		<td><?php echo $cstCandMilestones->MilestoneNum->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->MilestoneNum) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->MilestoneNum->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->MilestoneNum->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->MilestoneNum->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->Max28CCMMilestones2EDateUpdated29->Visible) { // Max(CCMMilestones.DateUpdated) ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->Max28CCMMilestones2EDateUpdated29) == "") { ?>
		<td><?php echo $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->Max28CCMMilestones2EDateUpdated29) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->Max28CCMMilestones2EDateUpdated29->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->Max28CCMMilestones2EDateUpdated29->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($cstCandMilestones->CCMMilestonePaid->Visible) { // CCMMilestonePaid ?>
	<?php if ($cstCandMilestones->SortUrl($cstCandMilestones->CCMMilestonePaid) == "") { ?>
		<td><?php echo $cstCandMilestones->CCMMilestonePaid->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $cstCandMilestones->SortUrl($cstCandMilestones->CCMMilestonePaid) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $cstCandMilestones->CCMMilestonePaid->FldCaption() ?></td><td style="width: 10px;"><?php if ($cstCandMilestones->CCMMilestonePaid->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($cstCandMilestones->CCMMilestonePaid->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)
$cstCandMilestones_list->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
if ($cstCandMilestones->ExportAll && $cstCandMilestones->Export <> "") {
	$cstCandMilestones_list->lStopRec = $cstCandMilestones_list->lTotalRecs;
} else {
	$cstCandMilestones_list->lStopRec = $cstCandMilestones_list->lStartRec + $cstCandMilestones_list->lDisplayRecs - 1; // Set the last record to display
}
$cstCandMilestones_list->lRecCount = $cstCandMilestones_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$bSelectLimit && $cstCandMilestones_list->lStartRec > 1)
		$rs->Move($cstCandMilestones_list->lStartRec - 1);
}

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

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

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

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

// Render list options (body, left)
$cstCandMilestones_list->ListOptions->Render("body", "left");
?>
	<?php if ($cstCandMilestones->FirstName->Visible) { // FirstName ?>
		<td<?php echo $cstCandMilestones->FirstName->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->FirstName->ViewAttributes() ?>><?php echo $cstCandMilestones->FirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->Surname->Visible) { // Surname ?>
		<td<?php echo $cstCandMilestones->Surname->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->Surname->ViewAttributes() ?>><?php echo $cstCandMilestones->Surname->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->MentorFirstName->Visible) { // MentorFirstName ?>
		<td<?php echo $cstCandMilestones->MentorFirstName->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->MentorFirstName->ViewAttributes() ?>><?php echo $cstCandMilestones->MentorFirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->MentorSurname->Visible) { // MentorSurname ?>
		<td<?php echo $cstCandMilestones->MentorSurname->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->MentorSurname->ViewAttributes() ?>><?php echo $cstCandMilestones->MentorSurname->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->EmployerFirstName->Visible) { // EmployerFirstName ?>
		<td<?php echo $cstCandMilestones->EmployerFirstName->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->EmployerFirstName->ViewAttributes() ?>><?php echo $cstCandMilestones->EmployerFirstName->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->EmployerSurname->Visible) { // EmployerSurname ?>
		<td<?php echo $cstCandMilestones->EmployerSurname->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->EmployerSurname->ViewAttributes() ?>><?php echo $cstCandMilestones->EmployerSurname->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->Organisation->Visible) { // Organisation ?>
		<td<?php echo $cstCandMilestones->Organisation->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->Organisation->ViewAttributes() ?>><?php echo $cstCandMilestones->Organisation->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->MilestoneNum->Visible) { // MilestoneNum ?>
		<td<?php echo $cstCandMilestones->MilestoneNum->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->MilestoneNum->ViewAttributes() ?>><?php echo $cstCandMilestones->MilestoneNum->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->Max28CCMMilestones2EDateUpdated29->Visible) { // Max(CCMMilestones.DateUpdated) ?>
		<td<?php echo $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewAttributes() ?>><?php echo $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($cstCandMilestones->CCMMilestonePaid->Visible) { // CCMMilestonePaid ?>
		<td<?php echo $cstCandMilestones->CCMMilestonePaid->CellAttributes() ?>>
<div<?php echo $cstCandMilestones->CCMMilestonePaid->ViewAttributes() ?>><?php echo $cstCandMilestones->CCMMilestonePaid->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php

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

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

//
// Page class
//
class ccstCandMilestones_list {

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

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

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

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

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

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

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

		// Table object (cstCandMilestones)
		$GLOBALS["cstCandMilestones"] = new ccstCandMilestones();

		// 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["cstCandMilestones"]->AddUrl();
		$this->InlineAddUrl = $this->PageUrl() . "a=add";
		$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
		$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
		$this->MultiDeleteUrl = "cstCandMilestonesdelete.php";
		$this->MultiUpdateUrl = "cstCandMilestonesupdate.php";

		// Table object (CCMUsers)
		$GLOBALS['CCMUsers'] = new cCCMUsers();

		// 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", 'cstCandMilestones', 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 $cstCandMilestones;

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

		// 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 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
			$cstCandMilestones->Recordset_SearchValidated();

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

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

		// Restore display records
		if ($cstCandMilestones->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $cstCandMilestones->getRecordsPerPage(); // Restore from Session
		} else {
			$this->lDisplayRecs = 20; // 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
		$cstCandMilestones->Recordset_Searching($this->sSrchWhere);

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

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

	// Advanced search WHERE clause based on QueryString
	function AdvancedSearchWhere() {
		global $Security, $cstCandMilestones;
		$sWhere = "";
		if (!$Security->CanSearch()) return "";
		$this->BuildSearchSql($sWhere, $cstCandMilestones->FirstName, FALSE); // FirstName
		$this->BuildSearchSql($sWhere, $cstCandMilestones->Surname, FALSE); // Surname
		$this->BuildSearchSql($sWhere, $cstCandMilestones->MentorFirstName, FALSE); // MentorFirstName
		$this->BuildSearchSql($sWhere, $cstCandMilestones->MentorSurname, FALSE); // MentorSurname
		$this->BuildSearchSql($sWhere, $cstCandMilestones->EmployerFirstName, FALSE); // EmployerFirstName
		$this->BuildSearchSql($sWhere, $cstCandMilestones->EmployerSurname, FALSE); // EmployerSurname
		$this->BuildSearchSql($sWhere, $cstCandMilestones->Organisation, FALSE); // Organisation
		$this->BuildSearchSql($sWhere, $cstCandMilestones->MilestoneNum, FALSE); // MilestoneNum
		$this->BuildSearchSql($sWhere, $cstCandMilestones->Max28CCMMilestones2EDateUpdated29, FALSE); // Max(CCMMilestones.DateUpdated)
		$this->BuildSearchSql($sWhere, $cstCandMilestones->CCMMilestonePaid, FALSE); // CCMMilestonePaid

		// Set up search parm
		if ($sWhere <> "") {
			$this->SetSearchParm($cstCandMilestones->FirstName); // FirstName
			$this->SetSearchParm($cstCandMilestones->Surname); // Surname
			$this->SetSearchParm($cstCandMilestones->MentorFirstName); // MentorFirstName
			$this->SetSearchParm($cstCandMilestones->MentorSurname); // MentorSurname
			$this->SetSearchParm($cstCandMilestones->EmployerFirstName); // EmployerFirstName
			$this->SetSearchParm($cstCandMilestones->EmployerSurname); // EmployerSurname
			$this->SetSearchParm($cstCandMilestones->Organisation); // Organisation
			$this->SetSearchParm($cstCandMilestones->MilestoneNum); // MilestoneNum
			$this->SetSearchParm($cstCandMilestones->Max28CCMMilestones2EDateUpdated29); // Max(CCMMilestones.DateUpdated)
			$this->SetSearchParm($cstCandMilestones->CCMMilestonePaid); // CCMMilestonePaid
		}
		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 $cstCandMilestones;
		$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);
		$cstCandMilestones->setAdvancedSearch("x_$FldParm", $FldVal);
		$cstCandMilestones->setAdvancedSearch("z_$FldParm", $Fld->AdvancedSearch->SearchOperator); // @$_GET["z_$FldParm"]
		$cstCandMilestones->setAdvancedSearch("v_$FldParm", $Fld->AdvancedSearch->SearchCondition); // @$_GET["v_$FldParm"]
		$cstCandMilestones->setAdvancedSearch("y_$FldParm", $FldVal2);
		$cstCandMilestones->setAdvancedSearch("w_$FldParm", $Fld->AdvancedSearch->SearchOperator2); // @$_GET["w_$FldParm"]
	}

	// Get search parameters
	function GetSearchParm(&$Fld) {
		global $cstCandMilestones;
		$FldParm = substr($Fld->FldVar, 2);
		$Fld->AdvancedSearch->SearchValue = $cstCandMilestones->GetAdvancedSearch("x_$FldParm");
		$Fld->AdvancedSearch->SearchOperator = $cstCandMilestones->GetAdvancedSearch("z_$FldParm");
		$Fld->AdvancedSearch->SearchCondition = $cstCandMilestones->GetAdvancedSearch("v_$FldParm");
		$Fld->AdvancedSearch->SearchValue2 = $cstCandMilestones->GetAdvancedSearch("y_$FldParm");
		$Fld->AdvancedSearch->SearchOperator2 = $cstCandMilestones->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;
	}

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

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

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

	// Clear all advanced search parameters
	function ResetAdvancedSearchParms() {
		global $cstCandMilestones;
		$cstCandMilestones->setAdvancedSearch("x_FirstName", "");
		$cstCandMilestones->setAdvancedSearch("x_Surname", "");
		$cstCandMilestones->setAdvancedSearch("x_MentorFirstName", "");
		$cstCandMilestones->setAdvancedSearch("x_MentorSurname", "");
		$cstCandMilestones->setAdvancedSearch("x_EmployerFirstName", "");
		$cstCandMilestones->setAdvancedSearch("x_EmployerSurname", "");
		$cstCandMilestones->setAdvancedSearch("x_Organisation", "");
		$cstCandMilestones->setAdvancedSearch("x_MilestoneNum", "");
		$cstCandMilestones->setAdvancedSearch("x_Max28CCMMilestones2EDateUpdated29", "");
		$cstCandMilestones->setAdvancedSearch("y_Max28CCMMilestones2EDateUpdated29", "");
		$cstCandMilestones->setAdvancedSearch("x_CCMMilestonePaid", "");
	}

	// Restore all search parameters
	function RestoreSearchParms() {
		global $cstCandMilestones;
		$bRestore = TRUE;
		if (@$_GET["x_FirstName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Surname"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorFirstName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MentorSurname"] <> "") $bRestore = FALSE;
		if (@$_GET["x_EmployerFirstName"] <> "") $bRestore = FALSE;
		if (@$_GET["x_EmployerSurname"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Organisation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_MilestoneNum"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Max28CCMMilestones2EDateUpdated29"] <> "") $bRestore = FALSE;
		if (@$_GET["y_Max28CCMMilestones2EDateUpdated29"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCMMilestonePaid"] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

			// Restore advanced search values
			$this->GetSearchParm($cstCandMilestones->FirstName);
			$this->GetSearchParm($cstCandMilestones->Surname);
			$this->GetSearchParm($cstCandMilestones->MentorFirstName);
			$this->GetSearchParm($cstCandMilestones->MentorSurname);
			$this->GetSearchParm($cstCandMilestones->EmployerFirstName);
			$this->GetSearchParm($cstCandMilestones->EmployerSurname);
			$this->GetSearchParm($cstCandMilestones->Organisation);
			$this->GetSearchParm($cstCandMilestones->MilestoneNum);
			$this->GetSearchParm($cstCandMilestones->Max28CCMMilestones2EDateUpdated29);
			$this->GetSearchParm($cstCandMilestones->CCMMilestonePaid);
		}
	}

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

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

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$cstCandMilestones->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$cstCandMilestones->CurrentOrderType = @$_GET["ordertype"];
			$cstCandMilestones->UpdateSort($cstCandMilestones->FirstName, $bCtrl); // FirstName
			$cstCandMilestones->UpdateSort($cstCandMilestones->Surname, $bCtrl); // Surname
			$cstCandMilestones->UpdateSort($cstCandMilestones->MentorFirstName, $bCtrl); // MentorFirstName
			$cstCandMilestones->UpdateSort($cstCandMilestones->MentorSurname, $bCtrl); // MentorSurname
			$cstCandMilestones->UpdateSort($cstCandMilestones->EmployerFirstName, $bCtrl); // EmployerFirstName
			$cstCandMilestones->UpdateSort($cstCandMilestones->EmployerSurname, $bCtrl); // EmployerSurname
			$cstCandMilestones->UpdateSort($cstCandMilestones->Organisation, $bCtrl); // Organisation
			$cstCandMilestones->UpdateSort($cstCandMilestones->MilestoneNum, $bCtrl); // MilestoneNum
			$cstCandMilestones->UpdateSort($cstCandMilestones->Max28CCMMilestones2EDateUpdated29, $bCtrl); // Max(CCMMilestones.DateUpdated)
			$cstCandMilestones->UpdateSort($cstCandMilestones->CCMMilestonePaid, $bCtrl); // CCMMilestonePaid
			$cstCandMilestones->setStartRecordNumber(1); // Reset start position
		}
	}

	// Load sort order parameters
	function LoadSortOrder() {
		global $cstCandMilestones;
		$sOrderBy = $cstCandMilestones->getSessionOrderBy(); // Get ORDER BY from Session
		if ($sOrderBy == "") {
			if ($cstCandMilestones->SqlOrderBy() <> "") {
				$sOrderBy = $cstCandMilestones->SqlOrderBy();
				$cstCandMilestones->setSessionOrderBy($sOrderBy);
				$cstCandMilestones->Organisation->setSort("ASC");
				$cstCandMilestones->Surname->setSort("ASC");
				$cstCandMilestones->FirstName->setSort("ASC");
				$cstCandMilestones->MilestoneNum->setSort("ASC");
			}
		}
	}

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

		// 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 = "";
				$cstCandMilestones->setSessionOrderBy($sOrderBy);
				$cstCandMilestones->FirstName->setSort("");
				$cstCandMilestones->Surname->setSort("");
				$cstCandMilestones->MentorFirstName->setSort("");
				$cstCandMilestones->MentorSurname->setSort("");
				$cstCandMilestones->EmployerFirstName->setSort("");
				$cstCandMilestones->EmployerSurname->setSort("");
				$cstCandMilestones->Organisation->setSort("");
				$cstCandMilestones->MilestoneNum->setSort("");
				$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->setSort("");
				$cstCandMilestones->CCMMilestonePaid->setSort("");
			}

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

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

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

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

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

		// "detail_CCMMilestones"
		$oListOpt =& $this->ListOptions->Items["detail_CCMMilestones"];
		if ($Security->AllowList('CCMMilestones')) {
			$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("CCMMilestones", "TblCaption");
			$oListOpt->Body = "<a href=\"CCMMilestoneslist.php?" . EW_TABLE_SHOW_MASTER . "=cstCandMilestones&CCMStudentID=" . urlencode(strval($cstCandMilestones->CCMStudentID->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";
		}
		$this->RenderListOptionsExt();

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

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

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

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

		// Load search values
		// FirstName

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

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

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

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

		// EmployerFirstName
		$cstCandMilestones->EmployerFirstName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EmployerFirstName"]);
		$cstCandMilestones->EmployerFirstName->AdvancedSearch->SearchOperator = @$_GET["z_EmployerFirstName"];

		// EmployerSurname
		$cstCandMilestones->EmployerSurname->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EmployerSurname"]);
		$cstCandMilestones->EmployerSurname->AdvancedSearch->SearchOperator = @$_GET["z_EmployerSurname"];

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

		// MilestoneNum
		$cstCandMilestones->MilestoneNum->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MilestoneNum"]);
		$cstCandMilestones->MilestoneNum->AdvancedSearch->SearchOperator = @$_GET["z_MilestoneNum"];

		// Max(CCMMilestones.DateUpdated)
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Max28CCMMilestones2EDateUpdated29"]);
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchOperator = @$_GET["z_Max28CCMMilestones2EDateUpdated29"];
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchCondition = @$_GET["v_Max28CCMMilestones2EDateUpdated29"];
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchValue2 = ew_StripSlashes(@$_GET["y_Max28CCMMilestones2EDateUpdated29"]);
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchOperator2 = @$_GET["w_Max28CCMMilestones2EDateUpdated29"];

		// CCMMilestonePaid
		$cstCandMilestones->CCMMilestonePaid->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCMMilestonePaid"]);
		$cstCandMilestones->CCMMilestonePaid->AdvancedSearch->SearchOperator = @$_GET["z_CCMMilestonePaid"];
	}

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $cstCandMilestones;
		$cstCandMilestones->CCMStudentID->setDbValue($rs->fields('CCMStudentID'));
		$cstCandMilestones->FirstName->setDbValue($rs->fields('FirstName'));
		$cstCandMilestones->Surname->setDbValue($rs->fields('Surname'));
		$cstCandMilestones->MentorFirstName->setDbValue($rs->fields('MentorFirstName'));
		$cstCandMilestones->MentorSurname->setDbValue($rs->fields('MentorSurname'));
		$cstCandMilestones->EmployerFirstName->setDbValue($rs->fields('EmployerFirstName'));
		$cstCandMilestones->EmployerSurname->setDbValue($rs->fields('EmployerSurname'));
		$cstCandMilestones->Organisation->setDbValue($rs->fields('Organisation'));
		$cstCandMilestones->MilestoneNum->setDbValue($rs->fields('MilestoneNum'));
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->setDbValue($rs->fields('Max(CCMMilestones.DateUpdated)'));
		$cstCandMilestones->CCMMilestonePaid->setDbValue($rs->fields('CCMMilestonePaid'));
	}

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

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

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

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

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

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

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

		// MentorSurname
		$cstCandMilestones->MentorSurname->CellCssStyle = ""; $cstCandMilestones->MentorSurname->CellCssClass = "";
		$cstCandMilestones->MentorSurname->CellAttrs = array(); $cstCandMilestones->MentorSurname->ViewAttrs = array(); $cstCandMilestones->MentorSurname->EditAttrs = array();

		// EmployerFirstName
		$cstCandMilestones->EmployerFirstName->CellCssStyle = ""; $cstCandMilestones->EmployerFirstName->CellCssClass = "";
		$cstCandMilestones->EmployerFirstName->CellAttrs = array(); $cstCandMilestones->EmployerFirstName->ViewAttrs = array(); $cstCandMilestones->EmployerFirstName->EditAttrs = array();

		// EmployerSurname
		$cstCandMilestones->EmployerSurname->CellCssStyle = ""; $cstCandMilestones->EmployerSurname->CellCssClass = "";
		$cstCandMilestones->EmployerSurname->CellAttrs = array(); $cstCandMilestones->EmployerSurname->ViewAttrs = array(); $cstCandMilestones->EmployerSurname->EditAttrs = array();

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

		// MilestoneNum
		$cstCandMilestones->MilestoneNum->CellCssStyle = ""; $cstCandMilestones->MilestoneNum->CellCssClass = "";
		$cstCandMilestones->MilestoneNum->CellAttrs = array(); $cstCandMilestones->MilestoneNum->ViewAttrs = array(); $cstCandMilestones->MilestoneNum->EditAttrs = array();

		// Max(CCMMilestones.DateUpdated)
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CellCssStyle = ""; $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CellCssClass = "";
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CellAttrs = array(); $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewAttrs = array(); $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->EditAttrs = array();

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

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

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

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

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

			// EmployerFirstName
			$cstCandMilestones->EmployerFirstName->ViewValue = $cstCandMilestones->EmployerFirstName->CurrentValue;
			$cstCandMilestones->EmployerFirstName->CssStyle = "";
			$cstCandMilestones->EmployerFirstName->CssClass = "";
			$cstCandMilestones->EmployerFirstName->ViewCustomAttributes = "";

			// EmployerSurname
			$cstCandMilestones->EmployerSurname->ViewValue = $cstCandMilestones->EmployerSurname->CurrentValue;
			$cstCandMilestones->EmployerSurname->CssStyle = "";
			$cstCandMilestones->EmployerSurname->CssClass = "";
			$cstCandMilestones->EmployerSurname->ViewCustomAttributes = "";

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

			// MilestoneNum
			$cstCandMilestones->MilestoneNum->ViewValue = $cstCandMilestones->MilestoneNum->CurrentValue;
			$cstCandMilestones->MilestoneNum->CssStyle = "";
			$cstCandMilestones->MilestoneNum->CssClass = "";
			$cstCandMilestones->MilestoneNum->ViewCustomAttributes = "";

			// Max(CCMMilestones.DateUpdated)
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewValue = $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CurrentValue;
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewValue = ew_FormatDateTime($cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewValue, 5);
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CssStyle = "";
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->CssClass = "";
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ViewCustomAttributes = "";

			// CCMMilestonePaid
			$cstCandMilestones->CCMMilestonePaid->ViewValue = $cstCandMilestones->CCMMilestonePaid->CurrentValue;
			$cstCandMilestones->CCMMilestonePaid->CssStyle = "";
			$cstCandMilestones->CCMMilestonePaid->CssClass = "";
			$cstCandMilestones->CCMMilestonePaid->ViewCustomAttributes = "";

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

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

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

			// MentorSurname
			$cstCandMilestones->MentorSurname->HrefValue = "";
			$cstCandMilestones->MentorSurname->TooltipValue = "";

			// EmployerFirstName
			$cstCandMilestones->EmployerFirstName->HrefValue = "";
			$cstCandMilestones->EmployerFirstName->TooltipValue = "";

			// EmployerSurname
			$cstCandMilestones->EmployerSurname->HrefValue = "";
			$cstCandMilestones->EmployerSurname->TooltipValue = "";

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

			// MilestoneNum
			$cstCandMilestones->MilestoneNum->HrefValue = "";
			$cstCandMilestones->MilestoneNum->TooltipValue = "";

			// Max(CCMMilestones.DateUpdated)
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->HrefValue = "";
			$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->TooltipValue = "";

			// CCMMilestonePaid
			$cstCandMilestones->CCMMilestonePaid->HrefValue = "";
			$cstCandMilestones->CCMMilestonePaid->TooltipValue = "";
		}

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

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

		// 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 $cstCandMilestones;
		$cstCandMilestones->FirstName->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_FirstName");
		$cstCandMilestones->Surname->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_Surname");
		$cstCandMilestones->MentorFirstName->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_MentorFirstName");
		$cstCandMilestones->MentorSurname->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_MentorSurname");
		$cstCandMilestones->EmployerFirstName->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_EmployerFirstName");
		$cstCandMilestones->EmployerSurname->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_EmployerSurname");
		$cstCandMilestones->Organisation->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_Organisation");
		$cstCandMilestones->MilestoneNum->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_MilestoneNum");
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_Max28CCMMilestones2EDateUpdated29");
		$cstCandMilestones->Max28CCMMilestones2EDateUpdated29->AdvancedSearch->SearchValue2 = $cstCandMilestones->getAdvancedSearch("y_Max28CCMMilestones2EDateUpdated29");
		$cstCandMilestones->CCMMilestonePaid->AdvancedSearch->SearchValue = $cstCandMilestones->getAdvancedSearch("x_CCMMilestonePaid");
	}

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

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

		// Export all
		if ($cstCandMilestones->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 ($cstCandMilestones->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($cstCandMilestones, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($cstCandMilestones->FirstName);
				$ExportDoc->ExportCaption($cstCandMilestones->Surname);
				$ExportDoc->ExportCaption($cstCandMilestones->MentorFirstName);
				$ExportDoc->ExportCaption($cstCandMilestones->MentorSurname);
				$ExportDoc->ExportCaption($cstCandMilestones->EmployerFirstName);
				$ExportDoc->ExportCaption($cstCandMilestones->EmployerSurname);
				$ExportDoc->ExportCaption($cstCandMilestones->Organisation);
				$ExportDoc->ExportCaption($cstCandMilestones->MilestoneNum);
				$ExportDoc->ExportCaption($cstCandMilestones->Max28CCMMilestones2EDateUpdated29);
				$ExportDoc->ExportCaption($cstCandMilestones->CCMMilestonePaid);
				$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
				$cstCandMilestones->CssClass = "";
				$cstCandMilestones->CssStyle = "";
				$cstCandMilestones->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($cstCandMilestones->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('FirstName', $cstCandMilestones->FirstName->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('Surname', $cstCandMilestones->Surname->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('MentorFirstName', $cstCandMilestones->MentorFirstName->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('MentorSurname', $cstCandMilestones->MentorSurname->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('EmployerFirstName', $cstCandMilestones->EmployerFirstName->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('EmployerSurname', $cstCandMilestones->EmployerSurname->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('Organisation', $cstCandMilestones->Organisation->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('MilestoneNum', $cstCandMilestones->MilestoneNum->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('Max28CCMMilestones2EDateUpdated29', $cstCandMilestones->Max28CCMMilestones2EDateUpdated29->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
					$XmlDoc->AddField('CCMMilestonePaid', $cstCandMilestones->CCMMilestonePaid->ExportValue($cstCandMilestones->Export, $cstCandMilestones->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($cstCandMilestones->FirstName);
					$ExportDoc->ExportField($cstCandMilestones->Surname);
					$ExportDoc->ExportField($cstCandMilestones->MentorFirstName);
					$ExportDoc->ExportField($cstCandMilestones->MentorSurname);
					$ExportDoc->ExportField($cstCandMilestones->EmployerFirstName);
					$ExportDoc->ExportField($cstCandMilestones->EmployerSurname);
					$ExportDoc->ExportField($cstCandMilestones->Organisation);
					$ExportDoc->ExportField($cstCandMilestones->MilestoneNum);
					$ExportDoc->ExportField($cstCandMilestones->Max28CCMMilestones2EDateUpdated29);
					$ExportDoc->ExportField($cstCandMilestones->CCMMilestonePaid);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($cstCandMilestones->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($cstCandMilestones->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

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

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

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

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

		// Build QueryString for search
		$this->AddSearchQueryString($sQry, $cstCandMilestones->FirstName); // FirstName
		$this->AddSearchQueryString($sQry, $cstCandMilestones->Surname); // Surname
		$this->AddSearchQueryString($sQry, $cstCandMilestones->MentorFirstName); // MentorFirstName
		$this->AddSearchQueryString($sQry, $cstCandMilestones->MentorSurname); // MentorSurname
		$this->AddSearchQueryString($sQry, $cstCandMilestones->EmployerFirstName); // EmployerFirstName
		$this->AddSearchQueryString($sQry, $cstCandMilestones->EmployerSurname); // EmployerSurname
		$this->AddSearchQueryString($sQry, $cstCandMilestones->Organisation); // Organisation
		$this->AddSearchQueryString($sQry, $cstCandMilestones->MilestoneNum); // MilestoneNum
		$this->AddSearchQueryString($sQry, $cstCandMilestones->Max28CCMMilestones2EDateUpdated29); // Max(CCMMilestones.DateUpdated)
		$this->AddSearchQueryString($sQry, $cstCandMilestones->CCMMilestonePaid); // CCMMilestonePaid

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

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

	}
}
?>