Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceconvenors/
Upload File :
Current File : /var/www/cesa.co.za/cceconvenors/CCEStAssigExtensionRequestslist.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 "CCEStAssigExtensionRequestsinfo.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
$CCEStAssigExtensionRequests_list = new cCCEStAssigExtensionRequests_list();
$Page =& $CCEStAssigExtensionRequests_list;

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

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

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

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

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

//-->
</script>
<link rel="stylesheet" type="text/css" media="all" href="calendar/calendar-win2k-cold-1.css" title="win2k-1">
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></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 ($CCEStAssigExtensionRequests->Export == "") { ?>
<?php } ?>
<?php
	$bSelectLimit = EW_SELECT_LIMIT;
	if ($bSelectLimit) {
		$CCEStAssigExtensionRequests_list->lTotalRecs = $CCEStAssigExtensionRequests->SelectRecordCount();
	} else {
		if ($rs = $CCEStAssigExtensionRequests_list->LoadRecordset())
			$CCEStAssigExtensionRequests_list->lTotalRecs = $rs->RecordCount();
	}
	$CCEStAssigExtensionRequests_list->lStartRec = 1;
	if ($CCEStAssigExtensionRequests_list->lDisplayRecs <= 0 || ($CCEStAssigExtensionRequests->Export <> "" && $CCEStAssigExtensionRequests->ExportAll)) // Display all records
		$CCEStAssigExtensionRequests_list->lDisplayRecs = $CCEStAssigExtensionRequests_list->lTotalRecs;
	if (!($CCEStAssigExtensionRequests->Export <> "" && $CCEStAssigExtensionRequests->ExportAll))
		$CCEStAssigExtensionRequests_list->SetUpStartRec(); // Set up start record position
	if ($bSelectLimit)
		$rs = $CCEStAssigExtensionRequests_list->LoadRecordset($CCEStAssigExtensionRequests_list->lStartRec-1, $CCEStAssigExtensionRequests_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCEStAssigExtensionRequests->TableCaption() ?>
<?php if ($CCEStAssigExtensionRequests->Export == "" && $CCEStAssigExtensionRequests->CurrentAction == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $CCEStAssigExtensionRequests_list->ExportPrintUrl ?>"><img src="images/print.gif" alt="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" title="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" width="16" height="16" border="0"></a>
&nbsp;&nbsp;<a href="<?php echo $CCEStAssigExtensionRequests_list->ExportExcelUrl ?>"><img src='images/exportxls.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a href="<?php echo $CCEStAssigExtensionRequests_list->ExportWordUrl ?>"><img src='images/exportdoc.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a name="emf_CCEStAssigExtensionRequests" id="emf_CCEStAssigExtensionRequests" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCEStAssigExtensionRequests',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fCCEStAssigExtensionRequestslist,sel:false});"><img src='images/exportemail.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
</span></p>
<?php if ($Security->IsLoggedIn()) { ?>
<?php if ($CCEStAssigExtensionRequests->Export == "" && $CCEStAssigExtensionRequests->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(CCEStAssigExtensionRequests_list);" style="text-decoration: none;"><img id="CCEStAssigExtensionRequests_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="CCEStAssigExtensionRequests_list_SearchPanel">
<form name="fCCEStAssigExtensionRequestslistsrch" id="fCCEStAssigExtensionRequestslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="CCEStAssigExtensionRequests">
<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($CCEStAssigExtensionRequests->getSessionBasicSearchKeyword()) ?>">
			<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">&nbsp;
			<a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>&nbsp;
			<a href="CCEStAssigExtensionRequestssrch.php"><?php echo $Language->Phrase("AdvancedSearch") ?></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 ($CCEStAssigExtensionRequests->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 ($CCEStAssigExtensionRequests->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 ($CCEStAssigExtensionRequests->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();
$CCEStAssigExtensionRequests_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($CCEStAssigExtensionRequests->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($CCEStAssigExtensionRequests->CurrentAction <> "gridadd" && $CCEStAssigExtensionRequests->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($CCEStAssigExtensionRequests_list->Pager)) $CCEStAssigExtensionRequests_list->Pager = new cPrevNextPager($CCEStAssigExtensionRequests_list->lStartRec, $CCEStAssigExtensionRequests_list->lDisplayRecs, $CCEStAssigExtensionRequests_list->lTotalRecs) ?>
<?php if ($CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCEStAssigExtensionRequests_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $CCEStAssigExtensionRequests_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $CCEStAssigExtensionRequests_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($CCEStAssigExtensionRequests_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 } ?>
		</td>
<?php if ($CCEStAssigExtensionRequests_list->lTotalRecs > 0) { ?>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php echo $Language->Phrase("RecordsPerPage") ?>&nbsp;</td><td>
<input type="hidden" id="t" name="t" value="CCEStAssigExtensionRequests">
<select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();">
<option value="20"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 20) { ?> selected="selected"<?php } ?>>20</option>
<option value="40"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 40) { ?> selected="selected"<?php } ?>>40</option>
<option value="60"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 60) { ?> selected="selected"<?php } ?>>60</option>
<option value="80"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 80) { ?> selected="selected"<?php } ?>>80</option>
<option value="ALL"<?php if ($CCEStAssigExtensionRequests->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select></td></tr></table>
		</td>
<?php } ?>
	</tr>
</table>
</form>
<?php } ?>
<span class="phpmaker">
</span>
</div>
<?php } ?>
<form name="fCCEStAssigExtensionRequestslist" id="fCCEStAssigExtensionRequestslist" class="ewForm" action="" method="post">
<div id="gmp_CCEStAssigExtensionRequests" class="ewGridMiddlePanel">
<?php if ($CCEStAssigExtensionRequests_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $CCEStAssigExtensionRequests->TableCustomInnerHtml ?>
<thead><!-- Table header -->
	<tr class="ewTableHeader">
<?php

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

// Render list options (header, left)
$CCEStAssigExtensionRequests_list->ListOptions->Render("header", "left");
?>
<?php if ($CCEStAssigExtensionRequests->CCEStudentID->Visible) { // CCEStudentID ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEStudentID) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->CCEStudentID->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEStudentID) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->CCEStudentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->CCEStudentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->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 ($CCEStAssigExtensionRequests->CCEAssignmentID->Visible) { // CCEAssignmentID ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEAssignmentID) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->CCEAssignmentID->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEAssignmentID) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->CCEAssignmentID->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->CCEAssignmentID->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->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 ($CCEStAssigExtensionRequests->CCEExtensionDate->Visible) { // CCEExtensionDate ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEExtensionDate) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->CCEExtensionDate->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->CCEExtensionDate) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->CCEExtensionDate->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->CCEExtensionDate->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->CCEExtensionDate->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStAssigExtensionRequests->DateRequested->Visible) { // DateRequested ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->DateRequested) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->DateRequested->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->DateRequested) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->DateRequested->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->DateRequested->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->DateRequested->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStAssigExtensionRequests->SupportingDoc->Visible) { // SupportingDoc ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->SupportingDoc) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->SupportingDoc->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->SupportingDoc) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->SupportingDoc->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->SupportingDoc->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->SupportingDoc->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStAssigExtensionRequests->Status->Visible) { // Status ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->Status) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->Status->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->Status) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->Status->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->Status->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->Status->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStAssigExtensionRequests->UpdatedBy->Visible) { // UpdatedBy ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->UpdatedBy) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->UpdatedBy->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->UpdatedBy) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->UpdatedBy->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->UpdatedBy->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->UpdatedBy->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
		</div></td>		
	<?php } ?>
<?php } ?>		
<?php if ($CCEStAssigExtensionRequests->DateUpdated->Visible) { // DateUpdated ?>
	<?php if ($CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->DateUpdated) == "") { ?>
		<td><?php echo $CCEStAssigExtensionRequests->DateUpdated->FldCaption() ?></td>
	<?php } else { ?>
		<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCEStAssigExtensionRequests->SortUrl($CCEStAssigExtensionRequests->DateUpdated) ?>',2);">
			<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCEStAssigExtensionRequests->DateUpdated->FldCaption() ?></td><td style="width: 10px;"><?php if ($CCEStAssigExtensionRequests->DateUpdated->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCEStAssigExtensionRequests->DateUpdated->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)
$CCEStAssigExtensionRequests_list->ListOptions->Render("header", "right");
?>
	</tr>
</thead>
<?php
if ($CCEStAssigExtensionRequests->ExportAll && $CCEStAssigExtensionRequests->Export <> "") {
	$CCEStAssigExtensionRequests_list->lStopRec = $CCEStAssigExtensionRequests_list->lTotalRecs;
} else {
	$CCEStAssigExtensionRequests_list->lStopRec = $CCEStAssigExtensionRequests_list->lStartRec + $CCEStAssigExtensionRequests_list->lDisplayRecs - 1; // Set the last record to display
}
$CCEStAssigExtensionRequests_list->lRecCount = $CCEStAssigExtensionRequests_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
	$rs->MoveFirst();
	if (!$bSelectLimit && $CCEStAssigExtensionRequests_list->lStartRec > 1)
		$rs->Move($CCEStAssigExtensionRequests_list->lStartRec - 1);
}

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

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

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

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

// Render list options (body, left)
$CCEStAssigExtensionRequests_list->ListOptions->Render("body", "left");
?>
	<?php if ($CCEStAssigExtensionRequests->CCEStudentID->Visible) { // CCEStudentID ?>
		<td<?php echo $CCEStAssigExtensionRequests->CCEStudentID->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->CCEStudentID->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->CCEStudentID->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->CCEAssignmentID->Visible) { // CCEAssignmentID ?>
		<td<?php echo $CCEStAssigExtensionRequests->CCEAssignmentID->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->CCEAssignmentID->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->CCEAssignmentID->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->CCEExtensionDate->Visible) { // CCEExtensionDate ?>
		<td<?php echo $CCEStAssigExtensionRequests->CCEExtensionDate->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->CCEExtensionDate->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->CCEExtensionDate->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->DateRequested->Visible) { // DateRequested ?>
		<td<?php echo $CCEStAssigExtensionRequests->DateRequested->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->DateRequested->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->DateRequested->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->SupportingDoc->Visible) { // SupportingDoc ?>
		<td<?php echo $CCEStAssigExtensionRequests->SupportingDoc->CellAttributes() ?>>
<?php if ($CCEStAssigExtensionRequests->SupportingDoc->HrefValue <> "" || $CCEStAssigExtensionRequests->SupportingDoc->TooltipValue <> "") { ?>
<?php if (!empty($CCEStAssigExtensionRequests->SupportingDoc->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStAssigExtensionRequests->SupportingDoc->HrefValue ?>"><?php echo $CCEStAssigExtensionRequests->SupportingDoc->ListViewValue() ?></a>
<?php } elseif (!in_array($CCEStAssigExtensionRequests->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStAssigExtensionRequests->SupportingDoc->Upload->DbValue)) { ?>
<?php echo $CCEStAssigExtensionRequests->SupportingDoc->ListViewValue() ?>
<?php } elseif (!in_array($CCEStAssigExtensionRequests->CurrentAction, array("I", "edit", "gridedit"))) { ?>	
&nbsp;
<?php } ?>
<?php } ?>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->Status->Visible) { // Status ?>
		<td<?php echo $CCEStAssigExtensionRequests->Status->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->Status->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->Status->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->UpdatedBy->Visible) { // UpdatedBy ?>
		<td<?php echo $CCEStAssigExtensionRequests->UpdatedBy->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->UpdatedBy->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->UpdatedBy->ListViewValue() ?></div>
</td>
	<?php } ?>
	<?php if ($CCEStAssigExtensionRequests->DateUpdated->Visible) { // DateUpdated ?>
		<td<?php echo $CCEStAssigExtensionRequests->DateUpdated->CellAttributes() ?>>
<div<?php echo $CCEStAssigExtensionRequests->DateUpdated->ViewAttributes() ?>><?php echo $CCEStAssigExtensionRequests->DateUpdated->ListViewValue() ?></div>
</td>
	<?php } ?>
<?php

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

// Close recordset
if ($rs)
	$rs->Close();
?>
<?php if ($CCEStAssigExtensionRequests_list->lTotalRecs > 0) { ?>
<?php if ($CCEStAssigExtensionRequests->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($CCEStAssigExtensionRequests->CurrentAction <> "gridadd" && $CCEStAssigExtensionRequests->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($CCEStAssigExtensionRequests_list->Pager)) $CCEStAssigExtensionRequests_list->Pager = new cPrevNextPager($CCEStAssigExtensionRequests_list->lStartRec, $CCEStAssigExtensionRequests_list->lDisplayRecs, $CCEStAssigExtensionRequests_list->lTotalRecs) ?>
<?php if ($CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCEStAssigExtensionRequests_list->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 ($CCEStAssigExtensionRequests_list->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCEStAssigExtensionRequests_list->PageUrl() ?>start=<?php echo $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_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 $CCEStAssigExtensionRequests_list->Pager->FromIndex ?>&nbsp;<?php echo $Language->Phrase("To") ?>&nbsp;<?php echo $CCEStAssigExtensionRequests_list->Pager->ToIndex ?>&nbsp;<?php echo $Language->Phrase("Of") ?>&nbsp;<?php echo $CCEStAssigExtensionRequests_list->Pager->RecordCount ?></span>
<?php } else { ?>
	<?php if ($CCEStAssigExtensionRequests_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 } ?>
		</td>
<?php if ($CCEStAssigExtensionRequests_list->lTotalRecs > 0) { ?>
		<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		<td><table border="0" cellspacing="0" cellpadding="0"><tr><td><?php echo $Language->Phrase("RecordsPerPage") ?>&nbsp;</td><td>
<input type="hidden" id="t" name="t" value="CCEStAssigExtensionRequests">
<select name="<?php echo EW_TABLE_REC_PER_PAGE ?>" id="<?php echo EW_TABLE_REC_PER_PAGE ?>" onchange="this.form.submit();">
<option value="20"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 20) { ?> selected="selected"<?php } ?>>20</option>
<option value="40"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 40) { ?> selected="selected"<?php } ?>>40</option>
<option value="60"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 60) { ?> selected="selected"<?php } ?>>60</option>
<option value="80"<?php if ($CCEStAssigExtensionRequests_list->lDisplayRecs == 80) { ?> selected="selected"<?php } ?>>80</option>
<option value="ALL"<?php if ($CCEStAssigExtensionRequests->getRecordsPerPage() == -1) { ?> selected="selected"<?php } ?>><?php echo $Language->Phrase("AllRecords") ?></option>
</select></td></tr></table>
		</td>
<?php } ?>
	</tr>
</table>
</form>
<?php } ?>
<?php //if ($CCEStAssigExtensionRequests_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($CCEStAssigExtensionRequests->Export == "" && $CCEStAssigExtensionRequests->CurrentAction == "") { ?>
<?php } ?>
<?php if ($CCEStAssigExtensionRequests->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
$CCEStAssigExtensionRequests_list->Page_Terminate();
?>
<?php

//
// Page class
//
class cCCEStAssigExtensionRequests_list {

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

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

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

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

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

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

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

		// Table object (CCEStAssigExtensionRequests)
		$GLOBALS["CCEStAssigExtensionRequests"] = new cCCEStAssigExtensionRequests();

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

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

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

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

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

			// Set up records per page
			$this->SetUpDisplayRecs();

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

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

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

			// Get and validate search values for advanced search
			$this->LoadSearchValues(); // Get search values
			if (!$this->ValidateSearch())
				$this->setMessage($gsSearchError);

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

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

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

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

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

		// Restore display records
		if ($CCEStAssigExtensionRequests->getRecordsPerPage() <> "") {
			$this->lDisplayRecs = $CCEStAssigExtensionRequests->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
		$CCEStAssigExtensionRequests->Recordset_Searching($this->sSrchWhere);

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

		// Build filter
		$sFilter = "";
		if ($this->sDbDetailFilter <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
		if ($this->sSrchWhere <> "")
			$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;

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

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

	// Set up number of records displayed per page
	function SetUpDisplayRecs() {
		global $CCEStAssigExtensionRequests;
		$sWrk = @$_GET[EW_TABLE_REC_PER_PAGE];
		if ($sWrk <> "") {
			if (is_numeric($sWrk)) {
				$this->lDisplayRecs = intval($sWrk);
			} else {
				if (strtolower($sWrk) == "all") { // Display all records
					$this->lDisplayRecs = -1;
				} else {
					$this->lDisplayRecs = 40; // Non-numeric, load default
				}
			}
			$CCEStAssigExtensionRequests->setRecordsPerPage($this->lDisplayRecs); // Save to Session

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

	// Advanced search WHERE clause based on QueryString
	function AdvancedSearchWhere() {
		global $Security, $CCEStAssigExtensionRequests;
		$sWhere = "";
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->CCEStudentID, FALSE); // CCEStudentID
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->CCEAssignmentID, FALSE); // CCEAssignmentID
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->CCEExtensionDate, FALSE); // CCEExtensionDate
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->DateRequested, FALSE); // DateRequested
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->Motivation, FALSE); // Motivation
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->Status, FALSE); // Status
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->StatusReason, FALSE); // StatusReason
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->UpdatedBy, FALSE); // UpdatedBy
		$this->BuildSearchSql($sWhere, $CCEStAssigExtensionRequests->DateUpdated, FALSE); // DateUpdated

		// Set up search parm
		if ($sWhere <> "") {
			$this->SetSearchParm($CCEStAssigExtensionRequests->CCEStudentID); // CCEStudentID
			$this->SetSearchParm($CCEStAssigExtensionRequests->CCEAssignmentID); // CCEAssignmentID
			$this->SetSearchParm($CCEStAssigExtensionRequests->CCEExtensionDate); // CCEExtensionDate
			$this->SetSearchParm($CCEStAssigExtensionRequests->DateRequested); // DateRequested
			$this->SetSearchParm($CCEStAssigExtensionRequests->Motivation); // Motivation
			$this->SetSearchParm($CCEStAssigExtensionRequests->Status); // Status
			$this->SetSearchParm($CCEStAssigExtensionRequests->StatusReason); // StatusReason
			$this->SetSearchParm($CCEStAssigExtensionRequests->UpdatedBy); // UpdatedBy
			$this->SetSearchParm($CCEStAssigExtensionRequests->DateUpdated); // DateUpdated
		}
		return $sWhere;
	}

	// Build search SQL
	function BuildSearchSql(&$Where, &$Fld, $MultiValue) {
		$FldParm = substr($Fld->FldVar, 2);		
		$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
		$FldOpr = $Fld->AdvancedSearch->SearchOperator; // @$_GET["z_$FldParm"]
		$FldCond = $Fld->AdvancedSearch->SearchCondition; // @$_GET["v_$FldParm"]
		$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
		$FldOpr2 = $Fld->AdvancedSearch->SearchOperator2; // @$_GET["w_$FldParm"]
		$sWrk = "";

		//$FldVal = ew_StripSlashes($FldVal);
		if (is_array($FldVal)) $FldVal = implode(",", $FldVal);

		//$FldVal2 = ew_StripSlashes($FldVal2);
		if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
		$FldOpr = strtoupper(trim($FldOpr));
		if ($FldOpr == "") $FldOpr = "=";
		$FldOpr2 = strtoupper(trim($FldOpr2));
		if ($FldOpr2 == "") $FldOpr2 = "=";
		if (EW_SEARCH_MULTI_VALUE_OPTION == 1 || $FldOpr <> "LIKE" ||
			($FldOpr2 <> "LIKE" && $FldVal2 <> ""))
			$MultiValue = FALSE;
		if ($MultiValue) {
			$sWrk1 = ($FldVal <> "") ? ew_GetMultiSearchSql($Fld, $FldVal) : ""; // Field value 1
			$sWrk2 = ($FldVal2 <> "") ? ew_GetMultiSearchSql($Fld, $FldVal2) : ""; // Field value 2
			$sWrk = $sWrk1; // Build final SQL
			if ($sWrk2 <> "")
				$sWrk = ($sWrk <> "") ? "($sWrk) $FldCond ($sWrk2)" : $sWrk2;
		} else {
			$FldVal = $this->ConvertSearchValue($Fld, $FldVal);
			$FldVal2 = $this->ConvertSearchValue($Fld, $FldVal2);
			$sWrk = ew_GetSearchSql($Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2);
		}
		if ($sWrk <> "") {
			if ($Where <> "") $Where .= " AND ";
			$Where .= "(" . $sWrk . ")";
		}
	}

	// Set search parameters
	function SetSearchParm(&$Fld) {
		global $CCEStAssigExtensionRequests;
		$FldParm = substr($Fld->FldVar, 2);
		$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
		$FldVal = ew_StripSlashes($FldVal);
		if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
		$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
		$FldVal2 = ew_StripSlashes($FldVal2);
		if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_$FldParm", $FldVal);
		$CCEStAssigExtensionRequests->setAdvancedSearch("z_$FldParm", $Fld->AdvancedSearch->SearchOperator); // @$_GET["z_$FldParm"]
		$CCEStAssigExtensionRequests->setAdvancedSearch("v_$FldParm", $Fld->AdvancedSearch->SearchCondition); // @$_GET["v_$FldParm"]
		$CCEStAssigExtensionRequests->setAdvancedSearch("y_$FldParm", $FldVal2);
		$CCEStAssigExtensionRequests->setAdvancedSearch("w_$FldParm", $Fld->AdvancedSearch->SearchOperator2); // @$_GET["w_$FldParm"]
	}

	// Get search parameters
	function GetSearchParm(&$Fld) {
		global $CCEStAssigExtensionRequests;
		$FldParm = substr($Fld->FldVar, 2);
		$Fld->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->GetAdvancedSearch("x_$FldParm");
		$Fld->AdvancedSearch->SearchOperator = $CCEStAssigExtensionRequests->GetAdvancedSearch("z_$FldParm");
		$Fld->AdvancedSearch->SearchCondition = $CCEStAssigExtensionRequests->GetAdvancedSearch("v_$FldParm");
		$Fld->AdvancedSearch->SearchValue2 = $CCEStAssigExtensionRequests->GetAdvancedSearch("y_$FldParm");
		$Fld->AdvancedSearch->SearchOperator2 = $CCEStAssigExtensionRequests->GetAdvancedSearch("w_$FldParm");
	}

	// Convert search value
	function ConvertSearchValue(&$Fld, $FldVal) {
		$Value = $FldVal;
		if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) {
			if ($FldVal <> "") $Value = ($FldVal == "1") ? $Fld->TrueValue : $Fld->FalseValue;
		} elseif ($Fld->FldDataType == EW_DATATYPE_DATE) {
			if ($FldVal <> "") $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat);
		}
		return $Value;
	}

	// Return basic search SQL
	function BasicSearchSQL($Keyword) {
		global $CCEStAssigExtensionRequests;
		$sKeyword = ew_AdjustSql($Keyword);
		$sWhere = "";
		$this->BuildBasicSearchSQL($sWhere, $CCEStAssigExtensionRequests->Motivation, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStAssigExtensionRequests->SupportingDoc, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStAssigExtensionRequests->Status, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStAssigExtensionRequests->StatusReason, $Keyword);
		$this->BuildBasicSearchSQL($sWhere, $CCEStAssigExtensionRequests->UpdatedBy, $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, $CCEStAssigExtensionRequests;
		$sSearchStr = "";
		$sSearchKeyword = $CCEStAssigExtensionRequests->BasicSearchKeyword;
		$sSearchType = $CCEStAssigExtensionRequests->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 <> "") {
			$CCEStAssigExtensionRequests->setSessionBasicSearchKeyword($sSearchKeyword);
			$CCEStAssigExtensionRequests->setSessionBasicSearchType($sSearchType);
		}
		return $sSearchStr;
	}

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

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

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

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

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

	// Clear all advanced search parameters
	function ResetAdvancedSearchParms() {
		global $CCEStAssigExtensionRequests;
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_CCEStudentID", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_CCEAssignmentID", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_CCEExtensionDate", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_DateRequested", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_Motivation", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_Status", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_StatusReason", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_UpdatedBy", "");
		$CCEStAssigExtensionRequests->setAdvancedSearch("x_DateUpdated", "");
	}

	// Restore all search parameters
	function RestoreSearchParms() {
		global $CCEStAssigExtensionRequests;
		$bRestore = TRUE;
		if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCEStudentID"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCEAssignmentID"] <> "") $bRestore = FALSE;
		if (@$_GET["x_CCEExtensionDate"] <> "") $bRestore = FALSE;
		if (@$_GET["x_DateRequested"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Motivation"] <> "") $bRestore = FALSE;
		if (@$_GET["x_Status"] <> "") $bRestore = FALSE;
		if (@$_GET["x_StatusReason"] <> "") $bRestore = FALSE;
		if (@$_GET["x_UpdatedBy"] <> "") $bRestore = FALSE;
		if (@$_GET["x_DateUpdated"] <> "") $bRestore = FALSE;
		$this->RestoreSearch = $bRestore;
		if ($bRestore) {

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

			// Restore advanced search values
			$this->GetSearchParm($CCEStAssigExtensionRequests->CCEStudentID);
			$this->GetSearchParm($CCEStAssigExtensionRequests->CCEAssignmentID);
			$this->GetSearchParm($CCEStAssigExtensionRequests->CCEExtensionDate);
			$this->GetSearchParm($CCEStAssigExtensionRequests->DateRequested);
			$this->GetSearchParm($CCEStAssigExtensionRequests->Motivation);
			$this->GetSearchParm($CCEStAssigExtensionRequests->Status);
			$this->GetSearchParm($CCEStAssigExtensionRequests->StatusReason);
			$this->GetSearchParm($CCEStAssigExtensionRequests->UpdatedBy);
			$this->GetSearchParm($CCEStAssigExtensionRequests->DateUpdated);
		}
	}

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

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

		// Check for "order" parameter
		if (@$_GET["order"] <> "") {
			$CCEStAssigExtensionRequests->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
			$CCEStAssigExtensionRequests->CurrentOrderType = @$_GET["ordertype"];
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->CCEStudentID, $bCtrl); // CCEStudentID
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->CCEAssignmentID, $bCtrl); // CCEAssignmentID
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->CCEExtensionDate, $bCtrl); // CCEExtensionDate
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->DateRequested, $bCtrl); // DateRequested
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->SupportingDoc, $bCtrl); // SupportingDoc
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->Status, $bCtrl); // Status
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->UpdatedBy, $bCtrl); // UpdatedBy
			$CCEStAssigExtensionRequests->UpdateSort($CCEStAssigExtensionRequests->DateUpdated, $bCtrl); // DateUpdated
			$CCEStAssigExtensionRequests->setStartRecordNumber(1); // Reset start position
		}
	}

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

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

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

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

			// Reset sorting order
			if (strtolower($sCmd) == "resetsort") {
				$sOrderBy = "";
				$CCEStAssigExtensionRequests->setSessionOrderBy($sOrderBy);
				$CCEStAssigExtensionRequests->CCEStudentID->setSort("");
				$CCEStAssigExtensionRequests->CCEAssignmentID->setSort("");
				$CCEStAssigExtensionRequests->CCEExtensionDate->setSort("");
				$CCEStAssigExtensionRequests->DateRequested->setSort("");
				$CCEStAssigExtensionRequests->SupportingDoc->setSort("");
				$CCEStAssigExtensionRequests->Status->setSort("");
				$CCEStAssigExtensionRequests->UpdatedBy->setSort("");
				$CCEStAssigExtensionRequests->DateUpdated->setSort("");
			}

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

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

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

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

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

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

		// "view"
		$oListOpt =& $this->ListOptions->Items["view"];
		if ($Security->IsLoggedIn() && $oListOpt->Visible)
			$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . "<img src=\"images/view.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";

		// "edit"
		$oListOpt =& $this->ListOptions->Items["edit"];
		if ($Security->IsLoggedIn() && $oListOpt->Visible) {
			$oListOpt->Body = "<a href=\"" . $this->EditUrl . "\">" . "<img src=\"images/edit.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
		}
		$this->RenderListOptionsExt();

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

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

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

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

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

		// Load search values
		// CCEStudentID

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

		// CCEAssignmentID
		$CCEStAssigExtensionRequests->CCEAssignmentID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCEAssignmentID"]);
		$CCEStAssigExtensionRequests->CCEAssignmentID->AdvancedSearch->SearchOperator = @$_GET["z_CCEAssignmentID"];

		// CCEExtensionDate
		$CCEStAssigExtensionRequests->CCEExtensionDate->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCEExtensionDate"]);
		$CCEStAssigExtensionRequests->CCEExtensionDate->AdvancedSearch->SearchOperator = @$_GET["z_CCEExtensionDate"];

		// DateRequested
		$CCEStAssigExtensionRequests->DateRequested->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_DateRequested"]);
		$CCEStAssigExtensionRequests->DateRequested->AdvancedSearch->SearchOperator = @$_GET["z_DateRequested"];

		// Motivation
		$CCEStAssigExtensionRequests->Motivation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Motivation"]);
		$CCEStAssigExtensionRequests->Motivation->AdvancedSearch->SearchOperator = @$_GET["z_Motivation"];

		// Status
		$CCEStAssigExtensionRequests->Status->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Status"]);
		$CCEStAssigExtensionRequests->Status->AdvancedSearch->SearchOperator = @$_GET["z_Status"];

		// StatusReason
		$CCEStAssigExtensionRequests->StatusReason->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_StatusReason"]);
		$CCEStAssigExtensionRequests->StatusReason->AdvancedSearch->SearchOperator = @$_GET["z_StatusReason"];

		// UpdatedBy
		$CCEStAssigExtensionRequests->UpdatedBy->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_UpdatedBy"]);
		$CCEStAssigExtensionRequests->UpdatedBy->AdvancedSearch->SearchOperator = @$_GET["z_UpdatedBy"];

		// DateUpdated
		$CCEStAssigExtensionRequests->DateUpdated->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_DateUpdated"]);
		$CCEStAssigExtensionRequests->DateUpdated->AdvancedSearch->SearchOperator = @$_GET["z_DateUpdated"];
	}

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

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

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

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

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

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

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

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

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

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $CCEStAssigExtensionRequests;
		$CCEStAssigExtensionRequests->CCEStAssigExtensionID->setDbValue($rs->fields('CCEStAssigExtensionID'));
		$CCEStAssigExtensionRequests->CCEStudentID->setDbValue($rs->fields('CCEStudentID'));
		$CCEStAssigExtensionRequests->CCEAssignmentID->setDbValue($rs->fields('CCEAssignmentID'));
		$CCEStAssigExtensionRequests->CCEExtensionDate->setDbValue($rs->fields('CCEExtensionDate'));
		$CCEStAssigExtensionRequests->DateRequested->setDbValue($rs->fields('DateRequested'));
		$CCEStAssigExtensionRequests->Motivation->setDbValue($rs->fields('Motivation'));
		$CCEStAssigExtensionRequests->SupportingDoc->Upload->DbValue = $rs->fields('SupportingDoc');
		$CCEStAssigExtensionRequests->Status->setDbValue($rs->fields('Status'));
		$CCEStAssigExtensionRequests->StatusReason->setDbValue($rs->fields('StatusReason'));
		$CCEStAssigExtensionRequests->UpdatedBy->setDbValue($rs->fields('UpdatedBy'));
		$CCEStAssigExtensionRequests->DateUpdated->setDbValue($rs->fields('DateUpdated'));
		$CCEStAssigExtensionRequests->CCEStudentAssigID->setDbValue($rs->fields('CCEStudentAssigID'));
	}

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

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

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

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

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

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

		// CCEExtensionDate
		$CCEStAssigExtensionRequests->CCEExtensionDate->CellCssStyle = ""; $CCEStAssigExtensionRequests->CCEExtensionDate->CellCssClass = "";
		$CCEStAssigExtensionRequests->CCEExtensionDate->CellAttrs = array(); $CCEStAssigExtensionRequests->CCEExtensionDate->ViewAttrs = array(); $CCEStAssigExtensionRequests->CCEExtensionDate->EditAttrs = array();

		// DateRequested
		$CCEStAssigExtensionRequests->DateRequested->CellCssStyle = ""; $CCEStAssigExtensionRequests->DateRequested->CellCssClass = "";
		$CCEStAssigExtensionRequests->DateRequested->CellAttrs = array(); $CCEStAssigExtensionRequests->DateRequested->ViewAttrs = array(); $CCEStAssigExtensionRequests->DateRequested->EditAttrs = array();

		// SupportingDoc
		$CCEStAssigExtensionRequests->SupportingDoc->CellCssStyle = ""; $CCEStAssigExtensionRequests->SupportingDoc->CellCssClass = "";
		$CCEStAssigExtensionRequests->SupportingDoc->CellAttrs = array(); $CCEStAssigExtensionRequests->SupportingDoc->ViewAttrs = array(); $CCEStAssigExtensionRequests->SupportingDoc->EditAttrs = array();

		// Status
		$CCEStAssigExtensionRequests->Status->CellCssStyle = ""; $CCEStAssigExtensionRequests->Status->CellCssClass = "";
		$CCEStAssigExtensionRequests->Status->CellAttrs = array(); $CCEStAssigExtensionRequests->Status->ViewAttrs = array(); $CCEStAssigExtensionRequests->Status->EditAttrs = array();

		// UpdatedBy
		$CCEStAssigExtensionRequests->UpdatedBy->CellCssStyle = ""; $CCEStAssigExtensionRequests->UpdatedBy->CellCssClass = "";
		$CCEStAssigExtensionRequests->UpdatedBy->CellAttrs = array(); $CCEStAssigExtensionRequests->UpdatedBy->ViewAttrs = array(); $CCEStAssigExtensionRequests->UpdatedBy->EditAttrs = array();

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

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

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

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

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

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

			// Status
			if (strval($CCEStAssigExtensionRequests->Status->CurrentValue) <> "") {
				switch ($CCEStAssigExtensionRequests->Status->CurrentValue) {
					case "":
						$CCEStAssigExtensionRequests->Status->ViewValue = "Pending";
						break;
					case "A":
						$CCEStAssigExtensionRequests->Status->ViewValue = "Approved";
						break;
					case "P":
						$CCEStAssigExtensionRequests->Status->ViewValue = "Approved with Penalty";
						break;
					case "D":
						$CCEStAssigExtensionRequests->Status->ViewValue = "Declined";
						break;
					default:
						$CCEStAssigExtensionRequests->Status->ViewValue = $CCEStAssigExtensionRequests->Status->CurrentValue;
				}
			} else {
				$CCEStAssigExtensionRequests->Status->ViewValue = NULL;
			}
			$CCEStAssigExtensionRequests->Status->CssStyle = "";
			$CCEStAssigExtensionRequests->Status->CssClass = "";
			$CCEStAssigExtensionRequests->Status->ViewCustomAttributes = "";

			// UpdatedBy
			$CCEStAssigExtensionRequests->UpdatedBy->ViewValue = $CCEStAssigExtensionRequests->UpdatedBy->CurrentValue;
			$CCEStAssigExtensionRequests->UpdatedBy->CssStyle = "";
			$CCEStAssigExtensionRequests->UpdatedBy->CssClass = "";
			$CCEStAssigExtensionRequests->UpdatedBy->ViewCustomAttributes = "";

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

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

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

			// CCEExtensionDate
			$CCEStAssigExtensionRequests->CCEExtensionDate->HrefValue = "";
			$CCEStAssigExtensionRequests->CCEExtensionDate->TooltipValue = "";

			// DateRequested
			$CCEStAssigExtensionRequests->DateRequested->HrefValue = "";
			$CCEStAssigExtensionRequests->DateRequested->TooltipValue = "";

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

			// Status
			$CCEStAssigExtensionRequests->Status->HrefValue = "";
			$CCEStAssigExtensionRequests->Status->TooltipValue = "";

			// UpdatedBy
			$CCEStAssigExtensionRequests->UpdatedBy->HrefValue = "";
			$CCEStAssigExtensionRequests->UpdatedBy->TooltipValue = "";

			// DateUpdated
			$CCEStAssigExtensionRequests->DateUpdated->HrefValue = "";
			$CCEStAssigExtensionRequests->DateUpdated->TooltipValue = "";
		}

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

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

		// Initialize
		$gsSearchError = "";

		// Check if validation required
		if (!EW_SERVER_VALIDATE)
			return TRUE;

		// Return validate result
		$ValidateSearch = ($gsSearchError == "");

		// Call Form_CustomValidate event
		$sFormCustomError = "";
		$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
		if ($sFormCustomError <> "") {
			if ($gsSearchError <> "") $gsSearchError .= "<br>";
			$gsSearchError .= $sFormCustomError;
		}
		return $ValidateSearch;
	}

	// Load advanced search
	function LoadAdvancedSearch() {
		global $CCEStAssigExtensionRequests;
		$CCEStAssigExtensionRequests->CCEStudentID->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_CCEStudentID");
		$CCEStAssigExtensionRequests->CCEAssignmentID->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_CCEAssignmentID");
		$CCEStAssigExtensionRequests->CCEExtensionDate->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_CCEExtensionDate");
		$CCEStAssigExtensionRequests->DateRequested->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_DateRequested");
		$CCEStAssigExtensionRequests->Motivation->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_Motivation");
		$CCEStAssigExtensionRequests->Status->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_Status");
		$CCEStAssigExtensionRequests->StatusReason->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_StatusReason");
		$CCEStAssigExtensionRequests->UpdatedBy->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_UpdatedBy");
		$CCEStAssigExtensionRequests->DateUpdated->AdvancedSearch->SearchValue = $CCEStAssigExtensionRequests->getAdvancedSearch("x_DateUpdated");
	}

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

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

		// Export all
		if ($CCEStAssigExtensionRequests->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 ($CCEStAssigExtensionRequests->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($CCEStAssigExtensionRequests, "h");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->CCEStudentID);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->CCEAssignmentID);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->CCEExtensionDate);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->DateRequested);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->SupportingDoc);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->Status);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->UpdatedBy);
				$ExportDoc->ExportCaption($CCEStAssigExtensionRequests->DateUpdated);
				$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
				$CCEStAssigExtensionRequests->CssClass = "";
				$CCEStAssigExtensionRequests->CssStyle = "";
				$CCEStAssigExtensionRequests->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($CCEStAssigExtensionRequests->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('CCEStudentID', $CCEStAssigExtensionRequests->CCEStudentID->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('CCEAssignmentID', $CCEStAssigExtensionRequests->CCEAssignmentID->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('CCEExtensionDate', $CCEStAssigExtensionRequests->CCEExtensionDate->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('DateRequested', $CCEStAssigExtensionRequests->DateRequested->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('SupportingDoc', $CCEStAssigExtensionRequests->SupportingDoc->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('Status', $CCEStAssigExtensionRequests->Status->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('UpdatedBy', $CCEStAssigExtensionRequests->UpdatedBy->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
					$XmlDoc->AddField('DateUpdated', $CCEStAssigExtensionRequests->DateUpdated->ExportValue($CCEStAssigExtensionRequests->Export, $CCEStAssigExtensionRequests->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->CCEStudentID);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->CCEAssignmentID);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->CCEExtensionDate);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->DateRequested);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->SupportingDoc);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->Status);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->UpdatedBy);
					$ExportDoc->ExportField($CCEStAssigExtensionRequests->DateUpdated);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($CCEStAssigExtensionRequests->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($CCEStAssigExtensionRequests->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

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

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

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

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

		// Build QueryString for search
		if ($CCEStAssigExtensionRequests->getSessionBasicSearchKeyword() <> "") {
			$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $CCEStAssigExtensionRequests->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $CCEStAssigExtensionRequests->getSessionBasicSearchType();
		}
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->CCEStudentID); // CCEStudentID
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->CCEAssignmentID); // CCEAssignmentID
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->CCEExtensionDate); // CCEExtensionDate
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->DateRequested); // DateRequested
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->Motivation); // Motivation
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->Status); // Status
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->StatusReason); // StatusReason
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->UpdatedBy); // UpdatedBy
		$this->AddSearchQueryString($sQry, $CCEStAssigExtensionRequests->DateUpdated); // DateUpdated

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

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

		// Page Load event
function Page_Load() {
    CCEStAssigExtensionRequestPageLoad();
}

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

	}
}
?>