| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/CCEStudentAssignmentsedit.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 "CCEFacilitatorUsersinfo.php" ?>
<?php include "CCEStudentsinfo.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_edit = new cCCEStudentAssignments_edit();
$Page =& $CCEStudentAssignments_edit;
// Page init
$CCEStudentAssignments_edit->Page_Init();
// Page main
$CCEStudentAssignments_edit->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CCEStudentAssignments_edit = new ew_Page("CCEStudentAssignments_edit");
// page properties
CCEStudentAssignments_edit.PageID = "edit"; // page ID
CCEStudentAssignments_edit.FormID = "fCCEStudentAssignmentsedit"; // form ID
var EW_PAGE_ID = CCEStudentAssignments_edit.PageID; // for backward compatibility
// extend page with ValidateForm function
CCEStudentAssignments_edit.ValidateForm = function(fobj) {
ew_PostAutoSuggest(fobj);
if (!this.ValidateRequired)
return true; // ignore validation
if (fobj.a_confirm && fobj.a_confirm.value == "F")
return true;
var i, elm, aelm, infix;
var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
for (i=0; i<rowcnt; i++) {
infix = (fobj.key_count) ? String(i+1) : "";
elm = fobj.elements["x" + infix + "_AssignmentFile4"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_AssignmentFile5"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_ResubmitDateOverride"];
if (elm && !ew_CheckDate(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEStudentAssignments->ResubmitDateOverride->FldErrMsg()) ?>");
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CCEStudentAssignments_edit.Form_CustomValidate = function(fobj) { // DO NOT CHANGE THIS LINE!
// Your custom validation code here, return false if invalid.
var elm = fobj.elements["x_LFSentTo[]"];
var elm2 = fobj.elements["x_LastFeedback"];
if (elm && elm2 && !ew_HasValue(elm) && ew_HasValue(elm2)) {
alert('You have not selected anyone to send the feedback to.');
return false;
} else {
return true;
}
}
<?php if (EW_CLIENT_VALIDATE) { ?>
CCEStudentAssignments_edit.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEStudentAssignments_edit.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>
<p><span class="phpmaker"><?php echo $Language->Phrase("Edit") ?> <?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_edit->ShowMessage();
?>
<form name="fCCEStudentAssignmentsedit" id="fCCEStudentAssignmentsedit" action="<?php echo ew_CurrentPage() ?>" method="post" enctype="multipart/form-data" onsubmit="return CCEStudentAssignments_edit.ValidateForm(this);">
<p>
<input type="hidden" name="a_table" id="a_table" value="CCEStudentAssignments">
<input type="hidden" name="a_edit" id="a_edit" value="U">
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<input type="hidden" name="x_CCEStudentAssigID" id="x_CCEStudentAssigID" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->CCEStudentAssigID->CurrentValue) ?>">
<?php if ($CCEStudentAssignments->CCEStudentID->Visible) { // CCEStudentID ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->CCEStudentID->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->CCEStudentID->CellAttributes() ?>><span id="el_CCEStudentID">
<div<?php echo $CCEStudentAssignments->CCEStudentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEStudentID->EditValue ?></div><input type="hidden" name="x_CCEStudentID" id="x_CCEStudentID" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->CCEStudentID->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->CCEStudentID->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->CCEAssignmentID->Visible) { // CCEAssignmentID ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->CCEAssignmentID->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->CCEAssignmentID->CellAttributes() ?>><span id="el_CCEAssignmentID">
<div<?php echo $CCEStudentAssignments->CCEAssignmentID->ViewAttributes() ?>><?php echo $CCEStudentAssignments->CCEAssignmentID->EditValue ?></div><input type="hidden" name="x_CCEAssignmentID" id="x_CCEAssignmentID" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->CCEAssignmentID->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->CCEAssignmentID->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentFile1->Visible) { // AssignmentFile1 ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentFile1->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentFile1->CellAttributes() ?>><span id="el_AssignmentFile1">
<?php if ($CCEStudentAssignments->AssignmentFile1->HrefValue <> "" || $CCEStudentAssignments->AssignmentFile1->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile1->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->AssignmentFile1->HrefValue ?>"><?php echo $CCEStudentAssignments->AssignmentFile1->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile1->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->AssignmentFile1->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="x_AssignmentFile1" id="x_AssignmentFile1" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->AssignmentFile1->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->AssignmentFile1->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentFile2->Visible) { // AssignmentFile2 ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentFile2->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentFile2->CellAttributes() ?>><span id="el_AssignmentFile2">
<?php if ($CCEStudentAssignments->AssignmentFile2->HrefValue <> "" || $CCEStudentAssignments->AssignmentFile2->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile2->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->AssignmentFile2->HrefValue ?>"><?php echo $CCEStudentAssignments->AssignmentFile2->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile2->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->AssignmentFile2->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="x_AssignmentFile2" id="x_AssignmentFile2" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->AssignmentFile2->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->AssignmentFile2->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentFile3->Visible) { // AssignmentFile3 ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentFile3->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentFile3->CellAttributes() ?>><span id="el_AssignmentFile3">
<?php if ($CCEStudentAssignments->AssignmentFile3->HrefValue <> "" || $CCEStudentAssignments->AssignmentFile3->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile3->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->AssignmentFile3->HrefValue ?>"><?php echo $CCEStudentAssignments->AssignmentFile3->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile3->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->AssignmentFile3->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="x_AssignmentFile3" id="x_AssignmentFile3" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->AssignmentFile3->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->AssignmentFile3->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentFile4->Visible) { // AssignmentFile4 ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentFile4->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentFile4->CellAttributes() ?>><span id="el_AssignmentFile4">
<div id="old_x_AssignmentFile4">
<?php if ($CCEStudentAssignments->AssignmentFile4->HrefValue <> "" || $CCEStudentAssignments->AssignmentFile4->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->AssignmentFile4->HrefValue ?>"><?php echo $CCEStudentAssignments->AssignmentFile4->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->AssignmentFile4->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
</div>
<div id="new_x_AssignmentFile4">
<?php if (!empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) { ?>
<label><input type="radio" name="a_AssignmentFile4" id="a_AssignmentFile4" value="1" checked="checked"><?php echo $Language->Phrase("Keep") ?></label>
<label><input type="radio" name="a_AssignmentFile4" id="a_AssignmentFile4" value="2"><?php echo $Language->Phrase("Remove") ?></label>
<label><input type="radio" name="a_AssignmentFile4" id="a_AssignmentFile4" value="3"><?php echo $Language->Phrase("Replace") ?><br></label>
<?php $CCEStudentAssignments->AssignmentFile4->EditAttrs["onchange"] = "this.form.a_AssignmentFile4[2].checked=true;" . @$CCEStudentAssignments->AssignmentFile4->EditAttrs["onchange"]; ?>
<?php } else { ?>
<input type="hidden" name="a_AssignmentFile4" id="a_AssignmentFile4" value="3">
<?php } ?>
<input type="file" name="x_AssignmentFile4" id="x_AssignmentFile4" title="<?php echo $CCEStudentAssignments->AssignmentFile4->FldTitle() ?>" size="30"<?php echo $CCEStudentAssignments->AssignmentFile4->EditAttributes() ?>>
</div>
</span><?php echo $CCEStudentAssignments->AssignmentFile4->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentFile5->Visible) { // AssignmentFile5 ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentFile5->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentFile5->CellAttributes() ?>><span id="el_AssignmentFile5">
<div id="old_x_AssignmentFile5">
<?php if ($CCEStudentAssignments->AssignmentFile5->HrefValue <> "" || $CCEStudentAssignments->AssignmentFile5->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->AssignmentFile5->HrefValue ?>"><?php echo $CCEStudentAssignments->AssignmentFile5->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->AssignmentFile5->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
</div>
<div id="new_x_AssignmentFile5">
<?php if (!empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) { ?>
<label><input type="radio" name="a_AssignmentFile5" id="a_AssignmentFile5" value="1" checked="checked"><?php echo $Language->Phrase("Keep") ?></label>
<label><input type="radio" name="a_AssignmentFile5" id="a_AssignmentFile5" value="2"><?php echo $Language->Phrase("Remove") ?></label>
<label><input type="radio" name="a_AssignmentFile5" id="a_AssignmentFile5" value="3"><?php echo $Language->Phrase("Replace") ?><br></label>
<?php $CCEStudentAssignments->AssignmentFile5->EditAttrs["onchange"] = "this.form.a_AssignmentFile5[2].checked=true;" . @$CCEStudentAssignments->AssignmentFile5->EditAttrs["onchange"]; ?>
<?php } else { ?>
<input type="hidden" name="a_AssignmentFile5" id="a_AssignmentFile5" value="3">
<?php } ?>
<input type="file" name="x_AssignmentFile5" id="x_AssignmentFile5" title="<?php echo $CCEStudentAssignments->AssignmentFile5->FldTitle() ?>" size="30"<?php echo $CCEStudentAssignments->AssignmentFile5->EditAttributes() ?>>
</div>
</span><?php echo $CCEStudentAssignments->AssignmentFile5->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->Comments->Visible) { // Comments ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->Comments->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->Comments->CellAttributes() ?>><span id="el_Comments">
<div<?php echo $CCEStudentAssignments->Comments->ViewAttributes() ?>><?php echo $CCEStudentAssignments->Comments->EditValue ?></div><input type="hidden" name="x_Comments" id="x_Comments" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->Comments->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->Comments->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->DateSubmitted->Visible) { // DateSubmitted ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->DateSubmitted->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->DateSubmitted->CellAttributes() ?>><span id="el_DateSubmitted">
<div<?php echo $CCEStudentAssignments->DateSubmitted->ViewAttributes() ?>><?php echo $CCEStudentAssignments->DateSubmitted->EditValue ?></div><input type="hidden" name="x_DateSubmitted" id="x_DateSubmitted" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->DateSubmitted->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->DateSubmitted->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->Passed->Visible) { // Passed ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->Passed->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->Passed->CellAttributes() ?>><span id="el_Passed">
<div<?php echo $CCEStudentAssignments->Passed->ViewAttributes() ?>><?php echo $CCEStudentAssignments->Passed->EditValue ?></div><input type="hidden" name="x_Passed" id="x_Passed" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->Passed->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->Passed->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->RulingCode->Visible) { // RulingCode ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->RulingCode->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->RulingCode->CellAttributes() ?>><span id="el_RulingCode">
<div<?php echo $CCEStudentAssignments->RulingCode->ViewAttributes() ?>><?php echo $CCEStudentAssignments->RulingCode->EditValue ?></div><input type="hidden" name="x_RulingCode" id="x_RulingCode" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->RulingCode->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->RulingCode->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->AssignmentScore->Visible) { // AssignmentScore ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->AssignmentScore->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->AssignmentScore->CellAttributes() ?>><span id="el_AssignmentScore">
<div<?php echo $CCEStudentAssignments->AssignmentScore->ViewAttributes() ?>><?php echo $CCEStudentAssignments->AssignmentScore->EditValue ?></div><input type="hidden" name="x_AssignmentScore" id="x_AssignmentScore" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->AssignmentScore->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->AssignmentScore->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->ScoredBy->Visible) { // ScoredBy ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->ScoredBy->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->ScoredBy->CellAttributes() ?>><span id="el_ScoredBy">
<div<?php echo $CCEStudentAssignments->ScoredBy->ViewAttributes() ?>><?php echo $CCEStudentAssignments->ScoredBy->EditValue ?></div><input type="hidden" name="x_ScoredBy" id="x_ScoredBy" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->ScoredBy->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->ScoredBy->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->Remarks->Visible) { // Remarks ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->Remarks->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->Remarks->CellAttributes() ?>><span id="el_Remarks">
<div<?php echo $CCEStudentAssignments->Remarks->ViewAttributes() ?>><?php echo $CCEStudentAssignments->Remarks->EditValue ?></div><input type="hidden" name="x_Remarks" id="x_Remarks" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->Remarks->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->Remarks->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->LFSentTo->Visible) { // LFSentTo ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->LFSentTo->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->LFSentTo->CellAttributes() ?>><span id="el_LFSentTo">
<div<?php echo $CCEStudentAssignments->LFSentTo->ViewAttributes() ?>><?php echo $CCEStudentAssignments->LFSentTo->EditValue ?></div><input type="hidden" name="x_LFSentTo[]" id="x_LFSentTo[]" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->LFSentTo->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->LFSentTo->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->LastFeedback->Visible) { // LastFeedback ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->LastFeedback->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->LastFeedback->CellAttributes() ?>><span id="el_LastFeedback">
<div<?php echo $CCEStudentAssignments->LastFeedback->ViewAttributes() ?>><?php echo $CCEStudentAssignments->LastFeedback->EditValue ?></div><input type="hidden" name="x_LastFeedback" id="x_LastFeedback" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->LastFeedback->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->LastFeedback->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->MsgAttachment->Visible) { // MsgAttachment ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->MsgAttachment->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->MsgAttachment->CellAttributes() ?>><span id="el_MsgAttachment">
<?php if ($CCEStudentAssignments->MsgAttachment->HrefValue <> "" || $CCEStudentAssignments->MsgAttachment->TooltipValue <> "") { ?>
<?php if (!empty($CCEStudentAssignments->MsgAttachment->Upload->DbValue)) { ?>
<a href="<?php echo $CCEStudentAssignments->MsgAttachment->HrefValue ?>"><?php echo $CCEStudentAssignments->MsgAttachment->EditValue ?></a>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEStudentAssignments->MsgAttachment->Upload->DbValue)) { ?>
<?php echo $CCEStudentAssignments->MsgAttachment->EditValue ?>
<?php } elseif (!in_array($CCEStudentAssignments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
<input type="hidden" name="x_MsgAttachment" id="x_MsgAttachment" value="<?php echo ew_HtmlEncode($CCEStudentAssignments->MsgAttachment->CurrentValue) ?>">
</span><?php echo $CCEStudentAssignments->MsgAttachment->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->Extended->Visible) { // Extended ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->Extended->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCEStudentAssignments->Extended->CellAttributes() ?>><span id="el_Extended">
<div id="tp_x_Extended" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x_Extended" id="x_Extended" title="<?php echo $CCEStudentAssignments->Extended->FldTitle() ?>" value="{value}"<?php echo $CCEStudentAssignments->Extended->EditAttributes() ?>></label></div>
<div id="dsl_x_Extended" repeatcolumn="5">
<?php
$arwrk = $CCEStudentAssignments->Extended->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCEStudentAssignments->Extended->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x_Extended" id="x_Extended" title="<?php echo $CCEStudentAssignments->Extended->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CCEStudentAssignments->Extended->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CCEStudentAssignments->Extended->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->References->Visible) { // References ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->References->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->References->CellAttributes() ?>><span id="el_References">
<textarea name="x_References" id="x_References" title="<?php echo $CCEStudentAssignments->References->FldTitle() ?>" cols="35" rows="4"<?php echo $CCEStudentAssignments->References->EditAttributes() ?>><?php echo $CCEStudentAssignments->References->EditValue ?></textarea>
</span><?php echo $CCEStudentAssignments->References->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->TempR->Visible) { // TempR ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->TempR->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->TempR->CellAttributes() ?>><span id="el_TempR">
<textarea name="x_TempR" id="x_TempR" title="<?php echo $CCEStudentAssignments->TempR->FldTitle() ?>" cols="35" rows="4"<?php echo $CCEStudentAssignments->TempR->EditAttributes() ?>><?php echo $CCEStudentAssignments->TempR->EditValue ?></textarea>
</span><?php echo $CCEStudentAssignments->TempR->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEStudentAssignments->ResubmitDateOverride->Visible) { // ResubmitDateOverride ?>
<tr<?php echo $CCEStudentAssignments->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEStudentAssignments->ResubmitDateOverride->FldCaption() ?></td>
<td<?php echo $CCEStudentAssignments->ResubmitDateOverride->CellAttributes() ?>><span id="el_ResubmitDateOverride">
<input type="text" name="x_ResubmitDateOverride" id="x_ResubmitDateOverride" title="<?php echo $CCEStudentAssignments->ResubmitDateOverride->FldTitle() ?>" value="<?php echo $CCEStudentAssignments->ResubmitDateOverride->EditValue ?>"<?php echo $CCEStudentAssignments->ResubmitDateOverride->EditAttributes() ?>>
</span><?php echo $CCEStudentAssignments->ResubmitDateOverride->CustomMsg ?></td>
</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="btnAction" id="btnAction" value="<?php echo ew_BtnCaption($Language->Phrase("EditBtn")) ?>">
</form>
<script language="JavaScript" type="text/javascript">
<!--
// Write your table-specific startup script here
// document.write("page loaded");
document.getElementById('btnAction').value='Edit / Send';
//-->
</script>
<?php include "footer.php" ?>
<?php
$CCEStudentAssignments_edit->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCEStudentAssignments_edit {
// Page ID
var $PageID = 'edit';
// Table name
var $TableName = 'CCEStudentAssignments';
// Page object name
var $PageObjName = 'CCEStudentAssignments_edit';
// 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 (CCEFacilitatorUsers)
$GLOBALS['CCEFacilitatorUsers'] = new cCCEFacilitatorUsers();
// Table object (CCEStudents)
$GLOBALS['CCEStudents'] = new cCCEStudents();
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'edit', 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");
}
// Create form object
$objForm = new cFormObj();
// 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 $sDbMasterFilter;
var $sDbDetailFilter;
//
// Page main
//
function Page_Main() {
global $objForm, $Language, $gsFormError, $CCEStudentAssignments;
// Load key from QueryString
if (@$_GET["CCEStudentAssigID"] <> "")
$CCEStudentAssignments->CCEStudentAssigID->setQueryStringValue($_GET["CCEStudentAssigID"]);
// Set up master detail parameters
$this->SetUpMasterDetail();
if (@$_POST["a_edit"] <> "") {
$CCEStudentAssignments->CurrentAction = $_POST["a_edit"]; // Get action code
$this->GetUploadFiles(); // Get upload files
$this->LoadFormValues(); // Get form values
// Validate form
if (!$this->ValidateForm()) {
$CCEStudentAssignments->CurrentAction = ""; // Form error, reset action
$this->setMessage($gsFormError);
$CCEStudentAssignments->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues();
}
} else {
$CCEStudentAssignments->CurrentAction = "I"; // Default action is display
}
// Check if valid key
if ($CCEStudentAssignments->CCEStudentAssigID->CurrentValue == "")
$this->Page_Terminate("CCEStudentAssignmentslist.php"); // Invalid key, return to list
switch ($CCEStudentAssignments->CurrentAction) {
case "I": // Get a record to display
if (!$this->LoadRow()) { // Load record based on key
$this->setMessage($Language->Phrase("NoRecord")); // No record found
$this->Page_Terminate("CCEStudentAssignmentslist.php"); // No matching record, return to list
}
break;
Case "U": // Update
$CCEStudentAssignments->SendEmail = TRUE; // Send email on update success
if ($this->EditRow()) { // Update record based on key
$this->setMessage($Language->Phrase("UpdateSuccess")); // Update success
$sReturnUrl = $CCEStudentAssignments->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CCEStudentAssignmentsview.php")
$sReturnUrl = $CCEStudentAssignments->ViewUrl(); // View paging, return to View page directly
$this->Page_Terminate($sReturnUrl); // Return to caller
} else {
$CCEStudentAssignments->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues(); // Restore form values if update failed
}
}
// Render the record
$CCEStudentAssignments->RowType = EW_ROWTYPE_EDIT; // Render as Edit
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CCEStudentAssignments;
// Get upload data
if ($CCEStudentAssignments->AssignmentFile1->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->AssignmentFile1->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CCEStudentAssignments->AssignmentFile2->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->AssignmentFile2->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CCEStudentAssignments->AssignmentFile3->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->AssignmentFile3->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CCEStudentAssignments->AssignmentFile4->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->AssignmentFile4->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CCEStudentAssignments->AssignmentFile5->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->AssignmentFile5->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CCEStudentAssignments->MsgAttachment->Upload->UploadFile()) {
// No action required
} else {
echo $CCEStudentAssignments->MsgAttachment->Upload->Message;
$this->Page_Terminate();
exit();
}
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CCEStudentAssignments;
$CCEStudentAssignments->CCEStudentAssigID->setFormValue($objForm->GetValue("x_CCEStudentAssigID"));
$CCEStudentAssignments->CCEStudentID->setFormValue($objForm->GetValue("x_CCEStudentID"));
$CCEStudentAssignments->CCEAssignmentID->setFormValue($objForm->GetValue("x_CCEAssignmentID"));
$CCEStudentAssignments->Comments->setFormValue($objForm->GetValue("x_Comments"));
$CCEStudentAssignments->DateSubmitted->setFormValue($objForm->GetValue("x_DateSubmitted"));
$CCEStudentAssignments->DateSubmitted->CurrentValue = ew_UnFormatDateTime($CCEStudentAssignments->DateSubmitted->CurrentValue, 9);
$CCEStudentAssignments->Passed->setFormValue($objForm->GetValue("x_Passed"));
$CCEStudentAssignments->RulingCode->setFormValue($objForm->GetValue("x_RulingCode"));
$CCEStudentAssignments->AssignmentScore->setFormValue($objForm->GetValue("x_AssignmentScore"));
$CCEStudentAssignments->ScoredBy->setFormValue($objForm->GetValue("x_ScoredBy"));
$CCEStudentAssignments->Remarks->setFormValue($objForm->GetValue("x_Remarks"));
$CCEStudentAssignments->LFSentTo->setFormValue($objForm->GetValue("x_LFSentTo"));
$CCEStudentAssignments->LastFeedback->setFormValue($objForm->GetValue("x_LastFeedback"));
$CCEStudentAssignments->Extended->setFormValue($objForm->GetValue("x_Extended"));
$CCEStudentAssignments->References->setFormValue($objForm->GetValue("x_References"));
$CCEStudentAssignments->TempR->setFormValue($objForm->GetValue("x_TempR"));
$CCEStudentAssignments->ResubmitDateOverride->setFormValue($objForm->GetValue("x_ResubmitDateOverride"));
$CCEStudentAssignments->ResubmitDateOverride->CurrentValue = ew_UnFormatDateTime($CCEStudentAssignments->ResubmitDateOverride->CurrentValue, 5);
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CCEStudentAssignments;
$this->LoadRow();
$CCEStudentAssignments->CCEStudentAssigID->CurrentValue = $CCEStudentAssignments->CCEStudentAssigID->FormValue;
$CCEStudentAssignments->CCEStudentID->CurrentValue = $CCEStudentAssignments->CCEStudentID->FormValue;
$CCEStudentAssignments->CCEAssignmentID->CurrentValue = $CCEStudentAssignments->CCEAssignmentID->FormValue;
$CCEStudentAssignments->Comments->CurrentValue = $CCEStudentAssignments->Comments->FormValue;
$CCEStudentAssignments->DateSubmitted->CurrentValue = $CCEStudentAssignments->DateSubmitted->FormValue;
$CCEStudentAssignments->DateSubmitted->CurrentValue = ew_UnFormatDateTime($CCEStudentAssignments->DateSubmitted->CurrentValue, 9);
$CCEStudentAssignments->Passed->CurrentValue = $CCEStudentAssignments->Passed->FormValue;
$CCEStudentAssignments->RulingCode->CurrentValue = $CCEStudentAssignments->RulingCode->FormValue;
$CCEStudentAssignments->AssignmentScore->CurrentValue = $CCEStudentAssignments->AssignmentScore->FormValue;
$CCEStudentAssignments->ScoredBy->CurrentValue = $CCEStudentAssignments->ScoredBy->FormValue;
$CCEStudentAssignments->Remarks->CurrentValue = $CCEStudentAssignments->Remarks->FormValue;
$CCEStudentAssignments->LFSentTo->CurrentValue = $CCEStudentAssignments->LFSentTo->FormValue;
$CCEStudentAssignments->LastFeedback->CurrentValue = $CCEStudentAssignments->LastFeedback->FormValue;
$CCEStudentAssignments->Extended->CurrentValue = $CCEStudentAssignments->Extended->FormValue;
$CCEStudentAssignments->References->CurrentValue = $CCEStudentAssignments->References->FormValue;
$CCEStudentAssignments->TempR->CurrentValue = $CCEStudentAssignments->TempR->FormValue;
$CCEStudentAssignments->ResubmitDateOverride->CurrentValue = $CCEStudentAssignments->ResubmitDateOverride->FormValue;
$CCEStudentAssignments->ResubmitDateOverride->CurrentValue = ew_UnFormatDateTime($CCEStudentAssignments->ResubmitDateOverride->CurrentValue, 5);
}
// 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
// CCEStudentAssigID
$CCEStudentAssignments->CCEStudentAssigID->CellCssStyle = ""; $CCEStudentAssignments->CCEStudentAssigID->CellCssClass = "";
$CCEStudentAssignments->CCEStudentAssigID->CellAttrs = array(); $CCEStudentAssignments->CCEStudentAssigID->ViewAttrs = array(); $CCEStudentAssignments->CCEStudentAssigID->EditAttrs = array();
// 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();
// AssignmentFile1
$CCEStudentAssignments->AssignmentFile1->CellCssStyle = ""; $CCEStudentAssignments->AssignmentFile1->CellCssClass = "";
$CCEStudentAssignments->AssignmentFile1->CellAttrs = array(); $CCEStudentAssignments->AssignmentFile1->ViewAttrs = array(); $CCEStudentAssignments->AssignmentFile1->EditAttrs = array();
// AssignmentFile2
$CCEStudentAssignments->AssignmentFile2->CellCssStyle = ""; $CCEStudentAssignments->AssignmentFile2->CellCssClass = "";
$CCEStudentAssignments->AssignmentFile2->CellAttrs = array(); $CCEStudentAssignments->AssignmentFile2->ViewAttrs = array(); $CCEStudentAssignments->AssignmentFile2->EditAttrs = array();
// AssignmentFile3
$CCEStudentAssignments->AssignmentFile3->CellCssStyle = ""; $CCEStudentAssignments->AssignmentFile3->CellCssClass = "";
$CCEStudentAssignments->AssignmentFile3->CellAttrs = array(); $CCEStudentAssignments->AssignmentFile3->ViewAttrs = array(); $CCEStudentAssignments->AssignmentFile3->EditAttrs = array();
// AssignmentFile4
$CCEStudentAssignments->AssignmentFile4->CellCssStyle = ""; $CCEStudentAssignments->AssignmentFile4->CellCssClass = "";
$CCEStudentAssignments->AssignmentFile4->CellAttrs = array(); $CCEStudentAssignments->AssignmentFile4->ViewAttrs = array(); $CCEStudentAssignments->AssignmentFile4->EditAttrs = array();
// AssignmentFile5
$CCEStudentAssignments->AssignmentFile5->CellCssStyle = ""; $CCEStudentAssignments->AssignmentFile5->CellCssClass = "";
$CCEStudentAssignments->AssignmentFile5->CellAttrs = array(); $CCEStudentAssignments->AssignmentFile5->ViewAttrs = array(); $CCEStudentAssignments->AssignmentFile5->EditAttrs = array();
// Comments
$CCEStudentAssignments->Comments->CellCssStyle = ""; $CCEStudentAssignments->Comments->CellCssClass = "";
$CCEStudentAssignments->Comments->CellAttrs = array(); $CCEStudentAssignments->Comments->ViewAttrs = array(); $CCEStudentAssignments->Comments->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();
// ScoredBy
$CCEStudentAssignments->ScoredBy->CellCssStyle = ""; $CCEStudentAssignments->ScoredBy->CellCssClass = "";
$CCEStudentAssignments->ScoredBy->CellAttrs = array(); $CCEStudentAssignments->ScoredBy->ViewAttrs = array(); $CCEStudentAssignments->ScoredBy->EditAttrs = array();
// Remarks
$CCEStudentAssignments->Remarks->CellCssStyle = ""; $CCEStudentAssignments->Remarks->CellCssClass = "";
$CCEStudentAssignments->Remarks->CellAttrs = array(); $CCEStudentAssignments->Remarks->ViewAttrs = array(); $CCEStudentAssignments->Remarks->EditAttrs = array();
// LFSentTo
$CCEStudentAssignments->LFSentTo->CellCssStyle = ""; $CCEStudentAssignments->LFSentTo->CellCssClass = "";
$CCEStudentAssignments->LFSentTo->CellAttrs = array(); $CCEStudentAssignments->LFSentTo->ViewAttrs = array(); $CCEStudentAssignments->LFSentTo->EditAttrs = array();
// LastFeedback
$CCEStudentAssignments->LastFeedback->CellCssStyle = ""; $CCEStudentAssignments->LastFeedback->CellCssClass = "";
$CCEStudentAssignments->LastFeedback->CellAttrs = array(); $CCEStudentAssignments->LastFeedback->ViewAttrs = array(); $CCEStudentAssignments->LastFeedback->EditAttrs = array();
// MsgAttachment
$CCEStudentAssignments->MsgAttachment->CellCssStyle = ""; $CCEStudentAssignments->MsgAttachment->CellCssClass = "";
$CCEStudentAssignments->MsgAttachment->CellAttrs = array(); $CCEStudentAssignments->MsgAttachment->ViewAttrs = array(); $CCEStudentAssignments->MsgAttachment->EditAttrs = array();
// Extended
$CCEStudentAssignments->Extended->CellCssStyle = ""; $CCEStudentAssignments->Extended->CellCssClass = "";
$CCEStudentAssignments->Extended->CellAttrs = array(); $CCEStudentAssignments->Extended->ViewAttrs = array(); $CCEStudentAssignments->Extended->EditAttrs = array();
// References
$CCEStudentAssignments->References->CellCssStyle = ""; $CCEStudentAssignments->References->CellCssClass = "";
$CCEStudentAssignments->References->CellAttrs = array(); $CCEStudentAssignments->References->ViewAttrs = array(); $CCEStudentAssignments->References->EditAttrs = array();
// TempR
$CCEStudentAssignments->TempR->CellCssStyle = ""; $CCEStudentAssignments->TempR->CellCssClass = "";
$CCEStudentAssignments->TempR->CellAttrs = array(); $CCEStudentAssignments->TempR->ViewAttrs = array(); $CCEStudentAssignments->TempR->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 ($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 = "";
// Completed
if (strval($CCEStudentAssignments->Completed->CurrentValue) <> "") {
switch ($CCEStudentAssignments->Completed->CurrentValue) {
case "1":
$CCEStudentAssignments->Completed->ViewValue = "Yes";
break;
case "0":
$CCEStudentAssignments->Completed->ViewValue = "No";
break;
default:
$CCEStudentAssignments->Completed->ViewValue = $CCEStudentAssignments->Completed->CurrentValue;
}
} else {
$CCEStudentAssignments->Completed->ViewValue = NULL;
}
$CCEStudentAssignments->Completed->CssStyle = "";
$CCEStudentAssignments->Completed->CssClass = "";
$CCEStudentAssignments->Completed->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 = "`CCEFacilitatorUserID` = " . ew_AdjustSql($CCEStudentAssignments->ScoredBy->CurrentValue) . "";
$sSqlWrk = "SELECT `FullName` FROM `CCEFacilitatorUsers`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `FullName`";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEStudentAssignments->ScoredBy->ViewValue = $rswrk->fields('FullName');
$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 = "";
// LFSentTo
if (strval($CCEStudentAssignments->LFSentTo->CurrentValue) <> "") {
$arwrk = explode(",", $CCEStudentAssignments->LFSentTo->CurrentValue);
$sFilterWrk = "";
foreach ($arwrk as $wrk) {
if ($sFilterWrk <> "") $sFilterWrk .= " OR ";
$sFilterWrk .= "`SendToSelect` = '" . ew_AdjustSql(trim($wrk)) . "'";
}
$sSqlWrk = "SELECT `SendToValue` FROM ((SELECT CONCAT('F', CCEFacilitators.FacilitatorID) AS SendToSelect, CONCAT('Facilitator: ', CCEFacilitators.FacilitatorName) AS SendToValue, 'Convenor' AS SendToType, CCEFacilitators.FacilitatorID AS SendToID, CCEStudentAssignments.CCEStudentAssigID FROM CCEFacilitators, CCEStudentAssignments, CCEStudents WHERE CCEStudents.CCEFacilitatorID = CCEFacilitators.FacilitatorID AND CCEStudentAssignments.CCEStudentID = CCEStudents.CCEStudentID) UNION (SELECT CONCAT('S', CCEStudents.CCEStudentID), CONCAT('Student: ', CCEStudents.FirstName, ' ', CCEStudents.Surname), 'Student', CCEStudents.CCEStudentID, CCEStudentAssignments.CCEStudentAssigID FROM CCEStudents, CCEStudentAssignments WHERE CCEStudents.CCEStudentID = CCEStudentAssignments.CCEStudentID) ) SendToTmp";
$sWhereWrk = "";
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . "CCEStudentAssigID IS NULL OR CCEStudentAssigID=".$_GET["CCEStudentAssigID"] . ")";
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->LFSentTo->ViewValue = "";
$ari = 0;
while (!$rswrk->EOF) {
$CCEStudentAssignments->LFSentTo->ViewValue .= $rswrk->fields('SendToValue');
$rswrk->MoveNext();
if (!$rswrk->EOF) $CCEStudentAssignments->LFSentTo->ViewValue .= ew_ViewOptionSeparator($ari); // Separate Options
$ari++;
}
$rswrk->Close();
} else {
$CCEStudentAssignments->LFSentTo->ViewValue = $CCEStudentAssignments->LFSentTo->CurrentValue;
}
} else {
$CCEStudentAssignments->LFSentTo->ViewValue = NULL;
}
$CCEStudentAssignments->LFSentTo->CssStyle = "";
$CCEStudentAssignments->LFSentTo->CssClass = "";
$CCEStudentAssignments->LFSentTo->ViewCustomAttributes = "";
// LastFeedback
$CCEStudentAssignments->LastFeedback->ViewValue = $CCEStudentAssignments->LastFeedback->CurrentValue;
$CCEStudentAssignments->LastFeedback->CssStyle = "";
$CCEStudentAssignments->LastFeedback->CssClass = "";
$CCEStudentAssignments->LastFeedback->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 = "";
// References
$CCEStudentAssignments->References->ViewValue = $CCEStudentAssignments->References->CurrentValue;
$CCEStudentAssignments->References->CssStyle = "";
$CCEStudentAssignments->References->CssClass = "";
$CCEStudentAssignments->References->ViewCustomAttributes = "";
// TempR
$CCEStudentAssignments->TempR->ViewValue = $CCEStudentAssignments->TempR->CurrentValue;
$CCEStudentAssignments->TempR->CssStyle = "";
$CCEStudentAssignments->TempR->CssClass = "";
$CCEStudentAssignments->TempR->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 = "";
// CCEStudentAssigID
$CCEStudentAssignments->CCEStudentAssigID->HrefValue = "";
$CCEStudentAssignments->CCEStudentAssigID->TooltipValue = "";
// CCEStudentID
$CCEStudentAssignments->CCEStudentID->HrefValue = "";
$CCEStudentAssignments->CCEStudentID->TooltipValue = "";
// CCEAssignmentID
$CCEStudentAssignments->CCEAssignmentID->HrefValue = "";
$CCEStudentAssignments->CCEAssignmentID->TooltipValue = "";
// AssignmentFile1
if (!ew_Empty($CCEStudentAssignments->AssignmentFile1->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile1->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile1->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile1->ViewValue)) ? $CCEStudentAssignments->AssignmentFile1->ViewValue : $CCEStudentAssignments->AssignmentFile1->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile1->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile1->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile1->HrefValue = "";
}
$CCEStudentAssignments->AssignmentFile1->TooltipValue = "";
// AssignmentFile2
if (!ew_Empty($CCEStudentAssignments->AssignmentFile2->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile2->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile2->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile2->ViewValue)) ? $CCEStudentAssignments->AssignmentFile2->ViewValue : $CCEStudentAssignments->AssignmentFile2->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile2->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile2->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile2->HrefValue = "";
}
$CCEStudentAssignments->AssignmentFile2->TooltipValue = "";
// AssignmentFile3
if (!ew_Empty($CCEStudentAssignments->AssignmentFile3->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile3->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile3->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile3->ViewValue)) ? $CCEStudentAssignments->AssignmentFile3->ViewValue : $CCEStudentAssignments->AssignmentFile3->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile3->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile3->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile3->HrefValue = "";
}
$CCEStudentAssignments->AssignmentFile3->TooltipValue = "";
// AssignmentFile4
if (!ew_Empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile4->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile4->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile4->ViewValue)) ? $CCEStudentAssignments->AssignmentFile4->ViewValue : $CCEStudentAssignments->AssignmentFile4->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile4->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile4->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile4->HrefValue = "";
}
$CCEStudentAssignments->AssignmentFile4->TooltipValue = "";
// AssignmentFile5
if (!ew_Empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile5->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile5->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile5->ViewValue)) ? $CCEStudentAssignments->AssignmentFile5->ViewValue : $CCEStudentAssignments->AssignmentFile5->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile5->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile5->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile5->HrefValue = "";
}
$CCEStudentAssignments->AssignmentFile5->TooltipValue = "";
// Comments
$CCEStudentAssignments->Comments->HrefValue = "";
$CCEStudentAssignments->Comments->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 = "";
// ScoredBy
$CCEStudentAssignments->ScoredBy->HrefValue = "";
$CCEStudentAssignments->ScoredBy->TooltipValue = "";
// Remarks
$CCEStudentAssignments->Remarks->HrefValue = "";
$CCEStudentAssignments->Remarks->TooltipValue = "";
// LFSentTo
$CCEStudentAssignments->LFSentTo->HrefValue = "";
$CCEStudentAssignments->LFSentTo->TooltipValue = "";
// LastFeedback
$CCEStudentAssignments->LastFeedback->HrefValue = "";
$CCEStudentAssignments->LastFeedback->TooltipValue = "";
// MsgAttachment
if (!ew_Empty($CCEStudentAssignments->MsgAttachment->Upload->DbValue)) {
$CCEStudentAssignments->MsgAttachment->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->MsgAttachment->UploadPath) . ((!empty($CCEStudentAssignments->MsgAttachment->ViewValue)) ? $CCEStudentAssignments->MsgAttachment->ViewValue : $CCEStudentAssignments->MsgAttachment->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->MsgAttachment->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->MsgAttachment->HrefValue);
} else {
$CCEStudentAssignments->MsgAttachment->HrefValue = "";
}
$CCEStudentAssignments->MsgAttachment->TooltipValue = "";
// Extended
$CCEStudentAssignments->Extended->HrefValue = "";
$CCEStudentAssignments->Extended->TooltipValue = "";
// References
$CCEStudentAssignments->References->HrefValue = "";
$CCEStudentAssignments->References->TooltipValue = "";
// TempR
$CCEStudentAssignments->TempR->HrefValue = "";
$CCEStudentAssignments->TempR->TooltipValue = "";
// ResubmitDateOverride
$CCEStudentAssignments->ResubmitDateOverride->HrefValue = "";
$CCEStudentAssignments->ResubmitDateOverride->TooltipValue = "";
} elseif ($CCEStudentAssignments->RowType == EW_ROWTYPE_EDIT) { // Edit row
// CCEStudentAssigID
$CCEStudentAssignments->CCEStudentAssigID->EditCustomAttributes = "";
// CCEStudentID
$CCEStudentAssignments->CCEStudentID->EditCustomAttributes = "";
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->EditValue = $rswrk->fields('FirstName');
$CCEStudentAssignments->CCEStudentID->EditValue .= ew_ValueSeparator(0) . $rswrk->fields('Surname');
$rswrk->Close();
} else {
$CCEStudentAssignments->CCEStudentID->EditValue = $CCEStudentAssignments->CCEStudentID->CurrentValue;
}
} else {
$CCEStudentAssignments->CCEStudentID->EditValue = NULL;
}
$CCEStudentAssignments->CCEStudentID->CssStyle = "";
$CCEStudentAssignments->CCEStudentID->CssClass = "";
$CCEStudentAssignments->CCEStudentID->ViewCustomAttributes = "";
// CCEAssignmentID
$CCEStudentAssignments->CCEAssignmentID->EditCustomAttributes = "";
if (strval($CCEStudentAssignments->CCEAssignmentID->CurrentValue) <> "") {
$sFilterWrk = "`CCEAssignmentID` = " . ew_AdjustSql($CCEStudentAssignments->CCEAssignmentID->CurrentValue) . "";
$sSqlWrk = "SELECT `RefNum`, `AssignmentName` FROM `CCEAssignments`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `RefNum`";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEStudentAssignments->CCEAssignmentID->EditValue = $rswrk->fields('RefNum');
$CCEStudentAssignments->CCEAssignmentID->EditValue .= ew_ValueSeparator(0) . $rswrk->fields('AssignmentName');
$rswrk->Close();
} else {
$CCEStudentAssignments->CCEAssignmentID->EditValue = $CCEStudentAssignments->CCEAssignmentID->CurrentValue;
}
} else {
$CCEStudentAssignments->CCEAssignmentID->EditValue = NULL;
}
$CCEStudentAssignments->CCEAssignmentID->CssStyle = "";
$CCEStudentAssignments->CCEAssignmentID->CssClass = "";
$CCEStudentAssignments->CCEAssignmentID->ViewCustomAttributes = "";
// AssignmentFile1
$CCEStudentAssignments->AssignmentFile1->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->AssignmentFile1->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile1->EditValue = $CCEStudentAssignments->AssignmentFile1->Upload->DbValue;
} else {
$CCEStudentAssignments->AssignmentFile1->EditValue = "";
}
$CCEStudentAssignments->AssignmentFile1->CssStyle = "";
$CCEStudentAssignments->AssignmentFile1->CssClass = "";
$CCEStudentAssignments->AssignmentFile1->ViewCustomAttributes = "";
// AssignmentFile2
$CCEStudentAssignments->AssignmentFile2->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->AssignmentFile2->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile2->EditValue = $CCEStudentAssignments->AssignmentFile2->Upload->DbValue;
} else {
$CCEStudentAssignments->AssignmentFile2->EditValue = "";
}
$CCEStudentAssignments->AssignmentFile2->CssStyle = "";
$CCEStudentAssignments->AssignmentFile2->CssClass = "";
$CCEStudentAssignments->AssignmentFile2->ViewCustomAttributes = "";
// AssignmentFile3
$CCEStudentAssignments->AssignmentFile3->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->AssignmentFile3->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile3->EditValue = $CCEStudentAssignments->AssignmentFile3->Upload->DbValue;
} else {
$CCEStudentAssignments->AssignmentFile3->EditValue = "";
}
$CCEStudentAssignments->AssignmentFile3->CssStyle = "";
$CCEStudentAssignments->AssignmentFile3->CssClass = "";
$CCEStudentAssignments->AssignmentFile3->ViewCustomAttributes = "";
// AssignmentFile4
$CCEStudentAssignments->AssignmentFile4->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile4->EditValue = $CCEStudentAssignments->AssignmentFile4->Upload->DbValue;
} else {
$CCEStudentAssignments->AssignmentFile4->EditValue = "";
}
// AssignmentFile5
$CCEStudentAssignments->AssignmentFile5->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile5->EditValue = $CCEStudentAssignments->AssignmentFile5->Upload->DbValue;
} else {
$CCEStudentAssignments->AssignmentFile5->EditValue = "";
}
// Comments
$CCEStudentAssignments->Comments->EditCustomAttributes = "";
$CCEStudentAssignments->Comments->EditValue = $CCEStudentAssignments->Comments->CurrentValue;
$CCEStudentAssignments->Comments->CssStyle = "";
$CCEStudentAssignments->Comments->CssClass = "";
$CCEStudentAssignments->Comments->ViewCustomAttributes = "";
// DateSubmitted
$CCEStudentAssignments->DateSubmitted->EditCustomAttributes = "";
$CCEStudentAssignments->DateSubmitted->EditValue = $CCEStudentAssignments->DateSubmitted->CurrentValue;
$CCEStudentAssignments->DateSubmitted->EditValue = ew_FormatDateTime($CCEStudentAssignments->DateSubmitted->EditValue, 9);
$CCEStudentAssignments->DateSubmitted->CssStyle = "";
$CCEStudentAssignments->DateSubmitted->CssClass = "";
$CCEStudentAssignments->DateSubmitted->ViewCustomAttributes = "";
// Passed
$CCEStudentAssignments->Passed->EditCustomAttributes = "";
if (strval($CCEStudentAssignments->Passed->CurrentValue) <> "") {
switch ($CCEStudentAssignments->Passed->CurrentValue) {
case "1":
$CCEStudentAssignments->Passed->EditValue = "Achieved";
break;
case "2":
$CCEStudentAssignments->Passed->EditValue = "Not Yet Achieved";
break;
case "0":
$CCEStudentAssignments->Passed->EditValue = "Not Yet Evaluated";
break;
case "3":
$CCEStudentAssignments->Passed->EditValue = "Added to PoE";
break;
default:
$CCEStudentAssignments->Passed->EditValue = $CCEStudentAssignments->Passed->CurrentValue;
}
} else {
$CCEStudentAssignments->Passed->EditValue = NULL;
}
$CCEStudentAssignments->Passed->CssStyle = "";
$CCEStudentAssignments->Passed->CssClass = "";
$CCEStudentAssignments->Passed->ViewCustomAttributes = "";
// RulingCode
$CCEStudentAssignments->RulingCode->EditCustomAttributes = "";
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->EditValue = $rswrk->fields('Ruling');
$rswrk->Close();
} else {
$CCEStudentAssignments->RulingCode->EditValue = $CCEStudentAssignments->RulingCode->CurrentValue;
}
} else {
$CCEStudentAssignments->RulingCode->EditValue = NULL;
}
$CCEStudentAssignments->RulingCode->CssStyle = "";
$CCEStudentAssignments->RulingCode->CssClass = "";
$CCEStudentAssignments->RulingCode->ViewCustomAttributes = "";
// AssignmentScore
$CCEStudentAssignments->AssignmentScore->EditCustomAttributes = "";
$CCEStudentAssignments->AssignmentScore->EditValue = $CCEStudentAssignments->AssignmentScore->CurrentValue;
$CCEStudentAssignments->AssignmentScore->CssStyle = "";
$CCEStudentAssignments->AssignmentScore->CssClass = "";
$CCEStudentAssignments->AssignmentScore->ViewCustomAttributes = "";
// ScoredBy
$CCEStudentAssignments->ScoredBy->EditCustomAttributes = "";
if (strval($CCEStudentAssignments->ScoredBy->CurrentValue) <> "") {
$sFilterWrk = "`CCEFacilitatorUserID` = " . ew_AdjustSql($CCEStudentAssignments->ScoredBy->CurrentValue) . "";
$sSqlWrk = "SELECT `FullName` FROM `CCEFacilitatorUsers`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `FullName`";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEStudentAssignments->ScoredBy->EditValue = $rswrk->fields('FullName');
$rswrk->Close();
} else {
$CCEStudentAssignments->ScoredBy->EditValue = $CCEStudentAssignments->ScoredBy->CurrentValue;
}
} else {
$CCEStudentAssignments->ScoredBy->EditValue = NULL;
}
$CCEStudentAssignments->ScoredBy->CssStyle = "";
$CCEStudentAssignments->ScoredBy->CssClass = "";
$CCEStudentAssignments->ScoredBy->ViewCustomAttributes = "";
// Remarks
$CCEStudentAssignments->Remarks->EditCustomAttributes = "";
$CCEStudentAssignments->Remarks->EditValue = $CCEStudentAssignments->Remarks->CurrentValue;
$CCEStudentAssignments->Remarks->CssStyle = "";
$CCEStudentAssignments->Remarks->CssClass = "";
$CCEStudentAssignments->Remarks->ViewCustomAttributes = "";
// LFSentTo
$CCEStudentAssignments->LFSentTo->EditCustomAttributes = "";
if (strval($CCEStudentAssignments->LFSentTo->CurrentValue) <> "") {
$arwrk = explode(",", $CCEStudentAssignments->LFSentTo->CurrentValue);
$sFilterWrk = "";
foreach ($arwrk as $wrk) {
if ($sFilterWrk <> "") $sFilterWrk .= " OR ";
$sFilterWrk .= "`SendToSelect` = '" . ew_AdjustSql(trim($wrk)) . "'";
}
$sSqlWrk = "SELECT `SendToValue` FROM ((SELECT CONCAT('F', CCEFacilitators.FacilitatorID) AS SendToSelect, CONCAT('Facilitator: ', CCEFacilitators.FacilitatorName) AS SendToValue, 'Convenor' AS SendToType, CCEFacilitators.FacilitatorID AS SendToID, CCEStudentAssignments.CCEStudentAssigID FROM CCEFacilitators, CCEStudentAssignments, CCEStudents WHERE CCEStudents.CCEFacilitatorID = CCEFacilitators.FacilitatorID AND CCEStudentAssignments.CCEStudentID = CCEStudents.CCEStudentID) UNION (SELECT CONCAT('S', CCEStudents.CCEStudentID), CONCAT('Student: ', CCEStudents.FirstName, ' ', CCEStudents.Surname), 'Student', CCEStudents.CCEStudentID, CCEStudentAssignments.CCEStudentAssigID FROM CCEStudents, CCEStudentAssignments WHERE CCEStudents.CCEStudentID = CCEStudentAssignments.CCEStudentID) ) SendToTmp";
$sWhereWrk = "";
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . "CCEStudentAssigID IS NULL OR CCEStudentAssigID=".$_GET["CCEStudentAssigID"] . ")";
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->LFSentTo->EditValue = "";
$ari = 0;
while (!$rswrk->EOF) {
$CCEStudentAssignments->LFSentTo->EditValue .= $rswrk->fields('SendToValue');
$rswrk->MoveNext();
if (!$rswrk->EOF) $CCEStudentAssignments->LFSentTo->EditValue .= ew_ViewOptionSeparator($ari); // Separate Options
$ari++;
}
$rswrk->Close();
} else {
$CCEStudentAssignments->LFSentTo->EditValue = $CCEStudentAssignments->LFSentTo->CurrentValue;
}
} else {
$CCEStudentAssignments->LFSentTo->EditValue = NULL;
}
$CCEStudentAssignments->LFSentTo->CssStyle = "";
$CCEStudentAssignments->LFSentTo->CssClass = "";
$CCEStudentAssignments->LFSentTo->ViewCustomAttributes = "";
// LastFeedback
$CCEStudentAssignments->LastFeedback->EditCustomAttributes = "";
$CCEStudentAssignments->LastFeedback->EditValue = $CCEStudentAssignments->LastFeedback->CurrentValue;
$CCEStudentAssignments->LastFeedback->CssStyle = "";
$CCEStudentAssignments->LastFeedback->CssClass = "";
$CCEStudentAssignments->LastFeedback->ViewCustomAttributes = "";
// MsgAttachment
$CCEStudentAssignments->MsgAttachment->EditCustomAttributes = "";
if (!ew_Empty($CCEStudentAssignments->MsgAttachment->Upload->DbValue)) {
$CCEStudentAssignments->MsgAttachment->EditValue = $CCEStudentAssignments->MsgAttachment->Upload->DbValue;
} else {
$CCEStudentAssignments->MsgAttachment->EditValue = "";
}
$CCEStudentAssignments->MsgAttachment->CssStyle = "";
$CCEStudentAssignments->MsgAttachment->CssClass = "";
$CCEStudentAssignments->MsgAttachment->ViewCustomAttributes = "";
// Extended
$CCEStudentAssignments->Extended->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("1", "Yes");
$arwrk[] = array("0", "No");
$CCEStudentAssignments->Extended->EditValue = $arwrk;
// References
$CCEStudentAssignments->References->EditCustomAttributes = "";
$CCEStudentAssignments->References->EditValue = ew_HtmlEncode($CCEStudentAssignments->References->CurrentValue);
// TempR
$CCEStudentAssignments->TempR->EditCustomAttributes = "";
$CCEStudentAssignments->TempR->EditValue = ew_HtmlEncode($CCEStudentAssignments->TempR->CurrentValue);
// ResubmitDateOverride
$CCEStudentAssignments->ResubmitDateOverride->EditCustomAttributes = "";
$CCEStudentAssignments->ResubmitDateOverride->EditValue = ew_HtmlEncode(ew_FormatDateTime($CCEStudentAssignments->ResubmitDateOverride->CurrentValue, 5));
// Edit refer script
// CCEStudentAssigID
$CCEStudentAssignments->CCEStudentAssigID->HrefValue = "";
// CCEStudentID
$CCEStudentAssignments->CCEStudentID->HrefValue = "";
// CCEAssignmentID
$CCEStudentAssignments->CCEAssignmentID->HrefValue = "";
// AssignmentFile1
if (!ew_Empty($CCEStudentAssignments->AssignmentFile1->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile1->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile1->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile1->EditValue)) ? $CCEStudentAssignments->AssignmentFile1->EditValue : $CCEStudentAssignments->AssignmentFile1->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile1->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile1->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile1->HrefValue = "";
}
// AssignmentFile2
if (!ew_Empty($CCEStudentAssignments->AssignmentFile2->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile2->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile2->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile2->EditValue)) ? $CCEStudentAssignments->AssignmentFile2->EditValue : $CCEStudentAssignments->AssignmentFile2->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile2->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile2->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile2->HrefValue = "";
}
// AssignmentFile3
if (!ew_Empty($CCEStudentAssignments->AssignmentFile3->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile3->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile3->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile3->EditValue)) ? $CCEStudentAssignments->AssignmentFile3->EditValue : $CCEStudentAssignments->AssignmentFile3->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile3->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile3->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile3->HrefValue = "";
}
// AssignmentFile4
if (!ew_Empty($CCEStudentAssignments->AssignmentFile4->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile4->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile4->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile4->EditValue)) ? $CCEStudentAssignments->AssignmentFile4->EditValue : $CCEStudentAssignments->AssignmentFile4->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile4->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile4->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile4->HrefValue = "";
}
// AssignmentFile5
if (!ew_Empty($CCEStudentAssignments->AssignmentFile5->Upload->DbValue)) {
$CCEStudentAssignments->AssignmentFile5->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->AssignmentFile5->UploadPath) . ((!empty($CCEStudentAssignments->AssignmentFile5->EditValue)) ? $CCEStudentAssignments->AssignmentFile5->EditValue : $CCEStudentAssignments->AssignmentFile5->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->AssignmentFile5->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->AssignmentFile5->HrefValue);
} else {
$CCEStudentAssignments->AssignmentFile5->HrefValue = "";
}
// Comments
$CCEStudentAssignments->Comments->HrefValue = "";
// DateSubmitted
$CCEStudentAssignments->DateSubmitted->HrefValue = "";
// Passed
$CCEStudentAssignments->Passed->HrefValue = "";
// RulingCode
$CCEStudentAssignments->RulingCode->HrefValue = "";
// AssignmentScore
$CCEStudentAssignments->AssignmentScore->HrefValue = "";
// ScoredBy
$CCEStudentAssignments->ScoredBy->HrefValue = "";
// Remarks
$CCEStudentAssignments->Remarks->HrefValue = "";
// LFSentTo
$CCEStudentAssignments->LFSentTo->HrefValue = "";
// LastFeedback
$CCEStudentAssignments->LastFeedback->HrefValue = "";
// MsgAttachment
if (!ew_Empty($CCEStudentAssignments->MsgAttachment->Upload->DbValue)) {
$CCEStudentAssignments->MsgAttachment->HrefValue = ew_UploadPathEx(FALSE, $CCEStudentAssignments->MsgAttachment->UploadPath) . ((!empty($CCEStudentAssignments->MsgAttachment->EditValue)) ? $CCEStudentAssignments->MsgAttachment->EditValue : $CCEStudentAssignments->MsgAttachment->CurrentValue);
if ($CCEStudentAssignments->Export <> "") $CCEStudentAssignments->MsgAttachment->HrefValue = ew_ConvertFullUrl($CCEStudentAssignments->MsgAttachment->HrefValue);
} else {
$CCEStudentAssignments->MsgAttachment->HrefValue = "";
}
// Extended
$CCEStudentAssignments->Extended->HrefValue = "";
// References
$CCEStudentAssignments->References->HrefValue = "";
// TempR
$CCEStudentAssignments->TempR->HrefValue = "";
// ResubmitDateOverride
$CCEStudentAssignments->ResubmitDateOverride->HrefValue = "";
}
// Call Row Rendered event
if ($CCEStudentAssignments->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCEStudentAssignments->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CCEStudentAssignments;
// Initialize form error message
$gsFormError = "";
if (!ew_CheckFileType($CCEStudentAssignments->AssignmentFile4->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CCEStudentAssignments->AssignmentFile4->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CCEStudentAssignments->AssignmentFile4->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CCEStudentAssignments->AssignmentFile4->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CCEStudentAssignments->AssignmentFile4->Upload->Error);
}
if (!ew_CheckFileType($CCEStudentAssignments->AssignmentFile5->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CCEStudentAssignments->AssignmentFile5->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CCEStudentAssignments->AssignmentFile5->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CCEStudentAssignments->AssignmentFile5->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CCEStudentAssignments->AssignmentFile5->Upload->Error);
}
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!ew_CheckDate($CCEStudentAssignments->ResubmitDateOverride->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEStudentAssignments->ResubmitDateOverride->FldErrMsg();
}
// Return validate result
$ValidateForm = ($gsFormError == "");
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError <> "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $sFormCustomError;
}
return $ValidateForm;
}
// Update record based on key values
function EditRow() {
global $conn, $Security, $Language, $CCEStudentAssignments;
$sFilter = $CCEStudentAssignments->KeyFilter();
$CCEStudentAssignments->CurrentFilter = $sFilter;
$sSql = $CCEStudentAssignments->SQL();
$conn->raiseErrorFn = 'ew_ErrorFn';
$rs = $conn->Execute($sSql);
$conn->raiseErrorFn = '';
if ($rs === FALSE)
return FALSE;
if ($rs->EOF) {
$EditRow = FALSE; // Update Failed
} else {
// Save old values
$rsold =& $rs->fields;
$rsnew = array();
// AssignmentFile4
$CCEStudentAssignments->AssignmentFile4->Upload->SaveToSession(); // Save file value to Session
if ($CCEStudentAssignments->AssignmentFile4->Upload->Action == "2" || $CCEStudentAssignments->AssignmentFile4->Upload->Action == "3") { // Update/Remove
$CCEStudentAssignments->AssignmentFile4->Upload->DbValue = $rs->fields('AssignmentFile4'); // Get original value
if (is_null($CCEStudentAssignments->AssignmentFile4->Upload->Value)) {
$rsnew['AssignmentFile4'] = NULL;
} else {
$rsnew['AssignmentFile4'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CCEStudentAssignments->AssignmentFile4->UploadPath), $CCEStudentAssignments->AssignmentFile4->Upload->FileName);
}
}
// AssignmentFile5
$CCEStudentAssignments->AssignmentFile5->Upload->SaveToSession(); // Save file value to Session
if ($CCEStudentAssignments->AssignmentFile5->Upload->Action == "2" || $CCEStudentAssignments->AssignmentFile5->Upload->Action == "3") { // Update/Remove
$CCEStudentAssignments->AssignmentFile5->Upload->DbValue = $rs->fields('AssignmentFile5'); // Get original value
if (is_null($CCEStudentAssignments->AssignmentFile5->Upload->Value)) {
$rsnew['AssignmentFile5'] = NULL;
} else {
$rsnew['AssignmentFile5'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CCEStudentAssignments->AssignmentFile5->UploadPath), $CCEStudentAssignments->AssignmentFile5->Upload->FileName);
}
}
// Extended
$CCEStudentAssignments->Extended->SetDbValueDef($rsnew, $CCEStudentAssignments->Extended->CurrentValue, 0, FALSE);
// References
$CCEStudentAssignments->References->SetDbValueDef($rsnew, $CCEStudentAssignments->References->CurrentValue, NULL, FALSE);
// TempR
$CCEStudentAssignments->TempR->SetDbValueDef($rsnew, $CCEStudentAssignments->TempR->CurrentValue, NULL, FALSE);
// ResubmitDateOverride
$CCEStudentAssignments->ResubmitDateOverride->SetDbValueDef($rsnew, ew_UnFormatDateTime($CCEStudentAssignments->ResubmitDateOverride->CurrentValue, 5, FALSE), NULL);
// Call Row Updating event
$bUpdateRow = $CCEStudentAssignments->Row_Updating($rsold, $rsnew);
if ($bUpdateRow) {
if (!ew_Empty($CCEStudentAssignments->AssignmentFile4->Upload->Value)) {
$CCEStudentAssignments->AssignmentFile4->Upload->SaveToFile($CCEStudentAssignments->AssignmentFile4->UploadPath, $rsnew['AssignmentFile4'], FALSE);
}
if (!ew_Empty($CCEStudentAssignments->AssignmentFile5->Upload->Value)) {
$CCEStudentAssignments->AssignmentFile5->Upload->SaveToFile($CCEStudentAssignments->AssignmentFile5->UploadPath, $rsnew['AssignmentFile5'], FALSE);
}
$conn->raiseErrorFn = 'ew_ErrorFn';
$EditRow = $conn->Execute($CCEStudentAssignments->UpdateSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CCEStudentAssignments->CancelMessage <> "") {
$this->setMessage($CCEStudentAssignments->CancelMessage);
$CCEStudentAssignments->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("UpdateCancelled"));
}
$EditRow = FALSE;
}
}
// Call Row_Updated event
if ($EditRow)
$CCEStudentAssignments->Row_Updated($rsold, $rsnew);
$rs->Close();
// AssignmentFile4
$CCEStudentAssignments->AssignmentFile4->Upload->RemoveFromSession(); // Remove file value from Session
// AssignmentFile5
$CCEStudentAssignments->AssignmentFile5->Upload->RemoveFromSession(); // Remove file value from Session
return $EditRow;
}
// Set up master/detail based on QueryString
function SetUpMasterDetail() {
global $CCEStudentAssignments;
$bValidMaster = FALSE;
// Get the keys for master table
if (@$_GET[EW_TABLE_SHOW_MASTER] <> "") {
$sMasterTblVar = $_GET[EW_TABLE_SHOW_MASTER];
if ($sMasterTblVar == "") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = "";
$this->sDbDetailFilter = "";
}
if ($sMasterTblVar == "CCEAssignments") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = $CCEStudentAssignments->SqlMasterFilter_CCEAssignments();
$this->sDbDetailFilter = $CCEStudentAssignments->SqlDetailFilter_CCEAssignments();
if (@$_GET["CCEAssignmentID"] <> "") {
$GLOBALS["CCEAssignments"]->CCEAssignmentID->setQueryStringValue($_GET["CCEAssignmentID"]);
$CCEStudentAssignments->CCEAssignmentID->setQueryStringValue($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue);
$CCEStudentAssignments->CCEAssignmentID->setSessionValue($CCEStudentAssignments->CCEAssignmentID->QueryStringValue);
if (!is_numeric($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue)) $bValidMaster = FALSE;
$this->sDbMasterFilter = str_replace("@CCEAssignmentID@", ew_AdjustSql($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue), $this->sDbMasterFilter);
$this->sDbDetailFilter = str_replace("@CCEAssignmentID@", ew_AdjustSql($GLOBALS["CCEAssignments"]->CCEAssignmentID->QueryStringValue), $this->sDbDetailFilter);
} else {
$bValidMaster = FALSE;
}
}
if ($sMasterTblVar == "CCEStudents") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = $CCEStudentAssignments->SqlMasterFilter_CCEStudents();
$this->sDbDetailFilter = $CCEStudentAssignments->SqlDetailFilter_CCEStudents();
if (@$_GET["CCEStudentID"] <> "") {
$GLOBALS["CCEStudents"]->CCEStudentID->setQueryStringValue($_GET["CCEStudentID"]);
$CCEStudentAssignments->CCEStudentID->setQueryStringValue($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue);
$CCEStudentAssignments->CCEStudentID->setSessionValue($CCEStudentAssignments->CCEStudentID->QueryStringValue);
if (!is_numeric($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue)) $bValidMaster = FALSE;
$this->sDbMasterFilter = str_replace("@CCEStudentID@", ew_AdjustSql($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue), $this->sDbMasterFilter);
$this->sDbDetailFilter = str_replace("@CCEStudentID@", ew_AdjustSql($GLOBALS["CCEStudents"]->CCEStudentID->QueryStringValue), $this->sDbDetailFilter);
} else {
$bValidMaster = FALSE;
}
}
}
if ($bValidMaster) {
// Save current master table
$CCEStudentAssignments->setCurrentMasterTable($sMasterTblVar);
// Reset start record counter (new master key)
$this->lStartRec = 1;
$CCEStudentAssignments->setStartRecordNumber($this->lStartRec);
$CCEStudentAssignments->setMasterFilter($this->sDbMasterFilter); // Set up master filter
$CCEStudentAssignments->setDetailFilter($this->sDbDetailFilter); // Set up detail filter
// Clear previous master key from Session
if ($sMasterTblVar <> "CCEAssignments") {
if ($CCEStudentAssignments->CCEAssignmentID->QueryStringValue == "") $CCEStudentAssignments->CCEAssignmentID->setSessionValue("");
}
if ($sMasterTblVar <> "CCEStudents") {
if ($CCEStudentAssignments->CCEStudentID->QueryStringValue == "") $CCEStudentAssignments->CCEStudentID->setSessionValue("");
}
} else {
$this->sDbMasterFilter = $CCEStudentAssignments->getMasterFilter(); // Restore master filter
$this->sDbDetailFilter = $CCEStudentAssignments->getDetailFilter(); // Restore detail filter
}
}
// Page Load event
function Page_Load() {
//echo "Page Load";
}
// 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;
}
}
?>