| Current Path : /var/www/cesa.co.za/ccmadmin/ |
| Current File : /var/www/cesa.co.za/ccmadmin/CCMMentorslist.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 "CCMMentorsinfo.php" ?>
<?php include "CCMUsersinfo.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
$CCMMentors_list = new cCCMMentors_list();
$Page =& $CCMMentors_list;
// Page init
$CCMMentors_list->Page_Init();
// Page main
$CCMMentors_list->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($CCMMentors->Export == "") { ?>
<script type="text/javascript">
<!--
// Create page object
var CCMMentors_list = new ew_Page("CCMMentors_list");
// page properties
CCMMentors_list.PageID = "list"; // page ID
CCMMentors_list.FormID = "fCCMMentorslist"; // form ID
var EW_PAGE_ID = CCMMentors_list.PageID; // for backward compatibility
// extend page with Form_CustomValidate function
CCMMentors_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) { ?>
CCMMentors_list.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMMentors_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 ($CCMMentors->Export == "") { ?>
<?php } ?>
<?php
$bSelectLimit = EW_SELECT_LIMIT;
if ($bSelectLimit) {
$CCMMentors_list->lTotalRecs = $CCMMentors->SelectRecordCount();
} else {
if ($rs = $CCMMentors_list->LoadRecordset())
$CCMMentors_list->lTotalRecs = $rs->RecordCount();
}
$CCMMentors_list->lStartRec = 1;
if ($CCMMentors_list->lDisplayRecs <= 0 || ($CCMMentors->Export <> "" && $CCMMentors->ExportAll)) // Display all records
$CCMMentors_list->lDisplayRecs = $CCMMentors_list->lTotalRecs;
if (!($CCMMentors->Export <> "" && $CCMMentors->ExportAll))
$CCMMentors_list->SetUpStartRec(); // Set up start record position
if ($bSelectLimit)
$rs = $CCMMentors_list->LoadRecordset($CCMMentors_list->lStartRec-1, $CCMMentors_list->lDisplayRecs);
?>
<p><span class="phpmaker" style="white-space: nowrap;"><?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCMMentors->TableCaption() ?>
<?php if ($CCMMentors->Export == "" && $CCMMentors->CurrentAction == "") { ?>
<a href="<?php echo $CCMMentors_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 $CCMMentors_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 $CCMMentors_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_CCMMentors" id="emf_CCMMentors" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCMMentors',hdr:ewLanguage.Phrase('ExportToEmail'),f:document.fCCMMentorslist,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->CanSearch()) { ?>
<?php if ($CCMMentors->Export == "" && $CCMMentors->CurrentAction == "") { ?>
<a href="javascript:ew_ToggleSearchPanel(CCMMentors_list);" style="text-decoration: none;"><img id="CCMMentors_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="CCMMentors_list_SearchPanel">
<form name="fCCMMentorslistsrch" id="fCCMMentorslistsrch" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<input type="hidden" id="t" name="t" value="CCMMentors">
<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($CCMMentors->getSessionBasicSearchKeyword()) ?>">
<input type="Submit" name="Submit" id="Submit" value="<?php echo ew_BtnCaption($Language->Phrase("QuickSearchBtn")) ?>">
<a href="<?php echo $CCMMentors_list->PageUrl() ?>cmd=reset"><?php echo $Language->Phrase("ShowAll") ?></a>
<a href="CCMMentorssrch.php"><?php echo $Language->Phrase("AdvancedSearch") ?></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 ($CCMMentors->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 ($CCMMentors->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 ($CCMMentors->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();
$CCMMentors_list->ShowMessage();
?>
<br>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<?php if ($CCMMentors->Export == "") { ?>
<div class="ewGridUpperPanel">
<?php if ($CCMMentors->CurrentAction <> "gridadd" && $CCMMentors->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($CCMMentors_list->Pager)) $CCMMentors_list->Pager = new cPrevNextPager($CCMMentors_list->lStartRec, $CCMMentors_list->lDisplayRecs, $CCMMentors_list->lTotalRecs) ?>
<?php if ($CCMMentors_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 ($CCMMentors_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 ($CCMMentors_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 $CCMMentors_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCMMentors_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 ($CCMMentors_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 $CCMMentors_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CCMMentors_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CCMMentors_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CCMMentors_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($Security->CanList()) { ?>
<?php if ($CCMMentors_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 } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>
</form>
<?php } ?>
<span class="phpmaker">
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $CCMMentors_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>
<?php } ?>
</span>
</div>
<?php } ?>
<form name="fCCMMentorslist" id="fCCMMentorslist" class="ewForm" action="" method="post">
<div id="gmp_CCMMentors" class="ewGridMiddlePanel">
<?php if ($CCMMentors_list->lTotalRecs > 0) { ?>
<table cellspacing="0" rowhighlightclass="ewTableHighlightRow" rowselectclass="ewTableSelectRow" roweditclass="ewTableEditRow" class="ewTable ewTableSeparate">
<?php echo $CCMMentors->TableCustomInnerHtml ?>
<thead><!-- Table header -->
<tr class="ewTableHeader">
<?php
// Render list options
$CCMMentors_list->RenderListOptions();
// Render list options (header, left)
$CCMMentors_list->ListOptions->Render("header", "left");
?>
<?php if ($CCMMentors->Organisation->Visible) { // Organisation ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Organisation) == "") { ?>
<td><?php echo $CCMMentors->Organisation->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Organisation) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Organisation->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Organisation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->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 ($CCMMentors->FirstName->Visible) { // FirstName ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->FirstName) == "") { ?>
<td><?php echo $CCMMentors->FirstName->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->FirstName) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->FirstName->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->FirstName->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->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 ($CCMMentors->Surname->Visible) { // Surname ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Surname) == "") { ?>
<td><?php echo $CCMMentors->Surname->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Surname) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Surname->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Surname->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->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 ($CCMMentors->Telephone->Visible) { // Telephone ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Telephone) == "") { ?>
<td><?php echo $CCMMentors->Telephone->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Telephone) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Telephone->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Telephone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->Telephone->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMMentors->Cellphone->Visible) { // Cellphone ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Cellphone) == "") { ?>
<td><?php echo $CCMMentors->Cellphone->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Cellphone) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Cellphone->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Cellphone->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->Cellphone->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMMentors->EmailAddress->Visible) { // EmailAddress ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->EmailAddress) == "") { ?>
<td><?php echo $CCMMentors->EmailAddress->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->EmailAddress) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->EmailAddress->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->EmailAddress->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->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 ($CCMMentors->Designation->Visible) { // Designation ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Designation) == "") { ?>
<td><?php echo $CCMMentors->Designation->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Designation) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Designation->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Designation->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->Designation->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMMentors->Prof_Reg_No->Visible) { // Prof Reg No ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Prof_Reg_No) == "") { ?>
<td><?php echo $CCMMentors->Prof_Reg_No->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Prof_Reg_No) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Prof_Reg_No->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Prof_Reg_No->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->Prof_Reg_No->getSort() == "DESC") { ?><img src="images/sortdown.gif" width="10" height="9" border="0"><?php } ?></td></tr></thead></table>
</div></td>
<?php } ?>
<?php } ?>
<?php if ($CCMMentors->Reg_No->Visible) { // Reg No ?>
<?php if ($CCMMentors->SortUrl($CCMMentors->Reg_No) == "") { ?>
<td><?php echo $CCMMentors->Reg_No->FldCaption() ?></td>
<?php } else { ?>
<td><div class="ewPointer" onmousedown="ew_Sort(event,'<?php echo $CCMMentors->SortUrl($CCMMentors->Reg_No) ?>',2);">
<table cellspacing="0" class="ewTableHeaderBtn"><thead><tr><td><?php echo $CCMMentors->Reg_No->FldCaption() ?><?php echo $Language->Phrase("SrchLegend") ?></td><td style="width: 10px;"><?php if ($CCMMentors->Reg_No->getSort() == "ASC") { ?><img src="images/sortup.gif" width="10" height="9" border="0"><?php } elseif ($CCMMentors->Reg_No->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)
$CCMMentors_list->ListOptions->Render("header", "right");
?>
</tr>
</thead>
<?php
if ($CCMMentors->ExportAll && $CCMMentors->Export <> "") {
$CCMMentors_list->lStopRec = $CCMMentors_list->lTotalRecs;
} else {
$CCMMentors_list->lStopRec = $CCMMentors_list->lStartRec + $CCMMentors_list->lDisplayRecs - 1; // Set the last record to display
}
$CCMMentors_list->lRecCount = $CCMMentors_list->lStartRec - 1;
if ($rs && !$rs->EOF) {
$rs->MoveFirst();
if (!$bSelectLimit && $CCMMentors_list->lStartRec > 1)
$rs->Move($CCMMentors_list->lStartRec - 1);
}
// Initialize aggregate
$CCMMentors->RowType = EW_ROWTYPE_AGGREGATEINIT;
$CCMMentors_list->RenderRow();
$CCMMentors_list->lRowCnt = 0;
while (($CCMMentors->CurrentAction == "gridadd" || !$rs->EOF) &&
$CCMMentors_list->lRecCount < $CCMMentors_list->lStopRec) {
$CCMMentors_list->lRecCount++;
if (intval($CCMMentors_list->lRecCount) >= intval($CCMMentors_list->lStartRec)) {
$CCMMentors_list->lRowCnt++;
// Init row class and style
$CCMMentors->CssClass = "";
$CCMMentors->CssStyle = "";
$CCMMentors->RowAttrs = array('onmouseover'=>'ew_MouseOver(event, this);', 'onmouseout'=>'ew_MouseOut(event, this);', 'onclick'=>'ew_Click(event, this);');
if ($CCMMentors->CurrentAction == "gridadd") {
$CCMMentors_list->LoadDefaultValues(); // Load default values
} else {
$CCMMentors_list->LoadRowValues($rs); // Load row values
}
$CCMMentors->RowType = EW_ROWTYPE_VIEW; // Render view
// Render row
$CCMMentors_list->RenderRow();
// Render list options
$CCMMentors_list->RenderListOptions();
?>
<tr<?php echo $CCMMentors->RowAttributes() ?>>
<?php
// Render list options (body, left)
$CCMMentors_list->ListOptions->Render("body", "left");
?>
<?php if ($CCMMentors->Organisation->Visible) { // Organisation ?>
<td<?php echo $CCMMentors->Organisation->CellAttributes() ?>>
<div<?php echo $CCMMentors->Organisation->ViewAttributes() ?>><?php echo $CCMMentors->Organisation->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->FirstName->Visible) { // FirstName ?>
<td<?php echo $CCMMentors->FirstName->CellAttributes() ?>>
<div<?php echo $CCMMentors->FirstName->ViewAttributes() ?>><?php echo $CCMMentors->FirstName->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Surname->Visible) { // Surname ?>
<td<?php echo $CCMMentors->Surname->CellAttributes() ?>>
<div<?php echo $CCMMentors->Surname->ViewAttributes() ?>><?php echo $CCMMentors->Surname->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Telephone->Visible) { // Telephone ?>
<td<?php echo $CCMMentors->Telephone->CellAttributes() ?>>
<div<?php echo $CCMMentors->Telephone->ViewAttributes() ?>><?php echo $CCMMentors->Telephone->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Cellphone->Visible) { // Cellphone ?>
<td<?php echo $CCMMentors->Cellphone->CellAttributes() ?>>
<div<?php echo $CCMMentors->Cellphone->ViewAttributes() ?>><?php echo $CCMMentors->Cellphone->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->EmailAddress->Visible) { // EmailAddress ?>
<td<?php echo $CCMMentors->EmailAddress->CellAttributes() ?>>
<div<?php echo $CCMMentors->EmailAddress->ViewAttributes() ?>><?php echo $CCMMentors->EmailAddress->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Designation->Visible) { // Designation ?>
<td<?php echo $CCMMentors->Designation->CellAttributes() ?>>
<div<?php echo $CCMMentors->Designation->ViewAttributes() ?>><?php echo $CCMMentors->Designation->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Prof_Reg_No->Visible) { // Prof Reg No ?>
<td<?php echo $CCMMentors->Prof_Reg_No->CellAttributes() ?>>
<div<?php echo $CCMMentors->Prof_Reg_No->ViewAttributes() ?>><?php echo $CCMMentors->Prof_Reg_No->ListViewValue() ?></div>
</td>
<?php } ?>
<?php if ($CCMMentors->Reg_No->Visible) { // Reg No ?>
<td<?php echo $CCMMentors->Reg_No->CellAttributes() ?>>
<div<?php echo $CCMMentors->Reg_No->ViewAttributes() ?>><?php echo $CCMMentors->Reg_No->ListViewValue() ?></div>
</td>
<?php } ?>
<?php
// Render list options (body, right)
$CCMMentors_list->ListOptions->Render("body", "right");
?>
</tr>
<?php
}
if ($CCMMentors->CurrentAction <> "gridadd")
$rs->MoveNext();
}
?>
</tbody>
</table>
<?php } ?>
</div>
</form>
<?php
// Close recordset
if ($rs)
$rs->Close();
?>
<?php if ($CCMMentors_list->lTotalRecs > 0) { ?>
<?php if ($CCMMentors->Export == "") { ?>
<div class="ewGridLowerPanel">
<?php if ($CCMMentors->CurrentAction <> "gridadd" && $CCMMentors->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($CCMMentors_list->Pager)) $CCMMentors_list->Pager = new cPrevNextPager($CCMMentors_list->lStartRec, $CCMMentors_list->lDisplayRecs, $CCMMentors_list->lTotalRecs) ?>
<?php if ($CCMMentors_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 ($CCMMentors_list->Pager->FirstButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 ($CCMMentors_list->Pager->PrevButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 $CCMMentors_list->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
<?php if ($CCMMentors_list->Pager->NextButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 ($CCMMentors_list->Pager->LastButton->Enabled) { ?>
<td><a href="<?php echo $CCMMentors_list->PageUrl() ?>start=<?php echo $CCMMentors_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 $CCMMentors_list->Pager->PageCount ?></span></td>
</tr></table>
</td>
<td> </td>
<td>
<span class="phpmaker"><?php echo $Language->Phrase("Record") ?> <?php echo $CCMMentors_list->Pager->FromIndex ?> <?php echo $Language->Phrase("To") ?> <?php echo $CCMMentors_list->Pager->ToIndex ?> <?php echo $Language->Phrase("Of") ?> <?php echo $CCMMentors_list->Pager->RecordCount ?></span>
<?php } else { ?>
<?php if ($Security->CanList()) { ?>
<?php if ($CCMMentors_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 } else { ?>
<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
<?php } ?>
<?php } ?>
</td>
</tr>
</table>
</form>
<?php } ?>
<?php //if ($CCMMentors_list->lTotalRecs > 0) { ?>
<span class="phpmaker">
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $CCMMentors_list->AddUrl ?>"><?php echo $Language->Phrase("AddLink") ?></a>
<?php } ?>
</span>
<?php //} ?>
</div>
<?php } ?>
<?php } ?>
</td></tr></table>
<?php if ($CCMMentors->Export == "" && $CCMMentors->CurrentAction == "") { ?>
<?php } ?>
<?php if ($CCMMentors->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
$CCMMentors_list->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCMMentors_list {
// Page ID
var $PageID = 'list';
// Table name
var $TableName = 'CCMMentors';
// Page object name
var $PageObjName = 'CCMMentors_list';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCMMentors;
if ($CCMMentors->UseTokenInUrl) $PageUrl .= "t=" . $CCMMentors->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, $CCMMentors;
if ($CCMMentors->UseTokenInUrl) {
if ($objForm)
return ($CCMMentors->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCMMentors->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function cCCMMentors_list() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCMMentors)
$GLOBALS["CCMMentors"] = new cCCMMentors();
// 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["CCMMentors"]->AddUrl();
$this->InlineAddUrl = $this->PageUrl() . "a=add";
$this->GridAddUrl = $this->PageUrl() . "a=gridadd";
$this->GridEditUrl = $this->PageUrl() . "a=gridedit";
$this->MultiDeleteUrl = "CCMMentorsdelete.php";
$this->MultiUpdateUrl = "CCMMentorsupdate.php";
// Table object (CCMUsers)
$GLOBALS['CCMUsers'] = new cCCMUsers();
// 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", 'CCMMentors', 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 $CCMMentors;
// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
$Security->TablePermission_Loading();
$Security->LoadCurrentUserLevel($this->TableName);
$Security->TablePermission_Loaded();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
if (!$Security->CanList()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
// Get export parameters
if (@$_GET["export"] <> "") {
$CCMMentors->Export = $_GET["export"];
} elseif (ew_IsHttpPost()) {
if (@$_POST["exporttype"] <> "")
$CCMMentors->Export = $_POST["exporttype"];
} else {
$CCMMentors->setExportReturnUrl(ew_CurrentUrl());
}
$gsExport = $CCMMentors->Export; // Get export parameter, used in header
$gsExportFile = $CCMMentors->TableVar; // Get export file, used in header
if ($CCMMentors->Export == "excel") {
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
}
if ($CCMMentors->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, $CCMMentors;
// 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();
// Get and validate search values for advanced search
$this->LoadSearchValues(); // Get search values
if (!$this->ValidateSearch())
$this->setMessage($gsSearchError);
// Restore search parms from Session
$this->RestoreSearchParms();
// Call Recordset SearchValidated event
$CCMMentors->Recordset_SearchValidated();
// Set up sorting order
$this->SetUpSortOrder();
// Get basic search criteria
if ($gsSearchError == "")
$sSrchBasic = $this->BasicSearchWhere();
// Get search criteria for advanced search
if ($gsSearchError == "")
$sSrchAdvanced = $this->AdvancedSearchWhere();
}
// Restore display records
if ($CCMMentors->getRecordsPerPage() <> "") {
$this->lDisplayRecs = $CCMMentors->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
$CCMMentors->Recordset_Searching($this->sSrchWhere);
// Save search criteria
if ($this->sSrchWhere <> "") {
if ($sSrchBasic == "")
$this->ResetBasicSearchParms();
if ($sSrchAdvanced == "")
$this->ResetAdvancedSearchParms();
$CCMMentors->setSearchWhere($this->sSrchWhere); // Save to Session
if (!$this->RestoreSearch) {
$this->lStartRec = 1; // Reset start record counter
$CCMMentors->setStartRecordNumber($this->lStartRec);
}
} else {
$this->sSrchWhere = $CCMMentors->getSearchWhere();
}
// Build filter
$sFilter = "";
if (!$Security->CanList())
$sFilter = "(0=1)"; // Filter all records
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
$CCMMentors->setSessionWhere($sFilter);
$CCMMentors->CurrentFilter = "";
// Export data only
if (in_array($CCMMentors->Export, array("html","word","excel","xml","csv","email"))) {
$this->ExportData();
if ($CCMMentors->Export <> "email")
$this->Page_Terminate(); // Terminate response
exit();
}
}
// Advanced search WHERE clause based on QueryString
function AdvancedSearchWhere() {
global $Security, $CCMMentors;
$sWhere = "";
if (!$Security->CanSearch()) return "";
$this->BuildSearchSql($sWhere, $CCMMentors->CCMMentorID, FALSE); // CCMMentorID
$this->BuildSearchSql($sWhere, $CCMMentors->Organisation, FALSE); // Organisation
$this->BuildSearchSql($sWhere, $CCMMentors->Title, FALSE); // Title
$this->BuildSearchSql($sWhere, $CCMMentors->FirstName, FALSE); // FirstName
$this->BuildSearchSql($sWhere, $CCMMentors->Surname, FALSE); // Surname
$this->BuildSearchSql($sWhere, $CCMMentors->Initials, FALSE); // Initials
$this->BuildSearchSql($sWhere, $CCMMentors->KnownAs, FALSE); // KnownAs
$this->BuildSearchSql($sWhere, $CCMMentors->IDNumber, FALSE); // IDNumber
$this->BuildSearchSql($sWhere, $CCMMentors->ProfessionalCouncil, FALSE); // ProfessionalCouncil
$this->BuildSearchSql($sWhere, $CCMMentors->CategoryReg, FALSE); // CategoryReg
$this->BuildSearchSql($sWhere, $CCMMentors->CouncilRegNumber, FALSE); // CouncilRegNumber
$this->BuildSearchSql($sWhere, $CCMMentors->Telephone, FALSE); // Telephone
$this->BuildSearchSql($sWhere, $CCMMentors->Cellphone, FALSE); // Cellphone
$this->BuildSearchSql($sWhere, $CCMMentors->EmailAddress, FALSE); // EmailAddress
$this->BuildSearchSql($sWhere, $CCMMentors->WorkAddress, FALSE); // WorkAddress
$this->BuildSearchSql($sWhere, $CCMMentors->PostalAddress, FALSE); // PostalAddress
$this->BuildSearchSql($sWhere, $CCMMentors->EducationalInst, FALSE); // EducationalInst
$this->BuildSearchSql($sWhere, $CCMMentors->Qualifications, FALSE); // Qualifications
$this->BuildSearchSql($sWhere, $CCMMentors->CVFile, FALSE); // CVFile
$this->BuildSearchSql($sWhere, $CCMMentors->MentorUndertaking, FALSE); // MentorUndertaking
$this->BuildSearchSql($sWhere, $CCMMentors->CandUUndertaking, FALSE); // CandUUndertaking
$this->BuildSearchSql($sWhere, $CCMMentors->WebUsername, FALSE); // WebUsername
$this->BuildSearchSql($sWhere, $CCMMentors->WebPassword, FALSE); // WebPassword
$this->BuildSearchSql($sWhere, $CCMMentors->BlockAccess, FALSE); // BlockAccess
$this->BuildSearchSql($sWhere, $CCMMentors->Archived, FALSE); // Archived
$this->BuildSearchSql($sWhere, $CCMMentors->Designation, FALSE); // Designation
$this->BuildSearchSql($sWhere, $CCMMentors->Prof_Reg_No, FALSE); // Prof Reg No
$this->BuildSearchSql($sWhere, $CCMMentors->Reg_No, FALSE); // Reg No
// Set up search parm
if ($sWhere <> "") {
$this->SetSearchParm($CCMMentors->CCMMentorID); // CCMMentorID
$this->SetSearchParm($CCMMentors->Organisation); // Organisation
$this->SetSearchParm($CCMMentors->Title); // Title
$this->SetSearchParm($CCMMentors->FirstName); // FirstName
$this->SetSearchParm($CCMMentors->Surname); // Surname
$this->SetSearchParm($CCMMentors->Initials); // Initials
$this->SetSearchParm($CCMMentors->KnownAs); // KnownAs
$this->SetSearchParm($CCMMentors->IDNumber); // IDNumber
$this->SetSearchParm($CCMMentors->ProfessionalCouncil); // ProfessionalCouncil
$this->SetSearchParm($CCMMentors->CategoryReg); // CategoryReg
$this->SetSearchParm($CCMMentors->CouncilRegNumber); // CouncilRegNumber
$this->SetSearchParm($CCMMentors->Telephone); // Telephone
$this->SetSearchParm($CCMMentors->Cellphone); // Cellphone
$this->SetSearchParm($CCMMentors->EmailAddress); // EmailAddress
$this->SetSearchParm($CCMMentors->WorkAddress); // WorkAddress
$this->SetSearchParm($CCMMentors->PostalAddress); // PostalAddress
$this->SetSearchParm($CCMMentors->EducationalInst); // EducationalInst
$this->SetSearchParm($CCMMentors->Qualifications); // Qualifications
$this->SetSearchParm($CCMMentors->CVFile); // CVFile
$this->SetSearchParm($CCMMentors->MentorUndertaking); // MentorUndertaking
$this->SetSearchParm($CCMMentors->CandUUndertaking); // CandUUndertaking
$this->SetSearchParm($CCMMentors->WebUsername); // WebUsername
$this->SetSearchParm($CCMMentors->WebPassword); // WebPassword
$this->SetSearchParm($CCMMentors->BlockAccess); // BlockAccess
$this->SetSearchParm($CCMMentors->Archived); // Archived
$this->SetSearchParm($CCMMentors->Designation); // Designation
$this->SetSearchParm($CCMMentors->Prof_Reg_No); // Prof Reg No
$this->SetSearchParm($CCMMentors->Reg_No); // Reg No
}
return $sWhere;
}
// Build search SQL
function BuildSearchSql(&$Where, &$Fld, $MultiValue) {
$FldParm = substr($Fld->FldVar, 2);
$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
$FldOpr = $Fld->AdvancedSearch->SearchOperator; // @$_GET["z_$FldParm"]
$FldCond = $Fld->AdvancedSearch->SearchCondition; // @$_GET["v_$FldParm"]
$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
$FldOpr2 = $Fld->AdvancedSearch->SearchOperator2; // @$_GET["w_$FldParm"]
$sWrk = "";
//$FldVal = ew_StripSlashes($FldVal);
if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
//$FldVal2 = ew_StripSlashes($FldVal2);
if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
$FldOpr = strtoupper(trim($FldOpr));
if ($FldOpr == "") $FldOpr = "=";
$FldOpr2 = strtoupper(trim($FldOpr2));
if ($FldOpr2 == "") $FldOpr2 = "=";
if (EW_SEARCH_MULTI_VALUE_OPTION == 1 || $FldOpr <> "LIKE" ||
($FldOpr2 <> "LIKE" && $FldVal2 <> ""))
$MultiValue = FALSE;
if ($MultiValue) {
$sWrk1 = ($FldVal <> "") ? ew_GetMultiSearchSql($Fld, $FldVal) : ""; // Field value 1
$sWrk2 = ($FldVal2 <> "") ? ew_GetMultiSearchSql($Fld, $FldVal2) : ""; // Field value 2
$sWrk = $sWrk1; // Build final SQL
if ($sWrk2 <> "")
$sWrk = ($sWrk <> "") ? "($sWrk) $FldCond ($sWrk2)" : $sWrk2;
} else {
$FldVal = $this->ConvertSearchValue($Fld, $FldVal);
$FldVal2 = $this->ConvertSearchValue($Fld, $FldVal2);
$sWrk = ew_GetSearchSql($Fld, $FldVal, $FldOpr, $FldCond, $FldVal2, $FldOpr2);
}
if ($sWrk <> "") {
if ($Where <> "") $Where .= " AND ";
$Where .= "(" . $sWrk . ")";
}
}
// Set search parameters
function SetSearchParm(&$Fld) {
global $CCMMentors;
$FldParm = substr($Fld->FldVar, 2);
$FldVal = $Fld->AdvancedSearch->SearchValue; // @$_GET["x_$FldParm"]
$FldVal = ew_StripSlashes($FldVal);
if (is_array($FldVal)) $FldVal = implode(",", $FldVal);
$FldVal2 = $Fld->AdvancedSearch->SearchValue2; // @$_GET["y_$FldParm"]
$FldVal2 = ew_StripSlashes($FldVal2);
if (is_array($FldVal2)) $FldVal2 = implode(",", $FldVal2);
$CCMMentors->setAdvancedSearch("x_$FldParm", $FldVal);
$CCMMentors->setAdvancedSearch("z_$FldParm", $Fld->AdvancedSearch->SearchOperator); // @$_GET["z_$FldParm"]
$CCMMentors->setAdvancedSearch("v_$FldParm", $Fld->AdvancedSearch->SearchCondition); // @$_GET["v_$FldParm"]
$CCMMentors->setAdvancedSearch("y_$FldParm", $FldVal2);
$CCMMentors->setAdvancedSearch("w_$FldParm", $Fld->AdvancedSearch->SearchOperator2); // @$_GET["w_$FldParm"]
}
// Get search parameters
function GetSearchParm(&$Fld) {
global $CCMMentors;
$FldParm = substr($Fld->FldVar, 2);
$Fld->AdvancedSearch->SearchValue = $CCMMentors->GetAdvancedSearch("x_$FldParm");
$Fld->AdvancedSearch->SearchOperator = $CCMMentors->GetAdvancedSearch("z_$FldParm");
$Fld->AdvancedSearch->SearchCondition = $CCMMentors->GetAdvancedSearch("v_$FldParm");
$Fld->AdvancedSearch->SearchValue2 = $CCMMentors->GetAdvancedSearch("y_$FldParm");
$Fld->AdvancedSearch->SearchOperator2 = $CCMMentors->GetAdvancedSearch("w_$FldParm");
}
// Convert search value
function ConvertSearchValue(&$Fld, $FldVal) {
$Value = $FldVal;
if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) {
if ($FldVal <> "") $Value = ($FldVal == "1") ? $Fld->TrueValue : $Fld->FalseValue;
} elseif ($Fld->FldDataType == EW_DATATYPE_DATE) {
if ($FldVal <> "") $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat);
}
return $Value;
}
// Return basic search SQL
function BasicSearchSQL($Keyword) {
global $CCMMentors;
$sKeyword = ew_AdjustSql($Keyword);
$sWhere = "";
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Organisation, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Title, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->FirstName, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Surname, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Initials, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->KnownAs, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->IDNumber, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->ProfessionalCouncil, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->CategoryReg, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->CouncilRegNumber, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Telephone, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Cellphone, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->EmailAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->WorkAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->PostalAddress, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->EducationalInst, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Qualifications, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->CVFile, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->MentorUndertaking, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->CandUUndertaking, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->WebUsername, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->WebPassword, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->BlockAccess, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Designation, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Prof_Reg_No, $Keyword);
$this->BuildBasicSearchSQL($sWhere, $CCMMentors->Reg_No, $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, $CCMMentors;
$sSearchStr = "";
if (!$Security->CanSearch()) return "";
$sSearchKeyword = $CCMMentors->BasicSearchKeyword;
$sSearchType = $CCMMentors->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 <> "") {
$CCMMentors->setSessionBasicSearchKeyword($sSearchKeyword);
$CCMMentors->setSessionBasicSearchType($sSearchType);
}
return $sSearchStr;
}
// Clear all search parameters
function ResetSearchParms() {
global $CCMMentors;
// Clear search WHERE clause
$this->sSrchWhere = "";
$CCMMentors->setSearchWhere($this->sSrchWhere);
// Clear basic search parameters
$this->ResetBasicSearchParms();
// Clear advanced search parameters
$this->ResetAdvancedSearchParms();
}
// Clear all basic search parameters
function ResetBasicSearchParms() {
global $CCMMentors;
$CCMMentors->setSessionBasicSearchKeyword("");
$CCMMentors->setSessionBasicSearchType("");
}
// Clear all advanced search parameters
function ResetAdvancedSearchParms() {
global $CCMMentors;
$CCMMentors->setAdvancedSearch("x_CCMMentorID", "");
$CCMMentors->setAdvancedSearch("x_Organisation", "");
$CCMMentors->setAdvancedSearch("x_Title", "");
$CCMMentors->setAdvancedSearch("x_FirstName", "");
$CCMMentors->setAdvancedSearch("x_Surname", "");
$CCMMentors->setAdvancedSearch("x_Initials", "");
$CCMMentors->setAdvancedSearch("x_KnownAs", "");
$CCMMentors->setAdvancedSearch("x_IDNumber", "");
$CCMMentors->setAdvancedSearch("x_ProfessionalCouncil", "");
$CCMMentors->setAdvancedSearch("x_CategoryReg", "");
$CCMMentors->setAdvancedSearch("x_CouncilRegNumber", "");
$CCMMentors->setAdvancedSearch("x_Telephone", "");
$CCMMentors->setAdvancedSearch("x_Cellphone", "");
$CCMMentors->setAdvancedSearch("x_EmailAddress", "");
$CCMMentors->setAdvancedSearch("x_WorkAddress", "");
$CCMMentors->setAdvancedSearch("x_PostalAddress", "");
$CCMMentors->setAdvancedSearch("x_EducationalInst", "");
$CCMMentors->setAdvancedSearch("x_Qualifications", "");
$CCMMentors->setAdvancedSearch("x_CVFile", "");
$CCMMentors->setAdvancedSearch("x_MentorUndertaking", "");
$CCMMentors->setAdvancedSearch("x_CandUUndertaking", "");
$CCMMentors->setAdvancedSearch("x_WebUsername", "");
$CCMMentors->setAdvancedSearch("x_WebPassword", "");
$CCMMentors->setAdvancedSearch("x_BlockAccess", "");
$CCMMentors->setAdvancedSearch("x_Archived", "");
$CCMMentors->setAdvancedSearch("x_Designation", "");
$CCMMentors->setAdvancedSearch("x_Prof_Reg_No", "");
$CCMMentors->setAdvancedSearch("x_Reg_No", "");
}
// Restore all search parameters
function RestoreSearchParms() {
global $CCMMentors;
$bRestore = TRUE;
if (@$_GET[EW_TABLE_BASIC_SEARCH] <> "") $bRestore = FALSE;
if (@$_GET["x_CCMMentorID"] <> "") $bRestore = FALSE;
if (@$_GET["x_Organisation"] <> "") $bRestore = FALSE;
if (@$_GET["x_Title"] <> "") $bRestore = FALSE;
if (@$_GET["x_FirstName"] <> "") $bRestore = FALSE;
if (@$_GET["x_Surname"] <> "") $bRestore = FALSE;
if (@$_GET["x_Initials"] <> "") $bRestore = FALSE;
if (@$_GET["x_KnownAs"] <> "") $bRestore = FALSE;
if (@$_GET["x_IDNumber"] <> "") $bRestore = FALSE;
if (@$_GET["x_ProfessionalCouncil"] <> "") $bRestore = FALSE;
if (@$_GET["x_CategoryReg"] <> "") $bRestore = FALSE;
if (@$_GET["x_CouncilRegNumber"] <> "") $bRestore = FALSE;
if (@$_GET["x_Telephone"] <> "") $bRestore = FALSE;
if (@$_GET["x_Cellphone"] <> "") $bRestore = FALSE;
if (@$_GET["x_EmailAddress"] <> "") $bRestore = FALSE;
if (@$_GET["x_WorkAddress"] <> "") $bRestore = FALSE;
if (@$_GET["x_PostalAddress"] <> "") $bRestore = FALSE;
if (@$_GET["x_EducationalInst"] <> "") $bRestore = FALSE;
if (@$_GET["x_Qualifications"] <> "") $bRestore = FALSE;
if (@$_GET["x_CVFile"] <> "") $bRestore = FALSE;
if (@$_GET["x_MentorUndertaking"] <> "") $bRestore = FALSE;
if (@$_GET["x_CandUUndertaking"] <> "") $bRestore = FALSE;
if (@$_GET["x_WebUsername"] <> "") $bRestore = FALSE;
if (@$_GET["x_WebPassword"] <> "") $bRestore = FALSE;
if (@$_GET["x_BlockAccess"] <> "") $bRestore = FALSE;
if (@$_GET["x_Archived"] <> "") $bRestore = FALSE;
if (@$_GET["x_Designation"] <> "") $bRestore = FALSE;
if (@$_GET["x_Prof_Reg_No"] <> "") $bRestore = FALSE;
if (@$_GET["x_Reg_No"] <> "") $bRestore = FALSE;
$this->RestoreSearch = $bRestore;
if ($bRestore) {
// Restore basic search values
$CCMMentors->BasicSearchKeyword = $CCMMentors->getSessionBasicSearchKeyword();
$CCMMentors->BasicSearchType = $CCMMentors->getSessionBasicSearchType();
// Restore advanced search values
$this->GetSearchParm($CCMMentors->CCMMentorID);
$this->GetSearchParm($CCMMentors->Organisation);
$this->GetSearchParm($CCMMentors->Title);
$this->GetSearchParm($CCMMentors->FirstName);
$this->GetSearchParm($CCMMentors->Surname);
$this->GetSearchParm($CCMMentors->Initials);
$this->GetSearchParm($CCMMentors->KnownAs);
$this->GetSearchParm($CCMMentors->IDNumber);
$this->GetSearchParm($CCMMentors->ProfessionalCouncil);
$this->GetSearchParm($CCMMentors->CategoryReg);
$this->GetSearchParm($CCMMentors->CouncilRegNumber);
$this->GetSearchParm($CCMMentors->Telephone);
$this->GetSearchParm($CCMMentors->Cellphone);
$this->GetSearchParm($CCMMentors->EmailAddress);
$this->GetSearchParm($CCMMentors->WorkAddress);
$this->GetSearchParm($CCMMentors->PostalAddress);
$this->GetSearchParm($CCMMentors->EducationalInst);
$this->GetSearchParm($CCMMentors->Qualifications);
$this->GetSearchParm($CCMMentors->CVFile);
$this->GetSearchParm($CCMMentors->MentorUndertaking);
$this->GetSearchParm($CCMMentors->CandUUndertaking);
$this->GetSearchParm($CCMMentors->WebUsername);
$this->GetSearchParm($CCMMentors->WebPassword);
$this->GetSearchParm($CCMMentors->BlockAccess);
$this->GetSearchParm($CCMMentors->Archived);
$this->GetSearchParm($CCMMentors->Designation);
$this->GetSearchParm($CCMMentors->Prof_Reg_No);
$this->GetSearchParm($CCMMentors->Reg_No);
}
}
// Set up sort parameters
function SetUpSortOrder() {
global $CCMMentors;
// Check for Ctrl pressed
$bCtrl = (@$_GET["ctrl"] <> "");
// Check for "order" parameter
if (@$_GET["order"] <> "") {
$CCMMentors->CurrentOrder = ew_StripSlashes(@$_GET["order"]);
$CCMMentors->CurrentOrderType = @$_GET["ordertype"];
$CCMMentors->UpdateSort($CCMMentors->Organisation, $bCtrl); // Organisation
$CCMMentors->UpdateSort($CCMMentors->FirstName, $bCtrl); // FirstName
$CCMMentors->UpdateSort($CCMMentors->Surname, $bCtrl); // Surname
$CCMMentors->UpdateSort($CCMMentors->Telephone, $bCtrl); // Telephone
$CCMMentors->UpdateSort($CCMMentors->Cellphone, $bCtrl); // Cellphone
$CCMMentors->UpdateSort($CCMMentors->EmailAddress, $bCtrl); // EmailAddress
$CCMMentors->UpdateSort($CCMMentors->Designation, $bCtrl); // Designation
$CCMMentors->UpdateSort($CCMMentors->Prof_Reg_No, $bCtrl); // Prof Reg No
$CCMMentors->UpdateSort($CCMMentors->Reg_No, $bCtrl); // Reg No
$CCMMentors->setStartRecordNumber(1); // Reset start position
}
}
// Load sort order parameters
function LoadSortOrder() {
global $CCMMentors;
$sOrderBy = $CCMMentors->getSessionOrderBy(); // Get ORDER BY from Session
if ($sOrderBy == "") {
if ($CCMMentors->SqlOrderBy() <> "") {
$sOrderBy = $CCMMentors->SqlOrderBy();
$CCMMentors->setSessionOrderBy($sOrderBy);
$CCMMentors->Organisation->setSort("ASC");
$CCMMentors->Surname->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 $CCMMentors;
// 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 = "";
$CCMMentors->setSessionOrderBy($sOrderBy);
$CCMMentors->Organisation->setSort("");
$CCMMentors->FirstName->setSort("");
$CCMMentors->Surname->setSort("");
$CCMMentors->Telephone->setSort("");
$CCMMentors->Cellphone->setSort("");
$CCMMentors->EmailAddress->setSort("");
$CCMMentors->Designation->setSort("");
$CCMMentors->Prof_Reg_No->setSort("");
$CCMMentors->Reg_No->setSort("");
}
// Reset start position
$this->lStartRec = 1;
$CCMMentors->setStartRecordNumber($this->lStartRec);
}
}
// Set up list options
function SetupListOptions() {
global $Security, $CCMMentors;
// "view"
$this->ListOptions->Add("view");
$item =& $this->ListOptions->Items["view"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->CanView();
$item->OnLeft = FALSE;
// "edit"
$this->ListOptions->Add("edit");
$item =& $this->ListOptions->Items["edit"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->CanEdit();
$item->OnLeft = FALSE;
// "delete"
$this->ListOptions->Add("delete");
$item =& $this->ListOptions->Items["delete"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->CanDelete();
$item->OnLeft = FALSE;
// "detail_CCMMilestones"
$this->ListOptions->Add("detail_CCMMilestones");
$item =& $this->ListOptions->Items["detail_CCMMilestones"];
$item->CssStyle = "white-space: nowrap;";
$item->Visible = $Security->AllowList('CCMMilestones');
$item->OnLeft = FALSE;
// Call ListOptions_Load event
$this->ListOptions_Load();
if ($CCMMentors->Export <> "" ||
$CCMMentors->CurrentAction == "gridadd" ||
$CCMMentors->CurrentAction == "gridedit")
$this->ListOptions->HideAllOptions();
}
// Render list options
function RenderListOptions() {
global $Security, $Language, $CCMMentors;
$this->ListOptions->LoadDefault();
// "view"
$oListOpt =& $this->ListOptions->Items["view"];
if ($Security->CanView() && $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->CanEdit() && $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>";
}
// "delete"
$oListOpt =& $this->ListOptions->Items["delete"];
if ($Security->CanDelete() && $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>";
// "detail_CCMMilestones"
$oListOpt =& $this->ListOptions->Items["detail_CCMMilestones"];
if ($Security->AllowList('CCMMilestones')) {
$oListOpt->Body = "<img src=\"images/detail.gif\" alt=\"" . ew_HtmlEncode($Language->Phrase("DetailLink")) . "\" title=\"" . ew_HtmlEncode($Language->Phrase("DetailLink")) . "\" width=\"16\" height=\"16\" border=\"0\">" . $Language->TablePhrase("CCMMilestones", "TblCaption");
$oListOpt->Body = "<a href=\"CCMMilestoneslist.php?" . EW_TABLE_SHOW_MASTER . "=CCMMentors&CCMMentorID=" . urlencode(strval($CCMMentors->CCMMentorID->CurrentValue)) . "\">" . $oListOpt->Body . "</a>";
}
$this->RenderListOptionsExt();
// Call ListOptions_Rendered event
$this->ListOptions_Rendered();
}
function RenderListOptionsExt() {
global $Security, $Language, $CCMMentors;
}
// Set up starting record parameters
function SetUpStartRec() {
global $CCMMentors;
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];
$CCMMentors->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;
}
$CCMMentors->setStartRecordNumber($this->lStartRec);
}
}
}
$this->lStartRec = $CCMMentors->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
$CCMMentors->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
$CCMMentors->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
$CCMMentors->setStartRecordNumber($this->lStartRec);
}
}
// Load basic search values
function LoadBasicSearchValues() {
global $CCMMentors;
$CCMMentors->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];
$CCMMentors->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];
}
// Load search values for validation
function LoadSearchValues() {
global $objForm, $CCMMentors;
// Load search values
// CCMMentorID
$CCMMentors->CCMMentorID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CCMMentorID"]);
$CCMMentors->CCMMentorID->AdvancedSearch->SearchOperator = @$_GET["z_CCMMentorID"];
// Organisation
$CCMMentors->Organisation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Organisation"]);
$CCMMentors->Organisation->AdvancedSearch->SearchOperator = @$_GET["z_Organisation"];
// Title
$CCMMentors->Title->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Title"]);
$CCMMentors->Title->AdvancedSearch->SearchOperator = @$_GET["z_Title"];
// FirstName
$CCMMentors->FirstName->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_FirstName"]);
$CCMMentors->FirstName->AdvancedSearch->SearchOperator = @$_GET["z_FirstName"];
// Surname
$CCMMentors->Surname->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Surname"]);
$CCMMentors->Surname->AdvancedSearch->SearchOperator = @$_GET["z_Surname"];
// Initials
$CCMMentors->Initials->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Initials"]);
$CCMMentors->Initials->AdvancedSearch->SearchOperator = @$_GET["z_Initials"];
// KnownAs
$CCMMentors->KnownAs->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_KnownAs"]);
$CCMMentors->KnownAs->AdvancedSearch->SearchOperator = @$_GET["z_KnownAs"];
// IDNumber
$CCMMentors->IDNumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_IDNumber"]);
$CCMMentors->IDNumber->AdvancedSearch->SearchOperator = @$_GET["z_IDNumber"];
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_ProfessionalCouncil"]);
$CCMMentors->ProfessionalCouncil->AdvancedSearch->SearchOperator = @$_GET["z_ProfessionalCouncil"];
// CategoryReg
$CCMMentors->CategoryReg->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CategoryReg"]);
$CCMMentors->CategoryReg->AdvancedSearch->SearchOperator = @$_GET["z_CategoryReg"];
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CouncilRegNumber"]);
$CCMMentors->CouncilRegNumber->AdvancedSearch->SearchOperator = @$_GET["z_CouncilRegNumber"];
// Telephone
$CCMMentors->Telephone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Telephone"]);
$CCMMentors->Telephone->AdvancedSearch->SearchOperator = @$_GET["z_Telephone"];
// Cellphone
$CCMMentors->Cellphone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Cellphone"]);
$CCMMentors->Cellphone->AdvancedSearch->SearchOperator = @$_GET["z_Cellphone"];
// EmailAddress
$CCMMentors->EmailAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EmailAddress"]);
$CCMMentors->EmailAddress->AdvancedSearch->SearchOperator = @$_GET["z_EmailAddress"];
// WorkAddress
$CCMMentors->WorkAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WorkAddress"]);
$CCMMentors->WorkAddress->AdvancedSearch->SearchOperator = @$_GET["z_WorkAddress"];
// PostalAddress
$CCMMentors->PostalAddress->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_PostalAddress"]);
$CCMMentors->PostalAddress->AdvancedSearch->SearchOperator = @$_GET["z_PostalAddress"];
// EducationalInst
$CCMMentors->EducationalInst->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_EducationalInst"]);
$CCMMentors->EducationalInst->AdvancedSearch->SearchOperator = @$_GET["z_EducationalInst"];
// Qualifications
$CCMMentors->Qualifications->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Qualifications"]);
$CCMMentors->Qualifications->AdvancedSearch->SearchOperator = @$_GET["z_Qualifications"];
// CVFile
$CCMMentors->CVFile->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CVFile"]);
$CCMMentors->CVFile->AdvancedSearch->SearchOperator = @$_GET["z_CVFile"];
// MentorUndertaking
$CCMMentors->MentorUndertaking->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_MentorUndertaking"]);
$CCMMentors->MentorUndertaking->AdvancedSearch->SearchOperator = @$_GET["z_MentorUndertaking"];
// CandUUndertaking
$CCMMentors->CandUUndertaking->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_CandUUndertaking"]);
$CCMMentors->CandUUndertaking->AdvancedSearch->SearchOperator = @$_GET["z_CandUUndertaking"];
// WebUsername
$CCMMentors->WebUsername->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WebUsername"]);
$CCMMentors->WebUsername->AdvancedSearch->SearchOperator = @$_GET["z_WebUsername"];
// WebPassword
$CCMMentors->WebPassword->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_WebPassword"]);
$CCMMentors->WebPassword->AdvancedSearch->SearchOperator = @$_GET["z_WebPassword"];
// BlockAccess
$CCMMentors->BlockAccess->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_BlockAccess"]);
$CCMMentors->BlockAccess->AdvancedSearch->SearchOperator = @$_GET["z_BlockAccess"];
// Archived
$CCMMentors->Archived->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Archived"]);
$CCMMentors->Archived->AdvancedSearch->SearchOperator = @$_GET["z_Archived"];
// Designation
$CCMMentors->Designation->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Designation"]);
$CCMMentors->Designation->AdvancedSearch->SearchOperator = @$_GET["z_Designation"];
// Prof Reg No
$CCMMentors->Prof_Reg_No->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Prof_Reg_No"]);
$CCMMentors->Prof_Reg_No->AdvancedSearch->SearchOperator = @$_GET["z_Prof_Reg_No"];
// Reg No
$CCMMentors->Reg_No->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET["x_Reg_No"]);
$CCMMentors->Reg_No->AdvancedSearch->SearchOperator = @$_GET["z_Reg_No"];
}
// Load recordset
function LoadRecordset($offset = -1, $rowcnt = -1) {
global $conn, $CCMMentors;
// Call Recordset Selecting event
$CCMMentors->Recordset_Selecting($CCMMentors->CurrentFilter);
// Load List page SQL
$sSql = $CCMMentors->SelectSQL();
if ($offset > -1 && $rowcnt > -1)
$sSql .= " LIMIT $offset, $rowcnt";
// Load recordset
$rs = ew_LoadRecordset($sSql);
// Call Recordset Selected event
$CCMMentors->Recordset_Selected($rs);
return $rs;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCMMentors;
$sFilter = $CCMMentors->KeyFilter();
// Call Row Selecting event
$CCMMentors->Row_Selecting($sFilter);
// Load SQL based on filter
$CCMMentors->CurrentFilter = $sFilter;
$sSql = $CCMMentors->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCMMentors->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCMMentors;
$CCMMentors->CCMMentorID->setDbValue($rs->fields('CCMMentorID'));
$CCMMentors->Organisation->setDbValue($rs->fields('Organisation'));
$CCMMentors->Title->setDbValue($rs->fields('Title'));
$CCMMentors->FirstName->setDbValue($rs->fields('FirstName'));
$CCMMentors->Surname->setDbValue($rs->fields('Surname'));
$CCMMentors->Initials->setDbValue($rs->fields('Initials'));
$CCMMentors->KnownAs->setDbValue($rs->fields('KnownAs'));
$CCMMentors->IDNumber->setDbValue($rs->fields('IDNumber'));
$CCMMentors->ProfessionalCouncil->setDbValue($rs->fields('ProfessionalCouncil'));
$CCMMentors->CategoryReg->setDbValue($rs->fields('CategoryReg'));
$CCMMentors->CouncilRegNumber->setDbValue($rs->fields('CouncilRegNumber'));
$CCMMentors->Telephone->setDbValue($rs->fields('Telephone'));
$CCMMentors->Cellphone->setDbValue($rs->fields('Cellphone'));
$CCMMentors->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$CCMMentors->WorkAddress->setDbValue($rs->fields('WorkAddress'));
$CCMMentors->PostalAddress->setDbValue($rs->fields('PostalAddress'));
$CCMMentors->EducationalInst->setDbValue($rs->fields('EducationalInst'));
$CCMMentors->Qualifications->setDbValue($rs->fields('Qualifications'));
$CCMMentors->CVFile->setDbValue($rs->fields('CVFile'));
$CCMMentors->MentorUndertaking->setDbValue($rs->fields('MentorUndertaking'));
$CCMMentors->CandUUndertaking->setDbValue($rs->fields('CandUUndertaking'));
$CCMMentors->WebUsername->setDbValue($rs->fields('WebUsername'));
$CCMMentors->WebPassword->setDbValue($rs->fields('WebPassword'));
$CCMMentors->BlockAccess->setDbValue($rs->fields('BlockAccess'));
$CCMMentors->Archived->setDbValue($rs->fields('Archived'));
$CCMMentors->Designation->setDbValue($rs->fields('Designation'));
$CCMMentors->Prof_Reg_No->setDbValue($rs->fields('Prof Reg No'));
$CCMMentors->Reg_No->setDbValue($rs->fields('Reg No'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCMMentors;
// Initialize URLs
$this->ViewUrl = $CCMMentors->ViewUrl();
$this->EditUrl = $CCMMentors->EditUrl();
$this->InlineEditUrl = $CCMMentors->InlineEditUrl();
$this->CopyUrl = $CCMMentors->CopyUrl();
$this->InlineCopyUrl = $CCMMentors->InlineCopyUrl();
$this->DeleteUrl = $CCMMentors->DeleteUrl();
// Call Row_Rendering event
$CCMMentors->Row_Rendering();
// Common render codes for all row types
// Organisation
$CCMMentors->Organisation->CellCssStyle = ""; $CCMMentors->Organisation->CellCssClass = "";
$CCMMentors->Organisation->CellAttrs = array(); $CCMMentors->Organisation->ViewAttrs = array(); $CCMMentors->Organisation->EditAttrs = array();
// FirstName
$CCMMentors->FirstName->CellCssStyle = ""; $CCMMentors->FirstName->CellCssClass = "";
$CCMMentors->FirstName->CellAttrs = array(); $CCMMentors->FirstName->ViewAttrs = array(); $CCMMentors->FirstName->EditAttrs = array();
// Surname
$CCMMentors->Surname->CellCssStyle = ""; $CCMMentors->Surname->CellCssClass = "";
$CCMMentors->Surname->CellAttrs = array(); $CCMMentors->Surname->ViewAttrs = array(); $CCMMentors->Surname->EditAttrs = array();
// Telephone
$CCMMentors->Telephone->CellCssStyle = ""; $CCMMentors->Telephone->CellCssClass = "";
$CCMMentors->Telephone->CellAttrs = array(); $CCMMentors->Telephone->ViewAttrs = array(); $CCMMentors->Telephone->EditAttrs = array();
// Cellphone
$CCMMentors->Cellphone->CellCssStyle = ""; $CCMMentors->Cellphone->CellCssClass = "";
$CCMMentors->Cellphone->CellAttrs = array(); $CCMMentors->Cellphone->ViewAttrs = array(); $CCMMentors->Cellphone->EditAttrs = array();
// EmailAddress
$CCMMentors->EmailAddress->CellCssStyle = ""; $CCMMentors->EmailAddress->CellCssClass = "";
$CCMMentors->EmailAddress->CellAttrs = array(); $CCMMentors->EmailAddress->ViewAttrs = array(); $CCMMentors->EmailAddress->EditAttrs = array();
// Designation
$CCMMentors->Designation->CellCssStyle = ""; $CCMMentors->Designation->CellCssClass = "";
$CCMMentors->Designation->CellAttrs = array(); $CCMMentors->Designation->ViewAttrs = array(); $CCMMentors->Designation->EditAttrs = array();
// Prof Reg No
$CCMMentors->Prof_Reg_No->CellCssStyle = ""; $CCMMentors->Prof_Reg_No->CellCssClass = "";
$CCMMentors->Prof_Reg_No->CellAttrs = array(); $CCMMentors->Prof_Reg_No->ViewAttrs = array(); $CCMMentors->Prof_Reg_No->EditAttrs = array();
// Reg No
$CCMMentors->Reg_No->CellCssStyle = ""; $CCMMentors->Reg_No->CellCssClass = "";
$CCMMentors->Reg_No->CellAttrs = array(); $CCMMentors->Reg_No->ViewAttrs = array(); $CCMMentors->Reg_No->EditAttrs = array();
if ($CCMMentors->RowType == EW_ROWTYPE_VIEW) { // View row
// CCMMentorID
$CCMMentors->CCMMentorID->ViewValue = $CCMMentors->CCMMentorID->CurrentValue;
$CCMMentors->CCMMentorID->CssStyle = "";
$CCMMentors->CCMMentorID->CssClass = "";
$CCMMentors->CCMMentorID->ViewCustomAttributes = "";
// Organisation
$CCMMentors->Organisation->ViewValue = $CCMMentors->Organisation->CurrentValue;
$CCMMentors->Organisation->CssStyle = "";
$CCMMentors->Organisation->CssClass = "";
$CCMMentors->Organisation->ViewCustomAttributes = "";
// Title
$CCMMentors->Title->ViewValue = $CCMMentors->Title->CurrentValue;
$CCMMentors->Title->CssStyle = "";
$CCMMentors->Title->CssClass = "";
$CCMMentors->Title->ViewCustomAttributes = "";
// FirstName
$CCMMentors->FirstName->ViewValue = $CCMMentors->FirstName->CurrentValue;
$CCMMentors->FirstName->CssStyle = "";
$CCMMentors->FirstName->CssClass = "";
$CCMMentors->FirstName->ViewCustomAttributes = "";
// Surname
$CCMMentors->Surname->ViewValue = $CCMMentors->Surname->CurrentValue;
$CCMMentors->Surname->CssStyle = "";
$CCMMentors->Surname->CssClass = "";
$CCMMentors->Surname->ViewCustomAttributes = "";
// Initials
$CCMMentors->Initials->ViewValue = $CCMMentors->Initials->CurrentValue;
$CCMMentors->Initials->CssStyle = "";
$CCMMentors->Initials->CssClass = "";
$CCMMentors->Initials->ViewCustomAttributes = "";
// KnownAs
$CCMMentors->KnownAs->ViewValue = $CCMMentors->KnownAs->CurrentValue;
$CCMMentors->KnownAs->CssStyle = "";
$CCMMentors->KnownAs->CssClass = "";
$CCMMentors->KnownAs->ViewCustomAttributes = "";
// IDNumber
$CCMMentors->IDNumber->ViewValue = $CCMMentors->IDNumber->CurrentValue;
$CCMMentors->IDNumber->CssStyle = "";
$CCMMentors->IDNumber->CssClass = "";
$CCMMentors->IDNumber->ViewCustomAttributes = "";
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->ViewValue = $CCMMentors->ProfessionalCouncil->CurrentValue;
$CCMMentors->ProfessionalCouncil->CssStyle = "";
$CCMMentors->ProfessionalCouncil->CssClass = "";
$CCMMentors->ProfessionalCouncil->ViewCustomAttributes = "";
// CategoryReg
$CCMMentors->CategoryReg->ViewValue = $CCMMentors->CategoryReg->CurrentValue;
$CCMMentors->CategoryReg->CssStyle = "";
$CCMMentors->CategoryReg->CssClass = "";
$CCMMentors->CategoryReg->ViewCustomAttributes = "";
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->ViewValue = $CCMMentors->CouncilRegNumber->CurrentValue;
$CCMMentors->CouncilRegNumber->CssStyle = "";
$CCMMentors->CouncilRegNumber->CssClass = "";
$CCMMentors->CouncilRegNumber->ViewCustomAttributes = "";
// Telephone
$CCMMentors->Telephone->ViewValue = $CCMMentors->Telephone->CurrentValue;
$CCMMentors->Telephone->CssStyle = "";
$CCMMentors->Telephone->CssClass = "";
$CCMMentors->Telephone->ViewCustomAttributes = "";
// Cellphone
$CCMMentors->Cellphone->ViewValue = $CCMMentors->Cellphone->CurrentValue;
$CCMMentors->Cellphone->CssStyle = "";
$CCMMentors->Cellphone->CssClass = "";
$CCMMentors->Cellphone->ViewCustomAttributes = "";
// EmailAddress
$CCMMentors->EmailAddress->ViewValue = $CCMMentors->EmailAddress->CurrentValue;
$CCMMentors->EmailAddress->CssStyle = "";
$CCMMentors->EmailAddress->CssClass = "";
$CCMMentors->EmailAddress->ViewCustomAttributes = "";
// WorkAddress
$CCMMentors->WorkAddress->ViewValue = $CCMMentors->WorkAddress->CurrentValue;
$CCMMentors->WorkAddress->CssStyle = "";
$CCMMentors->WorkAddress->CssClass = "";
$CCMMentors->WorkAddress->ViewCustomAttributes = "";
// PostalAddress
$CCMMentors->PostalAddress->ViewValue = $CCMMentors->PostalAddress->CurrentValue;
$CCMMentors->PostalAddress->CssStyle = "";
$CCMMentors->PostalAddress->CssClass = "";
$CCMMentors->PostalAddress->ViewCustomAttributes = "";
// CandUUndertaking
$CCMMentors->CandUUndertaking->ViewValue = $CCMMentors->CandUUndertaking->CurrentValue;
$CCMMentors->CandUUndertaking->CssStyle = "";
$CCMMentors->CandUUndertaking->CssClass = "";
$CCMMentors->CandUUndertaking->ViewCustomAttributes = "";
// WebUsername
$CCMMentors->WebUsername->ViewValue = $CCMMentors->WebUsername->CurrentValue;
$CCMMentors->WebUsername->CssStyle = "";
$CCMMentors->WebUsername->CssClass = "";
$CCMMentors->WebUsername->ViewCustomAttributes = "";
// WebPassword
$CCMMentors->WebPassword->ViewValue = $CCMMentors->WebPassword->CurrentValue;
$CCMMentors->WebPassword->CssStyle = "";
$CCMMentors->WebPassword->CssClass = "";
$CCMMentors->WebPassword->ViewCustomAttributes = "";
// BlockAccess
if (strval($CCMMentors->BlockAccess->CurrentValue) <> "") {
switch ($CCMMentors->BlockAccess->CurrentValue) {
case "y":
$CCMMentors->BlockAccess->ViewValue = "Yes";
break;
case "n":
$CCMMentors->BlockAccess->ViewValue = "No";
break;
default:
$CCMMentors->BlockAccess->ViewValue = $CCMMentors->BlockAccess->CurrentValue;
}
} else {
$CCMMentors->BlockAccess->ViewValue = NULL;
}
$CCMMentors->BlockAccess->CssStyle = "";
$CCMMentors->BlockAccess->CssClass = "";
$CCMMentors->BlockAccess->ViewCustomAttributes = "";
// Archived
if (strval($CCMMentors->Archived->CurrentValue) <> "") {
switch ($CCMMentors->Archived->CurrentValue) {
case "1":
$CCMMentors->Archived->ViewValue = "Yes";
break;
case "0":
$CCMMentors->Archived->ViewValue = "No";
break;
default:
$CCMMentors->Archived->ViewValue = $CCMMentors->Archived->CurrentValue;
}
} else {
$CCMMentors->Archived->ViewValue = NULL;
}
$CCMMentors->Archived->CssStyle = "";
$CCMMentors->Archived->CssClass = "";
$CCMMentors->Archived->ViewCustomAttributes = "";
// Designation
$CCMMentors->Designation->ViewValue = $CCMMentors->Designation->CurrentValue;
$CCMMentors->Designation->CssStyle = "";
$CCMMentors->Designation->CssClass = "";
$CCMMentors->Designation->ViewCustomAttributes = "";
// Prof Reg No
$CCMMentors->Prof_Reg_No->ViewValue = $CCMMentors->Prof_Reg_No->CurrentValue;
$CCMMentors->Prof_Reg_No->CssStyle = "";
$CCMMentors->Prof_Reg_No->CssClass = "";
$CCMMentors->Prof_Reg_No->ViewCustomAttributes = "";
// Reg No
$CCMMentors->Reg_No->ViewValue = $CCMMentors->Reg_No->CurrentValue;
$CCMMentors->Reg_No->CssStyle = "";
$CCMMentors->Reg_No->CssClass = "";
$CCMMentors->Reg_No->ViewCustomAttributes = "";
// Organisation
$CCMMentors->Organisation->HrefValue = "";
$CCMMentors->Organisation->TooltipValue = "";
// FirstName
$CCMMentors->FirstName->HrefValue = "";
$CCMMentors->FirstName->TooltipValue = "";
// Surname
$CCMMentors->Surname->HrefValue = "";
$CCMMentors->Surname->TooltipValue = "";
// Telephone
$CCMMentors->Telephone->HrefValue = "";
$CCMMentors->Telephone->TooltipValue = "";
// Cellphone
$CCMMentors->Cellphone->HrefValue = "";
$CCMMentors->Cellphone->TooltipValue = "";
// EmailAddress
$CCMMentors->EmailAddress->HrefValue = "";
$CCMMentors->EmailAddress->TooltipValue = "";
// Designation
$CCMMentors->Designation->HrefValue = "";
$CCMMentors->Designation->TooltipValue = "";
// Prof Reg No
$CCMMentors->Prof_Reg_No->HrefValue = "";
$CCMMentors->Prof_Reg_No->TooltipValue = "";
// Reg No
$CCMMentors->Reg_No->HrefValue = "";
$CCMMentors->Reg_No->TooltipValue = "";
}
// Call Row Rendered event
if ($CCMMentors->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCMMentors->Row_Rendered();
}
// Validate search
function ValidateSearch() {
global $gsSearchError, $CCMMentors;
// Initialize
$gsSearchError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE)
return TRUE;
// Return validate result
$ValidateSearch = ($gsSearchError == "");
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateSearch = $ValidateSearch && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError <> "") {
if ($gsSearchError <> "") $gsSearchError .= "<br>";
$gsSearchError .= $sFormCustomError;
}
return $ValidateSearch;
}
// Load advanced search
function LoadAdvancedSearch() {
global $CCMMentors;
$CCMMentors->CCMMentorID->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_CCMMentorID");
$CCMMentors->Organisation->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Organisation");
$CCMMentors->Title->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Title");
$CCMMentors->FirstName->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_FirstName");
$CCMMentors->Surname->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Surname");
$CCMMentors->Initials->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Initials");
$CCMMentors->KnownAs->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_KnownAs");
$CCMMentors->IDNumber->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_IDNumber");
$CCMMentors->ProfessionalCouncil->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_ProfessionalCouncil");
$CCMMentors->CategoryReg->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_CategoryReg");
$CCMMentors->CouncilRegNumber->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_CouncilRegNumber");
$CCMMentors->Telephone->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Telephone");
$CCMMentors->Cellphone->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Cellphone");
$CCMMentors->EmailAddress->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_EmailAddress");
$CCMMentors->WorkAddress->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_WorkAddress");
$CCMMentors->PostalAddress->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_PostalAddress");
$CCMMentors->EducationalInst->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_EducationalInst");
$CCMMentors->Qualifications->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Qualifications");
$CCMMentors->CVFile->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_CVFile");
$CCMMentors->MentorUndertaking->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_MentorUndertaking");
$CCMMentors->CandUUndertaking->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_CandUUndertaking");
$CCMMentors->WebUsername->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_WebUsername");
$CCMMentors->WebPassword->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_WebPassword");
$CCMMentors->BlockAccess->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_BlockAccess");
$CCMMentors->Archived->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Archived");
$CCMMentors->Designation->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Designation");
$CCMMentors->Prof_Reg_No->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Prof_Reg_No");
$CCMMentors->Reg_No->AdvancedSearch->SearchValue = $CCMMentors->getAdvancedSearch("x_Reg_No");
}
// Export data in HTML/CSV/Word/Excel/XML/Email format
function ExportData() {
global $CCMMentors;
$utf8 = FALSE;
$bSelectLimit = EW_SELECT_LIMIT;
// Load recordset
if ($bSelectLimit) {
$this->lTotalRecs = $CCMMentors->SelectRecordCount();
} else {
if ($rs = $this->LoadRecordset())
$this->lTotalRecs = $rs->RecordCount();
}
$this->lStartRec = 1;
// Export all
if ($CCMMentors->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 ($CCMMentors->Export == "xml") {
$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
$XmlDoc->AddRoot();
} else {
$ExportDoc = new cExportDocument($CCMMentors, "h");
$ExportDoc->ExportHeader();
if ($ExportDoc->Horizontal) { // Horizontal format, write header
$ExportDoc->BeginExportRow();
$ExportDoc->ExportCaption($CCMMentors->CCMMentorID);
$ExportDoc->ExportCaption($CCMMentors->Organisation);
$ExportDoc->ExportCaption($CCMMentors->Title);
$ExportDoc->ExportCaption($CCMMentors->FirstName);
$ExportDoc->ExportCaption($CCMMentors->Surname);
$ExportDoc->ExportCaption($CCMMentors->Initials);
$ExportDoc->ExportCaption($CCMMentors->KnownAs);
$ExportDoc->ExportCaption($CCMMentors->IDNumber);
$ExportDoc->ExportCaption($CCMMentors->ProfessionalCouncil);
$ExportDoc->ExportCaption($CCMMentors->CategoryReg);
$ExportDoc->ExportCaption($CCMMentors->CouncilRegNumber);
$ExportDoc->ExportCaption($CCMMentors->Telephone);
$ExportDoc->ExportCaption($CCMMentors->Cellphone);
$ExportDoc->ExportCaption($CCMMentors->EmailAddress);
$ExportDoc->ExportCaption($CCMMentors->WorkAddress);
$ExportDoc->ExportCaption($CCMMentors->PostalAddress);
$ExportDoc->ExportCaption($CCMMentors->CandUUndertaking);
$ExportDoc->ExportCaption($CCMMentors->WebUsername);
$ExportDoc->ExportCaption($CCMMentors->WebPassword);
$ExportDoc->ExportCaption($CCMMentors->BlockAccess);
$ExportDoc->ExportCaption($CCMMentors->Archived);
$ExportDoc->ExportCaption($CCMMentors->Designation);
$ExportDoc->ExportCaption($CCMMentors->Prof_Reg_No);
$ExportDoc->ExportCaption($CCMMentors->Reg_No);
$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
$CCMMentors->CssClass = "";
$CCMMentors->CssStyle = "";
$CCMMentors->RowType = EW_ROWTYPE_VIEW; // Render view
$this->RenderRow();
if ($CCMMentors->Export == "xml") {
$XmlDoc->AddRow();
$XmlDoc->AddField('CCMMentorID', $CCMMentors->CCMMentorID->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Organisation', $CCMMentors->Organisation->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Title', $CCMMentors->Title->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('FirstName', $CCMMentors->FirstName->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Surname', $CCMMentors->Surname->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Initials', $CCMMentors->Initials->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('KnownAs', $CCMMentors->KnownAs->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('IDNumber', $CCMMentors->IDNumber->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('ProfessionalCouncil', $CCMMentors->ProfessionalCouncil->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('CategoryReg', $CCMMentors->CategoryReg->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('CouncilRegNumber', $CCMMentors->CouncilRegNumber->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Telephone', $CCMMentors->Telephone->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Cellphone', $CCMMentors->Cellphone->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('EmailAddress', $CCMMentors->EmailAddress->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('WorkAddress', $CCMMentors->WorkAddress->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('PostalAddress', $CCMMentors->PostalAddress->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('CandUUndertaking', $CCMMentors->CandUUndertaking->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('WebUsername', $CCMMentors->WebUsername->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('WebPassword', $CCMMentors->WebPassword->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('BlockAccess', $CCMMentors->BlockAccess->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Archived', $CCMMentors->Archived->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Designation', $CCMMentors->Designation->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Prof_Reg_No', $CCMMentors->Prof_Reg_No->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
$XmlDoc->AddField('Reg_No', $CCMMentors->Reg_No->ExportValue($CCMMentors->Export, $CCMMentors->ExportOriginalValue));
} else {
$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
$ExportDoc->ExportField($CCMMentors->CCMMentorID);
$ExportDoc->ExportField($CCMMentors->Organisation);
$ExportDoc->ExportField($CCMMentors->Title);
$ExportDoc->ExportField($CCMMentors->FirstName);
$ExportDoc->ExportField($CCMMentors->Surname);
$ExportDoc->ExportField($CCMMentors->Initials);
$ExportDoc->ExportField($CCMMentors->KnownAs);
$ExportDoc->ExportField($CCMMentors->IDNumber);
$ExportDoc->ExportField($CCMMentors->ProfessionalCouncil);
$ExportDoc->ExportField($CCMMentors->CategoryReg);
$ExportDoc->ExportField($CCMMentors->CouncilRegNumber);
$ExportDoc->ExportField($CCMMentors->Telephone);
$ExportDoc->ExportField($CCMMentors->Cellphone);
$ExportDoc->ExportField($CCMMentors->EmailAddress);
$ExportDoc->ExportField($CCMMentors->WorkAddress);
$ExportDoc->ExportField($CCMMentors->PostalAddress);
$ExportDoc->ExportField($CCMMentors->CandUUndertaking);
$ExportDoc->ExportField($CCMMentors->WebUsername);
$ExportDoc->ExportField($CCMMentors->WebPassword);
$ExportDoc->ExportField($CCMMentors->BlockAccess);
$ExportDoc->ExportField($CCMMentors->Archived);
$ExportDoc->ExportField($CCMMentors->Designation);
$ExportDoc->ExportField($CCMMentors->Prof_Reg_No);
$ExportDoc->ExportField($CCMMentors->Reg_No);
$ExportDoc->EndExportRow();
}
}
$rs->MoveNext();
}
if ($CCMMentors->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($CCMMentors->Export, array("email", "xml")))
echo "\xEF\xBB\xBF";
// Write debug message if enabled
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
// Output data
if ($CCMMentors->Export == "xml") {
header("Content-Type: text/xml");
echo $XmlDoc->XML();
} elseif ($CCMMentors->Export == "email") {
$this->ExportEmail($ExportDoc->Text);
$this->Page_Terminate($CCMMentors->ExportReturnUrl());
} else {
echo $ExportDoc->Text;
}
}
// Export email
function ExportEmail($EmailContent) {
global $Language, $CCMMentors;
$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 ($CCMMentors->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 $CCMMentors;
// Initialize
$sQry = "export=html";
// Build QueryString for search
if ($CCMMentors->getSessionBasicSearchKeyword() <> "") {
$sQry .= "&" . EW_TABLE_BASIC_SEARCH . "=" . $CCMMentors->getSessionBasicSearchKeyword() . "&" . EW_TABLE_BASIC_SEARCH_TYPE . "=" . $CCMMentors->getSessionBasicSearchType();
}
$this->AddSearchQueryString($sQry, $CCMMentors->CCMMentorID); // CCMMentorID
$this->AddSearchQueryString($sQry, $CCMMentors->Organisation); // Organisation
$this->AddSearchQueryString($sQry, $CCMMentors->Title); // Title
$this->AddSearchQueryString($sQry, $CCMMentors->FirstName); // FirstName
$this->AddSearchQueryString($sQry, $CCMMentors->Surname); // Surname
$this->AddSearchQueryString($sQry, $CCMMentors->Initials); // Initials
$this->AddSearchQueryString($sQry, $CCMMentors->KnownAs); // KnownAs
$this->AddSearchQueryString($sQry, $CCMMentors->IDNumber); // IDNumber
$this->AddSearchQueryString($sQry, $CCMMentors->ProfessionalCouncil); // ProfessionalCouncil
$this->AddSearchQueryString($sQry, $CCMMentors->CategoryReg); // CategoryReg
$this->AddSearchQueryString($sQry, $CCMMentors->CouncilRegNumber); // CouncilRegNumber
$this->AddSearchQueryString($sQry, $CCMMentors->Telephone); // Telephone
$this->AddSearchQueryString($sQry, $CCMMentors->Cellphone); // Cellphone
$this->AddSearchQueryString($sQry, $CCMMentors->EmailAddress); // EmailAddress
$this->AddSearchQueryString($sQry, $CCMMentors->WorkAddress); // WorkAddress
$this->AddSearchQueryString($sQry, $CCMMentors->PostalAddress); // PostalAddress
$this->AddSearchQueryString($sQry, $CCMMentors->EducationalInst); // EducationalInst
$this->AddSearchQueryString($sQry, $CCMMentors->Qualifications); // Qualifications
$this->AddSearchQueryString($sQry, $CCMMentors->CVFile); // CVFile
$this->AddSearchQueryString($sQry, $CCMMentors->MentorUndertaking); // MentorUndertaking
$this->AddSearchQueryString($sQry, $CCMMentors->CandUUndertaking); // CandUUndertaking
$this->AddSearchQueryString($sQry, $CCMMentors->WebUsername); // WebUsername
$this->AddSearchQueryString($sQry, $CCMMentors->WebPassword); // WebPassword
$this->AddSearchQueryString($sQry, $CCMMentors->BlockAccess); // BlockAccess
$this->AddSearchQueryString($sQry, $CCMMentors->Archived); // Archived
$this->AddSearchQueryString($sQry, $CCMMentors->Designation); // Designation
$this->AddSearchQueryString($sQry, $CCMMentors->Prof_Reg_No); // Prof Reg No
$this->AddSearchQueryString($sQry, $CCMMentors->Reg_No); // Reg No
// Build QueryString for pager
$sQry .= "&" . EW_TABLE_REC_PER_PAGE . "=" . $CCMMentors->getRecordsPerPage() . "&" . EW_TABLE_START_REC . "=" . $CCMMentors->getStartRecordNumber();
return $sQry;
}
// Add search QueryString
function AddSearchQueryString(&$Qry, &$Fld) {
global $CCMMentors;
$FldParm = substr($Fld->FldVar, 2);
$FldSearchValue = $CCMMentors->GetAdvancedSearch("x_" . $FldParm);
if (strval($FldSearchValue) <> "") {
$Qry .= "&x_" . $FldParm . "=" . FldSearchValue .
"&z_" . $FldParm . "=" . $CCMMentors->GetAdvancedSearch("z_" . $FldParm);
}
$FldSearchValue2 = $CCMMentors->GetAdvancedSearch("y_" . $FldParm);
if (strval($FldSearchValue2) <> "") {
$Qry .= "&v_" . $FldParm . "=" . $CCMMentors->GetAdvancedSearch("v_" . $FldParm) .
"&y_" . $FldParm . "=" . $FldSearchValue2 .
"&w_" . $FldParm . "=" . $CCMMentors->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";
}
}
?>