| Current Path : /var/www/cesa.co.za/ccmadmin/ |
| Current File : /var/www/cesa.co.za/ccmadmin/CCMMentorsadd.php |
<?php
session_start(); // Initialize Session data
ob_start(); // Turn on output buffering
?>
<?php include "ewcfg7.php" ?>
<?php include "ewmysql7.php" ?>
<?php include "phpfn7.php" ?>
<?php include "CCMMentorsinfo.php" ?>
<?php include "CCMUsersinfo.php" ?>
<?php include "userfn7.php" ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
// Create page object
$CCMMentors_add = new cCCMMentors_add();
$Page =& $CCMMentors_add;
// Page init
$CCMMentors_add->Page_Init();
// Page main
$CCMMentors_add->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CCMMentors_add = new ew_Page("CCMMentors_add");
// page properties
CCMMentors_add.PageID = "add"; // page ID
CCMMentors_add.FormID = "fCCMMentorsadd"; // form ID
var EW_PAGE_ID = CCMMentors_add.PageID; // for backward compatibility
// extend page with ValidateForm function
CCMMentors_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($CCMMentors->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($CCMMentors->Surname->FldCaption()) ?>");
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CCMMentors_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) { ?>
CCMMentors_add.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CCMMentors_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 $CCMMentors->TableCaption() ?><br><br>
<a href="<?php echo $CCMMentors->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CCMMentors_add->ShowMessage();
?>
<form name="fCCMMentorsadd" id="fCCMMentorsadd" action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return CCMMentors_add.ValidateForm(this);">
<p>
<input type="hidden" name="t" id="t" value="CCMMentors">
<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 ($CCMMentors->Organisation->Visible) { // Organisation ?>
<tr<?php echo $CCMMentors->Organisation->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Organisation->FldCaption() ?></td>
<td<?php echo $CCMMentors->Organisation->CellAttributes() ?>><span id="el_Organisation">
<input type="text" name="x_Organisation" id="x_Organisation" title="<?php echo $CCMMentors->Organisation->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->Organisation->EditValue ?>"<?php echo $CCMMentors->Organisation->EditAttributes() ?>>
</span><?php echo $CCMMentors->Organisation->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Title->Visible) { // Title ?>
<tr<?php echo $CCMMentors->Title->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Title->FldCaption() ?></td>
<td<?php echo $CCMMentors->Title->CellAttributes() ?>><span id="el_Title">
<input type="text" name="x_Title" id="x_Title" title="<?php echo $CCMMentors->Title->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMMentors->Title->EditValue ?>"<?php echo $CCMMentors->Title->EditAttributes() ?>>
</span><?php echo $CCMMentors->Title->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->FirstName->Visible) { // FirstName ?>
<tr<?php echo $CCMMentors->FirstName->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->FirstName->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMMentors->FirstName->CellAttributes() ?>><span id="el_FirstName">
<input type="text" name="x_FirstName" id="x_FirstName" title="<?php echo $CCMMentors->FirstName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->FirstName->EditValue ?>"<?php echo $CCMMentors->FirstName->EditAttributes() ?>>
</span><?php echo $CCMMentors->FirstName->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Surname->Visible) { // Surname ?>
<tr<?php echo $CCMMentors->Surname->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Surname->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMMentors->Surname->CellAttributes() ?>><span id="el_Surname">
<input type="text" name="x_Surname" id="x_Surname" title="<?php echo $CCMMentors->Surname->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->Surname->EditValue ?>"<?php echo $CCMMentors->Surname->EditAttributes() ?>>
</span><?php echo $CCMMentors->Surname->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Initials->Visible) { // Initials ?>
<tr<?php echo $CCMMentors->Initials->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Initials->FldCaption() ?></td>
<td<?php echo $CCMMentors->Initials->CellAttributes() ?>><span id="el_Initials">
<input type="text" name="x_Initials" id="x_Initials" title="<?php echo $CCMMentors->Initials->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMMentors->Initials->EditValue ?>"<?php echo $CCMMentors->Initials->EditAttributes() ?>>
</span><?php echo $CCMMentors->Initials->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->KnownAs->Visible) { // KnownAs ?>
<tr<?php echo $CCMMentors->KnownAs->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->KnownAs->FldCaption() ?></td>
<td<?php echo $CCMMentors->KnownAs->CellAttributes() ?>><span id="el_KnownAs">
<input type="text" name="x_KnownAs" id="x_KnownAs" title="<?php echo $CCMMentors->KnownAs->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->KnownAs->EditValue ?>"<?php echo $CCMMentors->KnownAs->EditAttributes() ?>>
</span><?php echo $CCMMentors->KnownAs->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->IDNumber->Visible) { // IDNumber ?>
<tr<?php echo $CCMMentors->IDNumber->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->IDNumber->FldCaption() ?></td>
<td<?php echo $CCMMentors->IDNumber->CellAttributes() ?>><span id="el_IDNumber">
<input type="text" name="x_IDNumber" id="x_IDNumber" title="<?php echo $CCMMentors->IDNumber->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMMentors->IDNumber->EditValue ?>"<?php echo $CCMMentors->IDNumber->EditAttributes() ?>>
</span><?php echo $CCMMentors->IDNumber->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->ProfessionalCouncil->Visible) { // ProfessionalCouncil ?>
<tr<?php echo $CCMMentors->ProfessionalCouncil->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->ProfessionalCouncil->FldCaption() ?></td>
<td<?php echo $CCMMentors->ProfessionalCouncil->CellAttributes() ?>><span id="el_ProfessionalCouncil">
<input type="text" name="x_ProfessionalCouncil" id="x_ProfessionalCouncil" title="<?php echo $CCMMentors->ProfessionalCouncil->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->ProfessionalCouncil->EditValue ?>"<?php echo $CCMMentors->ProfessionalCouncil->EditAttributes() ?>>
</span><?php echo $CCMMentors->ProfessionalCouncil->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->CategoryReg->Visible) { // CategoryReg ?>
<tr<?php echo $CCMMentors->CategoryReg->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->CategoryReg->FldCaption() ?></td>
<td<?php echo $CCMMentors->CategoryReg->CellAttributes() ?>><span id="el_CategoryReg">
<input type="text" name="x_CategoryReg" id="x_CategoryReg" title="<?php echo $CCMMentors->CategoryReg->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->CategoryReg->EditValue ?>"<?php echo $CCMMentors->CategoryReg->EditAttributes() ?>>
</span><?php echo $CCMMentors->CategoryReg->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->CouncilRegNumber->Visible) { // CouncilRegNumber ?>
<tr<?php echo $CCMMentors->CouncilRegNumber->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->CouncilRegNumber->FldCaption() ?></td>
<td<?php echo $CCMMentors->CouncilRegNumber->CellAttributes() ?>><span id="el_CouncilRegNumber">
<input type="text" name="x_CouncilRegNumber" id="x_CouncilRegNumber" title="<?php echo $CCMMentors->CouncilRegNumber->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->CouncilRegNumber->EditValue ?>"<?php echo $CCMMentors->CouncilRegNumber->EditAttributes() ?>>
</span><?php echo $CCMMentors->CouncilRegNumber->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Telephone->Visible) { // Telephone ?>
<tr<?php echo $CCMMentors->Telephone->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Telephone->FldCaption() ?></td>
<td<?php echo $CCMMentors->Telephone->CellAttributes() ?>><span id="el_Telephone">
<input type="text" name="x_Telephone" id="x_Telephone" title="<?php echo $CCMMentors->Telephone->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->Telephone->EditValue ?>"<?php echo $CCMMentors->Telephone->EditAttributes() ?>>
</span><?php echo $CCMMentors->Telephone->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Cellphone->Visible) { // Cellphone ?>
<tr<?php echo $CCMMentors->Cellphone->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Cellphone->FldCaption() ?></td>
<td<?php echo $CCMMentors->Cellphone->CellAttributes() ?>><span id="el_Cellphone">
<input type="text" name="x_Cellphone" id="x_Cellphone" title="<?php echo $CCMMentors->Cellphone->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->Cellphone->EditValue ?>"<?php echo $CCMMentors->Cellphone->EditAttributes() ?>>
</span><?php echo $CCMMentors->Cellphone->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->EmailAddress->Visible) { // EmailAddress ?>
<tr<?php echo $CCMMentors->EmailAddress->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->EmailAddress->FldCaption() ?></td>
<td<?php echo $CCMMentors->EmailAddress->CellAttributes() ?>><span id="el_EmailAddress">
<input type="text" name="x_EmailAddress" id="x_EmailAddress" title="<?php echo $CCMMentors->EmailAddress->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->EmailAddress->EditValue ?>"<?php echo $CCMMentors->EmailAddress->EditAttributes() ?>>
</span><?php echo $CCMMentors->EmailAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->WorkAddress->Visible) { // WorkAddress ?>
<tr<?php echo $CCMMentors->WorkAddress->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->WorkAddress->FldCaption() ?></td>
<td<?php echo $CCMMentors->WorkAddress->CellAttributes() ?>><span id="el_WorkAddress">
<textarea name="x_WorkAddress" id="x_WorkAddress" title="<?php echo $CCMMentors->WorkAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CCMMentors->WorkAddress->EditAttributes() ?>><?php echo $CCMMentors->WorkAddress->EditValue ?></textarea>
</span><?php echo $CCMMentors->WorkAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->PostalAddress->Visible) { // PostalAddress ?>
<tr<?php echo $CCMMentors->PostalAddress->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->PostalAddress->FldCaption() ?></td>
<td<?php echo $CCMMentors->PostalAddress->CellAttributes() ?>><span id="el_PostalAddress">
<textarea name="x_PostalAddress" id="x_PostalAddress" title="<?php echo $CCMMentors->PostalAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CCMMentors->PostalAddress->EditAttributes() ?>><?php echo $CCMMentors->PostalAddress->EditValue ?></textarea>
</span><?php echo $CCMMentors->PostalAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->CandUUndertaking->Visible) { // CandUUndertaking ?>
<tr<?php echo $CCMMentors->CandUUndertaking->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->CandUUndertaking->FldCaption() ?></td>
<td<?php echo $CCMMentors->CandUUndertaking->CellAttributes() ?>><span id="el_CandUUndertaking">
<input type="text" name="x_CandUUndertaking" id="x_CandUUndertaking" title="<?php echo $CCMMentors->CandUUndertaking->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CCMMentors->CandUUndertaking->EditValue ?>"<?php echo $CCMMentors->CandUUndertaking->EditAttributes() ?>>
</span><?php echo $CCMMentors->CandUUndertaking->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->WebUsername->Visible) { // WebUsername ?>
<tr<?php echo $CCMMentors->WebUsername->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->WebUsername->FldCaption() ?></td>
<td<?php echo $CCMMentors->WebUsername->CellAttributes() ?>><span id="el_WebUsername">
<input type="text" name="x_WebUsername" id="x_WebUsername" title="<?php echo $CCMMentors->WebUsername->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMMentors->WebUsername->EditValue ?>"<?php echo $CCMMentors->WebUsername->EditAttributes() ?>>
</span><?php echo $CCMMentors->WebUsername->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->WebPassword->Visible) { // WebPassword ?>
<tr<?php echo $CCMMentors->WebPassword->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->WebPassword->FldCaption() ?></td>
<td<?php echo $CCMMentors->WebPassword->CellAttributes() ?>><span id="el_WebPassword">
<input type="text" name="x_WebPassword" id="x_WebPassword" title="<?php echo $CCMMentors->WebPassword->FldTitle() ?>" size="30" maxlength="20" value="<?php echo $CCMMentors->WebPassword->EditValue ?>"<?php echo $CCMMentors->WebPassword->EditAttributes() ?>>
</span><?php echo $CCMMentors->WebPassword->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->BlockAccess->Visible) { // BlockAccess ?>
<tr<?php echo $CCMMentors->BlockAccess->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->BlockAccess->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMMentors->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 $CCMMentors->BlockAccess->FldTitle() ?>" value="{value}"<?php echo $CCMMentors->BlockAccess->EditAttributes() ?>></label></div>
<div id="dsl_x_BlockAccess" repeatcolumn="5">
<?php
$arwrk = $CCMMentors->BlockAccess->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCMMentors->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 $CCMMentors->BlockAccess->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CCMMentors->BlockAccess->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CCMMentors->BlockAccess->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Archived->Visible) { // Archived ?>
<tr<?php echo $CCMMentors->Archived->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Archived->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CCMMentors->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 $CCMMentors->Archived->FldTitle() ?>" value="{value}"<?php echo $CCMMentors->Archived->EditAttributes() ?>></label></div>
<div id="dsl_x_Archived" repeatcolumn="5">
<?php
$arwrk = $CCMMentors->Archived->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CCMMentors->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 $CCMMentors->Archived->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CCMMentors->Archived->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CCMMentors->Archived->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Designation->Visible) { // Designation ?>
<tr<?php echo $CCMMentors->Designation->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Designation->FldCaption() ?></td>
<td<?php echo $CCMMentors->Designation->CellAttributes() ?>><span id="el_Designation">
<input type="text" name="x_Designation" id="x_Designation" title="<?php echo $CCMMentors->Designation->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMMentors->Designation->EditValue ?>"<?php echo $CCMMentors->Designation->EditAttributes() ?>>
</span><?php echo $CCMMentors->Designation->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Prof_Reg_No->Visible) { // Prof Reg No ?>
<tr<?php echo $CCMMentors->Prof_Reg_No->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Prof_Reg_No->FldCaption() ?></td>
<td<?php echo $CCMMentors->Prof_Reg_No->CellAttributes() ?>><span id="el_Prof_Reg_No">
<input type="text" name="x_Prof_Reg_No" id="x_Prof_Reg_No" title="<?php echo $CCMMentors->Prof_Reg_No->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMMentors->Prof_Reg_No->EditValue ?>"<?php echo $CCMMentors->Prof_Reg_No->EditAttributes() ?>>
</span><?php echo $CCMMentors->Prof_Reg_No->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CCMMentors->Reg_No->Visible) { // Reg No ?>
<tr<?php echo $CCMMentors->Reg_No->RowAttributes ?>>
<td class="ewTableHeader"><?php echo $CCMMentors->Reg_No->FldCaption() ?></td>
<td<?php echo $CCMMentors->Reg_No->CellAttributes() ?>><span id="el_Reg_No">
<input type="text" name="x_Reg_No" id="x_Reg_No" title="<?php echo $CCMMentors->Reg_No->FldTitle() ?>" size="30" maxlength="50" value="<?php echo $CCMMentors->Reg_No->EditValue ?>"<?php echo $CCMMentors->Reg_No->EditAttributes() ?>>
</span><?php echo $CCMMentors->Reg_No->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
$CCMMentors_add->Page_Terminate();
?>
<?php
//
// Page class
//
class cCCMMentors_add {
// Page ID
var $PageID = 'add';
// Table name
var $TableName = 'CCMMentors';
// Page object name
var $PageObjName = 'CCMMentors_add';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CCMMentors;
if ($CCMMentors->UseTokenInUrl) $PageUrl .= "t=" . $CCMMentors->TableVar . "&"; // Add page token
return $PageUrl;
}
// Page URLs
var $AddUrl;
var $EditUrl;
var $CopyUrl;
var $DeleteUrl;
var $ViewUrl;
var $ListUrl;
// Export URLs
var $ExportPrintUrl;
var $ExportHtmlUrl;
var $ExportExcelUrl;
var $ExportWordUrl;
var $ExportXmlUrl;
var $ExportCsvUrl;
// Update URLs
var $InlineAddUrl;
var $InlineCopyUrl;
var $InlineEditUrl;
var $GridAddUrl;
var $GridEditUrl;
var $MultiDeleteUrl;
var $MultiUpdateUrl;
// Message
function getMessage() {
return @$_SESSION[EW_SESSION_MESSAGE];
}
function setMessage($v) {
if (@$_SESSION[EW_SESSION_MESSAGE] <> "") { // Append
$_SESSION[EW_SESSION_MESSAGE] .= "<br>" . $v;
} else {
$_SESSION[EW_SESSION_MESSAGE] = $v;
}
}
// Show message
function ShowMessage() {
$sMessage = $this->getMessage();
$this->Message_Showing($sMessage);
if ($sMessage <> "") { // Message in Session, display
echo "<p><span class=\"ewMessage\">" . $sMessage . "</span></p>";
$_SESSION[EW_SESSION_MESSAGE] = ""; // Clear message in Session
}
}
// Validate page request
function IsPageRequest() {
global $objForm, $CCMMentors;
if ($CCMMentors->UseTokenInUrl) {
if ($objForm)
return ($CCMMentors->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CCMMentors->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function cCCMMentors_add() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CCMMentors)
$GLOBALS["CCMMentors"] = new cCCMMentors();
// 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", 'CCMMentors', 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 $CCMMentors;
// Security
$Security = new cAdvancedSecurity();
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
$Security->TablePermission_Loading();
$Security->LoadCurrentUserLevel($this->TableName);
$Security->TablePermission_Loaded();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.php");
}
if (!$Security->CanAdd()) {
$Security->SaveLastUrl();
$this->Page_Terminate("CCMMentorslist.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, $CCMMentors;
// Load key values from QueryString
$bCopy = TRUE;
if (@$_GET["CCMMentorID"] != "") {
$CCMMentors->CCMMentorID->setQueryStringValue($_GET["CCMMentorID"]);
} else {
$bCopy = FALSE;
}
// Process form if post back
if (@$_POST["a_add"] <> "") {
$CCMMentors->CurrentAction = $_POST["a_add"]; // Get form action
$this->LoadFormValues(); // Load form values
// Validate form
if (!$this->ValidateForm()) {
$CCMMentors->CurrentAction = "I"; // Form error, reset action
$this->setMessage($gsFormError);
}
} else { // Not post back
if ($bCopy) {
$CCMMentors->CurrentAction = "C"; // Copy record
} else {
$CCMMentors->CurrentAction = "I"; // Display blank record
$this->LoadDefaultValues(); // Load default values
}
}
// Perform action based on action code
switch ($CCMMentors->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("CCMMentorslist.php"); // No matching record, return to list
}
break;
case "A": // ' Add new record
$CCMMentors->SendEmail = TRUE; // Send email on add success
if ($this->AddRow()) { // Add successful
$this->setMessage($Language->Phrase("AddSuccess")); // Set up success message
$sReturnUrl = $CCMMentors->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CCMMentorsview.php")
$sReturnUrl = $CCMMentors->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
$CCMMentors->RowType = EW_ROWTYPE_ADD; // Render add type
// Render row
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CCMMentors;
// Get upload data
}
// Load default values
function LoadDefaultValues() {
global $CCMMentors;
$CCMMentors->BlockAccess->CurrentValue = "n";
$CCMMentors->Archived->CurrentValue = 0;
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CCMMentors;
$CCMMentors->Organisation->setFormValue($objForm->GetValue("x_Organisation"));
$CCMMentors->Title->setFormValue($objForm->GetValue("x_Title"));
$CCMMentors->FirstName->setFormValue($objForm->GetValue("x_FirstName"));
$CCMMentors->Surname->setFormValue($objForm->GetValue("x_Surname"));
$CCMMentors->Initials->setFormValue($objForm->GetValue("x_Initials"));
$CCMMentors->KnownAs->setFormValue($objForm->GetValue("x_KnownAs"));
$CCMMentors->IDNumber->setFormValue($objForm->GetValue("x_IDNumber"));
$CCMMentors->ProfessionalCouncil->setFormValue($objForm->GetValue("x_ProfessionalCouncil"));
$CCMMentors->CategoryReg->setFormValue($objForm->GetValue("x_CategoryReg"));
$CCMMentors->CouncilRegNumber->setFormValue($objForm->GetValue("x_CouncilRegNumber"));
$CCMMentors->Telephone->setFormValue($objForm->GetValue("x_Telephone"));
$CCMMentors->Cellphone->setFormValue($objForm->GetValue("x_Cellphone"));
$CCMMentors->EmailAddress->setFormValue($objForm->GetValue("x_EmailAddress"));
$CCMMentors->WorkAddress->setFormValue($objForm->GetValue("x_WorkAddress"));
$CCMMentors->PostalAddress->setFormValue($objForm->GetValue("x_PostalAddress"));
$CCMMentors->CandUUndertaking->setFormValue($objForm->GetValue("x_CandUUndertaking"));
$CCMMentors->WebUsername->setFormValue($objForm->GetValue("x_WebUsername"));
$CCMMentors->WebPassword->setFormValue($objForm->GetValue("x_WebPassword"));
$CCMMentors->BlockAccess->setFormValue($objForm->GetValue("x_BlockAccess"));
$CCMMentors->Archived->setFormValue($objForm->GetValue("x_Archived"));
$CCMMentors->Designation->setFormValue($objForm->GetValue("x_Designation"));
$CCMMentors->Prof_Reg_No->setFormValue($objForm->GetValue("x_Prof_Reg_No"));
$CCMMentors->Reg_No->setFormValue($objForm->GetValue("x_Reg_No"));
$CCMMentors->CCMMentorID->setFormValue($objForm->GetValue("x_CCMMentorID"));
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CCMMentors;
$CCMMentors->CCMMentorID->CurrentValue = $CCMMentors->CCMMentorID->FormValue;
$CCMMentors->Organisation->CurrentValue = $CCMMentors->Organisation->FormValue;
$CCMMentors->Title->CurrentValue = $CCMMentors->Title->FormValue;
$CCMMentors->FirstName->CurrentValue = $CCMMentors->FirstName->FormValue;
$CCMMentors->Surname->CurrentValue = $CCMMentors->Surname->FormValue;
$CCMMentors->Initials->CurrentValue = $CCMMentors->Initials->FormValue;
$CCMMentors->KnownAs->CurrentValue = $CCMMentors->KnownAs->FormValue;
$CCMMentors->IDNumber->CurrentValue = $CCMMentors->IDNumber->FormValue;
$CCMMentors->ProfessionalCouncil->CurrentValue = $CCMMentors->ProfessionalCouncil->FormValue;
$CCMMentors->CategoryReg->CurrentValue = $CCMMentors->CategoryReg->FormValue;
$CCMMentors->CouncilRegNumber->CurrentValue = $CCMMentors->CouncilRegNumber->FormValue;
$CCMMentors->Telephone->CurrentValue = $CCMMentors->Telephone->FormValue;
$CCMMentors->Cellphone->CurrentValue = $CCMMentors->Cellphone->FormValue;
$CCMMentors->EmailAddress->CurrentValue = $CCMMentors->EmailAddress->FormValue;
$CCMMentors->WorkAddress->CurrentValue = $CCMMentors->WorkAddress->FormValue;
$CCMMentors->PostalAddress->CurrentValue = $CCMMentors->PostalAddress->FormValue;
$CCMMentors->CandUUndertaking->CurrentValue = $CCMMentors->CandUUndertaking->FormValue;
$CCMMentors->WebUsername->CurrentValue = $CCMMentors->WebUsername->FormValue;
$CCMMentors->WebPassword->CurrentValue = $CCMMentors->WebPassword->FormValue;
$CCMMentors->BlockAccess->CurrentValue = $CCMMentors->BlockAccess->FormValue;
$CCMMentors->Archived->CurrentValue = $CCMMentors->Archived->FormValue;
$CCMMentors->Designation->CurrentValue = $CCMMentors->Designation->FormValue;
$CCMMentors->Prof_Reg_No->CurrentValue = $CCMMentors->Prof_Reg_No->FormValue;
$CCMMentors->Reg_No->CurrentValue = $CCMMentors->Reg_No->FormValue;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CCMMentors;
$sFilter = $CCMMentors->KeyFilter();
// Call Row Selecting event
$CCMMentors->Row_Selecting($sFilter);
// Load SQL based on filter
$CCMMentors->CurrentFilter = $sFilter;
$sSql = $CCMMentors->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CCMMentors->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CCMMentors;
$CCMMentors->CCMMentorID->setDbValue($rs->fields('CCMMentorID'));
$CCMMentors->Organisation->setDbValue($rs->fields('Organisation'));
$CCMMentors->Title->setDbValue($rs->fields('Title'));
$CCMMentors->FirstName->setDbValue($rs->fields('FirstName'));
$CCMMentors->Surname->setDbValue($rs->fields('Surname'));
$CCMMentors->Initials->setDbValue($rs->fields('Initials'));
$CCMMentors->KnownAs->setDbValue($rs->fields('KnownAs'));
$CCMMentors->IDNumber->setDbValue($rs->fields('IDNumber'));
$CCMMentors->ProfessionalCouncil->setDbValue($rs->fields('ProfessionalCouncil'));
$CCMMentors->CategoryReg->setDbValue($rs->fields('CategoryReg'));
$CCMMentors->CouncilRegNumber->setDbValue($rs->fields('CouncilRegNumber'));
$CCMMentors->Telephone->setDbValue($rs->fields('Telephone'));
$CCMMentors->Cellphone->setDbValue($rs->fields('Cellphone'));
$CCMMentors->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$CCMMentors->WorkAddress->setDbValue($rs->fields('WorkAddress'));
$CCMMentors->PostalAddress->setDbValue($rs->fields('PostalAddress'));
$CCMMentors->EducationalInst->setDbValue($rs->fields('EducationalInst'));
$CCMMentors->Qualifications->setDbValue($rs->fields('Qualifications'));
$CCMMentors->CVFile->setDbValue($rs->fields('CVFile'));
$CCMMentors->MentorUndertaking->setDbValue($rs->fields('MentorUndertaking'));
$CCMMentors->CandUUndertaking->setDbValue($rs->fields('CandUUndertaking'));
$CCMMentors->WebUsername->setDbValue($rs->fields('WebUsername'));
$CCMMentors->WebPassword->setDbValue($rs->fields('WebPassword'));
$CCMMentors->BlockAccess->setDbValue($rs->fields('BlockAccess'));
$CCMMentors->Archived->setDbValue($rs->fields('Archived'));
$CCMMentors->Designation->setDbValue($rs->fields('Designation'));
$CCMMentors->Prof_Reg_No->setDbValue($rs->fields('Prof Reg No'));
$CCMMentors->Reg_No->setDbValue($rs->fields('Reg No'));
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CCMMentors;
// Initialize URLs
// Call Row_Rendering event
$CCMMentors->Row_Rendering();
// Common render codes for all row types
// Organisation
$CCMMentors->Organisation->CellCssStyle = ""; $CCMMentors->Organisation->CellCssClass = "";
$CCMMentors->Organisation->CellAttrs = array(); $CCMMentors->Organisation->ViewAttrs = array(); $CCMMentors->Organisation->EditAttrs = array();
// Title
$CCMMentors->Title->CellCssStyle = ""; $CCMMentors->Title->CellCssClass = "";
$CCMMentors->Title->CellAttrs = array(); $CCMMentors->Title->ViewAttrs = array(); $CCMMentors->Title->EditAttrs = array();
// FirstName
$CCMMentors->FirstName->CellCssStyle = ""; $CCMMentors->FirstName->CellCssClass = "";
$CCMMentors->FirstName->CellAttrs = array(); $CCMMentors->FirstName->ViewAttrs = array(); $CCMMentors->FirstName->EditAttrs = array();
// Surname
$CCMMentors->Surname->CellCssStyle = ""; $CCMMentors->Surname->CellCssClass = "";
$CCMMentors->Surname->CellAttrs = array(); $CCMMentors->Surname->ViewAttrs = array(); $CCMMentors->Surname->EditAttrs = array();
// Initials
$CCMMentors->Initials->CellCssStyle = ""; $CCMMentors->Initials->CellCssClass = "";
$CCMMentors->Initials->CellAttrs = array(); $CCMMentors->Initials->ViewAttrs = array(); $CCMMentors->Initials->EditAttrs = array();
// KnownAs
$CCMMentors->KnownAs->CellCssStyle = ""; $CCMMentors->KnownAs->CellCssClass = "";
$CCMMentors->KnownAs->CellAttrs = array(); $CCMMentors->KnownAs->ViewAttrs = array(); $CCMMentors->KnownAs->EditAttrs = array();
// IDNumber
$CCMMentors->IDNumber->CellCssStyle = ""; $CCMMentors->IDNumber->CellCssClass = "";
$CCMMentors->IDNumber->CellAttrs = array(); $CCMMentors->IDNumber->ViewAttrs = array(); $CCMMentors->IDNumber->EditAttrs = array();
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->CellCssStyle = ""; $CCMMentors->ProfessionalCouncil->CellCssClass = "";
$CCMMentors->ProfessionalCouncil->CellAttrs = array(); $CCMMentors->ProfessionalCouncil->ViewAttrs = array(); $CCMMentors->ProfessionalCouncil->EditAttrs = array();
// CategoryReg
$CCMMentors->CategoryReg->CellCssStyle = ""; $CCMMentors->CategoryReg->CellCssClass = "";
$CCMMentors->CategoryReg->CellAttrs = array(); $CCMMentors->CategoryReg->ViewAttrs = array(); $CCMMentors->CategoryReg->EditAttrs = array();
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->CellCssStyle = ""; $CCMMentors->CouncilRegNumber->CellCssClass = "";
$CCMMentors->CouncilRegNumber->CellAttrs = array(); $CCMMentors->CouncilRegNumber->ViewAttrs = array(); $CCMMentors->CouncilRegNumber->EditAttrs = array();
// Telephone
$CCMMentors->Telephone->CellCssStyle = ""; $CCMMentors->Telephone->CellCssClass = "";
$CCMMentors->Telephone->CellAttrs = array(); $CCMMentors->Telephone->ViewAttrs = array(); $CCMMentors->Telephone->EditAttrs = array();
// Cellphone
$CCMMentors->Cellphone->CellCssStyle = ""; $CCMMentors->Cellphone->CellCssClass = "";
$CCMMentors->Cellphone->CellAttrs = array(); $CCMMentors->Cellphone->ViewAttrs = array(); $CCMMentors->Cellphone->EditAttrs = array();
// EmailAddress
$CCMMentors->EmailAddress->CellCssStyle = ""; $CCMMentors->EmailAddress->CellCssClass = "";
$CCMMentors->EmailAddress->CellAttrs = array(); $CCMMentors->EmailAddress->ViewAttrs = array(); $CCMMentors->EmailAddress->EditAttrs = array();
// WorkAddress
$CCMMentors->WorkAddress->CellCssStyle = ""; $CCMMentors->WorkAddress->CellCssClass = "";
$CCMMentors->WorkAddress->CellAttrs = array(); $CCMMentors->WorkAddress->ViewAttrs = array(); $CCMMentors->WorkAddress->EditAttrs = array();
// PostalAddress
$CCMMentors->PostalAddress->CellCssStyle = ""; $CCMMentors->PostalAddress->CellCssClass = "";
$CCMMentors->PostalAddress->CellAttrs = array(); $CCMMentors->PostalAddress->ViewAttrs = array(); $CCMMentors->PostalAddress->EditAttrs = array();
// CandUUndertaking
$CCMMentors->CandUUndertaking->CellCssStyle = ""; $CCMMentors->CandUUndertaking->CellCssClass = "";
$CCMMentors->CandUUndertaking->CellAttrs = array(); $CCMMentors->CandUUndertaking->ViewAttrs = array(); $CCMMentors->CandUUndertaking->EditAttrs = array();
// WebUsername
$CCMMentors->WebUsername->CellCssStyle = ""; $CCMMentors->WebUsername->CellCssClass = "";
$CCMMentors->WebUsername->CellAttrs = array(); $CCMMentors->WebUsername->ViewAttrs = array(); $CCMMentors->WebUsername->EditAttrs = array();
// WebPassword
$CCMMentors->WebPassword->CellCssStyle = ""; $CCMMentors->WebPassword->CellCssClass = "";
$CCMMentors->WebPassword->CellAttrs = array(); $CCMMentors->WebPassword->ViewAttrs = array(); $CCMMentors->WebPassword->EditAttrs = array();
// BlockAccess
$CCMMentors->BlockAccess->CellCssStyle = ""; $CCMMentors->BlockAccess->CellCssClass = "";
$CCMMentors->BlockAccess->CellAttrs = array(); $CCMMentors->BlockAccess->ViewAttrs = array(); $CCMMentors->BlockAccess->EditAttrs = array();
// Archived
$CCMMentors->Archived->CellCssStyle = ""; $CCMMentors->Archived->CellCssClass = "";
$CCMMentors->Archived->CellAttrs = array(); $CCMMentors->Archived->ViewAttrs = array(); $CCMMentors->Archived->EditAttrs = array();
// Designation
$CCMMentors->Designation->CellCssStyle = ""; $CCMMentors->Designation->CellCssClass = "";
$CCMMentors->Designation->CellAttrs = array(); $CCMMentors->Designation->ViewAttrs = array(); $CCMMentors->Designation->EditAttrs = array();
// Prof Reg No
$CCMMentors->Prof_Reg_No->CellCssStyle = ""; $CCMMentors->Prof_Reg_No->CellCssClass = "";
$CCMMentors->Prof_Reg_No->CellAttrs = array(); $CCMMentors->Prof_Reg_No->ViewAttrs = array(); $CCMMentors->Prof_Reg_No->EditAttrs = array();
// Reg No
$CCMMentors->Reg_No->CellCssStyle = ""; $CCMMentors->Reg_No->CellCssClass = "";
$CCMMentors->Reg_No->CellAttrs = array(); $CCMMentors->Reg_No->ViewAttrs = array(); $CCMMentors->Reg_No->EditAttrs = array();
if ($CCMMentors->RowType == EW_ROWTYPE_VIEW) { // View row
// CCMMentorID
$CCMMentors->CCMMentorID->ViewValue = $CCMMentors->CCMMentorID->CurrentValue;
$CCMMentors->CCMMentorID->CssStyle = "";
$CCMMentors->CCMMentorID->CssClass = "";
$CCMMentors->CCMMentorID->ViewCustomAttributes = "";
// Organisation
$CCMMentors->Organisation->ViewValue = $CCMMentors->Organisation->CurrentValue;
$CCMMentors->Organisation->CssStyle = "";
$CCMMentors->Organisation->CssClass = "";
$CCMMentors->Organisation->ViewCustomAttributes = "";
// Title
$CCMMentors->Title->ViewValue = $CCMMentors->Title->CurrentValue;
$CCMMentors->Title->CssStyle = "";
$CCMMentors->Title->CssClass = "";
$CCMMentors->Title->ViewCustomAttributes = "";
// FirstName
$CCMMentors->FirstName->ViewValue = $CCMMentors->FirstName->CurrentValue;
$CCMMentors->FirstName->CssStyle = "";
$CCMMentors->FirstName->CssClass = "";
$CCMMentors->FirstName->ViewCustomAttributes = "";
// Surname
$CCMMentors->Surname->ViewValue = $CCMMentors->Surname->CurrentValue;
$CCMMentors->Surname->CssStyle = "";
$CCMMentors->Surname->CssClass = "";
$CCMMentors->Surname->ViewCustomAttributes = "";
// Initials
$CCMMentors->Initials->ViewValue = $CCMMentors->Initials->CurrentValue;
$CCMMentors->Initials->CssStyle = "";
$CCMMentors->Initials->CssClass = "";
$CCMMentors->Initials->ViewCustomAttributes = "";
// KnownAs
$CCMMentors->KnownAs->ViewValue = $CCMMentors->KnownAs->CurrentValue;
$CCMMentors->KnownAs->CssStyle = "";
$CCMMentors->KnownAs->CssClass = "";
$CCMMentors->KnownAs->ViewCustomAttributes = "";
// IDNumber
$CCMMentors->IDNumber->ViewValue = $CCMMentors->IDNumber->CurrentValue;
$CCMMentors->IDNumber->CssStyle = "";
$CCMMentors->IDNumber->CssClass = "";
$CCMMentors->IDNumber->ViewCustomAttributes = "";
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->ViewValue = $CCMMentors->ProfessionalCouncil->CurrentValue;
$CCMMentors->ProfessionalCouncil->CssStyle = "";
$CCMMentors->ProfessionalCouncil->CssClass = "";
$CCMMentors->ProfessionalCouncil->ViewCustomAttributes = "";
// CategoryReg
$CCMMentors->CategoryReg->ViewValue = $CCMMentors->CategoryReg->CurrentValue;
$CCMMentors->CategoryReg->CssStyle = "";
$CCMMentors->CategoryReg->CssClass = "";
$CCMMentors->CategoryReg->ViewCustomAttributes = "";
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->ViewValue = $CCMMentors->CouncilRegNumber->CurrentValue;
$CCMMentors->CouncilRegNumber->CssStyle = "";
$CCMMentors->CouncilRegNumber->CssClass = "";
$CCMMentors->CouncilRegNumber->ViewCustomAttributes = "";
// Telephone
$CCMMentors->Telephone->ViewValue = $CCMMentors->Telephone->CurrentValue;
$CCMMentors->Telephone->CssStyle = "";
$CCMMentors->Telephone->CssClass = "";
$CCMMentors->Telephone->ViewCustomAttributes = "";
// Cellphone
$CCMMentors->Cellphone->ViewValue = $CCMMentors->Cellphone->CurrentValue;
$CCMMentors->Cellphone->CssStyle = "";
$CCMMentors->Cellphone->CssClass = "";
$CCMMentors->Cellphone->ViewCustomAttributes = "";
// EmailAddress
$CCMMentors->EmailAddress->ViewValue = $CCMMentors->EmailAddress->CurrentValue;
$CCMMentors->EmailAddress->CssStyle = "";
$CCMMentors->EmailAddress->CssClass = "";
$CCMMentors->EmailAddress->ViewCustomAttributes = "";
// WorkAddress
$CCMMentors->WorkAddress->ViewValue = $CCMMentors->WorkAddress->CurrentValue;
$CCMMentors->WorkAddress->CssStyle = "";
$CCMMentors->WorkAddress->CssClass = "";
$CCMMentors->WorkAddress->ViewCustomAttributes = "";
// PostalAddress
$CCMMentors->PostalAddress->ViewValue = $CCMMentors->PostalAddress->CurrentValue;
$CCMMentors->PostalAddress->CssStyle = "";
$CCMMentors->PostalAddress->CssClass = "";
$CCMMentors->PostalAddress->ViewCustomAttributes = "";
// CandUUndertaking
$CCMMentors->CandUUndertaking->ViewValue = $CCMMentors->CandUUndertaking->CurrentValue;
$CCMMentors->CandUUndertaking->CssStyle = "";
$CCMMentors->CandUUndertaking->CssClass = "";
$CCMMentors->CandUUndertaking->ViewCustomAttributes = "";
// WebUsername
$CCMMentors->WebUsername->ViewValue = $CCMMentors->WebUsername->CurrentValue;
$CCMMentors->WebUsername->CssStyle = "";
$CCMMentors->WebUsername->CssClass = "";
$CCMMentors->WebUsername->ViewCustomAttributes = "";
// WebPassword
$CCMMentors->WebPassword->ViewValue = $CCMMentors->WebPassword->CurrentValue;
$CCMMentors->WebPassword->CssStyle = "";
$CCMMentors->WebPassword->CssClass = "";
$CCMMentors->WebPassword->ViewCustomAttributes = "";
// BlockAccess
if (strval($CCMMentors->BlockAccess->CurrentValue) <> "") {
switch ($CCMMentors->BlockAccess->CurrentValue) {
case "y":
$CCMMentors->BlockAccess->ViewValue = "Yes";
break;
case "n":
$CCMMentors->BlockAccess->ViewValue = "No";
break;
default:
$CCMMentors->BlockAccess->ViewValue = $CCMMentors->BlockAccess->CurrentValue;
}
} else {
$CCMMentors->BlockAccess->ViewValue = NULL;
}
$CCMMentors->BlockAccess->CssStyle = "";
$CCMMentors->BlockAccess->CssClass = "";
$CCMMentors->BlockAccess->ViewCustomAttributes = "";
// Archived
if (strval($CCMMentors->Archived->CurrentValue) <> "") {
switch ($CCMMentors->Archived->CurrentValue) {
case "1":
$CCMMentors->Archived->ViewValue = "Yes";
break;
case "0":
$CCMMentors->Archived->ViewValue = "No";
break;
default:
$CCMMentors->Archived->ViewValue = $CCMMentors->Archived->CurrentValue;
}
} else {
$CCMMentors->Archived->ViewValue = NULL;
}
$CCMMentors->Archived->CssStyle = "";
$CCMMentors->Archived->CssClass = "";
$CCMMentors->Archived->ViewCustomAttributes = "";
// Designation
$CCMMentors->Designation->ViewValue = $CCMMentors->Designation->CurrentValue;
$CCMMentors->Designation->CssStyle = "";
$CCMMentors->Designation->CssClass = "";
$CCMMentors->Designation->ViewCustomAttributes = "";
// Prof Reg No
$CCMMentors->Prof_Reg_No->ViewValue = $CCMMentors->Prof_Reg_No->CurrentValue;
$CCMMentors->Prof_Reg_No->CssStyle = "";
$CCMMentors->Prof_Reg_No->CssClass = "";
$CCMMentors->Prof_Reg_No->ViewCustomAttributes = "";
// Reg No
$CCMMentors->Reg_No->ViewValue = $CCMMentors->Reg_No->CurrentValue;
$CCMMentors->Reg_No->CssStyle = "";
$CCMMentors->Reg_No->CssClass = "";
$CCMMentors->Reg_No->ViewCustomAttributes = "";
// Organisation
$CCMMentors->Organisation->HrefValue = "";
$CCMMentors->Organisation->TooltipValue = "";
// Title
$CCMMentors->Title->HrefValue = "";
$CCMMentors->Title->TooltipValue = "";
// FirstName
$CCMMentors->FirstName->HrefValue = "";
$CCMMentors->FirstName->TooltipValue = "";
// Surname
$CCMMentors->Surname->HrefValue = "";
$CCMMentors->Surname->TooltipValue = "";
// Initials
$CCMMentors->Initials->HrefValue = "";
$CCMMentors->Initials->TooltipValue = "";
// KnownAs
$CCMMentors->KnownAs->HrefValue = "";
$CCMMentors->KnownAs->TooltipValue = "";
// IDNumber
$CCMMentors->IDNumber->HrefValue = "";
$CCMMentors->IDNumber->TooltipValue = "";
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->HrefValue = "";
$CCMMentors->ProfessionalCouncil->TooltipValue = "";
// CategoryReg
$CCMMentors->CategoryReg->HrefValue = "";
$CCMMentors->CategoryReg->TooltipValue = "";
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->HrefValue = "";
$CCMMentors->CouncilRegNumber->TooltipValue = "";
// Telephone
$CCMMentors->Telephone->HrefValue = "";
$CCMMentors->Telephone->TooltipValue = "";
// Cellphone
$CCMMentors->Cellphone->HrefValue = "";
$CCMMentors->Cellphone->TooltipValue = "";
// EmailAddress
$CCMMentors->EmailAddress->HrefValue = "";
$CCMMentors->EmailAddress->TooltipValue = "";
// WorkAddress
$CCMMentors->WorkAddress->HrefValue = "";
$CCMMentors->WorkAddress->TooltipValue = "";
// PostalAddress
$CCMMentors->PostalAddress->HrefValue = "";
$CCMMentors->PostalAddress->TooltipValue = "";
// CandUUndertaking
$CCMMentors->CandUUndertaking->HrefValue = "";
$CCMMentors->CandUUndertaking->TooltipValue = "";
// WebUsername
$CCMMentors->WebUsername->HrefValue = "";
$CCMMentors->WebUsername->TooltipValue = "";
// WebPassword
$CCMMentors->WebPassword->HrefValue = "";
$CCMMentors->WebPassword->TooltipValue = "";
// BlockAccess
$CCMMentors->BlockAccess->HrefValue = "";
$CCMMentors->BlockAccess->TooltipValue = "";
// Archived
$CCMMentors->Archived->HrefValue = "";
$CCMMentors->Archived->TooltipValue = "";
// Designation
$CCMMentors->Designation->HrefValue = "";
$CCMMentors->Designation->TooltipValue = "";
// Prof Reg No
$CCMMentors->Prof_Reg_No->HrefValue = "";
$CCMMentors->Prof_Reg_No->TooltipValue = "";
// Reg No
$CCMMentors->Reg_No->HrefValue = "";
$CCMMentors->Reg_No->TooltipValue = "";
} elseif ($CCMMentors->RowType == EW_ROWTYPE_ADD) { // Add row
// Organisation
$CCMMentors->Organisation->EditCustomAttributes = "";
$CCMMentors->Organisation->EditValue = ew_HtmlEncode($CCMMentors->Organisation->CurrentValue);
// Title
$CCMMentors->Title->EditCustomAttributes = "";
$CCMMentors->Title->EditValue = ew_HtmlEncode($CCMMentors->Title->CurrentValue);
// FirstName
$CCMMentors->FirstName->EditCustomAttributes = "";
$CCMMentors->FirstName->EditValue = ew_HtmlEncode($CCMMentors->FirstName->CurrentValue);
// Surname
$CCMMentors->Surname->EditCustomAttributes = "";
$CCMMentors->Surname->EditValue = ew_HtmlEncode($CCMMentors->Surname->CurrentValue);
// Initials
$CCMMentors->Initials->EditCustomAttributes = "";
$CCMMentors->Initials->EditValue = ew_HtmlEncode($CCMMentors->Initials->CurrentValue);
// KnownAs
$CCMMentors->KnownAs->EditCustomAttributes = "";
$CCMMentors->KnownAs->EditValue = ew_HtmlEncode($CCMMentors->KnownAs->CurrentValue);
// IDNumber
$CCMMentors->IDNumber->EditCustomAttributes = "";
$CCMMentors->IDNumber->EditValue = ew_HtmlEncode($CCMMentors->IDNumber->CurrentValue);
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->EditCustomAttributes = "";
$CCMMentors->ProfessionalCouncil->EditValue = ew_HtmlEncode($CCMMentors->ProfessionalCouncil->CurrentValue);
// CategoryReg
$CCMMentors->CategoryReg->EditCustomAttributes = "";
$CCMMentors->CategoryReg->EditValue = ew_HtmlEncode($CCMMentors->CategoryReg->CurrentValue);
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->EditCustomAttributes = "";
$CCMMentors->CouncilRegNumber->EditValue = ew_HtmlEncode($CCMMentors->CouncilRegNumber->CurrentValue);
// Telephone
$CCMMentors->Telephone->EditCustomAttributes = "";
$CCMMentors->Telephone->EditValue = ew_HtmlEncode($CCMMentors->Telephone->CurrentValue);
// Cellphone
$CCMMentors->Cellphone->EditCustomAttributes = "";
$CCMMentors->Cellphone->EditValue = ew_HtmlEncode($CCMMentors->Cellphone->CurrentValue);
// EmailAddress
$CCMMentors->EmailAddress->EditCustomAttributes = "";
$CCMMentors->EmailAddress->EditValue = ew_HtmlEncode($CCMMentors->EmailAddress->CurrentValue);
// WorkAddress
$CCMMentors->WorkAddress->EditCustomAttributes = "";
$CCMMentors->WorkAddress->EditValue = ew_HtmlEncode($CCMMentors->WorkAddress->CurrentValue);
// PostalAddress
$CCMMentors->PostalAddress->EditCustomAttributes = "";
$CCMMentors->PostalAddress->EditValue = ew_HtmlEncode($CCMMentors->PostalAddress->CurrentValue);
// CandUUndertaking
$CCMMentors->CandUUndertaking->EditCustomAttributes = "";
$CCMMentors->CandUUndertaking->EditValue = ew_HtmlEncode($CCMMentors->CandUUndertaking->CurrentValue);
// WebUsername
$CCMMentors->WebUsername->EditCustomAttributes = "";
$CCMMentors->WebUsername->EditValue = ew_HtmlEncode($CCMMentors->WebUsername->CurrentValue);
// WebPassword
$CCMMentors->WebPassword->EditCustomAttributes = "";
$CCMMentors->WebPassword->EditValue = ew_HtmlEncode($CCMMentors->WebPassword->CurrentValue);
// BlockAccess
$CCMMentors->BlockAccess->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("y", "Yes");
$arwrk[] = array("n", "No");
$CCMMentors->BlockAccess->EditValue = $arwrk;
// Archived
$CCMMentors->Archived->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("1", "Yes");
$arwrk[] = array("0", "No");
$CCMMentors->Archived->EditValue = $arwrk;
// Designation
$CCMMentors->Designation->EditCustomAttributes = "";
$CCMMentors->Designation->EditValue = ew_HtmlEncode($CCMMentors->Designation->CurrentValue);
// Prof Reg No
$CCMMentors->Prof_Reg_No->EditCustomAttributes = "";
$CCMMentors->Prof_Reg_No->EditValue = ew_HtmlEncode($CCMMentors->Prof_Reg_No->CurrentValue);
// Reg No
$CCMMentors->Reg_No->EditCustomAttributes = "";
$CCMMentors->Reg_No->EditValue = ew_HtmlEncode($CCMMentors->Reg_No->CurrentValue);
}
// Call Row Rendered event
if ($CCMMentors->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CCMMentors->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CCMMentors;
// Initialize form error message
$gsFormError = "";
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!is_null($CCMMentors->FirstName->FormValue) && $CCMMentors->FirstName->FormValue == "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("EnterRequiredField") . " - " . $CCMMentors->FirstName->FldCaption();
}
if (!is_null($CCMMentors->Surname->FormValue) && $CCMMentors->Surname->FormValue == "") {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("EnterRequiredField") . " - " . $CCMMentors->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, $CCMMentors;
$rsnew = array();
// Organisation
$CCMMentors->Organisation->SetDbValueDef($rsnew, $CCMMentors->Organisation->CurrentValue, NULL, FALSE);
// Title
$CCMMentors->Title->SetDbValueDef($rsnew, $CCMMentors->Title->CurrentValue, NULL, FALSE);
// FirstName
$CCMMentors->FirstName->SetDbValueDef($rsnew, $CCMMentors->FirstName->CurrentValue, "", FALSE);
// Surname
$CCMMentors->Surname->SetDbValueDef($rsnew, $CCMMentors->Surname->CurrentValue, "", FALSE);
// Initials
$CCMMentors->Initials->SetDbValueDef($rsnew, $CCMMentors->Initials->CurrentValue, NULL, FALSE);
// KnownAs
$CCMMentors->KnownAs->SetDbValueDef($rsnew, $CCMMentors->KnownAs->CurrentValue, NULL, FALSE);
// IDNumber
$CCMMentors->IDNumber->SetDbValueDef($rsnew, $CCMMentors->IDNumber->CurrentValue, NULL, FALSE);
// ProfessionalCouncil
$CCMMentors->ProfessionalCouncil->SetDbValueDef($rsnew, $CCMMentors->ProfessionalCouncil->CurrentValue, NULL, FALSE);
// CategoryReg
$CCMMentors->CategoryReg->SetDbValueDef($rsnew, $CCMMentors->CategoryReg->CurrentValue, NULL, FALSE);
// CouncilRegNumber
$CCMMentors->CouncilRegNumber->SetDbValueDef($rsnew, $CCMMentors->CouncilRegNumber->CurrentValue, NULL, FALSE);
// Telephone
$CCMMentors->Telephone->SetDbValueDef($rsnew, $CCMMentors->Telephone->CurrentValue, NULL, FALSE);
// Cellphone
$CCMMentors->Cellphone->SetDbValueDef($rsnew, $CCMMentors->Cellphone->CurrentValue, NULL, FALSE);
// EmailAddress
$CCMMentors->EmailAddress->SetDbValueDef($rsnew, $CCMMentors->EmailAddress->CurrentValue, NULL, FALSE);
// WorkAddress
$CCMMentors->WorkAddress->SetDbValueDef($rsnew, $CCMMentors->WorkAddress->CurrentValue, NULL, FALSE);
// PostalAddress
$CCMMentors->PostalAddress->SetDbValueDef($rsnew, $CCMMentors->PostalAddress->CurrentValue, NULL, FALSE);
// CandUUndertaking
$CCMMentors->CandUUndertaking->SetDbValueDef($rsnew, $CCMMentors->CandUUndertaking->CurrentValue, NULL, FALSE);
// WebUsername
$CCMMentors->WebUsername->SetDbValueDef($rsnew, $CCMMentors->WebUsername->CurrentValue, NULL, FALSE);
// WebPassword
$CCMMentors->WebPassword->SetDbValueDef($rsnew, $CCMMentors->WebPassword->CurrentValue, NULL, FALSE);
// BlockAccess
$CCMMentors->BlockAccess->SetDbValueDef($rsnew, $CCMMentors->BlockAccess->CurrentValue, "", TRUE);
// Archived
$CCMMentors->Archived->SetDbValueDef($rsnew, $CCMMentors->Archived->CurrentValue, 0, TRUE);
// Designation
$CCMMentors->Designation->SetDbValueDef($rsnew, $CCMMentors->Designation->CurrentValue, NULL, FALSE);
// Prof Reg No
$CCMMentors->Prof_Reg_No->SetDbValueDef($rsnew, $CCMMentors->Prof_Reg_No->CurrentValue, NULL, FALSE);
// Reg No
$CCMMentors->Reg_No->SetDbValueDef($rsnew, $CCMMentors->Reg_No->CurrentValue, NULL, FALSE);
// Call Row Inserting event
$bInsertRow = $CCMMentors->Row_Inserting($rsnew);
if ($bInsertRow) {
$conn->raiseErrorFn = 'ew_ErrorFn';
$AddRow = $conn->Execute($CCMMentors->InsertSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CCMMentors->CancelMessage <> "") {
$this->setMessage($CCMMentors->CancelMessage);
$CCMMentors->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("InsertCancelled"));
}
$AddRow = FALSE;
}
if ($AddRow) {
$CCMMentors->CCMMentorID->setDbValue($conn->Insert_ID());
$rsnew['CCMMentorID'] = $CCMMentors->CCMMentorID->DbValue;
// Call Row Inserted event
$CCMMentors->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;
}
}
?>