Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/ccmadmin/
Upload File :
Current File : /var/www/cesa.co.za/ccmadmin/CCMEmployersview.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 "CCMEmployersinfo.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
$CCMEmployers_view = new cCCMEmployers_view();
$Page =& $CCMEmployers_view;

// Page init
$CCMEmployers_view->Page_Init();

// Page main
$CCMEmployers_view->Page_Main();
?>
<?php include "header.php" ?>
<?php if ($CCMEmployers->Export == "") { ?>
<script type="text/javascript">
<!--

// Create page object
var CCMEmployers_view = new ew_Page("CCMEmployers_view");

// page properties
CCMEmployers_view.PageID = "view"; // page ID
CCMEmployers_view.FormID = "fCCMEmployersview"; // form ID
var EW_PAGE_ID = CCMEmployers_view.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
CCMEmployers_view.Form_CustomValidate =  
 function(fobj) { // DO NOT CHANGE THIS LINE!

 	// Your custom validation code here, return false if invalid. 
 	return true;
 }
<?php if (EW_CLIENT_VALIDATE) { ?>
CCMEmployers_view.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMEmployers_view.ValidateRequired = false; // no JavaScript validation
<?php } ?>

//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--

// Write your client script here, no need to add script tags.
// To include another .js script, use:
// ew_ClientScriptInclude("my_javascript.js"); 
//-->

</script>
<?php } ?>
<p><span class="phpmaker"><?php echo $Language->Phrase("View") ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCMEmployers->TableCaption() ?>
<?php if ($CCMEmployers->Export == "") { ?>
&nbsp;&nbsp;<a href="<?php echo $CCMEmployers_view->ExportPrintUrl ?>"><img src="images/print.gif" alt="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" title="<?php echo ew_HtmlEncode($Language->Phrase("PrinterFriendly")) ?>" width="16" height="16" border="0"></a>
&nbsp;&nbsp;<a href="<?php echo $CCMEmployers_view->ExportExcelUrl ?>"><img src='images/exportxls.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToExcel")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a href="<?php echo $CCMEmployers_view->ExportWordUrl ?>"><img src='images/exportdoc.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToWord")) ?>' width='16' height='16' border='0'></a>
&nbsp;&nbsp;<a name="emf_CCMEmployers" id="emf_CCMEmployers" href="javascript:void(0);" onclick="ew_EmailDialogShow({lnk:'emf_CCMEmployers',hdr:ewLanguage.Phrase('ExportToEmail'),key:<?php echo ew_ArrayToJsonAttr($CCMEmployers_view->arRecKey) ?>,sel:false});"><img src='images/exportemail.gif' alt='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' title='<?php echo ew_HtmlEncode($Language->Phrase("ExportToEmail")) ?>' width='16' height='16' border='0'></a>
<?php } ?>
<br><br>
<?php if ($CCMEmployers->Export == "") { ?>
<a href="<?php echo $CCMEmployers_view->ListUrl ?>"><?php echo $Language->Phrase("BackToList") ?></a>&nbsp;
<?php if ($Security->CanAdd()) { ?>
<a href="<?php echo $CCMEmployers_view->AddUrl ?>"><?php echo $Language->Phrase("ViewPageAddLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->CanEdit()) { ?>
<a href="<?php echo $CCMEmployers_view->EditUrl ?>"><?php echo $Language->Phrase("ViewPageEditLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->CanDelete()) { ?>
<a href="<?php echo $CCMEmployers_view->DeleteUrl ?>"><?php echo $Language->Phrase("ViewPageDeleteLink") ?></a>&nbsp;
<?php } ?>
<?php if ($Security->AllowList('CCMMilestones')) { ?>
<a href="CCMMilestoneslist.php?<?php echo EW_TABLE_SHOW_MASTER ?>=CCMEmployers&CCMEmployerID=<?php echo urlencode(strval($CCMEmployers->CCMEmployerID->CurrentValue)) ?>"><?php echo $Language->Phrase("ViewPageDetailLink") ?><?php echo $Language->TablePhrase("CCMMilestones", "TblCaption") ?>
</a>
&nbsp;
<?php } ?>
<?php } ?>
</span></p>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$CCMEmployers_view->ShowMessage();
?>
<p>
<?php if ($CCMEmployers->Export == "") { ?>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($CCMEmployers_view->Pager)) $CCMEmployers_view->Pager = new cPrevNextPager($CCMEmployers_view->lStartRec, $CCMEmployers_view->lDisplayRecs, $CCMEmployers_view->lTotalRecs) ?>
<?php if ($CCMEmployers_view->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($CCMEmployers_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($CCMEmployers_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $CCMEmployers_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCMEmployers_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($CCMEmployers_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $CCMEmployers_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($CCMEmployers_view->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
	</tr>
</table>
</form>
<br>
<?php } ?>
<table cellspacing="0" class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable">
<?php if ($CCMEmployers->Organisation->Visible) { // Organisation ?>
	<tr<?php echo $CCMEmployers->Organisation->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Organisation->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Organisation->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Organisation->ViewAttributes() ?>><?php echo $CCMEmployers->Organisation->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Title->Visible) { // Title ?>
	<tr<?php echo $CCMEmployers->Title->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Title->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Title->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Title->ViewAttributes() ?>><?php echo $CCMEmployers->Title->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->FirstName->Visible) { // FirstName ?>
	<tr<?php echo $CCMEmployers->FirstName->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->FirstName->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->FirstName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->FirstName->ViewAttributes() ?>><?php echo $CCMEmployers->FirstName->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Surname->Visible) { // Surname ?>
	<tr<?php echo $CCMEmployers->Surname->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Surname->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Surname->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Surname->ViewAttributes() ?>><?php echo $CCMEmployers->Surname->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Initials->Visible) { // Initials ?>
	<tr<?php echo $CCMEmployers->Initials->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Initials->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Initials->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Initials->ViewAttributes() ?>><?php echo $CCMEmployers->Initials->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->KnownAs->Visible) { // KnownAs ?>
	<tr<?php echo $CCMEmployers->KnownAs->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->KnownAs->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->KnownAs->CellAttributes() ?>>
<div<?php echo $CCMEmployers->KnownAs->ViewAttributes() ?>><?php echo $CCMEmployers->KnownAs->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->IDNumber->Visible) { // IDNumber ?>
	<tr<?php echo $CCMEmployers->IDNumber->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->IDNumber->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->IDNumber->CellAttributes() ?>>
<div<?php echo $CCMEmployers->IDNumber->ViewAttributes() ?>><?php echo $CCMEmployers->IDNumber->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Telephone->Visible) { // Telephone ?>
	<tr<?php echo $CCMEmployers->Telephone->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Telephone->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Telephone->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Telephone->ViewAttributes() ?>><?php echo $CCMEmployers->Telephone->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Cellphone->Visible) { // Cellphone ?>
	<tr<?php echo $CCMEmployers->Cellphone->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Cellphone->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Cellphone->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Cellphone->ViewAttributes() ?>><?php echo $CCMEmployers->Cellphone->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->EmailAddress->Visible) { // EmailAddress ?>
	<tr<?php echo $CCMEmployers->EmailAddress->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->EmailAddress->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->EmailAddress->CellAttributes() ?>>
<div<?php echo $CCMEmployers->EmailAddress->ViewAttributes() ?>><?php echo $CCMEmployers->EmailAddress->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->WorkAddress->Visible) { // WorkAddress ?>
	<tr<?php echo $CCMEmployers->WorkAddress->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->WorkAddress->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->WorkAddress->CellAttributes() ?>>
<div<?php echo $CCMEmployers->WorkAddress->ViewAttributes() ?>><?php echo $CCMEmployers->WorkAddress->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->PostalAddress->Visible) { // PostalAddress ?>
	<tr<?php echo $CCMEmployers->PostalAddress->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->PostalAddress->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->PostalAddress->CellAttributes() ?>>
<div<?php echo $CCMEmployers->PostalAddress->ViewAttributes() ?>><?php echo $CCMEmployers->PostalAddress->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->CandUUndertaking->Visible) { // CandUUndertaking ?>
	<tr<?php echo $CCMEmployers->CandUUndertaking->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->CandUUndertaking->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->CandUUndertaking->CellAttributes() ?>>
<div<?php echo $CCMEmployers->CandUUndertaking->ViewAttributes() ?>><?php echo $CCMEmployers->CandUUndertaking->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->WebUsername->Visible) { // WebUsername ?>
	<tr<?php echo $CCMEmployers->WebUsername->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->WebUsername->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->WebUsername->CellAttributes() ?>>
<div<?php echo $CCMEmployers->WebUsername->ViewAttributes() ?>><?php echo $CCMEmployers->WebUsername->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->WebPassword->Visible) { // WebPassword ?>
	<tr<?php echo $CCMEmployers->WebPassword->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->WebPassword->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->WebPassword->CellAttributes() ?>>
<div<?php echo $CCMEmployers->WebPassword->ViewAttributes() ?>><?php echo $CCMEmployers->WebPassword->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->BlockAccess->Visible) { // BlockAccess ?>
	<tr<?php echo $CCMEmployers->BlockAccess->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->BlockAccess->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->BlockAccess->CellAttributes() ?>>
<div<?php echo $CCMEmployers->BlockAccess->ViewAttributes() ?>><?php echo $CCMEmployers->BlockAccess->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->Archived->Visible) { // Archived ?>
	<tr<?php echo $CCMEmployers->Archived->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->Archived->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->Archived->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Archived->ViewAttributes() ?>><?php echo $CCMEmployers->Archived->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->AccountName->Visible) { // AccountName ?>
	<tr<?php echo $CCMEmployers->AccountName->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->AccountName->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->AccountName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->AccountName->ViewAttributes() ?>><?php echo $CCMEmployers->AccountName->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->BankName->Visible) { // BankName ?>
	<tr<?php echo $CCMEmployers->BankName->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->BankName->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->BankName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->BankName->ViewAttributes() ?>><?php echo $CCMEmployers->BankName->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->BranchName->Visible) { // BranchName ?>
	<tr<?php echo $CCMEmployers->BranchName->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->BranchName->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->BranchName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->BranchName->ViewAttributes() ?>><?php echo $CCMEmployers->BranchName->ViewValue ?></div></td>
	</tr>
<?php } ?>
<?php if ($CCMEmployers->AccountNum->Visible) { // AccountNum ?>
	<tr<?php echo $CCMEmployers->AccountNum->RowAttributes ?>>
		<td class="ewTableHeader"><?php echo $CCMEmployers->AccountNum->FldCaption() ?></td>
		<td<?php echo $CCMEmployers->AccountNum->CellAttributes() ?>>
<div<?php echo $CCMEmployers->AccountNum->ViewAttributes() ?>><?php echo $CCMEmployers->AccountNum->ViewValue ?></div></td>
	</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<?php if ($CCMEmployers->Export == "") { ?>
<br>
<form name="ewpagerform" id="ewpagerform" class="ewForm" action="<?php echo ew_CurrentPage() ?>">
<table border="0" cellspacing="0" cellpadding="0" class="ewPager">
	<tr>
		<td nowrap>
<?php if (!isset($CCMEmployers_view->Pager)) $CCMEmployers_view->Pager = new cPrevNextPager($CCMEmployers_view->lStartRec, $CCMEmployers_view->lDisplayRecs, $CCMEmployers_view->lTotalRecs) ?>
<?php if ($CCMEmployers_view->Pager->RecordCount > 0) { ?>
	<table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="phpmaker"><?php echo $Language->Phrase("Page") ?>&nbsp;</span></td>
<!--first page button-->
	<?php if ($CCMEmployers_view->Pager->FirstButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->FirstButton->Start ?>"><img src="images/first.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/firstdisab.gif" alt="<?php echo $Language->Phrase("PagerFirst") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--previous page button-->
	<?php if ($CCMEmployers_view->Pager->PrevButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->PrevButton->Start ?>"><img src="images/prev.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></a></td>
	<?php } else { ?>
	<td><img src="images/prevdisab.gif" alt="<?php echo $Language->Phrase("PagerPrevious") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--current page number-->
	<td><input type="text" name="<?php echo EW_TABLE_PAGE_NO ?>" id="<?php echo EW_TABLE_PAGE_NO ?>" value="<?php echo $CCMEmployers_view->Pager->CurrentPage ?>" size="4"></td>
<!--next page button-->
	<?php if ($CCMEmployers_view->Pager->NextButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->NextButton->Start ?>"><img src="images/next.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/nextdisab.gif" alt="<?php echo $Language->Phrase("PagerNext") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
<!--last page button-->
	<?php if ($CCMEmployers_view->Pager->LastButton->Enabled) { ?>
	<td><a href="<?php echo $CCMEmployers_view->PageUrl() ?>start=<?php echo $CCMEmployers_view->Pager->LastButton->Start ?>"><img src="images/last.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></a></td>	
	<?php } else { ?>
	<td><img src="images/lastdisab.gif" alt="<?php echo $Language->Phrase("PagerLast") ?>" width="16" height="16" border="0"></td>
	<?php } ?>
	<td><span class="phpmaker">&nbsp;<?php echo $Language->Phrase("of") ?>&nbsp;<?php echo $CCMEmployers_view->Pager->PageCount ?></span></td>
	</tr></table>
<?php } else { ?>
	<?php if ($Security->CanList()) { ?>
	<?php if ($CCMEmployers_view->sSrchWhere == "0=101") { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("EnterSearchCriteria") ?></span>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoRecord") ?></span>
	<?php } ?>
	<?php } else { ?>
	<span class="phpmaker"><?php echo $Language->Phrase("NoPermission") ?></span>
	<?php } ?>
<?php } ?>
		</td>
	</tr>
</table>
</form>
<?php } ?>
<p>
<?php if ($CCMEmployers->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
$CCMEmployers_view->Page_Terminate();
?>
<?php

//
// Page class
//
class cCCMEmployers_view {

	// Page ID
	var $PageID = 'view';

	// Table name
	var $TableName = 'CCMEmployers';

	// Page object name
	var $PageObjName = 'CCMEmployers_view';

	// Page name
	function PageName() {
		return ew_CurrentPage();
	}

	// Page URL
	function PageUrl() {
		$PageUrl = ew_CurrentPage() . "?";
		global $CCMEmployers;
		if ($CCMEmployers->UseTokenInUrl) $PageUrl .= "t=" . $CCMEmployers->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, $CCMEmployers;
		if ($CCMEmployers->UseTokenInUrl) {
			if ($objForm)
				return ($CCMEmployers->TableVar == $objForm->GetValue("t"));
			if (@$_GET["t"] <> "")
				return ($CCMEmployers->TableVar == $_GET["t"]);
		} else {
			return TRUE;
		}
	}

	//
	// Page class constructor
	//
	function cCCMEmployers_view() {
		global $conn, $Language;

		// Language object
		$Language = new cLanguage();

		// Table object (CCMEmployers)
		$GLOBALS["CCMEmployers"] = new cCCMEmployers();

		// Table object (CCMUsers)
		$GLOBALS['CCMUsers'] = new cCCMUsers();

		// Page ID
		if (!defined("EW_PAGE_ID"))
			define("EW_PAGE_ID", 'view', TRUE);

		// Table name (for backward compatibility)
		if (!defined("EW_TABLE_NAME"))
			define("EW_TABLE_NAME", 'CCMEmployers', TRUE);

		// Start timer
		$GLOBALS["gsTimer"] = new cTimer();

		// Open connection
		$conn = ew_Connect();
	}

	// 
	//  Page_Init
	//
	function Page_Init() {
		global $gsExport, $gsExportFile, $UserProfile, $Language, $Security, $objForm;
		global $CCMEmployers;

		// 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->CanView()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("CCMEmployerslist.php");
		}

		// Get export parameters
		if (@$_GET["export"] <> "") {
			$CCMEmployers->Export = $_GET["export"];
		} elseif (ew_IsHttpPost()) {
			if (@$_POST["exporttype"] <> "")
				$CCMEmployers->Export = $_POST["exporttype"];
		} else {
			$CCMEmployers->setExportReturnUrl(ew_CurrentUrl());
		}
		$gsExport = $CCMEmployers->Export; // Get export parameter, used in header
		$gsExportFile = $CCMEmployers->TableVar; // Get export file, used in header
		if (@$_GET["CCMEmployerID"] <> "") {
			if ($gsExportFile <> "") $gsExportFile .= "_";
			$gsExportFile .= ew_StripSlashes($_GET["CCMEmployerID"]);
		}
		if ($CCMEmployers->Export == "excel") {
			header('Content-Type: application/vnd.ms-excel');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.xls');
		}
		if ($CCMEmployers->Export == "word") {
			header('Content-Type: application/vnd.ms-word');
			header('Content-Disposition: attachment; filename=' . $gsExportFile .'.doc');
		}

		// Global Page Loading event (in userfn*.php)
		Page_Loading();

		// Page Load event
		$this->Page_Load();
	}

	//
	// Page_Terminate
	//
	function Page_Terminate($url = "") {
		global $conn;

		// Page Unload event
		$this->Page_Unload();

		// Global Page Unloaded event (in userfn*.php)
		Page_Unloaded();

		 // Close connection
		$conn->Close();

		// Go to URL if specified
		$this->Page_Redirecting($url);
		if ($url <> "") {
			if (!EW_DEBUG_ENABLED && ob_get_length())
				ob_end_clean();
			header("Location: " . $url);
		}
		exit();
	}
	var $lDisplayRecs = 1;
	var $lStartRec;
	var $lStopRec;
	var $lTotalRecs = 0;
	var $lRecRange = 10;
	var $lRecCnt;
	var $arRecKey = array();

	//
	// Page main
	//
	function Page_Main() {
		global $Language, $CCMEmployers;

		// Load current record
		$bLoadCurrentRecord = FALSE;
		$sReturnUrl = "";
		$bMatchRecord = FALSE;
		if ($this->IsPageRequest()) { // Validate request
			if (@$_GET["CCMEmployerID"] <> "") {
				$CCMEmployers->CCMEmployerID->setQueryStringValue($_GET["CCMEmployerID"]);
				$this->arRecKey["CCMEmployerID"] = $CCMEmployers->CCMEmployerID->QueryStringValue;
			} else {
				$bLoadCurrentRecord = TRUE;
			}

			// Get action
			$CCMEmployers->CurrentAction = "I"; // Display form
			switch ($CCMEmployers->CurrentAction) {
				case "I": // Get a record to display
					$this->lStartRec = 1; // Initialize start position
					if ($rs = $this->LoadRecordset()) // Load records
						$this->lTotalRecs = $rs->RecordCount(); // Get record count
					if ($this->lTotalRecs <= 0) { // No record found
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$this->Page_Terminate("CCMEmployerslist.php"); // Return to list page
					} elseif ($bLoadCurrentRecord) { // Load current record position
						$this->SetUpStartRec(); // Set up start record position

						// Point to current record
						if (intval($this->lStartRec) <= intval($this->lTotalRecs)) {
							$bMatchRecord = TRUE;
							$rs->Move($this->lStartRec-1);
						}
					} else { // Match key values
						while (!$rs->EOF) {
							if (strval($CCMEmployers->CCMEmployerID->CurrentValue) == strval($rs->fields('CCMEmployerID'))) {
								$CCMEmployers->setStartRecordNumber($this->lStartRec); // Save record position
								$bMatchRecord = TRUE;
								break;
							} else {
								$this->lStartRec++;
								$rs->MoveNext();
							}
						}
					}
					if (!$bMatchRecord) {
						$this->setMessage($Language->Phrase("NoRecord")); // Set no record message
						$sReturnUrl = "CCMEmployerslist.php"; // No matching record, return to list
					} else {
						$this->LoadRowValues($rs); // Load row values
					}
			}

			// Export data only
			if (in_array($CCMEmployers->Export, array("html","word","excel","xml","csv","email"))) {
				$this->ExportData();
				if ($CCMEmployers->Export <> "email")
					$this->Page_Terminate(); // Terminate response
				exit();
			}
		} else {
			$sReturnUrl = "CCMEmployerslist.php"; // Not page request, return to list
		}
		if ($sReturnUrl <> "")
			$this->Page_Terminate($sReturnUrl);

		// Render row
		$CCMEmployers->RowType = EW_ROWTYPE_VIEW;
		$this->RenderRow();
	}

	// Set up starting record parameters
	function SetUpStartRec() {
		global $CCMEmployers;
		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];
				$CCMEmployers->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;
					}
					$CCMEmployers->setStartRecordNumber($this->lStartRec);
				}
			}
		}
		$this->lStartRec = $CCMEmployers->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
			$CCMEmployers->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
			$CCMEmployers->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
			$CCMEmployers->setStartRecordNumber($this->lStartRec);
		}
	}

	// Load recordset
	function LoadRecordset($offset = -1, $rowcnt = -1) {
		global $conn, $CCMEmployers;

		// Call Recordset Selecting event
		$CCMEmployers->Recordset_Selecting($CCMEmployers->CurrentFilter);

		// Load List page SQL
		$sSql = $CCMEmployers->SelectSQL();
		if ($offset > -1 && $rowcnt > -1)
			$sSql .= " LIMIT $offset, $rowcnt";

		// Load recordset
		$rs = ew_LoadRecordset($sSql);

		// Call Recordset Selected event
		$CCMEmployers->Recordset_Selected($rs);
		return $rs;
	}

	// Load row based on key values
	function LoadRow() {
		global $conn, $Security, $CCMEmployers;
		$sFilter = $CCMEmployers->KeyFilter();

		// Call Row Selecting event
		$CCMEmployers->Row_Selecting($sFilter);

		// Load SQL based on filter
		$CCMEmployers->CurrentFilter = $sFilter;
		$sSql = $CCMEmployers->SQL();
		$res = FALSE;
		$rs = ew_LoadRecordset($sSql);
		if ($rs && !$rs->EOF) {
			$res = TRUE;
			$this->LoadRowValues($rs); // Load row values

			// Call Row Selected event
			$CCMEmployers->Row_Selected($rs);
			$rs->Close();
		}
		return $res;
	}

	// Load row values from recordset
	function LoadRowValues(&$rs) {
		global $conn, $CCMEmployers;
		$CCMEmployers->CCMEmployerID->setDbValue($rs->fields('CCMEmployerID'));
		$CCMEmployers->Organisation->setDbValue($rs->fields('Organisation'));
		$CCMEmployers->Title->setDbValue($rs->fields('Title'));
		$CCMEmployers->FirstName->setDbValue($rs->fields('FirstName'));
		$CCMEmployers->Surname->setDbValue($rs->fields('Surname'));
		$CCMEmployers->Initials->setDbValue($rs->fields('Initials'));
		$CCMEmployers->KnownAs->setDbValue($rs->fields('KnownAs'));
		$CCMEmployers->IDNumber->setDbValue($rs->fields('IDNumber'));
		$CCMEmployers->Telephone->setDbValue($rs->fields('Telephone'));
		$CCMEmployers->Cellphone->setDbValue($rs->fields('Cellphone'));
		$CCMEmployers->EmailAddress->setDbValue($rs->fields('EmailAddress'));
		$CCMEmployers->WorkAddress->setDbValue($rs->fields('WorkAddress'));
		$CCMEmployers->PostalAddress->setDbValue($rs->fields('PostalAddress'));
		$CCMEmployers->CandUUndertaking->setDbValue($rs->fields('CandUUndertaking'));
		$CCMEmployers->WebUsername->setDbValue($rs->fields('WebUsername'));
		$CCMEmployers->WebPassword->setDbValue($rs->fields('WebPassword'));
		$CCMEmployers->BlockAccess->setDbValue($rs->fields('BlockAccess'));
		$CCMEmployers->Archived->setDbValue($rs->fields('Archived'));
		$CCMEmployers->AccountName->setDbValue($rs->fields('AccountName'));
		$CCMEmployers->BankName->setDbValue($rs->fields('BankName'));
		$CCMEmployers->BranchName->setDbValue($rs->fields('BranchName'));
		$CCMEmployers->AccountNum->setDbValue($rs->fields('AccountNum'));
	}

	// Render row values based on field settings
	function RenderRow() {
		global $conn, $Security, $Language, $CCMEmployers;

		// Initialize URLs
		$this->ExportPrintUrl = $this->PageUrl() . "export=print&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->ExportHtmlUrl = $this->PageUrl() . "export=html&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->ExportExcelUrl = $this->PageUrl() . "export=excel&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->ExportWordUrl = $this->PageUrl() . "export=word&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->ExportXmlUrl = $this->PageUrl() . "export=xml&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->ExportCsvUrl = $this->PageUrl() . "export=csv&" . "CCMEmployerID=" . urlencode($CCMEmployers->CCMEmployerID->CurrentValue);
		$this->AddUrl = $CCMEmployers->AddUrl();
		$this->EditUrl = $CCMEmployers->EditUrl();
		$this->CopyUrl = $CCMEmployers->CopyUrl();
		$this->DeleteUrl = $CCMEmployers->DeleteUrl();
		$this->ListUrl = $CCMEmployers->ListUrl();

		// Call Row_Rendering event
		$CCMEmployers->Row_Rendering();

		// Common render codes for all row types
		// Organisation

		$CCMEmployers->Organisation->CellCssStyle = ""; $CCMEmployers->Organisation->CellCssClass = "";
		$CCMEmployers->Organisation->CellAttrs = array(); $CCMEmployers->Organisation->ViewAttrs = array(); $CCMEmployers->Organisation->EditAttrs = array();

		// Title
		$CCMEmployers->Title->CellCssStyle = ""; $CCMEmployers->Title->CellCssClass = "";
		$CCMEmployers->Title->CellAttrs = array(); $CCMEmployers->Title->ViewAttrs = array(); $CCMEmployers->Title->EditAttrs = array();

		// FirstName
		$CCMEmployers->FirstName->CellCssStyle = ""; $CCMEmployers->FirstName->CellCssClass = "";
		$CCMEmployers->FirstName->CellAttrs = array(); $CCMEmployers->FirstName->ViewAttrs = array(); $CCMEmployers->FirstName->EditAttrs = array();

		// Surname
		$CCMEmployers->Surname->CellCssStyle = ""; $CCMEmployers->Surname->CellCssClass = "";
		$CCMEmployers->Surname->CellAttrs = array(); $CCMEmployers->Surname->ViewAttrs = array(); $CCMEmployers->Surname->EditAttrs = array();

		// Initials
		$CCMEmployers->Initials->CellCssStyle = ""; $CCMEmployers->Initials->CellCssClass = "";
		$CCMEmployers->Initials->CellAttrs = array(); $CCMEmployers->Initials->ViewAttrs = array(); $CCMEmployers->Initials->EditAttrs = array();

		// KnownAs
		$CCMEmployers->KnownAs->CellCssStyle = ""; $CCMEmployers->KnownAs->CellCssClass = "";
		$CCMEmployers->KnownAs->CellAttrs = array(); $CCMEmployers->KnownAs->ViewAttrs = array(); $CCMEmployers->KnownAs->EditAttrs = array();

		// IDNumber
		$CCMEmployers->IDNumber->CellCssStyle = ""; $CCMEmployers->IDNumber->CellCssClass = "";
		$CCMEmployers->IDNumber->CellAttrs = array(); $CCMEmployers->IDNumber->ViewAttrs = array(); $CCMEmployers->IDNumber->EditAttrs = array();

		// Telephone
		$CCMEmployers->Telephone->CellCssStyle = ""; $CCMEmployers->Telephone->CellCssClass = "";
		$CCMEmployers->Telephone->CellAttrs = array(); $CCMEmployers->Telephone->ViewAttrs = array(); $CCMEmployers->Telephone->EditAttrs = array();

		// Cellphone
		$CCMEmployers->Cellphone->CellCssStyle = ""; $CCMEmployers->Cellphone->CellCssClass = "";
		$CCMEmployers->Cellphone->CellAttrs = array(); $CCMEmployers->Cellphone->ViewAttrs = array(); $CCMEmployers->Cellphone->EditAttrs = array();

		// EmailAddress
		$CCMEmployers->EmailAddress->CellCssStyle = ""; $CCMEmployers->EmailAddress->CellCssClass = "";
		$CCMEmployers->EmailAddress->CellAttrs = array(); $CCMEmployers->EmailAddress->ViewAttrs = array(); $CCMEmployers->EmailAddress->EditAttrs = array();

		// WorkAddress
		$CCMEmployers->WorkAddress->CellCssStyle = ""; $CCMEmployers->WorkAddress->CellCssClass = "";
		$CCMEmployers->WorkAddress->CellAttrs = array(); $CCMEmployers->WorkAddress->ViewAttrs = array(); $CCMEmployers->WorkAddress->EditAttrs = array();

		// PostalAddress
		$CCMEmployers->PostalAddress->CellCssStyle = ""; $CCMEmployers->PostalAddress->CellCssClass = "";
		$CCMEmployers->PostalAddress->CellAttrs = array(); $CCMEmployers->PostalAddress->ViewAttrs = array(); $CCMEmployers->PostalAddress->EditAttrs = array();

		// CandUUndertaking
		$CCMEmployers->CandUUndertaking->CellCssStyle = ""; $CCMEmployers->CandUUndertaking->CellCssClass = "";
		$CCMEmployers->CandUUndertaking->CellAttrs = array(); $CCMEmployers->CandUUndertaking->ViewAttrs = array(); $CCMEmployers->CandUUndertaking->EditAttrs = array();

		// WebUsername
		$CCMEmployers->WebUsername->CellCssStyle = ""; $CCMEmployers->WebUsername->CellCssClass = "";
		$CCMEmployers->WebUsername->CellAttrs = array(); $CCMEmployers->WebUsername->ViewAttrs = array(); $CCMEmployers->WebUsername->EditAttrs = array();

		// WebPassword
		$CCMEmployers->WebPassword->CellCssStyle = ""; $CCMEmployers->WebPassword->CellCssClass = "";
		$CCMEmployers->WebPassword->CellAttrs = array(); $CCMEmployers->WebPassword->ViewAttrs = array(); $CCMEmployers->WebPassword->EditAttrs = array();

		// BlockAccess
		$CCMEmployers->BlockAccess->CellCssStyle = ""; $CCMEmployers->BlockAccess->CellCssClass = "";
		$CCMEmployers->BlockAccess->CellAttrs = array(); $CCMEmployers->BlockAccess->ViewAttrs = array(); $CCMEmployers->BlockAccess->EditAttrs = array();

		// Archived
		$CCMEmployers->Archived->CellCssStyle = ""; $CCMEmployers->Archived->CellCssClass = "";
		$CCMEmployers->Archived->CellAttrs = array(); $CCMEmployers->Archived->ViewAttrs = array(); $CCMEmployers->Archived->EditAttrs = array();

		// AccountName
		$CCMEmployers->AccountName->CellCssStyle = ""; $CCMEmployers->AccountName->CellCssClass = "";
		$CCMEmployers->AccountName->CellAttrs = array(); $CCMEmployers->AccountName->ViewAttrs = array(); $CCMEmployers->AccountName->EditAttrs = array();

		// BankName
		$CCMEmployers->BankName->CellCssStyle = ""; $CCMEmployers->BankName->CellCssClass = "";
		$CCMEmployers->BankName->CellAttrs = array(); $CCMEmployers->BankName->ViewAttrs = array(); $CCMEmployers->BankName->EditAttrs = array();

		// BranchName
		$CCMEmployers->BranchName->CellCssStyle = ""; $CCMEmployers->BranchName->CellCssClass = "";
		$CCMEmployers->BranchName->CellAttrs = array(); $CCMEmployers->BranchName->ViewAttrs = array(); $CCMEmployers->BranchName->EditAttrs = array();

		// AccountNum
		$CCMEmployers->AccountNum->CellCssStyle = ""; $CCMEmployers->AccountNum->CellCssClass = "";
		$CCMEmployers->AccountNum->CellAttrs = array(); $CCMEmployers->AccountNum->ViewAttrs = array(); $CCMEmployers->AccountNum->EditAttrs = array();
		if ($CCMEmployers->RowType == EW_ROWTYPE_VIEW) { // View row

			// CCMEmployerID
			$CCMEmployers->CCMEmployerID->ViewValue = $CCMEmployers->CCMEmployerID->CurrentValue;
			$CCMEmployers->CCMEmployerID->CssStyle = "";
			$CCMEmployers->CCMEmployerID->CssClass = "";
			$CCMEmployers->CCMEmployerID->ViewCustomAttributes = "";

			// Organisation
			$CCMEmployers->Organisation->ViewValue = $CCMEmployers->Organisation->CurrentValue;
			$CCMEmployers->Organisation->CssStyle = "";
			$CCMEmployers->Organisation->CssClass = "";
			$CCMEmployers->Organisation->ViewCustomAttributes = "";

			// Title
			$CCMEmployers->Title->ViewValue = $CCMEmployers->Title->CurrentValue;
			$CCMEmployers->Title->CssStyle = "";
			$CCMEmployers->Title->CssClass = "";
			$CCMEmployers->Title->ViewCustomAttributes = "";

			// FirstName
			$CCMEmployers->FirstName->ViewValue = $CCMEmployers->FirstName->CurrentValue;
			$CCMEmployers->FirstName->CssStyle = "";
			$CCMEmployers->FirstName->CssClass = "";
			$CCMEmployers->FirstName->ViewCustomAttributes = "";

			// Surname
			$CCMEmployers->Surname->ViewValue = $CCMEmployers->Surname->CurrentValue;
			$CCMEmployers->Surname->CssStyle = "";
			$CCMEmployers->Surname->CssClass = "";
			$CCMEmployers->Surname->ViewCustomAttributes = "";

			// Initials
			$CCMEmployers->Initials->ViewValue = $CCMEmployers->Initials->CurrentValue;
			$CCMEmployers->Initials->CssStyle = "";
			$CCMEmployers->Initials->CssClass = "";
			$CCMEmployers->Initials->ViewCustomAttributes = "";

			// KnownAs
			$CCMEmployers->KnownAs->ViewValue = $CCMEmployers->KnownAs->CurrentValue;
			$CCMEmployers->KnownAs->CssStyle = "";
			$CCMEmployers->KnownAs->CssClass = "";
			$CCMEmployers->KnownAs->ViewCustomAttributes = "";

			// IDNumber
			$CCMEmployers->IDNumber->ViewValue = $CCMEmployers->IDNumber->CurrentValue;
			$CCMEmployers->IDNumber->CssStyle = "";
			$CCMEmployers->IDNumber->CssClass = "";
			$CCMEmployers->IDNumber->ViewCustomAttributes = "";

			// Telephone
			$CCMEmployers->Telephone->ViewValue = $CCMEmployers->Telephone->CurrentValue;
			$CCMEmployers->Telephone->CssStyle = "";
			$CCMEmployers->Telephone->CssClass = "";
			$CCMEmployers->Telephone->ViewCustomAttributes = "";

			// Cellphone
			$CCMEmployers->Cellphone->ViewValue = $CCMEmployers->Cellphone->CurrentValue;
			$CCMEmployers->Cellphone->CssStyle = "";
			$CCMEmployers->Cellphone->CssClass = "";
			$CCMEmployers->Cellphone->ViewCustomAttributes = "";

			// EmailAddress
			$CCMEmployers->EmailAddress->ViewValue = $CCMEmployers->EmailAddress->CurrentValue;
			$CCMEmployers->EmailAddress->CssStyle = "";
			$CCMEmployers->EmailAddress->CssClass = "";
			$CCMEmployers->EmailAddress->ViewCustomAttributes = "";

			// WorkAddress
			$CCMEmployers->WorkAddress->ViewValue = $CCMEmployers->WorkAddress->CurrentValue;
			$CCMEmployers->WorkAddress->CssStyle = "";
			$CCMEmployers->WorkAddress->CssClass = "";
			$CCMEmployers->WorkAddress->ViewCustomAttributes = "";

			// PostalAddress
			$CCMEmployers->PostalAddress->ViewValue = $CCMEmployers->PostalAddress->CurrentValue;
			$CCMEmployers->PostalAddress->CssStyle = "";
			$CCMEmployers->PostalAddress->CssClass = "";
			$CCMEmployers->PostalAddress->ViewCustomAttributes = "";

			// CandUUndertaking
			$CCMEmployers->CandUUndertaking->ViewValue = $CCMEmployers->CandUUndertaking->CurrentValue;
			$CCMEmployers->CandUUndertaking->CssStyle = "";
			$CCMEmployers->CandUUndertaking->CssClass = "";
			$CCMEmployers->CandUUndertaking->ViewCustomAttributes = "";

			// WebUsername
			$CCMEmployers->WebUsername->ViewValue = $CCMEmployers->WebUsername->CurrentValue;
			$CCMEmployers->WebUsername->CssStyle = "";
			$CCMEmployers->WebUsername->CssClass = "";
			$CCMEmployers->WebUsername->ViewCustomAttributes = "";

			// WebPassword
			$CCMEmployers->WebPassword->ViewValue = $CCMEmployers->WebPassword->CurrentValue;
			$CCMEmployers->WebPassword->CssStyle = "";
			$CCMEmployers->WebPassword->CssClass = "";
			$CCMEmployers->WebPassword->ViewCustomAttributes = "";

			// BlockAccess
			if (strval($CCMEmployers->BlockAccess->CurrentValue) <> "") {
				switch ($CCMEmployers->BlockAccess->CurrentValue) {
					case "y":
						$CCMEmployers->BlockAccess->ViewValue = "Yes";
						break;
					case "n":
						$CCMEmployers->BlockAccess->ViewValue = "No";
						break;
					default:
						$CCMEmployers->BlockAccess->ViewValue = $CCMEmployers->BlockAccess->CurrentValue;
				}
			} else {
				$CCMEmployers->BlockAccess->ViewValue = NULL;
			}
			$CCMEmployers->BlockAccess->CssStyle = "";
			$CCMEmployers->BlockAccess->CssClass = "";
			$CCMEmployers->BlockAccess->ViewCustomAttributes = "";

			// Archived
			if (strval($CCMEmployers->Archived->CurrentValue) <> "") {
				switch ($CCMEmployers->Archived->CurrentValue) {
					case "1":
						$CCMEmployers->Archived->ViewValue = "Yes";
						break;
					case "0":
						$CCMEmployers->Archived->ViewValue = "No";
						break;
					default:
						$CCMEmployers->Archived->ViewValue = $CCMEmployers->Archived->CurrentValue;
				}
			} else {
				$CCMEmployers->Archived->ViewValue = NULL;
			}
			$CCMEmployers->Archived->CssStyle = "";
			$CCMEmployers->Archived->CssClass = "";
			$CCMEmployers->Archived->ViewCustomAttributes = "";

			// AccountName
			$CCMEmployers->AccountName->ViewValue = $CCMEmployers->AccountName->CurrentValue;
			$CCMEmployers->AccountName->CssStyle = "";
			$CCMEmployers->AccountName->CssClass = "";
			$CCMEmployers->AccountName->ViewCustomAttributes = "";

			// BankName
			$CCMEmployers->BankName->ViewValue = $CCMEmployers->BankName->CurrentValue;
			$CCMEmployers->BankName->CssStyle = "";
			$CCMEmployers->BankName->CssClass = "";
			$CCMEmployers->BankName->ViewCustomAttributes = "";

			// BranchName
			$CCMEmployers->BranchName->ViewValue = $CCMEmployers->BranchName->CurrentValue;
			$CCMEmployers->BranchName->CssStyle = "";
			$CCMEmployers->BranchName->CssClass = "";
			$CCMEmployers->BranchName->ViewCustomAttributes = "";

			// AccountNum
			$CCMEmployers->AccountNum->ViewValue = $CCMEmployers->AccountNum->CurrentValue;
			$CCMEmployers->AccountNum->CssStyle = "";
			$CCMEmployers->AccountNum->CssClass = "";
			$CCMEmployers->AccountNum->ViewCustomAttributes = "";

			// Organisation
			$CCMEmployers->Organisation->HrefValue = "";
			$CCMEmployers->Organisation->TooltipValue = "";

			// Title
			$CCMEmployers->Title->HrefValue = "";
			$CCMEmployers->Title->TooltipValue = "";

			// FirstName
			$CCMEmployers->FirstName->HrefValue = "";
			$CCMEmployers->FirstName->TooltipValue = "";

			// Surname
			$CCMEmployers->Surname->HrefValue = "";
			$CCMEmployers->Surname->TooltipValue = "";

			// Initials
			$CCMEmployers->Initials->HrefValue = "";
			$CCMEmployers->Initials->TooltipValue = "";

			// KnownAs
			$CCMEmployers->KnownAs->HrefValue = "";
			$CCMEmployers->KnownAs->TooltipValue = "";

			// IDNumber
			$CCMEmployers->IDNumber->HrefValue = "";
			$CCMEmployers->IDNumber->TooltipValue = "";

			// Telephone
			$CCMEmployers->Telephone->HrefValue = "";
			$CCMEmployers->Telephone->TooltipValue = "";

			// Cellphone
			$CCMEmployers->Cellphone->HrefValue = "";
			$CCMEmployers->Cellphone->TooltipValue = "";

			// EmailAddress
			$CCMEmployers->EmailAddress->HrefValue = "";
			$CCMEmployers->EmailAddress->TooltipValue = "";

			// WorkAddress
			$CCMEmployers->WorkAddress->HrefValue = "";
			$CCMEmployers->WorkAddress->TooltipValue = "";

			// PostalAddress
			$CCMEmployers->PostalAddress->HrefValue = "";
			$CCMEmployers->PostalAddress->TooltipValue = "";

			// CandUUndertaking
			$CCMEmployers->CandUUndertaking->HrefValue = "";
			$CCMEmployers->CandUUndertaking->TooltipValue = "";

			// WebUsername
			$CCMEmployers->WebUsername->HrefValue = "";
			$CCMEmployers->WebUsername->TooltipValue = "";

			// WebPassword
			$CCMEmployers->WebPassword->HrefValue = "";
			$CCMEmployers->WebPassword->TooltipValue = "";

			// BlockAccess
			$CCMEmployers->BlockAccess->HrefValue = "";
			$CCMEmployers->BlockAccess->TooltipValue = "";

			// Archived
			$CCMEmployers->Archived->HrefValue = "";
			$CCMEmployers->Archived->TooltipValue = "";

			// AccountName
			$CCMEmployers->AccountName->HrefValue = "";
			$CCMEmployers->AccountName->TooltipValue = "";

			// BankName
			$CCMEmployers->BankName->HrefValue = "";
			$CCMEmployers->BankName->TooltipValue = "";

			// BranchName
			$CCMEmployers->BranchName->HrefValue = "";
			$CCMEmployers->BranchName->TooltipValue = "";

			// AccountNum
			$CCMEmployers->AccountNum->HrefValue = "";
			$CCMEmployers->AccountNum->TooltipValue = "";
		}

		// Call Row Rendered event
		if ($CCMEmployers->RowType <> EW_ROWTYPE_AGGREGATEINIT)
			$CCMEmployers->Row_Rendered();
	}

	// Export data in HTML/CSV/Word/Excel/XML/Email format
	function ExportData() {
		global $CCMEmployers;
		$utf8 = FALSE;
		$bSelectLimit = FALSE;

		// Load recordset
		if ($bSelectLimit) {
			$this->lTotalRecs = $CCMEmployers->SelectRecordCount();
		} else {
			if ($rs = $this->LoadRecordset())
				$this->lTotalRecs = $rs->RecordCount();
		}
		$this->lStartRec = 1;
		$this->SetUpStartRec(); // Set up start record position

		// Set the last record to display
		if ($this->lDisplayRecs < 0) {
			$this->lStopRec = $this->lTotalRecs;
		} else {
			$this->lStopRec = $this->lStartRec + $this->lDisplayRecs - 1;
		}
		if (!$rs) {
			header("Content-Type:"); // Remove header
			header("Content-Disposition:");
			$this->ShowMessage();
			return;
		}
		if ($CCMEmployers->Export == "xml") {
			$XmlDoc = new cXMLDocument(EW_XML_ENCODING);
			$XmlDoc->AddRoot();
		} else {
			$ExportDoc = new cExportDocument($CCMEmployers, "v");
			$ExportDoc->ExportHeader();
			if ($ExportDoc->Horizontal) { // Horizontal format, write header
				$ExportDoc->BeginExportRow();
				$ExportDoc->ExportCaption($CCMEmployers->CCMEmployerID);
				$ExportDoc->ExportCaption($CCMEmployers->Organisation);
				$ExportDoc->ExportCaption($CCMEmployers->Title);
				$ExportDoc->ExportCaption($CCMEmployers->FirstName);
				$ExportDoc->ExportCaption($CCMEmployers->Surname);
				$ExportDoc->ExportCaption($CCMEmployers->Initials);
				$ExportDoc->ExportCaption($CCMEmployers->KnownAs);
				$ExportDoc->ExportCaption($CCMEmployers->IDNumber);
				$ExportDoc->ExportCaption($CCMEmployers->Telephone);
				$ExportDoc->ExportCaption($CCMEmployers->Cellphone);
				$ExportDoc->ExportCaption($CCMEmployers->EmailAddress);
				$ExportDoc->ExportCaption($CCMEmployers->CandUUndertaking);
				$ExportDoc->ExportCaption($CCMEmployers->WebUsername);
				$ExportDoc->ExportCaption($CCMEmployers->WebPassword);
				$ExportDoc->ExportCaption($CCMEmployers->BlockAccess);
				$ExportDoc->ExportCaption($CCMEmployers->Archived);
				$ExportDoc->ExportCaption($CCMEmployers->AccountName);
				$ExportDoc->ExportCaption($CCMEmployers->BankName);
				$ExportDoc->ExportCaption($CCMEmployers->BranchName);
				$ExportDoc->ExportCaption($CCMEmployers->AccountNum);
				$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
				$CCMEmployers->CssClass = "";
				$CCMEmployers->CssStyle = "";
				$CCMEmployers->RowType = EW_ROWTYPE_VIEW; // Render view
				$this->RenderRow();
				if ($CCMEmployers->Export == "xml") {
					$XmlDoc->AddRow();
					$XmlDoc->AddField('CCMEmployerID', $CCMEmployers->CCMEmployerID->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Organisation', $CCMEmployers->Organisation->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Title', $CCMEmployers->Title->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('FirstName', $CCMEmployers->FirstName->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Surname', $CCMEmployers->Surname->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Initials', $CCMEmployers->Initials->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('KnownAs', $CCMEmployers->KnownAs->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('IDNumber', $CCMEmployers->IDNumber->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Telephone', $CCMEmployers->Telephone->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Cellphone', $CCMEmployers->Cellphone->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('EmailAddress', $CCMEmployers->EmailAddress->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('CandUUndertaking', $CCMEmployers->CandUUndertaking->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('WebUsername', $CCMEmployers->WebUsername->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('WebPassword', $CCMEmployers->WebPassword->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('BlockAccess', $CCMEmployers->BlockAccess->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('Archived', $CCMEmployers->Archived->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('AccountName', $CCMEmployers->AccountName->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('BankName', $CCMEmployers->BankName->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('BranchName', $CCMEmployers->BranchName->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
					$XmlDoc->AddField('AccountNum', $CCMEmployers->AccountNum->ExportValue($CCMEmployers->Export, $CCMEmployers->ExportOriginalValue));
				} else {
					$ExportDoc->BeginExportRow(TRUE); // Allow CSS styles if enabled
					$ExportDoc->ExportField($CCMEmployers->CCMEmployerID);
					$ExportDoc->ExportField($CCMEmployers->Organisation);
					$ExportDoc->ExportField($CCMEmployers->Title);
					$ExportDoc->ExportField($CCMEmployers->FirstName);
					$ExportDoc->ExportField($CCMEmployers->Surname);
					$ExportDoc->ExportField($CCMEmployers->Initials);
					$ExportDoc->ExportField($CCMEmployers->KnownAs);
					$ExportDoc->ExportField($CCMEmployers->IDNumber);
					$ExportDoc->ExportField($CCMEmployers->Telephone);
					$ExportDoc->ExportField($CCMEmployers->Cellphone);
					$ExportDoc->ExportField($CCMEmployers->EmailAddress);
					$ExportDoc->ExportField($CCMEmployers->CandUUndertaking);
					$ExportDoc->ExportField($CCMEmployers->WebUsername);
					$ExportDoc->ExportField($CCMEmployers->WebPassword);
					$ExportDoc->ExportField($CCMEmployers->BlockAccess);
					$ExportDoc->ExportField($CCMEmployers->Archived);
					$ExportDoc->ExportField($CCMEmployers->AccountName);
					$ExportDoc->ExportField($CCMEmployers->BankName);
					$ExportDoc->ExportField($CCMEmployers->BranchName);
					$ExportDoc->ExportField($CCMEmployers->AccountNum);
					$ExportDoc->EndExportRow();
				}
			}
			$rs->MoveNext();
		}
		if ($CCMEmployers->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($CCMEmployers->Export, array("email", "xml")))
			echo "\xEF\xBB\xBF";

		// Write debug message if enabled
		if (EW_DEBUG_ENABLED)
			echo ew_DebugMsg();

		// Output data
		if ($CCMEmployers->Export == "xml") {
			header("Content-Type: text/xml");
			echo $XmlDoc->XML();
		} elseif ($CCMEmployers->Export == "email") {
			$this->ExportEmail($ExportDoc->Text);
			$this->Page_Terminate($CCMEmployers->ExportReturnUrl());
		} else {
			echo $ExportDoc->Text;
		}
	}

	// Export email
	function ExportEmail($EmailContent) {
		global $Language, $CCMEmployers;
		$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 ($CCMEmployers->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 $CCMEmployers;

		// Initialize
		$sQry = "export=html";

		// Add record key QueryString
		$sQry .= "&" . substr($CCMEmployers->KeyUrl("", ""), 1);
		return $sQry;
	}

	// Page Load event
	function Page_Load() {

		//echo "Page Load";
	}

	// Page Unload event
	function Page_Unload() {

		//echo "Page Unload";
	}

	// Page Redirecting event
	function Page_Redirecting(&$url) {

		// Example:
		//$url = "your URL";

	}

	// Message Showing event
	function Message_Showing(&$msg) {

		// Example:
		//$msg = "your new message";

	}
}
?>