Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/echasl23/
Upload File :
Current File : /var/www/cesa.co.za/echasl23/CCEStudentsdelete.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 "CCEStudentsinfo.php" ?>
<?php include "adminusersinfo.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
$CCEStudents_delete = new cCCEStudents_delete();
$Page =& $CCEStudents_delete;

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

// Page main
$CCEStudents_delete->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--

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

// page properties
CCEStudents_delete.PageID = "delete"; // page ID
CCEStudents_delete.FormID = "fCCEStudentsdelete"; // form ID
var EW_PAGE_ID = CCEStudents_delete.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
CCEStudents_delete.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) { ?>
CCEStudents_delete.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEStudents_delete.ValidateRequired = false; // no JavaScript validation
<?php } ?>

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

// Load records for display
if ($rs = $CCEStudents_delete->LoadRecordset())
	$CCEStudents_deletelTotalRecs = $rs->RecordCount(); // Get record count
if ($CCEStudents_deletelTotalRecs <= 0) { // No record found, exit
	if ($rs)
		$rs->Close();
	$CCEStudents_delete->Page_Terminate("CCEStudentslist.php"); // Return to list
}
?>
<p><span class="phpmaker"><?php echo $Language->Phrase("Delete") ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCEStudents->TableCaption() ?><br><br>
<a href="<?php echo $CCEStudents->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$CCEStudents_delete->ShowMessage();
?>
<form action="<?php echo ew_CurrentPage() ?>" method="post">
<p>
<input type="hidden" name="t" id="t" value="CCEStudents">
<input type="hidden" name="a_delete" id="a_delete" value="D">
<?php foreach ($CCEStudents_delete->arRecKeys as $key) { ?>
<input type="hidden" name="key_m[]" id="key_m[]" value="<?php echo ew_HtmlEncode($key) ?>">
<?php } ?>
<table class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable ewTableSeparate">
<?php echo $CCEStudents->TableCustomInnerHtml ?>
	<thead>
	<tr class="ewTableHeader">
		<td valign="top"><?php echo $CCEStudents->KnownAs->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->FirstName->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->Surname->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->Organisation->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->StudentNumber->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->OtherStatutoryBodyCategory->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->Age->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->Cellphone->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->EmailAddress->FldCaption() ?></td>
		<td valign="top"><?php echo $CCEStudents->BlockAccess->FldCaption() ?></td>
	</tr>
	</thead>
	<tbody>
<?php
$CCEStudents_delete->lRecCnt = 0;
$i = 0;
while (!$rs->EOF) {
	$CCEStudents_delete->lRecCnt++;

	// Set row properties
	$CCEStudents->CssClass = "";
	$CCEStudents->CssStyle = "";
	$CCEStudents->RowAttrs = array();
	$CCEStudents->RowType = EW_ROWTYPE_VIEW; // View

	// Get the field contents
	$CCEStudents_delete->LoadRowValues($rs);

	// Render row
	$CCEStudents_delete->RenderRow();
?>
	<tr<?php echo $CCEStudents->RowAttributes() ?>>
		<td<?php echo $CCEStudents->KnownAs->CellAttributes() ?>>
<div<?php echo $CCEStudents->KnownAs->ViewAttributes() ?>><?php echo $CCEStudents->KnownAs->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->FirstName->CellAttributes() ?>>
<div<?php echo $CCEStudents->FirstName->ViewAttributes() ?>><?php echo $CCEStudents->FirstName->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->Surname->CellAttributes() ?>>
<div<?php echo $CCEStudents->Surname->ViewAttributes() ?>><?php echo $CCEStudents->Surname->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->Organisation->CellAttributes() ?>>
<div<?php echo $CCEStudents->Organisation->ViewAttributes() ?>><?php echo $CCEStudents->Organisation->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->StudentNumber->CellAttributes() ?>>
<div<?php echo $CCEStudents->StudentNumber->ViewAttributes() ?>><?php echo $CCEStudents->StudentNumber->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->OtherStatutoryBodyCategory->CellAttributes() ?>>
<div<?php echo $CCEStudents->OtherStatutoryBodyCategory->ViewAttributes() ?>><?php echo $CCEStudents->OtherStatutoryBodyCategory->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->Age->CellAttributes() ?>>
<div<?php echo $CCEStudents->Age->ViewAttributes() ?>><?php echo $CCEStudents->Age->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->Cellphone->CellAttributes() ?>>
<div<?php echo $CCEStudents->Cellphone->ViewAttributes() ?>><?php echo $CCEStudents->Cellphone->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->EmailAddress->CellAttributes() ?>>
<div<?php echo $CCEStudents->EmailAddress->ViewAttributes() ?>><?php echo $CCEStudents->EmailAddress->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudents->BlockAccess->CellAttributes() ?>>
<div<?php echo $CCEStudents->BlockAccess->ViewAttributes() ?>><?php echo $CCEStudents->BlockAccess->ListViewValue() ?></div></td>
	</tr>
<?php
	$rs->MoveNext();
}
$rs->Close();
?>
</tbody>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="Action" id="Action" value="<?php echo ew_BtnCaption($Language->Phrase("DeleteBtn")) ?>">
</form>
<script language="JavaScript" type="text/javascript">
<!--

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

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

//
// Page class
//
class cCCEStudents_delete {

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

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

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

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

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

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

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

		// Table object (CCEStudents)
		$GLOBALS["CCEStudents"] = new cCCEStudents();

		// Table object (adminusers)
		$GLOBALS['adminusers'] = new cadminusers();

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

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

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

		// Open connection
		$conn = ew_Connect();
	}

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

		// User profile
		$UserProfile = new cUserProfile();
		$UserProfile->LoadProfile(@$_SESSION[EW_SESSION_USER_PROFILE]);

		// Security
		$Security = new cAdvancedSecurity();
		if (IsPasswordExpired())
			$this->Page_Terminate("changepwd.php");
		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->CanDelete()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("CCEStudentslist.php");
		}
		$Security->UserID_Loading();
		if ($Security->IsLoggedIn()) $Security->LoadUserID();
		$Security->UserID_Loaded();

		// 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();
	}
	var $lTotalRecs = 0;
	var $lRecCnt;
	var $arRecKeys = array();

	//
	// Page main
	//
	function Page_Main() {
		global $Language, $CCEStudents;

		// Load key parameters
		$sKey = "";
		$bSingleDelete = TRUE; // Initialize as single delete
		$nKeySelected = 0; // Initialize selected key count
		$sFilter = "";
		if (@$_GET["CCEStudentID"] <> "") {
			$CCEStudents->CCEStudentID->setQueryStringValue($_GET["CCEStudentID"]);
			if (!is_numeric($CCEStudents->CCEStudentID->QueryStringValue))
				$this->Page_Terminate("CCEStudentslist.php"); // Prevent SQL injection, exit
			$sKey .= $CCEStudents->CCEStudentID->QueryStringValue;
		} else {
			$bSingleDelete = FALSE;
		}
		if ($bSingleDelete) {
			$nKeySelected = 1; // Set up key selected count
			$this->arRecKeys[0] = $sKey;
		} else {
			if (isset($_POST["key_m"])) { // Key in form
				$nKeySelected = count($_POST["key_m"]); // Set up key selected count
				$this->arRecKeys = ew_StripSlashes($_POST["key_m"]);
			}
		}
		if ($nKeySelected <= 0)
			$this->Page_Terminate("CCEStudentslist.php"); // No key specified, return to list

		// Build filter
		foreach ($this->arRecKeys as $sKey) {
			$sFilter .= "(";

			// Set up key field
			$sKeyFld = $sKey;
			if (!is_numeric($sKeyFld))
				$this->Page_Terminate("CCEStudentslist.php"); // Prevent SQL injection, return to list
			$sFilter .= "`CCEStudentID`=" . ew_AdjustSql($sKeyFld) . " AND ";
			if (substr($sFilter, -5) == " AND ") $sFilter = substr($sFilter, 0, strlen($sFilter)-5) . ") OR ";
		}
		if (substr($sFilter, -4) == " OR ") $sFilter = substr($sFilter, 0, strlen($sFilter)-4);

		// Set up filter (SQL WHHERE clause) and get return SQL
		// SQL constructor in CCEStudents class, CCEStudentsinfo.php

		$CCEStudents->CurrentFilter = $sFilter;

		// Get action
		if (@$_POST["a_delete"] <> "") {
			$CCEStudents->CurrentAction = $_POST["a_delete"];
		} else {
			$CCEStudents->CurrentAction = "I"; // Display record
		}
		switch ($CCEStudents->CurrentAction) {
			case "D": // Delete
				$CCEStudents->SendEmail = TRUE; // Send email on delete success
				if ($this->DeleteRows()) { // delete rows
					$this->setMessage($Language->Phrase("DeleteSuccess")); // Set up success message
					$this->Page_Terminate($CCEStudents->getReturnUrl()); // Return to caller
				}
		}
	}

	//
	// Delete records based on current filter
	//
	function DeleteRows() {
		global $conn, $Language, $Security, $CCEStudents;
		$DeleteRows = TRUE;
		$sWrkFilter = $CCEStudents->CurrentFilter;

		// Set up filter (SQL WHERE clause) and get return SQL
		// SQL constructor in CCEStudents class, CCEStudentsinfo.php

		$CCEStudents->CurrentFilter = $sWrkFilter;
		$sSql = $CCEStudents->SQL();
		$conn->raiseErrorFn = 'ew_ErrorFn';
		$rs = $conn->Execute($sSql);
		$conn->raiseErrorFn = '';
		if ($rs === FALSE) {
			return FALSE;
		} elseif ($rs->EOF) {
			$this->setMessage($Language->Phrase("NoRecord")); // No record found
			$rs->Close();
			return FALSE;
		}
		$conn->BeginTrans();

		// Clone old rows
		$rsold = ($rs) ? $rs->GetRows() : array();
		if ($rs)
			$rs->Close();

		// Call row deleting event
		if ($DeleteRows) {
			foreach ($rsold as $row) {
				$DeleteRows = $CCEStudents->Row_Deleting($row);
				if (!$DeleteRows) break;
			}
		}
		if ($DeleteRows) {
			$sKey = "";
			foreach ($rsold as $row) {
				$sThisKey = "";
				if ($sThisKey <> "") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;
				$sThisKey .= $row['CCEStudentID'];
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->CVFile->UploadPath) . $row['CVFile']);
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->Trimester1Report->UploadPath) . $row['Trimester1Report']);
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->Trimester2Report->UploadPath) . $row['Trimester2Report']);
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->Trimester3Report->UploadPath) . $row['Trimester3Report']);
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->ExamResultLetter->UploadPath) . $row['ExamResultLetter']);
				@unlink(ew_UploadPathEx(TRUE, $CCEStudents->SupplementalExamLetter->UploadPath) . $row['SupplementalExamLetter']);
				$conn->raiseErrorFn = 'ew_ErrorFn';
				$DeleteRows = $conn->Execute($CCEStudents->DeleteSQL($row)); // Delete
				$conn->raiseErrorFn = '';
				if ($DeleteRows === FALSE)
					break;
				if ($sKey <> "") $sKey .= ", ";
				$sKey .= $sThisKey;
			}
		} else {

			// Set up error message
			if ($CCEStudents->CancelMessage <> "") {
				$this->setMessage($CCEStudents->CancelMessage);
				$CCEStudents->CancelMessage = "";
			} else {
				$this->setMessage($Language->Phrase("DeleteCancelled"));
			}
		}
		if ($DeleteRows) {
			$conn->CommitTrans(); // Commit the changes
		} else {
			$conn->RollbackTrans(); // Rollback changes
		}

		// Call Row Deleted event
		if ($DeleteRows) {
			foreach ($rsold as $row) {
				$CCEStudents->Row_Deleted($row);
			}	
		}
		return $DeleteRows;
	}

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $CCEStudents;
		$CCEStudents->CCEStudentID->setDbValue($rs->fields('CCEStudentID'));
		$CCEStudents->KnownAs->setDbValue($rs->fields('KnownAs'));
		$CCEStudents->FirstName->setDbValue($rs->fields('FirstName'));
		$CCEStudents->Surname->setDbValue($rs->fields('Surname'));
		$CCEStudents->Organisation->setDbValue($rs->fields('Organisation'));
		$CCEStudents->OrganisationType->setDbValue($rs->fields('OrganisationType'));
		$CCEStudents->Designation->setDbValue($rs->fields('Designation'));
		$CCEStudents->Department->setDbValue($rs->fields('Department'));
		$CCEStudents->StudentNumber->setDbValue($rs->fields('StudentNumber'));
		$CCEStudents->CCEFacilitatorID->setDbValue($rs->fields('CCEFacilitatorID'));
		$CCEStudents->Project->setDbValue($rs->fields('Project'));
		$CCEStudents->ProjectDiscipline->setDbValue($rs->fields('ProjectDiscipline'));
		$CCEStudents->ProjectCode->setDbValue($rs->fields('ProjectCode'));
		$CCEStudents->IDNumber->setDbValue($rs->fields('IDNumber'));
		$CCEStudents->ECSARegistered->setDbValue($rs->fields('ECSARegistered'));
		$CCEStudents->ECSACategory->setDbValue($rs->fields('ECSACategory'));
		$CCEStudents->ECSANumber->setDbValue($rs->fields('ECSANumber'));
		$CCEStudents->OtherStatutoryBodyRegistered->setDbValue($rs->fields('OtherStatutoryBodyRegistered'));
		$CCEStudents->OtherStatutoryBodyName->setDbValue($rs->fields('OtherStatutoryBodyName'));
		$CCEStudents->OtherStatutoryBodyNumber->setDbValue($rs->fields('OtherStatutoryBodyNumber'));
		$CCEStudents->OtherStatutoryBodyCategory->setDbValue($rs->fields('OtherStatutoryBodyCategory'));
		$CCEStudents->CESAMemberFirm->setDbValue($rs->fields('CESAMemberFirm'));
		$CCEStudents->OtherCEFirms->setDbValue($rs->fields('OtherCEFirms'));
		$CCEStudents->Age->setDbValue($rs->fields('Age'));
		$CCEStudents->HighestQual->setDbValue($rs->fields('HighestQual'));
		$CCEStudents->AreaDiscipline->setDbValue($rs->fields('AreaDiscipline'));
		$CCEStudents->Telephone->setDbValue($rs->fields('Telephone'));
		$CCEStudents->Cellphone->setDbValue($rs->fields('Cellphone'));
		$CCEStudents->EmailAddress->setDbValue($rs->fields('EmailAddress'));
		$CCEStudents->EmailAddress2->setDbValue($rs->fields('EmailAddress2'));
		$CCEStudents->HomeAddress->setDbValue($rs->fields('HomeAddress'));
		$CCEStudents->WorkAddress->setDbValue($rs->fields('WorkAddress'));
		$CCEStudents->PostalAddress->setDbValue($rs->fields('PostalAddress'));
		$CCEStudents->CESAAccountNo->setDbValue($rs->fields('CESAAccountNo'));
		$CCEStudents->VATNo->setDbValue($rs->fields('VATNo'));
		$CCEStudents->DietaryRequirements->setDbValue($rs->fields('DietaryRequirements'));
		$CCEStudents->OrderNo->setDbValue($rs->fields('OrderNo'));
		$CCEStudents->BookedByName->setDbValue($rs->fields('BookedByName'));
		$CCEStudents->BookedByDesignation->setDbValue($rs->fields('BookedByDesignation'));
		$CCEStudents->BookedByTelNo->setDbValue($rs->fields('BookedByTelNo'));
		$CCEStudents->BookedByFaxNo->setDbValue($rs->fields('BookedByFaxNo'));
		$CCEStudents->BookedByCellNo->setDbValue($rs->fields('BookedByCellNo'));
		$CCEStudents->BookedByEmail->setDbValue($rs->fields('BookedByEmail'));
		$CCEStudents->WebUsername->setDbValue($rs->fields('WebUsername'));
		$CCEStudents->WebPassword->setDbValue($rs->fields('WebPassword'));
		$CCEStudents->MentorFirstName->setDbValue($rs->fields('MentorFirstName'));
		$CCEStudents->MentorSurname->setDbValue($rs->fields('MentorSurname'));
		$CCEStudents->MentorCompany->setDbValue($rs->fields('MentorCompany'));
		$CCEStudents->MentorDesig->setDbValue($rs->fields('MentorDesig'));
		$CCEStudents->MentorTel->setDbValue($rs->fields('MentorTel'));
		$CCEStudents->MentorCell->setDbValue($rs->fields('MentorCell'));
		$CCEStudents->MentorEmail->setDbValue($rs->fields('MentorEmail'));
		$CCEStudents->HRManagerName->setDbValue($rs->fields('HRManagerName'));
		$CCEStudents->HRManagerDesignation->setDbValue($rs->fields('HRManagerDesignation'));
		$CCEStudents->HRManagerTelNo->setDbValue($rs->fields('HRManagerTelNo'));
		$CCEStudents->HRManagerCellNo->setDbValue($rs->fields('HRManagerCellNo'));
		$CCEStudents->HRManagerEmail->setDbValue($rs->fields('HRManagerEmail'));
		$CCEStudents->LengthEmploy->setDbValue($rs->fields('LengthEmploy'));
		$CCEStudents->ResponsiblePayment->setDbValue($rs->fields('ResponsiblePayment'));
		$CCEStudents->BlockAccess->setDbValue($rs->fields('BlockAccess'));
		$CCEStudents->Accepted->setDbValue($rs->fields('Accepted'));
		$CCEStudents->Archived->setDbValue($rs->fields('Archived'));
		$CCEStudents->Achieved->setDbValue($rs->fields('Achieved'));
		$CCEStudents->ReasonForLeaving->setDbValue($rs->fields('ReasonForLeaving'));
		$CCEStudents->ReasonNotAccepted->setDbValue($rs->fields('ReasonNotAccepted'));
		$CCEStudents->ResultComments->setDbValue($rs->fields('ResultComments'));
		$CCEStudents->ResultStatus->setDbValue($rs->fields('ResultStatus'));
		$CCEStudents->Cancelled->setDbValue($rs->fields('Cancelled'));
		$CCEStudents->CancelledReason->setDbValue($rs->fields('CancelledReason'));
		$CCEStudents->CVFile->Upload->DbValue = $rs->fields('CVFile');
		$CCEStudents->Title->setDbValue($rs->fields('Title'));
		$CCEStudents->QualCertificate1->setDbValue($rs->fields('QualCertificate1'));
		$CCEStudents->QualCertificate2->setDbValue($rs->fields('QualCertificate2'));
		$CCEStudents->QualCertificate3->setDbValue($rs->fields('QualCertificate3'));
		$CCEStudents->MemorandumFile->setDbValue($rs->fields('MemorandumFile'));
		$CCEStudents->AgreementFile->setDbValue($rs->fields('AgreementFile'));
		$CCEStudents->ResultLetter->setDbValue($rs->fields('ResultLetter'));
		$CCEStudents->IDFile->setDbValue($rs->fields('IDFile'));
		$CCEStudents->PhotoFile->setDbValue($rs->fields('PhotoFile'));
		$CCEStudents->SABTACOMemberFirm->setDbValue($rs->fields('SABTACOMemberFirm'));
		$CCEStudents->PreferredCourierAddress->setDbValue($rs->fields('PreferredCourierAddress'));
		$CCEStudents->MotivationalLetter->setDbValue($rs->fields('MotivationalLetter'));
		$CCEStudents->MentorName->setDbValue($rs->fields('MentorName'));
		$CCEStudents->ModulesEnrolled->setDbValue($rs->fields('ModulesEnrolled'));
		$CCEStudents->Trimester1Report->Upload->DbValue = $rs->fields('Trimester1Report');
		$CCEStudents->Trimester2Report->Upload->DbValue = $rs->fields('Trimester2Report');
		$CCEStudents->Trimester3Report->Upload->DbValue = $rs->fields('Trimester3Report');
		$CCEStudents->ExamResultLetter->Upload->DbValue = $rs->fields('ExamResultLetter');
		$CCEStudents->SupplementalExamLetter->Upload->DbValue = $rs->fields('SupplementalExamLetter');
	}

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

		// Initialize URLs
		// Call Row_Rendering event

		$CCEStudents->Row_Rendering();

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

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

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

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

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

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

		// OtherStatutoryBodyCategory
		$CCEStudents->OtherStatutoryBodyCategory->CellCssStyle = ""; $CCEStudents->OtherStatutoryBodyCategory->CellCssClass = "";
		$CCEStudents->OtherStatutoryBodyCategory->CellAttrs = array(); $CCEStudents->OtherStatutoryBodyCategory->ViewAttrs = array(); $CCEStudents->OtherStatutoryBodyCategory->EditAttrs = array();

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

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

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

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

			// CCEStudentID
			$CCEStudents->CCEStudentID->ViewValue = $CCEStudents->CCEStudentID->CurrentValue;
			$CCEStudents->CCEStudentID->CssStyle = "";
			$CCEStudents->CCEStudentID->CssClass = "";
			$CCEStudents->CCEStudentID->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

			// CCEFacilitatorID
			$CCEStudents->CCEFacilitatorID->ViewValue = $CCEStudents->CCEFacilitatorID->CurrentValue;
			if (strval($CCEStudents->CCEFacilitatorID->CurrentValue) <> "") {
				$sFilterWrk = "`FacilitatorID` = " . ew_AdjustSql($CCEStudents->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` Asc";
				$rswrk = $conn->Execute($sSqlWrk);
				if ($rswrk && !$rswrk->EOF) { // Lookup values found
					$CCEStudents->CCEFacilitatorID->ViewValue = $rswrk->fields('FacilitatorName');
					$rswrk->Close();
				} else {
					$CCEStudents->CCEFacilitatorID->ViewValue = $CCEStudents->CCEFacilitatorID->CurrentValue;
				}
			} else {
				$CCEStudents->CCEFacilitatorID->ViewValue = NULL;
			}
			$CCEStudents->CCEFacilitatorID->CssStyle = "";
			$CCEStudents->CCEFacilitatorID->CssClass = "";
			$CCEStudents->CCEFacilitatorID->ViewCustomAttributes = "";

			// Project
			$CCEStudents->Project->ViewValue = $CCEStudents->Project->CurrentValue;
			if (strval($CCEStudents->Project->CurrentValue) <> "") {
				$sFilterWrk = "`CCEProjectID` = " . ew_AdjustSql($CCEStudents->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` Asc";
				$rswrk = $conn->Execute($sSqlWrk);
				if ($rswrk && !$rswrk->EOF) { // Lookup values found
					$CCEStudents->Project->ViewValue = $rswrk->fields('Project');
					$rswrk->Close();
				} else {
					$CCEStudents->Project->ViewValue = $CCEStudents->Project->CurrentValue;
				}
			} else {
				$CCEStudents->Project->ViewValue = NULL;
			}
			$CCEStudents->Project->CssStyle = "";
			$CCEStudents->Project->CssClass = "";
			$CCEStudents->Project->ViewCustomAttributes = "";

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

			// ProjectCode
			$CCEStudents->ProjectCode->ViewValue = $CCEStudents->ProjectCode->CurrentValue;
			$CCEStudents->ProjectCode->CssStyle = "";
			$CCEStudents->ProjectCode->CssClass = "";
			$CCEStudents->ProjectCode->ViewCustomAttributes = "";

			// IDNumber
			$CCEStudents->IDNumber->ViewValue = $CCEStudents->IDNumber->CurrentValue;
			$CCEStudents->IDNumber->CssStyle = "";
			$CCEStudents->IDNumber->CssClass = "";
			$CCEStudents->IDNumber->ViewCustomAttributes = "";

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

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

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

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

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

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

			// OtherStatutoryBodyCategory
			$CCEStudents->OtherStatutoryBodyCategory->ViewValue = $CCEStudents->OtherStatutoryBodyCategory->CurrentValue;
			$CCEStudents->OtherStatutoryBodyCategory->CssStyle = "";
			$CCEStudents->OtherStatutoryBodyCategory->CssClass = "";
			$CCEStudents->OtherStatutoryBodyCategory->ViewCustomAttributes = "";

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

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

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

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

			// Telephone
			$CCEStudents->Telephone->ViewValue = $CCEStudents->Telephone->CurrentValue;
			$CCEStudents->Telephone->CssStyle = "";
			$CCEStudents->Telephone->CssClass = "";
			$CCEStudents->Telephone->ViewCustomAttributes = "";

			// Cellphone
			$CCEStudents->Cellphone->ViewValue = $CCEStudents->Cellphone->CurrentValue;
			$CCEStudents->Cellphone->CssStyle = "";
			$CCEStudents->Cellphone->CssClass = "";
			$CCEStudents->Cellphone->ViewCustomAttributes = "";

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

			// EmailAddress2
			$CCEStudents->EmailAddress2->ViewValue = $CCEStudents->EmailAddress2->CurrentValue;
			$CCEStudents->EmailAddress2->CssStyle = "";
			$CCEStudents->EmailAddress2->CssClass = "";
			$CCEStudents->EmailAddress2->ViewCustomAttributes = "";

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

			// VATNo
			$CCEStudents->VATNo->ViewValue = $CCEStudents->VATNo->CurrentValue;
			$CCEStudents->VATNo->CssStyle = "";
			$CCEStudents->VATNo->CssClass = "";
			$CCEStudents->VATNo->ViewCustomAttributes = "";

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

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

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

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

			// BookedByTelNo
			$CCEStudents->BookedByTelNo->ViewValue = $CCEStudents->BookedByTelNo->CurrentValue;
			$CCEStudents->BookedByTelNo->CssStyle = "";
			$CCEStudents->BookedByTelNo->CssClass = "";
			$CCEStudents->BookedByTelNo->ViewCustomAttributes = "";

			// BookedByFaxNo
			$CCEStudents->BookedByFaxNo->ViewValue = $CCEStudents->BookedByFaxNo->CurrentValue;
			$CCEStudents->BookedByFaxNo->CssStyle = "";
			$CCEStudents->BookedByFaxNo->CssClass = "";
			$CCEStudents->BookedByFaxNo->ViewCustomAttributes = "";

			// BookedByCellNo
			$CCEStudents->BookedByCellNo->ViewValue = $CCEStudents->BookedByCellNo->CurrentValue;
			$CCEStudents->BookedByCellNo->CssStyle = "";
			$CCEStudents->BookedByCellNo->CssClass = "";
			$CCEStudents->BookedByCellNo->ViewCustomAttributes = "";

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

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

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

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

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

			// MentorCompany
			$CCEStudents->MentorCompany->ViewValue = $CCEStudents->MentorCompany->CurrentValue;
			$CCEStudents->MentorCompany->CssStyle = "";
			$CCEStudents->MentorCompany->CssClass = "";
			$CCEStudents->MentorCompany->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

			// ResponsiblePayment
			$CCEStudents->ResponsiblePayment->ViewValue = $CCEStudents->ResponsiblePayment->CurrentValue;
			$CCEStudents->ResponsiblePayment->CssStyle = "";
			$CCEStudents->ResponsiblePayment->CssClass = "";
			$CCEStudents->ResponsiblePayment->ViewCustomAttributes = "";

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

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

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

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

			// ResultStatus
			if (strval($CCEStudents->ResultStatus->CurrentValue) <> "") {
				switch ($CCEStudents->ResultStatus->CurrentValue) {
					case "":
						$CCEStudents->ResultStatus->ViewValue = "No Result Yet";
						break;
					case "P":
						$CCEStudents->ResultStatus->ViewValue = "Passed";
						break;
					case "S":
						$CCEStudents->ResultStatus->ViewValue = "Pending Supplementary Exams";
						break;
					default:
						$CCEStudents->ResultStatus->ViewValue = $CCEStudents->ResultStatus->CurrentValue;
				}
			} else {
				$CCEStudents->ResultStatus->ViewValue = NULL;
			}
			$CCEStudents->ResultStatus->CssStyle = "";
			$CCEStudents->ResultStatus->CssClass = "";
			$CCEStudents->ResultStatus->ViewCustomAttributes = "";

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

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

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

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

			// QualCertificate1
			$CCEStudents->QualCertificate1->ViewValue = $CCEStudents->QualCertificate1->CurrentValue;
			$CCEStudents->QualCertificate1->CssStyle = "";
			$CCEStudents->QualCertificate1->CssClass = "";
			$CCEStudents->QualCertificate1->ViewCustomAttributes = "";

			// QualCertificate2
			$CCEStudents->QualCertificate2->ViewValue = $CCEStudents->QualCertificate2->CurrentValue;
			$CCEStudents->QualCertificate2->CssStyle = "";
			$CCEStudents->QualCertificate2->CssClass = "";
			$CCEStudents->QualCertificate2->ViewCustomAttributes = "";

			// QualCertificate3
			$CCEStudents->QualCertificate3->ViewValue = $CCEStudents->QualCertificate3->CurrentValue;
			$CCEStudents->QualCertificate3->CssStyle = "";
			$CCEStudents->QualCertificate3->CssClass = "";
			$CCEStudents->QualCertificate3->ViewCustomAttributes = "";

			// MemorandumFile
			$CCEStudents->MemorandumFile->ViewValue = $CCEStudents->MemorandumFile->CurrentValue;
			$CCEStudents->MemorandumFile->CssStyle = "";
			$CCEStudents->MemorandumFile->CssClass = "";
			$CCEStudents->MemorandumFile->ViewCustomAttributes = "";

			// AgreementFile
			$CCEStudents->AgreementFile->ViewValue = $CCEStudents->AgreementFile->CurrentValue;
			$CCEStudents->AgreementFile->CssStyle = "";
			$CCEStudents->AgreementFile->CssClass = "";
			$CCEStudents->AgreementFile->ViewCustomAttributes = "";

			// ResultLetter
			$CCEStudents->ResultLetter->ViewValue = $CCEStudents->ResultLetter->CurrentValue;
			$CCEStudents->ResultLetter->CssStyle = "";
			$CCEStudents->ResultLetter->CssClass = "";
			$CCEStudents->ResultLetter->ViewCustomAttributes = "";

			// IDFile
			$CCEStudents->IDFile->ViewValue = $CCEStudents->IDFile->CurrentValue;
			$CCEStudents->IDFile->CssStyle = "";
			$CCEStudents->IDFile->CssClass = "";
			$CCEStudents->IDFile->ViewCustomAttributes = "";

			// PhotoFile
			$CCEStudents->PhotoFile->ViewValue = $CCEStudents->PhotoFile->CurrentValue;
			$CCEStudents->PhotoFile->CssStyle = "";
			$CCEStudents->PhotoFile->CssClass = "";
			$CCEStudents->PhotoFile->ViewCustomAttributes = "";

			// SABTACOMemberFirm
			$CCEStudents->SABTACOMemberFirm->ViewValue = $CCEStudents->SABTACOMemberFirm->CurrentValue;
			$CCEStudents->SABTACOMemberFirm->CssStyle = "";
			$CCEStudents->SABTACOMemberFirm->CssClass = "";
			$CCEStudents->SABTACOMemberFirm->ViewCustomAttributes = "";

			// PreferredCourierAddress
			$CCEStudents->PreferredCourierAddress->ViewValue = $CCEStudents->PreferredCourierAddress->CurrentValue;
			$CCEStudents->PreferredCourierAddress->CssStyle = "";
			$CCEStudents->PreferredCourierAddress->CssClass = "";
			$CCEStudents->PreferredCourierAddress->ViewCustomAttributes = "";

			// MotivationalLetter
			$CCEStudents->MotivationalLetter->ViewValue = $CCEStudents->MotivationalLetter->CurrentValue;
			$CCEStudents->MotivationalLetter->CssStyle = "";
			$CCEStudents->MotivationalLetter->CssClass = "";
			$CCEStudents->MotivationalLetter->ViewCustomAttributes = "";

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

			// ModulesEnrolled
			$CCEStudents->ModulesEnrolled->ViewValue = $CCEStudents->ModulesEnrolled->CurrentValue;
			$CCEStudents->ModulesEnrolled->CssStyle = "";
			$CCEStudents->ModulesEnrolled->CssClass = "";
			$CCEStudents->ModulesEnrolled->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

			// OtherStatutoryBodyCategory
			$CCEStudents->OtherStatutoryBodyCategory->HrefValue = "";
			$CCEStudents->OtherStatutoryBodyCategory->TooltipValue = "";

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

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

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

			// BlockAccess
			$CCEStudents->BlockAccess->HrefValue = "";
			$CCEStudents->BlockAccess->TooltipValue = "";
		}

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

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

	}
}
?>