Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/ccmadmin/
Upload File :
Current File : /var/www/cesa.co.za/ccmadmin/CCMEmployersdelete.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_delete = new cCCMEmployers_delete();
$Page =& $CCMEmployers_delete;

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

// Page main
$CCMEmployers_delete->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--

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

// page properties
CCMEmployers_delete.PageID = "delete"; // page ID
CCMEmployers_delete.FormID = "fCCMEmployersdelete"; // form ID
var EW_PAGE_ID = CCMEmployers_delete.PageID; // for backward compatibility

// extend page with Form_CustomValidate function
CCMEmployers_delete.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_delete.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMEmployers_delete.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

// Load records for display
if ($rs = $CCMEmployers_delete->LoadRecordset())
	$CCMEmployers_deletelTotalRecs = $rs->RecordCount(); // Get record count
if ($CCMEmployers_deletelTotalRecs <= 0) { // No record found, exit
	if ($rs)
		$rs->Close();
	$CCMEmployers_delete->Page_Terminate("CCMEmployerslist.php"); // Return to list
}
?>
<p><span class="phpmaker"><?php echo $Language->Phrase("Delete") ?>&nbsp;<?php echo $Language->Phrase("TblTypeTABLE") ?><?php echo $CCMEmployers->TableCaption() ?><br><br>
<a href="<?php echo $CCMEmployers->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
	echo ew_DebugMsg();
$CCMEmployers_delete->ShowMessage();
?>
<form action="<?php echo ew_CurrentPage() ?>" method="post">
<p>
<input type="hidden" name="t" id="t" value="CCMEmployers">
<input type="hidden" name="a_delete" id="a_delete" value="D">
<?php foreach ($CCMEmployers_delete->arRecKeys as $key) { ?>
<input type="hidden" name="key_m[]" id="key_m[]" value="<?php echo ew_HtmlEncode($key) ?>">
<?php } ?>
<table class="ewGrid"><tr><td class="ewGridContent">
<div class="ewGridMiddlePanel">
<table cellspacing="0" class="ewTable ewTableSeparate">
<?php echo $CCMEmployers->TableCustomInnerHtml ?>
	<thead>
	<tr class="ewTableHeader">
		<td valign="top"><?php echo $CCMEmployers->Organisation->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->Title->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->FirstName->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->Surname->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->Telephone->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->Cellphone->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->EmailAddress->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->AccountName->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->BankName->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->BranchName->FldCaption() ?></td>
		<td valign="top"><?php echo $CCMEmployers->AccountNum->FldCaption() ?></td>
	</tr>
	</thead>
	<tbody>
<?php
$CCMEmployers_delete->lRecCnt = 0;
$i = 0;
while (!$rs->EOF) {
	$CCMEmployers_delete->lRecCnt++;

	// Set row properties
	$CCMEmployers->CssClass = "";
	$CCMEmployers->CssStyle = "";
	$CCMEmployers->RowAttrs = array();
	$CCMEmployers->RowType = EW_ROWTYPE_VIEW; // View

	// Get the field contents
	$CCMEmployers_delete->LoadRowValues($rs);

	// Render row
	$CCMEmployers_delete->RenderRow();
?>
	<tr<?php echo $CCMEmployers->RowAttributes() ?>>
		<td<?php echo $CCMEmployers->Organisation->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Organisation->ViewAttributes() ?>><?php echo $CCMEmployers->Organisation->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->Title->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Title->ViewAttributes() ?>><?php echo $CCMEmployers->Title->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->FirstName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->FirstName->ViewAttributes() ?>><?php echo $CCMEmployers->FirstName->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->Surname->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Surname->ViewAttributes() ?>><?php echo $CCMEmployers->Surname->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->Telephone->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Telephone->ViewAttributes() ?>><?php echo $CCMEmployers->Telephone->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->Cellphone->CellAttributes() ?>>
<div<?php echo $CCMEmployers->Cellphone->ViewAttributes() ?>><?php echo $CCMEmployers->Cellphone->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->EmailAddress->CellAttributes() ?>>
<div<?php echo $CCMEmployers->EmailAddress->ViewAttributes() ?>><?php echo $CCMEmployers->EmailAddress->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->AccountName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->AccountName->ViewAttributes() ?>><?php echo $CCMEmployers->AccountName->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->BankName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->BankName->ViewAttributes() ?>><?php echo $CCMEmployers->BankName->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->BranchName->CellAttributes() ?>>
<div<?php echo $CCMEmployers->BranchName->ViewAttributes() ?>><?php echo $CCMEmployers->BranchName->ListViewValue() ?></div></td>
		<td<?php echo $CCMEmployers->AccountNum->CellAttributes() ?>>
<div<?php echo $CCMEmployers->AccountNum->ViewAttributes() ?>><?php echo $CCMEmployers->AccountNum->ListViewValue() ?></div></td>
	</tr>
<?php
	$rs->MoveNext();
}
$rs->Close();
?>
</tbody>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="Action" id="Action" value="<?php echo ew_BtnCaption($Language->Phrase("DeleteBtn")) ?>">
</form>
<script language="JavaScript" type="text/javascript">
<!--

// Write your table-specific startup script here
// document.write("page loaded");
//-->

</script>
<?php include "footer.php" ?>
<?php
$CCMEmployers_delete->Page_Terminate();
?>
<?php

//
// Page class
//
class cCCMEmployers_delete {

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

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

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

	// 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_delete() {
		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", 'delete', 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->CanDelete()) {
			$Security->SaveLastUrl();
			$this->Page_Terminate("CCMEmployerslist.php");
		}

		// 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 $lTotalRecs = 0;
	var $lRecCnt;
	var $arRecKeys = array();

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

		// Load key parameters
		$sKey = "";
		$bSingleDelete = TRUE; // Initialize as single delete
		$nKeySelected = 0; // Initialize selected key count
		$sFilter = "";
		if (@$_GET["CCMEmployerID"] <> "") {
			$CCMEmployers->CCMEmployerID->setQueryStringValue($_GET["CCMEmployerID"]);
			if (!is_numeric($CCMEmployers->CCMEmployerID->QueryStringValue))
				$this->Page_Terminate("CCMEmployerslist.php"); // Prevent SQL injection, exit
			$sKey .= $CCMEmployers->CCMEmployerID->QueryStringValue;
		} else {
			$bSingleDelete = FALSE;
		}
		if ($bSingleDelete) {
			$nKeySelected = 1; // Set up key selected count
			$this->arRecKeys[0] = $sKey;
		} else {
			if (isset($_POST["key_m"])) { // Key in form
				$nKeySelected = count($_POST["key_m"]); // Set up key selected count
				$this->arRecKeys = ew_StripSlashes($_POST["key_m"]);
			}
		}
		if ($nKeySelected <= 0)
			$this->Page_Terminate("CCMEmployerslist.php"); // No key specified, return to list

		// Build filter
		foreach ($this->arRecKeys as $sKey) {
			$sFilter .= "(";

			// Set up key field
			$sKeyFld = $sKey;
			if (!is_numeric($sKeyFld))
				$this->Page_Terminate("CCMEmployerslist.php"); // Prevent SQL injection, return to list
			$sFilter .= "`CCMEmployerID`=" . ew_AdjustSql($sKeyFld) . " AND ";
			if (substr($sFilter, -5) == " AND ") $sFilter = substr($sFilter, 0, strlen($sFilter)-5) . ") OR ";
		}
		if (substr($sFilter, -4) == " OR ") $sFilter = substr($sFilter, 0, strlen($sFilter)-4);

		// Set up filter (SQL WHHERE clause) and get return SQL
		// SQL constructor in CCMEmployers class, CCMEmployersinfo.php

		$CCMEmployers->CurrentFilter = $sFilter;

		// Get action
		if (@$_POST["a_delete"] <> "") {
			$CCMEmployers->CurrentAction = $_POST["a_delete"];
		} else {
			$CCMEmployers->CurrentAction = "I"; // Display record
		}
		switch ($CCMEmployers->CurrentAction) {
			case "D": // Delete
				$CCMEmployers->SendEmail = TRUE; // Send email on delete success
				if ($this->DeleteRows()) { // delete rows
					$this->setMessage($Language->Phrase("DeleteSuccess")); // Set up success message
					$this->Page_Terminate($CCMEmployers->getReturnUrl()); // Return to caller
				}
		}
	}

	//
	// Delete records based on current filter
	//
	function DeleteRows() {
		global $conn, $Language, $Security, $CCMEmployers;
		$DeleteRows = TRUE;
		$sWrkFilter = $CCMEmployers->CurrentFilter;

		// Set up filter (SQL WHERE clause) and get return SQL
		// SQL constructor in CCMEmployers class, CCMEmployersinfo.php

		$CCMEmployers->CurrentFilter = $sWrkFilter;
		$sSql = $CCMEmployers->SQL();
		$conn->raiseErrorFn = 'ew_ErrorFn';
		$rs = $conn->Execute($sSql);
		$conn->raiseErrorFn = '';
		if ($rs === FALSE) {
			return FALSE;
		} elseif ($rs->EOF) {
			$this->setMessage($Language->Phrase("NoRecord")); // No record found
			$rs->Close();
			return FALSE;
		}
		$conn->BeginTrans();

		// Clone old rows
		$rsold = ($rs) ? $rs->GetRows() : array();
		if ($rs)
			$rs->Close();

		// Call row deleting event
		if ($DeleteRows) {
			foreach ($rsold as $row) {
				$DeleteRows = $CCMEmployers->Row_Deleting($row);
				if (!$DeleteRows) break;
			}
		}
		if ($DeleteRows) {
			$sKey = "";
			foreach ($rsold as $row) {
				$sThisKey = "";
				if ($sThisKey <> "") $sThisKey .= EW_COMPOSITE_KEY_SEPARATOR;
				$sThisKey .= $row['CCMEmployerID'];
				$conn->raiseErrorFn = 'ew_ErrorFn';
				$DeleteRows = $conn->Execute($CCMEmployers->DeleteSQL($row)); // Delete
				$conn->raiseErrorFn = '';
				if ($DeleteRows === FALSE)
					break;
				if ($sKey <> "") $sKey .= ", ";
				$sKey .= $sThisKey;
			}
		} else {

			// Set up error message
			if ($CCMEmployers->CancelMessage <> "") {
				$this->setMessage($CCMEmployers->CancelMessage);
				$CCMEmployers->CancelMessage = "";
			} else {
				$this->setMessage($Language->Phrase("DeleteCancelled"));
			}
		}
		if ($DeleteRows) {
			$conn->CommitTrans(); // Commit the changes
		} else {
			$conn->RollbackTrans(); // Rollback changes
		}

		// Call Row Deleted event
		if ($DeleteRows) {
			foreach ($rsold as $row) {
				$CCMEmployers->Row_Deleted($row);
			}	
		}
		return $DeleteRows;
	}

	// 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
		// 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();

		// 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();

		// 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 = "";

			// 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 = "";

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

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

			// EmailAddress
			$CCMEmployers->EmailAddress->HrefValue = "";
			$CCMEmployers->EmailAddress->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();
	}

	// 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";

	}
}
?>