| Current Path : /var/www/cesa.co.za/ccmadmin/ |
| Current File : /var/www/cesa.co.za/ccmadmin/CCMEmployersadd.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_add = new cCCMEmployers_add();
$Page =& $CCMEmployers_add;
// Page init
$CCMEmployers_add->Page_Init();
// Page main
$CCMEmployers_add->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CCMEmployers_add = new ew_Page("CCMEmployers_add");
// page properties
CCMEmployers_add.PageID = "add"; // page ID
CCMEmployers_add.FormID = "fCCMEmployersadd"; // form ID
var EW_PAGE_ID = CCMEmployers_add.PageID; // for backward compatibility
// extend page with ValidateForm function
CCMEmployers_add.ValidateForm = function(fobj) {
ew_PostAutoSuggest(fobj);
if (!this.ValidateRequired)
return true; // ignore validation
if (fobj.a_confirm && fobj.a_confirm.value == "F")
return true;
var i, elm, aelm, infix;
var rowcnt = (fobj.key_count) ? Number(fobj.key_count.value) : 1;
for (i=0; i<rowcnt; i++) {
infix = (fobj.key_count) ? String(i+1) : "";
elm = fobj.elements["x" + infix + "_FirstName"];
if (elm && !ew_HasValue(elm))
return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($CCMEmployers->FirstName->FldCaption()) ?>");
elm = fobj.elements["x" + infix + "_Surname"];
if (elm && !ew_HasValue(elm))
return ew_OnError(this, elm, ewLanguage.Phrase("EnterRequiredField") + " - <?php echo ew_JsEncode2($CCMEmployers->Surname->FldCaption()) ?>");
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CCMEmployers_add.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_add.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMEmployers_add.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>
<p><span class="phpmaker"><?php echo $Language->Phrase("Add") ?> <?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_add->ShowMessage();
?>
<form name="fCCMEmployersadd" id="fCCMEmployersadd" action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return CCMEmployers_add.ValidateForm(this);">
<p>
<input type="hidden" name="t" id="t" value="CCMEmployers">
<input type="hidden" name="a_add" id="a_add" value="A">
<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() ?>><span id="el_Organisation">
<input type="text" name="x_Organisation" id="x_Organisation" title="<?php echo $CCMEmployers->Organisation->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->Organisation->EditValue ?>"<?php echo $CCMEmployers->Organisation->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Organisation->CustomMsg ?></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() ?>><span id="el_Title">
<input type="text" name="x_Title" id="x_Title" title="<?php echo $CCMEmployers->Title->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMEmployers->Title->EditValue ?>"<?php echo $CCMEmployers->Title->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Title->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMEmployers->FirstName->Visible) { // FirstName ?>
<tr<?php echo $CCMEmployers->FirstName->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMEmployers->FirstName->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMEmployers->FirstName->CellAttributes() ?>><span id="el_FirstName">
<input type="text" name="x_FirstName" id="x_FirstName" title="<?php echo $CCMEmployers->FirstName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->FirstName->EditValue ?>"<?php echo $CCMEmployers->FirstName->EditAttributes() ?>>
</span><?php echo $CCMEmployers->FirstName->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMEmployers->Surname->Visible) { // Surname ?>
<tr<?php echo $CCMEmployers->Surname->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMEmployers->Surname->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMEmployers->Surname->CellAttributes() ?>><span id="el_Surname">
<input type="text" name="x_Surname" id="x_Surname" title="<?php echo $CCMEmployers->Surname->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->Surname->EditValue ?>"<?php echo $CCMEmployers->Surname->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Surname->CustomMsg ?></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() ?>><span id="el_Initials">
<input type="text" name="x_Initials" id="x_Initials" title="<?php echo $CCMEmployers->Initials->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMEmployers->Initials->EditValue ?>"<?php echo $CCMEmployers->Initials->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Initials->CustomMsg ?></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() ?>><span id="el_KnownAs">
<input type="text" name="x_KnownAs" id="x_KnownAs" title="<?php echo $CCMEmployers->KnownAs->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->KnownAs->EditValue ?>"<?php echo $CCMEmployers->KnownAs->EditAttributes() ?>>
</span><?php echo $CCMEmployers->KnownAs->CustomMsg ?></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() ?>><span id="el_IDNumber">
<input type="text" name="x_IDNumber" id="x_IDNumber" title="<?php echo $CCMEmployers->IDNumber->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMEmployers->IDNumber->EditValue ?>"<?php echo $CCMEmployers->IDNumber->EditAttributes() ?>>
</span><?php echo $CCMEmployers->IDNumber->CustomMsg ?></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() ?>><span id="el_Telephone">
<input type="text" name="x_Telephone" id="x_Telephone" title="<?php echo $CCMEmployers->Telephone->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->Telephone->EditValue ?>"<?php echo $CCMEmployers->Telephone->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Telephone->CustomMsg ?></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() ?>><span id="el_Cellphone">
<input type="text" name="x_Cellphone" id="x_Cellphone" title="<?php echo $CCMEmployers->Cellphone->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->Cellphone->EditValue ?>"<?php echo $CCMEmployers->Cellphone->EditAttributes() ?>>
</span><?php echo $CCMEmployers->Cellphone->CustomMsg ?></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() ?>><span id="el_EmailAddress">
<input type="text" name="x_EmailAddress" id="x_EmailAddress" title="<?php echo $CCMEmployers->EmailAddress->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->EmailAddress->EditValue ?>"<?php echo $CCMEmployers->EmailAddress->EditAttributes() ?>>
</span><?php echo $CCMEmployers->EmailAddress->CustomMsg ?></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() ?>><span id="el_WorkAddress">
<textarea name="x_WorkAddress" id="x_WorkAddress" title="<?php echo $CCMEmployers->WorkAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CCMEmployers->WorkAddress->EditAttributes() ?>><?php echo $CCMEmployers->WorkAddress->EditValue ?></textarea>
</span><?php echo $CCMEmployers->WorkAddress->CustomMsg ?></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() ?>><span id="el_PostalAddress">
<textarea name="x_PostalAddress" id="x_PostalAddress" title="<?php echo $CCMEmployers->PostalAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CCMEmployers->PostalAddress->EditAttributes() ?>><?php echo $CCMEmployers->PostalAddress->EditValue ?></textarea>
</span><?php echo $CCMEmployers->PostalAddress->CustomMsg ?></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() ?>><span id="el_CandUUndertaking">
<input type="text" name="x_CandUUndertaking" id="x_CandUUndertaking" title="<?php echo $CCMEmployers->CandUUndertaking->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->CandUUndertaking->EditValue ?>"<?php echo $CCMEmployers->CandUUndertaking->EditAttributes() ?>>
</span><?php echo $CCMEmployers->CandUUndertaking->CustomMsg ?></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() ?>><span id="el_WebUsername">
<input type="text" name="x_WebUsername" id="x_WebUsername" title="<?php echo $CCMEmployers->WebUsername->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMEmployers->WebUsername->EditValue ?>"<?php echo $CCMEmployers->WebUsername->EditAttributes() ?>>
</span><?php echo $CCMEmployers->WebUsername->CustomMsg ?></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() ?>><span id="el_WebPassword">
<input type="text" name="x_WebPassword" id="x_WebPassword" title="<?php echo $CCMEmployers->WebPassword->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMEmployers->WebPassword->EditValue ?>"<?php echo $CCMEmployers->WebPassword->EditAttributes() ?>>
</span><?php echo $CCMEmployers->WebPassword->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMEmployers->BlockAccess->Visible) { // BlockAccess ?>
<tr<?php echo $CCMEmployers->BlockAccess->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMEmployers->BlockAccess->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMEmployers->BlockAccess->CellAttributes() ?>><span id="el_BlockAccess">
<div id="tp_x_BlockAccess" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x_BlockAccess" id="x_BlockAccess" title="<?php echo $CCMEmployers->BlockAccess->FldTitle() ?>" value="{value}"<?php echo $CCMEmployers->BlockAccess->EditAttributes() ?>></label></div>
<div id="dsl_x_BlockAccess" repeatcolumn="5">
<?php
$arwrk = $CCMEmployers->BlockAccess->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCMEmployers->BlockAccess->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x_BlockAccess" id="x_BlockAccess" title="<?php echo $CCMEmployers->BlockAccess->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CCMEmployers->BlockAccess->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CCMEmployers->BlockAccess->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMEmployers->Archived->Visible) { // Archived ?>
<tr<?php echo $CCMEmployers->Archived->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMEmployers->Archived->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMEmployers->Archived->CellAttributes() ?>><span id="el_Archived">
<div id="tp_x_Archived" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x_Archived" id="x_Archived" title="<?php echo $CCMEmployers->Archived->FldTitle() ?>" value="{value}"<?php echo $CCMEmployers->Archived->EditAttributes() ?>></label></div>
<div id="dsl_x_Archived" repeatcolumn="5">
<?php
$arwrk = $CCMEmployers->Archived->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCMEmployers->Archived->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " checked=\"checked\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
// Note: No spacing within the LABEL tag
?>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 1) ?>
<label><input type="radio" name="x_Archived" id="x_Archived" title="<?php echo $CCMEmployers->Archived->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CCMEmployers->Archived->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CCMEmployers->Archived->CustomMsg ?></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() ?>><span id="el_AccountName">
<input type="text" name="x_AccountName" id="x_AccountName" title="<?php echo $CCMEmployers->AccountName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->AccountName->EditValue ?>"<?php echo $CCMEmployers->AccountName->EditAttributes() ?>>
</span><?php echo $CCMEmployers->AccountName->CustomMsg ?></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() ?>><span id="el_BankName">
<input type="text" name="x_BankName" id="x_BankName" title="<?php echo $CCMEmployers->BankName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->BankName->EditValue ?>"<?php echo $CCMEmployers->BankName->EditAttributes() ?>>
</span><?php echo $CCMEmployers->BankName->CustomMsg ?></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() ?>><span id="el_BranchName">
<input type="text" name="x_BranchName" id="x_BranchName" title="<?php echo $CCMEmployers->BranchName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->BranchName->EditValue ?>"<?php echo $CCMEmployers->BranchName->EditAttributes() ?>>
</span><?php echo $CCMEmployers->BranchName->CustomMsg ?></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() ?>><span id="el_AccountNum">
<input type="text" name="x_AccountNum" id="x_AccountNum" title="<?php echo $CCMEmployers->AccountNum->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMEmployers->AccountNum->EditValue ?>"<?php echo $CCMEmployers->AccountNum->EditAttributes() ?>>
</span><?php echo $CCMEmployers->AccountNum->CustomMsg ?></td>
</tr>
<?php } ?>
</table>
</div>
</td></tr></table>
<p>
<input type="submit" name="btnAction" id="btnAction" value="<?php echo ew_BtnCaption($Language->Phrase("AddBtn")) ?>">
</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_add->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCMEmployers_add {
// Page ID
var $PageID = 'add';
// Table name
var $TableName = 'CCMEmployers';
// Page object name
var $PageObjName = 'CCMEmployers_add';
// 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_add() {
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", 'add', 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->CanAdd()) {
$Security->SaveLastUrl();
$this->Page_Terminate("CCMEmployerslist.php");
}
// Create form object
$objForm = new cFormObj();
// 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 $sDbMasterFilter = "";
var $sDbDetailFilter = "";
var $lPriv = 0;
//
// Page main
//
function Page_Main() {
global $objForm, $Language, $gsFormError, $CCMEmployers;
// Load key values from QueryString
$bCopy = TRUE;
if (@$_GET["CCMEmployerID"] != "") {
$CCMEmployers->CCMEmployerID->setQueryStringValue($_GET["CCMEmployerID"]);
} else {
$bCopy = FALSE;
}
// Process form if post back
if (@$_POST["a_add"] <> "") {
$CCMEmployers->CurrentAction = $_POST["a_add"]; // Get form action
$this->LoadFormValues(); // Load form values
// Validate form
if (!$this->ValidateForm()) {
$CCMEmployers->CurrentAction = "I"; // Form error, reset action
$this->setMessage($gsFormError);
}
} else { // Not post back
if ($bCopy) {
$CCMEmployers->CurrentAction = "C"; // Copy record
} else {
$CCMEmployers->CurrentAction = "I"; // Display blank record
$this->LoadDefaultValues(); // Load default values
}
}
// Perform action based on action code
switch ($CCMEmployers->CurrentAction) {
case "I": // Blank record, no action required
break;
case "C": // Copy an existing record
if (!$this->LoadRow()) { // Load record based on key
$this->setMessage($Language->Phrase("NoRecord")); // No record found
$this->Page_Terminate("CCMEmployerslist.php"); // No matching record, return to list
}
break;
case "A": // ' Add new record
$CCMEmployers->SendEmail = TRUE; // Send email on add success
if ($this->AddRow()) { // Add successful
$this->setMessage($Language->Phrase("AddSuccess")); // Set up success message
$sReturnUrl = $CCMEmployers->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CCMEmployersview.php")
$sReturnUrl = $CCMEmployers->ViewUrl(); // View paging, return to view page with keyurl directly
$this->Page_Terminate($sReturnUrl); // Clean up and return
} else {
$this->RestoreFormValues(); // Add failed, restore form values
}
}
// Render row based on row type
$CCMEmployers->RowType = EW_ROWTYPE_ADD; // Render add type
// Render row
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CCMEmployers;
// Get upload data
}
// Load default values
function LoadDefaultValues() {
global $CCMEmployers;
$CCMEmployers->BlockAccess->CurrentValue = "n";
$CCMEmployers->Archived->CurrentValue = 0;
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CCMEmployers;
$CCMEmployers->Organisation->setFormValue($objForm->GetValue("x_Organisation"));
$CCMEmployers->Title->setFormValue($objForm->GetValue("x_Title"));
$CCMEmployers->FirstName->setFormValue($objForm->GetValue("x_FirstName"));
$CCMEmployers->Surname->setFormValue($objForm->GetValue("x_Surname"));
$CCMEmployers->Initials->setFormValue($objForm->GetValue("x_Initials"));
$CCMEmployers->KnownAs->setFormValue($objForm->GetValue("x_KnownAs"));
$CCMEmployers->IDNumber->setFormValue($objForm->GetValue("x_IDNumber"));
$CCMEmployers->Telephone->setFormValue($objForm->GetValue("x_Telephone"));
$CCMEmployers->Cellphone->setFormValue($objForm->GetValue("x_Cellphone"));
$CCMEmployers->EmailAddress->setFormValue($objForm->GetValue("x_EmailAddress"));
$CCMEmployers->WorkAddress->setFormValue($objForm->GetValue("x_WorkAddress"));
$CCMEmployers->PostalAddress->setFormValue($objForm->GetValue("x_PostalAddress"));
$CCMEmployers->CandUUndertaking->setFormValue($objForm->GetValue("x_CandUUndertaking"));
$CCMEmployers->WebUsername->setFormValue($objForm->GetValue("x_WebUsername"));
$CCMEmployers->WebPassword->setFormValue($objForm->GetValue("x_WebPassword"));
$CCMEmployers->BlockAccess->setFormValue($objForm->GetValue("x_BlockAccess"));
$CCMEmployers->Archived->setFormValue($objForm->GetValue("x_Archived"));
$CCMEmployers->AccountName->setFormValue($objForm->GetValue("x_AccountName"));
$CCMEmployers->BankName->setFormValue($objForm->GetValue("x_BankName"));
$CCMEmployers->BranchName->setFormValue($objForm->GetValue("x_BranchName"));
$CCMEmployers->AccountNum->setFormValue($objForm->GetValue("x_AccountNum"));
$CCMEmployers->CCMEmployerID->setFormValue($objForm->GetValue("x_CCMEmployerID"));
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CCMEmployers;
$CCMEmployers->CCMEmployerID->CurrentValue = $CCMEmployers->CCMEmployerID->FormValue;
$CCMEmployers->Organisation->CurrentValue = $CCMEmployers->Organisation->FormValue;
$CCMEmployers->Title->CurrentValue = $CCMEmployers->Title->FormValue;
$CCMEmployers->FirstName->CurrentValue = $CCMEmployers->FirstName->FormValue;
$CCMEmployers->Surname->CurrentValue = $CCMEmployers->Surname->FormValue;
$CCMEmployers->Initials->CurrentValue = $CCMEmployers->Initials->FormValue;
$CCMEmployers->KnownAs->CurrentValue = $CCMEmployers->KnownAs->FormValue;
$CCMEmployers->IDNumber->CurrentValue = $CCMEmployers->IDNumber->FormValue;
$CCMEmployers->Telephone->CurrentValue = $CCMEmployers->Telephone->FormValue;
$CCMEmployers->Cellphone->CurrentValue = $CCMEmployers->Cellphone->FormValue;
$CCMEmployers->EmailAddress->CurrentValue = $CCMEmployers->EmailAddress->FormValue;
$CCMEmployers->WorkAddress->CurrentValue = $CCMEmployers->WorkAddress->FormValue;
$CCMEmployers->PostalAddress->CurrentValue = $CCMEmployers->PostalAddress->FormValue;
$CCMEmployers->CandUUndertaking->CurrentValue = $CCMEmployers->CandUUndertaking->FormValue;
$CCMEmployers->WebUsername->CurrentValue = $CCMEmployers->WebUsername->FormValue;
$CCMEmployers->WebPassword->CurrentValue = $CCMEmployers->WebPassword->FormValue;
$CCMEmployers->BlockAccess->CurrentValue = $CCMEmployers->BlockAccess->FormValue;
$CCMEmployers->Archived->CurrentValue = $CCMEmployers->Archived->FormValue;
$CCMEmployers->AccountName->CurrentValue = $CCMEmployers->AccountName->FormValue;
$CCMEmployers->BankName->CurrentValue = $CCMEmployers->BankName->FormValue;
$CCMEmployers->BranchName->CurrentValue = $CCMEmployers->BranchName->FormValue;
$CCMEmployers->AccountNum->CurrentValue = $CCMEmployers->AccountNum->FormValue;
}
// 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();
// 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 = "";
} elseif ($CCMEmployers->RowType == EW_ROWTYPE_ADD) { // Add row
// Organisation
$CCMEmployers->Organisation->EditCustomAttributes = "";
$CCMEmployers->Organisation->EditValue = ew_HtmlEncode($CCMEmployers->Organisation->CurrentValue);
// Title
$CCMEmployers->Title->EditCustomAttributes = "";
$CCMEmployers->Title->EditValue = ew_HtmlEncode($CCMEmployers->Title->CurrentValue);
// FirstName
$CCMEmployers->FirstName->EditCustomAttributes = "";
$CCMEmployers->FirstName->EditValue = ew_HtmlEncode($CCMEmployers->FirstName->CurrentValue);
// Surname
$CCMEmployers->Surname->EditCustomAttributes = "";
$CCMEmployers->Surname->EditValue = ew_HtmlEncode($CCMEmployers->Surname->CurrentValue);
// Initials
$CCMEmployers->Initials->EditCustomAttributes = "";
$CCMEmployers->Initials->EditValue = ew_HtmlEncode($CCMEmployers->Initials->CurrentValue);
// KnownAs
$CCMEmployers->KnownAs->EditCustomAttributes = "";
$CCMEmployers->KnownAs->EditValue = ew_HtmlEncode($CCMEmployers->KnownAs->CurrentValue);
// IDNumber
$CCMEmployers->IDNumber->EditCustomAttributes = "";
$CCMEmployers->IDNumber->EditValue = ew_HtmlEncode($CCMEmployers->IDNumber->CurrentValue);
// Telephone
$CCMEmployers->Telephone->EditCustomAttributes = "";
$CCMEmployers->Telephone->EditValue = ew_HtmlEncode($CCMEmployers->Telephone->CurrentValue);
// Cellphone
$CCMEmployers->Cellphone->EditCustomAttributes = "";
$CCMEmployers->Cellphone->EditValue = ew_HtmlEncode($CCMEmployers->Cellphone->CurrentValue);
// EmailAddress
$CCMEmployers->EmailAddress->EditCustomAttributes = "";
$CCMEmployers->EmailAddress->EditValue = ew_HtmlEncode($CCMEmployers->EmailAddress->CurrentValue);
// WorkAddress
$CCMEmployers->WorkAddress->EditCustomAttributes = "";
$CCMEmployers->WorkAddress->EditValue = ew_HtmlEncode($CCMEmployers->WorkAddress->CurrentValue);
// PostalAddress
$CCMEmployers->PostalAddress->EditCustomAttributes = "";
$CCMEmployers->PostalAddress->EditValue = ew_HtmlEncode($CCMEmployers->PostalAddress->CurrentValue);
// CandUUndertaking
$CCMEmployers->CandUUndertaking->EditCustomAttributes = "";
$CCMEmployers->CandUUndertaking->EditValue = ew_HtmlEncode($CCMEmployers->CandUUndertaking->CurrentValue);
// WebUsername
$CCMEmployers->WebUsername->EditCustomAttributes = "";
$CCMEmployers->WebUsername->EditValue = ew_HtmlEncode($CCMEmployers->WebUsername->CurrentValue);
// WebPassword
$CCMEmployers->WebPassword->EditCustomAttributes = "";
$CCMEmployers->WebPassword->EditValue = ew_HtmlEncode($CCMEmployers->WebPassword->CurrentValue);
// BlockAccess
$CCMEmployers->BlockAccess->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("y", "Yes");
$arwrk[] = array("n", "No");
$CCMEmployers->BlockAccess->EditValue = $arwrk;
// Archived
$CCMEmployers->Archived->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("1", "Yes");
$arwrk[] = array("0", "No");
$CCMEmployers->Archived->EditValue = $arwrk;
// AccountName
$CCMEmployers->AccountName->EditCustomAttributes = "";
$CCMEmployers->AccountName->EditValue = ew_HtmlEncode($CCMEmployers->AccountName->CurrentValue);
// BankName
$CCMEmployers->BankName->EditCustomAttributes = "";
$CCMEmployers->BankName->EditValue = ew_HtmlEncode($CCMEmployers->BankName->CurrentValue);
// BranchName
$CCMEmployers->BranchName->EditCustomAttributes = "";
$CCMEmployers->BranchName->EditValue = ew_HtmlEncode($CCMEmployers->BranchName->CurrentValue);
// AccountNum
$CCMEmployers->AccountNum->EditCustomAttributes = "";
$CCMEmployers->AccountNum->EditValue = ew_HtmlEncode($CCMEmployers->AccountNum->CurrentValue);
}
// Call Row Rendered event
if ($CCMEmployers->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCMEmployers->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CCMEmployers;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!is_null($CCMEmployers->FirstName->FormValue) && $CCMEmployers->FirstName->FormValue == "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("EnterRequiredField") . " - " . $CCMEmployers->FirstName->FldCaption();
}
if (!is_null($CCMEmployers->Surname->FormValue) && $CCMEmployers->Surname->FormValue == "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("EnterRequiredField") . " - " . $CCMEmployers->Surname->FldCaption();
}
// Return validate result
$ValidateForm = ($gsFormError == "");
// Call Form_CustomValidate event
$sFormCustomError = "";
$ValidateForm = $ValidateForm && $this->Form_CustomValidate($sFormCustomError);
if ($sFormCustomError <> "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $sFormCustomError;
}
return $ValidateForm;
}
// Add record
function AddRow() {
global $conn, $Language, $Security, $CCMEmployers;
$rsnew = array();
// Organisation
$CCMEmployers->Organisation->SetDbValueDef($rsnew, $CCMEmployers->Organisation->CurrentValue, NULL, FALSE);
// Title
$CCMEmployers->Title->SetDbValueDef($rsnew, $CCMEmployers->Title->CurrentValue, NULL, FALSE);
// FirstName
$CCMEmployers->FirstName->SetDbValueDef($rsnew, $CCMEmployers->FirstName->CurrentValue, "", FALSE);
// Surname
$CCMEmployers->Surname->SetDbValueDef($rsnew, $CCMEmployers->Surname->CurrentValue, "", FALSE);
// Initials
$CCMEmployers->Initials->SetDbValueDef($rsnew, $CCMEmployers->Initials->CurrentValue, NULL, FALSE);
// KnownAs
$CCMEmployers->KnownAs->SetDbValueDef($rsnew, $CCMEmployers->KnownAs->CurrentValue, NULL, FALSE);
// IDNumber
$CCMEmployers->IDNumber->SetDbValueDef($rsnew, $CCMEmployers->IDNumber->CurrentValue, NULL, FALSE);
// Telephone
$CCMEmployers->Telephone->SetDbValueDef($rsnew, $CCMEmployers->Telephone->CurrentValue, NULL, FALSE);
// Cellphone
$CCMEmployers->Cellphone->SetDbValueDef($rsnew, $CCMEmployers->Cellphone->CurrentValue, NULL, FALSE);
// EmailAddress
$CCMEmployers->EmailAddress->SetDbValueDef($rsnew, $CCMEmployers->EmailAddress->CurrentValue, NULL, FALSE);
// WorkAddress
$CCMEmployers->WorkAddress->SetDbValueDef($rsnew, $CCMEmployers->WorkAddress->CurrentValue, NULL, FALSE);
// PostalAddress
$CCMEmployers->PostalAddress->SetDbValueDef($rsnew, $CCMEmployers->PostalAddress->CurrentValue, NULL, FALSE);
// CandUUndertaking
$CCMEmployers->CandUUndertaking->SetDbValueDef($rsnew, $CCMEmployers->CandUUndertaking->CurrentValue, NULL, FALSE);
// WebUsername
$CCMEmployers->WebUsername->SetDbValueDef($rsnew, $CCMEmployers->WebUsername->CurrentValue, NULL, FALSE);
// WebPassword
$CCMEmployers->WebPassword->SetDbValueDef($rsnew, $CCMEmployers->WebPassword->CurrentValue, NULL, FALSE);
// BlockAccess
$CCMEmployers->BlockAccess->SetDbValueDef($rsnew, $CCMEmployers->BlockAccess->CurrentValue, "", TRUE);
// Archived
$CCMEmployers->Archived->SetDbValueDef($rsnew, $CCMEmployers->Archived->CurrentValue, 0, TRUE);
// AccountName
$CCMEmployers->AccountName->SetDbValueDef($rsnew, $CCMEmployers->AccountName->CurrentValue, NULL, FALSE);
// BankName
$CCMEmployers->BankName->SetDbValueDef($rsnew, $CCMEmployers->BankName->CurrentValue, NULL, FALSE);
// BranchName
$CCMEmployers->BranchName->SetDbValueDef($rsnew, $CCMEmployers->BranchName->CurrentValue, NULL, FALSE);
// AccountNum
$CCMEmployers->AccountNum->SetDbValueDef($rsnew, $CCMEmployers->AccountNum->CurrentValue, NULL, FALSE);
// Call Row Inserting event
$bInsertRow = $CCMEmployers->Row_Inserting($rsnew);
if ($bInsertRow) {
$conn->raiseErrorFn = 'ew_ErrorFn';
$AddRow = $conn->Execute($CCMEmployers->InsertSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CCMEmployers->CancelMessage <> "") {
$this->setMessage($CCMEmployers->CancelMessage);
$CCMEmployers->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("InsertCancelled"));
}
$AddRow = FALSE;
}
if ($AddRow) {
$CCMEmployers->CCMEmployerID->setDbValue($conn->Insert_ID());
$rsnew['CCMEmployerID'] = $CCMEmployers->CCMEmployerID->DbValue;
// Call Row Inserted event
$CCMEmployers->Row_Inserted($rsnew);
}
return $AddRow;
}
// 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;
}
}
?>