| Current Path : /var/www/cesa.co.za/php/ |
| Current File : /var/www/cesa.co.za/php/cceregister.php |
<?php
// ini_set('display_errors', 1);
// error_reporting(E_ALL);
$iYearRegistering = date('Y') + 1;
$pagetitle = "Business of Consulting Engineering Management Development Programme (BCE-MDP) Registration";
include_once("inc_db.php");
require_once($_SERVER['DOCUMENT_ROOT'] . '/cesanet/inc_shared.php');
// require_once($_SERVER['DOCUMENT_ROOT'] . '/phpmailer/PHPMailer.php');
// require_once($_SERVER['DOCUMENT_ROOT'] . '/phpmailer/SMTP.php');
// require_once($_SERVER['DOCUMENT_ROOT'] . '/phpmailer/Exception.php');
// require_once($_SERVER['DOCUMENT_ROOT'] . '/php/includes/HTMLHelper.php');
// use PHPMailer\PHPMailer\PHPMailer;
$sMsg = "";
$bShowForm = true;
$bCourseFull = false;
$bDeadlinePassed = false;
function CaseCorrect($str)
{
$newstr = ucwords(strtolower($str));
return $newstr;
}
//echo "Registrations for BCE 2020 are now closed. Registrations for 2021 will open later in the year.";
//$bShowForm=false;
function XMail($to, $subject, $msg, $from, $CC = "", $type = "html")
{
$mail = new PHPMailer;
$mail->Mailer = "mail";
/*
$mail->Mailer="smtp";
$mail->Host="relay.aitonline.co.za";
$mail->Port=587;
$mail->Username="mail@cesa.co.za";
$mail->Password="c3SAmail!@!";
$mail->SMTPDebug=false;
$mail->SMTPAuth=true;
*/
if ($type == "html")
$mail->IsHTML(true);
$mail->From = $from;
$mail->FromName = $from;
$arrto = explode(",", $to);
for ($i = 0; $i < count($arrto); $i++) {
$mail->AddAddress($arrto[$i]);
}
$mail->Subject = $subject;
$mail->Body = $msg;
$mail->Send();
}
function GenPassword()
{
// Password generation
$length = 8; // Must be a multiple of 2
$conso = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "x", "y", "z");
$vocal = array("a", "e", "i", "o", "u");
$password = "";
srand((float) microtime() * 1000000);
$max = $length / 2;
for ($i = 1; $i <= $max; $i++) {
$password .= $conso[rand(0, 19)];
$password .= $vocal[rand(0, 4)];
}
return $password;
}
$iProgramme = $_REQUEST["programme"];
if (empty($iProgramme))
$iProgramme = 1;
$sql = "SELECT
MAX(CCECourseScheduleID) AS Schedule,
MAX(StartDate) AS StartDate,
MAX(RegistrationDeadline) AS RegistrationDeadline
FROM CCECourseSchedules
WHERE CCECourseID=" . intval($iProgramme) . "
AND CCECourseScheduleID = (SELECT CurrentScheduleID FROM CCESetup)
ORDER BY StartDate DESC LIMIT 1";
//echo $sql;
$recCount = mysql_query($sql);
if ($rowCount = mysql_fetch_assoc($recCount)) {
$iProgrammeSchedule = $rowCount["Schedule"];
$iYearRegistering = date('Y', strtotime($rowCount["StartDate"]));
if (isset($rowCount["RegistrationDeadline"])) {
$registerDeadline = new DateTime($rowCount["RegistrationDeadline"]);
$currentDate = new DateTime();
if ($registerDeadline->getTimestamp() < $currentDate->getTimestamp()) {
$bDeadlinePassed = true;
}
}
}
mysql_free_result($recCount);
if (isset($_POST["go"]) && ($_POST["go"] == 1)) {
// $iProgrammeSchedule=11;
// $sql = "SELECT MaxStudents, COUNT(*) AS NumStudents FROM CCEStudents INNER JOIN CCEStudentCourses USING (CCEStudentID)
// INNER JOIN CCECourseSchedules USING (CCECourseScheduleID)
// WHERE CCEStudents.Archived=0 AND CCEStudents.Accepted=1 AND CCEStudentCourses.CCECourseScheduleID=" . $iProgrammeSchedule;
$sql = "SELECT (SELECT MaxStudents FROM CCECourseSchedules WHERE YEAR(CCECourseSchedules.StartDate) = '" . $iYearRegistering . "') AS MaxStudents, COUNT(*) AS NumStudents FROM CCEStudents INNER JOIN CCEStudentCourses USING (CCEStudentID)
INNER JOIN CCECourseSchedules USING (CCECourseScheduleID)
WHERE CCEStudents.Archived=0 AND CCEStudents.Accepted=1 AND CCEStudentCourses.CCECourseScheduleID = (SELECT MAX(CCECourseScheduleID) AS CSID FROM CCECourseSchedules WHERE YEAR(CCECourseSchedules.StartDate) = '" . $iYearRegistering . "')";
// echo 'Please ignore debug info: ' . $sql . '<br />';
//die();
$recCount = mysql_query($sql);
if ($rowCount = mysql_fetch_assoc($recCount)) {
if ($rowCount["MaxStudents"] <= $rowCount["NumStudents"])
$bCourseFull = true;
}
mysql_free_result($recCount);
if ($bCourseFull) {
echo "<p style='color:red'><b>We regret to advise that BCE " . $iYearRegistering . " is fully subscribed, please contact Blessings Banda at <a href='mailto:blessings@cesa.co.za'>blessings@cesa.co.za</a> or 011 4632022 if you would like information about next year's course.</b></p>";
} else {
if (empty($_POST['FirstName'])) {
$sMsg .= "<li>Please enter your first name</li>";
}
if (empty($_POST['Surname'])) {
$sMsg .= "<li>Please enter your surname</li>";
}
if (empty($_POST['EmailAddress'])) {
$sMsg .= "<li>Please enter your email address</li>";
}
if (empty($_POST['IDNumber'])) {
$sMsg .= "<li>Please enter your ID Number</li>";
}
if (!reCaptcha($_POST["g-recaptcha-response"])) {
$sMsg .= "<li>You could not be verified as not being a robot, please tick the reCaptcha verification option at the bottom of the form.</li>";
}
if (empty($_POST['Accept_Policy'])) {
$sMsg .= "<li>You have not accepted the payment terms and conditions</li>";
}
$marketingSourceError = CCEStudents::validateBceMarketingSource(
$_POST['MarketingSource'] ?? '',
$_POST['MarketingSourceOther'] ?? ''
);
if ($marketingSourceError !== null) {
$sMsg .= "<li>" . htmlspecialchars($marketingSourceError, ENT_QUOTES, 'UTF-8') . "</li>";
}
if (empty($sMsg)) {
$bShowForm = false;
$sql = "SELECT * FROM CCEStudents WHERE IDNumber='" . addslashes(stripslashes($_REQUEST["IDNumber"])) . "'";
$recCheck = mysql_query($sql);
if ($rowCheck = mysql_fetch_assoc($recCheck)) {
$sMsg .= "<li>The ID number you provided is already registered.</li>";
$bShowForm = true;
}
mysql_free_result($recCheck);
}
if (empty($sMsg)) {
$uploaddir = 'cceadmin/students/';
$uploadfilename1 = "";
$uploadfilename2 = "";
$uploadfilename3 = "";
$uploadfilename4 = "";
$uploadfilename5 = "";
$uploadfilename6 = "";
$uploadfilename7 = "";
$uploadfile1 = "";
$uploadfile2 = "";
$uploadfile3 = "";
$uploadfile4 = "";
$uploadfile5 = "";
$uploadfile6 = "";
$uploadfile7 = "";
if (isset($_FILES['CVFile'])) {
$uploadfilename1 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['CVFile']['name']))));
$uploadfile1 = $uploaddir . $uploadfilename1;
$ifilenum = 1;
while (file_exists($uploadfile1) && !empty($uploadfilename1)) {
$uploadfile1 = $uploaddir . $ifilenum . "_" . $uploadfilename1;
$ifilenum++;
}
move_uploaded_file($_FILES['CVFile']['tmp_name'], $uploadfile1);
}
if (isset($_FILES['MotivationalLetter'])) {
$uploadfilename7 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['MotivationalLetter']['name']))));
$uploadfile7 = $uploaddir . $uploadfilename7;
$ifilenum = 1;
while (file_exists($uploadfile7) && !empty($uploadfilename7)) {
$uploadfile7 = $uploaddir . $ifilenum . "_" . $uploadfilename7;
$ifilenum++;
}
move_uploaded_file($_FILES['MotivationalLetter']['tmp_name'], $uploadfile7);
}
if (isset($_FILES['QualCertificate1'])) {
$uploadfilename2 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['QualCertificate1']['name']))));
$uploadfile2 = $uploaddir . $uploadfilename2;
$ifilenum = 1;
while (file_exists($uploadfile2) && !empty($uploadfilename2)) {
$uploadfile2 = $uploaddir . $ifilenum . "_" . $uploadfilename2;
$ifilenum++;
}
move_uploaded_file($_FILES['QualCertificate1']['tmp_name'], $uploadfile2);
}
if (isset($_FILES['QualCertificate2'])) {
$uploadfilename3 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['QualCertificate2']['name']))));
$uploadfile3 = $uploaddir . $uploadfilename3;
$ifilenum = 1;
while (file_exists($uploadfile3) && !empty($uploadfilename3)) {
$uploadfile3 = $uploaddir . $ifilenum . "_" . $uploadfilename3;
$ifilenum++;
}
move_uploaded_file($_FILES['QualCertificate2']['tmp_name'], $uploadfile3);
}
if (isset($_FILES['QualCertificate3'])) {
$uploadfilename4 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['QualCertificate3']['name']))));
$uploadfile4 = $uploaddir . $uploadfilename4;
$ifilenum = 1;
while (file_exists($uploadfile4) && !empty($uploadfilename4)) {
$uploadfile4 = $uploaddir . $ifilenum . "_" . $uploadfilename4;
$ifilenum++;
}
move_uploaded_file($_FILES['QualCertificate3']['tmp_name'], $uploadfile4);
}
if (isset($_FILES['IDFile'])) {
$uploadfilename5 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['IDFile']['name']))));
$uploadfile5 = $uploaddir . $uploadfilename5;
$ifilenum = 1;
while (file_exists($uploadfile5) && !empty($uploadfilename5)) {
$uploadfile5 = $uploaddir . $ifilenum . "_" . $uploadfilename5;
$ifilenum++;
}
move_uploaded_file($_FILES['IDFile']['tmp_name'], $uploadfile5);
}
if (isset($_FILES['PhotoFile'])) {
$uploadfilename6 = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['PhotoFile']['name']))));
$uploadfile6 = $uploaddir . $uploadfilename6;
$ifilenum = 1;
while (file_exists($uploadfile6) && !empty($uploadfilename6)) {
$uploadfile6 = $uploaddir . $ifilenum . "_" . $uploadfilename6;
$ifilenum++;
}
move_uploaded_file($_FILES['PhotoFile']['tmp_name'], $uploadfile6);
}
$marketingSourceData = CCEStudents::normalizeBceMarketingSource(
$_REQUEST['MarketingSource'] ?? '',
$_REQUEST['MarketingSourceOther'] ?? ''
);
$MarketingSource = $marketingSourceData['MarketingSource'];
$MarketingSourceOther = $marketingSourceData['MarketingSourceOther'];
$sql = "INSERT INTO CCEStudents (`FirstName`, `Surname`, `KnownAs`, `IDNumber`, `Telephone`, `Cellphone`,
`EmailAddress`, `EmailAddress2`, `HomeAddress`, `WorkAddress`, `PostalAddress`, `Title`, `Designation`, `Department`,
`Age`, `HighestQual`, `AreaDiscipline`,
`Organisation`, `ECSANumber`, `DietaryRequirements`, `OrganisationType`, `OrderNo`, `CESAAccountNo`,
`VATNo`, `BookedByName`, `BookedByDesignation`, `BookedByTelNo`, `BookedByCellNo`, `BookedByEmail`,
`MentorFirstName`, MentorSurname, `MentorDesig`, `MentorTel`, `MentorCell`, `MentorEmail`, `HRManagerName`, `HRManagerDesignation`,
`HRManagerTelNo`, `HRManagerCellNo`, `HRManagerEmail`, `CVFile`, `QualCertificate1`, `QualCertificate2`, `QualCertificate3`, IDFile, PhotoFile, LengthEmploy, Archived, ECSARegistered, CESAMemberFirm,
OtherCEFirms, BlockAccess, MotivationalLetter, PreferredCourierAddress, Accepted, `ECSACategory`, `OtherStatutoryBodyRegistered`, `OtherStatutoryBodyName`, `OtherStatutoryBodyNumber`, `OtherStatutoryBodyCategory`,
`MarketingSource`, `MarketingSourceOther`)
VALUES ('" . addslashes(stripslashes(CaseCorrect($_REQUEST["FirstName"]))) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["Surname"]))) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["KnownAs"]))) . "',
'" . addslashes(stripslashes($_REQUEST["IDNumber"])) . "', '" . addslashes(stripslashes($_REQUEST["Telephone"])) . "', '" . addslashes(stripslashes($_REQUEST["Cellphone"])) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["EmailAddress"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["EmailAddress2"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["HomeAddress"]))) . "\r\n" . addslashes($_REQUEST["HomePostCode"]) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["WorkAddress"]))) . "\r\n" . addslashes($_REQUEST["WorkPostCode"]) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["PostalAddress"]))) . "\r\n" . addslashes($_REQUEST["PostCode"]) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["Title"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["Designation"]))) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["Department"]))) . "',
'" . intval($_REQUEST["Age"]) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["HighestQual"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["AreaDiscipline"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["Organisation"]))) . "', '" . addslashes(stripslashes($_REQUEST["ECSANumber"])) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["DietaryRequirements"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["OrganisationType"]))) . "',
'" . addslashes(stripslashes($_REQUEST["OrderNo"])) . "', '" . addslashes(stripslashes($_REQUEST["CESAAccountNo"])) . "', '" . addslashes(stripslashes($_REQUEST["VATNo"])) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["BookedByName"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["BookedByDesignation"]))) . "',
'" . addslashes(stripslashes($_REQUEST["BookedByTelNo"])) . "',
'" . addslashes(stripslashes($_REQUEST["BookedByCellNo"])) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["BookedByEmail"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["MentorFirstName"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["MentorSurname"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["MentorDesig"]))) . "',
'" . addslashes(stripslashes($_REQUEST["MentorTel"])) . "', '" . addslashes(stripslashes($_REQUEST["MentorCell"])) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["MentorEmail"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["HRManagerName"]))) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["HRManagerDesignation"]))) . "',
'" . addslashes(stripslashes($_REQUEST["HRManagerTelNo"])) . "', '" . addslashes(stripslashes($_REQUEST["HRManagerCellNo"])) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["HRManagerEmail"]))) . "',
'" . str_replace($uploaddir, '', $uploadfile1) . "',
'" . str_replace($uploaddir, '', $uploadfile2) . "',
'" . str_replace($uploaddir, '', $uploadfile3) . "',
'" . str_replace($uploaddir, '', $uploadfile4) . "',
'" . str_replace($uploaddir, '', $uploadfile5) . "',
'" . str_replace($uploaddir, '', $uploadfile6) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["LengthEmploy"]))) . "', 0, '" . $_REQUEST["ECSARegistered"] . "', '" . $_REQUEST["CESAMemberFirm"] . "', '" . addslashes(stripslashes($_REQUEST["OtherCEFirms"])) . "', 'y',
'" . str_replace($uploaddir, '', $uploadfile7) . "', '" . $_REQUEST["PreferredCourierAddress"] . "', 0, '" . addslashes(stripslashes($_REQUEST["ECSACategory"])) . "', '" . addslashes(stripslashes($_REQUEST["OtherStatutoryBodyRegistered"])) . "', "
. "'" . addslashes(stripslashes($_REQUEST["OtherStatutoryBodyName"])) . "', '" . addslashes(stripslashes($_REQUEST["OtherStatutoryBodyNumber"])) . "', '" . addslashes(stripslashes($_REQUEST["OtherStatutoryBodyCategory"])) . "', "
. "'" . addslashes($MarketingSource) . "', '" . addslashes($MarketingSourceOther) . "'
)";
if ($_REQUEST["Surname"] != 'Test') {
mysql_query($sql);
}
$iStudentID = mysql_insert_id();
$sStudentNumber = "CCE" . str_pad($iStudentID, 6, "0", STR_PAD_LEFT);
$WebUsername = $sStudentNumber;
$WebPassword = GenPassword();
$sql = "UPDATE CCEStudents SET StudentNumber='" . $sStudentNumber . "', WebUsername='" . $WebUsername . "', WebPassword='" . $WebPassword . "'
WHERE CCEStudentID=" . $iStudentID;
if ($_REQUEST["Surname"] != 'Test') {
mysql_query($sql);
}
$sql = "INSERT INTO CCEStudentCourses (`CCECourseID`, `CCEStudentID`, `OrderNo`, `BookedByName`, `BookedByDesignation`,
`BookedByTelNo`, `BookedByCellNo`, `BookedByEmail`, CCECourseScheduleID)
VALUES ('" . $iProgramme . "', '" . $iStudentID . "', '" . addslashes(stripslashes($_REQUEST["OrderNo"])) . "', '" . addslashes(stripslashes(CaseCorrect($_REQUEST["BookedByName"]))) . "',
'" . addslashes(stripslashes(CaseCorrect($_REQUEST["BookedByDesignation"]))) . "', '" . addslashes(stripslashes($_REQUEST["BookedByTelNo"])) . "',
'" . addslashes(stripslashes($_REQUEST["BookedByCellNo"])) . "', '" . CaseCorrect($_REQUEST["BookedByEmail"]) . "', '" . $iProgrammeSchedule . "')";
if ($_REQUEST["Surname"] != 'Test') {
mysql_query($sql);
}
$sql = "INSERT INTO CCEStudentSessions (`CCEStudentID`, `CCESessionScheduleID`)
SELECT '" . $iStudentID . "', CCESessionSchedules.CCESessScheduleID
FROM CCESessions, CCESessionSchedules
WHERE CCESessions.CCECourseID='" . $iProgramme . "'
AND CCESessions.CCESessionID = CCESessionSchedules.CCESessionID
AND CCESessionSchedules.CCECourseScheduleID=" . $iProgrammeSchedule;
if ($_REQUEST["Surname"] != 'Test') {
mysql_query($sql);
}
$ECSARegistered = "No";
switch ($_REQUEST["ECSARegistered"]) {
case "c":
$ECSARegistered = "Yes, Candidate Engineer";
break;
case "p":
$ECSARegistered = "Yes, Professional Engineer";
break;
case "n":
$ECSARegistered = "No";
break;
case "y":
$ECSARegistered = "Yes";
break;
}
$CESAMemberFirm = "No";
switch ($_REQUEST["CESAMemberFirm"]) {
case "y":
$CESAMemberFirm = "Yes";
break;
case "n":
$CESAMemberFirm = "No";
break;
}
$OtherRegistered = 'No';
if ($_REQUEST["OtherStatutoryBodyRegistered"] > 0) {
$OtherRegistered = 'Yes';
}
$sForm = '
<h3>REGISTRATION FOR THE CERTIFICATE IN CONSULTING ENGINEERING ' . $iYearRegistering . '</h3>
<h4>Your Student Number: ' . $sStudentNumber . '</h4>
<h4>Programme: Business of Consulting Engineering Management Development Programme (BCE-MDP) ' . $iYearRegistering . '</h4>
<table border="1" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td width="233"><p>Title:</p></td>
<td width="349"><p>' . CaseCorrect($_REQUEST["Title"]) . '</p></td>
</tr>
<tr>
<td width="233"><p>First Name:</p></td>
<td width="349"><p>' . CaseCorrect($_REQUEST["FirstName"]) . '</p></td>
</tr>
<tr>
<td><p>Surname:</p></td>
<td><p>' . CaseCorrect($_REQUEST["Surname"]) . '</p></td>
</tr>
<tr>
<td><p>Preferred Name (Known As):</p></td>
<td><p>' . CaseCorrect($_REQUEST["KnownAs"]) . '</p></td>
</tr>
<tr>
<td><p>Are you registered with ECSA?</p></td>
<td><p>' . $ECSARegistered . '</p></td>
</tr>
<tr>
<td><p>ECSA Category of Registration</p></td>
<td><p>' . CaseCorrect($_REQUEST["ECSACategory"]) . '</p></td>
</tr>
<tr>
<td><p>ECSA Number:</p></td>
<td><p>' . $_REQUEST["ECSANumber"] . '</p></td>
</tr>
<tr>
<td><p>Are you registered with another statutory body?</p></td>
<td><p>' . $OtherRegistered . '</p></td>
</tr>
<tr>
<td><p>Statutory Body Name</p></td>
<td><p>' . CaseCorrect($_REQUEST["OtherStatutoryBodyName"]) . '</p></td>
</tr>
<tr>
<td><p>Statutory Body Number</p></td>
<td><p>' . CaseCorrect($_REQUEST["OtherStatutoryBodyNumber"]) . '</p></td>
</tr>
<tr>
<td><p>Statutory Body Category</p></td>
<td><p>' . CaseCorrect($_REQUEST["OtherStatutoryBodyCategory"]) . '</p></td>
</tr>
<tr>
<td><p>ID Number:</p></td>
<td><p>' . $_REQUEST["IDNumber"] . '</p></td>
</tr>
<tr>
<td><p>Your Age:</p></td>
<td><p>' . $_REQUEST["Age"] . '</p></td>
</tr>
<tr>
<td><p>Highest Qualification:</p></td>
<td><p>' . CaseCorrect($_REQUEST["HighestQual"]) . '</p></td>
</tr>
<tr>
<td><p>Area of Discipline:</p></td>
<td><p>' . CaseCorrect($_REQUEST["AreaDiscipline"]) . '</p></td>
</tr>
<tr>
<td valign="top">Organisation Name:</td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["Organisation"]))) . '</p></td>
</tr>
<tr>
<td>How long have you worked in a Consulting Engineering Firm?</td>
<td><p>' . CaseCorrect($_REQUEST["LengthEmploy"]) . '</p></td>
</tr>
<tr>
<td>Previous Consulting Engineering Firms you have worked for</td>
<td><p>' . nl2br(stripslashes($_REQUEST["OtherCEFirms"])) . '</p></td>
</tr>
<tr>
<td>Where did you hear about the BCE MDP?</td>
<td><p>' . htmlspecialchars(CCEStudents::formatBceMarketingSourceForDisplay($MarketingSource, $MarketingSourceOther), ENT_QUOTES, 'UTF-8') . '</p></td>
</tr>
<tr>
<td valign="top">Is the organisation a CESA member firm?</td>
<td><p>' . $CESAMemberFirm . '</p></td>
</tr>
<tr>
<td valign="top">CESA Account No:</td>
<td><p>' . $_REQUEST["CESAAccountNo"] . '</p></td>
</tr>
<tr>
<td><p>Telephone No:</p></td>
<td><p>' . $_REQUEST["Telephone"] . '</p></td>
</tr>
<tr>
<td><p>Cell No. :</p></td>
<td><p>' . $_REQUEST["Cellphone"] . '</p></td>
</tr>
<tr>
<td><p>E-mail Address:</p></td>
<td><p>' . CaseCorrect($_REQUEST["EmailAddress"]) . '</p></td>
</tr>
<tr>
<td><p>Personal E-mail Address (e.g. Gmail):</p></td>
<td><p>' . CaseCorrect($_REQUEST["EmailAddress2"]) . '</p></td>
</tr>
<tr>
<td valign="top"><p>Current Residential Address:</p></td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["HomeAddress"]))) . '</p></td>
</tr>
<tr>
<td valign="top"><p>Work Address:</p></td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["WorkAddress"]))) . '</p></td>
</tr>
<tr>
<td valign="top"><p>Postal Address:</p></td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["PostalAddress"]))) . '</p></td>
</tr>
<tr><td valign="top"><p>Preferred Courier Address:</p></td><td><p>' . $_REQUEST["PreferredCourierAddress"] . '</p></td></tr>
<tr>
<td>Designation:</td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["Designation"]))) . '</p></td>
</tr>
<tr>
<td valign="top">Organisation Type:</td>
<td><p>' . nl2br(stripslashes($_REQUEST["OrganisationType"])) . '</p></td>
</tr>
<tr>
<td valign="top">VAT No:</td>
<td><p>' . nl2br(stripslashes($_REQUEST["VATNo"])) . '</p></td>
</tr>
<tr>
<td valign="top">Order No:</td>
<td><p>' . nl2br(stripslashes($_REQUEST["OrderNo"])) . '</p></td>
</tr>
<tr>
<td valign="top">Programme:</td>
<td>Business of Consulting Engineering</td>
</tr>
<tr>
<td valign="top"><strong>Mentor:</strong></td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["MentorFirstName"] . " " . $_REQUEST["MentorSurname"]))) . '</td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["MentorDesig"]))) . '</td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td>' . nl2br(stripslashes($_REQUEST["MentorTel"])) . '</td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td>' . nl2br(stripslashes($_REQUEST["MentorCell"])) . '</td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["MentorEmail"]))) . '</td>
</tr>
<tr>
<td valign="top"><strong>HR Manager:</strong></td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["HRManagerName"]))) . '</td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["HRManagerDesignation"]))) . '</td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td>' . nl2br(stripslashes($_REQUEST["HRManagerTelNo"])) . '</td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td>' . nl2br(stripslashes($_REQUEST["HRManagerCellNo"])) . '</td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td>' . nl2br(stripslashes(CaseCorrect($_REQUEST["HRManagerEmail"]))) . '</td>
</tr>
<tr>
<td valign="top"><strong>Booked By:</strong></td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["BookedByName"]))) . '</p></td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["BookedByDesignation"]))) . '</p></td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td><p>' . nl2br(stripslashes($_REQUEST["BookedByTelNo"])) . '</p></td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td><p>' . nl2br(stripslashes($_REQUEST["BookedByCellNo"])) . '</p></td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td><p>' . nl2br(stripslashes(CaseCorrect($_REQUEST["BookedByEmail"]))) . '</p></td>
</tr>
</tbody>
</table>';
$messageText = '<p>
Thank you for submitting your application for the Business of Consulting Engineering Management Development Programme (BCE-MDP).
A copy of your completed form is included below.
</p>
<p>
Your application will now proceed through the following stages:
</p>
<p>
<table width="100%" cellpadding="5" cellspacing="0" border="0">
<tbody>
<tr>
<td width="30" nowrap>
<b>Step 1:</b>
</td>
<td>
Your application, along with your supporting documents, will be forwarded to the BCE-MDP reviewers, who will assess the application.
You will be contacted by our office should you not have submitted all the required documents, so that our reviewers can make an
informed decision.
</td>
</tr>
<tr>
<td width="30" nowrap>
<b>Step 2:</b>
</td>
<td>
Students not meeting minimum entrance requirements will be notified of their unsuccessful application, after the initial review.
</td>
</tr>
<tr>
<td width="30" nowrap>
<b>Step 3:</b>
</td>
<td>
In mid-January, applications that have advanced will be evaluated by a final review committee.
</td>
</tr>
<tr>
<td width="30" nowrap>
<b>Step 4:</b>
</td>
<td>
By the end of January, you will have received written confirmation as to whether you have secured one of the available spots in
the programme or have been placed on the waitlist.
</td>
</tr>
<tr>
<td width="30" nowrap>
<b>Step 5:</b>
</td>
<td>
Information regarding the programme will be made available to you and your organisation early in February. Once confirmation of
attendance has been received, an invoice will be issued to your company, payable within 30 days of receipt.
</td>
</tr>
<tr>
<td width="30" nowrap>
<b>Step 6:</b>
</td>
<td>
The programme will officially commence toward the end of February with a full day in-person launch and orientation, taking place
at the CESA offices in Paulshof, and satellite venues in other major cities. All subsequent sessions, except for the final exam at
year-end, will be conducted online.
</td>
</tr>
</tbody>
</table>
</p>
<p>
If you have any questions or need further assistance, please feel free to contact Melissa Jardine at melissa@cesa.co.za or on (+27) 011 463-2022
/ (+27) 081 458 4190, or reach out to me directly.
</p>
<p>
With kind regards<br />
Brenda Lacey-Smith<br />
Manager: Education and Training<br />
CESA School of Consulting Engineering<br />
(+27) 011 463 2022<br />
(+27) 084 9000 195<br />
Email: <a href="mailto:brenda@cesa.co.za">brenda@cesa.co.za</a>
</p>';
echo $messageText . $sForm;
$sSendFormTo = "blessings@cesa.co.za, craigclarkeknysna@gmail.com, brenda@cesa.co.za, billy.galal@gmail.com, michele@rivarola.co.za, "
. "geoffm@grindstoneprops.co.za, diane.liebenberg@dcx7.co.za, athromethm@cesa.co.za, melissa@cesa.co.za";
// nico.swart@nsengineers.co.za, Celia.Mullane@gmail.com,
// $sSendFormTo = "julia@xe.co.za";
if ($_REQUEST["Surname"] != 'Test') {
maill(
$sSendFormTo,
"REGISTRATION FOR BCE " . $iYearRegistering,
$sForm,
null,
['isHTML' => true, 'from-name' => 'BCE CESAnet', 'reply-to-address' => 'blessings@cesa.co.za']
);
maill(
$_POST['EmailAddress'],
"REGISTRATION FOR BCE " . $iYearRegistering,
$messageText . $sForm,
null,
['isHTML' => true, 'from-name' => 'BCE CESAnet', 'reply-to-address' => 'blessings@cesa.co.za']
);
}
}
}
}
if ($bDeadlinePassed) {
echo "<p style='color:red'><b>We regret to advise that the registration deadline for BCE " . $iYearRegistering
. " has passed. Please contact CESA SCE at <a href='mailto:sce@cesa.co.za'>sce@cesa.co.za</a>
or (+27) 011 463 2022 if you would like information about next year's programme.</b></p>";
} elseif ($bShowForm) {
?>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<form action="/sce/bce-registration/" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return CheckFiles();">
<input type="hidden" name="go" value="1" />
<h3>REGISTRATION FOR THE CERTIFICATE IN CONSULTING ENGINEERING</h3>
<h3><?php echo $iYearRegistering; ?> COURSE</h3>
<?php
if (!empty($sMsg))
echo "<p style='color:red'><b>Error:<br /><ul style='color:red'>" . $sMsg . "</ul></b></p>";
?>
<p>Please complete the on-line application form below.
<p>NB: Please ensure you have a copy of your CV and proof of qualification/s ready for upload in an electronic format.
<table border="1" cellpadding="5" cellspacing="0">
<tbody>
<tr>
<td>Title:</td>
<td><input name="Title" type="text" id="Title" size="50" value="<?php echo $_REQUEST["Title"]; ?>" /></td>
</tr>
<tr>
<td width="233">
<p>First Name:</p>
</td>
<td width="349">
<p>
<input name="FirstName" type="text" id="FirstName" size="50" value="<?php echo $_REQUEST["FirstName"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>
<p>Surname:</p>
</td>
<td><input name="Surname" type="text" id="Surname" size="50" value="<?php echo $_REQUEST["Surname"]; ?>" /></td>
</tr>
<tr>
<td>
<p>Preferred Name (Known As):</p>
</td>
<td>
<p>
<input name="KnownAs" type="text" id="KnownAs" size="50" value="<?php echo $_REQUEST["KnownAs"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>Are you registered with ECSA?</td>
<td>
<p>
<label>
<input type="radio" name="ECSARegistered" value="y" id="ECSARegistered_0" <?php if ($_REQUEST["ECSARegistered"] == "y") echo " checked"; ?>>
Yes</label>
<br>
<label>
<input type="radio" name="ECSARegistered" value="n" id="ECSARegistered_2" <?php if ($_REQUEST["ECSARegistered"] == "n") echo " checked"; ?>>
No</label>
<br>
</p>
</td>
</tr>
<tr>
<td>ECSA Category of Registration:</td>
<td>
<?php
$cceStudentObj = new CCEStudents($sqlf);
echo $cceStudentObj->getECSACategorySelectList($_REQUEST["ECSACategory"]);
?>
</td>
</tr>
<tr>
<td>ECSA Number:</td>
<td><input name="ECSANumber" type="text" id="ECSANumber" size="30" value="<?php echo $_REQUEST["ECSANumber"]; ?>" /></td>
</tr>
<tr>
<td>Are you registered with another statutory body?</td>
<td>
<p>
<label>
<input type="radio" name="OtherStatutoryBodyRegistered" value="1" id="OtherStatutoryBodyRegistered_0" <?php if ($_REQUEST["OtherStatutoryBodyRegistered"] == 1) echo " checked"; ?>>
Yes</label>
<br>
<label>
<input type="radio" name="OtherStatutoryBodyRegistered" value="0" id="OtherStatutoryBodyRegistered_2" <?php if ($_REQUEST["OtherStatutoryBodyRegistered"] !== 1) echo " checked"; ?>>
No</label>
<br>
</p>
</td>
</tr>
<tr>
<td>If yes, name of statutory body, registration number and category if registration:</td>
<td><input name="OtherStatutoryBodyName" type="text" id="OtherStatutoryBodyName" size="30" value="<?php echo $_REQUEST["OtherStatutoryBodyName"]; ?>" placeholder="Other statutory body name" /></td>
</tr>
<tr>
<td> </td>
<td><input name="OtherStatutoryBodyNumber" type="text" id="OtherStatutoryBodyNumber" size="30" value="<?php echo $_REQUEST["OtherStatutoryBodyNumber"]; ?>" placeholder="Other statutory body number" /></td>
</tr>
<tr>
<td> </td>
<td><input name="OtherStatutoryBodyCategory" type="text" id="OtherStatutoryBodyCategory" size="30" value="<?php echo $_REQUEST["OtherStatutoryBodyCategory"]; ?>" placeholder="Other statutory body registration category" /></td>
</tr>
<tr>
<td>ID Number:</td>
<td><input name="IDNumber" type="text" id="IDNumber" size="30" value="<?php echo $_REQUEST["IDNumber"]; ?>" /></td>
</tr>
<tr>
<td>Your Age:</td>
<td><input name="Age" type="text" id="Age" size="30" value="<?php echo $_REQUEST["Age"]; ?>" /></td>
</tr>
<tr>
<td>Highest Qualification:</td>
<td><input name="HighestQual" type="text" id="HighestQual" size="50" value="<?php echo $_REQUEST["HighestQual"]; ?>" /></td>
</tr>
<tr>
<td>Area of Discipline:</td>
<td><input name="AreaDiscipline" type="text" id="AreaDiscipline" size="50" value="<?php echo $_REQUEST["AreaDiscipline"]; ?>" /></td>
</tr>
<tr>
<td>Organisation Name (Current Employer):</td>
<td><input name="Organisation" type="text" id="Organisation" size="50" value="<?php echo $_REQUEST["Organisation"]; ?>" /></td>
</tr>
<tr>
<td>How long have you worked in a Consulting Engineering Firm?</td>
<td><input name="LengthEmploy" type="text" id="LengthEmploy" size="50" value="<?php echo $_REQUEST["LengthEmploy"]; ?>" /></td>
</tr>
<tr>
<td>Previous Consulting Engineering firms you have worked for:</td>
<td><textarea name="OtherCEFirms" id="OtherCEFirms" cols="45" rows="5"><?php echo stripslashes($_REQUEST["OtherCEFirms"]); ?>
</textarea></td>
</tr>
<tr>
<td>Is the Organisation a CESA Member Firm?</td>
<td>
<p>
<label>
<input type="radio" name="CESAMemberFirm" value="y" id="CESAMemberFirm_0" <?php if ($_REQUEST["CESAMemberFirm"] == "y") echo " checked"; ?>>
Yes</label>
<br>
<label>
<input type="radio" name="CESAMemberFirm" value="n" id="CESAMemberFirm_1" <?php if ($_REQUEST["CESAMemberFirm"] == "n") echo " checked"; ?>>
No</label>
<br>
</p>
</td>
</tr>
<tr>
<td>CESA Account No:</td>
<td><input name="CESAAccountNo" type="text" id="CESAAccountNo" size="30" value="<?php echo $_REQUEST["CESAAccountNo"]; ?>" /></td>
</tr>
<tr>
<td>
<p>Your Telephone No:</p>
</td>
<td>
<p>
<input name="Telephone" type="text" id="Telephone" size="30" value="<?php echo $_REQUEST["Telephone"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>
<p>Your Cell No. :</p>
</td>
<td>
<p>
<input name="Cellphone" type="text" id="Cellphone" size="30" value="<?php echo $_REQUEST["Cellphone"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>
<p>Your E-mail Address:</p>
</td>
<td>
<p>
<input name="EmailAddress" type="text" id="EmailAddress" size="50" value="<?php echo $_REQUEST["EmailAddress"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>
<p>Personal E-mail Address (e.g. Gmail):</p>
</td>
<td>
<p>
<input name="EmailAddress2" type="text" id="EmailAddress2" size="50" value="<?php echo $_REQUEST["EmailAddress2"]; ?>" />
</p>
</td>
</tr>
<tr>
<td>Designation within Organisation:</td>
<td><input name="Designation" type="text" id="Designation3" size="50" value="<?php echo $_REQUEST["Designation"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Organisation Type:</td>
<td><input name="OrganisationType" type="text" id="OrganisationType" size="50" value="<?php echo $_REQUEST["OrganisationType"]; ?>" /></td>
</tr>
<tr>
<td valign="top">VAT No:</td>
<td><input name="VATNo" type="text" id="VATNo" size="30" value="<?php echo $_REQUEST["VATNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Order No:</td>
<td><input name="OrderNo" type="text" id="OrderNo" size="30" value="<?php echo $_REQUEST["OrderNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">
<p>Current Residential Address:</p>
</td>
<td>
<p>
<textarea name="HomeAddress" id="HomeAddress" cols="45" rows="3"><?php echo stripslashes($_REQUEST["HomeAddress"]); ?>
</textarea><br>Postal Code: <input type="text" name="HomePostCode" value="<?php echo $_REQUEST["HomePostCode"]; ?>">
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>Work Address:</p>
</td>
<td>
<p>
<textarea name="WorkAddress" id="WorkAddress" cols="45" rows="3"><?php echo stripslashes($_REQUEST["WorkAddress"]); ?>
</textarea><br>Postal Code: <input type="text" name="WorkPostCode" value="<?php echo $_REQUEST["WorkPostCode"]; ?>">
</p>
</td>
</tr>
<tr>
<td valign="top">
<p>Postal Address:</p>
</td>
<td>
<p>
<textarea name="PostalAddress" id="PostalAddress" cols="45" rows="5"><?php echo stripslashes($_REQUEST["PostalAddress"]); ?>
</textarea><br>Postal Code: <input type="text" name="PostCode" value="<?php echo $_REQUEST["PostCode"]; ?>">
</p>
</td>
</tr>
<tr>
<td valign="top">Preferred Address for Courier Deliveries:</td>
<td>
<p><select name="PreferredCourierAddress" required>
<option value="Home">Residential Address</option>
<option value="Work">Work Address</option>
</select>
</p>
</td>
</tr>
<tr>
<td valign="top">Programme:</td>
<td><label>
<input name="programme" type="checkbox" id="programme" value="1" checked="checked" />
</label>
Business of Consulting Engineering</td>
</tr>
<tr>
<td valign="top"><strong>Mentor:</strong></td>
<td> </td>
</tr>
<tr>
<td valign="top">First Name:</td>
<td><input name="MentorFirstName" type="text" id="MentorFirstName" size="50" value="<?php echo $_REQUEST["MentorFirstName"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Surname:</td>
<td><input name="MentorSurname" type="text" id="MentorSurname" size="50" value="<?php echo $_REQUEST["MentorSurname"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td><input name="MentorDesig" type="text" id="MentorDesig" size="50" value="<?php echo $_REQUEST["MentorDesig"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td><input name="MentorTel" type="text" id="MentorTel" size="30" value="<?php echo $_REQUEST["MentorTel"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td><input name="MentorCell" type="text" id="MentorCell" size="30" value="<?php echo $_REQUEST["MentorCell"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td><input name="MentorEmail" type="text" id="MentorEmail" size="50" value="<?php echo $_REQUEST["MentorEmail"]; ?>" /></td>
</tr>
<tr>
<td valign="top"><strong>HR Manager:</strong></td>
<td> </td>
</tr>
<tr>
<td valign="top">Full Name:</td>
<td><input name="HRManagerName" type="text" id="HRManagerName" size="50" value="<?php echo $_REQUEST["HRManagerName"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td><input name="HRManagerDesignation" type="text" id="HRManagerDesignation" size="50" value="<?php echo $_REQUEST["HRManagerDesignation"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td><input name="HRManagerTelNo" type="text" id="HRManagerTelNo" size="30" value="<?php echo $_REQUEST["HRManagerTelNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td><input name="HRManagerCellNo" type="text" id="HRManagerCellNo" size="30" value="<?php echo $_REQUEST["HRManagerCellNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td><input name="HRManagerEmail" type="text" id="HRManagerEmail" size="50" value="<?php echo $_REQUEST["HRManagerEmail"]; ?>" /></td>
</tr>
<tr>
<td valign="top"><strong>Booked By:</strong></td>
<td> </td>
</tr>
<tr>
<td valign="top">Full Name:</td>
<td><input name="BookedByName" type="text" id="BookedByName" size="50" value="<?php echo $_REQUEST["BookedByName"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Designation:</td>
<td><input name="BookedByDesignation" type="text" id="BookedByDesignation" size="50" value="<?php echo $_REQUEST["BookedByDesignation"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Tel No:</td>
<td><input name="BookedByTelNo" type="text" id="BookedByTelNo" size="30" value="<?php echo $_REQUEST["BookedByTelNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Cell No:</td>
<td><input name="BookedByCellNo" type="text" id="BookedByCellNo" size="30" value="<?php echo $_REQUEST["BookedByCellNo"]; ?>" /></td>
</tr>
<tr>
<td valign="top">Email Address:</td>
<td><input name="BookedByEmail" type="text" id="BookedByEmail" size="50" value="<?php echo $_REQUEST["BookedByEmail"]; ?>" /></td>
</tr>
<tr>
<td valign="top"><strong>Documents:</strong></td>
<td> </td>
</tr>
<tr>
<td valign="top">ID:</td>
<td><input type="file" name="IDFile" id="IDFile" /></td>
</tr>
<tr>
<td valign="top">Photograph:</td>
<td><input type="file" name="PhotoFile" id="PhotoFile" /></td>
</tr>
<tr>
<td valign="top">CV:</td>
<td><label>
<input type="file" name="CVFile" id="CVFile" />
</label></td>
</tr>
<tr>
<td valign="top">Motivational Letter:</td>
<td><label>
<input type="file" name="MotivationalLetter" id="MotivationalLetter" />
</label></td>
</tr>
<tr>
<td valign="top">Qualification:</td>
<td><input type="file" name="QualCertificate1" id="QualCertificate1" /></td>
</tr>
<tr>
<td valign="top">Qualification:</td>
<td><input type="file" name="QualCertificate2" id="QualCertificate2" /></td>
</tr>
<tr>
<td valign="top">Qualification:</td>
<td><input type="file" name="QualCertificate3" id="QualCertificate3" /></td>
</tr>
</tbody>
</table>
<br />
<p>Where did you hear about the BCE MDP? <span style="color:red">*</span>
<select name="MarketingSource" id="MarketingSource" required>
<option value="">Please select (required)</option>
<?php
$selectedMarketingSource = isset($_REQUEST['MarketingSource']) ? (string)$_REQUEST['MarketingSource'] : '';
foreach (CCEStudents::getBceMarketingSourceOptions() as $opt) {
$sel = ($selectedMarketingSource === $opt) ? ' selected' : '';
echo ' <option value="' . htmlspecialchars($opt, ENT_QUOTES, 'UTF-8') . '"' . $sel . '>'
. htmlspecialchars($opt, ENT_QUOTES, 'UTF-8') . '</option>' . "\n";
}
?>
</select>
</p>
<p id="MarketingSourceOtherWrap" style="display:none;">
<input type="text" name="MarketingSourceOther" id="MarketingSourceOther" size="50"
value="<?php echo htmlspecialchars(isset($_REQUEST['MarketingSourceOther']) ? (string)$_REQUEST['MarketingSourceOther'] : '', ENT_QUOTES, 'UTF-8'); ?>"
placeholder="Please specify">
</p>
<br />
<p><strong>Terms and Conditions:</strong></p>
<ul>
<li>Payment in full and the proof of payment must be paid before attending the first module, otherwise the your registration will be cancelled</li>
<li>The 10% administration fee is payable if you cancel less than 14 working days prior to the start of the module, even if we have not received payment, however a substitute can be made up to 24 hours prior to the course.</li>
<li>In order to secure your place, advance booking is essential.</li>
<li>If you fail to attend the module you will be liable for the 10% administration fee.</li>
<li>CESA reserves the right to change/cancel a specific date, venue without prior notification.</li>
<li>If no e-mail confirmation is received, please call in to confirm.</li>
<li>No booking will be considered confirmed until proof of payment has been received.</li>
</ul>
<p>
<input type="checkbox" name="Accept_Policy" id="Accept_Policy" value="yes" />
I have read and accept the terms and conditions
</p>
<div class="g-recaptcha" data-sitekey="6LcoIWUrAAAAAKBLHpjS7GyroBey9G6yhilbpyNa"></div>
<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" onclick="return Checkfiles();" />
</p>
</form>
<script language="javascript">
function checkOnFile(fileElementId) {
var fup = document.getElementById(fileElementId);
var fileName = ' ' + fup.value;
if (fileName.indexOf('\'') > 0) {
return false;
}
return true;
}
function toggleMarketingSourceOther() {
var source = document.getElementById('MarketingSource');
var wrap = document.getElementById('MarketingSourceOtherWrap');
var other = document.getElementById('MarketingSourceOther');
if (!source || !wrap || !other) {
return;
}
if (source.value === 'Other') {
wrap.style.display = 'block';
other.required = true;
} else {
wrap.style.display = 'none';
other.required = false;
}
}
function Checkfiles() {
if (!checkOnFile('IDFile') || !checkOnFile('PhotoFile') || !checkOnFile('CVFile') || !checkOnFile('MotivationalLetter') || !checkOnFile('QualCertificate1') || !checkOnFile('QualCertificate2') || !checkOnFile('QualCertificate3')) {
alert('Please remove apostrophes from all file names before uploading them');
return false;
}
var source = document.getElementById('MarketingSource');
if (!source || !source.value) {
alert('Please tell us where you heard about the BCE MDP.');
if (source) {
source.focus();
}
return false;
}
if (source.value === 'Other') {
var other = document.getElementById('MarketingSourceOther');
if (!other || !other.value.trim()) {
alert('Please specify where you heard about the BCE MDP.');
if (other) {
other.focus();
}
return false;
}
}
return true;
}
document.getElementById('MarketingSource').addEventListener('change', toggleMarketingSourceOther);
toggleMarketingSourceOther();
</script>
<?php
}
?>
<br />
<p> </p>