Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceadmin/
Upload File :
Current File : /var/www/cesa.co.za/cceadmin/CCEStudentAssignmentslist.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 "CCEStudentAssignmentsinfo.php" ?>
<?php include "CCEAssignmentsinfo.php" ?>
<?php include "CCEStudentsinfo.php" ?>
<?php include "CCEUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1 
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php

// Create page object
$CCEStudentAssignments_list = new cCCEStudentAssignments_list();
$Page =& $CCEStudentAssignments_list;

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

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

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

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

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

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

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

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

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

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

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

// Render list options (header, left)
$CCEStudentAssignments_list->ListOptions->Render("header", "left");
?>
<?php if ($CCEStudentAssignments->CCEStudentID->Visible) { // CCEStudentID ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->CCEStudentID) == "") { ?>
		<td><?php echo $CCEStudentAssignments->CCEStudentID->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->CCEStudentID) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->CCEStudentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->CCEStudentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->CCEStudentID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->CCEAssignmentID->Visible) { // CCEAssignmentID ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->CCEAssignmentID) == "") { ?>
		<td><?php echo $CCEStudentAssignments->CCEAssignmentID->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->CCEAssignmentID) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->CCEAssignmentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->CCEAssignmentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->CCEAssignmentID->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->DateSubmitted->Visible) { // DateSubmitted ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->DateSubmitted) == "") { ?>
		<td><?php echo $CCEStudentAssignments->DateSubmitted->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->DateSubmitted) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->DateSubmitted->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->DateSubmitted->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->DateSubmitted->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->Passed->Visible) { // Passed ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->Passed) == "") { ?>
		<td><?php echo $CCEStudentAssignments->Passed->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->Passed) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->Passed->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->Passed->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->Passed->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->RulingCode->Visible) { // RulingCode ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->RulingCode) == "") { ?>
		<td><?php echo $CCEStudentAssignments->RulingCode->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->RulingCode) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->RulingCode->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->RulingCode->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->RulingCode->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->AssignmentScore->Visible) { // AssignmentScore ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->AssignmentScore) == "") { ?>
		<td><?php echo $CCEStudentAssignments->AssignmentScore->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->AssignmentScore) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->AssignmentScore->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->AssignmentScore->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->AssignmentScore->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStudentAssignments->ResubmitDateOverride->Visible) { // ResubmitDateOverride ?>
	<?php if ($CCEStudentAssignments->SortUrl($CCEStudentAssignments->ResubmitDateOverride) == "") { ?>
		<td><?php echo $CCEStudentAssignments->ResubmitDateOverride->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStudentAssignments->SortUrl($CCEStudentAssignments->ResubmitDateOverride) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStudentAssignments->ResubmitDateOverride->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStudentAssignments->ResubmitDateOverride->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStudentAssignments->ResubmitDateOverride->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php

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

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

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

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

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

// Render list options (body, left)
$CCEStudentAssignments_list->ListOptions->Render("body", "left");
?>
	<?php if ($CCEStudentAssignments->CCEStudentID->Visible) { // CCEStudentID ?>
		<td<?php echo $CCEStudentAssignments->CCEStudentID->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->CCEStudentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEStudentID->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->CCEAssignmentID->Visible) { // CCEAssignmentID ?>
		<td<?php echo $CCEStudentAssignments->CCEAssignmentID->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->CCEAssignmentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEAssignmentID->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->DateSubmitted->Visible) { // DateSubmitted ?>
		<td<?php echo $CCEStudentAssignments->DateSubmitted->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->DateSubmitted->ViewAttributes() ?>><?php echo $CCEStudentAssignments->DateSubmitted->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->Passed->Visible) { // Passed ?>
		<td<?php echo $CCEStudentAssignments->Passed->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->Passed->ViewAttributes() ?>><?php echo $CCEStudentAssignments->Passed->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->RulingCode->Visible) { // RulingCode ?>
		<td<?php echo $CCEStudentAssignments->RulingCode->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->RulingCode->ViewAttributes() ?>><?php echo $CCEStudentAssignments->RulingCode->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->AssignmentScore->Visible) { // AssignmentScore ?>
		<td<?php echo $CCEStudentAssignments->AssignmentScore->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->AssignmentScore->ViewAttributes() ?>><?php echo $CCEStudentAssignments->AssignmentScore->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStudentAssignments->ResubmitDateOverride->Visible) { // ResubmitDateOverride ?>
		<td<?php echo $CCEStudentAssignments->ResubmitDateOverride->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->ResubmitDateOverride->ViewAttributes() ?>><?php echo $CCEStudentAssignments->ResubmitDateOverride->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php

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

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

//
// Page class
//
class cCCEStudentAssignments_list {

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

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

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

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

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

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

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

		// Table object (CCEStudentAssignments)
		$GLOBALS["CCEStudentAssignments"] = new cCCEStudentAssignments();

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

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

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

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

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

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

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

		// Open connection
		$conn = ew_Connect();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

			// Set up master detail parameters
			$this->SetUpMasterDetail();

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

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

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

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

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

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

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

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

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

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

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

		// Build filter
		$sFilter = "";
		if (!$Security->CanList())
			$sFilter = "(0=1)"; // Filter all records

		// Restore master/detail filter
		$this->sDbMasterFilter = $CCEStudentAssignments->getMasterFilter(); // Restore master filter
		$this->sDbDetailFilter = $CCEStudentAssignments->getDetailFilter(); // Restore detail filter
		if ($this->sDbDetailFilter <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
		if ($this->sSrchWhere <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;

		// Load master record
		if ($CCEStudentAssignments->getMasterFilter() <> "" && $CCEStudentAssignments->getCurrentMasterTable() == "CCEAssignments") {
			global $CCEAssignments;
			$rsmaster = $CCEAssignments->LoadRs($this->sDbMasterFilter);
			$this->bMasterRecordExists = ($rsmaster && !$rsmaster->EOF);
			if (!$this->bMasterRecordExists) {
				$CCEStudentAssignments->setMasterFilter(""); // Clear master filter
				$CCEStudentAssignments->setDetailFilter(""); // Clear detail filter
				$this->setMessage($Language->Phrase("NoRecord")); // Set no record found
				$this->Page_Terminate($CCEStudentAssignments->getReturnUrl()); // Return to caller
			} else {
				$CCEAssignments->LoadListRowValues($rsmaster);
				$CCEAssignments->RowType = EW_ROWTYPE_MASTER; // Master row
				$CCEAssignments->RenderListRow();
				$rsmaster->Close();
			}
		}

		// Load master record
		if ($CCEStudentAssignments->getMasterFilter() <> "" && $CCEStudentAssignments->getCurrentMasterTable() == "CCEStudents") {
			global $CCEStudents;
			$rsmaster = $CCEStudents->LoadRs($this->sDbMasterFilter);
			$this->bMasterRecordExists = ($rsmaster && !$rsmaster->EOF);
			if (!$this->bMasterRecordExists) {
				$CCEStudentAssignments->setMasterFilter(""); // Clear master filter
				$CCEStudentAssignments->setDetailFilter(""); // Clear detail filter
				$this->setMessage($Language->Phrase("NoRecord")); // Set no record found
				$this->Page_Terminate($CCEStudentAssignments->getReturnUrl()); // Return to caller
			} else {
				$CCEStudents->LoadListRowValues($rsmaster);
				$CCEStudents->RowType = EW_ROWTYPE_MASTER; // Master row
				$CCEStudents->RenderListRow();
				$rsmaster->Close();
			}
		}

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

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

	// Return basic search SQL
	function BasicSearchSQL($Keyword) {
		global $CCEStudentAssignments;
		$sKeyword = ew_AdjustSql($Keyword);
		$sWhere = "";
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->AssignmentFile1, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->AssignmentFile2, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->AssignmentFile3, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->AssignmentFile4, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->AssignmentFile5, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->Comments, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->RulingCode, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->Remarks, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->LFSentTo, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->LastFeedback, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->MsgAttachment, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->References, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStudentAssignments->TempR, $Keyword);
		return $sWhere;
	}

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

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

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

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

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

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

	// Restore all search parameters
	function RestoreSearchParms() {
		global $CCEStudentAssignments;
		$bRestore = TRUE;
		if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

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

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

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

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$CCEStudentAssignments->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$CCEStudentAssignments->CurrentOrderType = @$_GET["ordertype"];
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->CCEStudentID, $bCtrl); // CCEStudentID
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->CCEAssignmentID, $bCtrl); // CCEAssignmentID
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->DateSubmitted, $bCtrl); // DateSubmitted
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->Passed, $bCtrl); // Passed
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->RulingCode, $bCtrl); // RulingCode
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->AssignmentScore, $bCtrl); // AssignmentScore
			$CCEStudentAssignments->UpdateSort($CCEStudentAssignments->ResubmitDateOverride, $bCtrl); // ResubmitDateOverride
			$CCEStudentAssignments->setStartRecordNumber(1); // Reset start position
		}
	}

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

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

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

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

			// Reset master/detail keys
			if (strtolower($sCmd) == "resetall") {
				$CCEStudentAssignments->getCurrentMasterTable = ""; // Clear master table
				$CCEStudentAssignments->setMasterFilter(""); // Clear master filter
				$this->sDbMasterFilter = "";
				$CCEStudentAssignments->setDetailFilter(""); // Clear detail filter
				$this->sDbDetailFilter = "";
				$CCEStudentAssignments->CCEAssignmentID->setSessionValue("");
				$CCEStudentAssignments->CCEStudentID->setSessionValue("");
			}

			// Reset sorting order
			if (strtolower($sCmd) == "resetsort") {
				$sOrderBy = "";
				$CCEStudentAssignments->setSessionOrderBy($sOrderBy);
				$CCEStudentAssignments->CCEStudentID->setSort("");
				$CCEStudentAssignments->CCEAssignmentID->setSort("");
				$CCEStudentAssignments->DateSubmitted->setSort("");
				$CCEStudentAssignments->Passed->setSort("");
				$CCEStudentAssignments->RulingCode->setSort("");
				$CCEStudentAssignments->AssignmentScore->setSort("");
				$CCEStudentAssignments->ResubmitDateOverride->setSort("");
			}

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

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

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

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

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

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

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

		// "view"
		$oListOpt =& $this->ListOptions->Items["view"];
		if ($Security->CanView() && $oListOpt->Visible)
			$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . $Language->Phrase("ViewLink") . "</a>";

		// "edit"
		$oListOpt =& $this->ListOptions->Items["edit"];
		if ($Security->CanEdit() && $oListOpt->Visible) {
			$oListOpt->Body = "<a href=\"" . $this->EditUrl . "\">" . $Language->Phrase("EditLink") . "</a>";
		}

		// "delete"
		$oListOpt =& $this->ListOptions->Items["delete"];
		if ($Security->CanDelete() && $oListOpt->Visible)
			$oListOpt->Body = "<a" . "" . " href=\"" . $this->DeleteUrl . "\">" . $Language->Phrase("DeleteLink") . "</a>";
		$this->RenderListOptionsExt();

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

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

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

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

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $CCEStudentAssignments;
		$CCEStudentAssignments->CCEStudentAssigID->setDbValue($rs->fields('CCEStudentAssigID'));
		$CCEStudentAssignments->CCEStudentID->setDbValue($rs->fields('CCEStudentID'));
		$CCEStudentAssignments->CCEAssignmentID->setDbValue($rs->fields('CCEAssignmentID'));
		$CCEStudentAssignments->AssignmentFile1->Upload->DbValue = $rs->fields('AssignmentFile1');
		$CCEStudentAssignments->AssignmentFile2->Upload->DbValue = $rs->fields('AssignmentFile2');
		$CCEStudentAssignments->AssignmentFile3->Upload->DbValue = $rs->fields('AssignmentFile3');
		$CCEStudentAssignments->AssignmentFile4->Upload->DbValue = $rs->fields('AssignmentFile4');
		$CCEStudentAssignments->AssignmentFile5->Upload->DbValue = $rs->fields('AssignmentFile5');
		$CCEStudentAssignments->Comments->setDbValue($rs->fields('Comments'));
		$CCEStudentAssignments->DateSubmitted->setDbValue($rs->fields('DateSubmitted'));
		$CCEStudentAssignments->Completed->setDbValue($rs->fields('Completed'));
		$CCEStudentAssignments->Passed->setDbValue($rs->fields('Passed'));
		$CCEStudentAssignments->RulingCode->setDbValue($rs->fields('RulingCode'));
		$CCEStudentAssignments->AssignmentScore->setDbValue($rs->fields('AssignmentScore'));
		$CCEStudentAssignments->ScoredBy->setDbValue($rs->fields('ScoredBy'));
		$CCEStudentAssignments->Remarks->setDbValue($rs->fields('Remarks'));
		$CCEStudentAssignments->FeedbackMessageID->setDbValue($rs->fields('FeedbackMessageID'));
		$CCEStudentAssignments->LFSentTo->setDbValue($rs->fields('LFSentTo'));
		$CCEStudentAssignments->LastFeedback->setDbValue($rs->fields('LastFeedback'));
		$CCEStudentAssignments->MsgAttachment->Upload->DbValue = $rs->fields('MsgAttachment');
		$CCEStudentAssignments->Extended->setDbValue($rs->fields('Extended'));
		$CCEStudentAssignments->References->setDbValue($rs->fields('References'));
		$CCEStudentAssignments->TempR->setDbValue($rs->fields('TempR'));
		$CCEStudentAssignments->ResubmitDateOverride->setDbValue($rs->fields('ResubmitDateOverride'));
	}

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

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

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

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

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

		// CCEAssignmentID
		$CCEStudentAssignments->CCEAssignmentID->CellCssStyle = ""; $CCEStudentAssignments->CCEAssignmentID->CellCssClass = "";
		$CCEStudentAssignments->CCEAssignmentID->CellAttrs = array(); $CCEStudentAssignments->CCEAssignmentID->ViewAttrs = array(); $CCEStudentAssignments->CCEAssignmentID->EditAttrs = array();

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

		// Passed
		$CCEStudentAssignments->Passed->CellCssStyle = ""; $CCEStudentAssignments->Passed->CellCssClass = "";
		$CCEStudentAssignments->Passed->CellAttrs = array(); $CCEStudentAssignments->Passed->ViewAttrs = array(); $CCEStudentAssignments->Passed->EditAttrs = array();

		// RulingCode
		$CCEStudentAssignments->RulingCode->CellCssStyle = ""; $CCEStudentAssignments->RulingCode->CellCssClass = "";
		$CCEStudentAssignments->RulingCode->CellAttrs = array(); $CCEStudentAssignments->RulingCode->ViewAttrs = array(); $CCEStudentAssignments->RulingCode->EditAttrs = array();

		// AssignmentScore
		$CCEStudentAssignments->AssignmentScore->CellCssStyle = ""; $CCEStudentAssignments->AssignmentScore->CellCssClass = "";
		$CCEStudentAssignments->AssignmentScore->CellAttrs = array(); $CCEStudentAssignments->AssignmentScore->ViewAttrs = array(); $CCEStudentAssignments->AssignmentScore->EditAttrs = array();

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

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

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

			// CCEAssignmentID
			if (strval($CCEStudentAssignments->CCEAssignmentID->CurrentValue) <> "") {
				$sFilterWrk = "`CCEAssignmentID` = " . ew_AdjustSql($CCEStudentAssignments->CCEAssignmentID->CurrentValue) . "";
			$sSqlWrk = "SELECT `RefNum`, `AssignmentName` FROM `CCEAssignments`";
			$sWhereWrk = "";
			if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
			$sWhereWrk .= "(" . "Archived=0" . ")";
			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
					$CCEStudentAssignments->CCEAssignmentID->ViewValue = $rswrk->fields('RefNum');
					$CCEStudentAssignments->CCEAssignmentID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('AssignmentName');
					$rswrk->Close();
				} else {
					$CCEStudentAssignments->CCEAssignmentID->ViewValue = $CCEStudentAssignments->CCEAssignmentID->CurrentValue;
				}
			} else {
				$CCEStudentAssignments->CCEAssignmentID->ViewValue = NULL;
			}
			$CCEStudentAssignments->CCEAssignmentID->CssStyle = "";
			$CCEStudentAssignments->CCEAssignmentID->CssClass = "";
			$CCEStudentAssignments->CCEAssignmentID->ViewCustomAttributes = "";

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

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

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

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

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

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

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

			// Passed
			if (strval($CCEStudentAssignments->Passed->CurrentValue) <> "") {
				switch ($CCEStudentAssignments->Passed->CurrentValue) {
					case "1":
						$CCEStudentAssignments->Passed->ViewValue = "Achieved";
						break;
					case "2":
						$CCEStudentAssignments->Passed->ViewValue = "Not Yet Achieved";
						break;
					case "0":
						$CCEStudentAssignments->Passed->ViewValue = "Not Yet Evaluated";
						break;
					case "3":
						$CCEStudentAssignments->Passed->ViewValue = "Added to PoE";
						break;
					default:
						$CCEStudentAssignments->Passed->ViewValue = $CCEStudentAssignments->Passed->CurrentValue;
				}
			} else {
				$CCEStudentAssignments->Passed->ViewValue = NULL;
			}
			$CCEStudentAssignments->Passed->CssStyle = "";
			$CCEStudentAssignments->Passed->CssClass = "";
			$CCEStudentAssignments->Passed->ViewCustomAttributes = "";

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

			// AssignmentScore
			$CCEStudentAssignments->AssignmentScore->ViewValue = $CCEStudentAssignments->AssignmentScore->CurrentValue;
			$CCEStudentAssignments->AssignmentScore->CssStyle = "";
			$CCEStudentAssignments->AssignmentScore->CssClass = "";
			$CCEStudentAssignments->AssignmentScore->ViewCustomAttributes = "";

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

			// Remarks
			$CCEStudentAssignments->Remarks->ViewValue = $CCEStudentAssignments->Remarks->CurrentValue;
			$CCEStudentAssignments->Remarks->CssStyle = "";
			$CCEStudentAssignments->Remarks->CssClass = "";
			$CCEStudentAssignments->Remarks->ViewCustomAttributes = "";

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

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

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

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

			// CCEAssignmentID
			$CCEStudentAssignments->CCEAssignmentID->HrefValue = "";
			$CCEStudentAssignments->CCEAssignmentID->TooltipValue = "";

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

			// Passed
			$CCEStudentAssignments->Passed->HrefValue = "";
			$CCEStudentAssignments->Passed->TooltipValue = "";

			// RulingCode
			$CCEStudentAssignments->RulingCode->HrefValue = "";
			$CCEStudentAssignments->RulingCode->TooltipValue = "";

			// AssignmentScore
			$CCEStudentAssignments->AssignmentScore->HrefValue = "";
			$CCEStudentAssignments->AssignmentScore->TooltipValue = "";

			// ResubmitDateOverride
			$CCEStudentAssignments->ResubmitDateOverride->HrefValue = "";
			$CCEStudentAssignments->ResubmitDateOverride->TooltipValue = "";
		}

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

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

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

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

			// Set the last record to display
			if ($this->lDisplayRecs < 0) {
				$this->lStopRec = $this->lTotalRecs;
			} else {
				$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
			}
		}
		if ($bSelectLimit)
			$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);
		if (!$rs) {
			header("Content-Type:"); // Remove header
			header("Content-Disposition:");
			$this->ShowMessage();
			return;
		}
		if ($CCEStudentAssignments->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($CCEStudentAssignments, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($CCEStudentAssignments->CCEStudentAssigID);
				$ExportDoc->ExportCaption($CCEStudentAssignments->CCEStudentID);
				$ExportDoc->ExportCaption($CCEStudentAssignments->CCEAssignmentID);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentFile1);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentFile2);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentFile3);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentFile4);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentFile5);
				$ExportDoc->ExportCaption($CCEStudentAssignments->Comments);
				$ExportDoc->ExportCaption($CCEStudentAssignments->DateSubmitted);
				$ExportDoc->ExportCaption($CCEStudentAssignments->Passed);
				$ExportDoc->ExportCaption($CCEStudentAssignments->RulingCode);
				$ExportDoc->ExportCaption($CCEStudentAssignments->AssignmentScore);
				$ExportDoc->ExportCaption($CCEStudentAssignments->ScoredBy);
				$ExportDoc->ExportCaption($CCEStudentAssignments->Remarks);
				$ExportDoc->ExportCaption($CCEStudentAssignments->MsgAttachment);
				$ExportDoc->ExportCaption($CCEStudentAssignments->Extended);
				$ExportDoc->ExportCaption($CCEStudentAssignments->ResubmitDateOverride);
				$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
				$CCEStudentAssignments->CssClass = "";
				$CCEStudentAssignments->CssStyle = "";
				$CCEStudentAssignments->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($CCEStudentAssignments->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('CCEStudentAssigID', $CCEStudentAssignments->CCEStudentAssigID->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('CCEStudentID', $CCEStudentAssignments->CCEStudentID->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('CCEAssignmentID', $CCEStudentAssignments->CCEAssignmentID->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile1', $CCEStudentAssignments->AssignmentFile1->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile2', $CCEStudentAssignments->AssignmentFile2->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile3', $CCEStudentAssignments->AssignmentFile3->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile4', $CCEStudentAssignments->AssignmentFile4->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentFile5', $CCEStudentAssignments->AssignmentFile5->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('Comments', $CCEStudentAssignments->Comments->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('DateSubmitted', $CCEStudentAssignments->DateSubmitted->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('Passed', $CCEStudentAssignments->Passed->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('RulingCode', $CCEStudentAssignments->RulingCode->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('AssignmentScore', $CCEStudentAssignments->AssignmentScore->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('ScoredBy', $CCEStudentAssignments->ScoredBy->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('Remarks', $CCEStudentAssignments->Remarks->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('MsgAttachment', $CCEStudentAssignments->MsgAttachment->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('Extended', $CCEStudentAssignments->Extended->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
					$XmlDoc->AddField('ResubmitDateOverride', $CCEStudentAssignments->ResubmitDateOverride->ExportValue($CCEStudentAssignments->Export, $CCEStudentAssignments->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($CCEStudentAssignments->CCEStudentAssigID);
					$ExportDoc->ExportField($CCEStudentAssignments->CCEStudentID);
					$ExportDoc->ExportField($CCEStudentAssignments->CCEAssignmentID);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentFile1);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentFile2);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentFile3);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentFile4);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentFile5);
					$ExportDoc->ExportField($CCEStudentAssignments->Comments);
					$ExportDoc->ExportField($CCEStudentAssignments->DateSubmitted);
					$ExportDoc->ExportField($CCEStudentAssignments->Passed);
					$ExportDoc->ExportField($CCEStudentAssignments->RulingCode);
					$ExportDoc->ExportField($CCEStudentAssignments->AssignmentScore);
					$ExportDoc->ExportField($CCEStudentAssignments->ScoredBy);
					$ExportDoc->ExportField($CCEStudentAssignments->Remarks);
					$ExportDoc->ExportField($CCEStudentAssignments->MsgAttachment);
					$ExportDoc->ExportField($CCEStudentAssignments->Extended);
					$ExportDoc->ExportField($CCEStudentAssignments->ResubmitDateOverride);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($CCEStudentAssignments->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($CCEStudentAssignments->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

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

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

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

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

		// Build QueryString for search
		if ($CCEStudentAssignments->getSessionBasicSearchKeyword() <> "") {
			$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $CCEStudentAssignments->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $CCEStudentAssignments->getSessionBasicSearchType();
		}

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

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

	// Set up master/detail based on QueryString
	function SetUpMasterDetail() {
		global $CCEStudentAssignments;
		$bValidMaster = FALSE;

		// Get the keys for master table
		if (@$_GET[EW_TABLE_SHOW_MASTER] <> "") {
			$sMasterTblVar = $_GET[EW_TABLE_SHOW_MASTER];
			if ($sMasterTblVar == "") {
				$bValidMaster = TRUE;
				$this->sDbMasterFilter = "";
				$this->sDbDetailFilter = "";
			}
			if ($sMasterTblVar == "CCEAssignments") {
				$bValidMaster = TRUE;
				$this->sDbMasterFilter = $CCEStudentAssignments->SqlMasterFilter_CCEAssignments();
				$this->sDbDetailFilter = $CCEStudentAssignments->SqlDetailFilter_CCEAssignments();
				if (@$_GET["CCEAssignmentID"] <> "") {
					$GLOBALS["CCEAssignments"]->CCEAssignmentID->setQueryStringValue($_GET["CCEAssignmentID"]);
					$CCEStudentAssignments->CCEAssignmentID->setQueryStringValue($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue);
					$CCEStudentAssignments->CCEAssignmentID->setSessionValue($CCEStudentAssignments->CCEAssignmentID->QueryStringValue);
					if (!is_numeric($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue)) $bValidMaster = FALSE;
					$this->sDbMasterFilter = str_replace("@CCEAssignmentID@", ew_AdjustSql($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue), $this->sDbMasterFilter);
					$this->sDbDetailFilter = str_replace("@CCEAssignmentID@", ew_AdjustSql($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue), $this->sDbDetailFilter);
				} else {
					$bValidMaster = FALSE;
				}
			}
			if ($sMasterTblVar == "CCEStudents") {
				$bValidMaster = TRUE;
				$this->sDbMasterFilter = $CCEStudentAssignments->SqlMasterFilter_CCEStudents();
				$this->sDbDetailFilter = $CCEStudentAssignments->SqlDetailFilter_CCEStudents();
				if (@$_GET["CCEStudentID"] <> "") {
					$GLOBALS["CCEStudents"]->CCEStudentID->setQueryStringValue($_GET["CCEStudentID"]);
					$CCEStudentAssignments->CCEStudentID->setQueryStringValue($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue);
					$CCEStudentAssignments->CCEStudentID->setSessionValue($CCEStudentAssignments->CCEStudentID->QueryStringValue);
					if (!is_numeric($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue)) $bValidMaster = FALSE;
					$this->sDbMasterFilter = str_replace("@CCEStudentID@", ew_AdjustSql($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue), $this->sDbMasterFilter);
					$this->sDbDetailFilter = str_replace("@CCEStudentID@", ew_AdjustSql($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue), $this->sDbDetailFilter);
				} else {
					$bValidMaster = FALSE;
				}
			}
		}
		if ($bValidMaster) {

			// Save current master table
			$CCEStudentAssignments->setCurrentMasterTable($sMasterTblVar);

			// Reset start record counter (new master key)
			$this->lStartRec = 1;
			$CCEStudentAssignments->setStartRecordNumber($this->lStartRec);
			$CCEStudentAssignments->setMasterFilter($this->sDbMasterFilter); // Set up master filter
			$CCEStudentAssignments->setDetailFilter($this->sDbDetailFilter); // Set up detail filter

			// Clear previous master key from Session
			if ($sMasterTblVar <> "CCEAssignments") {
				if ($CCEStudentAssignments->CCEAssignmentID->QueryStringValue == "") $CCEStudentAssignments->CCEAssignmentID->setSessionValue("");
			}
			if ($sMasterTblVar <> "CCEStudents") {
				if ($CCEStudentAssignments->CCEStudentID->QueryStringValue == "") $CCEStudentAssignments->CCEStudentID->setSessionValue("");
			}
		} else {
			$this->sDbMasterFilter = $CCEStudentAssignments->getMasterFilter(); //  Restore master filter
			$this->sDbDetailFilter = $CCEStudentAssignments->getDetailFilter(); // Restore detail filter
		}
	}

		// Page Load event
function Page_Load() {
    //echo "Page Load";
    global $conni;
    
    CCEStudentAssignmentsList_Load();
    
}  

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

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

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

	}

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

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

	}

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

		// Return error message in CustomError
		return TRUE;
	}

	// ListOptions Load event
	function ListOptions_Load() {

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

	}

	// ListOptions Rendered event
	function ListOptions_Rendered() {

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

	}
}
?>