| Current Path : /var/www/cesa.co.za/php/ |
| Current File : /var/www/cesa.co.za/php/cpdproviderportal.php |
<?php
// ini_set('display_errors', 1);
// error_reporting(E_ALL);
// echo 'Please ignore debug information';
// exit;
require_once($_SERVER['DOCUMENT_ROOT'] . '/cfg/config.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/cesanet/inc_shared.php');
function CombinePhonePost($sName)
{
return "+" . filter_input(INPUT_POST, $sName . "_1", FILTER_SANITIZE_STRING) . " (0" . filter_input(INPUT_POST, $sName . "_2", FILTER_SANITIZE_STRING) . ") " . filter_input(INPUT_POST, $sName . "_3", FILTER_SANITIZE_STRING) . " "
. filter_input(INPUT_POST, $sName . "_4", FILTER_SANITIZE_STRING);
}
function WritePhoneField($sName, $bRequired)
{
return '+<input type="text" style="width:45px !important" placeholder="27" name="' . $sName . '_1" size="2" value="27"' . ($bRequired ? ' required' : '') . '>(0)'
. '<input type="text" style="width:45px !important" placeholder="" name="' . $sName . '_2" size="2"' . ($bRequired ? ' required' : '') . '><input type="text" style="width:90px !important" name="' . $sName . '_3" size="3"' . ($bRequired ? ' required' : '') . '>'
. '<input type="text" style="width:90px !important" name="' . $sName . '_4" size="4"' . ($bRequired ? ' required' : '') . '>';
}
function UniqueFilename($sDir, $sFilename, $sFilenamePrefix = "")
{
global $conn;
$ext = pathinfo($sFilename, PATHINFO_EXTENSION);
$fname = pathinfo($sFilename, PATHINFO_FILENAME);
$i = 1;
$sNewFilename = "";
if (!empty($_SESSION["CPDProviderID"]))
$sNewFilename = $_SESSION["CPDProviderID"];
if (!empty($sFilenamePrefix)) {
$sNewFilename .= str_replace(array("'", '"', ",", '#', " "), "_", $sFilenamePrefix);
} else {
$sNewFilename .= str_replace(array("'", '"', ",", '#'), "_", $fname);
}
$sFinalFilename = $sNewFilename;
while (file_exists($sDir . $sNewFilename . "." . $ext)) {
$sNewFilename = $sFinalFilename . "_" . $i;
$i++;
}
return $sDir . $sNewFilename . "." . $ext;
}
$sessid = session_id();
if (empty($sessid)) {
session_start();
$sessid = session_id();
}
$_COOKIE["PHPSESSID"] = $sessid;
include("inc_db.php");
if (!isset($_SESSION["CPDProviderID"]) || empty($_SESSION["CPDProviderID"])) {
$bShowLoginForm = true;
if (isset($_POST["username"])) {
if (empty($_POST["username"]) || empty($_POST["password"])) {
echo "<p><b>ERROR: Please provide both your username and password</b></p>";
} else {
$query = "SELECT * "
. "FROM CPDServiceProvider "
. "WHERE (LOWER(ContactEmail) = '" . prepSQLValue(strtolower($_POST["username"])) . "' "
. "OR LOWER(AdminEmail) = '" . prepSQLValue(strtolower($_POST["username"])) . "' "
. "OR LOWER(EmailAddress) = '" . prepSQLValue(strtolower($_POST["username"])) . "') "
. "AND Password='" . prepSQLValue($_POST["password"]) . "' "
. "AND Archived=0";
$result = mysqli_query($conni, $query);
if ($result === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} elseif ($row = mysqli_fetch_array($result)) {
$_SESSION["CPDProviderID"] = $row['CPDProviderID'];
$_SESSION["CompanyName"] = $row["CompanyName"];
$_SESSION["SPNumber"] = $row["SPNumber"];
$_SESSION["firstname"] = $row["ContactFirstName"];
$_SESSION["lastname"] = $row["ContactSurname"];
$_SESSION["email"] = $row["ContactEmailAddress"];
$rowSP = $row;
echo "<h2>Welcome " . $_SESSION["firstname"] . " " . $_SESSION["lastname"] . "</h2>";
$bShowLoginForm = false;
} else {
echo "<p><b>ERROR: Invalid username or password</b></p>";
}
if ($result !== false) {
mysqli_free_result($result);
}
}
}
if ($bShowLoginForm) {
?>
<h1>CPD Service Provider Login</h1>
<form method="post" action="/cpd-validation/training-material/">Email Address:
<input type="text" placeholder="Required" required="required" name="username" />
Password:
<input type="password" required="required" name="password" />
<input type="submit" value="Login" />
</form>
<?php
}
}
if (isset($_SESSION["CPDProviderID"]) && !empty($_SESSION["CPDProviderID"])) {
?>
<table border=0 width=100%>
<tr>
<td width="180"><a style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px; text-align:center;display :block; width:180px;" href="/cpd-validation/training-material/"><b>CPD Service / Training Provider Portal</b></a></td>
<td width="100%"> </td>
<td width="180"><a style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px; text-align:center;display :block; width:180px;" href="/cpd-validation/training-material/?do=logout"><b>Logout</b></a></td>
</tr>
</table>
<?php
if (!isset($_REQUEST["do"])) {
?>
<h2 style="background-color:#6DA9D4; padding:5px;">CPD Service / Training Provider Details</h2>
<?php
$sql = "SELECT * FROM CPDServiceProvider WHERE CPDProviderID=" . intval($_SESSION["CPDProviderID"]);
$rec = mysqli_query($conni, $sql);
if ($rec === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} elseif ($row = mysqli_fetch_assoc($rec)) {
if (strlen($row['DateExpires']) > 0) {
$expiryDate = new DateTime($row['DateExpires']);
} elseif (strlen($row['SPNumber']) > 0) {
$expiryDateArr = split($row['SPNumber'], '-');
array_reverse($expiryDateArr);
$expiryDate = new DateTime('01/' . $expiryDateArr[0]);
} else {
$expiryDate = new DateTime();
$expiryDate->modify('-1 days');
}
?>
<h2 style="background-color:#CCCCCC; padding:5px;">Current Status: <?php
if ($expiryDate->getTimestamp() <= time()) {
echo "EXPIRED";
} else {
switch ($row["Approved"]) {
case "A":
echo "APPROVED";
break;
case "R":
echo "DECLINED";
break;
default:
echo "PENDING EVALUATION";
break;
}
}
?></h2>
<?php
if ($row["Approved"] != "A") {
echo "<p>You will be able to upload your CPD Activity details once you have been approved as a service provider.</p>";
} elseif ($expiryDate->getTimestamp() <= time()) {
echo "<p>Your service provider verification has expired on " . $expiryDate->format('j F Y') . ". <a href=\"/cpd-validation/cpd-service-provider/\">Click here to apply for renewal</a>.</p>"
. "<p>If you have any queries, with regard to the above please contact <a href=\"mailto:cpdverification@cesa.co.za\">cpdverification@cesa.co.za</a></p>";
} else {
?>
<table border=1 cellspacing=0 cellpadding=2 width="100%">
<tr>
<td><b>Company Name</b></td>
<td><b>Contact Person</b></td>
<td><b>SP Number</b></td>
<td>
<strong>Documents Uploaded</strong>
</td>
<!--<td> </td>-->
</tr>
<tr>
<td valign="top"><?php echo $row["CompanyName"]; ?></td>
<td valign="top"><?php echo $row["ContactTitle"] . " " . $row["ContactFirstName"] . " " . $row["ContactSurname"]; ?></td>
<td valign="top"><?php echo $row["SPNumber"]; ?></td>
<td valign="top"><?php
$sql = "SELECT DISTINCT DocType FROM CPDProviderDocs WHERE CPDProviderID=" . intval($_SESSION["CPDProviderID"]) . " AND DocFile IS NOT NULL AND DocFile<>''";
$rec2 = mysqli_query($conni, $sql);
if ($rec2 === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} elseif (mysqli_num_rows($rec2) > 0) {
while ($row2 = mysqli_fetch_assoc($rec2)) {
echo $row2["DocType"] . "<br>";
}
} else {
echo "No documents uploaded";
}
?></td>
<!-- <td valign="top"><b><a href="/cpd-validation/training-material/?do=edit" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;">Edit Details and Upload Documents</a></b></td>
-->
</tr>
</table>
<hr>
<h2 style="background-color:#6DA9D4; padding:5px;">CPD Activity</h2>
<?php
?>
<p><a href="/cpd-validation/training-material/?do=addcrs" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;"><b>Application Form for Validation of CPD Activity</b></a></p>
<?php
$sql = "SELECT * FROM CPDTrainingMaterial WHERE ProviderID=" . intval($_SESSION["CPDProviderID"]) . " AND Archived=0 ORDER BY Subject";
// AND CurrentlyOffered=1
$rec = mysqli_query($conni, $sql);
if ($rec === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} elseif (mysqli_num_rows($rec) > 0) {
?>
<table border=1 cellspacing=0 cellpadding=2>
<tr>
<td><b>Subject</b></td>
<td><b>Accred Num/s</b></td>
<td>Status</td>
<td> </td>
</tr>
<?php
while ($row = mysqli_fetch_assoc($rec)) {
?>
<tr>
<td><?php echo $row["Subject"]; ?></td>
<td><?php echo $row["AccredNum"]; ?></td>
<td><?php echo $row["Status"]; ?></td>
<!--<td><a href="/cpd-validation/training-material/?do=editcrs&id=<?php echo $row["MaterialID"]; ?>" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;"><b>Edit Details</b></a></td> -->
</tr>
<?php
}
?>
</table>
<?php
}
}
}
?>
<?php
} elseif ($_REQUEST["do"] == "addcrs") {
?>
<h2 style="background-color:#6DA9D4; padding:5px;">Submit CPD Activity for Validation</h2>
<?php
if (isset($_POST["go"])) {
maill(
'cpdverification@igotafrica.com',
"ATTEMPTED APPLICATION FOR APPROVAL OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) ACTIVITY",
nl2br(print_r($_REQUEST, true)),
null,
array(
'from-address' => "cpd@cesa.co.za",
'from-name' => 'CPD Verification',
'isHTML' => true,
'bcc' => array('cpdverification@igotafrica.com'),
)
);
try {
if (false && $_SESSION["CPDProviderID"] == 1055) {
ini_set('display_errors', 1);
error_reporting(E_ALL);
}
// Add server side validation here, check all required fields abnd then display a
// list of all missing required fields
$missingFields = array();
if (empty($_REQUEST["Course_Name"])) {
$missingFields[] = "Course Name";
}
if (empty($_REQUEST["Level"])) {
$missingFields[] = "Level";
}
if (empty($_REQUEST["Course_Description"])) {
$missingFields[] = "Course Description";
}
if (empty($_REQUEST["Activity_Duration"])) {
$missingFields[] = "Activity Duration";
}
if (empty($_REQUEST["Activity_Duration_Hours_Days"])) {
$missingFields[] = "Activity Duration (Hours/Days)";
}
if (empty($_REQUEST["Product_Promotion"])) {
$missingFields[] = "Product Promotion";
}
if (empty($_REQUEST["ResponsiblePersonFirstName"])) {
$missingFields[] = "Responsible Person First Name";
}
if (empty($_REQUEST["ResponsiblePersonLastName"])) {
$missingFields[] = "Responsible Person Last Name";
}
if (empty($_REQUEST["ResponsiblePersonEMailAddress"])) {
$missingFields[] = "Responsible Person Email Address";
}
if (empty($_REQUEST["ResponsiblePersonContactNumber"])) {
$missingFields[] = "Responsible Person Contact Number";
}
if (empty($_REQUEST["LearningOutcomes"])) {
$missingFields[] = "Learning Outcomes";
}
if (empty($_REQUEST["Objectives"])) {
$missingFields[] = "Objectives";
}
if (empty($_REQUEST["TrainingManualLink"])) {
$missingFields[] = "Training Manual Link";
}
if (empty($_REQUEST["PresentationLink"])) {
$missingFields[] = "Presentation Link";
}
if (empty($_REQUEST["Instances"])) {
$missingFields[] = "Instances";
}
if (!isset($_FILES["CourseBrochure"]) || empty($_FILES["CourseBrochure"]["name"])) {
$missingFields[] = "Course Brochure File";
}
if (!isset($_FILES["ActivityProgramme"]) || empty($_FILES["ActivityProgramme"]["name"])) {
$missingFields[] = "Activity Programme File";
}
if (!isset($_FILES["LearningOutcomesFile"]) || empty($_FILES["LearningOutcomesFile"]["name"])) {
$missingFields[] = "Learning Outcomes File";
}
if (empty($_REQUEST["Presenter1FirstName"])) {
$missingFields[] = "At least one presenter name is required";
}
if (empty($_REQUEST["Presenter1Surname"])) {
$missingFields[] = "At least one presenter surname is required";
}
if (empty($_REQUEST["Presenter1Title"])) {
$missingFields[] = "At least one presenter title is required";
}
if (empty($_REQUEST["Presenter1Phone"])) {
$missingFields[] = "At least one presenter phone number is required";
}
if (empty($_REQUEST["Presenter1Email"])) {
$missingFields[] = "At least one presenter email address is required";
}
if (!isset($_FILES["Presenter1CV"]) || empty($_FILES["Presenter1CV"]["name"])) {
$missingFields[] = "At least one presenter CV is required";
}
if (!isset($_FILES["Presenter1SLA"]) || empty($_FILES["Presenter1SLA"]["name"])) {
$missingFields[] = "At least one presenter SLA is required";
}
if (!isset($_FILES["Presenter1IDDoc"]) || empty($_FILES["Presenter1IDDoc"]["name"])) {
$missingFields[] = "At least one presenter ID document is required";
}
if (!empty($_REQUEST["StartDate"]) && strlen($_REQUEST["StartDate"]) > 0 && !isValidDate($_REQUEST["StartDate"])) {
echo "<p>The start date is not a valid date.</p>";
}
if (empty($missingFields)) {
echo "<p>Please make sure all required fields are filled in.</p>
<p>Missing fields: " . implode(", ", $missingFields) . "</p>
<p><a href='#' onclick='history.back();'>Go back to form</a></p>";
exit;
}
$uploadfilename1 = '';
$uploadfilenameAP = '';
$uploadfileLO = '';
$presenterCVs = array('', '', '');
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . '/uploads/';
$presenterIDDocs = ['', '', ''];
$presenterSLAs = ['', '', ''];
if (isset($_FILES['ActivityProgramme'])) {
$uploadfilenameAP = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['ActivityProgramme']['name']))));
$uploadfileAP = $uploaddir . $uploadfilenameAP;
move_uploaded_file($_FILES['ActivityProgramme']['tmp_name'], $uploadfileAP);
$uploadfileAP = $uploadfilenameAP;
}
if (isset($_FILES['CourseBrochure'])) {
$uploadfilename1 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['CourseBrochure']['name']))));
$uploadfile1 = $uploaddir . $uploadfilename1;
move_uploaded_file($_FILES['CourseBrochure']['tmp_name'], $uploadfile1);
$uploadfile1 = $uploadfilename1;
}
if (isset($_FILES['LearningOutcomesFile'])) {
$uploadfilenameLO = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['LearningOutcomesFile']['name']))));
$uploadfileLO = $uploaddir . $uploadfilenameLO;
move_uploaded_file($_FILES['LearningOutcomesFile']['tmp_name'], $uploadfileLO);
$uploadfileLO = $uploadfilenameLO;
}
for ($cvCnt = 1; $cvCnt <= 3; $cvCnt++) {
if (isset($_FILES['Presenter' . $cvCnt . 'CV'])) {
$uploadfilename = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['Presenter' . $cvCnt . 'CV']['name']))));
$uploadfile = $uploaddir . $uploadfilename;
move_uploaded_file($_FILES['Presenter' . $cvCnt . 'CV']['tmp_name'], $uploadfile);
$uploadfile = $uploadfilename;
$presenterCVs[$cvCnt - 1] = $uploadfilename;
}
} //for
for ($cvCnt = 1; $cvCnt <= 3; $cvCnt++) {
if (isset($_FILES['Presenter' . $cvCnt . 'IDDoc'])) {
$uploadfilename = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['Presenter' . $cvCnt . 'IDDoc']['name']))));
$uploadfile = $uploaddir . $uploadfilename;
move_uploaded_file($_FILES['Presenter' . $cvCnt . 'IDDoc']['tmp_name'], $uploadfile);
$uploadfile = $uploadfilename;
$presenterIDDocs[$cvCnt - 1] = $uploadfilename;
}
} //for
for ($cvCnt = 1; $cvCnt <= 3; $cvCnt++) {
if (isset($_FILES['Presenter' . $cvCnt . 'SLA'])) {
$uploadfilename = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['Presenter' . $cvCnt . 'SLA']['name']))));
$uploadfile = $uploaddir . $uploadfilename;
move_uploaded_file($_FILES['Presenter' . $cvCnt . 'SLA']['tmp_name'], $uploadfile);
$uploadfile = $uploadfilename;
$presenterSLAs[$cvCnt - 1] = $uploadfilename;
}
} //for
$actDur = explode(' ', $_REQUEST["Activity_Duration_Hours_Days"]);
$_REQUEST["Activity_Duration"] = $actDur[0];
$_REQUEST["Hours_Days"] = $actDur[1];
if (!isset($_REQUEST["Category_Reg"]) || !is_array($_REQUEST["Category_Reg"])) {
$_REQUEST["Category_Reg"] = array();
}
if (!isset($_REQUEST["Discipline"]) || !is_array($_REQUEST["Discipline"])) {
$_REQUEST["Discipline"] = array();
}
if (empty($_REQUEST["StartDate"]) || strlen($_REQUEST["StartDate"]) == 0 || !isValidDate($_REQUEST["StartDate"])) {
$startDateValue = 'NULL';
} else {
$startDateObject = new DateTime($_REQUEST["StartDate"]);
$startDateValue = "'" . prepSQLValue($startDateObject->format('Y-m-d')) . "'";
}
$sql = "INSERT INTO `CPDTrainingMaterial` (`ProviderID`, `Subject`, `Level`,
`EventDescription`, `Duration`, `AccredNum`, `PrevAccredNum`,
`Presenter1Surname`, `Presenter2Surname`, `Presenter3Surname`,
`DurationUnit`, `Promotion`, `Motivation`,
`Status`, `StartDate`, `Other_Validator`,
`Category_Reg`, `Discipline`, `Sub_Discipline`, `TargetAudience`,
`Activity_Nature`, `Instances`, `RemoteUpload`, `Archived`,
`LearningOutcomes`, `Objectives`, `ActivityProgramme`, `CourseBrochure`, `LearningOutcomesFile`, `TrainingManualLink`, `PresentationLink`, `HandOutsLink`,
`ResponsiblePersonFirstName`, `ResponsiblePersonLastName`, `ResponsiblePersonEMailAddress`, `ResponsibleBillingAddress`, `ResponsiblePersonContactNumber`, `ResponsibleVATNumber`,
`Presenter1FirstName`,
`Presenter1Title`, `Presenter1Phone`, `Presenter1Email`,
`Presenter1ID`, `Presenter1IDDoc`, `Presenter1CV`, `Presenter1SLA`, `Presenter2FirstName`, `Presenter2Title`,
`Presenter2Phone`, `Presenter2Email`, `Presenter2ID`, `Presenter2IDDoc`, `Presenter2CV`, `Presenter2SLA`,
`Presenter3FirstName`, `Presenter3Title`, `Presenter3Phone`,
`Presenter3Email`, `Presenter3ID`, `Presenter3IDDoc`, `Presenter3CV`, `Presenter3SLA`, RenewOrNew, CostToDelegate, DateCreated)
VALUES (" . $_SESSION["CPDProviderID"] . ", '" . prepSQLValue($_REQUEST["Course_Name"]) . "',
'" . prepSQLValue($_REQUEST["Level"]) . "', '" . prepSQLValue($_REQUEST["Course_Description"]) . "',
'" . prepSQLValue($_REQUEST["Activity_Duration"]) . "', 'Pending', '" . prepSQLValue($_REQUEST["PrevAccredNum"]) . "',
'" . prepSQLValue($_REQUEST["Presenter1Surname"]) . "', '" . prepSQLValue($_REQUEST["Presenter2Surname"]) . "',
'" . prepSQLValue($_REQUEST["Presenter3Surname"]) . "', '" . prepSQLValue($_REQUEST["Hours_Days"]) . "',
'" . prepSQLValue($_REQUEST["Product_Promotion"]) . "', '" . prepSQLValue($_REQUEST["Motivation"]) . "',
'Pending', " . $startDateValue . ", '" . prepSQLValue($_REQUEST["Other_Validator"]) . "',
'" . prepSQLValue(implode(",", $_REQUEST["Category_Reg"])) . "', '" . prepSQLValue(implode(",", $_REQUEST["Discipline"])) . "',
'" . prepSQLValue($_REQUEST["Sub_Discipline"]) . "', '" . prepSQLValue($_REQUEST["TargetAudience"]) . "',
'" . prepSQLValue($_REQUEST["Activity_Nature"]) . "',
'" . prepSQLValue($_REQUEST["Instances"]) . "', '" . prepSQLValue($_REQUEST["RemoteUpload"]) . "', 0,
'" . prepSQLValue($_REQUEST["LearningOutcomes"]) . "', '" . prepSQLValue($_REQUEST["Objectives"]) . "', '" . $uploadfileAP . "',
'" . $uploadfilename1 . "', '" . $uploadfileLO . "', '" . prepSQLValue($_REQUEST["TrainingManualLink"]) . "',
'" . prepSQLValue($_REQUEST["PresentationLink"]) . "', '" . prepSQLValue($_REQUEST["HandOutsLink"]) . "',
'" . prepSQLValue($_REQUEST["ResponsiblePersonFirstName"]) . "', '" . prepSQLValue($_REQUEST["ResponsiblePersonLastName"]) . "',
'" . prepSQLValue($_REQUEST["ResponsiblePersonEMailAddress"]) . "', '" . prepSQLValue($_REQUEST["ResponsibleBillingAddress"]) . "',
'" . prepSQLValue($_REQUEST["ResponsiblePersonContactNumber"]) . "', "
. "'" . prepSQLValue($_REQUEST["ResponsibleVATNumber"]) . "',
'" . prepSQLValue($_REQUEST["Presenter1FirstName"]) . "',
'" . prepSQLValue($_REQUEST["Presenter1Title"]) . "', '" . prepSQLValue(CombinePhonePost("Presenter1Phone")) . "',
'" . prepSQLValue($_REQUEST["Presenter1Email"]) . "', '" . prepSQLValue($_REQUEST["Presenter1ID"]) . "', '" . $presenterIDDocs[0] . "',
'" . $presenterCVs[0] . "', '" . $presenterSLAs[0] . "',
'" . prepSQLValue($_REQUEST["Presenter2FirstName"]) . "',
'" . prepSQLValue($_REQUEST["Presenter2Title"]) . "', '" . prepSQLValue(CombinePhonePost("Presenter2Phone")) . "',
'" . prepSQLValue($_REQUEST["Presenter2Email"]) . "', '" . prepSQLValue($_REQUEST["Presenter2ID"]) . "', '" . $presenterIDDocs[1] . "',
'" . $presenterCVs[1] . "', '" . $presenterSLAs[1] . "',
'" . prepSQLValue($_REQUEST["Presenter3FirstName"]) . "',
'" . prepSQLValue($_REQUEST["Presenter3Title"]) . "', '" . prepSQLValue(CombinePhonePost("Presenter3Phone")) . "',
'" . prepSQLValue($_REQUEST["Presenter3Email"]) . "', '" . prepSQLValue($_REQUEST["Presenter3ID"]) . "', '" . $presenterIDDocs[2] . "',
'" . $presenterCVs[2] . "', '" . $presenterSLAs[2] . "',
'" . prepSQLValue($_REQUEST["RenewOrNew"]) . "', '" . prepSQLValue((float) $_REQUEST["CostToDelegate"]) . "', NOW())";
if (!mysqli_query($conni, $sql)) {
ErrorLog::logError('Error inserting CPD training material: ' . mysqli_error($conni) . ' - ' . $sql);
ErrorLog::logError('Error inserting CPD training material: ' . mysqli_error($conni) . ' - No SQL');
echo "<p>An error occurred while submitting the form. Please try again later.</p>"
. "<p>Please share technical details with the support team: " . mysqli_error($conni) . "</p>";
exit;
}
// echo $sql;
// exit;
$sForm = "<p>The following service provider has applied for validation of CPD Activity:</p>
<p><b>" . $_SESSION["CompanyName"] . "</b></p>
<p>Activity name: <b>" . $_POST["Course_Name"] . "</b></p>
<p>Download documentation: <a href='" . $_POST["RemoteUpload"] . "'>" . $_POST["RemoteUpload"] . "</a></p>
<p>Please login to the CPD admin portal to review the information submitted.</p>";
$newRenew = 'New';
if ($_REQUEST["RenewOrNew"] == 'r') {
$newRenew = 'Renewal';
}
$presenterCVLinks = array('', '', '');
$presenterSLALinks = array('', '', '');
for ($cvCnt = 0; $cvCnt < 3; $cvCnt++) {
if (isset($presenterCVs[$cvCnt]) && strlen($presenterCVs[$cvCnt]) > 0) {
$presenterCVLinks[$cvCnt] = '<br /><b>CV:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterCVs[$cvCnt] . '">' . $presenterCVs[$cvCnt] . '</a>';
}
if (isset($presenterSLAs[$cvCnt]) && strlen($presenterSLAs[$cvCnt]) > 0) {
$presenterSLALinks[$cvCnt] = '<br /><b>SLA:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterSLAs[$cvCnt] . '">' . $presenterSLAs[$cvCnt] . '</a>';
}
} //for
$sForm = '<h3>APPLICATION FOR APPROVAL OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) ACTIVITY</h3>
<table border="1" cellpadding="5" cellspacing="0">
<tbody>
<tr><td colspan=2><p style="font-weight: bold">BODY APPLYING FOR ACTIVITY APPROVAL IN TERMS OF ECSA CPD POLICY</p>
</td>
</tr>
<tr>
<td width="233"><p>Name of Service Provider:</p></td>
<td width="338"><p>' . $_SESSION["CompanyName"] . '
</p></td>
</tr>
<tr>
<td width="233"><p>Service Provider Number:</p></td>
<td width="338"><p>' . $_SESSION["SPNumber"] . '
</p></td>
</tr>
<tr><td colspan=2><p style="font-weight: bold">DETAILS OF ACTIVITY</p></td></tr>
<tr>
<td width="222"><p>Activity Name: (Name on Certificate)</p></td>
<td width="349"><p>
' . $_REQUEST["Course_Name"] . '
</p></td>
</tr>
<tr>
<td width="222"><p>New Activity or Renewal?</p></td>
<td width="349"><p>
' . $newRenew . '
</p></td>
</tr>
<tr>
<td width="222"><p>Brochure:</p></td>
<td width="349"><p>
<a href="' . getBaseURL() . '/uploads/' . $uploadfilename1 . '">' . $uploadfilename1 . '</a>
</p></td>
</tr>
<tr>
<td width="222"><p>Programme:</p></td>
<td width="349"><p>
<a href="' . getBaseURL() . '/uploads/' . $uploadfilenameAP . '">' . $uploadfilenameAP . '</a>
</p></td>
</tr>
<tr>
<td width="222"><p>Outcomes:</p></td>
<td width="349"><p>
<a href="' . getBaseURL() . '/uploads/' . $uploadfilenameLO . '">' . $uploadfilenameLO . '</a>
</p></td>
</tr>
<tr>
<td width="222"><p>Training Manual:</p></td>
<td width="349"><p>
<a href="' . $_REQUEST["TrainingManualLink"] . '">' . $_REQUEST["TrainingManualLink"] . '</a>
</p></td>
</tr>
<tr>
<td width="222"><p>Presentation:</p></td>
<td width="349"><p>
<a href="' . $_REQUEST["PresentationLink"] . '">' . $_REQUEST["PresentationLink"] . '</a>
</p></td>
</tr>
<tr>
<td width="222"><p>Hand Outs:</p></td>
<td width="349"><p>
<a href="' . $_REQUEST["HandOutsLink"] . '">' . $_REQUEST["HandOutsLink"] . '</a>
</p></td>
</tr>
<tr>
<td valign="top"><p>Responsible Person:</p></td>
<td>
' . $_REQUEST["ResponsiblePersonFirstName"] . ' ' . $_REQUEST["ResponsiblePersonLastName"] . '
<br />
' . $_REQUEST["ResponsiblePersonEMailAddress"] . '
<br />
' . $_REQUEST["ResponsiblePersonContactNumber"] . '
</p></td>
</tr>
<tr>
<td valign="top"><p>VAT No:</p></td>
<td>
' . $_REQUEST["ResponsibleVATNumber"] . '
</p></td>
</tr>
<tr>
<td valign="top"><p>Billing Address:</p></td>
<td>
' . $_REQUEST["ResponsibleBillingAddress"] . '
</p></td>
</tr>
<tr>
<td valign="top"><p>Name/s of Presenter/s:</p></td>
<td><p>
1.
' . $_REQUEST["Presenter1FirstName"] . ' ' . $_REQUEST["Presenter1Surname"] . ' <br />'
. '<b>CV:</b> ' . $presenterCVLinks[0] . ' <br />'
. '<b>ID Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterIDDocs[0] . '">' . $presenterIDDocs[0] . '</a><br />'
. '<b>SLA Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterSLAs[0] . '">' . $presenterSLAs[0] . '</a>
</p>
<p>
2.
' . $_REQUEST["Presenter2FirstName"] . ' ' . $_REQUEST["Presenter2Surname"] . ' <br />'
. '<b>CV:</b> ' . ' ' . $presenterCVLinks[1] . ' <br />'
. '<b>ID Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterIDDocs[1] . '">' . $presenterIDDocs[1] . '</a><br />'
. '<b>SLA Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterSLAs[1] . '">' . $presenterSLAs[1] . '</a>
</p>
<p>
3.
' . $_REQUEST["Presenter3FirstName"] . ' ' . $_REQUEST["Presenter3Surname"] . ' <br />'
. '<b>CV:</b> ' . ' ' . $presenterCVLinks[2] . ' <br />'
. '<b>ID Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterIDDocs[2] . '">' . $presenterIDDocs[2] . '</a><br />'
. '<b>SLA Doc:</b> <a href="' . getBaseURL() . '/uploads/' . $presenterSLAs[2] . '">' . $presenterSLAs[2] . '</a>
</p>
</td>
</tr>
<tr>
<td><p>Duration of Activity</p></td>
<td><p>
' . $_REQUEST["Activity_Duration"] . ' ' . $_REQUEST["Hours_Days"] . '
</p></td>
</tr>
<tr>
<td><p>Activity category:</p></td>
<td><p>
' . $_REQUEST["Level"] . '
</p></td>
</tr>
<tr>
<td><p>Category of Registration:</p></td>
<td><p>
' . implode(",", $_REQUEST["Category_Reg"]) . '
</p></td>
</tr>
<tr>
<td><p>Discipline:</p></td>
<td><p>
' . implode(",", $_REQUEST["Discipline"]) . '
</p></td>
</tr>
<tr>
<td><p>Sub-Discipline:</p></td>
<td><p>
' . $_REQUEST["Sub_Discipline"] . '
</p></td>
</tr>
<tr>
<td><p>Target Audience:</p></td>
<td><p>
' . $_REQUEST["TargetAudience"] . '
</p></td>
</tr>
<tr>
<td><p>Nature of Activity:</p></td>
<td><p>
' . $_REQUEST["Activity_Nature"] . '
</p></td>
</tr>
<tr>
<td valign="top"><p><b>Description / Overview of Activity: *</b></p></td>
<td>' . $_REQUEST["Course_Description"] . '</td>
</tr>
<tr>
<td><p>Instances:</p></td>
<td><p>
' . $_REQUEST["Instances"] . '
</p></td>
</tr>
<tr>
<td><p>Is the activity promoting a product?</p></td>
<td><p>' . $_REQUEST["Product_Promotion"] . '
</p></td>
</tr>
<tr>
<td><p>Starting date (if a conference or site visit):</p></td>
<td><p>' . $_REQUEST["StartDate"] . '
</p></td>
</tr>
<tr>
<td><p>Cost of Activity to Delegates (Including VAT)</p></td>
<td><p>' . $_REQUEST["CostToDelegate"] . '
</p></td>
</tr>
<tr>
<td><p>Where else have you submitted a request to have this activity validated?</p></td>
<td><p>' . $_REQUEST["Other_Validator"] . '
</p></td>
</tr>
</tbody>
</table>
<br />
<p style="font-weight: bold">MOTIVATION FOR ACTIVITY TO BE APPROVED:</p>
<p>
' . $_REQUEST["Motivation"] . '
</p>
';
//<hr><p>WeTransfer / DropBox documentation download link: <a href="' . $_REQUEST["RemoteUpload"] . '">' . $_REQUEST["RemoteUpload"] . '</a></p>
$sSendFormTo = "cpd@cesa.co.za,brenda@cesa.co.za,blessings@cesa.co.za,cpdverification@cesa.co.za,athromethm@cesa.co.za";
//$sSendFormTo = "julia@xe.co.za";
maill(
$sSendFormTo,
"APPLICATION FOR VALIDATION OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) ACTIVITY",
$sForm,
null,
array('from-address' => "cpd@cesa.co.za", 'from-name' => 'CPD Verification', 'isHTML' => true, 'bcc' => array('cpdverification@igotafrica.com'))
);
// Thank you message
$tyMessage = '<p>Dear ' . $_REQUEST["ResponsiblePersonFirstName"] . '</p>'
. '<p>We acknowledge receipt of the online application for validation of your activity, entitled:</p>'
. '<p>' . $_REQUEST["Course_Name"] . '</p>'
. '<p>Sue Moseley Walker, the CESA CPD Verification Assessor, will be in contact with you shortly.</p>'
. '<p>Kind regards,</p>'
. '<p>CPD Verification Assessments<br />'
. 'CESA</p>';
maill(
$_REQUEST["ResponsiblePersonEMailAddress"],
"ACKNOWLEDGED RECEIPT OF APPLICATION FOR VALIDATION OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) ACTIVITY",
$tyMessage,
null,
array('from-address' => "cpdverification@cesa.co.za", 'from-name' => 'CPD Verification', 'isHTML' => true, 'bcc' => array('cpdverification@igotafrica.com', 'cpdverification@cesa.co.za'))
);
?>
<p><b>Thank you for your submission.</b></p>
<p>It is now under review. You may return to the main page, or submit another activity for validation.</p>
<p><a href="/cpd-validation/training-material/">Return to main page</a></p>
<p><a href="/cpd-validation/training-material/?do=addcrs">Submit another activity</a></p>
<p><a href="/cpd-validation/training-material/?do=logout">Logout</a></p>
<?php
} catch (Exception $ex) {
?>
<p><b>There was a problem with your submission.</b></p>
<p>The error has been reported. Please try again later.</p>
<p><a href="#" onclick="history.go(-1); return false;">Try again</a></p>
<p><a href="/cpd-validation/training-material/">Return to main page</a></p>
<p><a href="/cpd-validation/training-material/?do=addcrs">Submit another activity</a></p>
<p><a href="/cpd-validation/training-material/?do=logout">Logout</a></p>
<?php
maill(
'cesa-cpd@igotafrica.com',
"Error on CPD Validation",
$ex->getMessage() . ' - ' . $ex->getTraceAsString(),
null,
array(
'from-address' => "cpd@cesa.co.za",
'from-name' => 'CPD Verification',
'isHTML' => true,
'bcc' => array('cpdverification@igotafrica.com'),
)
);
}
} else {
?>
<form method="post" action="/cpd-validation/training-material/" enctype="multipart/form-data" id="activityForm" onsubmit="return checkForm();">
<input type="hidden" name="do" value="addcrs" />
<input type="hidden" name="go" value="1" />
<h3>APPLICATION FOR APPROVAL OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) ACTIVITY</h3>
<p>Please complete the form below:</p>
<!-- <ul>
<li><span style="color: #000000;">The following must be sent in a Drop Box folder or by WeTransfer to cpdverification@cesa.co.za:</span>
<ul>
<li>Training manual</li>
<li>PowerPoint presentations</li>
<li>Handouts</li>
<li>Activity advert / brochure</li>
<li>CVs of trainers</li>
</ul>
</li>
<li><span style="color: #000000;">The above is to be submitted <strong><u>no less than six weeks prior</u></strong> to the commencement of the event date.</span></li>
</ul>-->
<table border="1" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td colspan=2 bgcolor="#CCCCCC">
<p style="font-weight: bold">DETAILS OF ACTIVITY</p>
</td>
</tr>
<tr>
<td width="222">
<p>Activity Name: (Name on Certificate)</p>
</td>
<td width="349">
<p>
<input name="Course_Name" type="text" id="Course_Name" size="50" value="<?php echo $_REQUEST["Course_Name"]; ?>" required />
</p>
</td>
</tr>
<tr>
<td>
<p>New Activity or Renewal?</p>
</td>
<td>
<p>
<input name="RenewOrNew" id="RenewOrNew_n" class="RenewOrNew" type="radio" value="n" required<?php if ($_REQUEST["RenewOrNew"] == "n") echo " checked"; ?>> New<br>
<input name="RenewOrNew" id="RenewOrNew_r" class="RenewOrNew" type="radio" value="r" required<?php if ($_REQUEST["RenewOrNew"] == "r") echo " checked"; ?>> Renewal
</p>
</td>
</tr>
<tr id="trPrevAccredNum" style="display: none;">
<td width="222">
<p>Previous Accreditation Number</p>
</td>
<td width="349">
<p>
<input name="PrevAccredNum" type="text" id="PrevAccredNum" size="50" value="<?php echo $_REQUEST["PrevAccredNum"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>
<p>Duration of Activity:</p>
</td>
<td>
<p>
<!--
<input name="Activity_Duration" type="text" id="Activity_Duration" size="10" value="<?php echo $_REQUEST["Activity_Duration"]; ?>" required />
Hours <input type="hidden" name="Hours_Days" value="Hours">
<select name="Hours_Days" id="Hours_Days" required="required">
<option value="">Select Hours or Days for Duration</option>
<option value="Hours"<?php if ($_REQUEST["Hours_Days"] == "Hours") echo " selected"; ?>>Hours</option>
<option value="Days"<?php if ($_REQUEST["Hours_Days"] == "Days") echo " selected"; ?>>Days</option>
</select>
-->
<select name="Activity_Duration_Hours_Days" id="Activity_Duration_Hours_Days" required="required">
<option value="">Select duration</option>
<?php
for ($cnt = 5; $cnt > 0; $cnt--) {
$days = 'Days';
if ($cnt <= 1) {
$days = 'Day';
}
?>
<option value="<?php echo $cnt; ?> Days" <?php if ($_REQUEST["Hours_Days"] == "Days" && $_REQUEST["Activity_Duration"] == $cnt) echo " selected"; ?>><?php echo $cnt . ' ' . $days; ?></option>
<?php
} //days
?>
<option value="4 Hours" <?php if ($_REQUEST["Hours_Days"] == "Hours" && $_REQUEST["Activity_Duration"] == 4) echo " selected"; ?>>Half day (4 - 6 hours)</option>
<?php
for ($cnt = 3; $cnt > 0; $cnt--) {
$hours = 'Hours';
if ($cnt <= 1) {
$hours = 'Hour';
}
?>
<option value="<?php echo $cnt; ?> Hours" <?php if ($_REQUEST["Hours_Days"] == "Hours" && $_REQUEST["Activity_Duration"] == $cnt) echo " selected"; ?>><?php echo $cnt . ' ' . $hours; ?></option>
<?php
} //for hours
?>
</select>
</p>
</td>
</tr>
<tr>
<td>
<p>Activity Category:</p>
</td>
<td>
<p>
<?php
echo HTMLHelper::drawSelect(['name' => 'Level', 'value' => $_REQUEST["Level"], 'choices' => [
'Conference' => 'Conference',
'Congress' => 'Congress',
'Course' => 'Course',
'E-learning' => 'E-learning',
'Large Group Workshop' => 'Large Group Workshop',
'Lecture' => 'Lecture',
'Refresher Course' => 'Refresher Course',
'Seminar' => 'Seminar',
'Workshop' => 'Workshop',
'Webinar' => 'Webinar',
]]);
?>
</p>
</td>
</tr>
<tr>
<td valign="top">Pitched at Category of Registration:</td>
<td>
<input type="checkbox" name="Category_Reg[]" value="Professional Engineer" <?php if (is_array($_REQUEST["Category_Reg"]) && in_array("Professional Engineer", $_REQUEST["Category_Reg"])) echo " checked"; ?>> Professional Engineer<br>
<input type="checkbox" name="Category_Reg[]" value="Professional Engineer Technologist" <?php if (is_array($_REQUEST["Category_Reg"]) && in_array("Professional Engineer Technologist", $_REQUEST["Category_Reg"])) echo " checked"; ?>> Professional Engineer Technologist<br>
<input type="checkbox" name="Category_Reg[]" value="Professional Certificated Engineer" <?php if (is_array($_REQUEST["Category_Reg"]) && in_array("Professional Certificated Engineer", $_REQUEST["Category_Reg"])) echo " checked"; ?>> Professional Certificated Engineer<br>
<input type="checkbox" name="Category_Reg[]" value="Professional Engineer Technician" <?php if (is_array($_REQUEST["Category_Reg"]) && in_array("Professional Engineer Technician", $_REQUEST["Category_Reg"])) echo " checked"; ?>> Professional Engineer Technician<br>
<input type="checkbox" name="Category_Reg[]" value="All" <?php if (is_array($_REQUEST["Category_Reg"]) && in_array("All", $_REQUEST["Category_Reg"])) echo " checked"; ?>>All
</tr>
<tr>
<td valign="top">Engineering Discipline/s:</td>
<td>
<?php
$arrDisciplines = array("Aeronautical", "Agricultural", "Chemical", "Civil", "Electrical", "Electronics", "Mechanical", "Mechatronics", "Metallurgical", "Mining", "Industrial", "All");
foreach ($arrDisciplines as $val) {
?>
<input type="checkbox" name="Discipline[]" value="<?php echo $val; ?>" <?php if (is_array($_REQUEST["Discipline"]) && in_array($val, $_REQUEST["Discipline"])) echo " checked"; ?>> <?php echo $val; ?><br>
<?php
}
?>
</tr>
<tr>
<td valign="top">Engineering Sub-Discipline:</td>
<td>
<input name="Sub_Discipline" type="text" id="Sub_Discipline" size="50" value="<?php echo $_REQUEST["Sub_Discipline"]; ?>" />
</td>
</tr>
<tr>
<td valign="top">Target Audience (Designation):</td>
<td>
<input name="TargetAudience" type="text" id="TargetAudience" size="50" value="<?php echo $_REQUEST["TargetAudience"]; ?>" />
</td>
</tr>
<tr>
<td valign="top">Nature of Activity:</td>
<td>
<select name="Activity_Nature" id="Activity_Nature" required>
<option value="Engineering" <?php if ($_REQUEST["Activity_Nature"] == "Engineering") echo " selected"; ?>>Engineering</option>
<option value="Project Management" <?php if ($_REQUEST["Activity_Nature"] == "Project Management") echo " selected"; ?>>Project Management</option>
<option value="Technical" <?php if ($_REQUEST["Activity_Nature"] == "Technical") echo " selected"; ?>>Technical</option>
<option value="Legal" <?php if ($_REQUEST["Activity_Nature"] == "Legal") echo " selected"; ?>>Legal</option>
<option value="Office" <?php if ($_REQUEST["Activity_Nature"] == "Office") echo " selected"; ?>>Office</option>
<option value="Finance" <?php if ($_REQUEST["Activity_Nature"] == "Finance") echo " selected"; ?>>Finance</option>
<option value="Computer Skills" <?php if ($_REQUEST["Activity_Nature"] == "Computer Skills") echo " selected"; ?>>Computer Skills</option>
<option value="Interpersonal Skills" <?php if ($_REQUEST["Activity_Nature"] == "Interpersonal Skills") echo " selected"; ?>>Interpersonal Skills</option>
<option value="General Management" <?php if ($_REQUEST["Activity_Nature"] == "General Management") echo " selected"; ?>>General Management</option>
</select>
</td>
</tr>
<tr>
<td valign="top">
<p>Description / Overview of Activity:</p>
</td>
<td><textarea name="Course_Description" id="Course_Description" cols="45" rows="7" required><?php echo stripslashes($_REQUEST["Course_Description"]); ?></textarea></td>
</tr>
<tr>
<td valign="top">
<p><b>Brochure: *</b></p>
</td>
<td><input type="file" name="CourseBrochure" id="CourseBrochure" required="required" /></td>
</tr>
<tr>
<td valign="top">
<p><b>Activity Programme: *</b></p>
</td>
<td><input type="file" name="ActivityProgramme" id="ActivityProgramme" required="required" /></td>
</tr>
<tr>
<td valign="top">
<p><b>Activity Outcomes: *</b></p>
</td>
<td><input type="file" name="LearningOutcomesFile" id="CourseBrochure" required="required" /></td>
</tr>
<tr>
<td valign="top">
<p><b>Learning Outcomes: *</b></p>
</td>
<td><textarea name="LearningOutcomes" id="LearningOutcomes" cols="45" rows="7" required><?php echo stripslashes($_REQUEST["LearningOutcomes"]); ?></textarea></td>
</tr>
<tr>
<td valign="top">
<p><b>Objectives: *</b></p>
</td>
<td><textarea name="Objectives" id="Objectives" cols="45" rows="7" required><?php echo stripslashes($_REQUEST["Objectives"]); ?></textarea></td>
</tr>
<tr>
<td valign="top" align="left" colspan="2">
<h3>Uploaded Documents</h3>
<p>Upload your documents to a file sharing system, such as DropBox or WeTransfer, and enter the links to the content here</p>
</td>
</tr>
<tr>
<td valign="top">
<p><b>Training Manual: *</b></p>
</td>
<td>
<input name="TrainingManualLink" type="text" id="TrainingManualLink" size="50" value="<?php echo $_REQUEST["TrainingManualLink"]; ?>" required="required" />
</td>
</tr>
<tr>
<td valign="top">
<p><b>Presentation: *</b></p>
</td>
<td>
<input name="PresentationLink" type="text" id="TrainingManualLink" size="50" value="<?php echo $_REQUEST["TrainingManualLink"]; ?>" required="required" />
</td>
</tr>
<tr>
<td valign="top">
<p><b>Hand Outs: *</b></p>
</td>
<td>
<input name="HandOutsLink" type="text" id="TrainingManualLink" size="50" value="<?php echo $_REQUEST["TrainingManualLink"]; ?>" />
</td>
</tr>
<tr>
<td>Instances:</td>
<td><input type="radio" name="Instances" id="Instances" value="Single" <?php if (!isset($_REQUEST["Instances"]) || ($_REQUEST["Instances"] == "Single")) echo " checked"; ?> required> Single
<input type="radio" name="Instances" id="Instances" value="Multiple" <?php if (!isset($_REQUEST["Instances"]) || ($_REQUEST["Instances"] == "Multiple")) echo " checked"; ?>> Multiple
</td>
</tr>
<tr>
<td>
<p>Is the activity promoting a product?</p>
</td>
<td>
<p><select name="Product_Promotion" id="Product_Promotion" required>
<option value="No" <?php if ($_REQUEST["Product_Promotion"] == "No") echo " checked"; ?>>No</option>
<option value="Yes" <?php if ($_REQUEST["Product_Promotion"] == "Yes") echo " checked"; ?>>Yes</option>
</select>
</p>
</td>
</tr>
<tr>
<td>
<p>If the activity is a conference or site visit, please enter the date (or starting date):</p>
</td>
<td>
<p><input type="text" name="StartDate" id="StartDate" size="30" value="<?php echo $_REQUEST["StartDate"]; ?>"></p>
</td>
</tr>
<tr>
<td>
<p>Cost of Activity to Delegates (Including VAT): *</p>
</td>
<td>
<p><input type="text" name="CostToDelegate" id="CostToDelegate" size="30" value="<?php echo $_REQUEST["CostToDelegate"]; ?>" required></p>
</td>
</tr>
<tr>
<td>
<p>Where else have you submitted a request to have this activity validated?</p>
</td>
<td>
<p><input type="text" name="Other_Validator" id="Other_Validator" size="50" value="<?php echo $_REQUEST["Other_Validator"]; ?>"></p>
</td>
</tr>
<tr>
<td colspan=2 bgcolor="#CCCCCC">
<p style="font-weight: bold">RESPONSIBLE PERSON</p>
</td>
</tr>
<tr>
<td><b>First Name *</b></td>
<td><input type="text" name="ResponsiblePersonFirstName" value="<?php echo $_REQUEST["ResponsiblePersonFirstName"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>Last Name *</b></td>
<td><input type="text" name="ResponsiblePersonLastName" value="<?php echo $_REQUEST["ResponsiblePersonLastName"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>Email Address *</b></td>
<td><input type="text" name="ResponsiblePersonEMailAddress" value="<?php echo $_REQUEST["ResponsiblePersonEMailAddress"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>Contact Number *</b></td>
<td>
<input type="text" name="ResponsiblePersonContactNumber" value="<?php echo $_REQUEST["ResponsiblePersonContactNumber"]; ?>" size="40" required>
</td>
</tr>
<tr>
<td><b>VAT Number</b></td>
<td>
<input type="text" id="ResponsibleVATNumber" name="ResponsibleVATNumber" value="<?php echo $_REQUEST["ResponsibleVATNumber"]; ?>" size="40">
<p>
<input type="checkbox" id="noVat" value="1" /> Not Vat Registered
</p>
</td>
</tr>
<tr>
<td><b>Billing Address *</b></td>
<td>
<textarea name="ResponsiblePersonContactNumber" value="<?php echo $_REQUEST["ResponsiblePersonContactNumber"]; ?>" cols="45" rows="7" required="required"></textarea>
</td>
</tr>
<tr>
<td colspan=2 bgcolor="#CCCCCC">
<p style="font-weight: bold">PRESENTERS</p>
</td>
</tr>
<tr>
<td colspan=2>
<p style="font-weight: bold">Presenter 1 *</p>
</td>
</tr>
<tr>
<td width="30%"><b>Title</b></td>
<td><select name="Presenter1Title" required>
<?php
$sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Title' ORDER BY DisplayOrder, PicklistValue";
$rec = mysqli_query($conni, $sql);
if ($rec === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} else {
while ($row = mysqli_fetch_assoc($rec)) {
?>
<option value="<?php echo $row["PicklistValue"]; ?>" <?php if ($_REQUEST["Presenter1Title"] == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option>
<?php
}
}
?>
</select></td>
</tr>
<tr>
<td><b>First Name (Known As) *</b></td>
<td><input type="text" name="Presenter1FirstName" value="<?php echo $_REQUEST["Presenter1FirstName"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>Surname *</b></td>
<td><input type="text" name="Presenter1Surname" value="<?php echo $_REQUEST["Presenter1Surname"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>ID / Passport Number</b></td>
<td><input type="text" name="Presenter1ID" value="<?php echo $_REQUEST["Presenter1ID"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>ID/ Passport Document</b></td>
<td><input type="file" name="Presenter1IDDoc" size="40" required></td>
</tr>
<tr>
<td><b>Phone / Cell Number *</b></td>
<td><?php echo WritePhoneField("Presenter1Phone", true); ?></td>
</tr>
<tr>
<td><b>Email Address *</b></td>
<td><input type="text" name="Presenter1Email" value="<?php echo $_REQUEST["Presenter1Email"]; ?>" size="40" required></td>
</tr>
<tr>
<td><b>Presenter CV *</b></td>
<td><input type="file" name="Presenter1CV" size="40" required></td>
</tr>
<tr>
<td><b>Presenter's Service Level Agreement (SLA) with Service Provider *</b></td>
<td><input type="file" id="Presenter1SLA" name="Presenter1SLA" size="40" required></td>
</tr>
<tr>
<td colspan=2>
<p style="font-weight: bold">Presenter 2 (optional)</p>
</td>
</tr>
<tr>
<td width="30%"><b>Title</b></td>
<td><select name="Presenter2Title">
<?php
$sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Title' ORDER BY DisplayOrder, PicklistValue";
$rec = mysqli_query($conni, $sql);
if ($rec === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} else {
while ($row = mysqli_fetch_assoc($rec)) {
?>
<option value="<?php echo $row["PicklistValue"]; ?>" <?php if ($_REQUEST["Presenter2Title"] == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option>
<?php
}
}
?>
</select></td>
</tr>
<tr>
<td><b>First Name (Known As)</b></td>
<td><input type="text" class="presenterName" id="Presenter2FirstName" name="Presenter2FirstName" data-presenter-num="2" value="<?php echo $_REQUEST["Presenter2FirstName"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>Surname</b></td>
<td><input type="text" name="Presenter2Surname" value="<?php echo $_REQUEST["Presenter2Surname"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>ID / Passport Number</b></td>
<td><input type="text" name="Presenter2ID" value="<?php echo $_REQUEST["Presenter2ID"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>ID/ Passport Document</b></td>
<td><input type="file" name="Presenter2IDDoc" size="40"></td>
</tr>
<tr>
<td><b>Phone / Cell Number</b></td>
<td><?php echo WritePhoneField("Presenter2Phone", false); ?></td>
</tr>
<tr>
<td><b>Email Address</b></td>
<td><input type="text" name="Presenter2Email" value="<?php echo $_REQUEST["Presenter2Email"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>Presenter CV</b></td>
<td><input type="file" id="Presenter2CV" name="Presenter2CV" size="40"></td>
</tr>
<tr>
<td><b>Presenter's Service Level Agreement (SLA) with Service Provider</b></td>
<td><input type="file" id="Presenter2SLA" name="Presenter2SLA" size="40"></td>
</tr>
<tr>
<td colspan=2>
<p style="font-weight: bold">Presenter 3 (optional)</p>
</td>
</tr>
<tr>
<td width="30%"><b>Title</b></td>
<td><select name="Presenter3Title">
<?php
$sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Title' ORDER BY DisplayOrder, PicklistValue";
$rec = mysqli_query($conni, $sql);
if ($rec === false) {
throw new Exception("ERROR: Database query failed: " . mysqli_error($conni));
} else {
while ($row = mysqli_fetch_assoc($rec)) {
?>
<option value="<?php echo $row["PicklistValue"]; ?>" <?php if ($_REQUEST["Presenter3Title"] == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option>
<?php
}
}
?>
</select></td>
</tr>
<tr>
<td><b>First Name (Known As)</b></td>
<td><input type="text" class="presenterName" id="Presenter3FirstName" name="Presenter3FirstName" data-presenter-num="3" value="<?php echo $_REQUEST["Presenter3FirstName"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>Surname</b></td>
<td><input type="text" name="Presenter3Surname" value="<?php echo $_REQUEST["Presenter3Surname"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>ID / Passport Number</b></td>
<td><input type="text" name="Presenter3ID" value="<?php echo $_REQUEST["Presenter3ID"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>ID/ Passport Document</b></td>
<td><input type="file" name="Presenter3IDDoc" size="40"></td>
</tr>
<tr>
<td><b>Phone / Cell Number</b></td>
<td><?php echo WritePhoneField("Presenter3Phone", false); ?></td>
</tr>
<tr>
<td><b>Email Address</b></td>
<td><input type="text" name="Presenter3Email" value="<?php echo $_REQUEST["Presenter3Email"]; ?>" size="40"></td>
</tr>
<tr>
<td><b>Presenter CV</b></td>
<td><input type="file" id="Presenter3CV" name="Presenter3CV" size="40"></td>
</tr>
<tr>
<td><b>Presenter's Service Level Agreement (SLA) with Service Provider</b></td>
<td><input type="file" id="Presenter3SLA" name="Presenter3SLA" size="40"></td>
</tr>
</tbody>
</table>
<br />
<p style="font-weight: bold">MOTIVATION FOR ACTIVITY TO BE APPROVED:</p>
<p>
<textarea name="Motivation" id="Motivation" cols="60" rows="7" required><?php echo stripslashes($_REQUEST["Motivation"]); ?></textarea>
</p>
<!-- <p>WeTransfer / DropBox documentation download link: *<br>
<input type="text" name="RemoteUpload" value="<?php echo $_REQUEST["RemoteUpload"]; ?>" size="80" required></p>-->
<p>
<input type="checkbox" name="Accept_Policy" id="Accept_Policy" value="yes" required />
I, on behalf of the
Training Provider body as specified above, hereby certify that I am fully aware of the CESA policy on the selection and appointment of training providers and the statutory requirements of continuing professional development as described in the ECSA Policy Document and undertake to comply with the requirements of serving as an approved provider for this activity.
</p>
<p>
<input type="checkbox" name="Confirm_Prices" id="Confirm_Prices" value="yes" required />
I confirm that I have seen the prices and confirm that I want to go ahead
with this application
</p>
<p>
<input type="submit" name="Submit" id="Submit" value="Submit to CESA" style="background-color:red;color:white;font-style:bold;width:150px;height:50px" />
</p>
</form>
<script language="Javascript">
var allowSubmit = true;
function isFileValid(fileObject) {
if (/^[\x20-\x7E]+$/.test(fileObject.val())) {
return true;
} else {
return false;
}
}
function checkForm() {
var allValid = true;
jQuery('input[type="file"]').each(function() {
if (jQuery(this).val() != '' && !isFileValid(jQuery(this))) {
allValid = false;
alert('The files you upload may only contain characters A-Z, 0-9, spaces, hyphens and dots.');
jQuery(this).focus();
allValid = false;
return false;
}
});
// console.log(allValid)
// return false;
if (allValid && allowSubmit) {
allowSubmit = false;
jQuery('#Submit').attr('value', 'Sending now ...');
jQuery('#Submit').attr('disabled', 'disabled');
return allValid;
} else {
return false;
}
return allValid;
}
function presenterRequired(presenterNameField) {
var presenterNum = presenterNameField.attr('data-presenter-num');
var nameField = '#Presenter' + presenterNum + 'FirstName';
var fileField = '#Presenter' + presenterNum + 'CV';
if (jQuery(nameField).val() != '') {
jQuery(fileField).attr('required', 'required');
} else {
jQuery(fileField).removeAttr('required');
}
}
function vatYN() {
if (jQuery('#noVat').is(':checked')) {
jQuery('#ResponsibleVATNumber').removeAttr('required');
} else {
jQuery('#ResponsibleVATNumber').attr('required', 'required');
}
}
function showHidePrevAccredNum() {
if (jQuery('#RenewOrNew_n').is(':checked')) {
jQuery('#trPrevAccredNum').attr('style', 'display: none;');
} else {
jQuery('#trPrevAccredNum').attr('style', '');
}
}
jQuery(document).ready(function() {
jQuery('#noVat').click(function() {
vatYN();
});
jQuery('.presenterName').change(function() {
presenterRequired(jQuery(this));
});
jQuery('.presenterName').each(function() {
presenterRequired(jQuery(this));
});
jQuery('.RenewOrNew').change(function() {
showHidePrevAccredNum();
});
vatYN();
// jQuery('#activityForm').on('submit', function () {
// if (allowSubmit) {
// allowSubmit = false;
// jQuery('#Submit').attr('value', 'Sending now ...');
// jQuery('#Submit').attr('disabled', 'disabled');
// return true;
// } else {
// return false;
// }
// });
});
</script>
<?php
}
} elseif ($_REQUEST["do"] == "logout") {
$_SESSION['ProviderID'] = "";
unset($_SESSION["CPDProviderID"]);
unset($_SESSION["firstname"]);
unset($_SESSION["lastname"]);
unset($_SESSION["email"]);
?>
<p>You have been logged out.</p>
<?php
}
}
?>
<script>
function check() {
jQuery.getJSON(
'/echasl23/ajax/session-keep-alive.php',
function(data) {}
);
}
jQuery(document).ready(function() {
setInterval(function() {
check();
}, 100000); // Tick every 100 seconds
check();
});
</script>
<?php
include_once($_SERVER['DOCUMENT_ROOT'] . '/php/templates/inc_footer.php');