| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/CCEDocumentsedit.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 "CCEDocumentsinfo.php" ?>
<?php include "CCEModulesinfo.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
$CCEDocuments_edit = new cCCEDocuments_edit();
$Page =& $CCEDocuments_edit;
// Page init
$CCEDocuments_edit->Page_Init();
// Page main
$CCEDocuments_edit->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CCEDocuments_edit = new ew_Page("CCEDocuments_edit");
// page properties
CCEDocuments_edit.PageID = "edit"; // page ID
CCEDocuments_edit.FormID = "fCCEDocumentsedit"; // form ID
var EW_PAGE_ID = CCEDocuments_edit.PageID; // for backward compatibility
// extend page with ValidateForm function
CCEDocuments_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 + "_DocumentCategory"];
if (elm && !ew_HasValue(elm))
return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($CCEDocuments->DocumentCategory->FldCaption()) ?>");
elm = fobj.elements["x" + infix + "_DocumentFile"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CCEDocuments_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) { ?>
CCEDocuments_edit.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEDocuments_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 $CCEDocuments->TableCaption() ?><br><br>
<a href="<?php echo $CCEDocuments->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CCEDocuments_edit->ShowMessage();
?>
<form name="fCCEDocumentsedit" id="fCCEDocumentsedit" action="<?php echo ew_CurrentPage() ?>" method="post" enctype="multipart/form-data" onsubmit="return CCEDocuments_edit.ValidateForm(this);">
<p>
<input type="hidden" name="a_table" id="a_table" value="CCEDocuments">
<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_CCEDocumentID" id="x_CCEDocumentID" value="<?php echo ew_HtmlEncode($CCEDocuments->CCEDocumentID->CurrentValue) ?>">
<?php if ($CCEDocuments->CCEModuleID->Visible) { // CCEModuleID ?>
<tr<?php echo $CCEDocuments->CCEModuleID->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->CCEModuleID->FldCaption() ?></td>
<td<?php echo $CCEDocuments->CCEModuleID->CellAttributes() ?>><span id="el_CCEModuleID">
<?php if ($CCEDocuments->CCEModuleID->getSessionValue() <> "") { ?>
<div<?php echo $CCEDocuments->CCEModuleID->ViewAttributes() ?>><?php echo $CCEDocuments->CCEModuleID->ViewValue ?></div>
<input type="hidden" id="x_CCEModuleID" name="x_CCEModuleID" value="<?php echo ew_HtmlEncode($CCEDocuments->CCEModuleID->CurrentValue) ?>">
<?php } else { ?>
<select id="x_CCEModuleID" name="x_CCEModuleID" title="<?php echo $CCEDocuments->CCEModuleID->FldTitle() ?>"<?php echo $CCEDocuments->CCEModuleID->EditAttributes() ?>>
<?php
if (is_array($CCEDocuments->CCEModuleID->EditValue)) {
$arwrk = $CCEDocuments->CCEModuleID->EditValue;
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCEDocuments->CCEModuleID->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
<?php if ($arwrk[$rowcntwrk][2] <> "") { ?>
<?php echo ew_ValueSeparator($rowcntwrk) ?><?php echo $arwrk[$rowcntwrk][2] ?>
<?php } ?>
</option>
<?php
}
}
?>
</select>
<?php } ?>
</span><?php echo $CCEDocuments->CCEModuleID->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEDocuments->DocumentCategory->Visible) { // DocumentCategory ?>
<tr<?php echo $CCEDocuments->DocumentCategory->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->DocumentCategory->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCEDocuments->DocumentCategory->CellAttributes() ?>><span id="el_DocumentCategory">
<select id="x_DocumentCategory" name="x_DocumentCategory" title="<?php echo $CCEDocuments->DocumentCategory->FldTitle() ?>"<?php echo $CCEDocuments->DocumentCategory->EditAttributes() ?>>
<?php
if (is_array($CCEDocuments->DocumentCategory->EditValue)) {
$arwrk = $CCEDocuments->DocumentCategory->EditValue;
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCEDocuments->DocumentCategory->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
}
}
?>
</select>
</span><?php echo $CCEDocuments->DocumentCategory->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEDocuments->DocumentName->Visible) { // DocumentName ?>
<tr<?php echo $CCEDocuments->DocumentName->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->DocumentName->FldCaption() ?></td>
<td<?php echo $CCEDocuments->DocumentName->CellAttributes() ?>><span id="el_DocumentName">
<input type="text" name="x_DocumentName" id="x_DocumentName" title="<?php echo $CCEDocuments->DocumentName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCEDocuments->DocumentName->EditValue ?>"<?php echo $CCEDocuments->DocumentName->EditAttributes() ?>>
</span><?php echo $CCEDocuments->DocumentName->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEDocuments->DocumentFile->Visible) { // DocumentFile ?>
<tr<?php echo $CCEDocuments->DocumentFile->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->DocumentFile->FldCaption() ?></td>
<td<?php echo $CCEDocuments->DocumentFile->CellAttributes() ?>><span id="el_DocumentFile">
<div id="old_x_DocumentFile">
<?php if ($CCEDocuments->DocumentFile->HrefValue <> "" || $CCEDocuments->DocumentFile->TooltipValue <> "") { ?>
<?php if (!empty($CCEDocuments->DocumentFile->Upload->DbValue)) { ?>
<a href="<?php echo $CCEDocuments->DocumentFile->HrefValue ?>"><?php echo $CCEDocuments->DocumentFile->EditValue ?></a>
<?php } elseif (!in_array($CCEDocuments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEDocuments->DocumentFile->Upload->DbValue)) { ?>
<?php echo $CCEDocuments->DocumentFile->EditValue ?>
<?php } elseif (!in_array($CCEDocuments->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
</div>
<div id="new_x_DocumentFile">
<?php if (!empty($CCEDocuments->DocumentFile->Upload->DbValue)) { ?>
<label><input type="radio" name="a_DocumentFile" id="a_DocumentFile" value="1" checked="checked"><?php echo $Language->Phrase("Keep") ?></label>
<label><input type="radio" name="a_DocumentFile" id="a_DocumentFile" value="2"><?php echo $Language->Phrase("Remove") ?></label>
<label><input type="radio" name="a_DocumentFile" id="a_DocumentFile" value="3"><?php echo $Language->Phrase("Replace") ?><br></label>
<?php $CCEDocuments->DocumentFile->EditAttrs["onchange"] = "this.form.a_DocumentFile[2].checked=true;" . @$CCEDocuments->DocumentFile->EditAttrs["onchange"]; ?>
<?php } else { ?>
<input type="hidden" name="a_DocumentFile" id="a_DocumentFile" value="3">
<?php } ?>
<input type="file" name="x_DocumentFile" id="x_DocumentFile" title="<?php echo $CCEDocuments->DocumentFile->FldTitle() ?>" size="30"<?php echo $CCEDocuments->DocumentFile->EditAttributes() ?>>
</div>
</span><?php echo $CCEDocuments->DocumentFile->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEDocuments->DocumentURL->Visible) { // DocumentURL ?>
<tr<?php echo $CCEDocuments->DocumentURL->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->DocumentURL->FldCaption() ?></td>
<td<?php echo $CCEDocuments->DocumentURL->CellAttributes() ?>><span id="el_DocumentURL">
<input type="text" name="x_DocumentURL" id="x_DocumentURL" title="<?php echo $CCEDocuments->DocumentURL->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCEDocuments->DocumentURL->EditValue ?>"<?php echo $CCEDocuments->DocumentURL->EditAttributes() ?>>
</span><?php echo $CCEDocuments->DocumentURL->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCEDocuments->UploadedBy->Visible) { // UploadedBy ?>
<tr<?php echo $CCEDocuments->UploadedBy->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCEDocuments->UploadedBy->FldCaption() ?></td>
<td<?php echo $CCEDocuments->UploadedBy->CellAttributes() ?>><span id="el_UploadedBy">
<select id="x_UploadedBy" name="x_UploadedBy" title="<?php echo $CCEDocuments->UploadedBy->FldTitle() ?>"<?php echo $CCEDocuments->UploadedBy->EditAttributes() ?>>
<?php
if (is_array($CCEDocuments->UploadedBy->EditValue)) {
$arwrk = $CCEDocuments->UploadedBy->EditValue;
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCEDocuments->UploadedBy->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
}
}
?>
</select>
</span><?php echo $CCEDocuments->UploadedBy->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
$CCEDocuments_edit->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCEDocuments_edit {
// Page ID
var $PageID = 'edit';
// Table name
var $TableName = 'CCEDocuments';
// Page object name
var $PageObjName = 'CCEDocuments_edit';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCEDocuments;
if ($CCEDocuments->UseTokenInUrl) $PageUrl .= "t=" . $CCEDocuments->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, $CCEDocuments;
if ($CCEDocuments->UseTokenInUrl) {
if ($objForm)
return ($CCEDocuments->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCEDocuments->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCEDocuments)
$GLOBALS["CCEDocuments"] = new cCCEDocuments();
// Table object (CCEModules)
$GLOBALS['CCEModules'] = new cCCEModules();
// 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", 'CCEDocuments', 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 $CCEDocuments;
// 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, $CCEDocuments;
// Load key from QueryString
if (@$_GET["CCEDocumentID"] <> "")
$CCEDocuments->CCEDocumentID->setQueryStringValue($_GET["CCEDocumentID"]);
// Set up master detail parameters
$this->SetUpMasterDetail();
if (@$_POST["a_edit"] <> "") {
$CCEDocuments->CurrentAction = $_POST["a_edit"]; // Get action code
$this->GetUploadFiles(); // Get upload files
$this->LoadFormValues(); // Get form values
// Validate form
if (!$this->ValidateForm()) {
$CCEDocuments->CurrentAction = ""; // Form error, reset action
$this->setMessage($gsFormError);
$CCEDocuments->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues();
}
} else {
$CCEDocuments->CurrentAction = "I"; // Default action is display
}
// Check if valid key
if ($CCEDocuments->CCEDocumentID->CurrentValue == "")
$this->Page_Terminate("CCEDocumentslist.php"); // Invalid key, return to list
switch ($CCEDocuments->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("CCEDocumentslist.php"); // No matching record, return to list
}
break;
Case "U": // Update
$CCEDocuments->SendEmail = TRUE; // Send email on update success
if ($this->EditRow()) { // Update record based on key
$this->setMessage($Language->Phrase("UpdateSuccess")); // Update success
$sReturnUrl = $CCEDocuments->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CCEDocumentsview.php")
$sReturnUrl = $CCEDocuments->ViewUrl(); // View paging, return to View page directly
$this->Page_Terminate($sReturnUrl); // Return to caller
} else {
$CCEDocuments->EventCancelled = TRUE; // Event cancelled
$this->RestoreFormValues(); // Restore form values if update failed
}
}
// Render the record
$CCEDocuments->RowType = EW_ROWTYPE_EDIT; // Render as Edit
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CCEDocuments;
// Get upload data
if ($CCEDocuments->DocumentFile->Upload->UploadFile()) {
// No action required
} else {
echo $CCEDocuments->DocumentFile->Upload->Message;
$this->Page_Terminate();
exit();
}
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CCEDocuments;
$CCEDocuments->CCEDocumentID->setFormValue($objForm->GetValue("x_CCEDocumentID"));
$CCEDocuments->CCEModuleID->setFormValue($objForm->GetValue("x_CCEModuleID"));
$CCEDocuments->DocumentCategory->setFormValue($objForm->GetValue("x_DocumentCategory"));
$CCEDocuments->DocumentName->setFormValue($objForm->GetValue("x_DocumentName"));
$CCEDocuments->DocumentURL->setFormValue($objForm->GetValue("x_DocumentURL"));
$CCEDocuments->UploadedBy->setFormValue($objForm->GetValue("x_UploadedBy"));
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CCEDocuments;
$this->LoadRow();
$CCEDocuments->CCEDocumentID->CurrentValue = $CCEDocuments->CCEDocumentID->FormValue;
$CCEDocuments->CCEModuleID->CurrentValue = $CCEDocuments->CCEModuleID->FormValue;
$CCEDocuments->DocumentCategory->CurrentValue = $CCEDocuments->DocumentCategory->FormValue;
$CCEDocuments->DocumentName->CurrentValue = $CCEDocuments->DocumentName->FormValue;
$CCEDocuments->DocumentURL->CurrentValue = $CCEDocuments->DocumentURL->FormValue;
$CCEDocuments->UploadedBy->CurrentValue = $CCEDocuments->UploadedBy->FormValue;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCEDocuments;
$sFilter = $CCEDocuments->KeyFilter();
// Call Row Selecting event
$CCEDocuments->Row_Selecting($sFilter);
// Load SQL based on filter
$CCEDocuments->CurrentFilter = $sFilter;
$sSql = $CCEDocuments->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCEDocuments->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCEDocuments;
$CCEDocuments->CCEDocumentID->setDbValue($rs->fields('CCEDocumentID'));
$CCEDocuments->CCEModuleID->setDbValue($rs->fields('CCEModuleID'));
$CCEDocuments->DocumentCategory->setDbValue($rs->fields('DocumentCategory'));
$CCEDocuments->DocumentName->setDbValue($rs->fields('DocumentName'));
$CCEDocuments->DocumentFile->Upload->DbValue = $rs->fields('DocumentFile');
$CCEDocuments->DocumentURL->setDbValue($rs->fields('DocumentURL'));
$CCEDocuments->DocumentThumb->setDbValue($rs->fields('DocumentThumb'));
$CCEDocuments->UploadedBy->setDbValue($rs->fields('UploadedBy'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCEDocuments;
// Initialize URLs
// Call Row_Rendering event
$CCEDocuments->Row_Rendering();
// Common render codes for all row types
// CCEDocumentID
$CCEDocuments->CCEDocumentID->CellCssStyle = ""; $CCEDocuments->CCEDocumentID->CellCssClass = "";
$CCEDocuments->CCEDocumentID->CellAttrs = array(); $CCEDocuments->CCEDocumentID->ViewAttrs = array(); $CCEDocuments->CCEDocumentID->EditAttrs = array();
// CCEModuleID
$CCEDocuments->CCEModuleID->CellCssStyle = ""; $CCEDocuments->CCEModuleID->CellCssClass = "";
$CCEDocuments->CCEModuleID->CellAttrs = array(); $CCEDocuments->CCEModuleID->ViewAttrs = array(); $CCEDocuments->CCEModuleID->EditAttrs = array();
// DocumentCategory
$CCEDocuments->DocumentCategory->CellCssStyle = ""; $CCEDocuments->DocumentCategory->CellCssClass = "";
$CCEDocuments->DocumentCategory->CellAttrs = array(); $CCEDocuments->DocumentCategory->ViewAttrs = array(); $CCEDocuments->DocumentCategory->EditAttrs = array();
// DocumentName
$CCEDocuments->DocumentName->CellCssStyle = ""; $CCEDocuments->DocumentName->CellCssClass = "";
$CCEDocuments->DocumentName->CellAttrs = array(); $CCEDocuments->DocumentName->ViewAttrs = array(); $CCEDocuments->DocumentName->EditAttrs = array();
// DocumentFile
$CCEDocuments->DocumentFile->CellCssStyle = ""; $CCEDocuments->DocumentFile->CellCssClass = "";
$CCEDocuments->DocumentFile->CellAttrs = array(); $CCEDocuments->DocumentFile->ViewAttrs = array(); $CCEDocuments->DocumentFile->EditAttrs = array();
// DocumentURL
$CCEDocuments->DocumentURL->CellCssStyle = ""; $CCEDocuments->DocumentURL->CellCssClass = "";
$CCEDocuments->DocumentURL->CellAttrs = array(); $CCEDocuments->DocumentURL->ViewAttrs = array(); $CCEDocuments->DocumentURL->EditAttrs = array();
// UploadedBy
$CCEDocuments->UploadedBy->CellCssStyle = ""; $CCEDocuments->UploadedBy->CellCssClass = "";
$CCEDocuments->UploadedBy->CellAttrs = array(); $CCEDocuments->UploadedBy->ViewAttrs = array(); $CCEDocuments->UploadedBy->EditAttrs = array();
if ($CCEDocuments->RowType == EW_ROWTYPE_VIEW) { // View row
// CCEDocumentID
$CCEDocuments->CCEDocumentID->ViewValue = $CCEDocuments->CCEDocumentID->CurrentValue;
$CCEDocuments->CCEDocumentID->CssStyle = "";
$CCEDocuments->CCEDocumentID->CssClass = "";
$CCEDocuments->CCEDocumentID->ViewCustomAttributes = "";
// CCEModuleID
if (strval($CCEDocuments->CCEModuleID->CurrentValue) <> "") {
$sFilterWrk = "CCEModules.CCEModuleID = " . ew_AdjustSql($CCEDocuments->CCEModuleID->CurrentValue) . "";
$sSqlWrk = "SELECT CCEModules.ModuleNum AS `ModuleNum`, CCEModules.ModuleName AS `ModuleName` FROM CCECourses Inner Join CCEModules On CCECourses.CCECourseID = CCEModules.CCECourseID";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY CCECourses.CCECourseID, CCEModules.ModuleNum";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEDocuments->CCEModuleID->ViewValue = $rswrk->fields('ModuleNum');
$CCEDocuments->CCEModuleID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('ModuleName');
$rswrk->Close();
} else {
$CCEDocuments->CCEModuleID->ViewValue = $CCEDocuments->CCEModuleID->CurrentValue;
}
} else {
$CCEDocuments->CCEModuleID->ViewValue = NULL;
}
$CCEDocuments->CCEModuleID->CssStyle = "";
$CCEDocuments->CCEModuleID->CssClass = "";
$CCEDocuments->CCEModuleID->ViewCustomAttributes = "";
// DocumentCategory
if (strval($CCEDocuments->DocumentCategory->CurrentValue) <> "") {
$sFilterWrk = "`CCEDocCategoryID` = " . ew_AdjustSql($CCEDocuments->DocumentCategory->CurrentValue) . "";
$sSqlWrk = "SELECT `CategoryName` FROM `CCEDocCategories`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `CategoryName`";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEDocuments->DocumentCategory->ViewValue = $rswrk->fields('CategoryName');
$rswrk->Close();
} else {
$CCEDocuments->DocumentCategory->ViewValue = $CCEDocuments->DocumentCategory->CurrentValue;
}
} else {
$CCEDocuments->DocumentCategory->ViewValue = NULL;
}
$CCEDocuments->DocumentCategory->CssStyle = "";
$CCEDocuments->DocumentCategory->CssClass = "";
$CCEDocuments->DocumentCategory->ViewCustomAttributes = "";
// DocumentName
$CCEDocuments->DocumentName->ViewValue = $CCEDocuments->DocumentName->CurrentValue;
$CCEDocuments->DocumentName->CssStyle = "";
$CCEDocuments->DocumentName->CssClass = "";
$CCEDocuments->DocumentName->ViewCustomAttributes = "";
// DocumentFile
if (!ew_Empty($CCEDocuments->DocumentFile->Upload->DbValue)) {
$CCEDocuments->DocumentFile->ViewValue = $CCEDocuments->DocumentFile->Upload->DbValue;
} else {
$CCEDocuments->DocumentFile->ViewValue = "";
}
$CCEDocuments->DocumentFile->CssStyle = "";
$CCEDocuments->DocumentFile->CssClass = "";
$CCEDocuments->DocumentFile->ViewCustomAttributes = "";
// DocumentURL
$CCEDocuments->DocumentURL->ViewValue = $CCEDocuments->DocumentURL->CurrentValue;
$CCEDocuments->DocumentURL->CssStyle = "";
$CCEDocuments->DocumentURL->CssClass = "";
$CCEDocuments->DocumentURL->ViewCustomAttributes = "";
// UploadedBy
if (strval($CCEDocuments->UploadedBy->CurrentValue) <> "") {
$sFilterWrk = "`FacilitatorID` = " . ew_AdjustSql($CCEDocuments->UploadedBy->CurrentValue) . "";
$sSqlWrk = "SELECT `FacilitatorName` FROM `CCEFacilitators`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `FacilitatorName`";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEDocuments->UploadedBy->ViewValue = $rswrk->fields('FacilitatorName');
$rswrk->Close();
} else {
$CCEDocuments->UploadedBy->ViewValue = $CCEDocuments->UploadedBy->CurrentValue;
}
} else {
$CCEDocuments->UploadedBy->ViewValue = NULL;
}
$CCEDocuments->UploadedBy->CssStyle = "";
$CCEDocuments->UploadedBy->CssClass = "";
$CCEDocuments->UploadedBy->ViewCustomAttributes = "";
// CCEDocumentID
$CCEDocuments->CCEDocumentID->HrefValue = "";
$CCEDocuments->CCEDocumentID->TooltipValue = "";
// CCEModuleID
$CCEDocuments->CCEModuleID->HrefValue = "";
$CCEDocuments->CCEModuleID->TooltipValue = "";
// DocumentCategory
$CCEDocuments->DocumentCategory->HrefValue = "";
$CCEDocuments->DocumentCategory->TooltipValue = "";
// DocumentName
$CCEDocuments->DocumentName->HrefValue = "";
$CCEDocuments->DocumentName->TooltipValue = "";
// DocumentFile
if (!ew_Empty($CCEDocuments->DocumentFile->Upload->DbValue)) {
$CCEDocuments->DocumentFile->HrefValue = ew_UploadPathEx(FALSE, $CCEDocuments->DocumentFile->UploadPath) . ((!empty($CCEDocuments->DocumentFile->ViewValue)) ? $CCEDocuments->DocumentFile->ViewValue : $CCEDocuments->DocumentFile->CurrentValue);
if ($CCEDocuments->Export <> "") $CCEDocuments->DocumentFile->HrefValue = ew_ConvertFullUrl($CCEDocuments->DocumentFile->HrefValue);
} else {
$CCEDocuments->DocumentFile->HrefValue = "";
}
$CCEDocuments->DocumentFile->TooltipValue = "";
// DocumentURL
$CCEDocuments->DocumentURL->HrefValue = "";
$CCEDocuments->DocumentURL->TooltipValue = "";
// UploadedBy
$CCEDocuments->UploadedBy->HrefValue = "";
$CCEDocuments->UploadedBy->TooltipValue = "";
} elseif ($CCEDocuments->RowType == EW_ROWTYPE_EDIT) { // Edit row
// CCEDocumentID
$CCEDocuments->CCEDocumentID->EditCustomAttributes = "";
// CCEModuleID
$CCEDocuments->CCEModuleID->EditCustomAttributes = "";
if ($CCEDocuments->CCEModuleID->getSessionValue() <> "") {
$CCEDocuments->CCEModuleID->CurrentValue = $CCEDocuments->CCEModuleID->getSessionValue();
if (strval($CCEDocuments->CCEModuleID->CurrentValue) <> "") {
$sFilterWrk = "CCEModules.CCEModuleID = " . ew_AdjustSql($CCEDocuments->CCEModuleID->CurrentValue) . "";
$sSqlWrk = "SELECT CCEModules.ModuleNum AS `ModuleNum`, CCEModules.ModuleName AS `ModuleName` FROM CCECourses Inner Join CCEModules On CCECourses.CCECourseID = CCEModules.CCECourseID";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY CCECourses.CCECourseID, CCEModules.ModuleNum";
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CCEDocuments->CCEModuleID->ViewValue = $rswrk->fields('ModuleNum');
$CCEDocuments->CCEModuleID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('ModuleName');
$rswrk->Close();
} else {
$CCEDocuments->CCEModuleID->ViewValue = $CCEDocuments->CCEModuleID->CurrentValue;
}
} else {
$CCEDocuments->CCEModuleID->ViewValue = NULL;
}
$CCEDocuments->CCEModuleID->CssStyle = "";
$CCEDocuments->CCEModuleID->CssClass = "";
$CCEDocuments->CCEModuleID->ViewCustomAttributes = "";
} else {
$sFilterWrk = "";
$sSqlWrk = "SELECT CCEModules.CCEModuleID, CCEModules.ModuleNum, CCEModules.ModuleName, '' AS SelectFilterFld FROM CCECourses Inner Join CCEModules On CCECourses.CCECourseID = CCEModules.CCECourseID";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY CCECourses.CCECourseID, CCEModules.ModuleNum";
$rswrk = $conn->Execute($sSqlWrk);
$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
if ($rswrk) $rswrk->Close();
array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), ""));
$CCEDocuments->CCEModuleID->EditValue = $arwrk;
}
// DocumentCategory
$CCEDocuments->DocumentCategory->EditCustomAttributes = "";
$sFilterWrk = "";
$sSqlWrk = "SELECT `CCEDocCategoryID`, `CategoryName`, '' AS Disp2Fld, '' AS SelectFilterFld FROM `CCEDocCategories`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `CategoryName`";
$rswrk = $conn->Execute($sSqlWrk);
$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
if ($rswrk) $rswrk->Close();
array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
$CCEDocuments->DocumentCategory->EditValue = $arwrk;
// DocumentName
$CCEDocuments->DocumentName->EditCustomAttributes = "";
$CCEDocuments->DocumentName->EditValue = ew_HtmlEncode($CCEDocuments->DocumentName->CurrentValue);
// DocumentFile
$CCEDocuments->DocumentFile->EditCustomAttributes = "";
if (!ew_Empty($CCEDocuments->DocumentFile->Upload->DbValue)) {
$CCEDocuments->DocumentFile->EditValue = $CCEDocuments->DocumentFile->Upload->DbValue;
} else {
$CCEDocuments->DocumentFile->EditValue = "";
}
// DocumentURL
$CCEDocuments->DocumentURL->EditCustomAttributes = "";
$CCEDocuments->DocumentURL->EditValue = ew_HtmlEncode($CCEDocuments->DocumentURL->CurrentValue);
// UploadedBy
$CCEDocuments->UploadedBy->EditCustomAttributes = "";
$sFilterWrk = "";
$sSqlWrk = "SELECT `FacilitatorID`, `FacilitatorName`, '' AS Disp2Fld, '' AS SelectFilterFld FROM `CCEFacilitators`";
$sWhereWrk = "";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$sSqlWrk .= " ORDER BY `FacilitatorName`";
$rswrk = $conn->Execute($sSqlWrk);
$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
if ($rswrk) $rswrk->Close();
array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
$CCEDocuments->UploadedBy->EditValue = $arwrk;
// Edit refer script
// CCEDocumentID
$CCEDocuments->CCEDocumentID->HrefValue = "";
// CCEModuleID
$CCEDocuments->CCEModuleID->HrefValue = "";
// DocumentCategory
$CCEDocuments->DocumentCategory->HrefValue = "";
// DocumentName
$CCEDocuments->DocumentName->HrefValue = "";
// DocumentFile
if (!ew_Empty($CCEDocuments->DocumentFile->Upload->DbValue)) {
$CCEDocuments->DocumentFile->HrefValue = ew_UploadPathEx(FALSE, $CCEDocuments->DocumentFile->UploadPath) . ((!empty($CCEDocuments->DocumentFile->EditValue)) ? $CCEDocuments->DocumentFile->EditValue : $CCEDocuments->DocumentFile->CurrentValue);
if ($CCEDocuments->Export <> "") $CCEDocuments->DocumentFile->HrefValue = ew_ConvertFullUrl($CCEDocuments->DocumentFile->HrefValue);
} else {
$CCEDocuments->DocumentFile->HrefValue = "";
}
// DocumentURL
$CCEDocuments->DocumentURL->HrefValue = "";
// UploadedBy
$CCEDocuments->UploadedBy->HrefValue = "";
}
// Call Row Rendered event
if ($CCEDocuments->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCEDocuments->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CCEDocuments;
// Initialize form error message
$gsFormError = "";
if (!ew_CheckFileType($CCEDocuments->DocumentFile->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CCEDocuments->DocumentFile->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CCEDocuments->DocumentFile->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CCEDocuments->DocumentFile->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CCEDocuments->DocumentFile->Upload->Error);
}
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!is_null($CCEDocuments->DocumentCategory->FormValue) && $CCEDocuments->DocumentCategory->FormValue == "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("EnterRequiredField") . " - " . $CCEDocuments->DocumentCategory->FldCaption();
}
// 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, $CCEDocuments;
$sFilter = $CCEDocuments->KeyFilter();
$CCEDocuments->CurrentFilter = $sFilter;
$sSql = $CCEDocuments->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();
// CCEModuleID
$CCEDocuments->CCEModuleID->SetDbValueDef($rsnew, $CCEDocuments->CCEModuleID->CurrentValue, NULL, FALSE);
// DocumentCategory
$CCEDocuments->DocumentCategory->SetDbValueDef($rsnew, $CCEDocuments->DocumentCategory->CurrentValue, NULL, FALSE);
// DocumentName
$CCEDocuments->DocumentName->SetDbValueDef($rsnew, $CCEDocuments->DocumentName->CurrentValue, NULL, FALSE);
// DocumentFile
$CCEDocuments->DocumentFile->Upload->SaveToSession(); // Save file value to Session
if ($CCEDocuments->DocumentFile->Upload->Action == "2" || $CCEDocuments->DocumentFile->Upload->Action == "3") { // Update/Remove
$CCEDocuments->DocumentFile->Upload->DbValue = $rs->fields('DocumentFile'); // Get original value
if (is_null($CCEDocuments->DocumentFile->Upload->Value)) {
$rsnew['DocumentFile'] = NULL;
} else {
$rsnew['DocumentFile'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CCEDocuments->DocumentFile->UploadPath), $CCEDocuments->DocumentFile->Upload->FileName);
}
}
// DocumentURL
$CCEDocuments->DocumentURL->SetDbValueDef($rsnew, $CCEDocuments->DocumentURL->CurrentValue, NULL, FALSE);
// UploadedBy
$CCEDocuments->UploadedBy->SetDbValueDef($rsnew, $CCEDocuments->UploadedBy->CurrentValue, NULL, FALSE);
// Call Row Updating event
$bUpdateRow = $CCEDocuments->Row_Updating($rsold, $rsnew);
if ($bUpdateRow) {
if (!ew_Empty($CCEDocuments->DocumentFile->Upload->Value)) {
$CCEDocuments->DocumentFile->Upload->SaveToFile($CCEDocuments->DocumentFile->UploadPath, $rsnew['DocumentFile'], FALSE);
}
$conn->raiseErrorFn = 'ew_ErrorFn';
$EditRow = $conn->Execute($CCEDocuments->UpdateSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CCEDocuments->CancelMessage <> "") {
$this->setMessage($CCEDocuments->CancelMessage);
$CCEDocuments->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("UpdateCancelled"));
}
$EditRow = FALSE;
}
}
// Call Row_Updated event
if ($EditRow)
$CCEDocuments->Row_Updated($rsold, $rsnew);
$rs->Close();
// DocumentFile
$CCEDocuments->DocumentFile->Upload->RemoveFromSession(); // Remove file value from Session
return $EditRow;
}
// Set up master/detail based on QueryString
function SetUpMasterDetail() {
global $CCEDocuments;
$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 == "CCEModules") {
$bValidMaster = TRUE;
$this->sDbMasterFilter = $CCEDocuments->SqlMasterFilter_CCEModules();
$this->sDbDetailFilter = $CCEDocuments->SqlDetailFilter_CCEModules();
if (@$_GET["CCEModuleID"] <> "") {
$GLOBALS["CCEModules"]->CCEModuleID->setQueryStringValue($_GET["CCEModuleID"]);
$CCEDocuments->CCEModuleID->setQueryStringValue($GLOBALS["CCEModules"]->CCEModuleID->QueryStringValue);
$CCEDocuments->CCEModuleID->setSessionValue($CCEDocuments->CCEModuleID->QueryStringValue);
if (!is_numeric($GLOBALS["CCEModules"]->CCEModuleID->QueryStringValue)) $bValidMaster = FALSE;
$this->sDbMasterFilter = str_replace("@CCEModuleID@", ew_AdjustSql($GLOBALS["CCEModules"]->CCEModuleID->QueryStringValue), $this->sDbMasterFilter);
$this->sDbDetailFilter = str_replace("@CCEModuleID@", ew_AdjustSql($GLOBALS["CCEModules"]->CCEModuleID->QueryStringValue), $this->sDbDetailFilter);
} else {
$bValidMaster = FALSE;
}
}
}
if ($bValidMaster) {
// Save current master table
$CCEDocuments->setCurrentMasterTable($sMasterTblVar);
// Reset start record counter (new master key)
$this->lStartRec = 1;
$CCEDocuments->setStartRecordNumber($this->lStartRec);
$CCEDocuments->setMasterFilter($this->sDbMasterFilter); // Set up master filter
$CCEDocuments->setDetailFilter($this->sDbDetailFilter); // Set up detail filter
// Clear previous master key from Session
if ($sMasterTblVar <> "CCEModules") {
if ($CCEDocuments->CCEModuleID->QueryStringValue == "") $CCEDocuments->CCEModuleID->setSessionValue("");
}
} else {
$this->sDbMasterFilter = $CCEDocuments->getMasterFilter(); // Restore master filter
$this->sDbDetailFilter = $CCEDocuments->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;
}
}
?>