| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/CCEWeeklySessionsedit.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 "CCEWeeklySessionsinfo.php" ?>
<?php include "CCEFacilitatorUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Create page object
$CCEWeeklySessions_edit = new cCCEWeeklySessions_edit();
$Page =& $CCEWeeklySessions_edit;
// Page init
$CCEWeeklySessions_edit->Page_Init();
// Page main
$CCEWeeklySessions_edit->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CCEWeeklySessions_edit = new ew_Page("CCEWeeklySessions_edit");
// page properties
CCEWeeklySessions_edit.PageID = "edit"; // page ID
CCEWeeklySessions_edit.FormID = "fCCEWeeklySessionsedit"; // form ID
var EW_PAGE_ID = CCEWeeklySessions_edit.PageID; // for backward compatibility
// extend page with ValidateForm function
CCEWeeklySessions_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 + "_ScheduleID"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->ScheduleID->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_TrimesterNum"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->TrimesterNum->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_WeekNum"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->WeekNum->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_SessionDate"];
if (elm && !ew_CheckDate(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->SessionDate->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_StartTime"];
if (elm && !ew_CheckTime(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->StartTime->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_EndTime"];
if (elm && !ew_CheckTime(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->EndTime->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_AssignmentSubDate"];
if (elm && !ew_CheckDate(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CCEWeeklySessions->AssignmentSubDate->FldErrMsg()) ?>");
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CCEWeeklySessions_edit.Form_CustomValidate =
function(fobj) { // DO NOT CHANGE THIS LINE!
// Your custom validation code here, return false if invalid.
return true;
}
<?php if (EW_CLIENT_VALIDATE) { ?>
CCEWeeklySessions_edit.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEWeeklySessions_edit.ValidateRequired = false; // no JavaScript validation
<?php } ?>
//-->
</script>
<script type="text/javascript">
<!--
var ew_DHTMLEditors = [];
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js");
//-->
</script>
<p><span class="phpmaker"><?php echo $Language->Phrase("Edit") ?> <?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCEWeeklySessions->TableCaption() ?><br><br>
<a href="<?php echo $CCEWeeklySessions->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CCEWeeklySessions_edit->ShowMessage();
?>
<form name="fCCEWeeklySessionsedit" id="fCCEWeeklySessionsedit" action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return CCEWeeklySessions_edit.ValidateForm(this);">
<p>
<input type="hidden" name="a_table" id="a_table" value="CCEWeeklySessions">
<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">
<?php if ($CCEWeeklySessions->CCEWeeklySessionID->Visible) { // CCEWeeklySessionID ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->CCEWeeklySessionID->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->CCEWeeklySessionID->CellAttributes() ?>><span id="el_CCEWeeklySessionID">
<div<?php echo $CCEWeeklySessions->CCEWeeklySessionID->ViewAttributes() ?>><?php echo $CCEWeeklySessions->CCEWeeklySessionID->EditValue ?></div><input type="hidden" name="x_CCEWeeklySessionID" id="x_CCEWeeklySessionID" value="<?php echo ew_HtmlEncode($CCEWeeklySessions->CCEWeeklySessionID->CurrentValue) ?>">
</span><?php echo $CCEWeeklySessions->CCEWeeklySessionID->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->ScheduleID->Visible) { // ScheduleID ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->ScheduleID->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->ScheduleID->CellAttributes() ?>><span id="el_ScheduleID">
<input type="text" name="x_ScheduleID" id="x_ScheduleID" title="<?php echo $CCEWeeklySessions->ScheduleID->FldTitle() ?>" size="30" value="<?php echo $CCEWeeklySessions->ScheduleID->EditValue ?>"<?php echo $CCEWeeklySessions->ScheduleID->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->ScheduleID->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->TrimesterNum->Visible) { // TrimesterNum ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->TrimesterNum->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->TrimesterNum->CellAttributes() ?>><span id="el_TrimesterNum">
<input type="text" name="x_TrimesterNum" id="x_TrimesterNum" title="<?php echo $CCEWeeklySessions->TrimesterNum->FldTitle() ?>" size="30" value="<?php echo $CCEWeeklySessions->TrimesterNum->EditValue ?>"<?php echo $CCEWeeklySessions->TrimesterNum->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->TrimesterNum->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->WeekNum->Visible) { // WeekNum ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->WeekNum->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->WeekNum->CellAttributes() ?>><span id="el_WeekNum">
<input type="text" name="x_WeekNum" id="x_WeekNum" title="<?php echo $CCEWeeklySessions->WeekNum->FldTitle() ?>" size="30" value="<?php echo $CCEWeeklySessions->WeekNum->EditValue ?>"<?php echo $CCEWeeklySessions->WeekNum->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->WeekNum->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->SessionDate->Visible) { // SessionDate ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->SessionDate->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->SessionDate->CellAttributes() ?>><span id="el_SessionDate">
<input type="text" name="x_SessionDate" id="x_SessionDate" title="<?php echo $CCEWeeklySessions->SessionDate->FldTitle() ?>" value="<?php echo $CCEWeeklySessions->SessionDate->EditValue ?>"<?php echo $CCEWeeklySessions->SessionDate->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->SessionDate->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->SessionDay->Visible) { // SessionDay ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->SessionDay->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->SessionDay->CellAttributes() ?>><span id="el_SessionDay">
<input type="text" name="x_SessionDay" id="x_SessionDay" title="<?php echo $CCEWeeklySessions->SessionDay->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCEWeeklySessions->SessionDay->EditValue ?>"<?php echo $CCEWeeklySessions->SessionDay->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->SessionDay->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->StartTime->Visible) { // StartTime ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->StartTime->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->StartTime->CellAttributes() ?>><span id="el_StartTime">
<input type="text" name="x_StartTime" id="x_StartTime" title="<?php echo $CCEWeeklySessions->StartTime->FldTitle() ?>" size="30" value="<?php echo $CCEWeeklySessions->StartTime->EditValue ?>"<?php echo $CCEWeeklySessions->StartTime->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->StartTime->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->EndTime->Visible) { // EndTime ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->EndTime->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->EndTime->CellAttributes() ?>><span id="el_EndTime">
<input type="text" name="x_EndTime" id="x_EndTime" title="<?php echo $CCEWeeklySessions->EndTime->FldTitle() ?>" size="30" value="<?php echo $CCEWeeklySessions->EndTime->EditValue ?>"<?php echo $CCEWeeklySessions->EndTime->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->EndTime->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->Description->Visible) { // Description ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->Description->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->Description->CellAttributes() ?>><span id="el_Description">
<textarea name="x_Description" id="x_Description" title="<?php echo $CCEWeeklySessions->Description->FldTitle() ?>" cols="35" rows="4"<?php echo $CCEWeeklySessions->Description->EditAttributes() ?>><?php echo $CCEWeeklySessions->Description->EditValue ?></textarea>
</span><?php echo $CCEWeeklySessions->Description->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->PresentationRef->Visible) { // PresentationRef ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->PresentationRef->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->PresentationRef->CellAttributes() ?>><span id="el_PresentationRef">
<input type="text" name="x_PresentationRef" id="x_PresentationRef" title="<?php echo $CCEWeeklySessions->PresentationRef->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCEWeeklySessions->PresentationRef->EditValue ?>"<?php echo $CCEWeeklySessions->PresentationRef->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->PresentationRef->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->AssignmentRef->Visible) { // AssignmentRef ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->AssignmentRef->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->AssignmentRef->CellAttributes() ?>><span id="el_AssignmentRef">
<input type="text" name="x_AssignmentRef" id="x_AssignmentRef" title="<?php echo $CCEWeeklySessions->AssignmentRef->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCEWeeklySessions->AssignmentRef->EditValue ?>"<?php echo $CCEWeeklySessions->AssignmentRef->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->AssignmentRef->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->AssignmentSubDate->Visible) { // AssignmentSubDate ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->AssignmentSubDate->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->AssignmentSubDate->CellAttributes() ?>><span id="el_AssignmentSubDate">
<input type="text" name="x_AssignmentSubDate" id="x_AssignmentSubDate" title="<?php echo $CCEWeeklySessions->AssignmentSubDate->FldTitle() ?>" value="<?php echo $CCEWeeklySessions->AssignmentSubDate->EditValue ?>"<?php echo $CCEWeeklySessions->AssignmentSubDate->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->AssignmentSubDate->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->PresenterName->Visible) { // PresenterName ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->PresenterName->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->PresenterName->CellAttributes() ?>><span id="el_PresenterName">
<input type="text" name="x_PresenterName" id="x_PresenterName" title="<?php echo $CCEWeeklySessions->PresenterName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCEWeeklySessions->PresenterName->EditValue ?>"<?php echo $CCEWeeklySessions->PresenterName->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->PresenterName->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEWeeklySessions->Duration->Visible) { // Duration ?>
<tr<?php echo $CCEWeeklySessions->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEWeeklySessions->Duration->FldCaption() ?></td>
<td<?php echo $CCEWeeklySessions->Duration->CellAttributes() ?>><span id="el_Duration">
<input type="text" name="x_Duration" id="x_Duration" title="<?php echo $CCEWeeklySessions->Duration->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCEWeeklySessions->Duration->EditValue ?>"<?php echo $CCEWeeklySessions->Duration->EditAttributes() ?>>
</span><?php echo $CCEWeeklySessions->Duration->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");
//-->
</script>
<?php include "footer.php" ?>
<?php
$CCEWeeklySessions_edit->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCEWeeklySessions_edit {
// Page ID
var $PageID = 'edit';
// Table name
var $TableName = 'CCEWeeklySessions';
// Page object name
var $PageObjName = 'CCEWeeklySessions_edit';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCEWeeklySessions;
if ($CCEWeeklySessions->UseTokenInUrl) $PageUrl .= "t=" . $CCEWeeklySessions->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, $CCEWeeklySessions;
if ($CCEWeeklySessions->UseTokenInUrl) {
if ($objForm)
return ($CCEWeeklySessions->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCEWeeklySessions->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCEWeeklySessions)
$GLOBALS["CCEWeeklySessions"] = new cCCEWeeklySessions();
// Table object (CCEFacilitatorUsers)
$GLOBALS['CCEFacilitatorUsers'] = new cCCEFacilitatorUsers();
// 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", 'CCEWeeklySessions', 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 $CCEWeeklySessions;
// 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, $CCEWeeklySessions;
// Load key from QueryString
if (@$_GET["CCEWeeklySessionID"] <> "")
$CCEWeeklySessions->CCEWeeklySessionID->setQueryStringValue($_GET["CCEWeeklySessionID"]);
if (@$_POST["a_edit"] <> "") {
$CCEWeeklySessions->CurrentAction = $_POST["a_edit"]; // Get action code
$this->LoadFormValues(); // Get form values
// Validate form
if (!$this->ValidateForm()) {
$CCEWeeklySessions->CurrentAction = ""; // Form error, reset action
$this->setMessage($gsFormError);
$CCEWeeklySessions->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues();
}
} else {
$CCEWeeklySessions->CurrentAction = "I"; // Default action is display
}
// Check if valid key
if ($CCEWeeklySessions->CCEWeeklySessionID->CurrentValue == "")
$this->Page_Terminate("CCEWeeklySessionslist.php"); // Invalid key, return to list
switch ($CCEWeeklySessions->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("CCEWeeklySessionslist.php"); // No matching record, return to list
}
break;
Case "U": // Update
$CCEWeeklySessions->SendEmail = TRUE; // Send email on update success
if ($this->EditRow()) { // Update record based on key
$this->setMessage($Language->Phrase("UpdateSuccess")); // Update success
$sReturnUrl = $CCEWeeklySessions->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CCEWeeklySessionsview.php")
$sReturnUrl = $CCEWeeklySessions->ViewUrl(); // View paging, return to View page directly
$this->Page_Terminate($sReturnUrl); // Return to caller
} else {
$CCEWeeklySessions->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues(); // Restore form values if update failed
}
}
// Render the record
$CCEWeeklySessions->RowType = EW_ROWTYPE_EDIT; // Render as Edit
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CCEWeeklySessions;
// Get upload data
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CCEWeeklySessions;
$CCEWeeklySessions->CCEWeeklySessionID->setFormValue($objForm->GetValue("x_CCEWeeklySessionID"));
$CCEWeeklySessions->ScheduleID->setFormValue($objForm->GetValue("x_ScheduleID"));
$CCEWeeklySessions->TrimesterNum->setFormValue($objForm->GetValue("x_TrimesterNum"));
$CCEWeeklySessions->WeekNum->setFormValue($objForm->GetValue("x_WeekNum"));
$CCEWeeklySessions->SessionDate->setFormValue($objForm->GetValue("x_SessionDate"));
$CCEWeeklySessions->SessionDate->CurrentValue = ew_UnFormatDateTime($CCEWeeklySessions->SessionDate->CurrentValue, 5);
$CCEWeeklySessions->SessionDay->setFormValue($objForm->GetValue("x_SessionDay"));
$CCEWeeklySessions->StartTime->setFormValue($objForm->GetValue("x_StartTime"));
$CCEWeeklySessions->EndTime->setFormValue($objForm->GetValue("x_EndTime"));
$CCEWeeklySessions->Description->setFormValue($objForm->GetValue("x_Description"));
$CCEWeeklySessions->PresentationRef->setFormValue($objForm->GetValue("x_PresentationRef"));
$CCEWeeklySessions->AssignmentRef->setFormValue($objForm->GetValue("x_AssignmentRef"));
$CCEWeeklySessions->AssignmentSubDate->setFormValue($objForm->GetValue("x_AssignmentSubDate"));
$CCEWeeklySessions->AssignmentSubDate->CurrentValue = ew_UnFormatDateTime($CCEWeeklySessions->AssignmentSubDate->CurrentValue, 5);
$CCEWeeklySessions->PresenterName->setFormValue($objForm->GetValue("x_PresenterName"));
$CCEWeeklySessions->Duration->setFormValue($objForm->GetValue("x_Duration"));
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CCEWeeklySessions;
$this->LoadRow();
$CCEWeeklySessions->CCEWeeklySessionID->CurrentValue = $CCEWeeklySessions->CCEWeeklySessionID->FormValue;
$CCEWeeklySessions->ScheduleID->CurrentValue = $CCEWeeklySessions->ScheduleID->FormValue;
$CCEWeeklySessions->TrimesterNum->CurrentValue = $CCEWeeklySessions->TrimesterNum->FormValue;
$CCEWeeklySessions->WeekNum->CurrentValue = $CCEWeeklySessions->WeekNum->FormValue;
$CCEWeeklySessions->SessionDate->CurrentValue = $CCEWeeklySessions->SessionDate->FormValue;
$CCEWeeklySessions->SessionDate->CurrentValue = ew_UnFormatDateTime($CCEWeeklySessions->SessionDate->CurrentValue, 5);
$CCEWeeklySessions->SessionDay->CurrentValue = $CCEWeeklySessions->SessionDay->FormValue;
$CCEWeeklySessions->StartTime->CurrentValue = $CCEWeeklySessions->StartTime->FormValue;
$CCEWeeklySessions->EndTime->CurrentValue = $CCEWeeklySessions->EndTime->FormValue;
$CCEWeeklySessions->Description->CurrentValue = $CCEWeeklySessions->Description->FormValue;
$CCEWeeklySessions->PresentationRef->CurrentValue = $CCEWeeklySessions->PresentationRef->FormValue;
$CCEWeeklySessions->AssignmentRef->CurrentValue = $CCEWeeklySessions->AssignmentRef->FormValue;
$CCEWeeklySessions->AssignmentSubDate->CurrentValue = $CCEWeeklySessions->AssignmentSubDate->FormValue;
$CCEWeeklySessions->AssignmentSubDate->CurrentValue = ew_UnFormatDateTime($CCEWeeklySessions->AssignmentSubDate->CurrentValue, 5);
$CCEWeeklySessions->PresenterName->CurrentValue = $CCEWeeklySessions->PresenterName->FormValue;
$CCEWeeklySessions->Duration->CurrentValue = $CCEWeeklySessions->Duration->FormValue;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCEWeeklySessions;
$sFilter = $CCEWeeklySessions->KeyFilter();
// Call Row Selecting event
$CCEWeeklySessions->Row_Selecting($sFilter);
// Load SQL based on filter
$CCEWeeklySessions->CurrentFilter = $sFilter;
$sSql = $CCEWeeklySessions->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCEWeeklySessions->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCEWeeklySessions;
$CCEWeeklySessions->CCEWeeklySessionID->setDbValue($rs->fields('CCEWeeklySessionID'));
$CCEWeeklySessions->ScheduleID->setDbValue($rs->fields('ScheduleID'));
$CCEWeeklySessions->TrimesterNum->setDbValue($rs->fields('TrimesterNum'));
$CCEWeeklySessions->WeekNum->setDbValue($rs->fields('WeekNum'));
$CCEWeeklySessions->SessionDate->setDbValue($rs->fields('SessionDate'));
$CCEWeeklySessions->SessionDay->setDbValue($rs->fields('SessionDay'));
$CCEWeeklySessions->StartTime->setDbValue($rs->fields('StartTime'));
$CCEWeeklySessions->EndTime->setDbValue($rs->fields('EndTime'));
$CCEWeeklySessions->Description->setDbValue($rs->fields('Description'));
$CCEWeeklySessions->PresentationRef->setDbValue($rs->fields('PresentationRef'));
$CCEWeeklySessions->AssignmentRef->setDbValue($rs->fields('AssignmentRef'));
$CCEWeeklySessions->AssignmentSubDate->setDbValue($rs->fields('AssignmentSubDate'));
$CCEWeeklySessions->PresenterName->setDbValue($rs->fields('PresenterName'));
$CCEWeeklySessions->Duration->setDbValue($rs->fields('Duration'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCEWeeklySessions;
// Initialize URLs
// Call Row_Rendering event
$CCEWeeklySessions->Row_Rendering();
// Common render codes for all row types
// CCEWeeklySessionID
$CCEWeeklySessions->CCEWeeklySessionID->CellCssStyle = ""; $CCEWeeklySessions->CCEWeeklySessionID->CellCssClass = "";
$CCEWeeklySessions->CCEWeeklySessionID->CellAttrs = array(); $CCEWeeklySessions->CCEWeeklySessionID->ViewAttrs = array(); $CCEWeeklySessions->CCEWeeklySessionID->EditAttrs = array();
// ScheduleID
$CCEWeeklySessions->ScheduleID->CellCssStyle = ""; $CCEWeeklySessions->ScheduleID->CellCssClass = "";
$CCEWeeklySessions->ScheduleID->CellAttrs = array(); $CCEWeeklySessions->ScheduleID->ViewAttrs = array(); $CCEWeeklySessions->ScheduleID->EditAttrs = array();
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->CellCssStyle = ""; $CCEWeeklySessions->TrimesterNum->CellCssClass = "";
$CCEWeeklySessions->TrimesterNum->CellAttrs = array(); $CCEWeeklySessions->TrimesterNum->ViewAttrs = array(); $CCEWeeklySessions->TrimesterNum->EditAttrs = array();
// WeekNum
$CCEWeeklySessions->WeekNum->CellCssStyle = ""; $CCEWeeklySessions->WeekNum->CellCssClass = "";
$CCEWeeklySessions->WeekNum->CellAttrs = array(); $CCEWeeklySessions->WeekNum->ViewAttrs = array(); $CCEWeeklySessions->WeekNum->EditAttrs = array();
// SessionDate
$CCEWeeklySessions->SessionDate->CellCssStyle = ""; $CCEWeeklySessions->SessionDate->CellCssClass = "";
$CCEWeeklySessions->SessionDate->CellAttrs = array(); $CCEWeeklySessions->SessionDate->ViewAttrs = array(); $CCEWeeklySessions->SessionDate->EditAttrs = array();
// SessionDay
$CCEWeeklySessions->SessionDay->CellCssStyle = ""; $CCEWeeklySessions->SessionDay->CellCssClass = "";
$CCEWeeklySessions->SessionDay->CellAttrs = array(); $CCEWeeklySessions->SessionDay->ViewAttrs = array(); $CCEWeeklySessions->SessionDay->EditAttrs = array();
// StartTime
$CCEWeeklySessions->StartTime->CellCssStyle = ""; $CCEWeeklySessions->StartTime->CellCssClass = "";
$CCEWeeklySessions->StartTime->CellAttrs = array(); $CCEWeeklySessions->StartTime->ViewAttrs = array(); $CCEWeeklySessions->StartTime->EditAttrs = array();
// EndTime
$CCEWeeklySessions->EndTime->CellCssStyle = ""; $CCEWeeklySessions->EndTime->CellCssClass = "";
$CCEWeeklySessions->EndTime->CellAttrs = array(); $CCEWeeklySessions->EndTime->ViewAttrs = array(); $CCEWeeklySessions->EndTime->EditAttrs = array();
// Description
$CCEWeeklySessions->Description->CellCssStyle = ""; $CCEWeeklySessions->Description->CellCssClass = "";
$CCEWeeklySessions->Description->CellAttrs = array(); $CCEWeeklySessions->Description->ViewAttrs = array(); $CCEWeeklySessions->Description->EditAttrs = array();
// PresentationRef
$CCEWeeklySessions->PresentationRef->CellCssStyle = ""; $CCEWeeklySessions->PresentationRef->CellCssClass = "";
$CCEWeeklySessions->PresentationRef->CellAttrs = array(); $CCEWeeklySessions->PresentationRef->ViewAttrs = array(); $CCEWeeklySessions->PresentationRef->EditAttrs = array();
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->CellCssStyle = ""; $CCEWeeklySessions->AssignmentRef->CellCssClass = "";
$CCEWeeklySessions->AssignmentRef->CellAttrs = array(); $CCEWeeklySessions->AssignmentRef->ViewAttrs = array(); $CCEWeeklySessions->AssignmentRef->EditAttrs = array();
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->CellCssStyle = ""; $CCEWeeklySessions->AssignmentSubDate->CellCssClass = "";
$CCEWeeklySessions->AssignmentSubDate->CellAttrs = array(); $CCEWeeklySessions->AssignmentSubDate->ViewAttrs = array(); $CCEWeeklySessions->AssignmentSubDate->EditAttrs = array();
// PresenterName
$CCEWeeklySessions->PresenterName->CellCssStyle = ""; $CCEWeeklySessions->PresenterName->CellCssClass = "";
$CCEWeeklySessions->PresenterName->CellAttrs = array(); $CCEWeeklySessions->PresenterName->ViewAttrs = array(); $CCEWeeklySessions->PresenterName->EditAttrs = array();
// Duration
$CCEWeeklySessions->Duration->CellCssStyle = ""; $CCEWeeklySessions->Duration->CellCssClass = "";
$CCEWeeklySessions->Duration->CellAttrs = array(); $CCEWeeklySessions->Duration->ViewAttrs = array(); $CCEWeeklySessions->Duration->EditAttrs = array();
if ($CCEWeeklySessions->RowType == EW_ROWTYPE_VIEW) { // View row
// CCEWeeklySessionID
$CCEWeeklySessions->CCEWeeklySessionID->ViewValue = $CCEWeeklySessions->CCEWeeklySessionID->CurrentValue;
$CCEWeeklySessions->CCEWeeklySessionID->CssStyle = "";
$CCEWeeklySessions->CCEWeeklySessionID->CssClass = "";
$CCEWeeklySessions->CCEWeeklySessionID->ViewCustomAttributes = "";
// ScheduleID
$CCEWeeklySessions->ScheduleID->ViewValue = $CCEWeeklySessions->ScheduleID->CurrentValue;
$CCEWeeklySessions->ScheduleID->CssStyle = "";
$CCEWeeklySessions->ScheduleID->CssClass = "";
$CCEWeeklySessions->ScheduleID->ViewCustomAttributes = "";
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->ViewValue = $CCEWeeklySessions->TrimesterNum->CurrentValue;
$CCEWeeklySessions->TrimesterNum->CssStyle = "";
$CCEWeeklySessions->TrimesterNum->CssClass = "";
$CCEWeeklySessions->TrimesterNum->ViewCustomAttributes = "";
// WeekNum
$CCEWeeklySessions->WeekNum->ViewValue = $CCEWeeklySessions->WeekNum->CurrentValue;
$CCEWeeklySessions->WeekNum->CssStyle = "";
$CCEWeeklySessions->WeekNum->CssClass = "";
$CCEWeeklySessions->WeekNum->ViewCustomAttributes = "";
// SessionDate
$CCEWeeklySessions->SessionDate->ViewValue = $CCEWeeklySessions->SessionDate->CurrentValue;
$CCEWeeklySessions->SessionDate->ViewValue = ew_FormatDateTime($CCEWeeklySessions->SessionDate->ViewValue, 5);
$CCEWeeklySessions->SessionDate->CssStyle = "";
$CCEWeeklySessions->SessionDate->CssClass = "";
$CCEWeeklySessions->SessionDate->ViewCustomAttributes = "";
// SessionDay
$CCEWeeklySessions->SessionDay->ViewValue = $CCEWeeklySessions->SessionDay->CurrentValue;
$CCEWeeklySessions->SessionDay->CssStyle = "";
$CCEWeeklySessions->SessionDay->CssClass = "";
$CCEWeeklySessions->SessionDay->ViewCustomAttributes = "";
// StartTime
$CCEWeeklySessions->StartTime->ViewValue = $CCEWeeklySessions->StartTime->CurrentValue;
$CCEWeeklySessions->StartTime->ViewValue = ew_FormatDateTime($CCEWeeklySessions->StartTime->ViewValue, 4);
$CCEWeeklySessions->StartTime->CssStyle = "";
$CCEWeeklySessions->StartTime->CssClass = "";
$CCEWeeklySessions->StartTime->ViewCustomAttributes = "";
// EndTime
$CCEWeeklySessions->EndTime->ViewValue = $CCEWeeklySessions->EndTime->CurrentValue;
$CCEWeeklySessions->EndTime->ViewValue = ew_FormatDateTime($CCEWeeklySessions->EndTime->ViewValue, 4);
$CCEWeeklySessions->EndTime->CssStyle = "";
$CCEWeeklySessions->EndTime->CssClass = "";
$CCEWeeklySessions->EndTime->ViewCustomAttributes = "";
// Description
$CCEWeeklySessions->Description->ViewValue = $CCEWeeklySessions->Description->CurrentValue;
$CCEWeeklySessions->Description->CssStyle = "";
$CCEWeeklySessions->Description->CssClass = "";
$CCEWeeklySessions->Description->ViewCustomAttributes = "";
// PresentationRef
$CCEWeeklySessions->PresentationRef->ViewValue = $CCEWeeklySessions->PresentationRef->CurrentValue;
$CCEWeeklySessions->PresentationRef->CssStyle = "";
$CCEWeeklySessions->PresentationRef->CssClass = "";
$CCEWeeklySessions->PresentationRef->ViewCustomAttributes = "";
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->ViewValue = $CCEWeeklySessions->AssignmentRef->CurrentValue;
$CCEWeeklySessions->AssignmentRef->CssStyle = "";
$CCEWeeklySessions->AssignmentRef->CssClass = "";
$CCEWeeklySessions->AssignmentRef->ViewCustomAttributes = "";
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->ViewValue = $CCEWeeklySessions->AssignmentSubDate->CurrentValue;
$CCEWeeklySessions->AssignmentSubDate->ViewValue = ew_FormatDateTime($CCEWeeklySessions->AssignmentSubDate->ViewValue, 5);
$CCEWeeklySessions->AssignmentSubDate->CssStyle = "";
$CCEWeeklySessions->AssignmentSubDate->CssClass = "";
$CCEWeeklySessions->AssignmentSubDate->ViewCustomAttributes = "";
// PresenterName
$CCEWeeklySessions->PresenterName->ViewValue = $CCEWeeklySessions->PresenterName->CurrentValue;
$CCEWeeklySessions->PresenterName->CssStyle = "";
$CCEWeeklySessions->PresenterName->CssClass = "";
$CCEWeeklySessions->PresenterName->ViewCustomAttributes = "";
// Duration
$CCEWeeklySessions->Duration->ViewValue = $CCEWeeklySessions->Duration->CurrentValue;
$CCEWeeklySessions->Duration->CssStyle = "";
$CCEWeeklySessions->Duration->CssClass = "";
$CCEWeeklySessions->Duration->ViewCustomAttributes = "";
// CCEWeeklySessionID
$CCEWeeklySessions->CCEWeeklySessionID->HrefValue = "";
$CCEWeeklySessions->CCEWeeklySessionID->TooltipValue = "";
// ScheduleID
$CCEWeeklySessions->ScheduleID->HrefValue = "";
$CCEWeeklySessions->ScheduleID->TooltipValue = "";
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->HrefValue = "";
$CCEWeeklySessions->TrimesterNum->TooltipValue = "";
// WeekNum
$CCEWeeklySessions->WeekNum->HrefValue = "";
$CCEWeeklySessions->WeekNum->TooltipValue = "";
// SessionDate
$CCEWeeklySessions->SessionDate->HrefValue = "";
$CCEWeeklySessions->SessionDate->TooltipValue = "";
// SessionDay
$CCEWeeklySessions->SessionDay->HrefValue = "";
$CCEWeeklySessions->SessionDay->TooltipValue = "";
// StartTime
$CCEWeeklySessions->StartTime->HrefValue = "";
$CCEWeeklySessions->StartTime->TooltipValue = "";
// EndTime
$CCEWeeklySessions->EndTime->HrefValue = "";
$CCEWeeklySessions->EndTime->TooltipValue = "";
// Description
$CCEWeeklySessions->Description->HrefValue = "";
$CCEWeeklySessions->Description->TooltipValue = "";
// PresentationRef
$CCEWeeklySessions->PresentationRef->HrefValue = "";
$CCEWeeklySessions->PresentationRef->TooltipValue = "";
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->HrefValue = "";
$CCEWeeklySessions->AssignmentRef->TooltipValue = "";
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->HrefValue = "";
$CCEWeeklySessions->AssignmentSubDate->TooltipValue = "";
// PresenterName
$CCEWeeklySessions->PresenterName->HrefValue = "";
$CCEWeeklySessions->PresenterName->TooltipValue = "";
// Duration
$CCEWeeklySessions->Duration->HrefValue = "";
$CCEWeeklySessions->Duration->TooltipValue = "";
} elseif ($CCEWeeklySessions->RowType == EW_ROWTYPE_EDIT) { // Edit row
// CCEWeeklySessionID
$CCEWeeklySessions->CCEWeeklySessionID->EditCustomAttributes = "";
$CCEWeeklySessions->CCEWeeklySessionID->EditValue = $CCEWeeklySessions->CCEWeeklySessionID->CurrentValue;
$CCEWeeklySessions->CCEWeeklySessionID->CssStyle = "";
$CCEWeeklySessions->CCEWeeklySessionID->CssClass = "";
$CCEWeeklySessions->CCEWeeklySessionID->ViewCustomAttributes = "";
// ScheduleID
$CCEWeeklySessions->ScheduleID->EditCustomAttributes = "";
$CCEWeeklySessions->ScheduleID->EditValue = ew_HtmlEncode($CCEWeeklySessions->ScheduleID->CurrentValue);
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->EditCustomAttributes = "";
$CCEWeeklySessions->TrimesterNum->EditValue = ew_HtmlEncode($CCEWeeklySessions->TrimesterNum->CurrentValue);
// WeekNum
$CCEWeeklySessions->WeekNum->EditCustomAttributes = "";
$CCEWeeklySessions->WeekNum->EditValue = ew_HtmlEncode($CCEWeeklySessions->WeekNum->CurrentValue);
// SessionDate
$CCEWeeklySessions->SessionDate->EditCustomAttributes = "";
$CCEWeeklySessions->SessionDate->EditValue = ew_HtmlEncode(ew_FormatDateTime($CCEWeeklySessions->SessionDate->CurrentValue, 5));
// SessionDay
$CCEWeeklySessions->SessionDay->EditCustomAttributes = "";
$CCEWeeklySessions->SessionDay->EditValue = ew_HtmlEncode($CCEWeeklySessions->SessionDay->CurrentValue);
// StartTime
$CCEWeeklySessions->StartTime->EditCustomAttributes = "";
$CCEWeeklySessions->StartTime->EditValue = ew_HtmlEncode(ew_FormatDateTime($CCEWeeklySessions->StartTime->CurrentValue, 4));
// EndTime
$CCEWeeklySessions->EndTime->EditCustomAttributes = "";
$CCEWeeklySessions->EndTime->EditValue = ew_HtmlEncode(ew_FormatDateTime($CCEWeeklySessions->EndTime->CurrentValue, 4));
// Description
$CCEWeeklySessions->Description->EditCustomAttributes = "";
$CCEWeeklySessions->Description->EditValue = ew_HtmlEncode($CCEWeeklySessions->Description->CurrentValue);
// PresentationRef
$CCEWeeklySessions->PresentationRef->EditCustomAttributes = "";
$CCEWeeklySessions->PresentationRef->EditValue = ew_HtmlEncode($CCEWeeklySessions->PresentationRef->CurrentValue);
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->EditCustomAttributes = "";
$CCEWeeklySessions->AssignmentRef->EditValue = ew_HtmlEncode($CCEWeeklySessions->AssignmentRef->CurrentValue);
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->EditCustomAttributes = "";
$CCEWeeklySessions->AssignmentSubDate->EditValue = ew_HtmlEncode(ew_FormatDateTime($CCEWeeklySessions->AssignmentSubDate->CurrentValue, 5));
// PresenterName
$CCEWeeklySessions->PresenterName->EditCustomAttributes = "";
$CCEWeeklySessions->PresenterName->EditValue = ew_HtmlEncode($CCEWeeklySessions->PresenterName->CurrentValue);
// Duration
$CCEWeeklySessions->Duration->EditCustomAttributes = "";
$CCEWeeklySessions->Duration->EditValue = ew_HtmlEncode($CCEWeeklySessions->Duration->CurrentValue);
// Edit refer script
// CCEWeeklySessionID
$CCEWeeklySessions->CCEWeeklySessionID->HrefValue = "";
// ScheduleID
$CCEWeeklySessions->ScheduleID->HrefValue = "";
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->HrefValue = "";
// WeekNum
$CCEWeeklySessions->WeekNum->HrefValue = "";
// SessionDate
$CCEWeeklySessions->SessionDate->HrefValue = "";
// SessionDay
$CCEWeeklySessions->SessionDay->HrefValue = "";
// StartTime
$CCEWeeklySessions->StartTime->HrefValue = "";
// EndTime
$CCEWeeklySessions->EndTime->HrefValue = "";
// Description
$CCEWeeklySessions->Description->HrefValue = "";
// PresentationRef
$CCEWeeklySessions->PresentationRef->HrefValue = "";
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->HrefValue = "";
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->HrefValue = "";
// PresenterName
$CCEWeeklySessions->PresenterName->HrefValue = "";
// Duration
$CCEWeeklySessions->Duration->HrefValue = "";
}
// Call Row Rendered event
if ($CCEWeeklySessions->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCEWeeklySessions->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CCEWeeklySessions;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!ew_CheckInteger($CCEWeeklySessions->ScheduleID->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->ScheduleID->FldErrMsg();
}
if (!ew_CheckInteger($CCEWeeklySessions->TrimesterNum->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->TrimesterNum->FldErrMsg();
}
if (!ew_CheckInteger($CCEWeeklySessions->WeekNum->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->WeekNum->FldErrMsg();
}
if (!ew_CheckDate($CCEWeeklySessions->SessionDate->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->SessionDate->FldErrMsg();
}
if (!ew_CheckTime($CCEWeeklySessions->StartTime->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->StartTime->FldErrMsg();
}
if (!ew_CheckTime($CCEWeeklySessions->EndTime->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->EndTime->FldErrMsg();
}
if (!ew_CheckDate($CCEWeeklySessions->AssignmentSubDate->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CCEWeeklySessions->AssignmentSubDate->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, $CCEWeeklySessions;
$sFilter = $CCEWeeklySessions->KeyFilter();
$CCEWeeklySessions->CurrentFilter = $sFilter;
$sSql = $CCEWeeklySessions->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();
// ScheduleID
$CCEWeeklySessions->ScheduleID->SetDbValueDef($rsnew, $CCEWeeklySessions->ScheduleID->CurrentValue, NULL, FALSE);
// TrimesterNum
$CCEWeeklySessions->TrimesterNum->SetDbValueDef($rsnew, $CCEWeeklySessions->TrimesterNum->CurrentValue, NULL, FALSE);
// WeekNum
$CCEWeeklySessions->WeekNum->SetDbValueDef($rsnew, $CCEWeeklySessions->WeekNum->CurrentValue, NULL, FALSE);
// SessionDate
$CCEWeeklySessions->SessionDate->SetDbValueDef($rsnew, ew_UnFormatDateTime($CCEWeeklySessions->SessionDate->CurrentValue, 5, FALSE), NULL);
// SessionDay
$CCEWeeklySessions->SessionDay->SetDbValueDef($rsnew, $CCEWeeklySessions->SessionDay->CurrentValue, NULL, FALSE);
// StartTime
$CCEWeeklySessions->StartTime->SetDbValueDef($rsnew, ew_FormatDateTime($CCEWeeklySessions->StartTime->CurrentValue, 4), NULL, FALSE);
// EndTime
$CCEWeeklySessions->EndTime->SetDbValueDef($rsnew, ew_FormatDateTime($CCEWeeklySessions->EndTime->CurrentValue, 4), NULL, FALSE);
// Description
$CCEWeeklySessions->Description->SetDbValueDef($rsnew, $CCEWeeklySessions->Description->CurrentValue, NULL, FALSE);
// PresentationRef
$CCEWeeklySessions->PresentationRef->SetDbValueDef($rsnew, $CCEWeeklySessions->PresentationRef->CurrentValue, NULL, FALSE);
// AssignmentRef
$CCEWeeklySessions->AssignmentRef->SetDbValueDef($rsnew, $CCEWeeklySessions->AssignmentRef->CurrentValue, NULL, FALSE);
// AssignmentSubDate
$CCEWeeklySessions->AssignmentSubDate->SetDbValueDef($rsnew, ew_UnFormatDateTime($CCEWeeklySessions->AssignmentSubDate->CurrentValue, 5, FALSE), NULL);
// PresenterName
$CCEWeeklySessions->PresenterName->SetDbValueDef($rsnew, $CCEWeeklySessions->PresenterName->CurrentValue, NULL, FALSE);
// Duration
$CCEWeeklySessions->Duration->SetDbValueDef($rsnew, $CCEWeeklySessions->Duration->CurrentValue, NULL, FALSE);
// Call Row Updating event
$bUpdateRow = $CCEWeeklySessions->Row_Updating($rsold, $rsnew);
if ($bUpdateRow) {
$conn->raiseErrorFn = 'ew_ErrorFn';
$EditRow = $conn->Execute($CCEWeeklySessions->UpdateSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CCEWeeklySessions->CancelMessage <> "") {
$this->setMessage($CCEWeeklySessions->CancelMessage);
$CCEWeeklySessions->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("UpdateCancelled"));
}
$EditRow = FALSE;
}
}
// Call Row_Updated event
if ($EditRow)
$CCEWeeklySessions->Row_Updated($rsold, $rsnew);
$rs->Close();
return $EditRow;
}
// 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;
}
}
?>