| Current Path : /var/www/cesa.co.za/cceconvenors/ |
| Current File : /var/www/cesa.co.za/cceconvenors/CCEFacilitatorsview.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 "CCEFacilitatorsinfo.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
$CCEFacilitators_view = new cCCEFacilitators_view();
$Page =& $CCEFacilitators_view;
// Page init
$CCEFacilitators_view->Page_Init();
// Page main
$CCEFacilitators_view->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($CCEFacilitators->Export == "") { ?>
<script type="text/javascript">
<!--
// Create page object
var CCEFacilitators_view = new ew_Page("CCEFacilitators_view");
// page properties
CCEFacilitators_view.PageID = "view"; // page ID
CCEFacilitators_view.FormID = "fCCEFacilitatorsview"; // form ID
var EW_PAGE_ID = CCEFacilitators_view.PageID; // for backward compatibility
// extend page with Form_CustomValidate function
CCEFacilitators_view.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) { ?>
CCEFacilitators_view.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCEFacilitators_view.ValidateRequired = false; // no JavaScript validation
<?php } ?>
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js");
//-->
</script>
<?php } ?>
<p><span class="phpmaker"><?php echo $Language->Phrase("View") ?> <?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCEFacilitators->TableCaption() ?>
<?php if ($CCEFacilitators->Export == "") { ?>
<a href="<?php echo $CCEFacilitators_view->ExportPrintUrl ?>"><img src="images/print.gif" alt="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" title="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" width="16" height="16" border="0"></a>
<a href="<?php echo $CCEFacilitators_view->ExportExcelUrl ?>"><img src='images/exportxls.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' width='16' height='16' border='0'></a>
<a href="<?php echo $CCEFacilitators_view->ExportWordUrl ?>"><img src='images/exportdoc.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' width='16' height='16' border='0'></a>
<a name="emf_CCEFacilitators" id="emf_CCEFacilitators" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCEFacilitators',hdr:ewLanguage.Phrase('ExportToEmail'),key:<?php echo ew_ArrayToJsonAttr($CCEFacilitators_view->arRecKey) ?>,sel:false});"><img src='images/exportemail.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
<br><br>
<?php if ($CCEFacilitators->Export == "") { ?>
<a href="<?php echo $CCEFacilitators_view->ListUrl ?>"><?php echo $Language->Phrase("BackToList") ?></a>
<?php if ($Security->IsLoggedIn()) { ?>
<a href="<?php echo $CCEFacilitators_view->EditUrl ?>"><?php echo $Language->Phrase("ViewPageEditLink") ?></a>
<?php } ?>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CCEFacilitators_view->ShowMessage();
?>
<p>
<?php if ($CCEFacilitators->Export == "") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
<tr>
<td nowrap>
<?php if (!isset($CCEFacilitators_view->Pager)) $CCEFacilitators_view->Pager = new cPrevNextPager($CCEFacilitators_view->lStartRec, $CCEFacilitators_view->lDisplayRecs, $CCEFacilitators_view->lTotalRecs) ?>
<?php if ($CCEFacilitators_view->Pager->RecordCount > 0) { ?>
<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?> </span></td>
<!--first page button-->
<?php if ($CCEFacilitators_view->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--previous page button-->
<?php if ($CCEFacilitators_view->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--current page number-->
<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $CCEFacilitators_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCEFacilitators_view->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--last page button-->
<?php if ($CCEFacilitators_view->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<td><span class="phpmaker"> <?php echo $Language->Phrase("of") ?> <?php echo $CCEFacilitators_view->Pager->PageCount ?></span></td>
</tr></table>
<?php } else { ?>
<?php if ($CCEFacilitators_view->sSrchWhere == "0=101") { ?>
<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
<?php } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>
</form>
<br>
<?php } ?>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<?php if ($CCEFacilitators->FacilitatorName->Visible) { // FacilitatorName ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->FacilitatorName->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->FacilitatorName->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->FacilitatorName->ViewAttributes() ?>><?php echo $CCEFacilitators->FacilitatorName->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->PhoneNumber->Visible) { // PhoneNumber ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->PhoneNumber->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->PhoneNumber->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->PhoneNumber->ViewAttributes() ?>><?php echo $CCEFacilitators->PhoneNumber->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->MobileNumber->Visible) { // MobileNumber ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->MobileNumber->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->MobileNumber->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->MobileNumber->ViewAttributes() ?>><?php echo $CCEFacilitators->MobileNumber->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->FaxNumber->Visible) { // FaxNumber ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->FaxNumber->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->FaxNumber->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->FaxNumber->ViewAttributes() ?>><?php echo $CCEFacilitators->FaxNumber->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->EmailAddress->Visible) { // EmailAddress ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->EmailAddress->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->EmailAddress->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->EmailAddress->ViewAttributes() ?>><?php echo $CCEFacilitators->EmailAddress->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->CVFile->Visible) { // CVFile ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->CVFile->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->CVFile->CellAttributes() ?>>
<?php if ($CCEFacilitators->CVFile->HrefValue <> "" || $CCEFacilitators->CVFile->TooltipValue <> "") { ?>
<?php if (!empty($CCEFacilitators->CVFile->Upload->DbValue)) { ?>
<a href="<?php echo $CCEFacilitators->CVFile->HrefValue ?>"><?php echo $CCEFacilitators->CVFile->ViewValue ?></a>
<?php } elseif (!in_array($CCEFacilitators->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEFacilitators->CVFile->Upload->DbValue)) { ?>
<?php echo $CCEFacilitators->CVFile->ViewValue ?>
<?php } elseif (!in_array($CCEFacilitators->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->Photograph->Visible) { // Photograph ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->Photograph->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->Photograph->CellAttributes() ?>>
<?php if ($CCEFacilitators->Photograph->HrefValue <> "" || $CCEFacilitators->Photograph->TooltipValue <> "") { ?>
<?php if (!empty($CCEFacilitators->Photograph->Upload->DbValue)) { ?>
<a href="<?php echo $CCEFacilitators->Photograph->HrefValue ?>"><?php echo $CCEFacilitators->Photograph->ViewValue ?></a>
<?php } elseif (!in_array($CCEFacilitators->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } else { ?>
<?php if (!empty($CCEFacilitators->Photograph->Upload->DbValue)) { ?>
<?php echo $CCEFacilitators->Photograph->ViewValue ?>
<?php } elseif (!in_array($CCEFacilitators->CurrentAction, array("I", "edit", "gridedit"))) { ?>
<?php } ?>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->Qualifications->Visible) { // Qualifications ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->Qualifications->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->Qualifications->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->Qualifications->ViewAttributes() ?>><?php echo $CCEFacilitators->Qualifications->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->Archived->Visible) { // Archived ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->Archived->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->Archived->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->Archived->ViewAttributes() ?>><?php echo $CCEFacilitators->Archived->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->ReceiveMailToAll->Visible) { // ReceiveMailToAll ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->ReceiveMailToAll->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->ReceiveMailToAll->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->ReceiveMailToAll->ViewAttributes() ?>><?php echo $CCEFacilitators->ReceiveMailToAll->ViewValue ?></div></td>
</tr>
<?php } ?>
<?php if ($CCEFacilitators->ProgrammeCoordinator->Visible) { // ProgrammeCoordinator ?>
<tr<?php echo $CCEFacilitators->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CCEFacilitators->ProgrammeCoordinator->FldCaption() ?></td>
<td<?php echo $CCEFacilitators->ProgrammeCoordinator->CellAttributes() ?>>
<div<?php echo $CCEFacilitators->ProgrammeCoordinator->ViewAttributes() ?>><?php echo $CCEFacilitators->ProgrammeCoordinator->ViewValue ?></div></td>
</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<?php if ($CCEFacilitators->Export == "") { ?>
<br>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
<tr>
<td nowrap>
<?php if (!isset($CCEFacilitators_view->Pager)) $CCEFacilitators_view->Pager = new cPrevNextPager($CCEFacilitators_view->lStartRec, $CCEFacilitators_view->lDisplayRecs, $CCEFacilitators_view->lTotalRecs) ?>
<?php if ($CCEFacilitators_view->Pager->RecordCount > 0) { ?>
<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?> </span></td>
<!--first page button-->
<?php if ($CCEFacilitators_view->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--previous page button-->
<?php if ($CCEFacilitators_view->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--current page number-->
<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $CCEFacilitators_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCEFacilitators_view->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<!--last page button-->
<?php if ($CCEFacilitators_view->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCEFacilitators_view->PageUrl() ?>start=<?php echo $CCEFacilitators_view->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>
<?php } else { ?>
<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
<?php } ?>
<td><span class="phpmaker"> <?php echo $Language->Phrase("of") ?> <?php echo $CCEFacilitators_view->Pager->PageCount ?></span></td>
</tr></table>
<?php } else { ?>
<?php if ($CCEFacilitators_view->sSrchWhere == "0=101") { ?>
<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
<?php } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>
</form>
<?php } ?>
<p>
<?php if ($CCEFacilitators->Export == "") { ?>
<script language="JavaScript" type="text/javascript">
<!--
// Write your table-specific startup script here
// document.write("page loaded");
//-->
</script>
<?php } ?>
<?php include "footer.php" ?>
<?php
$CCEFacilitators_view->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCEFacilitators_view {
// Page ID
var $PageID = 'view';
// Table name
var $TableName = 'CCEFacilitators';
// Page object name
var $PageObjName = 'CCEFacilitators_view';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCEFacilitators;
if ($CCEFacilitators->UseTokenInUrl) $PageUrl .= "t=" . $CCEFacilitators->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, $CCEFacilitators;
if ($CCEFacilitators->UseTokenInUrl) {
if ($objForm)
return ($CCEFacilitators->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCEFacilitators->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCEFacilitators)
$GLOBALS["CCEFacilitators"] = new cCCEFacilitators();
// Table object (CCEFacilitatorUsers)
$GLOBALS['CCEFacilitatorUsers'] = new cCCEFacilitatorUsers();
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'view', TRUE);
// Table name (for backward compatibility)
if (!defined("EW_TABLE_NAME"))
define("EW_TABLE_NAME", 'CCEFacilitators', 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 $CCEFacilitators;
// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
// Get export parameters
if (@$_GET["export"] <> "") {
$CCEFacilitators->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$CCEFacilitators->Export = $_POST["exporttype"];
} else {
$CCEFacilitators->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $CCEFacilitators->Export; // Get export parameter, used in header
$gsExportFile = $CCEFacilitators->TableVar; // Get export file, used in header
if (@$_GET["FacilitatorID"] <> "") {
if ($gsExportFile <> "") $gsExportFile .= "_";
$gsExportFile .= ew_StripSlashes($_GET["FacilitatorID"]);
}
if ($CCEFacilitators->Export == "excel") {
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
}
if ($CCEFacilitators->Export == "word") {
header('Content-Type: application/vnd.ms-word');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
}
// Global Page Loading event (in userfn*.php)
Page_Loading();
// Page Load event
$this->Page_Load();
}
//
// Page_Terminate
//
function Page_Terminate($url = "") {
global $conn;
// Page Unload event
$this->Page_Unload();
// Global Page Unloaded event (in userfn*.php)
Page_Unloaded();
// Close connection
$conn->Close();
// Go to URL if specified
$this->Page_Redirecting($url);
if ($url <> "") {
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header("Location: " . $url);
}
exit();
}
var $lDisplayRecs = 1;
var $lStartRec;
var $lStopRec;
var $lTotalRecs = 0;
var $lRecRange = 10;
var $lRecCnt;
var $arRecKey = array();
//
// Page main
//
function Page_Main() {
global $Language, $CCEFacilitators;
// Load current record
$bLoadCurrentRecord = FALSE;
$sReturnUrl = "";
$bMatchRecord = FALSE;
if ($this->IsPageRequest()) { // Validate request
if (@$_GET["FacilitatorID"] <> "") {
$CCEFacilitators->FacilitatorID->setQueryStringValue($_GET["FacilitatorID"]);
$this->arRecKey["FacilitatorID"] = $CCEFacilitators->FacilitatorID->QueryStringValue;
} else {
$bLoadCurrentRecord = TRUE;
}
// Get action
$CCEFacilitators->CurrentAction = "I"; // Display form
switch ($CCEFacilitators->CurrentAction) {
case "I": // Get a record to display
$this->lStartRec = 1; // Initialize start position
if ($rs = $this->LoadRecordset()) // Load records
$this->lTotalRecs = $rs->RecordCount(); // Get record count
if ($this->lTotalRecs <= 0) { // No record found
$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
$this->Page_Terminate("CCEFacilitatorslist.php"); // Return to list page
} elseif ($bLoadCurrentRecord) { // Load current record position
$this->SetUpStartRec(); // Set up start record position
// Point to current record
if (intval($this->lStartRec) <= intval($this->lTotalRecs)) {
$bMatchRecord = TRUE;
$rs->Move($this->lStartRec-1);
}
} else { // Match key values
while (!$rs->EOF) {
if (strval($CCEFacilitators->FacilitatorID->CurrentValue) == strval($rs->fields('FacilitatorID'))) {
$CCEFacilitators->setStartRecordNumber($this->lStartRec); // Save record position
$bMatchRecord = TRUE;
break;
} else {
$this->lStartRec++;
$rs->MoveNext();
}
}
}
if (!$bMatchRecord) {
$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
$sReturnUrl = "CCEFacilitatorslist.php"; // No matching record, return to list
} else {
$this->LoadRowValues($rs); // Load row values
}
}
// Export data only
if (in_array($CCEFacilitators->Export, array("html","word","excel","xml","csv","email"))) {
$this->ExportData();
if ($CCEFacilitators->Export <> "email")
$this->Page_Terminate(); // Terminate response
exit();
}
} else {
$sReturnUrl = "CCEFacilitatorslist.php"; // Not page request, return to list
}
if ($sReturnUrl <> "")
$this->Page_Terminate($sReturnUrl);
// Render row
$CCEFacilitators->RowType = EW_ROWTYPE_VIEW;
$this->RenderRow();
}
// Set up starting record parameters
function SetUpStartRec() {
global $CCEFacilitators;
if ($this->lDisplayRecs == 0)
return;
if ($this->IsPageRequest()) { // Validate request
if (@$_GET[EW_TABLE_START_REC] <> "") { // Check for "start" parameter
$this->lStartRec = $_GET[EW_TABLE_START_REC];
$CCEFacilitators->setStartRecordNumber($this->lStartRec);
} elseif (@$_GET[EW_TABLE_PAGE_NO] <> "") {
$this->nPageNo = $_GET[EW_TABLE_PAGE_NO];
if (is_numeric($this->nPageNo)) {
$this->lStartRec = ($this->nPageNo-1)*$this->lDisplayRecs+1;
if ($this->lStartRec <= 0) {
$this->lStartRec = 1;
} elseif ($this->lStartRec >= intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1) {
$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1;
}
$CCEFacilitators->setStartRecordNumber($this->lStartRec);
}
}
}
$this->lStartRec = $CCEFacilitators->getStartRecordNumber();
// Check if correct start record counter
if (!is_numeric($this->lStartRec) || $this->lStartRec == "") { // Avoid invalid start record counter
$this->lStartRec = 1; // Reset start record counter
$CCEFacilitators->setStartRecordNumber($this->lStartRec);
} elseif (intval($this->lStartRec) > intval($this->lTotalRecs)) { // Avoid starting record > total records
$this->lStartRec = intval(($this->lTotalRecs-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to last page first record
$CCEFacilitators->setStartRecordNumber($this->lStartRec);
} elseif (($this->lStartRec-1) % $this->lDisplayRecs <> 0) {
$this->lStartRec = intval(($this->lStartRec-1)/$this->lDisplayRecs)*$this->lDisplayRecs+1; // Point to page boundary
$CCEFacilitators->setStartRecordNumber($this->lStartRec);
}
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn, $CCEFacilitators;
// Call Recordset Selecting event
$CCEFacilitators->Recordset_Selecting($CCEFacilitators->CurrentFilter);
// Load List page SQL
$sSql = $CCEFacilitators->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $offset, $rowcnt";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$CCEFacilitators->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCEFacilitators;
$sFilter = $CCEFacilitators->KeyFilter();
// Call Row Selecting event
$CCEFacilitators->Row_Selecting($sFilter);
// Load SQL based on filter
$CCEFacilitators->CurrentFilter = $sFilter;
$sSql = $CCEFacilitators->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCEFacilitators->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCEFacilitators;
$CCEFacilitators->FacilitatorID->setDbValue($rs->fields('FacilitatorID'));
$CCEFacilitators->FacilitatorName->setDbValue($rs->fields('FacilitatorName'));
$CCEFacilitators->PhoneNumber->setDbValue($rs->fields('PhoneNumber'));
$CCEFacilitators->MobileNumber->setDbValue($rs->fields('MobileNumber'));
$CCEFacilitators->FaxNumber->setDbValue($rs->fields('FaxNumber'));
$CCEFacilitators->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$CCEFacilitators->CVFile->Upload->DbValue = $rs->fields('CVFile');
$CCEFacilitators->Photograph->Upload->DbValue = $rs->fields('Photograph');
$CCEFacilitators->Qualifications->setDbValue($rs->fields('Qualifications'));
$CCEFacilitators->Archived->setDbValue($rs->fields('Archived'));
$CCEFacilitators->ReceiveMailToAll->setDbValue($rs->fields('ReceiveMailToAll'));
$CCEFacilitators->ProgrammeCoordinator->setDbValue($rs->fields('ProgrammeCoordinator'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCEFacilitators;
// Initialize URLs
$this->ExportPrintUrl = $this->PageUrl() . "export=print&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->ExportHtmlUrl = $this->PageUrl() . "export=html&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->ExportExcelUrl = $this->PageUrl() . "export=excel&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->ExportWordUrl = $this->PageUrl() . "export=word&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->ExportXmlUrl = $this->PageUrl() . "export=xml&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->ExportCsvUrl = $this->PageUrl() . "export=csv&" . "FacilitatorID=" . urlencode($CCEFacilitators->FacilitatorID->CurrentValue);
$this->AddUrl = $CCEFacilitators->AddUrl();
$this->EditUrl = $CCEFacilitators->EditUrl();
$this->CopyUrl = $CCEFacilitators->CopyUrl();
$this->DeleteUrl = $CCEFacilitators->DeleteUrl();
$this->ListUrl = $CCEFacilitators->ListUrl();
// Call Row_Rendering event
$CCEFacilitators->Row_Rendering();
// Common render codes for all row types
// FacilitatorName
$CCEFacilitators->FacilitatorName->CellCssStyle = ""; $CCEFacilitators->FacilitatorName->CellCssClass = "";
$CCEFacilitators->FacilitatorName->CellAttrs = array(); $CCEFacilitators->FacilitatorName->ViewAttrs = array(); $CCEFacilitators->FacilitatorName->EditAttrs = array();
// PhoneNumber
$CCEFacilitators->PhoneNumber->CellCssStyle = ""; $CCEFacilitators->PhoneNumber->CellCssClass = "";
$CCEFacilitators->PhoneNumber->CellAttrs = array(); $CCEFacilitators->PhoneNumber->ViewAttrs = array(); $CCEFacilitators->PhoneNumber->EditAttrs = array();
// MobileNumber
$CCEFacilitators->MobileNumber->CellCssStyle = ""; $CCEFacilitators->MobileNumber->CellCssClass = "";
$CCEFacilitators->MobileNumber->CellAttrs = array(); $CCEFacilitators->MobileNumber->ViewAttrs = array(); $CCEFacilitators->MobileNumber->EditAttrs = array();
// FaxNumber
$CCEFacilitators->FaxNumber->CellCssStyle = ""; $CCEFacilitators->FaxNumber->CellCssClass = "";
$CCEFacilitators->FaxNumber->CellAttrs = array(); $CCEFacilitators->FaxNumber->ViewAttrs = array(); $CCEFacilitators->FaxNumber->EditAttrs = array();
// EmailAddress
$CCEFacilitators->EmailAddress->CellCssStyle = ""; $CCEFacilitators->EmailAddress->CellCssClass = "";
$CCEFacilitators->EmailAddress->CellAttrs = array(); $CCEFacilitators->EmailAddress->ViewAttrs = array(); $CCEFacilitators->EmailAddress->EditAttrs = array();
// CVFile
$CCEFacilitators->CVFile->CellCssStyle = ""; $CCEFacilitators->CVFile->CellCssClass = "";
$CCEFacilitators->CVFile->CellAttrs = array(); $CCEFacilitators->CVFile->ViewAttrs = array(); $CCEFacilitators->CVFile->EditAttrs = array();
// Photograph
$CCEFacilitators->Photograph->CellCssStyle = ""; $CCEFacilitators->Photograph->CellCssClass = "";
$CCEFacilitators->Photograph->CellAttrs = array(); $CCEFacilitators->Photograph->ViewAttrs = array(); $CCEFacilitators->Photograph->EditAttrs = array();
// Qualifications
$CCEFacilitators->Qualifications->CellCssStyle = ""; $CCEFacilitators->Qualifications->CellCssClass = "";
$CCEFacilitators->Qualifications->CellAttrs = array(); $CCEFacilitators->Qualifications->ViewAttrs = array(); $CCEFacilitators->Qualifications->EditAttrs = array();
// Archived
$CCEFacilitators->Archived->CellCssStyle = ""; $CCEFacilitators->Archived->CellCssClass = "";
$CCEFacilitators->Archived->CellAttrs = array(); $CCEFacilitators->Archived->ViewAttrs = array(); $CCEFacilitators->Archived->EditAttrs = array();
// ReceiveMailToAll
$CCEFacilitators->ReceiveMailToAll->CellCssStyle = ""; $CCEFacilitators->ReceiveMailToAll->CellCssClass = "";
$CCEFacilitators->ReceiveMailToAll->CellAttrs = array(); $CCEFacilitators->ReceiveMailToAll->ViewAttrs = array(); $CCEFacilitators->ReceiveMailToAll->EditAttrs = array();
// ProgrammeCoordinator
$CCEFacilitators->ProgrammeCoordinator->CellCssStyle = ""; $CCEFacilitators->ProgrammeCoordinator->CellCssClass = "";
$CCEFacilitators->ProgrammeCoordinator->CellAttrs = array(); $CCEFacilitators->ProgrammeCoordinator->ViewAttrs = array(); $CCEFacilitators->ProgrammeCoordinator->EditAttrs = array();
if ($CCEFacilitators->RowType == EW_ROWTYPE_VIEW) { // View row
// FacilitatorID
$CCEFacilitators->FacilitatorID->ViewValue = $CCEFacilitators->FacilitatorID->CurrentValue;
$CCEFacilitators->FacilitatorID->CssStyle = "";
$CCEFacilitators->FacilitatorID->CssClass = "";
$CCEFacilitators->FacilitatorID->ViewCustomAttributes = "";
// FacilitatorName
$CCEFacilitators->FacilitatorName->ViewValue = $CCEFacilitators->FacilitatorName->CurrentValue;
$CCEFacilitators->FacilitatorName->CssStyle = "";
$CCEFacilitators->FacilitatorName->CssClass = "";
$CCEFacilitators->FacilitatorName->ViewCustomAttributes = "";
// PhoneNumber
$CCEFacilitators->PhoneNumber->ViewValue = $CCEFacilitators->PhoneNumber->CurrentValue;
$CCEFacilitators->PhoneNumber->CssStyle = "";
$CCEFacilitators->PhoneNumber->CssClass = "";
$CCEFacilitators->PhoneNumber->ViewCustomAttributes = "";
// MobileNumber
$CCEFacilitators->MobileNumber->ViewValue = $CCEFacilitators->MobileNumber->CurrentValue;
$CCEFacilitators->MobileNumber->CssStyle = "";
$CCEFacilitators->MobileNumber->CssClass = "";
$CCEFacilitators->MobileNumber->ViewCustomAttributes = "";
// FaxNumber
$CCEFacilitators->FaxNumber->ViewValue = $CCEFacilitators->FaxNumber->CurrentValue;
$CCEFacilitators->FaxNumber->CssStyle = "";
$CCEFacilitators->FaxNumber->CssClass = "";
$CCEFacilitators->FaxNumber->ViewCustomAttributes = "";
// EmailAddress
$CCEFacilitators->EmailAddress->ViewValue = $CCEFacilitators->EmailAddress->CurrentValue;
$CCEFacilitators->EmailAddress->CssStyle = "";
$CCEFacilitators->EmailAddress->CssClass = "";
$CCEFacilitators->EmailAddress->ViewCustomAttributes = "";
// CVFile
if (!ew_Empty($CCEFacilitators->CVFile->Upload->DbValue)) {
$CCEFacilitators->CVFile->ViewValue = $CCEFacilitators->CVFile->Upload->DbValue;
} else {
$CCEFacilitators->CVFile->ViewValue = "";
}
$CCEFacilitators->CVFile->CssStyle = "";
$CCEFacilitators->CVFile->CssClass = "";
$CCEFacilitators->CVFile->ViewCustomAttributes = "";
// Photograph
if (!ew_Empty($CCEFacilitators->Photograph->Upload->DbValue)) {
$CCEFacilitators->Photograph->ViewValue = $CCEFacilitators->Photograph->Upload->DbValue;
} else {
$CCEFacilitators->Photograph->ViewValue = "";
}
$CCEFacilitators->Photograph->CssStyle = "";
$CCEFacilitators->Photograph->CssClass = "";
$CCEFacilitators->Photograph->ViewCustomAttributes = "";
// Qualifications
$CCEFacilitators->Qualifications->ViewValue = $CCEFacilitators->Qualifications->CurrentValue;
$CCEFacilitators->Qualifications->CssStyle = "";
$CCEFacilitators->Qualifications->CssClass = "";
$CCEFacilitators->Qualifications->ViewCustomAttributes = "";
// Archived
$CCEFacilitators->Archived->ViewValue = $CCEFacilitators->Archived->CurrentValue;
$CCEFacilitators->Archived->CssStyle = "";
$CCEFacilitators->Archived->CssClass = "";
$CCEFacilitators->Archived->ViewCustomAttributes = "";
// ReceiveMailToAll
$CCEFacilitators->ReceiveMailToAll->ViewValue = $CCEFacilitators->ReceiveMailToAll->CurrentValue;
$CCEFacilitators->ReceiveMailToAll->CssStyle = "";
$CCEFacilitators->ReceiveMailToAll->CssClass = "";
$CCEFacilitators->ReceiveMailToAll->ViewCustomAttributes = "";
// ProgrammeCoordinator
$CCEFacilitators->ProgrammeCoordinator->ViewValue = $CCEFacilitators->ProgrammeCoordinator->CurrentValue;
$CCEFacilitators->ProgrammeCoordinator->CssStyle = "";
$CCEFacilitators->ProgrammeCoordinator->CssClass = "";
$CCEFacilitators->ProgrammeCoordinator->ViewCustomAttributes = "";
// FacilitatorName
$CCEFacilitators->FacilitatorName->HrefValue = "";
$CCEFacilitators->FacilitatorName->TooltipValue = "";
// PhoneNumber
$CCEFacilitators->PhoneNumber->HrefValue = "";
$CCEFacilitators->PhoneNumber->TooltipValue = "";
// MobileNumber
$CCEFacilitators->MobileNumber->HrefValue = "";
$CCEFacilitators->MobileNumber->TooltipValue = "";
// FaxNumber
$CCEFacilitators->FaxNumber->HrefValue = "";
$CCEFacilitators->FaxNumber->TooltipValue = "";
// EmailAddress
$CCEFacilitators->EmailAddress->HrefValue = "";
$CCEFacilitators->EmailAddress->TooltipValue = "";
// CVFile
if (!ew_Empty($CCEFacilitators->CVFile->Upload->DbValue)) {
$CCEFacilitators->CVFile->HrefValue = ew_UploadPathEx(FALSE, $CCEFacilitators->CVFile->UploadPath) . ((!empty($CCEFacilitators->CVFile->ViewValue)) ? $CCEFacilitators->CVFile->ViewValue : $CCEFacilitators->CVFile->CurrentValue);
if ($CCEFacilitators->Export <> "") $CCEFacilitators->CVFile->HrefValue = ew_ConvertFullUrl($CCEFacilitators->CVFile->HrefValue);
} else {
$CCEFacilitators->CVFile->HrefValue = "";
}
$CCEFacilitators->CVFile->TooltipValue = "";
// Photograph
if (!ew_Empty($CCEFacilitators->Photograph->Upload->DbValue)) {
$CCEFacilitators->Photograph->HrefValue = ew_UploadPathEx(FALSE, $CCEFacilitators->Photograph->UploadPath) . ((!empty($CCEFacilitators->Photograph->ViewValue)) ? $CCEFacilitators->Photograph->ViewValue : $CCEFacilitators->Photograph->CurrentValue);
if ($CCEFacilitators->Export <> "") $CCEFacilitators->Photograph->HrefValue = ew_ConvertFullUrl($CCEFacilitators->Photograph->HrefValue);
} else {
$CCEFacilitators->Photograph->HrefValue = "";
}
$CCEFacilitators->Photograph->TooltipValue = "";
// Qualifications
$CCEFacilitators->Qualifications->HrefValue = "";
$CCEFacilitators->Qualifications->TooltipValue = "";
// Archived
$CCEFacilitators->Archived->HrefValue = "";
$CCEFacilitators->Archived->TooltipValue = "";
// ReceiveMailToAll
$CCEFacilitators->ReceiveMailToAll->HrefValue = "";
$CCEFacilitators->ReceiveMailToAll->TooltipValue = "";
// ProgrammeCoordinator
$CCEFacilitators->ProgrammeCoordinator->HrefValue = "";
$CCEFacilitators->ProgrammeCoordinator->TooltipValue = "";
}
// Call Row Rendered event
if ($CCEFacilitators->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCEFacilitators->Row_Rendered();
}
// Export data in HTML/CSV/Word/Excel/XML/Email format
function ExportData() {
global $CCEFacilitators;
$utf8 = FALSE;
$bSelectLimit = FALSE;
// Load recordset
if ($bSelectLimit) {
$this->lTotalRecs = $CCEFacilitators->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->lTotalRecs = $rs->RecordCount();
}
$this->lStartRec = 1;
$this->SetUpStartRec(); // Set up start record position
// Set the last record to display
if ($this->lDisplayRecs < 0) {
$this->lStopRec = $this->lTotalRecs;
} else {
$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
}
if (!$rs) {
header("Content-Type:"); // Remove header
header("Content-Disposition:");
$this->ShowMessage();
return;
}
if ($CCEFacilitators->Export == "xml") {
$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
$XmlDoc->AddRoot();
} else {
$ExportDoc = new cExportDocument($CCEFacilitators, "v");
$ExportDoc->ExportHeader();
if ($ExportDoc->Horizontal) { // Horizontal format, write header
$ExportDoc->BeginExportRow();
$ExportDoc->ExportCaption($CCEFacilitators->FacilitatorID);
$ExportDoc->ExportCaption($CCEFacilitators->FacilitatorName);
$ExportDoc->ExportCaption($CCEFacilitators->PhoneNumber);
$ExportDoc->ExportCaption($CCEFacilitators->MobileNumber);
$ExportDoc->ExportCaption($CCEFacilitators->FaxNumber);
$ExportDoc->ExportCaption($CCEFacilitators->EmailAddress);
$ExportDoc->ExportCaption($CCEFacilitators->CVFile);
$ExportDoc->ExportCaption($CCEFacilitators->Photograph);
$ExportDoc->ExportCaption($CCEFacilitators->Qualifications);
$ExportDoc->ExportCaption($CCEFacilitators->Archived);
$ExportDoc->ExportCaption($CCEFacilitators->ReceiveMailToAll);
$ExportDoc->ExportCaption($CCEFacilitators->ProgrammeCoordinator);
$ExportDoc->EndExportRow();
}
}
// Move to first record
$this->lRecCnt = $this->lStartRec - 1;
if (!$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $this->lStartRec > 1)
$rs->Move($this->lStartRec - 1);
}
while (!$rs->EOF && $this->lRecCnt < $this->lStopRec) {
$this->lRecCnt++;
if (intval($this->lRecCnt) >= intval($this->lStartRec)) {
$this->LoadRowValues($rs);
// Render row
$CCEFacilitators->CssClass = "";
$CCEFacilitators->CssStyle = "";
$CCEFacilitators->RowType = EW_ROWTYPE_VIEW; // Render view
$this->RenderRow();
if ($CCEFacilitators->Export == "xml") {
$XmlDoc->AddRow();
$XmlDoc->AddField('FacilitatorID', $CCEFacilitators->FacilitatorID->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('FacilitatorName', $CCEFacilitators->FacilitatorName->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('PhoneNumber', $CCEFacilitators->PhoneNumber->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('MobileNumber', $CCEFacilitators->MobileNumber->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('FaxNumber', $CCEFacilitators->FaxNumber->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('EmailAddress', $CCEFacilitators->EmailAddress->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('CVFile', $CCEFacilitators->CVFile->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('Photograph', $CCEFacilitators->Photograph->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('Qualifications', $CCEFacilitators->Qualifications->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('Archived', $CCEFacilitators->Archived->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('ReceiveMailToAll', $CCEFacilitators->ReceiveMailToAll->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
$XmlDoc->AddField('ProgrammeCoordinator', $CCEFacilitators->ProgrammeCoordinator->ExportValue($CCEFacilitators->Export, $CCEFacilitators->ExportOriginalValue));
} else {
$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
$ExportDoc->ExportField($CCEFacilitators->FacilitatorID);
$ExportDoc->ExportField($CCEFacilitators->FacilitatorName);
$ExportDoc->ExportField($CCEFacilitators->PhoneNumber);
$ExportDoc->ExportField($CCEFacilitators->MobileNumber);
$ExportDoc->ExportField($CCEFacilitators->FaxNumber);
$ExportDoc->ExportField($CCEFacilitators->EmailAddress);
$ExportDoc->ExportField($CCEFacilitators->CVFile);
$ExportDoc->ExportField($CCEFacilitators->Photograph);
$ExportDoc->ExportField($CCEFacilitators->Qualifications);
$ExportDoc->ExportField($CCEFacilitators->Archived);
$ExportDoc->ExportField($CCEFacilitators->ReceiveMailToAll);
$ExportDoc->ExportField($CCEFacilitators->ProgrammeCoordinator);
$ExportDoc->EndExportRow();
}
}
$rs->MoveNext();
}
if ($CCEFacilitators->Export <> "xml")
$ExportDoc->ExportFooter();
// Close recordset
$rs->Close();
// Clean output buffer
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
// Write BOM if utf-8
if ($utf8 && !in_array($CCEFacilitators->Export, array("email", "xml")))
echo "\xEF\xBB\xBF";
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
if ($CCEFacilitators->Export == "xml") {
header("Content-Type: text/xml");
echo $XmlDoc->XML();
} elseif ($CCEFacilitators->Export == "email") {
$this->ExportEmail($ExportDoc->Text);
$this->Page_Terminate($CCEFacilitators->ExportReturnUrl());
} else {
echo $ExportDoc->Text;
}
}
// Export email
function ExportEmail($EmailContent) {
global $Language, $CCEFacilitators;
$sSender = @$_GET["sender"];
$sRecipient = @$_GET["recipient"];
$sCc = @$_GET["cc"];
$sBcc = @$_GET["bcc"];
$sContentType = @$_GET["contenttype"];
// Subject
$sSubject = ew_StripSlashes(@$_GET["subject"]);
$sEmailSubject = $sSubject;
// Message
$sContent = ew_StripSlashes(@$_GET["message"]);
$sEmailMessage = $sContent;
// Check sender
if ($sSender == "") {
$this->setMessage($Language->Phrase("EnterSenderEmail"));
return;
}
if (!ew_CheckEmail($sSender)) {
$this->setMessage($Language->Phrase("EnterProperSenderEmail"));
return;
}
// Check recipient
if (!ew_CheckEmailList($sRecipient, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperRecipientEmail"));
return;
}
// Check cc
if (!ew_CheckEmailList($sCc, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperCcEmail"));
return;
}
// Check bcc
if (!ew_CheckEmailList($sBcc, EW_MAX_EMAIL_RECIPIENT)) {
$this->setMessage($Language->Phrase("EnterProperBccEmail"));
return;
}
// Check email sent count
if (!isset($_SESSION[EW_EXPORT_EMAIL_COUNTER]))
$_SESSION[EW_EXPORT_EMAIL_COUNTER] = 0;
if (intval($_SESSION[EW_EXPORT_EMAIL_COUNTER]) > EW_MAX_EMAIL_SENT_COUNT) {
$this->setMessage($Language->Phrase("ExceedMaxEmailExport"));
return;
}
if ($sEmailMessage <> "") {
$sEmailMessage = ew_RemoveXSS($sEmailMessage);
$sEmailMessage .= ($sContentType == "url") ? "\r\n\r\n" : "<br><br>";
}
if ($sContentType == "url") {
$sUrl = ew_ConvertFullUrl(ew_CurrentPage() . "?" . $this->ExportQueryString());
$sEmailMessage .= $sUrl; // send URL only
} else {
$sEmailMessage .= $EmailContent; // send HTML
}
// Send email
$Email = new cEmail();
$Email->Sender = $sSender; // Sender
$Email->Recipient = $sRecipient; // Recipient
$Email->Cc = $sCc; // Cc
$Email->Bcc = $sBcc; // Bcc
$Email->Subject = $sEmailSubject; // Subject
$Email->Content = $sEmailMessage; // Content
$Email->Format = ($sContentType == "url") ? "text" : "html";
$Email->Charset = EW_EMAIL_CHARSET;
$EventArgs = array();
$bEmailSent = FALSE;
if ($CCEFacilitators->Email_Sending($Email, $EventArgs))
$bEmailSent = $Email->Send();
// Check email sent status
if ($bEmailSent) {
// Update email sent count
$_SESSION[EW_EXPORT_EMAIL_COUNTER]++;
// Sent email success
$this->setMessage($Language->Phrase("SendEmailSuccess"));
} else {
// Sent email failure
$this->setMessage($Email->SendErrDescription);
}
}
// Export QueryString
function ExportQueryString() {
global $CCEFacilitators;
// Initialize
$sQry = "export=html";
// Add record key QueryString
$sQry .= "&" . substr($CCEFacilitators->KeyUrl("", ""), 1);
return $sQry;
}
// 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";
}
}
?>