Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceconvenors/
Upload File :
Current File : /var/www/cesa.co.za/cceconvenors/CCEStudentActivitiesview.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 "CCEStudentActivitiesinfo.php" ?>
<?php include "CCEAssignmentsinfo.php" ?>
<?php include "CCEStudentsinfo.php" ?>
<?php include "CCEFacilitatorUsersinfo.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
$CCEStudentActivities_view = new cCCEStudentActivities_view();
$Page =& $CCEStudentActivities_view;

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

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

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

// page properties
CCEStudentActivities_view.PageID = "view"; // page ID
CCEStudentActivities_view.FormID = "fCCEStudentActivitiesview"; // form ID
var EW_PAGE_ID = CCEStudentActivities_view.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
CCEStudentActivities_view.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) { ?>
CCEStudentActivities_view.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEStudentActivities_view.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 } ?>
<p><span class="phpmaker"><?php echo $Language->Phrase("View") ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCEStudentActivities->TableCaption() ?>
<?php if ($CCEStudentActivities->Export == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $CCEStudentActivities_view->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 $CCEStudentActivities_view->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 $CCEStudentActivities_view->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_CCEStudentActivities" id="emf_CCEStudentActivities" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCEStudentActivities',hdr:ewLanguage.Phrase('ExportToEmail'),key:<?php echo ew_ArrayToJsonAttr($CCEStudentActivities_view->arRecKey) ?>,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 } ?>
<br><br>
<?php if ($CCEStudentActivities->Export == "") { ?>
<a href="<?php echo $CCEStudentActivities_view->ListUrl ?>"><?php echo $Language->Phrase("BackToList") ?></a>&nbsp;
<?php if ($Security->IsLoggedIn()) { ?>
<a href="<?php echo $CCEStudentActivities_view->EditUrl ?>"><?php echo $Language->Phrase("ViewPageEditLink") ?></a>&nbsp;
<?php } ?>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$CCEStudentActivities_view->ShowMessage();
?>
<p>
<?php if ($CCEStudentActivities->Export == "") { ?>
<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($CCEStudentActivities_view->Pager)) $CCEStudentActivities_view->Pager = new cPrevNextPager($CCEStudentActivities_view->lStartRec, $CCEStudentActivities_view->lDisplayRecs, $CCEStudentActivities_view->lTotalRecs) ?>
<?php if ($CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 $CCEStudentActivities_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCEStudentActivities_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 $CCEStudentActivities_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($CCEStudentActivities_view->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 } ?>
		</td>
	</tr>
</table>
</form>
<br>
<?php } ?>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<?php if ($CCEStudentActivities->CCEStudentID->Visible) { // CCEStudentID ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->CCEStudentID->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->CCEStudentID->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->CCEStudentID->ViewAttributes() ?>><?php echo $CCEStudentActivities->CCEStudentID->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->CCEActivityID->Visible) { // CCEActivityID ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->CCEActivityID->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->CCEActivityID->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->CCEActivityID->ViewAttributes() ?>><?php echo $CCEStudentActivities->CCEActivityID->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->ActivityRef->Visible) { // ActivityRef ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->ActivityRef->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->ActivityRef->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->ActivityRef->ViewAttributes() ?>><?php echo $CCEStudentActivities->ActivityRef->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile1->Visible) { // AssignmentFile1 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile1->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile1->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile1->HrefValue <> "" || $CCEStudentActivities->AssignmentFile1->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile1->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile1->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile1->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile1->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile1->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile2->Visible) { // AssignmentFile2 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile2->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile2->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile2->HrefValue <> "" || $CCEStudentActivities->AssignmentFile2->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile2->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile2->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile2->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile2->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile2->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile3->Visible) { // AssignmentFile3 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile3->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile3->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile3->HrefValue <> "" || $CCEStudentActivities->AssignmentFile3->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile3->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile3->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile3->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile3->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile3->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile4->Visible) { // AssignmentFile4 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile4->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile4->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile4->HrefValue <> "" || $CCEStudentActivities->AssignmentFile4->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile4->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile4->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile4->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile4->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile4->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile5->Visible) { // AssignmentFile5 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile5->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile5->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile5->HrefValue <> "" || $CCEStudentActivities->AssignmentFile5->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile5->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile5->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile5->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile5->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile5->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AssignmentFile6->Visible) { // AssignmentFile6 ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AssignmentFile6->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AssignmentFile6->CellAttributes() ?>>
<?php if ($CCEStudentActivities->AssignmentFile6->HrefValue <> "" || $CCEStudentActivities->AssignmentFile6->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile6->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentActivities->AssignmentFile6->HrefValue ?>"><?php echo $CCEStudentActivities->AssignmentFile6->ViewValue ?></a>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentActivities->AssignmentFile6->Upload->DbValue)) { ?>
<?php echo $CCEStudentActivities->AssignmentFile6->ViewValue ?>
<?php } elseif (!in_array($CCEStudentActivities->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->DateSubmitted->Visible) { // DateSubmitted ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->DateSubmitted->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->DateSubmitted->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->DateSubmitted->ViewAttributes() ?>><?php echo $CCEStudentActivities->DateSubmitted->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AcceptStatus->Visible) { // AcceptStatus ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AcceptStatus->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AcceptStatus->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->AcceptStatus->ViewAttributes() ?>><?php echo $CCEStudentActivities->AcceptStatus->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->AcceptedBy->Visible) { // AcceptedBy ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->AcceptedBy->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->AcceptedBy->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->AcceptedBy->ViewAttributes() ?>><?php echo $CCEStudentActivities->AcceptedBy->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->DateAccepted->Visible) { // DateAccepted ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->DateAccepted->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->DateAccepted->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->DateAccepted->ViewAttributes() ?>><?php echo $CCEStudentActivities->DateAccepted->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCEStudentActivities->Comments->Visible) { // Comments ?>
	<tr<?php echo $CCEStudentActivities->RowAttributes() ?>>
		<td class="ewTableHeader"><?php echo $CCEStudentActivities->Comments->FldCaption() ?></td>
		<td<?php echo $CCEStudentActivities->Comments->CellAttributes() ?>>
<div<?php echo $CCEStudentActivities->Comments->ViewAttributes() ?>><?php echo $CCEStudentActivities->Comments->ViewValue ?></div></td>
	</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<?php if ($CCEStudentActivities->Export == "") { ?>
<br>
<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($CCEStudentActivities_view->Pager)) $CCEStudentActivities_view->Pager = new cPrevNextPager($CCEStudentActivities_view->lStartRec, $CCEStudentActivities_view->lDisplayRecs, $CCEStudentActivities_view->lTotalRecs) ?>
<?php if ($CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 $CCEStudentActivities_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCEStudentActivities_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 ($CCEStudentActivities_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStudentActivities_view->PageUrl() ?>start=<?php echo $CCEStudentActivities_view->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 $CCEStudentActivities_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($CCEStudentActivities_view->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 } ?>
		</td>
	</tr>
</table>
</form>
<?php } ?>
<p>
<?php if ($CCEStudentActivities->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
$CCEStudentActivities_view->Page_Terminate();
?>
<?php

//
// Page class
//
class cCCEStudentActivities_view {

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

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

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

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

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

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

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

		// Table object (CCEStudentActivities)
		$GLOBALS["CCEStudentActivities"] = new cCCEStudentActivities();

		// Table object (CCEAssignments)
		$GLOBALS['CCEAssignments'] = new cCCEAssignments();

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

		// Table object (CCEFacilitatorUsers)
		$GLOBALS['CCEFacilitatorUsers'] = new cCCEFacilitatorUsers();

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

		// Table name (for backward compatibility)
		if (!defined("EW_TABLE_NAME"))
			define("EW_TABLE_NAME", 'CCEStudentActivities', 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 $CCEStudentActivities;

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

		// Get export parameters
		if (@$_GET["export"] <> "") {
			$CCEStudentActivities->Export = $_GET["export"];
		} elseif (ew_IsHttpPost()) {
			if (@$_POST["exporttype"] <> "")
				$CCEStudentActivities->Export = $_POST["exporttype"];
		} else {
			$CCEStudentActivities->setExportReturnUrl(ew_CurrentUrl());
		}
		$gsExport = $CCEStudentActivities->Export; // Get export parameter, used in header
		$gsExportFile = $CCEStudentActivities->TableVar; // Get export file, used in header
		if (@$_GET["CCEStudentAssigID"] <> "") {
			if ($gsExportFile <> "") $gsExportFile .= "_";
			$gsExportFile .= ew_StripSlashes($_GET["CCEStudentAssigID"]);
		}
		if ($CCEStudentActivities->Export == "excel") {
			header('Content-Type: application/vnd.ms-excel');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
		}
		if ($CCEStudentActivities->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();
	}
	var $lDisplayRecs = 1;
	var $lStartRec;
	var $lStopRec;
	var $lTotalRecs = 0;
	var $lRecRange = 10;
	var $lRecCnt;
	var $arRecKey = array();

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

		// Load current record
		$bLoadCurrentRecord = FALSE;
		$sReturnUrl = "";
		$bMatchRecord = FALSE;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET["CCEStudentAssigID"] <> "") {
				$CCEStudentActivities->CCEStudentAssigID->setQueryStringValue($_GET["CCEStudentAssigID"]);
				$this->arRecKey["CCEStudentAssigID"] = $CCEStudentActivities->CCEStudentAssigID->QueryStringValue;
			} else {
				$bLoadCurrentRecord = TRUE;
			}

			// Get action
			$CCEStudentActivities->CurrentAction = "I"; // Display form
			switch ($CCEStudentActivities->CurrentAction) {
				case "I": // Get a record to display
					$this->lStartRec = 1; // Initialize start position
					if ($rs = $this->LoadRecordset()) // Load records
						$this->lTotalRecs = $rs->RecordCount(); // Get record count
					if ($this->lTotalRecs <= 0) { // No record found
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$this->Page_Terminate("CCEStudentActivitieslist.php"); // Return to list page
					} elseif ($bLoadCurrentRecord) { // Load current record position
						$this->SetUpStartRec(); // Set up start record position

						// Point to current record
						if (intval($this->lStartRec) <= intval($this->lTotalRecs)) {
							$bMatchRecord = TRUE;
							$rs->Move($this->lStartRec-1);
						}
					} else { // Match key values
						while (!$rs->EOF) {
							if (strval($CCEStudentActivities->CCEStudentAssigID->CurrentValue) == strval($rs->fields('CCEStudentAssigID'))) {
								$CCEStudentActivities->setStartRecordNumber($this->lStartRec); // Save record position
								$bMatchRecord = TRUE;
								break;
							} else {
								$this->lStartRec++;
								$rs->MoveNext();
							}
						}
					}
					if (!$bMatchRecord) {
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$sReturnUrl = "CCEStudentActivitieslist.php"; // No matching record, return to list
					} else {
						$this->LoadRowValues($rs); // Load row values
					}
			}

			// Export data only
			if (in_array($CCEStudentActivities->Export, array("html","word","excel","xml","csv","email"))) {
				$this->ExportData();
				if ($CCEStudentActivities->Export <> "email")
					$this->Page_Terminate(); // Terminate response
				exit();
			}
		} else {
			$sReturnUrl = "CCEStudentActivitieslist.php"; // Not page request, return to list
		}
		if ($sReturnUrl <> "")
			$this->Page_Terminate($sReturnUrl);

		// Render row
		$CCEStudentActivities->RowType = EW_ROWTYPE_VIEW;
		$this->RenderRow();
	}

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

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $CCEStudentActivities;
		$CCEStudentActivities->CCEStudentAssigID->setDbValue($rs->fields('CCEStudentAssigID'));
		$CCEStudentActivities->CCEStudentID->setDbValue($rs->fields('CCEStudentID'));
		$CCEStudentActivities->CCEActivityID->setDbValue($rs->fields('CCEActivityID'));
		$CCEStudentActivities->CCEAssignmentID->setDbValue($rs->fields('CCEAssignmentID'));
		$CCEStudentActivities->CCEModuleID->setDbValue($rs->fields('CCEModuleID'));
		$CCEStudentActivities->ActivityRef->setDbValue($rs->fields('ActivityRef'));
		$CCEStudentActivities->AssignmentFile1->Upload->DbValue = $rs->fields('AssignmentFile1');
		$CCEStudentActivities->AssignmentFile2->Upload->DbValue = $rs->fields('AssignmentFile2');
		$CCEStudentActivities->AssignmentFile3->Upload->DbValue = $rs->fields('AssignmentFile3');
		$CCEStudentActivities->AssignmentFile4->Upload->DbValue = $rs->fields('AssignmentFile4');
		$CCEStudentActivities->AssignmentFile5->Upload->DbValue = $rs->fields('AssignmentFile5');
		$CCEStudentActivities->AssignmentFile6->Upload->DbValue = $rs->fields('AssignmentFile6');
		$CCEStudentActivities->DateSubmitted->setDbValue($rs->fields('DateSubmitted'));
		$CCEStudentActivities->AcceptStatus->setDbValue($rs->fields('AcceptStatus'));
		$CCEStudentActivities->AcceptedBy->setDbValue($rs->fields('AcceptedBy'));
		$CCEStudentActivities->DateAccepted->setDbValue($rs->fields('DateAccepted'));
		$CCEStudentActivities->Comments->setDbValue($rs->fields('Comments'));
	}

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

		// Initialize URLs
		$this->ExportPrintUrl = $this->PageUrl() . "export=print&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->ExportHtmlUrl = $this->PageUrl() . "export=html&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->ExportExcelUrl = $this->PageUrl() . "export=excel&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->ExportWordUrl = $this->PageUrl() . "export=word&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->ExportXmlUrl = $this->PageUrl() . "export=xml&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->ExportCsvUrl = $this->PageUrl() . "export=csv&" . "CCEStudentAssigID=" . urlencode($CCEStudentActivities->CCEStudentAssigID->CurrentValue);
		$this->AddUrl = $CCEStudentActivities->AddUrl();
		$this->EditUrl = $CCEStudentActivities->EditUrl();
		$this->CopyUrl = $CCEStudentActivities->CopyUrl();
		$this->DeleteUrl = $CCEStudentActivities->DeleteUrl();
		$this->ListUrl = $CCEStudentActivities->ListUrl();

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

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

		$CCEStudentActivities->CCEStudentID->CellCssStyle = ""; $CCEStudentActivities->CCEStudentID->CellCssClass = "";
		$CCEStudentActivities->CCEStudentID->CellAttrs = array(); $CCEStudentActivities->CCEStudentID->ViewAttrs = array(); $CCEStudentActivities->CCEStudentID->EditAttrs = array();

		// CCEActivityID
		$CCEStudentActivities->CCEActivityID->CellCssStyle = ""; $CCEStudentActivities->CCEActivityID->CellCssClass = "";
		$CCEStudentActivities->CCEActivityID->CellAttrs = array(); $CCEStudentActivities->CCEActivityID->ViewAttrs = array(); $CCEStudentActivities->CCEActivityID->EditAttrs = array();

		// ActivityRef
		$CCEStudentActivities->ActivityRef->CellCssStyle = ""; $CCEStudentActivities->ActivityRef->CellCssClass = "";
		$CCEStudentActivities->ActivityRef->CellAttrs = array(); $CCEStudentActivities->ActivityRef->ViewAttrs = array(); $CCEStudentActivities->ActivityRef->EditAttrs = array();

		// AssignmentFile1
		$CCEStudentActivities->AssignmentFile1->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile1->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile1->CellAttrs = array(); $CCEStudentActivities->AssignmentFile1->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile1->EditAttrs = array();

		// AssignmentFile2
		$CCEStudentActivities->AssignmentFile2->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile2->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile2->CellAttrs = array(); $CCEStudentActivities->AssignmentFile2->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile2->EditAttrs = array();

		// AssignmentFile3
		$CCEStudentActivities->AssignmentFile3->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile3->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile3->CellAttrs = array(); $CCEStudentActivities->AssignmentFile3->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile3->EditAttrs = array();

		// AssignmentFile4
		$CCEStudentActivities->AssignmentFile4->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile4->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile4->CellAttrs = array(); $CCEStudentActivities->AssignmentFile4->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile4->EditAttrs = array();

		// AssignmentFile5
		$CCEStudentActivities->AssignmentFile5->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile5->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile5->CellAttrs = array(); $CCEStudentActivities->AssignmentFile5->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile5->EditAttrs = array();

		// AssignmentFile6
		$CCEStudentActivities->AssignmentFile6->CellCssStyle = ""; $CCEStudentActivities->AssignmentFile6->CellCssClass = "";
		$CCEStudentActivities->AssignmentFile6->CellAttrs = array(); $CCEStudentActivities->AssignmentFile6->ViewAttrs = array(); $CCEStudentActivities->AssignmentFile6->EditAttrs = array();

		// DateSubmitted
		$CCEStudentActivities->DateSubmitted->CellCssStyle = ""; $CCEStudentActivities->DateSubmitted->CellCssClass = "";
		$CCEStudentActivities->DateSubmitted->CellAttrs = array(); $CCEStudentActivities->DateSubmitted->ViewAttrs = array(); $CCEStudentActivities->DateSubmitted->EditAttrs = array();

		// AcceptStatus
		$CCEStudentActivities->AcceptStatus->CellCssStyle = ""; $CCEStudentActivities->AcceptStatus->CellCssClass = "";
		$CCEStudentActivities->AcceptStatus->CellAttrs = array(); $CCEStudentActivities->AcceptStatus->ViewAttrs = array(); $CCEStudentActivities->AcceptStatus->EditAttrs = array();

		// AcceptedBy
		$CCEStudentActivities->AcceptedBy->CellCssStyle = ""; $CCEStudentActivities->AcceptedBy->CellCssClass = "";
		$CCEStudentActivities->AcceptedBy->CellAttrs = array(); $CCEStudentActivities->AcceptedBy->ViewAttrs = array(); $CCEStudentActivities->AcceptedBy->EditAttrs = array();

		// DateAccepted
		$CCEStudentActivities->DateAccepted->CellCssStyle = ""; $CCEStudentActivities->DateAccepted->CellCssClass = "";
		$CCEStudentActivities->DateAccepted->CellAttrs = array(); $CCEStudentActivities->DateAccepted->ViewAttrs = array(); $CCEStudentActivities->DateAccepted->EditAttrs = array();

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

			// CCEStudentAssigID
			$CCEStudentActivities->CCEStudentAssigID->ViewValue = $CCEStudentActivities->CCEStudentAssigID->CurrentValue;
			$CCEStudentActivities->CCEStudentAssigID->CssStyle = "";
			$CCEStudentActivities->CCEStudentAssigID->CssClass = "";
			$CCEStudentActivities->CCEStudentAssigID->ViewCustomAttributes = "";

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

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

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

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

			// ActivityRef
			$CCEStudentActivities->ActivityRef->ViewValue = $CCEStudentActivities->ActivityRef->CurrentValue;
			$CCEStudentActivities->ActivityRef->CssStyle = "";
			$CCEStudentActivities->ActivityRef->CssClass = "";
			$CCEStudentActivities->ActivityRef->ViewCustomAttributes = "";

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

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

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

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

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

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

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

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

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

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

			// Comments
			$CCEStudentActivities->Comments->ViewValue = $CCEStudentActivities->Comments->CurrentValue;
			$CCEStudentActivities->Comments->CssStyle = "";
			$CCEStudentActivities->Comments->CssClass = "";
			$CCEStudentActivities->Comments->ViewCustomAttributes = "";

			// CCEStudentID
			$CCEStudentActivities->CCEStudentID->HrefValue = "";
			$CCEStudentActivities->CCEStudentID->TooltipValue = "";

			// CCEActivityID
			$CCEStudentActivities->CCEActivityID->HrefValue = "";
			$CCEStudentActivities->CCEActivityID->TooltipValue = "";

			// ActivityRef
			$CCEStudentActivities->ActivityRef->HrefValue = "";
			$CCEStudentActivities->ActivityRef->TooltipValue = "";

			// AssignmentFile1
			if (!ew_Empty($CCEStudentActivities->AssignmentFile1->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile1->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile1->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile1->ViewValue)) ? $CCEStudentActivities->AssignmentFile1->ViewValue : $CCEStudentActivities->AssignmentFile1->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile1->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile1->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile1->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile1->TooltipValue = "";

			// AssignmentFile2
			if (!ew_Empty($CCEStudentActivities->AssignmentFile2->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile2->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile2->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile2->ViewValue)) ? $CCEStudentActivities->AssignmentFile2->ViewValue : $CCEStudentActivities->AssignmentFile2->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile2->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile2->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile2->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile2->TooltipValue = "";

			// AssignmentFile3
			if (!ew_Empty($CCEStudentActivities->AssignmentFile3->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile3->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile3->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile3->ViewValue)) ? $CCEStudentActivities->AssignmentFile3->ViewValue : $CCEStudentActivities->AssignmentFile3->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile3->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile3->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile3->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile3->TooltipValue = "";

			// AssignmentFile4
			if (!ew_Empty($CCEStudentActivities->AssignmentFile4->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile4->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile4->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile4->ViewValue)) ? $CCEStudentActivities->AssignmentFile4->ViewValue : $CCEStudentActivities->AssignmentFile4->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile4->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile4->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile4->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile4->TooltipValue = "";

			// AssignmentFile5
			if (!ew_Empty($CCEStudentActivities->AssignmentFile5->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile5->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile5->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile5->ViewValue)) ? $CCEStudentActivities->AssignmentFile5->ViewValue : $CCEStudentActivities->AssignmentFile5->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile5->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile5->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile5->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile5->TooltipValue = "";

			// AssignmentFile6
			if (!ew_Empty($CCEStudentActivities->AssignmentFile6->Upload->DbValue)) {
				$CCEStudentActivities->AssignmentFile6->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentActivities->AssignmentFile6->UploadPath) . ((!empty($CCEStudentActivities->AssignmentFile6->ViewValue)) ? $CCEStudentActivities->AssignmentFile6->ViewValue : $CCEStudentActivities->AssignmentFile6->CurrentValue);
				if ($CCEStudentActivities->Export <> "") $CCEStudentActivities->AssignmentFile6->HrefValue = ew_ConvertFullUrl($CCEStudentActivities->AssignmentFile6->HrefValue);
			} else {
				$CCEStudentActivities->AssignmentFile6->HrefValue = "";
			}
			$CCEStudentActivities->AssignmentFile6->TooltipValue = "";

			// DateSubmitted
			$CCEStudentActivities->DateSubmitted->HrefValue = "";
			$CCEStudentActivities->DateSubmitted->TooltipValue = "";

			// AcceptStatus
			$CCEStudentActivities->AcceptStatus->HrefValue = "";
			$CCEStudentActivities->AcceptStatus->TooltipValue = "";

			// AcceptedBy
			$CCEStudentActivities->AcceptedBy->HrefValue = "";
			$CCEStudentActivities->AcceptedBy->TooltipValue = "";

			// DateAccepted
			$CCEStudentActivities->DateAccepted->HrefValue = "";
			$CCEStudentActivities->DateAccepted->TooltipValue = "";

			// Comments
			$CCEStudentActivities->Comments->HrefValue = "";
			$CCEStudentActivities->Comments->TooltipValue = "";
		}

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

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

		// Load recordset
		if ($bSelectLimit) {
			$this->lTotalRecs = $CCEStudentActivities->SelectRecordCount();
		} else {
			if ($rs = $this->LoadRecordset())
				$this->lTotalRecs = $rs->RecordCount();
		}
		$this->lStartRec = 1;
		$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 (!$rs) {
			header("Content-Type:"); // Remove header
			header("Content-Disposition:");
			$this->ShowMessage();
			return;
		}
		if ($CCEStudentActivities->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($CCEStudentActivities, "v");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($CCEStudentActivities->CCEStudentAssigID);
				$ExportDoc->ExportCaption($CCEStudentActivities->CCEStudentID);
				$ExportDoc->ExportCaption($CCEStudentActivities->CCEActivityID);
				$ExportDoc->ExportCaption($CCEStudentActivities->CCEAssignmentID);
				$ExportDoc->ExportCaption($CCEStudentActivities->CCEModuleID);
				$ExportDoc->ExportCaption($CCEStudentActivities->ActivityRef);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile1);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile2);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile3);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile4);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile5);
				$ExportDoc->ExportCaption($CCEStudentActivities->AssignmentFile6);
				$ExportDoc->ExportCaption($CCEStudentActivities->DateSubmitted);
				$ExportDoc->ExportCaption($CCEStudentActivities->AcceptStatus);
				$ExportDoc->ExportCaption($CCEStudentActivities->AcceptedBy);
				$ExportDoc->ExportCaption($CCEStudentActivities->DateAccepted);
				$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
				$CCEStudentActivities->CssClass = "";
				$CCEStudentActivities->CssStyle = "";
				$CCEStudentActivities->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($CCEStudentActivities->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('CCEStudentAssigID', $CCEStudentActivities->CCEStudentAssigID->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('CCEStudentID', $CCEStudentActivities->CCEStudentID->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('CCEActivityID', $CCEStudentActivities->CCEActivityID->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('CCEAssignmentID', $CCEStudentActivities->CCEAssignmentID->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('CCEModuleID', $CCEStudentActivities->CCEModuleID->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('ActivityRef', $CCEStudentActivities->ActivityRef->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile1', $CCEStudentActivities->AssignmentFile1->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile2', $CCEStudentActivities->AssignmentFile2->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile3', $CCEStudentActivities->AssignmentFile3->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile4', $CCEStudentActivities->AssignmentFile4->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile5', $CCEStudentActivities->AssignmentFile5->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile6', $CCEStudentActivities->AssignmentFile6->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('DateSubmitted', $CCEStudentActivities->DateSubmitted->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AcceptStatus', $CCEStudentActivities->AcceptStatus->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('AcceptedBy', $CCEStudentActivities->AcceptedBy->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
					$XmlDoc->AddField('DateAccepted', $CCEStudentActivities->DateAccepted->ExportValue($CCEStudentActivities->Export, $CCEStudentActivities->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($CCEStudentActivities->CCEStudentAssigID);
					$ExportDoc->ExportField($CCEStudentActivities->CCEStudentID);
					$ExportDoc->ExportField($CCEStudentActivities->CCEActivityID);
					$ExportDoc->ExportField($CCEStudentActivities->CCEAssignmentID);
					$ExportDoc->ExportField($CCEStudentActivities->CCEModuleID);
					$ExportDoc->ExportField($CCEStudentActivities->ActivityRef);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile1);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile2);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile3);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile4);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile5);
					$ExportDoc->ExportField($CCEStudentActivities->AssignmentFile6);
					$ExportDoc->ExportField($CCEStudentActivities->DateSubmitted);
					$ExportDoc->ExportField($CCEStudentActivities->AcceptStatus);
					$ExportDoc->ExportField($CCEStudentActivities->AcceptedBy);
					$ExportDoc->ExportField($CCEStudentActivities->DateAccepted);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($CCEStudentActivities->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($CCEStudentActivities->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

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

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

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

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

		// Add record key QueryString
		$sQry .= "&" . substr($CCEStudentActivities->KeyUrl("", ""), 1);
		return $sQry;
	}

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

	}
}
?>