Linux cesa-www-main 6.1.0-49-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
Apache/2.4.68 (Debian)
Server IP : 10.218.0.2 & Your IP : 216.73.216.28
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
cesa.co.za /
php /
Delete
Unzip
Name
Size
Permission
Date
Action
_notes
[ DIR ]
drwxr-sr-x
2022-12-20 11:09
_vti_cnf
[ DIR ]
drwxr-sr-x
2022-12-20 11:09
certificate
[ DIR ]
drwxr-sr-x
2023-03-22 11:22
includes
[ DIR ]
drwxr-sr-x
2026-08-24 10:12
mail_interface
[ DIR ]
drwxr-sr-x
2025-06-14 09:47
security
[ DIR ]
drwxr-sr-x
2023-09-17 08:02
temp
[ DIR ]
drwxr-sr-x
2026-04-18 22:25
templates
[ DIR ]
drwxr-sr-x
2026-05-25 12:12
tests
[ DIR ]
drwxr-sr-x
2025-07-07 15:54
CaptchaSecurityImages.php
2.26
KB
-rw-r--r--
2022-12-20 11:09
Inc_calendarnew.php
8.59
KB
-rw-r--r--
2017-11-20 10:34
accredcourses.php
7.04
KB
-rw-r--r--
2023-08-22 10:55
adecquestionnaire.php
26.54
KB
-rw-r--r--
2025-08-01 10:38
advisory.php
7.21
KB
-rw-r--r--
2022-12-20 11:09
advisory_full.php
1.31
KB
-rw-r--r--
2022-12-20 11:09
annualdeclaration.php
15.28
KB
-rw-r--r--
2026-01-22 10:25
awardsentry.php
14.55
KB
-rw-r--r--
2025-08-01 10:38
awardsentry.php.bak
11.22
KB
-rw-r--r--
2016-04-13 12:45
bookdetail.php
954
B
-rw-r--r--
2022-12-20 11:09
books.php
4.4
KB
-rw-r--r--
2023-05-16 13:08
branchdocuments.php
1.14
KB
-rw-r--r--
2022-12-20 11:09
branches.php
2.82
KB
-rw-r--r--
2025-08-06 12:54
calendarpdf.php
1.75
KB
-rw-r--r--
2025-08-26 16:52
cceregister.php
55.59
KB
-rw-r--r--
2026-08-14 12:05
ccmregister.php
71.57
KB
-rw-r--r--
2022-12-20 11:09
class.phpmailer.php
44.39
KB
-rw-r--r--
2022-12-20 11:09
class.smtp.php
32.74
KB
-rw-r--r--
2022-12-20 11:09
committeedocs.php
932
B
-rw-r--r--
2022-12-20 11:09
committees.php
2.69
KB
-rw-r--r--
2025-08-06 12:58
cpdapply.php
5.73
KB
-rw-r--r--
2022-12-20 11:09
cpdapplyform.php
34.06
KB
-rw-r--r--
2025-08-01 10:38
cpdproviderapply.php
42.09
KB
-rw-r--r--
2026-02-10 10:10
cpdproviderportal.php
79.47
KB
-rw-r--r--
2025-09-08 07:23
cpdspverify.php
4.27
KB
-rw-r--r--
2025-10-10 10:45
cpdtmverify.php
4.45
KB
-rw-r--r--
2023-06-19 13:44
declineeventreg.php
3.73
KB
-rw-r--r--
2022-12-20 11:09
directorybooking.php
7.39
KB
-rw-r--r--
2022-12-20 11:09
downloadPN.php
385
B
-rw-r--r--
2025-06-26 13:02
downloadfile.php
280
B
-rw-r--r--
2025-08-01 10:38
enews.php
1.33
KB
-rw-r--r--
2022-12-20 11:09
enewsarchive.php
1.09
KB
-rw-r--r--
2022-12-20 11:09
event.php
12.39
KB
-rw-r--r--
2026-08-19 12:22
event_allvenues.php
18.93
KB
-rw-r--r--
2026-08-09 11:44
eventdecline_awards.php
11.79
KB
-rw-r--r--
2022-12-20 11:09
eventregister.php
26.85
KB
-rw-r--r--
2026-02-10 07:56
eventregister_awards.php
19.4
KB
-rw-r--r--
2025-06-20 06:38
eventregister_golf.php
28.83
KB
-rw-r--r--
2025-08-19 08:12
eventtables.php
24.13
KB
-rw-r--r--
2023-06-01 09:51
eventtables.php.bak
3.49
KB
-rw-r--r--
2022-12-20 11:09
fidicgama2018.php
1012
B
-rw-r--r--
2022-12-20 11:09
forum.php
3.25
KB
-rw-r--r--
2022-12-20 11:09
getoffices.php
799
B
-rw-r--r--
2022-12-20 11:09
hrforumsubscribe.php
2.62
KB
-rw-r--r--
2022-12-20 11:09
hrforumunsubscribe.php
1.32
KB
-rw-r--r--
2022-12-20 11:09
inc_calendarnew.php
10.56
KB
-rw-r--r--
2025-08-21 10:11
inc_captcha.php
337
B
-rw-r--r--
2022-12-20 11:09
inc_db.php
12.33
KB
-rw-r--r--
2025-06-18 12:05
inc_php7.php
6
KB
-rw-r--r--
2025-07-07 12:51
inc_practicenoteslist.php
4.1
KB
-rw-r--r--
2024-07-03 13:52
inc_scecalendar.php
8.55
KB
-rw-r--r--
2025-06-13 08:57
inc_scecalendar_backup.php
6.66
KB
-rw-r--r--
2022-12-20 11:09
inc_scecalendarnew.php
7.84
KB
-rw-r--r--
2026-05-09 09:39
jobshadowschools.php
7.26
KB
-rw-r--r--
2025-06-20 06:38
logout.php
593
B
-rw-r--r--
2025-02-25 08:19
marketingevent.php
122.75
KB
-rw-r--r--
2026-08-03 13:40
marketingeventdecline.php
15.21
KB
-rw-r--r--
2022-12-20 11:09
marketingsurvey.php
5.95
KB
-rw-r--r--
2022-12-20 11:09
matrixtemplate.htm
2.13
KB
-rw-r--r--
2022-12-20 11:09
member_portal_becs.php
2.14
KB
-rw-r--r--
2025-09-12 07:50
member_portal_transformation.php
10.45
KB
-rw-r--r--
2026-05-20 10:07
member_portal_transformation_proxy.php
538
B
-rw-r--r--
2026-05-20 09:08
memberauth.php
991
B
-rw-r--r--
2025-02-25 08:19
memberportal.php
11.79
KB
-rw-r--r--
2026-05-20 09:54
membersearch.php
22.72
KB
-rw-r--r--
2025-02-27 08:02
membersearch_smme.php
6.2
KB
-rw-r--r--
2024-11-27 11:41
memberverify.php
5.25
KB
-rw-r--r--
2022-12-20 11:09
mentors.php
21.68
KB
-rw-r--r--
2025-06-20 06:38
migratenode.php
1.26
KB
-rw-r--r--
2022-12-20 11:09
monofont.ttf
40.07
KB
-rw-r--r--
2022-12-20 11:09
nlc.php
855
B
-rw-r--r--
2022-12-20 11:09
nlcreports.php
2.51
KB
-rw-r--r--
2022-12-20 11:09
php_errors.log
1.06
KB
-rw-r--r--
2026-08-20 23:37
practicenotes.php
4.63
KB
-rw-r--r--
2022-12-20 11:09
practicenotes_full.php
1.33
KB
-rw-r--r--
2022-12-20 11:09
practicenotes_help.php
2.17
KB
-rw-r--r--
2022-12-20 11:09
practicenotes_list.php
2.03
KB
-rw-r--r--
2024-07-03 13:52
practicenotes_search.php
9.43
KB
-rw-r--r--
2022-12-20 11:09
querynlcmatrix.php
15
KB
-rw-r--r--
2022-12-20 11:09
querynlcmatrix.php4
15.38
KB
-rw-r--r--
2012-03-05 08:01
register.php
58.18
KB
-rw-r--r--
2026-05-26 14:55
relay.php
20.33
KB
-rw-r--r--
2025-06-20 06:38
relayteams.php
12.53
KB
-rw-r--r--
2022-12-20 11:09
resendcpdform.php
7.28
KB
-rw-r--r--
2025-08-01 10:38
retiredeng.php
13.45
KB
-rw-r--r--
2025-06-20 06:38
retiredeng_members.php
1.81
KB
-rw-r--r--
2022-12-20 11:09
sanitize.php
10
B
-rw-r--r--
2022-12-20 11:09
sce_survey2015.php
25.85
KB
-rw-r--r--
2022-12-20 11:09
sceallevents.php
8.13
KB
-rw-r--r--
2026-01-20 08:45
scecalendar.php
4.86
KB
-rw-r--r--
2025-06-18 11:18
scecalendar_backup.php
3.17
KB
-rw-r--r--
2025-06-18 11:18
scecalendarnew.php
5.98
KB
-rw-r--r--
2025-08-28 11:14
scecalendarnewtest.php
5.7
KB
-rw-r--r--
2022-03-04 12:37
scecalendartest.php
3.57
KB
-rw-r--r--
2022-03-04 12:38
scecategories.php
914
B
-rw-r--r--
2022-12-20 11:09
scecourses.php
7.18
KB
-rw-r--r--
2026-08-19 12:15
scelist.php
7.72
KB
-rw-r--r--
2025-08-29 07:18
scesubscribe.php
2.06
KB
-rw-r--r--
2022-12-20 11:09
sceupdate.php
1.67
KB
-rw-r--r--
2025-06-18 11:18
scevenuehire.php
6.15
KB
-rw-r--r--
2026-01-23 13:12
sendeventreg.php
19.5
KB
-rw-r--r--
2026-08-14 12:05
sendeventreg2.php
2.83
KB
-rw-r--r--
2026-07-17 14:57
sendeventreg_golf.php
20.23
KB
-rw-r--r--
2026-08-14 12:05
sendeventreg_golf.php.bak
11.69
KB
-rw-r--r--
2016-09-07 09:48
sendreg.php
35.15
KB
-rw-r--r--
2026-08-14 12:05
smsunsub.php
1.89
KB
-rw-r--r--
2025-06-18 11:18
template.php
54.36
KB
-rw-r--r--
2022-12-20 11:09
tenders.php
1.34
KB
-rw-r--r--
2022-12-20 11:09
trainerportal.php
50.27
KB
-rw-r--r--
2025-08-01 11:06
trainerportal.php.bak
2.57
KB
-rw-r--r--
2022-12-20 11:09
unempgrad_members.php
2.38
KB
-rw-r--r--
2025-06-18 11:18
unemployed.php
14.13
KB
-rw-r--r--
2025-06-20 06:38
unemployedreg.php
23.38
KB
-rw-r--r--
2025-06-20 06:38
unempreg_members.php
2.36
KB
-rw-r--r--
2025-06-18 11:18
ypfbranchcommittee.php
1.63
KB
-rw-r--r--
2022-12-20 11:09
ypfcommittees.php
1.57
KB
-rw-r--r--
2022-12-20 11:09
ypfjoin.php
30.29
KB
-rw-r--r--
2025-07-07 15:53
ypfjoin2.php
28.13
KB
-rw-r--r--
2025-06-18 11:18
ypfjoinmatches.php
9.46
KB
-rw-r--r--
2025-06-18 11:18
ypfmentees.php
20.81
KB
-rw-r--r--
2026-08-24 11:52
ypfmentees_members.php
2.42
KB
-rw-r--r--
2025-06-18 11:18
Save
Rename
<?php $Notify = "blessings@cesa.co.za,brenda@cesa.co.za"; //$Notify="julia@xe.co.za"; function UniqueFilename($sDir, $sFilename, $sFilenamePrefix = "") { global $conn; $ext = pathinfo($sFilename, PATHINFO_EXTENSION); $fname = pathinfo($sFilename, PATHINFO_FILENAME); $i = 1; $sNewFilename = ""; if (!empty($_SESSION["ProviderID"])) $sNewFilename = $_SESSION["ProviderID"]; 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["ProviderID"]) || empty($_SESSION["ProviderID"])) { $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 TrainingProviders WHERE LOWER(EmailAddress) = '" . addslashes(strtolower($_POST["username"])) . "' AND Password='" . addslashes($_POST["password"]) . "'"; // echo '<!-- ' . $query . '<br /> -->'; $result = mysqli_query($conni, $query); if ($row = mysqli_fetch_array($result)) { $_SESSION["ProviderID"] = $row['ProviderID']; $_SESSION["firstname"] = $row["ContactFirstName"]; $_SESSION["lastname"] = $row["ContactSurname"]; $_SESSION["email"] = $row["EmailAddress"]; echo "<h2>Welcome " . $_SESSION["firstname"] . " " . $_SESSION["lastname"] . "</h2>"; $bShowLoginForm = false; } else { echo "<p><b>ERROR: Invalid username or password</b></p>"; } mysqli_free_result($result); } } if ($bShowLoginForm) { ?> <h1>Training Provider Login</h1> <form method="post" action="/sce/trainingprovider/">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["ProviderID"]) && !empty($_SESSION["ProviderID"])) { ?> <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="/sce/trainingprovider/"><b>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="/sce/trainingprovider/?do=logout"><b>Logout</b></a></td> </tr> </table> <?php if (!isset($_REQUEST["do"])) { ?> <h2 style="background-color:#6DA9D4; padding:5px;">Your Training Provider Details</h2> <?php $sql = "SELECT * FROM TrainingProviders WHERE ProviderID=" . intval($_SESSION["ProviderID"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) { ?> <table border=1 cellspacing=0 cellpadding=2 width="100%"> <tr><td><b>Company Name</b></td><td><b>Contact Person</b></td><td><b>Email Address</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["EmailAddress"]; ?></td> <td valign="top"><?php $sql = "SELECT DISTINCT DocType FROM TrainingProviderDocs WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND DocFile IS NOT NULL AND DocFile<>''"; $rec = mysqli_query($conni, $sql); if (mysqli_num_rows($rec) > 0) { while ($row = mysqli_fetch_assoc($rec)) { echo $row["DocType"] . "<br>"; } } else { echo "No documents uploaded"; } ?></td> <td valign="top"><b><a href="/sce/trainingprovider/?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> <?php } ?> <hr> <h2 style="background-color:#6DA9D4; padding:5px;">Daily Rates</h2> <?php $sql = "SELECT * FROM TrainingProviderRates WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND RatePerDay IS NOT NULL AND RatePerDay>0"; $rec = mysqli_query($conni, $sql); if (mysqli_num_rows($rec) > 0) { ?> <p>We have <b><?php echo mysqli_num_rows($rec); ?></b> of 12 daily rates on record for you.</p> <?php } else { ?> <p><b>We have no daily rates on record for you.</b> Please enter your daily rates using the button below below.</p> <?php } ?> <p><b><a href="/sce/trainingprovider/?do=rates" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;">Enter your daily rates</a></b></p> <hr> <h2 style="background-color:#6DA9D4; padding:5px;">Trainers</h2> <?php $sql = "SELECT * FROM TrainingProviderTrainers WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " ORDER BY Surname, FirstName"; $rec = mysqli_query($conni, $sql); if (mysqli_num_rows($rec) > 0) { ?> <table border=1 cellspacing=0 cellpadding=2> <tr><td><b>Name</b></td><td><b>Email Address</b></td><td> </td></tr> <?php while ($row = mysqli_fetch_assoc($rec)) { ?> <tr><td><?php echo $row["Title"] . " " . $row["FirstName"] . " " . $row["Surname"]; ?></td><td><?php echo $row["Email"]; ?></td><td><a href="/sce/trainingprovider/?do=edittr&id=<?php echo $row["TPTrainerID"]; ?>" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;"><b>Edit Details and Upload Qualifications</b></a></td></tr> <?php } ?> </table> <?php } ?> <p><b><a href="/sce/trainingprovider/?do=addtr" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;">Add a Trainer</a></b></p> <hr> <h2 style="background-color:#6DA9D4; padding:5px;">Your Courses Currently Offered by SCE</h2> <?php $sql = "SELECT * FROM SchoolCourses LEFT JOIN SchoolWebCategories ON (SchoolCourses.WebCategory=SchoolWebCategories.WebCategoryID) WHERE TrainingProviderID=" . intval($_SESSION["ProviderID"]) . " AND CurrentlyOffered=1 ORDER BY CourseName"; // AND CurrentlyOffered=1 $rec = mysqli_query($conni, $sql); if (mysqli_num_rows($rec) > 0) { ?> <table border=1 cellspacing=0 cellpadding=2> <tr><td><b>Name</b></td><td><b>Accred Num/s</b></td><td><b>Category</b></td><td> </td></tr> <?php while ($row = mysqli_fetch_assoc($rec)) { ?> <tr><td><?php echo $row["CourseName"]; ?></td> <td><?php echo $row["AccredNum"]; if (!empty($row["AccredNum2"])) echo "<br>" . $row["AccredNum2"]; if (!empty($row["SACPCMPNum"])) echo "<br>" . $row["SACPCMPNum"]; ?></td> <td><?php echo $row["WebCategoryName"]; ?></td> <td><a href="/sce/trainingprovider/?do=editcrs&id=<?php echo $row["SchoolCourseID"]; ?>" style="background-color:#325eab; color:white; border:1px solid #325eab; border-radius:10px; padding:5px;"><b>Edit Electronic Brochure</b></a></td></tr> <?php } ?> </table> <?php } ?> <?php } elseif ($_REQUEST["do"] == "edit") { // Edit training provider details $sql = "SELECT * FROM TrainingProviders WHERE ProviderID=" . intval($_SESSION["ProviderID"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) extract($row, EXTR_PREFIX_ALL, "Exist"); if (isset($_POST["DBCompanyName"])) { // update details $arrChanged = array(); $sql = "UPDATE TrainingProviders SET "; foreach ($_POST as $name => $val) { if (substr($name, 0, 2) == "DB") { $fieldname = substr($name, 2); $sql .= $fieldname . "='" . addslashes($val) . "', "; $existval = "Exist_" . $fieldname; if ($$existval != $val) { $arrChanged[] = array($fieldname, $$existval, $val); } } } $sql .= "DateUpdated=NOW(), UpdatedBy='" . $_SESSION["email"] . "' WHERE ProviderID=" . intval($_SESSION["ProviderID"]); mysqli_query($conni, $sql); if (count($arrChanged) > 0) { $emailmsg = "<p>The following information has been updated by " . $_SESSION["firstname"] . " " . $_SESSION["lastname"] . " (" . $_SESSION["email"] . "):</p> <table border=1><tr><td><b>Field</b></td><td><b>Original Value</b></td><td><b>New Value</b></td></tr> "; foreach ($arrChanged as $arr) { $emailmsg .= "<tr><td>" . $arr[0] . "</td><td>" . $arr[1] . "</td><td>" . $arr[2] . "</td></tr> "; } $emailmsg .= "</table>"; mail($Notify, "Training Provider Details Changed", $emailmsg, "From: sce@cesa.co.za" . "\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type:text/html;charset=UTF-8" . "\r\n"); } $target_dir = $_SERVER['DOCUMENT_ROOT'] . "/echasl23/providerdocs/"; // var_dump($_FILES); for ($i = 1; $i <= $_POST["NumFiles"]; $i++) { $sDocName = $_POST["FLName" . $i]; for ($z = 1; $z <= 3; $z++) { $sFile = ""; if (isset($_FILES["FLFile" . $i . "_" . $z])) { $target_file = UniqueFilename($target_dir, basename($_FILES["FLFile" . $i . "_" . $z]["name"]), str_replace(" ", "_", $sDocName . $z)); if (move_uploaded_file($_FILES["FLFile" . $i . "_" . $z]["tmp_name"], $target_file)) { $sFile = basename($target_file); if (!empty($_POST["FLID" . $i . "_" . $z])) { $sql = "DELETE FROM TrainingProviderDocs WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND DocType='" . addslashes($sDocName) . "' AND TPDocID=" . $_POST["FLID" . $i . "_" . $z]; mysqli_query($conni, $sql); } $sql = "INSERT INTO TrainingProviderDocs (ProviderID, DocType, DocFile, DateUploaded, UploadedBy) VALUES (" . intval($_SESSION["ProviderID"]) . ", '" . addslashes($sDocName) . "', '" . $sFile . "', NOW(), '" . $_SESSION["email"] . "')"; // echo $sql; mysqli_query($conni, $sql); } } } } ?> <div style="border:5px solid green; padding:10px">Your information has been updated. <a href="/sce/trainingprovider/"><b>Click here to return to the Training Provider Portal main page</b></a></div> <br><hr><br> <?php $sql = "SELECT * FROM TrainingProviders WHERE ProviderID=" . intval($_SESSION["ProviderID"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) extract($row, EXTR_PREFIX_ALL, "Exist"); } ?> <h2 style="background-color:#6DA9D4; padding:5px;">Edit Your Details</h2> <form method="post" action="/sce/trainingprovider/" enctype="multipart/form-data"> <input type="hidden" name="do" value="edit"> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Contact Person</b></td></tr> <tr><td width="30%"><b>Title</b></td> <td><select name="DBContactTitle"> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Title' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>"<?php if ($Exist_ContactTitle == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td></tr> <tr><td><b>Initials</b></td> <td><input type="text" name="DBContactInitials" value="<?php echo $Exist_ContactInitials; ?>" size="40"></td></tr> <tr><td><b>First Name *</b></td> <td><input type="text" name="DBContactFirstName" value="<?php echo $Exist_ContactFirstName; ?>" size="40" required></td></tr> <tr><td><b>Surname *</b></td> <td><input type="text" name="DBContactSurname" value="<?php echo $Exist_ContactSurname; ?>" size="40" required></td></tr> <tr><td><b>Designation</b></td> <td><input type="text" name="DBDesignation" value="<?php echo $Exist_Designation; ?>" size="40"></td></tr> <tr><td><b>ID Number</b></td> <td><input type="text" name="DBIDNumber" value="<?php echo $Exist_IDNumber; ?>" size="40"></td></tr> <tr><td><b>Telephone</b></td> <td><input type="text" name="DBPhoneNumber" value="<?php echo $Exist_PhoneNumber; ?>" size="40"></td></tr> <tr><td><b>Cellphone</b></td> <td><input type="text" name="DBMobileNumber" value="<?php echo $Exist_MobileNumber; ?>" size="40"></td></tr> <tr><td><b>Email Address *</b></td> <td><input type="text" name="DBEmailAddress" value="<?php echo $Exist_EmailAddress; ?>" size="40" required></td></tr> <tr><td><b>Fax Number</b></td> <td><input type="text" name="DBFaxNumber" value="<?php echo $Exist_FaxNumber; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Company Details</b></td></tr> <tr><td><b>Company Name</b></td> <td><input type="text" name="DBCompanyName" value="<?php echo $Exist_CompanyName; ?>" size="40"></td></tr> <tr><td><b>Website</b></td> <td><input type="text" name="DBWebsite" value="<?php echo $Exist_Website; ?>" size="40"></td></tr> <tr><td><b>Company Registration No</b></td> <td><input type="text" name="DBCompanyRegNo" value="<?php echo $Exist_CompanyRegNo; ?>" size="40"></td></tr> <tr><td><b>VAT No</b></td> <td><input type="text" name="DBVATNumber" value="<?php echo $Exist_VATNumber; ?>" size="40"></td></tr> <tr><td><b>BBBEE Level</b></td> <td><select name="DBBBBEELevel"> <option value=""<?php if (empty($Exist_BBBEELevel)) echo " selected"; ?>>Please select</option> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='BBBEE Level' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>"<?php if ($Exist_BBBEELevel == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td></tr> <tr><td><b>CSD No</b></td> <td><input type="text" name="DBCSDNo" value="<?php echo $Exist_CSDNo; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Physical Address</b></td></tr> <tr><td><b>Physical Address Line 1</b></td> <td><input type="text" name="DBPhysicalAddress1" value="<?php echo $Exist_PhysicalAddress1; ?>" size="40"></td></tr> <tr><td><b>Physical Address Line 2</b></td> <td><input type="text" name="DBPhysicalAddress2" value="<?php echo $Exist_PhysicalAddress2; ?>" size="40"></td></tr> <tr><td><b>City</b></td> <td><input type="text" name="DBPhysicalCity" value="<?php echo $Exist_PhysicalCity; ?>" size="40"></td></tr> <tr><td><b>Code</b></td> <td><input type="text" name="DBPhysicalCode" value="<?php echo $Exist_PhysicalCode; ?>" size="40"></td></tr> <tr><td><b>Province</b></td> <td><select name="DBPhysicalProvince"> <option value=""<?php if (empty($Exist_PhysicalProvince)) echo " selected"; ?>>Please select</option> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Province' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>"<?php if ($Exist_PhysicalProvince == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td></tr> <tr><td><b>Country</b></td> <td><input type="text" name="DBPhysicalCountry" value="<?php echo $Exist_PhysicalCountry; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Postal Address</b></td></tr> <tr><td><b>Postal Address Line 1</b></td> <td><input type="text" name="DBPostalAddress1" value="<?php echo $Exist_PostalAddress1; ?>" size="40"></td></tr> <tr><td><b>Postal Address Line 2</b></td> <td><input type="text" name="DBPostalAddress2" value="<?php echo $Exist_PostalAddress2; ?>" size="40"></td></tr> <tr><td><b>City</b></td> <td><input type="text" name="DBPostalCity" value="<?php echo $Exist_PostalCity; ?>" size="40"></td></tr> <tr><td><b>Code</b></td> <td><input type="text" name="DBPostalCode" value="<?php echo $Exist_PostalCode; ?>" size="40"></td></tr> <tr><td><b>Province</b></td> <td><select name="DBPostalProvince"> <option value=""<?php if (empty($Exist_PostalProvince)) echo " selected"; ?>>Please select</option> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Province' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>"<?php if ($Exist_PostalProvince == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td></tr> <tr><td><b>Country</b></td> <td><input type="text" name="DBPostalCountry" value="<?php echo $Exist_PostalCountry; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Reference 1</b></td></tr> <tr><td><b>Reference Company Name</b></td> <td><input type="text" name="DBReference1Company" value="<?php echo $Exist_Reference1Company; ?>" size="40"></td></tr> <tr><td><b>Reference Contact Name</b></td> <td><input type="text" name="DBReference1Contact" value="<?php echo $Exist_Reference1Contact; ?>" size="40"></td></tr> <tr><td><b>Cellphone</b></td> <td><input type="text" name="DBReference1Cell" value="<?php echo $Exist_Reference1Cell; ?>" size="40"></td></tr> <tr><td><b>Email Address</b></td> <td><input type="text" name="DBReference1Email" value="<?php echo $Exist_Reference1Email; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Reference 2</b></td></tr> <tr><td><b>Reference Company Name</b></td> <td><input type="text" name="DBReference2Company" value="<?php echo $Exist_Reference2Company; ?>" size="40"></td></tr> <tr><td><b>Reference Contact Name</b></td> <td><input type="text" name="DBReference2Contact" value="<?php echo $Exist_Reference2Contact; ?>" size="40"></td></tr> <tr><td><b>Cellphone</b></td> <td><input type="text" name="DBReference2Cell" value="<?php echo $Exist_Reference2Cell; ?>" size="40"></td></tr> <tr><td><b>Email Address</b></td> <td><input type="text" name="DBReference2Email" value="<?php echo $Exist_Reference2Email; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Reference 3</b></td></tr> <tr><td><b>Reference Company Name</b></td> <td><input type="text" name="DBReference3Company" value="<?php echo $Exist_Reference3Company; ?>" size="40"></td></tr> <tr><td><b>Reference Contact Name</b></td> <td><input type="text" name="DBReference3Contact" value="<?php echo $Exist_Reference3Contact; ?>" size="40"></td></tr> <tr><td><b>Cellphone</b></td> <td><input type="text" name="DBReference3Cell" value="<?php echo $Exist_Reference3Cell; ?>" size="40"></td></tr> <tr><td><b>Email Address</b></td> <td><input type="text" name="DBReference3Email" value="<?php echo $Exist_Reference3Email; ?>" size="40"></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Expression of Interest</b></td></tr> <tr><td><b>Webinars (1 - 3 hour) *</b></td> <td><input type="radio" name="DBInterestWebinar" value="Y"<?php if ($Exist_InterestWebinar == "Y") echo " checked"; ?> required> Yes<br> <input type="radio" name="DBInterestWebinar" value="N"<?php if ($Exist_InterestWebinar == "N") echo " checked"; ?> required> No</td></tr> <tr><td><b>Virtual classroom courses (1 - 3 day) *</b></td> <td><input type="radio" name="DBInterestClassroom" value="Y"<?php if ($Exist_InterestClassroom == "Y") echo " checked"; ?> required> Yes<br> <input type="radio" name="DBInterestClassroom" value="N"<?php if ($Exist_InterestClassroom == "N") echo " checked"; ?> required> No</td></tr> <tr><td><b>Video (Pre-recorded - Available 24/7 on CPD on Demand™ Service) *</b></td> <td><input type="radio" name="DBInterestVideo" value="Y"<?php if ($Exist_InterestVideo == "Y") echo " checked"; ?> required> Yes<br> <input type="radio" name="DBInterestVideo" value="N"<?php if ($Exist_InterestVideo == "N") echo " checked"; ?> required> No</td></tr> <tr><td><b>Publications – (Journals, Technical Papers, Journal Papers, Educational Industry Related Articles, Conference Papers and Case Studies) *</b></td> <td><input type="radio" name="DBInterestPublications" value="Y"<?php if ($Exist_InterestPublications == "Y") echo " checked"; ?> required> Yes<br> <input type="radio" name="DBInterestPublications" value="N"<?php if ($Exist_InterestPublications == "N") echo " checked"; ?> required> No</td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Upload Documents</b></td></tr> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Training Provider Documents' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); $i = 0; while ($row = mysqli_fetch_assoc($rec)) { $i++; ?> <tr><td valign="top"><b><?php echo $row["PicklistValue"]; ?><input type="hidden" name="FLName<?php echo $i; ?>" value="<?php echo $row["PicklistValue"]; ?>"></b></td> <td valign="top"><?php $sql = "SELECT * FROM TrainingProviderDocs WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND DocType='" . $row["PicklistValue"] . "' AND DocFile IS NOT NULL AND DocFile<>'' ORDER BY DocFile"; $recF = mysqli_query($conni, $sql); $z = 0; while ($rowF = mysqli_fetch_assoc($recF)) { $z++; echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($rowF["DocFile"]) . "' target='_blank'>" . $rowF["DocFile"] . "</a><br>"; echo "<input type='hidden' name='FLID" . $i . "_" . $z . "' value='" . $rowF["TPDocID"] . "'>"; } $NumUploads = 1; if ($row["PicklistValue"] == "CPD Validation Certificates") $NumUploads = 3; for ($z = 1; $z <= $NumUploads; $z++) { if ($z > 1) echo "<br>"; ?> <input type="file" name="FLFile<?php echo $i; ?>_<?php echo $z; ?>"> <?php } ?> </td> </tr> <?php } ?> <tr><td colspan="2" align="center"><input type="submit" value="Save Changes"></td></tr> </table> <input type="hidden" name="NumFiles" value="<?php echo $i; ?>"> </form> <?php } elseif ($_REQUEST["do"] == "rates") { if (isset($_POST["do"])) { // update details $sql = "SELECT TrainingProviderRates.*, TrainingSuggestRates.SuggestRate FROM TrainingProviderRates JOIN TrainingSuggestRates ON (TrainingProviderRates.RateDesc=TrainingSuggestRates.RateDesc) WHERE ProviderID=" . intval($_SESSION["ProviderID"]); $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { $sRate = "NULL"; if (!empty($_POST["Rate" . $row["TPRateID"]])) $sRate = floatval($_POST["Rate" . $row["TPRateID"]]); $sql = "UPDATE TrainingProviderRates SET RatePerDay=" . $sRate . " WHERE TPRateID=" . $row["TPRateID"]; mysqli_query($conni, $sql); } ?> <div style="border:5px solid green; padding:10px">Your information has been updated. <a href="/sce/trainingprovider/"><b>Click here to return to the Training Provider Portal main page</b></a></div> <br><hr><br> <?php extract($_POST, EXTR_PREFIX_ALL, "Exist"); } ?> <h2 style="background-color:#6DA9D4; padding:5px;">Update Daily Rates</h2> <form method="post" action="/sce/trainingprovider/"> <input type="hidden" name="do" value="rates"> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr><td><b>Description</b></td><td><b>Suggested Daily Rate (EXCL VAT)</b></td><td><b>Enter Your Daily Rate (EXCL VAT)</b></td></tr> <?php $sql = "SELECT TrainingProviderRates.*, TrainingSuggestRates.SuggestRate FROM TrainingProviderRates JOIN TrainingSuggestRates ON (TrainingProviderRates.RateDesc=TrainingSuggestRates.RateDesc) WHERE ProviderID=" . intval($_SESSION["ProviderID"]); $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <tr><td width="20%"><b><?php echo $row["RateDesc"]; ?></b></td> <td width="20%"><b>R <?php echo number_format($row["SuggestRate"], 2, ".", " "); ?></b></td> <td>R <input type="text" name="Rate<?php echo $row["TPRateID"]; ?>" placeholder="Numbers only" value="<?php echo $row["RatePerDay"]; ?>" required></td> </tr> <?php } ?> <tr><td colspan="2" align="center"><input type="submit" value="Save Changes"></td></tr> </table> </form> <?php } elseif (($_REQUEST["do"] == "addtr") || ($_REQUEST["do"] == "edittr")) { // Add or edit trainer details if ($_REQUEST["do"] == "edittr") { $TPTrainerID = intval($_REQUEST["id"]); $sql = "SELECT * FROM TrainingProviderTrainers WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND TPTrainerID=" . intval($_REQUEST["id"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) extract($row, EXTR_PREFIX_ALL, "Exist"); } if (isset($_POST["DBFirstName"])) { if ($_REQUEST["do"] == "edittr") { // update details $arrChanged = array(); $sql = "UPDATE TrainingProviderTrainers SET "; foreach ($_POST as $name => $val) { if (substr($name, 0, 2) == "DB") { $fieldname = substr($name, 2); $fieldval = is_array($val) ? implode(",", $val) : $val; $sql .= $fieldname . "='" . addslashes($fieldval) . "', "; $existval = "Exist_" . $fieldname; if ($$existval != $fieldval) { $arrChanged[] = array($fieldname, $$existval, $fieldval); } } } $sql .= "DateUpdated=NOW(), UpdatedBy='" . $_SESSION["email"] . "' WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND TPTrainerID=" . intval($_REQUEST["id"]); mysqli_query($conni, $sql); if (count($arrChanged) > 0) { $emailmsg = "<p>The following information has been updated by " . $_SESSION["firstname"] . " " . $_SESSION["lastname"] . " (" . $_SESSION["email"] . "):</p> <p><b>Trainer: " . $_POST["DBFirstName"] . " " . $_POST["DBSurname"] . "</b></p> <table border=1><tr><td><b>Field</b></td><td><b>Original Value</b></td><td><b>New Value</b></td></tr> "; foreach ($arrChanged as $arr) { $emailmsg .= "<tr><td>" . $arr[0] . "</td><td>" . $arr[1] . "</td><td>" . $arr[2] . "</td></tr> "; } $emailmsg .= "</table>"; mail($Notify, "Training Provider Trainer Changed", $emailmsg, "From: sce@cesa.co.za" . "\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type:text/html;charset=UTF-8" . "\r\n"); } $TPTrainerID = intval($_REQUEST["id"]); } else { // add details $sql = "INSERT INTO TrainingProviderTrainers ("; foreach ($_POST as $name => $val) { if (substr($name, 0, 2) == "DB") { $fieldname = substr($name, 2); $sql .= $fieldname . ", "; } } $sql .= "ProviderID, DateUpdated, UpdatedBy) VALUES ("; foreach ($_POST as $name => $val) { if (substr($name, 0, 2) == "DB") { $sql .= "'" . addslashes($val) . "', "; } } $sql .= intval($_SESSION["ProviderID"]) . ", NOW(), '" . $_SESSION["email"] . "')"; mysqli_query($conni, $sql); $TPTrainerID = mysqli_insert_id($conni); } $target_dir = $_SERVER['DOCUMENT_ROOT'] . "/echasl23/providerdocs/"; // var_dump($_FILES); $arrFiles = array("FLPhoto", "FLCVFile", "FLQualificationFile1", "FLQualificationFile2", "FLQualificationFile3"); foreach ($arrFiles as $val) { $sFile = ""; $sDocName = str_replace("FL", "", $val); if (isset($_FILES[$val])) { $target_file = UniqueFilename($target_dir, basename($_FILES[$val]["name"]), str_replace(" ", "_", $TPTrainerID . $sDocName)); if (move_uploaded_file($_FILES[$val]["tmp_name"], $target_file)) { $sFile = basename($target_file); $sql = "UPDATE TrainingProviderTrainers SET " . $sDocName . "='" . $sFile . "' WHERE TPTrainerID=" . $TPTrainerID; mysqli_query($conni, $sql); } } } $sql = "SELECT * FROM TrainingProviderTrainers WHERE ProviderID=" . intval($_SESSION["ProviderID"]) . " AND TPTrainerID=" . $TPTrainerID; $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) extract($row, EXTR_PREFIX_ALL, "Exist"); ?> <div style="border:5px solid green; padding:10px">Your information has been updated. <a href="/sce/trainingprovider/"><b>Click here to return to the Training Provider Portal main page</b></a></div> <br><hr><br> <?php } ?> <h2 style="background-color:#6DA9D4; padding:5px;"><?php echo ($_REQUEST["do"] == "edittr" ? "Edit" : "Add"); ?> The Trainer's Details</h2> <form method="post" action="/sce/trainingprovider/" enctype="multipart/form-data"> <input type="hidden" name="do" value="<?php if (isset($TPTrainerID)) { echo "edittr"; } else { echo "addtr"; } ?>"> <input type="hidden" name="id" value="<?php echo $TPTrainerID; ?>"> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr><td width="30%"><b>Title</b></td> <td><select name="DBTitle"> <?php $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Title' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>"<?php if ($Exist_Title == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td></tr> <tr><td><b>First Name *</b></td> <td><input type="text" name="DBFirstName" value="<?php echo $Exist_FirstName; ?>" size="40" required></td></tr> <tr><td><b>Surname *</b></td> <td><input type="text" name="DBSurname" value="<?php echo $Exist_Surname; ?>" size="40" required></td></tr> <tr><td><b>Cellphone</b></td> <td><input type="text" name="DBCellNo" value="<?php echo $Exist_CellNo; ?>" size="40"></td></tr> <tr><td><b>Email Address *</b></td> <td><input type="text" name="DBEmail" value="<?php echo $Exist_Email; ?>" size="40" required></td></tr> <tr><td><b>Post Nominal<br>(Letters after the name, e.g. registrations or qualifications)</b></td> <td><input type="text" name="DBPostNominal" value="<?php echo $Exist_PostNominal; ?>" size="40"></td></tr> <tr><td><b>Preferred Remote Video Software *</b></td> <td><input type="radio" name="DBPreferredRemote" value="Zoom"<?php if ($Exist_PreferredRemote == "Zoom") echo " checked"; ?>> Zoom<br> <input type="radio" name="DBPreferredRemote" value="MS Teams"<?php if ($Exist_PreferredRemote == "MS Teams") echo " checked"; ?>> MS Teams</td></tr> <tr><td><b>Which Software does the Trainer own? *</b></td> <td><input type="checkbox" name="DBOwnRemote[]" value="Zoom"<?php if (strpos($Exist_OwnRemote, "Zoom") !== false) echo " checked"; ?>> Zoom<br> <input type="checkbox" name="DBOwnRemote[]" value="MS Teams"<?php if (strpos($Exist_OwnRemote, "MS Teams") !== false) echo " checked"; ?>> MS Teams</td></tr> <tr><td><b>Brief Biography *<br>(Single paragraph)</b></td> <td><textarea name="DBBiography" rows="4" cols="40" required><?php echo $Exist_Biography; ?></textarea></td></tr> <tr><td><b>Qualification/s *</b></td> <td><textarea name="DBQualifications" rows="4" cols="40" required><?php echo $Exist_Qualifications; ?></textarea></td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Upload</b></td></tr> <tr><td><b>Photograph</b></td><td> <?php if (!empty($Exist_Photo)) echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($Exist_Photo) . "' target='_blank'>" . $Exist_Photo . "</a><br>"; ?> <input type="file" name="FLPhoto"></td></tr> <tr><td><b>CV</b></td><td> <?php if (!empty($Exist_CVFile)) echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($Exist_CVFile) . "' target='_blank'>" . $Exist_CVFile . "</a><br>"; ?> <input type="file" name="FLCVFile"></td></tr> <tr><td><b>Qualification/s</b></td><td> <?php if (!empty($Exist_QualificationFile1)) echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($Exist_QualificationFile1) . "' target='_blank'>" . $Exist_QualificationFile1 . "</a><br>"; ?> <input type="file" name="FLQualificationFile1"><br> <?php if (!empty($Exist_QualificationFile2)) echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($Exist_QualificationFile2) . "' target='_blank'>" . $Exist_QualificationFile2 . "</a><br>"; ?> <input type="file" name="FLQualificationFile2"><br> <?php if (!empty($Exist_QualificationFile3)) echo "Existing file: <a href='/php/downloadfile.php?filename=" . urlencode($Exist_QualificationFile3) . "' target='_blank'>" . $Exist_QualificationFile3 . "</a><br>"; ?> <input type="file" name="FLQualificationFile3"> </td></tr> <tr><td colspan="2" align="center"><input type="submit" value="Save Changes"></td></tr> </table> </form> <?php } elseif ($_REQUEST["do"] == "editcrs") { ?> <h2 style="background-color:#6DA9D4; padding:5px;">Edit Electronic Brochure</h2> <?php if (isset($_POST["SchoolCourseID"])) { $errs = array(); if (empty($_POST["DBTempDescOverview"])) $errs[] = "Please provide the overview"; if (!is_array($_POST["TempDescWhoAttend"]) || (count($_POST["TempDescWhoAttend"]) == 0)) $errs[] = "Please select from the list of who should attend"; if (count($errs) > 0) { ?> <div style="border:5px solid green; padding:10px">Your information has NOT been updated. Please correct the errors below: <ul><li><?php echo implode("</li><li>", $errs); ?></li></ul> </div> <br><hr><br> <?php } else { // update details $sql = "SELECT * FROM SchoolCourses WHERE SchoolCourseID=" . intval($_POST["SchoolCourseID"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) extract($row, EXTR_PREFIX_ALL, "Exist"); $arrChanged = array(); $sql = "UPDATE SchoolCourses SET "; foreach ($_POST as $name => $val) { if (substr($name, 0, 2) == "DB") { $fieldname = substr($name, 2); $sql .= $fieldname . "='" . addslashes($val) . "', "; $existval = "Exist_" . str_replace("Temp", "", $fieldname); if ($$existval != $val) { $arrChanged[] = array($fieldname, $$existval, $val); } } } $sql .= "TempDescWhoAttend='<ul><li>" . implode("</li><li>", $_POST["TempDescWhoAttend"]) . "</li></ul>', AcceptTemp='P' WHERE SchoolCourseID=" . intval($_POST["SchoolCourseID"]); // echo $sql; mysqli_query($conni, $sql); if (count($arrChanged) > 0) { $emailmsg = "<p>The following information has been updated by " . $_SESSION["firstname"] . " " . $_SESSION["lastname"] . " (" . $_SESSION["email"] . "):</p> <p><b>" . $Exist_CourseName . "</b></p> <table border=1><tr><td><b>Field</b></td><td><b>Original Value</b></td><td><b>New Value</b></td></tr> "; foreach ($arrChanged as $arr) { $emailmsg .= "<tr><td>" . $arr[0] . "</td><td>" . $arr[1] . "</td><td>" . $arr[2] . "</td></tr> "; } $editlink = "https://www.cesa.co.za/echasl23/SchoolCoursesedit.php?SchoolCourseID=" . intval($_POST["SchoolCourseID"]); $emailmsg .= "</table> <p>Please use the link below and approve, edit or reject the changes on the 'Updated by Training Provider' tab. You will need to be logged in to the school database.</p> <p><a href='" . $editlink . "'>" . $editlink . "</a></p>"; mail($Notify, "Course Information Changed", $emailmsg, "From: sce@cesa.co.za" . "\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type:text/html;charset=UTF-8" . "\r\n"); } ?> <div style="border:5px solid green; padding:10px">Your information has been updated. Please note that the changes will be checked by the SCE before being visible live on our website. <a href="/sce/trainingprovider/"><b>Click here to return to the Training Provider Portal main page</b></a></div> <br><hr><br> <?php } } $sql = "SELECT * FROM SchoolCourses WHERE TrainingProviderID=" . intval($_SESSION["ProviderID"]) . " AND SchoolCourseID=" . intval($_REQUEST["id"]); $rec = mysqli_query($conni, $sql); if ($row = mysqli_fetch_assoc($rec)) { ?> <script type="text/javascript" src="/echasl23/ckeditor/ckeditor.js"></script> <form method="post" action="/sce/trainingprovider/"> <input type="hidden" name="do" value="editcrs"> <input type="hidden" name="id" value="<?php echo $_REQUEST["id"]; ?>"> <input type="hidden" name="SchoolCourseID" value="<?php echo $_REQUEST["id"]; ?>"> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr><td colspan="2"><b><?php echo $row["CourseName"]; ?></b></td></tr> <tr><td valign="top"><b>Overview</b></td><td><textarea name="DBTempDescOverview" id="DBTempDescOverview"><?php echo strip_tags(empty($row["TempDescOverview"]) ? $row["DescOverview"] : $row["TempDescOverview"], "<p><br><br/><ul><ol><li><b><i><strong><em><u><table><tr><td><th>"); ?></textarea> </td></tr> <tr><td valign="top"><b>Why Should an Individual Attend?</b></td><td><textarea name="DBTempDescWhyAttend" id="DBTempDescWhyAttend"><?php echo strip_tags(empty($row["TempDescWhyAttend"]) ? $row["DescWhyAttend"] : $row["TempDescWhyAttend"], "<p><br><br/><ul><ol><li><b><i><strong><em><u><table><tr><td><th>"); ?></textarea></td></tr> <tr><td valign="top"><b>Outcomes</b></td><td><textarea name="DBTempDescOutcomes" id="DBTempDescOutcomes"><?php echo strip_tags(empty($row["TempDescOutcomes"]) ? $row["DescOutcomes"] : $row["TempDescOutcomes"], "<p><br><br/><ul><ol><li><b><i><strong><em><u><table><tr><td><th>"); ?></textarea></td></tr> <tr><td valign="top"><b>Program Outline</b></td><td><textarea name="DBTempDescProgram" id="DBTempDescProgram"><?php echo strip_tags(empty($row["TempDescProgram"]) ? $row["DescProgram"] : $row["TempDescProgram"], "<p><br><br/><ul><ol><li><b><i><strong><em><u><table><tr><td><th>"); ?></textarea></td></tr> <tr><td valign="top"><b>Who Should Attend?</b></td><td><b>Current Value:</b><br><div style="border:1px"><?php echo strip_tags(empty($row["TempDescWhoAttend"]) ? $row["DescWhoAttend"] : $row["TempDescWhoAttend"], "<p><br><br/><ul><ol><li><b><i><strong><em><u><table><tr><td><th>"); ?></div> <hr><b>Update To:</b> (select all that apply)<br> <?php $arrWhoAttend = array("Engineers", "Technicians", "Technologists", "Architects", "Project / Construction Managers", "Quantity Surveyors", "Construction Health & Safety", "Contractors / Sub Contractors", "Executives / Senior Management", "Middle Management", "Administrators / Support Staff", "Other"); foreach ($arrWhoAttend as $val) { ?> <input type="checkbox" name="TempDescWhoAttend[]" value="<?php echo $val; ?>"<?php if ((!empty($row["TempDescWhoAttend"]) && (strpos($row["TempDescWhoAttend"], $val) !== false)) || (empty($row["TempDescWhoAttend"]) && (strpos($row["DescWhoAttend"], $val) !== false))) echo " checked"; ?>> <?php echo $val; ?><br> <?php } ?> </td></tr> <tr><td colspan="2" align="center"><input type="submit" value="Save Changes"></td></tr> </table> <script type="text/javascript"> CKEDITOR.replace('DBTempDescOverview', { toolbar: [ ['Bold', 'Italic', 'Underline', 'BulletedList', 'PasteText', 'PasteFromWord'] ] }); CKEDITOR.replace('DBTempDescWhyAttend', { toolbar: [ ['Bold', 'Italic', 'Underline', 'BulletedList', 'PasteText', 'PasteFromWord'] ] }); CKEDITOR.replace('DBTempDescOutcomes', { toolbar: [ ['Bold', 'Italic', 'Underline', 'BulletedList', 'PasteText', 'PasteFromWord'] ] }); CKEDITOR.replace('DBTempDescProgram', { toolbar: [ ['Bold', 'Italic', 'Underline', 'BulletedList', 'PasteText', 'PasteFromWord'] ] }); </script> </form> <?php } } elseif ($_REQUEST["do"] == "logout") { $_SESSION['ProviderID'] = ""; unset($_SESSION["ProviderID"]); unset($_SESSION["firstname"]); unset($_SESSION["lastname"]); unset($_SESSION["email"]); ?> <p>You have been logged out.</p> <?php } } ?>