| Current Path : /var/www/cesa.co.za/cpdadmin/ |
| Current File : /var/www/cesa.co.za/cpdadmin/CPDAssessorsadd.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 "CPDAssessorsinfo.php" ?>
<?php include "CPDAdminUsersinfo.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
$CPDAssessors_add = new cCPDAssessors_add();
$Page =& $CPDAssessors_add;
// Page init
$CPDAssessors_add->Page_Init();
// Page main
$CPDAssessors_add->Page_Main();
?>
<?php include "header.php" ?>
<script type="text/javascript">
<!--
// Create page object
var CPDAssessors_add = new ew_Page("CPDAssessors_add");
// page properties
CPDAssessors_add.PageID = "add"; // page ID
CPDAssessors_add.FormID = "fCPDAssessorsadd"; // form ID
var EW_PAGE_ID = CPDAssessors_add.PageID; // for backward compatibility
// extend page with ValidateForm function
CPDAssessors_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 + "_CVFile"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_QualificationFile"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_NDAFile"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_Document1"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_DocumentName2"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CPDAssessors->DocumentName2->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_Document2"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
elm = fobj.elements["x" + infix + "_DocumentName3"];
if (elm && !ew_CheckInteger(elm.value))
return ew_OnError(this, elm, "<?php echo ew_JsEncode2($CPDAssessors->DocumentName3->FldErrMsg()) ?>");
elm = fobj.elements["x" + infix + "_Document3"];
if (elm && !ew_CheckFileType(elm.value))
return ew_OnError(this, elm, ewLanguage.Phrase("WrongFileType"));
// Call Form Custom Validate event
if (!this.Form_CustomValidate(fobj)) return false;
}
return true;
}
// extend page with Form_CustomValidate function
CPDAssessors_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) { ?>
CPDAssessors_add.ValidateRequired = true; // uses JavaScript validation
<?php } else { ?>
CPDAssessors_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 $CPDAssessors->TableCaption() ?><br><br>
<a href="<?php echo $CPDAssessors->getReturnUrl() ?>"><?php echo $Language->Phrase("GoBack") ?></a></span></p>
<?php
if (EW_DEBUG_ENABLED)
echo ew_DebugMsg();
$CPDAssessors_add->ShowMessage();
?>
<form name="fCPDAssessorsadd" id="fCPDAssessorsadd" action="<?php echo ew_CurrentPage() ?>" method="post" enctype="multipart/form-data" onsubmit="return CPDAssessors_add.ValidateForm(this);">
<p>
<input type="hidden" name="t" id="t" value="CPDAssessors">
<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 ($CPDAssessors->Title->Visible) { // Title ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Title->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Title->CellAttributes() ?>><span id="el_Title">
<input type="text" name="x_Title" id="x_Title" title="<?php echo $CPDAssessors->Title->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->Title->EditValue ?>"<?php echo $CPDAssessors->Title->EditAttributes() ?>>
</span><?php echo $CPDAssessors->Title->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->KnownAs->Visible) { // KnownAs ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->KnownAs->FldCaption() ?></td>
<td<?php echo $CPDAssessors->KnownAs->CellAttributes() ?>><span id="el_KnownAs">
<input type="text" name="x_KnownAs" id="x_KnownAs" title="<?php echo $CPDAssessors->KnownAs->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->KnownAs->EditValue ?>"<?php echo $CPDAssessors->KnownAs->EditAttributes() ?>>
</span><?php echo $CPDAssessors->KnownAs->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->FirstName->Visible) { // FirstName ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->FirstName->FldCaption() ?></td>
<td<?php echo $CPDAssessors->FirstName->CellAttributes() ?>><span id="el_FirstName">
<input type="text" name="x_FirstName" id="x_FirstName" title="<?php echo $CPDAssessors->FirstName->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->FirstName->EditValue ?>"<?php echo $CPDAssessors->FirstName->EditAttributes() ?>>
</span><?php echo $CPDAssessors->FirstName->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Surname->Visible) { // Surname ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Surname->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Surname->CellAttributes() ?>><span id="el_Surname">
<input type="text" name="x_Surname" id="x_Surname" title="<?php echo $CPDAssessors->Surname->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->Surname->EditValue ?>"<?php echo $CPDAssessors->Surname->EditAttributes() ?>>
</span><?php echo $CPDAssessors->Surname->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Designation->Visible) { // Designation ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Designation->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Designation->CellAttributes() ?>><span id="el_Designation">
<input type="text" name="x_Designation" id="x_Designation" title="<?php echo $CPDAssessors->Designation->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->Designation->EditValue ?>"<?php echo $CPDAssessors->Designation->EditAttributes() ?>>
</span><?php echo $CPDAssessors->Designation->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Department->Visible) { // Department ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Department->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Department->CellAttributes() ?>><span id="el_Department">
<input type="text" name="x_Department" id="x_Department" title="<?php echo $CPDAssessors->Department->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->Department->EditValue ?>"<?php echo $CPDAssessors->Department->EditAttributes() ?>>
</span><?php echo $CPDAssessors->Department->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Organisation->Visible) { // Organisation ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Organisation->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Organisation->CellAttributes() ?>><span id="el_Organisation">
<input type="text" name="x_Organisation" id="x_Organisation" title="<?php echo $CPDAssessors->Organisation->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->Organisation->EditValue ?>"<?php echo $CPDAssessors->Organisation->EditAttributes() ?>>
</span><?php echo $CPDAssessors->Organisation->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->PostalAddress->Visible) { // PostalAddress ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->PostalAddress->FldCaption() ?></td>
<td<?php echo $CPDAssessors->PostalAddress->CellAttributes() ?>><span id="el_PostalAddress">
<textarea name="x_PostalAddress" id="x_PostalAddress" title="<?php echo $CPDAssessors->PostalAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CPDAssessors->PostalAddress->EditAttributes() ?>><?php echo $CPDAssessors->PostalAddress->EditValue ?></textarea>
</span><?php echo $CPDAssessors->PostalAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->PhysicalAddress->Visible) { // PhysicalAddress ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->PhysicalAddress->FldCaption() ?></td>
<td<?php echo $CPDAssessors->PhysicalAddress->CellAttributes() ?>><span id="el_PhysicalAddress">
<textarea name="x_PhysicalAddress" id="x_PhysicalAddress" title="<?php echo $CPDAssessors->PhysicalAddress->FldTitle() ?>" cols="35" rows="4"<?php echo $CPDAssessors->PhysicalAddress->EditAttributes() ?>><?php echo $CPDAssessors->PhysicalAddress->EditValue ?></textarea>
</span><?php echo $CPDAssessors->PhysicalAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->CellNumber->Visible) { // CellNumber ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->CellNumber->FldCaption() ?></td>
<td<?php echo $CPDAssessors->CellNumber->CellAttributes() ?>><span id="el_CellNumber">
<input type="text" name="x_CellNumber" id="x_CellNumber" title="<?php echo $CPDAssessors->CellNumber->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->CellNumber->EditValue ?>"<?php echo $CPDAssessors->CellNumber->EditAttributes() ?>>
</span><?php echo $CPDAssessors->CellNumber->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->EmailAddress->Visible) { // EmailAddress ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->EmailAddress->FldCaption() ?></td>
<td<?php echo $CPDAssessors->EmailAddress->CellAttributes() ?>><span id="el_EmailAddress">
<input type="text" name="x_EmailAddress" id="x_EmailAddress" title="<?php echo $CPDAssessors->EmailAddress->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->EmailAddress->EditValue ?>"<?php echo $CPDAssessors->EmailAddress->EditAttributes() ?>>
</span><?php echo $CPDAssessors->EmailAddress->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->ProfessionalCouncil->Visible) { // ProfessionalCouncil ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->ProfessionalCouncil->FldCaption() ?></td>
<td<?php echo $CPDAssessors->ProfessionalCouncil->CellAttributes() ?>><span id="el_ProfessionalCouncil">
<input type="text" name="x_ProfessionalCouncil" id="x_ProfessionalCouncil" title="<?php echo $CPDAssessors->ProfessionalCouncil->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->ProfessionalCouncil->EditValue ?>"<?php echo $CPDAssessors->ProfessionalCouncil->EditAttributes() ?>>
</span><?php echo $CPDAssessors->ProfessionalCouncil->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->ProfRegNo->Visible) { // ProfRegNo ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->ProfRegNo->FldCaption() ?></td>
<td<?php echo $CPDAssessors->ProfRegNo->CellAttributes() ?>><span id="el_ProfRegNo">
<input type="text" name="x_ProfRegNo" id="x_ProfRegNo" title="<?php echo $CPDAssessors->ProfRegNo->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->ProfRegNo->EditValue ?>"<?php echo $CPDAssessors->ProfRegNo->EditAttributes() ?>>
</span><?php echo $CPDAssessors->ProfRegNo->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->CVFile->Visible) { // CVFile ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->CVFile->FldCaption() ?></td>
<td<?php echo $CPDAssessors->CVFile->CellAttributes() ?>><span id="el_CVFile">
<input type="file" name="x_CVFile" id="x_CVFile" title="<?php echo $CPDAssessors->CVFile->FldTitle() ?>" size="30"<?php echo $CPDAssessors->CVFile->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->CVFile->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->QualificationFile->Visible) { // QualificationFile ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->QualificationFile->FldCaption() ?></td>
<td<?php echo $CPDAssessors->QualificationFile->CellAttributes() ?>><span id="el_QualificationFile">
<input type="file" name="x_QualificationFile" id="x_QualificationFile" title="<?php echo $CPDAssessors->QualificationFile->FldTitle() ?>" size="30"<?php echo $CPDAssessors->QualificationFile->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->QualificationFile->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->NDAFile->Visible) { // NDAFile ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->NDAFile->FldCaption() ?></td>
<td<?php echo $CPDAssessors->NDAFile->CellAttributes() ?>><span id="el_NDAFile">
<input type="file" name="x_NDAFile" id="x_NDAFile" title="<?php echo $CPDAssessors->NDAFile->FldTitle() ?>" size="30"<?php echo $CPDAssessors->NDAFile->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->NDAFile->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->adminusername->Visible) { // adminusername ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->adminusername->FldCaption() ?></td>
<td<?php echo $CPDAssessors->adminusername->CellAttributes() ?>><span id="el_adminusername">
<select id="x_adminusername" name="x_adminusername" title="<?php echo $CPDAssessors->adminusername->FldTitle() ?>"<?php echo $CPDAssessors->adminusername->EditAttributes() ?>>
<?php
if (is_array($CPDAssessors->adminusername->EditValue)) {
$arwrk = $CPDAssessors->adminusername->EditValue;
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CPDAssessors->adminusername->CurrentValue) == strval($arwrk[$rowcntwrk][0])) ? " selected=\"selected\"" : "";
if ($selwrk <> "") $emptywrk = FALSE;
?>
<option value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?>>
<?php echo $arwrk[$rowcntwrk][1] ?>
</option>
<?php
}
}
?>
</select>
</span><?php echo $CPDAssessors->adminusername->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Active->Visible) { // Active ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Active->FldCaption() ?><?php echo $Language->Phrase("FieldRequiredIndicator") ?></td>
<td<?php echo $CPDAssessors->Active->CellAttributes() ?>><span id="el_Active">
<div id="tp_x_Active" class="<?php echo EW_ITEM_TEMPLATE_CLASSNAME ?>"><label><input type="radio" name="x_Active" id="x_Active" title="<?php echo $CPDAssessors->Active->FldTitle() ?>" value="{value}"<?php echo $CPDAssessors->Active->EditAttributes() ?>></label></div>
<div id="dsl_x_Active" repeatcolumn="5">
<?php
$arwrk = $CPDAssessors->Active->EditValue;
if (is_array($arwrk)) {
$rowswrk = count($arwrk);
$emptywrk = TRUE;
for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
$selwrk = (strval($CPDAssessors->Active->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_Active" id="x_Active" title="<?php echo $CPDAssessors->Active->FldTitle() ?>" value="<?php echo ew_HtmlEncode($arwrk[$rowcntwrk][0]) ?>"<?php echo $selwrk ?><?php echo $CPDAssessors->Active->EditAttributes() ?>><?php echo $arwrk[$rowcntwrk][1] ?></label>
<?php echo ew_RepeatColumnTable($rowswrk, $rowcntwrk, 5, 2) ?>
<?php
}
}
?>
</div>
</span><?php echo $CPDAssessors->Active->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->DocumentName1->Visible) { // DocumentName1 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->DocumentName1->FldCaption() ?></td>
<td<?php echo $CPDAssessors->DocumentName1->CellAttributes() ?>><span id="el_DocumentName1">
<input type="text" name="x_DocumentName1" id="x_DocumentName1" title="<?php echo $CPDAssessors->DocumentName1->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->DocumentName1->EditValue ?>"<?php echo $CPDAssessors->DocumentName1->EditAttributes() ?>>
</span><?php echo $CPDAssessors->DocumentName1->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Document1->Visible) { // Document1 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Document1->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Document1->CellAttributes() ?>><span id="el_Document1">
<input type="file" name="x_Document1" id="x_Document1" title="<?php echo $CPDAssessors->Document1->FldTitle() ?>" size="30"<?php echo $CPDAssessors->Document1->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->Document1->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->DocumentName2->Visible) { // DocumentName2 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->DocumentName2->FldCaption() ?></td>
<td<?php echo $CPDAssessors->DocumentName2->CellAttributes() ?>><span id="el_DocumentName2">
<input type="text" name="x_DocumentName2" id="x_DocumentName2" title="<?php echo $CPDAssessors->DocumentName2->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->DocumentName2->EditValue ?>"<?php echo $CPDAssessors->DocumentName2->EditAttributes() ?>>
</span><?php echo $CPDAssessors->DocumentName2->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Document2->Visible) { // Document2 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Document2->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Document2->CellAttributes() ?>><span id="el_Document2">
<input type="file" name="x_Document2" id="x_Document2" title="<?php echo $CPDAssessors->Document2->FldTitle() ?>" size="30"<?php echo $CPDAssessors->Document2->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->Document2->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->DocumentName3->Visible) { // DocumentName3 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->DocumentName3->FldCaption() ?></td>
<td<?php echo $CPDAssessors->DocumentName3->CellAttributes() ?>><span id="el_DocumentName3">
<input type="text" name="x_DocumentName3" id="x_DocumentName3" title="<?php echo $CPDAssessors->DocumentName3->FldTitle() ?>" size="30" maxlength="255" value="<?php echo $CPDAssessors->DocumentName3->EditValue ?>"<?php echo $CPDAssessors->DocumentName3->EditAttributes() ?>>
</span><?php echo $CPDAssessors->DocumentName3->CustomMsg ?></td>
</tr>
<?php } ?>
<?php if ($CPDAssessors->Document3->Visible) { // Document3 ?>
<tr<?php echo $CPDAssessors->RowAttributes() ?>>
<td class="ewTableHeader"><?php echo $CPDAssessors->Document3->FldCaption() ?></td>
<td<?php echo $CPDAssessors->Document3->CellAttributes() ?>><span id="el_Document3">
<input type="file" name="x_Document3" id="x_Document3" title="<?php echo $CPDAssessors->Document3->FldTitle() ?>" size="30"<?php echo $CPDAssessors->Document3->EditAttributes() ?>>
</div>
</span><?php echo $CPDAssessors->Document3->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
$CPDAssessors_add->Page_Terminate();
?>
<?php
//
// Page class
//
class cCPDAssessors_add {
// Page ID
var $PageID = 'add';
// Table name
var $TableName = 'CPDAssessors';
// Page object name
var $PageObjName = 'CPDAssessors_add';
// Page name
function PageName() {
return ew_CurrentPage();
}
// Page URL
function PageUrl() {
$PageUrl = ew_CurrentPage() . "?";
global $CPDAssessors;
if ($CPDAssessors->UseTokenInUrl) $PageUrl .= "t=" . $CPDAssessors->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, $CPDAssessors;
if ($CPDAssessors->UseTokenInUrl) {
if ($objForm)
return ($CPDAssessors->TableVar == $objForm->GetValue("t"));
if (@$_GET["t"] <> "")
return ($CPDAssessors->TableVar == $_GET["t"]);
} else {
return TRUE;
}
}
//
// Page class constructor
//
function __construct() {
global $conn, $Language;
// Language object
$Language = new cLanguage();
// Table object (CPDAssessors)
$GLOBALS["CPDAssessors"] = new cCPDAssessors();
// Table object (CPDAdminUsers)
$GLOBALS['CPDAdminUsers'] = new cCPDAdminUsers();
// 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", 'CPDAssessors', 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 $CPDAssessors;
// User profile
$UserProfile = new cUserProfile();
$UserProfile->LoadProfile(@$_SESSION[EW_SESSION_USER_PROFILE]);
// Security
$Security = new cAdvancedSecurity();
if (IsPasswordExpired())
$this->Page_Terminate("changepwd.php");
if (!$Security->IsLoggedIn()) $Security->AutoLogin();
if (!$Security->IsLoggedIn()) {
$Security->SaveLastUrl();
$this->Page_Terminate("login.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, $CPDAssessors;
// Load key values from QueryString
$bCopy = TRUE;
if (@$_GET["CPDAssessorID"] != "") {
$CPDAssessors->CPDAssessorID->setQueryStringValue($_GET["CPDAssessorID"]);
} else {
$bCopy = FALSE;
}
// Process form if post back
if (@$_POST["a_add"] <> "") {
$CPDAssessors->CurrentAction = $_POST["a_add"]; // Get form action
$this->GetUploadFiles(); // Get upload files
$this->LoadFormValues(); // Load form values
// Validate form
if (!$this->ValidateForm()) {
$CPDAssessors->CurrentAction = "I"; // Form error, reset action
$this->setMessage($gsFormError);
}
} else { // Not post back
if ($bCopy) {
$CPDAssessors->CurrentAction = "C"; // Copy record
} else {
$CPDAssessors->CurrentAction = "I"; // Display blank record
$this->LoadDefaultValues(); // Load default values
}
}
// Perform action based on action code
switch ($CPDAssessors->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("CPDAssessorslist.php"); // No matching record, return to list
}
break;
case "A": // ' Add new record
$CPDAssessors->SendEmail = TRUE; // Send email on add success
if ($this->AddRow()) { // Add successful
$this->setMessage($Language->Phrase("AddSuccess")); // Set up success message
$sReturnUrl = $CPDAssessors->getReturnUrl();
if (ew_GetPageName($sReturnUrl) == "CPDAssessorsview.php")
$sReturnUrl = $CPDAssessors->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
$CPDAssessors->RowType = EW_ROWTYPE_ADD; // Render add type
// Render row
$this->RenderRow();
}
// Get upload files
function GetUploadFiles() {
global $objForm, $CPDAssessors;
// Get upload data
if ($CPDAssessors->CVFile->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->CVFile->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CPDAssessors->QualificationFile->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->QualificationFile->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CPDAssessors->NDAFile->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->NDAFile->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CPDAssessors->Document1->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->Document1->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CPDAssessors->Document2->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->Document2->Upload->Message;
$this->Page_Terminate();
exit();
}
if ($CPDAssessors->Document3->Upload->UploadFile()) {
// No action required
} else {
echo $CPDAssessors->Document3->Upload->Message;
$this->Page_Terminate();
exit();
}
}
// Load default values
function LoadDefaultValues() {
global $CPDAssessors;
$CPDAssessors->CVFile->CurrentValue = NULL; // Clear file related field
$CPDAssessors->QualificationFile->CurrentValue = NULL; // Clear file related field
$CPDAssessors->NDAFile->CurrentValue = NULL; // Clear file related field
$CPDAssessors->Active->CurrentValue = 1;
$CPDAssessors->Document1->CurrentValue = NULL; // Clear file related field
$CPDAssessors->Document2->CurrentValue = NULL; // Clear file related field
$CPDAssessors->Document3->CurrentValue = NULL; // Clear file related field
}
// Load form values
function LoadFormValues() {
// Load from form
global $objForm, $CPDAssessors;
$CPDAssessors->Title->setFormValue($objForm->GetValue("x_Title"));
$CPDAssessors->KnownAs->setFormValue($objForm->GetValue("x_KnownAs"));
$CPDAssessors->FirstName->setFormValue($objForm->GetValue("x_FirstName"));
$CPDAssessors->Surname->setFormValue($objForm->GetValue("x_Surname"));
$CPDAssessors->Designation->setFormValue($objForm->GetValue("x_Designation"));
$CPDAssessors->Department->setFormValue($objForm->GetValue("x_Department"));
$CPDAssessors->Organisation->setFormValue($objForm->GetValue("x_Organisation"));
$CPDAssessors->PostalAddress->setFormValue($objForm->GetValue("x_PostalAddress"));
$CPDAssessors->PhysicalAddress->setFormValue($objForm->GetValue("x_PhysicalAddress"));
$CPDAssessors->CellNumber->setFormValue($objForm->GetValue("x_CellNumber"));
$CPDAssessors->EmailAddress->setFormValue($objForm->GetValue("x_EmailAddress"));
$CPDAssessors->ProfessionalCouncil->setFormValue($objForm->GetValue("x_ProfessionalCouncil"));
$CPDAssessors->ProfRegNo->setFormValue($objForm->GetValue("x_ProfRegNo"));
$CPDAssessors->adminusername->setFormValue($objForm->GetValue("x_adminusername"));
$CPDAssessors->DateUpdated->setFormValue($objForm->GetValue("x_DateUpdated"));
$CPDAssessors->DateUpdated->CurrentValue = ew_UnFormatDateTime($CPDAssessors->DateUpdated->CurrentValue, 5);
$CPDAssessors->Active->setFormValue($objForm->GetValue("x_Active"));
$CPDAssessors->DocumentName1->setFormValue($objForm->GetValue("x_DocumentName1"));
$CPDAssessors->DocumentName2->setFormValue($objForm->GetValue("x_DocumentName2"));
$CPDAssessors->DocumentName3->setFormValue($objForm->GetValue("x_DocumentName3"));
$CPDAssessors->CPDAssessorID->setFormValue($objForm->GetValue("x_CPDAssessorID"));
}
// Restore form values
function RestoreFormValues() {
global $objForm, $CPDAssessors;
$CPDAssessors->CPDAssessorID->CurrentValue = $CPDAssessors->CPDAssessorID->FormValue;
$CPDAssessors->Title->CurrentValue = $CPDAssessors->Title->FormValue;
$CPDAssessors->KnownAs->CurrentValue = $CPDAssessors->KnownAs->FormValue;
$CPDAssessors->FirstName->CurrentValue = $CPDAssessors->FirstName->FormValue;
$CPDAssessors->Surname->CurrentValue = $CPDAssessors->Surname->FormValue;
$CPDAssessors->Designation->CurrentValue = $CPDAssessors->Designation->FormValue;
$CPDAssessors->Department->CurrentValue = $CPDAssessors->Department->FormValue;
$CPDAssessors->Organisation->CurrentValue = $CPDAssessors->Organisation->FormValue;
$CPDAssessors->PostalAddress->CurrentValue = $CPDAssessors->PostalAddress->FormValue;
$CPDAssessors->PhysicalAddress->CurrentValue = $CPDAssessors->PhysicalAddress->FormValue;
$CPDAssessors->CellNumber->CurrentValue = $CPDAssessors->CellNumber->FormValue;
$CPDAssessors->EmailAddress->CurrentValue = $CPDAssessors->EmailAddress->FormValue;
$CPDAssessors->ProfessionalCouncil->CurrentValue = $CPDAssessors->ProfessionalCouncil->FormValue;
$CPDAssessors->ProfRegNo->CurrentValue = $CPDAssessors->ProfRegNo->FormValue;
$CPDAssessors->adminusername->CurrentValue = $CPDAssessors->adminusername->FormValue;
$CPDAssessors->DateUpdated->CurrentValue = $CPDAssessors->DateUpdated->FormValue;
$CPDAssessors->DateUpdated->CurrentValue = ew_UnFormatDateTime($CPDAssessors->DateUpdated->CurrentValue, 5);
$CPDAssessors->Active->CurrentValue = $CPDAssessors->Active->FormValue;
$CPDAssessors->DocumentName1->CurrentValue = $CPDAssessors->DocumentName1->FormValue;
$CPDAssessors->DocumentName2->CurrentValue = $CPDAssessors->DocumentName2->FormValue;
$CPDAssessors->DocumentName3->CurrentValue = $CPDAssessors->DocumentName3->FormValue;
}
// Load row based on key values
function LoadRow() {
global $conn, $Security, $CPDAssessors;
$sFilter = $CPDAssessors->KeyFilter();
// Call Row Selecting event
$CPDAssessors->Row_Selecting($sFilter);
// Load SQL based on filter
$CPDAssessors->CurrentFilter = $sFilter;
$sSql = $CPDAssessors->SQL();
$res = FALSE;
$rs = ew_LoadRecordset($sSql);
if ($rs && !$rs->EOF) {
$res = TRUE;
$this->LoadRowValues($rs); // Load row values
// Call Row Selected event
$CPDAssessors->Row_Selected($rs);
$rs->Close();
}
return $res;
}
// Load row values from recordset
function LoadRowValues(&$rs) {
global $conn, $CPDAssessors;
$CPDAssessors->CPDAssessorID->setDbValue($rs->fields('CPDAssessorID'));
$CPDAssessors->Title->setDbValue($rs->fields('Title'));
$CPDAssessors->KnownAs->setDbValue($rs->fields('KnownAs'));
$CPDAssessors->FirstName->setDbValue($rs->fields('FirstName'));
$CPDAssessors->Surname->setDbValue($rs->fields('Surname'));
$CPDAssessors->Designation->setDbValue($rs->fields('Designation'));
$CPDAssessors->Department->setDbValue($rs->fields('Department'));
$CPDAssessors->Organisation->setDbValue($rs->fields('Organisation'));
$CPDAssessors->PostalAddress->setDbValue($rs->fields('PostalAddress'));
$CPDAssessors->PhysicalAddress->setDbValue($rs->fields('PhysicalAddress'));
$CPDAssessors->CellNumber->setDbValue($rs->fields('CellNumber'));
$CPDAssessors->EmailAddress->setDbValue($rs->fields('EmailAddress'));
$CPDAssessors->ProfessionalCouncil->setDbValue($rs->fields('ProfessionalCouncil'));
$CPDAssessors->ProfRegNo->setDbValue($rs->fields('ProfRegNo'));
$CPDAssessors->CVFile->Upload->DbValue = $rs->fields('CVFile');
$CPDAssessors->QualificationFile->Upload->DbValue = $rs->fields('QualificationFile');
$CPDAssessors->NDAFile->Upload->DbValue = $rs->fields('NDAFile');
$CPDAssessors->adminusername->setDbValue($rs->fields('adminusername'));
$CPDAssessors->DateUpdated->setDbValue($rs->fields('DateUpdated'));
$CPDAssessors->Active->setDbValue($rs->fields('Active'));
$CPDAssessors->DocumentName1->setDbValue($rs->fields('DocumentName1'));
$CPDAssessors->Document1->Upload->DbValue = $rs->fields('Document1');
$CPDAssessors->DocumentName2->setDbValue($rs->fields('DocumentName2'));
$CPDAssessors->Document2->Upload->DbValue = $rs->fields('Document2');
$CPDAssessors->DocumentName3->setDbValue($rs->fields('DocumentName3'));
$CPDAssessors->Document3->Upload->DbValue = $rs->fields('Document3');
}
// Render row values based on field settings
function RenderRow() {
global $conn, $Security, $Language, $CPDAssessors;
// Initialize URLs
// Call Row_Rendering event
$CPDAssessors->Row_Rendering();
// Common render codes for all row types
// Title
$CPDAssessors->Title->CellCssStyle = ""; $CPDAssessors->Title->CellCssClass = "";
$CPDAssessors->Title->CellAttrs = array(); $CPDAssessors->Title->ViewAttrs = array(); $CPDAssessors->Title->EditAttrs = array();
// KnownAs
$CPDAssessors->KnownAs->CellCssStyle = ""; $CPDAssessors->KnownAs->CellCssClass = "";
$CPDAssessors->KnownAs->CellAttrs = array(); $CPDAssessors->KnownAs->ViewAttrs = array(); $CPDAssessors->KnownAs->EditAttrs = array();
// FirstName
$CPDAssessors->FirstName->CellCssStyle = ""; $CPDAssessors->FirstName->CellCssClass = "";
$CPDAssessors->FirstName->CellAttrs = array(); $CPDAssessors->FirstName->ViewAttrs = array(); $CPDAssessors->FirstName->EditAttrs = array();
// Surname
$CPDAssessors->Surname->CellCssStyle = ""; $CPDAssessors->Surname->CellCssClass = "";
$CPDAssessors->Surname->CellAttrs = array(); $CPDAssessors->Surname->ViewAttrs = array(); $CPDAssessors->Surname->EditAttrs = array();
// Designation
$CPDAssessors->Designation->CellCssStyle = ""; $CPDAssessors->Designation->CellCssClass = "";
$CPDAssessors->Designation->CellAttrs = array(); $CPDAssessors->Designation->ViewAttrs = array(); $CPDAssessors->Designation->EditAttrs = array();
// Department
$CPDAssessors->Department->CellCssStyle = ""; $CPDAssessors->Department->CellCssClass = "";
$CPDAssessors->Department->CellAttrs = array(); $CPDAssessors->Department->ViewAttrs = array(); $CPDAssessors->Department->EditAttrs = array();
// Organisation
$CPDAssessors->Organisation->CellCssStyle = ""; $CPDAssessors->Organisation->CellCssClass = "";
$CPDAssessors->Organisation->CellAttrs = array(); $CPDAssessors->Organisation->ViewAttrs = array(); $CPDAssessors->Organisation->EditAttrs = array();
// PostalAddress
$CPDAssessors->PostalAddress->CellCssStyle = ""; $CPDAssessors->PostalAddress->CellCssClass = "";
$CPDAssessors->PostalAddress->CellAttrs = array(); $CPDAssessors->PostalAddress->ViewAttrs = array(); $CPDAssessors->PostalAddress->EditAttrs = array();
// PhysicalAddress
$CPDAssessors->PhysicalAddress->CellCssStyle = ""; $CPDAssessors->PhysicalAddress->CellCssClass = "";
$CPDAssessors->PhysicalAddress->CellAttrs = array(); $CPDAssessors->PhysicalAddress->ViewAttrs = array(); $CPDAssessors->PhysicalAddress->EditAttrs = array();
// CellNumber
$CPDAssessors->CellNumber->CellCssStyle = ""; $CPDAssessors->CellNumber->CellCssClass = "";
$CPDAssessors->CellNumber->CellAttrs = array(); $CPDAssessors->CellNumber->ViewAttrs = array(); $CPDAssessors->CellNumber->EditAttrs = array();
// EmailAddress
$CPDAssessors->EmailAddress->CellCssStyle = ""; $CPDAssessors->EmailAddress->CellCssClass = "";
$CPDAssessors->EmailAddress->CellAttrs = array(); $CPDAssessors->EmailAddress->ViewAttrs = array(); $CPDAssessors->EmailAddress->EditAttrs = array();
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->CellCssStyle = ""; $CPDAssessors->ProfessionalCouncil->CellCssClass = "";
$CPDAssessors->ProfessionalCouncil->CellAttrs = array(); $CPDAssessors->ProfessionalCouncil->ViewAttrs = array(); $CPDAssessors->ProfessionalCouncil->EditAttrs = array();
// ProfRegNo
$CPDAssessors->ProfRegNo->CellCssStyle = ""; $CPDAssessors->ProfRegNo->CellCssClass = "";
$CPDAssessors->ProfRegNo->CellAttrs = array(); $CPDAssessors->ProfRegNo->ViewAttrs = array(); $CPDAssessors->ProfRegNo->EditAttrs = array();
// CVFile
$CPDAssessors->CVFile->CellCssStyle = ""; $CPDAssessors->CVFile->CellCssClass = "";
$CPDAssessors->CVFile->CellAttrs = array(); $CPDAssessors->CVFile->ViewAttrs = array(); $CPDAssessors->CVFile->EditAttrs = array();
// QualificationFile
$CPDAssessors->QualificationFile->CellCssStyle = ""; $CPDAssessors->QualificationFile->CellCssClass = "";
$CPDAssessors->QualificationFile->CellAttrs = array(); $CPDAssessors->QualificationFile->ViewAttrs = array(); $CPDAssessors->QualificationFile->EditAttrs = array();
// NDAFile
$CPDAssessors->NDAFile->CellCssStyle = ""; $CPDAssessors->NDAFile->CellCssClass = "";
$CPDAssessors->NDAFile->CellAttrs = array(); $CPDAssessors->NDAFile->ViewAttrs = array(); $CPDAssessors->NDAFile->EditAttrs = array();
// adminusername
$CPDAssessors->adminusername->CellCssStyle = ""; $CPDAssessors->adminusername->CellCssClass = "";
$CPDAssessors->adminusername->CellAttrs = array(); $CPDAssessors->adminusername->ViewAttrs = array(); $CPDAssessors->adminusername->EditAttrs = array();
// DateUpdated
$CPDAssessors->DateUpdated->CellCssStyle = ""; $CPDAssessors->DateUpdated->CellCssClass = "";
$CPDAssessors->DateUpdated->CellAttrs = array(); $CPDAssessors->DateUpdated->ViewAttrs = array(); $CPDAssessors->DateUpdated->EditAttrs = array();
// Active
$CPDAssessors->Active->CellCssStyle = ""; $CPDAssessors->Active->CellCssClass = "";
$CPDAssessors->Active->CellAttrs = array(); $CPDAssessors->Active->ViewAttrs = array(); $CPDAssessors->Active->EditAttrs = array();
// DocumentName1
$CPDAssessors->DocumentName1->CellCssStyle = ""; $CPDAssessors->DocumentName1->CellCssClass = "";
$CPDAssessors->DocumentName1->CellAttrs = array(); $CPDAssessors->DocumentName1->ViewAttrs = array(); $CPDAssessors->DocumentName1->EditAttrs = array();
// Document1
$CPDAssessors->Document1->CellCssStyle = ""; $CPDAssessors->Document1->CellCssClass = "";
$CPDAssessors->Document1->CellAttrs = array(); $CPDAssessors->Document1->ViewAttrs = array(); $CPDAssessors->Document1->EditAttrs = array();
// DocumentName2
$CPDAssessors->DocumentName2->CellCssStyle = ""; $CPDAssessors->DocumentName2->CellCssClass = "";
$CPDAssessors->DocumentName2->CellAttrs = array(); $CPDAssessors->DocumentName2->ViewAttrs = array(); $CPDAssessors->DocumentName2->EditAttrs = array();
// Document2
$CPDAssessors->Document2->CellCssStyle = ""; $CPDAssessors->Document2->CellCssClass = "";
$CPDAssessors->Document2->CellAttrs = array(); $CPDAssessors->Document2->ViewAttrs = array(); $CPDAssessors->Document2->EditAttrs = array();
// DocumentName3
$CPDAssessors->DocumentName3->CellCssStyle = ""; $CPDAssessors->DocumentName3->CellCssClass = "";
$CPDAssessors->DocumentName3->CellAttrs = array(); $CPDAssessors->DocumentName3->ViewAttrs = array(); $CPDAssessors->DocumentName3->EditAttrs = array();
// Document3
$CPDAssessors->Document3->CellCssStyle = ""; $CPDAssessors->Document3->CellCssClass = "";
$CPDAssessors->Document3->CellAttrs = array(); $CPDAssessors->Document3->ViewAttrs = array(); $CPDAssessors->Document3->EditAttrs = array();
if ($CPDAssessors->RowType == EW_ROWTYPE_VIEW) { // View row
// CPDAssessorID
$CPDAssessors->CPDAssessorID->ViewValue = $CPDAssessors->CPDAssessorID->CurrentValue;
$CPDAssessors->CPDAssessorID->CssStyle = "";
$CPDAssessors->CPDAssessorID->CssClass = "";
$CPDAssessors->CPDAssessorID->ViewCustomAttributes = "";
// Title
$CPDAssessors->Title->ViewValue = $CPDAssessors->Title->CurrentValue;
$CPDAssessors->Title->CssStyle = "";
$CPDAssessors->Title->CssClass = "";
$CPDAssessors->Title->ViewCustomAttributes = "";
// KnownAs
$CPDAssessors->KnownAs->ViewValue = $CPDAssessors->KnownAs->CurrentValue;
$CPDAssessors->KnownAs->CssStyle = "";
$CPDAssessors->KnownAs->CssClass = "";
$CPDAssessors->KnownAs->ViewCustomAttributes = "";
// FirstName
$CPDAssessors->FirstName->ViewValue = $CPDAssessors->FirstName->CurrentValue;
$CPDAssessors->FirstName->CssStyle = "";
$CPDAssessors->FirstName->CssClass = "";
$CPDAssessors->FirstName->ViewCustomAttributes = "";
// Surname
$CPDAssessors->Surname->ViewValue = $CPDAssessors->Surname->CurrentValue;
$CPDAssessors->Surname->CssStyle = "";
$CPDAssessors->Surname->CssClass = "";
$CPDAssessors->Surname->ViewCustomAttributes = "";
// Designation
$CPDAssessors->Designation->ViewValue = $CPDAssessors->Designation->CurrentValue;
$CPDAssessors->Designation->CssStyle = "";
$CPDAssessors->Designation->CssClass = "";
$CPDAssessors->Designation->ViewCustomAttributes = "";
// Department
$CPDAssessors->Department->ViewValue = $CPDAssessors->Department->CurrentValue;
$CPDAssessors->Department->CssStyle = "";
$CPDAssessors->Department->CssClass = "";
$CPDAssessors->Department->ViewCustomAttributes = "";
// Organisation
$CPDAssessors->Organisation->ViewValue = $CPDAssessors->Organisation->CurrentValue;
$CPDAssessors->Organisation->CssStyle = "";
$CPDAssessors->Organisation->CssClass = "";
$CPDAssessors->Organisation->ViewCustomAttributes = "";
// PostalAddress
$CPDAssessors->PostalAddress->ViewValue = $CPDAssessors->PostalAddress->CurrentValue;
$CPDAssessors->PostalAddress->CssStyle = "";
$CPDAssessors->PostalAddress->CssClass = "";
$CPDAssessors->PostalAddress->ViewCustomAttributes = "";
// PhysicalAddress
$CPDAssessors->PhysicalAddress->ViewValue = $CPDAssessors->PhysicalAddress->CurrentValue;
$CPDAssessors->PhysicalAddress->CssStyle = "";
$CPDAssessors->PhysicalAddress->CssClass = "";
$CPDAssessors->PhysicalAddress->ViewCustomAttributes = "";
// CellNumber
$CPDAssessors->CellNumber->ViewValue = $CPDAssessors->CellNumber->CurrentValue;
$CPDAssessors->CellNumber->CssStyle = "";
$CPDAssessors->CellNumber->CssClass = "";
$CPDAssessors->CellNumber->ViewCustomAttributes = "";
// EmailAddress
$CPDAssessors->EmailAddress->ViewValue = $CPDAssessors->EmailAddress->CurrentValue;
$CPDAssessors->EmailAddress->CssStyle = "";
$CPDAssessors->EmailAddress->CssClass = "";
$CPDAssessors->EmailAddress->ViewCustomAttributes = "";
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->ViewValue = $CPDAssessors->ProfessionalCouncil->CurrentValue;
$CPDAssessors->ProfessionalCouncil->CssStyle = "";
$CPDAssessors->ProfessionalCouncil->CssClass = "";
$CPDAssessors->ProfessionalCouncil->ViewCustomAttributes = "";
// ProfRegNo
$CPDAssessors->ProfRegNo->ViewValue = $CPDAssessors->ProfRegNo->CurrentValue;
$CPDAssessors->ProfRegNo->CssStyle = "";
$CPDAssessors->ProfRegNo->CssClass = "";
$CPDAssessors->ProfRegNo->ViewCustomAttributes = "";
// CVFile
if (!ew_Empty($CPDAssessors->CVFile->Upload->DbValue)) {
$CPDAssessors->CVFile->ViewValue = $CPDAssessors->CVFile->Upload->DbValue;
} else {
$CPDAssessors->CVFile->ViewValue = "";
}
$CPDAssessors->CVFile->CssStyle = "";
$CPDAssessors->CVFile->CssClass = "";
$CPDAssessors->CVFile->ViewCustomAttributes = "";
// QualificationFile
if (!ew_Empty($CPDAssessors->QualificationFile->Upload->DbValue)) {
$CPDAssessors->QualificationFile->ViewValue = $CPDAssessors->QualificationFile->Upload->DbValue;
} else {
$CPDAssessors->QualificationFile->ViewValue = "";
}
$CPDAssessors->QualificationFile->CssStyle = "";
$CPDAssessors->QualificationFile->CssClass = "";
$CPDAssessors->QualificationFile->ViewCustomAttributes = "";
// NDAFile
if (!ew_Empty($CPDAssessors->NDAFile->Upload->DbValue)) {
$CPDAssessors->NDAFile->ViewValue = $CPDAssessors->NDAFile->Upload->DbValue;
} else {
$CPDAssessors->NDAFile->ViewValue = "";
}
$CPDAssessors->NDAFile->CssStyle = "";
$CPDAssessors->NDAFile->CssClass = "";
$CPDAssessors->NDAFile->ViewCustomAttributes = "";
// adminusername
if (strval($CPDAssessors->adminusername->CurrentValue) <> "") {
$sFilterWrk = "`adminusername` = '" . ew_AdjustSql($CPDAssessors->adminusername->CurrentValue) . "'";
$sSqlWrk = "SELECT `adminusername` FROM `CPDAdminUsers`";
$sWhereWrk = "";
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . "`level`=11" . ")";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
if ($rswrk && !$rswrk->EOF) { // Lookup values found
$CPDAssessors->adminusername->ViewValue = $rswrk->fields('adminusername');
$rswrk->Close();
} else {
$CPDAssessors->adminusername->ViewValue = $CPDAssessors->adminusername->CurrentValue;
}
} else {
$CPDAssessors->adminusername->ViewValue = NULL;
}
$CPDAssessors->adminusername->CssStyle = "";
$CPDAssessors->adminusername->CssClass = "";
$CPDAssessors->adminusername->ViewCustomAttributes = "";
// DateUpdated
$CPDAssessors->DateUpdated->ViewValue = $CPDAssessors->DateUpdated->CurrentValue;
$CPDAssessors->DateUpdated->ViewValue = ew_FormatDateTime($CPDAssessors->DateUpdated->ViewValue, 5);
$CPDAssessors->DateUpdated->CssStyle = "";
$CPDAssessors->DateUpdated->CssClass = "";
$CPDAssessors->DateUpdated->ViewCustomAttributes = "";
// Active
if (strval($CPDAssessors->Active->CurrentValue) <> "") {
switch ($CPDAssessors->Active->CurrentValue) {
case "1":
$CPDAssessors->Active->ViewValue = "Yes";
break;
case "0":
$CPDAssessors->Active->ViewValue = "No";
break;
default:
$CPDAssessors->Active->ViewValue = $CPDAssessors->Active->CurrentValue;
}
} else {
$CPDAssessors->Active->ViewValue = NULL;
}
$CPDAssessors->Active->CssStyle = "";
$CPDAssessors->Active->CssClass = "";
$CPDAssessors->Active->ViewCustomAttributes = "";
// DocumentName1
$CPDAssessors->DocumentName1->ViewValue = $CPDAssessors->DocumentName1->CurrentValue;
$CPDAssessors->DocumentName1->CssStyle = "";
$CPDAssessors->DocumentName1->CssClass = "";
$CPDAssessors->DocumentName1->ViewCustomAttributes = "";
// Document1
if (!ew_Empty($CPDAssessors->Document1->Upload->DbValue)) {
$CPDAssessors->Document1->ViewValue = $CPDAssessors->Document1->Upload->DbValue;
} else {
$CPDAssessors->Document1->ViewValue = "";
}
$CPDAssessors->Document1->CssStyle = "";
$CPDAssessors->Document1->CssClass = "";
$CPDAssessors->Document1->ViewCustomAttributes = "";
// DocumentName2
$CPDAssessors->DocumentName2->ViewValue = $CPDAssessors->DocumentName2->CurrentValue;
$CPDAssessors->DocumentName2->CssStyle = "";
$CPDAssessors->DocumentName2->CssClass = "";
$CPDAssessors->DocumentName2->ViewCustomAttributes = "";
// Document2
if (!ew_Empty($CPDAssessors->Document2->Upload->DbValue)) {
$CPDAssessors->Document2->ViewValue = $CPDAssessors->Document2->Upload->DbValue;
} else {
$CPDAssessors->Document2->ViewValue = "";
}
$CPDAssessors->Document2->CssStyle = "";
$CPDAssessors->Document2->CssClass = "";
$CPDAssessors->Document2->ViewCustomAttributes = "";
// DocumentName3
$CPDAssessors->DocumentName3->ViewValue = $CPDAssessors->DocumentName3->CurrentValue;
$CPDAssessors->DocumentName3->CssStyle = "";
$CPDAssessors->DocumentName3->CssClass = "";
$CPDAssessors->DocumentName3->ViewCustomAttributes = "";
// Document3
if (!ew_Empty($CPDAssessors->Document3->Upload->DbValue)) {
$CPDAssessors->Document3->ViewValue = $CPDAssessors->Document3->Upload->DbValue;
} else {
$CPDAssessors->Document3->ViewValue = "";
}
$CPDAssessors->Document3->CssStyle = "";
$CPDAssessors->Document3->CssClass = "";
$CPDAssessors->Document3->ViewCustomAttributes = "";
// Title
$CPDAssessors->Title->HrefValue = "";
$CPDAssessors->Title->TooltipValue = "";
// KnownAs
$CPDAssessors->KnownAs->HrefValue = "";
$CPDAssessors->KnownAs->TooltipValue = "";
// FirstName
$CPDAssessors->FirstName->HrefValue = "";
$CPDAssessors->FirstName->TooltipValue = "";
// Surname
$CPDAssessors->Surname->HrefValue = "";
$CPDAssessors->Surname->TooltipValue = "";
// Designation
$CPDAssessors->Designation->HrefValue = "";
$CPDAssessors->Designation->TooltipValue = "";
// Department
$CPDAssessors->Department->HrefValue = "";
$CPDAssessors->Department->TooltipValue = "";
// Organisation
$CPDAssessors->Organisation->HrefValue = "";
$CPDAssessors->Organisation->TooltipValue = "";
// PostalAddress
$CPDAssessors->PostalAddress->HrefValue = "";
$CPDAssessors->PostalAddress->TooltipValue = "";
// PhysicalAddress
$CPDAssessors->PhysicalAddress->HrefValue = "";
$CPDAssessors->PhysicalAddress->TooltipValue = "";
// CellNumber
$CPDAssessors->CellNumber->HrefValue = "";
$CPDAssessors->CellNumber->TooltipValue = "";
// EmailAddress
$CPDAssessors->EmailAddress->HrefValue = "";
$CPDAssessors->EmailAddress->TooltipValue = "";
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->HrefValue = "";
$CPDAssessors->ProfessionalCouncil->TooltipValue = "";
// ProfRegNo
$CPDAssessors->ProfRegNo->HrefValue = "";
$CPDAssessors->ProfRegNo->TooltipValue = "";
// CVFile
if (!ew_Empty($CPDAssessors->CVFile->Upload->DbValue)) {
$CPDAssessors->CVFile->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->CVFile->UploadPath) . ((!empty($CPDAssessors->CVFile->ViewValue)) ? $CPDAssessors->CVFile->ViewValue : $CPDAssessors->CVFile->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->CVFile->HrefValue = ew_ConvertFullUrl($CPDAssessors->CVFile->HrefValue);
} else {
$CPDAssessors->CVFile->HrefValue = "";
}
$CPDAssessors->CVFile->TooltipValue = "";
// QualificationFile
if (!ew_Empty($CPDAssessors->QualificationFile->Upload->DbValue)) {
$CPDAssessors->QualificationFile->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->QualificationFile->UploadPath) . ((!empty($CPDAssessors->QualificationFile->ViewValue)) ? $CPDAssessors->QualificationFile->ViewValue : $CPDAssessors->QualificationFile->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->QualificationFile->HrefValue = ew_ConvertFullUrl($CPDAssessors->QualificationFile->HrefValue);
} else {
$CPDAssessors->QualificationFile->HrefValue = "";
}
$CPDAssessors->QualificationFile->TooltipValue = "";
// NDAFile
if (!ew_Empty($CPDAssessors->NDAFile->Upload->DbValue)) {
$CPDAssessors->NDAFile->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->NDAFile->UploadPath) . ((!empty($CPDAssessors->NDAFile->ViewValue)) ? $CPDAssessors->NDAFile->ViewValue : $CPDAssessors->NDAFile->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->NDAFile->HrefValue = ew_ConvertFullUrl($CPDAssessors->NDAFile->HrefValue);
} else {
$CPDAssessors->NDAFile->HrefValue = "";
}
$CPDAssessors->NDAFile->TooltipValue = "";
// adminusername
$CPDAssessors->adminusername->HrefValue = "";
$CPDAssessors->adminusername->TooltipValue = "";
// DateUpdated
$CPDAssessors->DateUpdated->HrefValue = "";
$CPDAssessors->DateUpdated->TooltipValue = "";
// Active
$CPDAssessors->Active->HrefValue = "";
$CPDAssessors->Active->TooltipValue = "";
// DocumentName1
$CPDAssessors->DocumentName1->HrefValue = "";
$CPDAssessors->DocumentName1->TooltipValue = "";
// Document1
if (!ew_Empty($CPDAssessors->Document1->Upload->DbValue)) {
$CPDAssessors->Document1->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->Document1->UploadPath) . ((!empty($CPDAssessors->Document1->ViewValue)) ? $CPDAssessors->Document1->ViewValue : $CPDAssessors->Document1->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->Document1->HrefValue = ew_ConvertFullUrl($CPDAssessors->Document1->HrefValue);
} else {
$CPDAssessors->Document1->HrefValue = "";
}
$CPDAssessors->Document1->TooltipValue = "";
// DocumentName2
$CPDAssessors->DocumentName2->HrefValue = "";
$CPDAssessors->DocumentName2->TooltipValue = "";
// Document2
if (!ew_Empty($CPDAssessors->Document2->Upload->DbValue)) {
$CPDAssessors->Document2->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->Document2->UploadPath) . ((!empty($CPDAssessors->Document2->ViewValue)) ? $CPDAssessors->Document2->ViewValue : $CPDAssessors->Document2->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->Document2->HrefValue = ew_ConvertFullUrl($CPDAssessors->Document2->HrefValue);
} else {
$CPDAssessors->Document2->HrefValue = "";
}
$CPDAssessors->Document2->TooltipValue = "";
// DocumentName3
$CPDAssessors->DocumentName3->HrefValue = "";
$CPDAssessors->DocumentName3->TooltipValue = "";
// Document3
if (!ew_Empty($CPDAssessors->Document3->Upload->DbValue)) {
$CPDAssessors->Document3->HrefValue = ew_UploadPathEx(FALSE, $CPDAssessors->Document3->UploadPath) . ((!empty($CPDAssessors->Document3->ViewValue)) ? $CPDAssessors->Document3->ViewValue : $CPDAssessors->Document3->CurrentValue);
if ($CPDAssessors->Export <> "") $CPDAssessors->Document3->HrefValue = ew_ConvertFullUrl($CPDAssessors->Document3->HrefValue);
} else {
$CPDAssessors->Document3->HrefValue = "";
}
$CPDAssessors->Document3->TooltipValue = "";
} elseif ($CPDAssessors->RowType == EW_ROWTYPE_ADD) { // Add row
// Title
$CPDAssessors->Title->EditCustomAttributes = "";
$CPDAssessors->Title->EditValue = ew_HtmlEncode($CPDAssessors->Title->CurrentValue);
// KnownAs
$CPDAssessors->KnownAs->EditCustomAttributes = "";
$CPDAssessors->KnownAs->EditValue = ew_HtmlEncode($CPDAssessors->KnownAs->CurrentValue);
// FirstName
$CPDAssessors->FirstName->EditCustomAttributes = "";
$CPDAssessors->FirstName->EditValue = ew_HtmlEncode($CPDAssessors->FirstName->CurrentValue);
// Surname
$CPDAssessors->Surname->EditCustomAttributes = "";
$CPDAssessors->Surname->EditValue = ew_HtmlEncode($CPDAssessors->Surname->CurrentValue);
// Designation
$CPDAssessors->Designation->EditCustomAttributes = "";
$CPDAssessors->Designation->EditValue = ew_HtmlEncode($CPDAssessors->Designation->CurrentValue);
// Department
$CPDAssessors->Department->EditCustomAttributes = "";
$CPDAssessors->Department->EditValue = ew_HtmlEncode($CPDAssessors->Department->CurrentValue);
// Organisation
$CPDAssessors->Organisation->EditCustomAttributes = "";
$CPDAssessors->Organisation->EditValue = ew_HtmlEncode($CPDAssessors->Organisation->CurrentValue);
// PostalAddress
$CPDAssessors->PostalAddress->EditCustomAttributes = "";
$CPDAssessors->PostalAddress->EditValue = ew_HtmlEncode($CPDAssessors->PostalAddress->CurrentValue);
// PhysicalAddress
$CPDAssessors->PhysicalAddress->EditCustomAttributes = "";
$CPDAssessors->PhysicalAddress->EditValue = ew_HtmlEncode($CPDAssessors->PhysicalAddress->CurrentValue);
// CellNumber
$CPDAssessors->CellNumber->EditCustomAttributes = "";
$CPDAssessors->CellNumber->EditValue = ew_HtmlEncode($CPDAssessors->CellNumber->CurrentValue);
// EmailAddress
$CPDAssessors->EmailAddress->EditCustomAttributes = "";
$CPDAssessors->EmailAddress->EditValue = ew_HtmlEncode($CPDAssessors->EmailAddress->CurrentValue);
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->EditCustomAttributes = "";
$CPDAssessors->ProfessionalCouncil->EditValue = ew_HtmlEncode($CPDAssessors->ProfessionalCouncil->CurrentValue);
// ProfRegNo
$CPDAssessors->ProfRegNo->EditCustomAttributes = "";
$CPDAssessors->ProfRegNo->EditValue = ew_HtmlEncode($CPDAssessors->ProfRegNo->CurrentValue);
// CVFile
$CPDAssessors->CVFile->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->CVFile->Upload->DbValue)) {
$CPDAssessors->CVFile->EditValue = $CPDAssessors->CVFile->Upload->DbValue;
} else {
$CPDAssessors->CVFile->EditValue = "";
}
// QualificationFile
$CPDAssessors->QualificationFile->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->QualificationFile->Upload->DbValue)) {
$CPDAssessors->QualificationFile->EditValue = $CPDAssessors->QualificationFile->Upload->DbValue;
} else {
$CPDAssessors->QualificationFile->EditValue = "";
}
// NDAFile
$CPDAssessors->NDAFile->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->NDAFile->Upload->DbValue)) {
$CPDAssessors->NDAFile->EditValue = $CPDAssessors->NDAFile->Upload->DbValue;
} else {
$CPDAssessors->NDAFile->EditValue = "";
}
// adminusername
$CPDAssessors->adminusername->EditCustomAttributes = "";
$sFilterWrk = "";
$sSqlWrk = "SELECT `adminusername`, `adminusername`, '' AS Disp2Fld, '' AS SelectFilterFld FROM `CPDAdminUsers`";
$sWhereWrk = "";
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . "`level`=11" . ")";
if ($sFilterWrk <> "") {
if ($sWhereWrk <> "") $sWhereWrk .= " AND ";
$sWhereWrk .= "(" . $sFilterWrk . ")";
}
if ($sWhereWrk <> "") $sSqlWrk .= " WHERE " . $sWhereWrk;
$rswrk = $conn->Execute($sSqlWrk);
$arwrk = ($rswrk) ? $rswrk->GetRows() : array();
if ($rswrk) $rswrk->Close();
array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
$CPDAssessors->adminusername->EditValue = $arwrk;
// DateUpdated
// Active
$CPDAssessors->Active->EditCustomAttributes = "";
$arwrk = array();
$arwrk[] = array("1", "Yes");
$arwrk[] = array("0", "No");
$CPDAssessors->Active->EditValue = $arwrk;
// DocumentName1
$CPDAssessors->DocumentName1->EditCustomAttributes = "";
$CPDAssessors->DocumentName1->EditValue = ew_HtmlEncode($CPDAssessors->DocumentName1->CurrentValue);
// Document1
$CPDAssessors->Document1->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->Document1->Upload->DbValue)) {
$CPDAssessors->Document1->EditValue = $CPDAssessors->Document1->Upload->DbValue;
} else {
$CPDAssessors->Document1->EditValue = "";
}
// DocumentName2
$CPDAssessors->DocumentName2->EditCustomAttributes = "";
$CPDAssessors->DocumentName2->EditValue = ew_HtmlEncode($CPDAssessors->DocumentName2->CurrentValue);
// Document2
$CPDAssessors->Document2->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->Document2->Upload->DbValue)) {
$CPDAssessors->Document2->EditValue = $CPDAssessors->Document2->Upload->DbValue;
} else {
$CPDAssessors->Document2->EditValue = "";
}
// DocumentName3
$CPDAssessors->DocumentName3->EditCustomAttributes = "";
$CPDAssessors->DocumentName3->EditValue = ew_HtmlEncode($CPDAssessors->DocumentName3->CurrentValue);
// Document3
$CPDAssessors->Document3->EditCustomAttributes = "";
if (!ew_Empty($CPDAssessors->Document3->Upload->DbValue)) {
$CPDAssessors->Document3->EditValue = $CPDAssessors->Document3->Upload->DbValue;
} else {
$CPDAssessors->Document3->EditValue = "";
}
}
// Call Row Rendered event
if ($CPDAssessors->RowType <> EW_ROWTYPE_AGGREGATEINIT)
$CPDAssessors->Row_Rendered();
}
// Validate form
function ValidateForm() {
global $Language, $gsFormError, $CPDAssessors;
// Initialize form error message
$gsFormError = "";
if (!ew_CheckFileType($CPDAssessors->CVFile->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->CVFile->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->CVFile->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->CVFile->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->CVFile->Upload->Error);
}
if (!ew_CheckFileType($CPDAssessors->QualificationFile->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->QualificationFile->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->QualificationFile->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->QualificationFile->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->QualificationFile->Upload->Error);
}
if (!ew_CheckFileType($CPDAssessors->NDAFile->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->NDAFile->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->NDAFile->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->NDAFile->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->NDAFile->Upload->Error);
}
if (!ew_CheckFileType($CPDAssessors->Document1->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->Document1->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->Document1->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->Document1->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->Document1->Upload->Error);
}
if (!ew_CheckFileType($CPDAssessors->Document2->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->Document2->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->Document2->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->Document2->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->Document2->Upload->Error);
}
if (!ew_CheckFileType($CPDAssessors->Document3->Upload->FileName)) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("WrongFileType");
}
if ($CPDAssessors->Document3->Upload->FileSize > 0 && EW_MAX_FILE_SIZE > 0 && $CPDAssessors->Document3->Upload->FileSize > EW_MAX_FILE_SIZE) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= str_replace("%s", EW_MAX_FILE_SIZE, $Language->Phrase("MaxFileSize"));
}
if (in_array($CPDAssessors->Document3->Upload->Error, array(1, 2, 3, 6, 7, 8))) {
$gsFormError .= ($gsFormError <> "") ? "<br>" : "";
$gsFormError .= $Language->Phrase("PhpUploadErr" . $CPDAssessors->Document3->Upload->Error);
}
// Check if validation required
if (!EW_SERVER_VALIDATE)
return ($gsFormError == "");
if (!ew_CheckInteger($CPDAssessors->DocumentName2->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CPDAssessors->DocumentName2->FldErrMsg();
}
if (!ew_CheckInteger($CPDAssessors->DocumentName3->FormValue)) {
if ($gsFormError <> "") $gsFormError .= "<br>";
$gsFormError .= $CPDAssessors->DocumentName3->FldErrMsg();
}
// 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, $CPDAssessors;
$rsnew = array();
// Title
$CPDAssessors->Title->SetDbValueDef($rsnew, $CPDAssessors->Title->CurrentValue, NULL, FALSE);
// KnownAs
$CPDAssessors->KnownAs->SetDbValueDef($rsnew, $CPDAssessors->KnownAs->CurrentValue, NULL, FALSE);
// FirstName
$CPDAssessors->FirstName->SetDbValueDef($rsnew, $CPDAssessors->FirstName->CurrentValue, NULL, FALSE);
// Surname
$CPDAssessors->Surname->SetDbValueDef($rsnew, $CPDAssessors->Surname->CurrentValue, NULL, FALSE);
// Designation
$CPDAssessors->Designation->SetDbValueDef($rsnew, $CPDAssessors->Designation->CurrentValue, NULL, FALSE);
// Department
$CPDAssessors->Department->SetDbValueDef($rsnew, $CPDAssessors->Department->CurrentValue, NULL, FALSE);
// Organisation
$CPDAssessors->Organisation->SetDbValueDef($rsnew, $CPDAssessors->Organisation->CurrentValue, NULL, FALSE);
// PostalAddress
$CPDAssessors->PostalAddress->SetDbValueDef($rsnew, $CPDAssessors->PostalAddress->CurrentValue, NULL, FALSE);
// PhysicalAddress
$CPDAssessors->PhysicalAddress->SetDbValueDef($rsnew, $CPDAssessors->PhysicalAddress->CurrentValue, NULL, FALSE);
// CellNumber
$CPDAssessors->CellNumber->SetDbValueDef($rsnew, $CPDAssessors->CellNumber->CurrentValue, NULL, FALSE);
// EmailAddress
$CPDAssessors->EmailAddress->SetDbValueDef($rsnew, $CPDAssessors->EmailAddress->CurrentValue, NULL, FALSE);
// ProfessionalCouncil
$CPDAssessors->ProfessionalCouncil->SetDbValueDef($rsnew, $CPDAssessors->ProfessionalCouncil->CurrentValue, NULL, FALSE);
// ProfRegNo
$CPDAssessors->ProfRegNo->SetDbValueDef($rsnew, $CPDAssessors->ProfRegNo->CurrentValue, NULL, FALSE);
// CVFile
$CPDAssessors->CVFile->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->CVFile->Upload->Value)) {
$rsnew['CVFile'] = NULL;
} else {
$rsnew['CVFile'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->CVFile->UploadPath), $CPDAssessors->CVFile->Upload->FileName);
}
// QualificationFile
$CPDAssessors->QualificationFile->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->QualificationFile->Upload->Value)) {
$rsnew['QualificationFile'] = NULL;
} else {
$rsnew['QualificationFile'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->QualificationFile->UploadPath), $CPDAssessors->QualificationFile->Upload->FileName);
}
// NDAFile
$CPDAssessors->NDAFile->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->NDAFile->Upload->Value)) {
$rsnew['NDAFile'] = NULL;
} else {
$rsnew['NDAFile'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->NDAFile->UploadPath), $CPDAssessors->NDAFile->Upload->FileName);
}
// adminusername
$CPDAssessors->adminusername->SetDbValueDef($rsnew, $CPDAssessors->adminusername->CurrentValue, NULL, FALSE);
// DateUpdated
$CPDAssessors->DateUpdated->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);
$rsnew['DateUpdated'] =& $CPDAssessors->DateUpdated->DbValue;
// Active
$CPDAssessors->Active->SetDbValueDef($rsnew, $CPDAssessors->Active->CurrentValue, 0, TRUE);
// DocumentName1
$CPDAssessors->DocumentName1->SetDbValueDef($rsnew, $CPDAssessors->DocumentName1->CurrentValue, NULL, FALSE);
// Document1
$CPDAssessors->Document1->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->Document1->Upload->Value)) {
$rsnew['Document1'] = NULL;
} else {
$rsnew['Document1'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->Document1->UploadPath), $CPDAssessors->Document1->Upload->FileName);
}
// DocumentName2
$CPDAssessors->DocumentName2->SetDbValueDef($rsnew, $CPDAssessors->DocumentName2->CurrentValue, NULL, FALSE);
// Document2
$CPDAssessors->Document2->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->Document2->Upload->Value)) {
$rsnew['Document2'] = NULL;
} else {
$rsnew['Document2'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->Document2->UploadPath), $CPDAssessors->Document2->Upload->FileName);
}
// DocumentName3
$CPDAssessors->DocumentName3->SetDbValueDef($rsnew, $CPDAssessors->DocumentName3->CurrentValue, NULL, FALSE);
// Document3
$CPDAssessors->Document3->Upload->SaveToSession(); // Save file value to Session
if (is_null($CPDAssessors->Document3->Upload->Value)) {
$rsnew['Document3'] = NULL;
} else {
$rsnew['Document3'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $CPDAssessors->Document3->UploadPath), $CPDAssessors->Document3->Upload->FileName);
}
// Call Row Inserting event
$bInsertRow = $CPDAssessors->Row_Inserting($rsnew);
if ($bInsertRow) {
if (!ew_Empty($CPDAssessors->CVFile->Upload->Value)) {
if ($CPDAssessors->CVFile->Upload->FileName == $CPDAssessors->CVFile->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->CVFile->Upload->SaveToFile($CPDAssessors->CVFile->UploadPath, $rsnew['CVFile'], TRUE);
$CPDAssessors->CVFile->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->CVFile->Upload->SaveToFile($CPDAssessors->CVFile->UploadPath, $rsnew['CVFile'], FALSE);
}
}
if ($CPDAssessors->CVFile->Upload->Action == "2" || $CPDAssessors->CVFile->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->CVFile->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->CVFile->UploadPath) . $CPDAssessors->CVFile->Upload->DbValue);
}
if (!ew_Empty($CPDAssessors->QualificationFile->Upload->Value)) {
if ($CPDAssessors->QualificationFile->Upload->FileName == $CPDAssessors->QualificationFile->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->QualificationFile->Upload->SaveToFile($CPDAssessors->QualificationFile->UploadPath, $rsnew['QualificationFile'], TRUE);
$CPDAssessors->QualificationFile->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->QualificationFile->Upload->SaveToFile($CPDAssessors->QualificationFile->UploadPath, $rsnew['QualificationFile'], FALSE);
}
}
if ($CPDAssessors->QualificationFile->Upload->Action == "2" || $CPDAssessors->QualificationFile->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->QualificationFile->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->QualificationFile->UploadPath) . $CPDAssessors->QualificationFile->Upload->DbValue);
}
if (!ew_Empty($CPDAssessors->NDAFile->Upload->Value)) {
if ($CPDAssessors->NDAFile->Upload->FileName == $CPDAssessors->NDAFile->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->NDAFile->Upload->SaveToFile($CPDAssessors->NDAFile->UploadPath, $rsnew['NDAFile'], TRUE);
$CPDAssessors->NDAFile->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->NDAFile->Upload->SaveToFile($CPDAssessors->NDAFile->UploadPath, $rsnew['NDAFile'], FALSE);
}
}
if ($CPDAssessors->NDAFile->Upload->Action == "2" || $CPDAssessors->NDAFile->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->NDAFile->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->NDAFile->UploadPath) . $CPDAssessors->NDAFile->Upload->DbValue);
}
if (!ew_Empty($CPDAssessors->Document1->Upload->Value)) {
if ($CPDAssessors->Document1->Upload->FileName == $CPDAssessors->Document1->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->Document1->Upload->SaveToFile($CPDAssessors->Document1->UploadPath, $rsnew['Document1'], TRUE);
$CPDAssessors->Document1->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->Document1->Upload->SaveToFile($CPDAssessors->Document1->UploadPath, $rsnew['Document1'], FALSE);
}
}
if ($CPDAssessors->Document1->Upload->Action == "2" || $CPDAssessors->Document1->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->Document1->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->Document1->UploadPath) . $CPDAssessors->Document1->Upload->DbValue);
}
if (!ew_Empty($CPDAssessors->Document2->Upload->Value)) {
if ($CPDAssessors->Document2->Upload->FileName == $CPDAssessors->Document2->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->Document2->Upload->SaveToFile($CPDAssessors->Document2->UploadPath, $rsnew['Document2'], TRUE);
$CPDAssessors->Document2->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->Document2->Upload->SaveToFile($CPDAssessors->Document2->UploadPath, $rsnew['Document2'], FALSE);
}
}
if ($CPDAssessors->Document2->Upload->Action == "2" || $CPDAssessors->Document2->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->Document2->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->Document2->UploadPath) . $CPDAssessors->Document2->Upload->DbValue);
}
if (!ew_Empty($CPDAssessors->Document3->Upload->Value)) {
if ($CPDAssessors->Document3->Upload->FileName == $CPDAssessors->Document3->Upload->DbValue) { // Overwrite if same file name
$CPDAssessors->Document3->Upload->SaveToFile($CPDAssessors->Document3->UploadPath, $rsnew['Document3'], TRUE);
$CPDAssessors->Document3->Upload->DbValue = ""; // No need to delete any more
} else {
$CPDAssessors->Document3->Upload->SaveToFile($CPDAssessors->Document3->UploadPath, $rsnew['Document3'], FALSE);
}
}
if ($CPDAssessors->Document3->Upload->Action == "2" || $CPDAssessors->Document3->Upload->Action == "3") { // Update/Remove
if ($CPDAssessors->Document3->Upload->DbValue <> "")
@unlink(ew_UploadPathEx(TRUE, $CPDAssessors->Document3->UploadPath) . $CPDAssessors->Document3->Upload->DbValue);
}
$conn->raiseErrorFn = 'ew_ErrorFn';
$AddRow = $conn->Execute($CPDAssessors->InsertSQL($rsnew));
$conn->raiseErrorFn = '';
} else {
if ($CPDAssessors->CancelMessage <> "") {
$this->setMessage($CPDAssessors->CancelMessage);
$CPDAssessors->CancelMessage = "";
} else {
$this->setMessage($Language->Phrase("InsertCancelled"));
}
$AddRow = FALSE;
}
if ($AddRow) {
$CPDAssessors->CPDAssessorID->setDbValue($conn->Insert_ID());
$rsnew['CPDAssessorID'] = $CPDAssessors->CPDAssessorID->DbValue;
// Call Row Inserted event
$CPDAssessors->Row_Inserted($rsnew);
}
// CVFile
$CPDAssessors->CVFile->Upload->RemoveFromSession(); // Remove file value from Session
// QualificationFile
$CPDAssessors->QualificationFile->Upload->RemoveFromSession(); // Remove file value from Session
// NDAFile
$CPDAssessors->NDAFile->Upload->RemoveFromSession(); // Remove file value from Session
// Document1
$CPDAssessors->Document1->Upload->RemoveFromSession(); // Remove file value from Session
// Document2
$CPDAssessors->Document2->Upload->RemoveFromSession(); // Remove file value from Session
// Document3
$CPDAssessors->Document3->Upload->RemoveFromSession(); // Remove file value from Session
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;
}
}
?>