Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/cceadmin/
Upload File :
Current File : /var/www/cesa.co.za/cceadmin/CCEStudentAssignmentsdelete.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_delete = new cCCEStudentAssignments_delete();
$Page =& $CCEStudentAssignments_delete;

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

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

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

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

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

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

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

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

</script>
<?php

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

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

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

	// Render row
	$CCEStudentAssignments_delete->RenderRow();
?>
	<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
		<td<?php echo $CCEStudentAssignments->CCEStudentID->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->CCEStudentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEStudentID->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->CCEAssignmentID->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->CCEAssignmentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEAssignmentID->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->DateSubmitted->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->DateSubmitted->ViewAttributes() ?>><?php echo $CCEStudentAssignments->DateSubmitted->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->Passed->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->Passed->ViewAttributes() ?>><?php echo $CCEStudentAssignments->Passed->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->RulingCode->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->RulingCode->ViewAttributes() ?>><?php echo $CCEStudentAssignments->RulingCode->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->AssignmentScore->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->AssignmentScore->ViewAttributes() ?>><?php echo $CCEStudentAssignments->AssignmentScore->ListViewValue() ?></div></td>
		<td<?php echo $CCEStudentAssignments->ResubmitDateOverride->CellAttributes() ?>>
<div<?php echo $CCEStudentAssignments->ResubmitDateOverride->ViewAttributes() ?>><?php echo $CCEStudentAssignments->ResubmitDateOverride->ListViewValue() ?></div></td>
	</tr>
<?php
	$rs->MoveNext();
}
$rs->Close();
?>
</tbody>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="Action" id="Action" value="<?php echo ew_BtnCaption($Language->Phrase("DeleteBtn")) ?>">
</form>
<script language="JavaScript" type="text/javascript">
<!--

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

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

//
// Page class
//
class cCCEStudentAssignments_delete {

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

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

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

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

		// 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", 'delete', 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();
	}

	// 
	//  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->CanDelete()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("CCEStudentAssignmentslist.php");
		}

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

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

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

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

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

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

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

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

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

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

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

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

		$CCEStudentAssignments->CurrentFilter = $sFilter;

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

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

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

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

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

		// Call row deleting event
		if ($DeleteRows) {
			foreach ($rsold as $row) {
				$DeleteRows = $CCEStudentAssignments->Row_Deleting($row);
				if (!$DeleteRows) break;
			}
		}
		if ($DeleteRows) {
			$sKey = "";
			foreach ($rsold as $row) {
				$sThisKey = "";
				if ($sThisKey <> "") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;
				$sThisKey .= $row['CCEStudentAssigID'];
				$conn->raiseErrorFn = 'ew_ErrorFn';
				$DeleteRows = $conn->Execute($CCEStudentAssignments->DeleteSQL($row)); // Delete
				$conn->raiseErrorFn = '';
				if ($DeleteRows === FALSE)
					break;
				if ($sKey <> "") $sKey .= ", ";
				$sKey .= $sThisKey;
			}
		} else {

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

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

	// 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
		// 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();
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

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

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

	}

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

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

	}
}
?>