| Current Path : /var/www/cesa.co.za/cpdadmin/ |
| Current File : /var/www/cesa.co.za/cpdadmin/CPDAssessorslist.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 "CPDAssessorsinfo.php" ?>
<?php include "CPDAdminUsersinfo.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
$CPDAssessors_list = new cCPDAssessors_list();
$Page =& $CPDAssessors_list;
// Page init
$CPDAssessors_list->Page_Init();
// Page main
$CPDAssessors_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($CPDAssessors->Export == "") { ?>
<script type="text/javascript">
<!--
// Create page object
var CPDAssessors_list = new ew_Page("CPDAssessors_list");
// page properties
CPDAssessors_list.PageID = "list"; // page ID
CPDAssessors_list.FormID = "fCPDAssessorslist"; // form ID
var EW_PAGE_ID = CPDAssessors_list.PageID; // for backward compatibility
// extend page with Form_CustomValidate function
CPDAssessors_list.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) { ?>
CPDAssessors_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CPDAssessors_list.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>
<?php } ?>
<?php if ($CPDAssessors->Export == "") { ?>
<?php } ?>
<?php
$bSelectLimit = EW_SELECT_LIMIT;
if ($bSelectLimit) {
$CPDAssessors_list->lTotalRecs = $CPDAssessors->SelectRecordCount();
} else {
if ($rs = $CPDAssessors_list->LoadRecordset())
$CPDAssessors_list->lTotalRecs = $rs->RecordCount();
}
$CPDAssessors_list->lStartRec = 1;
if ($CPDAssessors_list->lDisplayRecs <= 0 || ($CPDAssessors->Export <> "" && $CPDAssessors->ExportAll)) // Display all records
$CPDAssessors_list->lDisplayRecs = $CPDAssessors_list->lTotalRecs;
if (!($CPDAssessors->Export <> "" && $CPDAssessors->ExportAll))
$CPDAssessors_list->SetUpStartRec(); // Set up start record position
if ($bSelectLimit)
$rs = $CPDAssessors_list->LoadRecordset($CPDAssessors_list->lStartRec-1, $CPDAssessors_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CPDAssessors->TableCaption() ?>
<?php if ($CPDAssessors->Export == "" && $CPDAssessors->CurrentAction == "") { ?>
<a href="<?php echo $CPDAssessors_list->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 $CPDAssessors_list->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 $CPDAssessors_list->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_CPDAssessors" id="emf_CPDAssessors" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CPDAssessors',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fCPDAssessorslist,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 } ?>
</span></p>
<?php if ($Security->IsLoggedIn()) { ?>
<?php if ($CPDAssessors->Export == "" && $CPDAssessors->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(CPDAssessors_list);" style="text-decoration: none;"><img id="CPDAssessors_list_SearchImage" src="images/collapse.gif" alt="" width="9" height="9" border="0"></a><span class="phpmaker"> <?php echo $Language->Phrase("Search") ?></span><br>
<div id="CPDAssessors_list_SearchPanel">
<form name="fCPDAssessorslistsrch" id="fCPDAssessorslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="CPDAssessors">
<table class="ewBasicSearch">
<tr>
<td><span class="phpmaker">
<input type="text" name="<?php echo EW_TABLE_BASIC_SEARCH ?>" id="<?php echo EW_TABLE_BASIC_SEARCH ?>" size="20" value="<?php echo ew_HtmlEncode($CPDAssessors->getSessionBasicSearchKeyword()) ?>">
<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">
<a href="<?php echo $CPDAssessors_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>
</span></td>
</tr>
<tr>
<td><span class="phpmaker"><label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value=""<?php if ($CPDAssessors->getSessionBasicSearchType() == "") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("ExactPhrase") ?></label> <label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="AND"<?php if ($CPDAssessors->getSessionBasicSearchType() == "AND") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AllWord") ?></label> <label><input type="radio" name="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" id="<?php echo EW_TABLE_BASIC_SEARCH_TYPE ?>" value="OR"<?php if ($CPDAssessors->getSessionBasicSearchType() == "OR") { ?> checked="checked"<?php } ?>><?php echo $Language->Phrase("AnyWord") ?></label></span></td>
</tr>
</table>
</form>
</div>
<?php } ?>
<?php } ?>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CPDAssessors_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($CPDAssessors->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($CPDAssessors->CurrentAction <> "gridadd" && $CPDAssessors->CurrentAction <> "gridedit") { ?>
<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($CPDAssessors_list->Pager)) $CPDAssessors_list->Pager = new cPrevNextPager($CPDAssessors_list->lStartRec, $CPDAssessors_list->lDisplayRecs, $CPDAssessors_list->lTotalRecs) ?>
<?php if ($CPDAssessors_list->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 ($CPDAssessors_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 ($CPDAssessors_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 $CPDAssessors_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CPDAssessors_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 ($CPDAssessors_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 $CPDAssessors_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CPDAssessors_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CPDAssessors_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CPDAssessors_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($CPDAssessors_list->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 } ?>
<span class="phpmaker">
<?php if ($Security->IsLoggedIn()) { ?>
<a href="<?php echo $CPDAssessors_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>
<?php } ?>
</span>
</div>
<?php } ?>
<form name="fCPDAssessorslist" id="fCPDAssessorslist" class="ewForm" action="" method="post">
<div id="gmp_CPDAssessors" class="ewGridMiddlePanel">
<?php if ($CPDAssessors_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $CPDAssessors->TableCustomInnerHtml ?>
<thead><!-- Table header -->
<tr class="ewTableHeader">
<?php
// Render list options
$CPDAssessors_list->RenderListOptions();
// Render list options (header, left)
$CPDAssessors_list->ListOptions->Render("header", "left");
?>
<?php if ($CPDAssessors->FirstName->Visible) { // FirstName ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->FirstName) == "") { ?>
<td><?php echo $CPDAssessors->FirstName->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->FirstName) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->FirstName->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CPDAssessors->FirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->FirstName->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->Surname->Visible) { // Surname ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->Surname) == "") { ?>
<td><?php echo $CPDAssessors->Surname->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->Surname) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->Surname->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CPDAssessors->Surname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->Surname->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->Organisation->Visible) { // Organisation ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->Organisation) == "") { ?>
<td><?php echo $CPDAssessors->Organisation->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->Organisation) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->Organisation->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CPDAssessors->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->Organisation->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->CellNumber->Visible) { // CellNumber ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->CellNumber) == "") { ?>
<td><?php echo $CPDAssessors->CellNumber->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->CellNumber) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->CellNumber->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CPDAssessors->CellNumber->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->CellNumber->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->EmailAddress->Visible) { // EmailAddress ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->EmailAddress) == "") { ?>
<td><?php echo $CPDAssessors->EmailAddress->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->EmailAddress) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->EmailAddress->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CPDAssessors->EmailAddress->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->EmailAddress->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->adminusername->Visible) { // adminusername ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->adminusername) == "") { ?>
<td><?php echo $CPDAssessors->adminusername->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->adminusername) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->adminusername->FldCaption() ?></td><td style="width: 10px;"><?php if ($CPDAssessors->adminusername->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->adminusername->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->DateUpdated->Visible) { // DateUpdated ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->DateUpdated) == "") { ?>
<td><?php echo $CPDAssessors->DateUpdated->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->DateUpdated) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->DateUpdated->FldCaption() ?></td><td style="width: 10px;"><?php if ($CPDAssessors->DateUpdated->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->DateUpdated->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CPDAssessors->Active->Visible) { // Active ?>
<?php if ($CPDAssessors->SortUrl($CPDAssessors->Active) == "") { ?>
<td><?php echo $CPDAssessors->Active->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CPDAssessors->SortUrl($CPDAssessors->Active) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CPDAssessors->Active->FldCaption() ?></td><td style="width: 10px;"><?php if ($CPDAssessors->Active->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CPDAssessors->Active->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php
// Render list options (header, right)
$CPDAssessors_list->ListOptions->Render("header", "right");
?>
</tr>
</thead>
<?php
if ($CPDAssessors->ExportAll && $CPDAssessors->Export <> "") {
$CPDAssessors_list->lStopRec = $CPDAssessors_list->lTotalRecs;
} else {
$CPDAssessors_list->lStopRec = $CPDAssessors_list->lStartRec + $CPDAssessors_list->lDisplayRecs - 1; // Set the last record to display
}
$CPDAssessors_list->lRecCount = $CPDAssessors_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $CPDAssessors_list->lStartRec > 1)
$rs->Move($CPDAssessors_list->lStartRec - 1);
}
// Initialize aggregate
$CPDAssessors->RowType = EW_ROWTYPE_AGGREGATEINIT;
$CPDAssessors_list->RenderRow();
$CPDAssessors_list->lRowCnt = 0;
while (($CPDAssessors->CurrentAction == "gridadd" || !$rs->EOF) &&
$CPDAssessors_list->lRecCount < $CPDAssessors_list->lStopRec) {
$CPDAssessors_list->lRecCount++;
if (intval($CPDAssessors_list->lRecCount) >= intval($CPDAssessors_list->lStartRec)) {
$CPDAssessors_list->lRowCnt++;
// Init row class and style
$CPDAssessors->CssClass = "";
$CPDAssessors->CssStyle = "";
$CPDAssessors->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
if ($CPDAssessors->CurrentAction == "gridadd") {
$CPDAssessors_list->LoadDefaultValues(); // Load default values
} else {
$CPDAssessors_list->LoadRowValues($rs); // Load row values
}
$CPDAssessors->RowType = EW_ROWTYPE_VIEW; // Render view
// Render row
$CPDAssessors_list->RenderRow();
// Render list options
$CPDAssessors_list->RenderListOptions();
?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<?php
// Render list options (body, left)
$CPDAssessors_list->ListOptions->Render("body", "left");
?>
<?php if ($CPDAssessors->FirstName->Visible) { // FirstName ?>
<td<?php echo $CPDAssessors->FirstName->CellAttributes() ?>>
<div<?php echo $CPDAssessors->FirstName->ViewAttributes() ?>><?php echo $CPDAssessors->FirstName->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->Surname->Visible) { // Surname ?>
<td<?php echo $CPDAssessors->Surname->CellAttributes() ?>>
<div<?php echo $CPDAssessors->Surname->ViewAttributes() ?>><?php echo $CPDAssessors->Surname->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->Organisation->Visible) { // Organisation ?>
<td<?php echo $CPDAssessors->Organisation->CellAttributes() ?>>
<div<?php echo $CPDAssessors->Organisation->ViewAttributes() ?>><?php echo $CPDAssessors->Organisation->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->CellNumber->Visible) { // CellNumber ?>
<td<?php echo $CPDAssessors->CellNumber->CellAttributes() ?>>
<div<?php echo $CPDAssessors->CellNumber->ViewAttributes() ?>><?php echo $CPDAssessors->CellNumber->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->EmailAddress->Visible) { // EmailAddress ?>
<td<?php echo $CPDAssessors->EmailAddress->CellAttributes() ?>>
<div<?php echo $CPDAssessors->EmailAddress->ViewAttributes() ?>><?php echo $CPDAssessors->EmailAddress->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->adminusername->Visible) { // adminusername ?>
<td<?php echo $CPDAssessors->adminusername->CellAttributes() ?>>
<div<?php echo $CPDAssessors->adminusername->ViewAttributes() ?>><?php echo $CPDAssessors->adminusername->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->DateUpdated->Visible) { // DateUpdated ?>
<td<?php echo $CPDAssessors->DateUpdated->CellAttributes() ?>>
<div<?php echo $CPDAssessors->DateUpdated->ViewAttributes() ?>><?php echo $CPDAssessors->DateUpdated->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CPDAssessors->Active->Visible) { // Active ?>
<td<?php echo $CPDAssessors->Active->CellAttributes() ?>>
<div<?php echo $CPDAssessors->Active->ViewAttributes() ?>><?php echo $CPDAssessors->Active->ListViewValue() ?></div>
</td>
<?php } ?>
<?php
// Render list options (body, right)
$CPDAssessors_list->ListOptions->Render("body", "right");
?>
</tr>
<?php
}
if ($CPDAssessors->CurrentAction <> "gridadd")
$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php
// Close recordset
if ($rs)
$rs->Close();
?>
<?php if ($CPDAssessors_list->lTotalRecs > 0) { ?>
<?php if ($CPDAssessors->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($CPDAssessors->CurrentAction <> "gridadd" && $CPDAssessors->CurrentAction <> "gridedit") { ?>
<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($CPDAssessors_list->Pager)) $CPDAssessors_list->Pager = new cPrevNextPager($CPDAssessors_list->lStartRec, $CPDAssessors_list->lDisplayRecs, $CPDAssessors_list->lTotalRecs) ?>
<?php if ($CPDAssessors_list->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 ($CPDAssessors_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 ($CPDAssessors_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 $CPDAssessors_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CPDAssessors_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 ($CPDAssessors_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CPDAssessors_list->PageUrl() ?>start=<?php echo $CPDAssessors_list->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 $CPDAssessors_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CPDAssessors_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CPDAssessors_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CPDAssessors_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($CPDAssessors_list->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 } ?>
<?php //if ($CPDAssessors_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
<?php if ($Security->IsLoggedIn()) { ?>
<a href="<?php echo $CPDAssessors_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>
<?php } ?>
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($CPDAssessors->Export == "" && $CPDAssessors->CurrentAction == "") { ?>
<?php } ?>
<?php if ($CPDAssessors->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
$CPDAssessors_list->Page_Terminate();
?>
<?php
//
// Page class
//
class cCPDAssessors_list {
// Page ID
var $PageID = 'list';
// Table name
var $TableName = 'CPDAssessors';
// Page object name
var $PageObjName = 'CPDAssessors_list';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CPDAssessors;
if ($CPDAssessors->UseTokenInUrl) $PageUrl .= "t=" . $CPDAssessors->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, $CPDAssessors;
if ($CPDAssessors->UseTokenInUrl) {
if ($objForm)
return ($CPDAssessors->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CPDAssessors->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CPDAssessors)
$GLOBALS["CPDAssessors"] = new cCPDAssessors();
// Initialize URLs
$this->ExportPrintUrl = $this->PageUrl() . "export=print";
$this->ExportExcelUrl = $this->PageUrl() . "export=excel";
$this->ExportWordUrl = $this->PageUrl() . "export=word";
$this->ExportHtmlUrl = $this->PageUrl() . "export=html";
$this->ExportXmlUrl = $this->PageUrl() . "export=xml";
$this->ExportCsvUrl = $this->PageUrl() . "export=csv";
$this->AddUrl = $GLOBALS["CPDAssessors"]->AddUrl();
$this->InlineAddUrl = $this->PageUrl() . "a=add";
$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
$this->MultiDeleteUrl = "CPDAssessorsdelete.php";
$this->MultiUpdateUrl = "CPDAssessorsupdate.php";
// Table object (CPDAdminUsers)
$GLOBALS['CPDAdminUsers'] = new cCPDAdminUsers();
// Page ID
if (!defined("EW_PAGE_ID"))
define("EW_PAGE_ID", 'list', TRUE);
// Table name (for backward compatibility)
if (!defined("EW_TABLE_NAME"))
define("EW_TABLE_NAME", 'CPDAssessors', TRUE);
// Start timer
$GLOBALS["gsTimer"] = new cTimer();
// Open connection
$conn = ew_Connect();
// List options
$this->ListOptions = new cListOptions();
}
//
// Page_Init
//
function Page_Init() {
global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
global $CPDAssessors;
// User profile
$UserProfile = new cUserProfile();
$UserProfile->LoadProfile(@$_SESSION[EW_SESSION_USER_PROFILE]);
// Security
$Security = new cAdvancedSecurity();
if (IsPasswordExpired())
$this->Page_Terminate("changepwd.php");
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
// Get export parameters
if (@$_GET["export"] <> "") {
$CPDAssessors->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$CPDAssessors->Export = $_POST["exporttype"];
} else {
$CPDAssessors->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $CPDAssessors->Export; // Get export parameter, used in header
$gsExportFile = $CPDAssessors->TableVar; // Get export file, used in header
if ($CPDAssessors->Export == "excel") {
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
}
if ($CPDAssessors->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();
}
// Class variables
var $ListOptions; // List options
var $lDisplayRecs = 20;
var $lStartRec;
var $lStopRec;
var $lTotalRecs = 0;
var $lRecRange = 10;
var $sSrchWhere = ""; // Search WHERE clause
var $lRecCnt = 0; // Record count
var $lEditRowCnt;
var $lRowCnt;
var $lRowIndex; // Row index
var $lRecPerRow = 0;
var $lColCnt = 0;
var $sDbMasterFilter = ""; // Master filter
var $sDbDetailFilter = ""; // Detail filter
var $bMasterRecordExists;
var $sMultiSelectKey;
var $RestoreSearch;
//
// Page main
//
function Page_Main() {
global $objForm, $Language, $gsSearchError, $Security, $CPDAssessors;
// Search filters
$sSrchAdvanced = ""; // Advanced search filter
$sSrchBasic = ""; // Basic search filter
$sFilter = "";
if ($this->IsPageRequest()) { // Validate request
// Handle reset command
$this->ResetCmd();
// Set up list options
$this->SetupListOptions();
// Get basic search values
$this->LoadBasicSearchValues();
// Restore search parms from Session
$this->RestoreSearchParms();
// Call Recordset SearchValidated event
$CPDAssessors->Recordset_SearchValidated();
// Set up sorting order
$this->SetUpSortOrder();
// Get basic search criteria
if ($gsSearchError == "")
$sSrchBasic = $this->BasicSearchWhere();
}
// Restore display records
if ($CPDAssessors->getRecordsPerPage() <> "") {
$this->lDisplayRecs = $CPDAssessors->getRecordsPerPage(); // Restore from Session
} else {
$this->lDisplayRecs = 20; // Load default
}
// Load Sorting Order
$this->LoadSortOrder();
// Build search criteria
if ($sSrchAdvanced <> "")
$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchAdvanced . ")" : $sSrchAdvanced;
if ($sSrchBasic <> "")
$this->sSrchWhere = ($this->sSrchWhere <> "") ? "(" . $this->sSrchWhere . ") AND (" . $sSrchBasic. ")" : $sSrchBasic;
// Call Recordset_Searching event
$CPDAssessors->Recordset_Searching($this->sSrchWhere);
// Save search criteria
if ($this->sSrchWhere <> "") {
if ($sSrchBasic == "")
$this->ResetBasicSearchParms();
$CPDAssessors->setSearchWhere($this->sSrchWhere); // Save to Session
if (!$this->RestoreSearch) {
$this->lStartRec = 1; // Reset start record counter
$CPDAssessors->setStartRecordNumber($this->lStartRec);
}
} else {
$this->sSrchWhere = $CPDAssessors->getSearchWhere();
}
// Build filter
$sFilter = "";
if ($this->sDbDetailFilter <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (" . $this->sDbDetailFilter . ")" : $this->sDbDetailFilter;
if ($this->sSrchWhere <> "")
$sFilter = ($sFilter <> "") ? "(" . $sFilter . ") AND (". $this->sSrchWhere . ")" : $this->sSrchWhere;
// Set up filter in session
$CPDAssessors->setSessionWhere($sFilter);
$CPDAssessors->CurrentFilter = "";
// Export data only
if (in_array($CPDAssessors->Export, array("html","word","excel","xml","csv","email"))) {
$this->ExportData();
if ($CPDAssessors->Export <> "email")
$this->Page_Terminate(); // Terminate response
exit();
}
}
// Return basic search SQL
function BasicSearchSQL($Keyword) {
global $CPDAssessors;
$sKeyword = ew_AdjustSql($Keyword);
$sWhere = "";
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->Title, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->KnownAs, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->FirstName, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->Surname, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->Designation, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->Department, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->Organisation, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->PostalAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->PhysicalAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->CellNumber, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->EmailAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->ProfessionalCouncil, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->ProfRegNo, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->CVFile, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->QualificationFile, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->NDAFile, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CPDAssessors->adminusername, $Keyword);
return $sWhere;
}
// Build basic search SQL
function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {
$sFldExpression = ($Fld->FldVirtualExpression <> "") ? $Fld->FldVirtualExpression : $Fld->FldExpression;
$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;
if ($lFldDataType == EW_DATATYPE_NUMBER) {
$sWrk = $sFldExpression . " = " . ew_QuotedValue($Keyword, $lFldDataType);
} else {
$sWrk = $sFldExpression . " LIKE " . ew_QuotedValue("%" . $Keyword . "%", $lFldDataType);
}
if ($Where <> "") $Where .= " OR ";
$Where .= $sWrk;
}
// Return basic search WHERE clause based on search keyword and type
function BasicSearchWhere() {
global $Security, $CPDAssessors;
$sSearchStr = "";
$sSearchKeyword = $CPDAssessors->BasicSearchKeyword;
$sSearchType = $CPDAssessors->BasicSearchType;
if ($sSearchKeyword <> "") {
$sSearch = trim($sSearchKeyword);
if ($sSearchType <> "") {
while (strpos($sSearch, " ") !== FALSE)
$sSearch = str_replace(" ", " ", $sSearch);
$arKeyword = explode(" ", trim($sSearch));
foreach ($arKeyword as $sKeyword) {
if ($sSearchStr <> "") $sSearchStr .= " " . $sSearchType . " ";
$sSearchStr .= "(" . $this->BasicSearchSQL($sKeyword) . ")";
}
} else {
$sSearchStr = $this->BasicSearchSQL($sSearch);
}
}
if ($sSearchKeyword <> "") {
$CPDAssessors->setSessionBasicSearchKeyword($sSearchKeyword);
$CPDAssessors->setSessionBasicSearchType($sSearchType);
}
return $sSearchStr;
}
// Clear all search parameters
function ResetSearchParms() {
global $CPDAssessors;
// Clear search WHERE clause
$this->sSrchWhere = "";
$CPDAssessors->setSearchWhere($this->sSrchWhere);
// Clear basic search parameters
$this->ResetBasicSearchParms();
}
// Clear all basic search parameters
function ResetBasicSearchParms() {
global $CPDAssessors;
$CPDAssessors->setSessionBasicSearchKeyword("");
$CPDAssessors->setSessionBasicSearchType("");
}
// Restore all search parameters
function RestoreSearchParms() {
global $CPDAssessors;
$bRestore = TRUE;
if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
$this->RestoreSearch = $bRestore;
if ($bRestore) {
// Restore basic search values
$CPDAssessors->BasicSearchKeyword = $CPDAssessors->getSessionBasicSearchKeyword();
$CPDAssessors->BasicSearchType = $CPDAssessors->getSessionBasicSearchType();
}
}
// Set up sort parameters
function SetUpSortOrder() {
global $CPDAssessors;
// Check for Ctrl pressed
$bCtrl = (@$_GET["ctrl"] <> "");
// Check for "order" parameter
if (@$_GET["order"] <> "") {
$CPDAssessors->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
$CPDAssessors->CurrentOrderType = @$_GET["ordertype"];
$CPDAssessors->UpdateSort($CPDAssessors->FirstName, $bCtrl); // FirstName
$CPDAssessors->UpdateSort($CPDAssessors->Surname, $bCtrl); // Surname
$CPDAssessors->UpdateSort($CPDAssessors->Organisation, $bCtrl); // Organisation
$CPDAssessors->UpdateSort($CPDAssessors->CellNumber, $bCtrl); // CellNumber
$CPDAssessors->UpdateSort($CPDAssessors->EmailAddress, $bCtrl); // EmailAddress
$CPDAssessors->UpdateSort($CPDAssessors->adminusername, $bCtrl); // adminusername
$CPDAssessors->UpdateSort($CPDAssessors->DateUpdated, $bCtrl); // DateUpdated
$CPDAssessors->UpdateSort($CPDAssessors->Active, $bCtrl); // Active
$CPDAssessors->setStartRecordNumber(1); // Reset start position
}
}
// Load sort order parameters
function LoadSortOrder() {
global $CPDAssessors;
$sOrderBy = $CPDAssessors->getSessionOrderBy(); // Get ORDER BY from Session
if ($sOrderBy == "") {
if ($CPDAssessors->SqlOrderBy() <> "") {
$sOrderBy = $CPDAssessors->SqlOrderBy();
$CPDAssessors->setSessionOrderBy($sOrderBy);
$CPDAssessors->Surname->setSort("ASC");
$CPDAssessors->FirstName->setSort("ASC");
}
}
}
// Reset command
// cmd=reset (Reset search parameters)
// cmd=resetall (Reset search and master/detail parameters)
// cmd=resetsort (Reset sort parameters)
function ResetCmd() {
global $CPDAssessors;
// Get reset command
if (@$_GET["cmd"] <> "") {
$sCmd = $_GET["cmd"];
// Reset search criteria
if (strtolower($sCmd) == "reset" || strtolower($sCmd) == "resetall")
$this->ResetSearchParms();
// Reset sorting order
if (strtolower($sCmd) == "resetsort") {
$sOrderBy = "";
$CPDAssessors->setSessionOrderBy($sOrderBy);
$CPDAssessors->FirstName->setSort("");
$CPDAssessors->Surname->setSort("");
$CPDAssessors->Organisation->setSort("");
$CPDAssessors->CellNumber->setSort("");
$CPDAssessors->EmailAddress->setSort("");
$CPDAssessors->adminusername->setSort("");
$CPDAssessors->DateUpdated->setSort("");
$CPDAssessors->Active->setSort("");
}
// Reset start position
$this->lStartRec = 1;
$CPDAssessors->setStartRecordNumber($this->lStartRec);
}
}
// Set up list options
function SetupListOptions() {
global $Security, $CPDAssessors;
// "view"
$this->ListOptions->Add("view");
$item =& $this->ListOptions->Items["view"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->IsLoggedIn();
$item->OnLeft = FALSE;
// "edit"
$this->ListOptions->Add("edit");
$item =& $this->ListOptions->Items["edit"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->IsLoggedIn();
$item->OnLeft = FALSE;
// "copy"
$this->ListOptions->Add("copy");
$item =& $this->ListOptions->Items["copy"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->IsLoggedIn();
$item->OnLeft = FALSE;
// "delete"
$this->ListOptions->Add("delete");
$item =& $this->ListOptions->Items["delete"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->IsLoggedIn();
$item->OnLeft = FALSE;
// Call ListOptions_Load event
$this->ListOptions_Load();
if ($CPDAssessors->Export <> "" ||
$CPDAssessors->CurrentAction == "gridadd" ||
$CPDAssessors->CurrentAction == "gridedit")
$this->ListOptions->HideAllOptions();
}
// Render list options
function RenderListOptions() {
global $Security, $Language, $CPDAssessors;
$this->ListOptions->LoadDefault();
// "view"
$oListOpt =& $this->ListOptions->Items["view"];
if ($Security->IsLoggedIn() && $oListOpt->Visible)
$oListOpt->Body = "<a href=\"" . $this->ViewUrl . "\">" . "<img src=\"images/view.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("ViewLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
// "edit"
$oListOpt =& $this->ListOptions->Items["edit"];
if ($Security->IsLoggedIn() && $oListOpt->Visible) {
$oListOpt->Body = "<a href=\"" . $this->EditUrl . "\">" . "<img src=\"images/edit.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("EditLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
}
// "copy"
$oListOpt =& $this->ListOptions->Items["copy"];
if ($Security->IsLoggedIn() && $oListOpt->Visible) {
$oListOpt->Body = "<a href=\"" . $this->CopyUrl . "\">" . "<img src=\"images/copy.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("CopyLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("CopyLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
}
// "delete"
$oListOpt =& $this->ListOptions->Items["delete"];
if ($Security->IsLoggedIn() && $oListOpt->Visible)
$oListOpt->Body = "<a" . "" . " href=\"" . $this->DeleteUrl . "\">" . "<img src=\"images/delete.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("DeleteLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("DeleteLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . "</a>";
$this->RenderListOptionsExt();
// Call ListOptions_Rendered event
$this->ListOptions_Rendered();
}
function RenderListOptionsExt() {
global $Security, $Language, $CPDAssessors;
}
// Set up starting record parameters
function SetUpStartRec() {
global $CPDAssessors;
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];
$CPDAssessors->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;
}
$CPDAssessors->setStartRecordNumber($this->lStartRec);
}
}
}
$this->lStartRec = $CPDAssessors->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
$CPDAssessors->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
$CPDAssessors->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
$CPDAssessors->setStartRecordNumber($this->lStartRec);
}
}
// Load basic search values
function LoadBasicSearchValues() {
global $CPDAssessors;
$CPDAssessors->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];
$CPDAssessors->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn, $CPDAssessors;
// Call Recordset Selecting event
$CPDAssessors->Recordset_Selecting($CPDAssessors->CurrentFilter);
// Load List page SQL
$sSql = $CPDAssessors->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $offset, $rowcnt";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$CPDAssessors->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CPDAssessors;
$sFilter = $CPDAssessors->KeyFilter();
// Call Row Selecting event
$CPDAssessors->Row_Selecting($sFilter);
// Load SQL based on filter
$CPDAssessors->CurrentFilter = $sFilter;
$sSql = $CPDAssessors->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CPDAssessors->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CPDAssessors;
$CPDAssessors->CPDAssessorID->setDbValue($rs->fields('CPDAssessorID'));
$CPDAssessors->Title->setDbValue($rs->fields('Title'));
$CPDAssessors->KnownAs->setDbValue($rs->fields('KnownAs'));
$CPDAssessors->FirstName->setDbValue($rs->fields('FirstName'));
$CPDAssessors->Surname->setDbValue($rs->fields('Surname'));
$CPDAssessors->Designation->setDbValue($rs->fields('Designation'));
$CPDAssessors->Department->setDbValue($rs->fields('Department'));
$CPDAssessors->Organisation->setDbValue($rs->fields('Organisation'));
$CPDAssessors->PostalAddress->setDbValue($rs->fields('PostalAddress'));
$CPDAssessors->PhysicalAddress->setDbValue($rs->fields('PhysicalAddress'));
$CPDAssessors->CellNumber->setDbValue($rs->fields('CellNumber'));
$CPDAssessors->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$CPDAssessors->ProfessionalCouncil->setDbValue($rs->fields('ProfessionalCouncil'));
$CPDAssessors->ProfRegNo->setDbValue($rs->fields('ProfRegNo'));
$CPDAssessors->CVFile->Upload->DbValue = $rs->fields('CVFile');
$CPDAssessors->QualificationFile->Upload->DbValue = $rs->fields('QualificationFile');
$CPDAssessors->NDAFile->Upload->DbValue = $rs->fields('NDAFile');
$CPDAssessors->adminusername->setDbValue($rs->fields('adminusername'));
$CPDAssessors->DateUpdated->setDbValue($rs->fields('DateUpdated'));
$CPDAssessors->Active->setDbValue($rs->fields('Active'));
$CPDAssessors->DocumentName1->setDbValue($rs->fields('DocumentName1'));
$CPDAssessors->Document1->Upload->DbValue = $rs->fields('Document1');
$CPDAssessors->DocumentName2->setDbValue($rs->fields('DocumentName2'));
$CPDAssessors->Document2->Upload->DbValue = $rs->fields('Document2');
$CPDAssessors->DocumentName3->setDbValue($rs->fields('DocumentName3'));
$CPDAssessors->Document3->Upload->DbValue = $rs->fields('Document3');
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CPDAssessors;
// Initialize URLs
$this->ViewUrl = $CPDAssessors->ViewUrl();
$this->EditUrl = $CPDAssessors->EditUrl();
$this->InlineEditUrl = $CPDAssessors->InlineEditUrl();
$this->CopyUrl = $CPDAssessors->CopyUrl();
$this->InlineCopyUrl = $CPDAssessors->InlineCopyUrl();
$this->DeleteUrl = $CPDAssessors->DeleteUrl();
// Call Row_Rendering event
$CPDAssessors->Row_Rendering();
// Common render codes for all row types
// FirstName
$CPDAssessors->FirstName->CellCssStyle = ""; $CPDAssessors->FirstName->CellCssClass = "";
$CPDAssessors->FirstName->CellAttrs = array(); $CPDAssessors->FirstName->ViewAttrs = array(); $CPDAssessors->FirstName->EditAttrs = array();
// Surname
$CPDAssessors->Surname->CellCssStyle = ""; $CPDAssessors->Surname->CellCssClass = "";
$CPDAssessors->Surname->CellAttrs = array(); $CPDAssessors->Surname->ViewAttrs = array(); $CPDAssessors->Surname->EditAttrs = array();
// Organisation
$CPDAssessors->Organisation->CellCssStyle = ""; $CPDAssessors->Organisation->CellCssClass = "";
$CPDAssessors->Organisation->CellAttrs = array(); $CPDAssessors->Organisation->ViewAttrs = array(); $CPDAssessors->Organisation->EditAttrs = array();
// CellNumber
$CPDAssessors->CellNumber->CellCssStyle = ""; $CPDAssessors->CellNumber->CellCssClass = "";
$CPDAssessors->CellNumber->CellAttrs = array(); $CPDAssessors->CellNumber->ViewAttrs = array(); $CPDAssessors->CellNumber->EditAttrs = array();
// EmailAddress
$CPDAssessors->EmailAddress->CellCssStyle = ""; $CPDAssessors->EmailAddress->CellCssClass = "";
$CPDAssessors->EmailAddress->CellAttrs = array(); $CPDAssessors->EmailAddress->ViewAttrs = array(); $CPDAssessors->EmailAddress->EditAttrs = array();
// adminusername
$CPDAssessors->adminusername->CellCssStyle = ""; $CPDAssessors->adminusername->CellCssClass = "";
$CPDAssessors->adminusername->CellAttrs = array(); $CPDAssessors->adminusername->ViewAttrs = array(); $CPDAssessors->adminusername->EditAttrs = array();
// DateUpdated
$CPDAssessors->DateUpdated->CellCssStyle = ""; $CPDAssessors->DateUpdated->CellCssClass = "";
$CPDAssessors->DateUpdated->CellAttrs = array(); $CPDAssessors->DateUpdated->ViewAttrs = array(); $CPDAssessors->DateUpdated->EditAttrs = array();
// Active
$CPDAssessors->Active->CellCssStyle = ""; $CPDAssessors->Active->CellCssClass = "";
$CPDAssessors->Active->CellAttrs = array(); $CPDAssessors->Active->ViewAttrs = array(); $CPDAssessors->Active->EditAttrs = array();
if ($CPDAssessors->RowType == EW_ROWTYPE_VIEW) { // View row
// CPDAssessorID
$CPDAssessors->CPDAssessorID->ViewValue = $CPDAssessors->CPDAssessorID->CurrentValue;
$CPDAssessors->CPDAssessorID->CssStyle = "";
$CPDAssessors->CPDAssessorID->CssClass = "";
$CPDAssessors->CPDAssessorID->ViewCustomAttributes = "";
// Title
$CPDAssessors->Title->ViewValue = $CPDAssessors->Title->CurrentValue;
$CPDAssessors->Title->CssStyle = "";
$CPDAssessors->Title->CssClass = "";
$CPDAssessors->Title->ViewCustomAttributes = "";
// KnownAs
$CPDAssessors->KnownAs->ViewValue = $CPDAssessors->KnownAs->CurrentValue;
$CPDAssessors->KnownAs->CssStyle = "";
$CPDAssessors->KnownAs->CssClass = "";
$CPDAssessors->KnownAs->ViewCustomAttributes = "";
// FirstName
$CPDAssessors->FirstName->ViewValue = $CPDAssessors->FirstName->CurrentValue;
$CPDAssessors->FirstName->CssStyle = "";
$CPDAssessors->FirstName->CssClass = "";
$CPDAssessors->FirstName->ViewCustomAttributes = "";
// Surname
$CPDAssessors->Surname->ViewValue = $CPDAssessors->Surname->CurrentValue;
$CPDAssessors->Surname->CssStyle = "";
$CPDAssessors->Surname->CssClass = "";
$CPDAssessors->Surname->ViewCustomAttributes = "";
// Designation
$CPDAssessors->Designation->ViewValue = $CPDAssessors->Designation->CurrentValue;
$CPDAssessors->Designation->CssStyle = "";
$CPDAssessors->Designation->CssClass = "";
$CPDAssessors->Designation->ViewCustomAttributes = "";
// Department
$CPDAssessors->Department->ViewValue = $CPDAssessors->Department->CurrentValue;
$CPDAssessors->Department->CssStyle = "";
$CPDAssessors->Department->CssClass = "";
$CPDAssessors->Department->ViewCustomAttributes = "";
// Organisation
$CPDAssessors->Organisation->ViewValue = $CPDAssessors->Organisation->CurrentValue;
$CPDAssessors->Organisation->CssStyle = "";
$CPDAssessors->Organisation->CssClass = "";
$CPDAssessors->Organisation->ViewCustomAttributes = "";
// CellNumber
$CPDAssessors->CellNumber->ViewValue = $CPDAssessors->CellNumber->CurrentValue;
$CPDAssessors->CellNumber->CssStyle = "";
$CPDAssessors->CellNumber->CssClass = "";
$CPDAssessors->CellNumber->ViewCustomAttributes = "";
// EmailAddress
$CPDAssessors->EmailAddress->ViewValue = $CPDAssessors->EmailAddress->CurrentValue;
$CPDAssessors->EmailAddress->CssStyle = "";
$CPDAssessors->EmailAddress->CssClass = "";
$CPDAssessors->EmailAddress->ViewCustomAttributes = "";
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->ViewValue = $CPDAssessors->ProfessionalCouncil->CurrentValue;
$CPDAssessors->ProfessionalCouncil->CssStyle = "";
$CPDAssessors->ProfessionalCouncil->CssClass = "";
$CPDAssessors->ProfessionalCouncil->ViewCustomAttributes = "";
// ProfRegNo
$CPDAssessors->ProfRegNo->ViewValue = $CPDAssessors->ProfRegNo->CurrentValue;
$CPDAssessors->ProfRegNo->CssStyle = "";
$CPDAssessors->ProfRegNo->CssClass = "";
$CPDAssessors->ProfRegNo->ViewCustomAttributes = "";
// CVFile
if (!ew_Empty($CPDAssessors->CVFile->Upload->DbValue)) {
$CPDAssessors->CVFile->ViewValue = $CPDAssessors->CVFile->Upload->DbValue;
} else {
$CPDAssessors->CVFile->ViewValue = "";
}
$CPDAssessors->CVFile->CssStyle = "";
$CPDAssessors->CVFile->CssClass = "";
$CPDAssessors->CVFile->ViewCustomAttributes = "";
// QualificationFile
if (!ew_Empty($CPDAssessors->QualificationFile->Upload->DbValue)) {
$CPDAssessors->QualificationFile->ViewValue = $CPDAssessors->QualificationFile->Upload->DbValue;
} else {
$CPDAssessors->QualificationFile->ViewValue = "";
}
$CPDAssessors->QualificationFile->CssStyle = "";
$CPDAssessors->QualificationFile->CssClass = "";
$CPDAssessors->QualificationFile->ViewCustomAttributes = "";
// NDAFile
if (!ew_Empty($CPDAssessors->NDAFile->Upload->DbValue)) {
$CPDAssessors->NDAFile->ViewValue = $CPDAssessors->NDAFile->Upload->DbValue;
} else {
$CPDAssessors->NDAFile->ViewValue = "";
}
$CPDAssessors->NDAFile->CssStyle = "";
$CPDAssessors->NDAFile->CssClass = "";
$CPDAssessors->NDAFile->ViewCustomAttributes = "";
// adminusername
if (strval($CPDAssessors->adminusername->CurrentValue) <> "") {
$sFilterWrk = "`adminusername` = '" . ew_AdjustSql($CPDAssessors->adminusername->CurrentValue) . "'";
$sSqlWrk = "SELECT `adminusername` FROM `CPDAdminUsers`";
$sWhereWrk = "";
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . "`level`=11" . ")";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CPDAssessors->adminusername->ViewValue = $rswrk->fields('adminusername');
$rswrk->Close();
} else {
$CPDAssessors->adminusername->ViewValue = $CPDAssessors->adminusername->CurrentValue;
}
} else {
$CPDAssessors->adminusername->ViewValue = NULL;
}
$CPDAssessors->adminusername->CssStyle = "";
$CPDAssessors->adminusername->CssClass = "";
$CPDAssessors->adminusername->ViewCustomAttributes = "";
// DateUpdated
$CPDAssessors->DateUpdated->ViewValue = $CPDAssessors->DateUpdated->CurrentValue;
$CPDAssessors->DateUpdated->ViewValue = ew_FormatDateTime($CPDAssessors->DateUpdated->ViewValue, 5);
$CPDAssessors->DateUpdated->CssStyle = "";
$CPDAssessors->DateUpdated->CssClass = "";
$CPDAssessors->DateUpdated->ViewCustomAttributes = "";
// Active
if (strval($CPDAssessors->Active->CurrentValue) <> "") {
switch ($CPDAssessors->Active->CurrentValue) {
case "1":
$CPDAssessors->Active->ViewValue = "Yes";
break;
case "0":
$CPDAssessors->Active->ViewValue = "No";
break;
default:
$CPDAssessors->Active->ViewValue = $CPDAssessors->Active->CurrentValue;
}
} else {
$CPDAssessors->Active->ViewValue = NULL;
}
$CPDAssessors->Active->CssStyle = "";
$CPDAssessors->Active->CssClass = "";
$CPDAssessors->Active->ViewCustomAttributes = "";
// DocumentName1
$CPDAssessors->DocumentName1->ViewValue = $CPDAssessors->DocumentName1->CurrentValue;
$CPDAssessors->DocumentName1->CssStyle = "";
$CPDAssessors->DocumentName1->CssClass = "";
$CPDAssessors->DocumentName1->ViewCustomAttributes = "";
// Document1
if (!ew_Empty($CPDAssessors->Document1->Upload->DbValue)) {
$CPDAssessors->Document1->ViewValue = $CPDAssessors->Document1->Upload->DbValue;
} else {
$CPDAssessors->Document1->ViewValue = "";
}
$CPDAssessors->Document1->CssStyle = "";
$CPDAssessors->Document1->CssClass = "";
$CPDAssessors->Document1->ViewCustomAttributes = "";
// DocumentName2
$CPDAssessors->DocumentName2->ViewValue = $CPDAssessors->DocumentName2->CurrentValue;
$CPDAssessors->DocumentName2->CssStyle = "";
$CPDAssessors->DocumentName2->CssClass = "";
$CPDAssessors->DocumentName2->ViewCustomAttributes = "";
// Document2
if (!ew_Empty($CPDAssessors->Document2->Upload->DbValue)) {
$CPDAssessors->Document2->ViewValue = $CPDAssessors->Document2->Upload->DbValue;
} else {
$CPDAssessors->Document2->ViewValue = "";
}
$CPDAssessors->Document2->CssStyle = "";
$CPDAssessors->Document2->CssClass = "";
$CPDAssessors->Document2->ViewCustomAttributes = "";
// DocumentName3
$CPDAssessors->DocumentName3->ViewValue = $CPDAssessors->DocumentName3->CurrentValue;
$CPDAssessors->DocumentName3->CssStyle = "";
$CPDAssessors->DocumentName3->CssClass = "";
$CPDAssessors->DocumentName3->ViewCustomAttributes = "";
// Document3
if (!ew_Empty($CPDAssessors->Document3->Upload->DbValue)) {
$CPDAssessors->Document3->ViewValue = $CPDAssessors->Document3->Upload->DbValue;
} else {
$CPDAssessors->Document3->ViewValue = "";
}
$CPDAssessors->Document3->CssStyle = "";
$CPDAssessors->Document3->CssClass = "";
$CPDAssessors->Document3->ViewCustomAttributes = "";
// FirstName
$CPDAssessors->FirstName->HrefValue = "";
$CPDAssessors->FirstName->TooltipValue = "";
// Surname
$CPDAssessors->Surname->HrefValue = "";
$CPDAssessors->Surname->TooltipValue = "";
// Organisation
$CPDAssessors->Organisation->HrefValue = "";
$CPDAssessors->Organisation->TooltipValue = "";
// CellNumber
$CPDAssessors->CellNumber->HrefValue = "";
$CPDAssessors->CellNumber->TooltipValue = "";
// EmailAddress
$CPDAssessors->EmailAddress->HrefValue = "";
$CPDAssessors->EmailAddress->TooltipValue = "";
// adminusername
$CPDAssessors->adminusername->HrefValue = "";
$CPDAssessors->adminusername->TooltipValue = "";
// DateUpdated
$CPDAssessors->DateUpdated->HrefValue = "";
$CPDAssessors->DateUpdated->TooltipValue = "";
// Active
$CPDAssessors->Active->HrefValue = "";
$CPDAssessors->Active->TooltipValue = "";
}
// Call Row Rendered event
if ($CPDAssessors->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CPDAssessors->Row_Rendered();
}
// Export data in HTML/CSV/Word/Excel/XML/Email format
function ExportData() {
global $CPDAssessors;
$utf8 = FALSE;
$bSelectLimit = EW_SELECT_LIMIT;
// Load recordset
if ($bSelectLimit) {
$this->lTotalRecs = $CPDAssessors->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->lTotalRecs = $rs->RecordCount();
}
$this->lStartRec = 1;
// Export all
if ($CPDAssessors->ExportAll) {
$this->lDisplayRecs = $this->lTotalRecs;
$this->lStopRec = $this->lTotalRecs;
} else { // Export one page only
$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 ($bSelectLimit)
$rs = $this->LoadRecordset($this->lStartRec-1, $this->lDisplayRecs);
if (!$rs) {
header("Content-Type:"); // Remove header
header("Content-Disposition:");
$this->ShowMessage();
return;
}
if ($CPDAssessors->Export == "xml") {
$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
$XmlDoc->AddRoot();
} else {
$ExportDoc = new cExportDocument($CPDAssessors, "h");
$ExportDoc->ExportHeader();
if ($ExportDoc->Horizontal) { // Horizontal format, write header
$ExportDoc->BeginExportRow();
$ExportDoc->ExportCaption($CPDAssessors->CPDAssessorID);
$ExportDoc->ExportCaption($CPDAssessors->Title);
$ExportDoc->ExportCaption($CPDAssessors->KnownAs);
$ExportDoc->ExportCaption($CPDAssessors->FirstName);
$ExportDoc->ExportCaption($CPDAssessors->Surname);
$ExportDoc->ExportCaption($CPDAssessors->Designation);
$ExportDoc->ExportCaption($CPDAssessors->Department);
$ExportDoc->ExportCaption($CPDAssessors->Organisation);
$ExportDoc->ExportCaption($CPDAssessors->CellNumber);
$ExportDoc->ExportCaption($CPDAssessors->EmailAddress);
$ExportDoc->ExportCaption($CPDAssessors->ProfessionalCouncil);
$ExportDoc->ExportCaption($CPDAssessors->ProfRegNo);
$ExportDoc->ExportCaption($CPDAssessors->CVFile);
$ExportDoc->ExportCaption($CPDAssessors->QualificationFile);
$ExportDoc->ExportCaption($CPDAssessors->NDAFile);
$ExportDoc->ExportCaption($CPDAssessors->adminusername);
$ExportDoc->ExportCaption($CPDAssessors->DateUpdated);
$ExportDoc->ExportCaption($CPDAssessors->Active);
$ExportDoc->ExportCaption($CPDAssessors->DocumentName1);
$ExportDoc->ExportCaption($CPDAssessors->Document1);
$ExportDoc->ExportCaption($CPDAssessors->DocumentName2);
$ExportDoc->ExportCaption($CPDAssessors->Document2);
$ExportDoc->ExportCaption($CPDAssessors->DocumentName3);
$ExportDoc->ExportCaption($CPDAssessors->Document3);
$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
$CPDAssessors->CssClass = "";
$CPDAssessors->CssStyle = "";
$CPDAssessors->RowType = EW_ROWTYPE_VIEW; // Render view
$this->RenderRow();
if ($CPDAssessors->Export == "xml") {
$XmlDoc->AddRow();
$XmlDoc->AddField('CPDAssessorID', $CPDAssessors->CPDAssessorID->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Title', $CPDAssessors->Title->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('KnownAs', $CPDAssessors->KnownAs->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('FirstName', $CPDAssessors->FirstName->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Surname', $CPDAssessors->Surname->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Designation', $CPDAssessors->Designation->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Department', $CPDAssessors->Department->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Organisation', $CPDAssessors->Organisation->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('CellNumber', $CPDAssessors->CellNumber->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('EmailAddress', $CPDAssessors->EmailAddress->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('ProfessionalCouncil', $CPDAssessors->ProfessionalCouncil->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('ProfRegNo', $CPDAssessors->ProfRegNo->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('CVFile', $CPDAssessors->CVFile->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('QualificationFile', $CPDAssessors->QualificationFile->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('NDAFile', $CPDAssessors->NDAFile->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('adminusername', $CPDAssessors->adminusername->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('DateUpdated', $CPDAssessors->DateUpdated->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Active', $CPDAssessors->Active->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('DocumentName1', $CPDAssessors->DocumentName1->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Document1', $CPDAssessors->Document1->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('DocumentName2', $CPDAssessors->DocumentName2->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Document2', $CPDAssessors->Document2->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('DocumentName3', $CPDAssessors->DocumentName3->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
$XmlDoc->AddField('Document3', $CPDAssessors->Document3->ExportValue($CPDAssessors->Export, $CPDAssessors->ExportOriginalValue));
} else {
$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
$ExportDoc->ExportField($CPDAssessors->CPDAssessorID);
$ExportDoc->ExportField($CPDAssessors->Title);
$ExportDoc->ExportField($CPDAssessors->KnownAs);
$ExportDoc->ExportField($CPDAssessors->FirstName);
$ExportDoc->ExportField($CPDAssessors->Surname);
$ExportDoc->ExportField($CPDAssessors->Designation);
$ExportDoc->ExportField($CPDAssessors->Department);
$ExportDoc->ExportField($CPDAssessors->Organisation);
$ExportDoc->ExportField($CPDAssessors->CellNumber);
$ExportDoc->ExportField($CPDAssessors->EmailAddress);
$ExportDoc->ExportField($CPDAssessors->ProfessionalCouncil);
$ExportDoc->ExportField($CPDAssessors->ProfRegNo);
$ExportDoc->ExportField($CPDAssessors->CVFile);
$ExportDoc->ExportField($CPDAssessors->QualificationFile);
$ExportDoc->ExportField($CPDAssessors->NDAFile);
$ExportDoc->ExportField($CPDAssessors->adminusername);
$ExportDoc->ExportField($CPDAssessors->DateUpdated);
$ExportDoc->ExportField($CPDAssessors->Active);
$ExportDoc->ExportField($CPDAssessors->DocumentName1);
$ExportDoc->ExportField($CPDAssessors->Document1);
$ExportDoc->ExportField($CPDAssessors->DocumentName2);
$ExportDoc->ExportField($CPDAssessors->Document2);
$ExportDoc->ExportField($CPDAssessors->DocumentName3);
$ExportDoc->ExportField($CPDAssessors->Document3);
$ExportDoc->EndExportRow();
}
}
$rs->MoveNext();
}
if ($CPDAssessors->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($CPDAssessors->Export, array("email", "xml")))
echo "\xEF\xBB\xBF";
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
if ($CPDAssessors->Export == "xml") {
header("Content-Type: text/xml");
echo $XmlDoc->XML();
} elseif ($CPDAssessors->Export == "email") {
$this->ExportEmail($ExportDoc->Text);
$this->Page_Terminate($CPDAssessors->ExportReturnUrl());
} else {
echo $ExportDoc->Text;
}
}
// Export email
function ExportEmail($EmailContent) {
global $Language, $CPDAssessors;
$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 ($CPDAssessors->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 $CPDAssessors;
// Initialize
$sQry = "export=html";
// Build QueryString for search
if ($CPDAssessors->getSessionBasicSearchKeyword() <> "") {
$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $CPDAssessors->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $CPDAssessors->getSessionBasicSearchType();
}
// Build QueryString for pager
$sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . $CPDAssessors->getRecordsPerPage() . "&" . EW_TABLE_START_REC . "=" . $CPDAssessors->getStartRecordNumber();
return $sQry;
}
// Add search QueryString
function AddSearchQueryString(&$Qry, &$Fld) {
global $CPDAssessors;
$FldParm = substr($Fld->FldVar, 2);
$FldSearchValue = $CPDAssessors->GetAdvancedSearch("x_" . $FldParm);
if (strval($FldSearchValue) <> "") {
$Qry .= "&x_" . $FldParm . "=" . FldSearchValue .
"&z_" . $FldParm . "=" . $CPDAssessors->GetAdvancedSearch("z_" . $FldParm);
}
$FldSearchValue2 = $CPDAssessors->GetAdvancedSearch("y_" . $FldParm);
if (strval($FldSearchValue2) <> "") {
$Qry .= "&v_" . $FldParm . "=" . $CPDAssessors->GetAdvancedSearch("v_" . $FldParm) .
"&y_" . $FldParm . "=" . $FldSearchValue2 .
"&w_" . $FldParm . "=" . $CPDAssessors->GetAdvancedSearch("w_" . $FldParm);
}
}
// 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;
}
// ListOptions Load event
function ListOptions_Load() {
// Example:
//$this->ListOptions->Add("new");
//$this->ListOptions->Items["new"]->OnLeft = TRUE; // Link on left
//$this->ListOptions->MoveItem("new", 0); // Move to first column
}
// ListOptions Rendered event
function ListOptions_Rendered() {
// Example:
//$this->ListOptions->Items["new"]->Body = "xxx";
}
}
?>