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 //ini_set('display_errors', 1); //error_reporting(E_ALL); include_once("inc_db.php"); // include_once($_SERVER['DOCUMENT_ROOT'] . "/phpmailer/PHPMailer.php"); // include_once($_SERVER['DOCUMENT_ROOT'] . "/phpmailer/SMTP.php"); // include_once($_SERVER['DOCUMENT_ROOT'] . "/phpmailer/Exception.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/cesanet/inc_shared.php"); // include_once($_SERVER['DOCUMENT_ROOT'] . "/php/includes/maill.php"); // use PHPMailer\PHPMailer\PHPMailer; $Notify = "blessings@cesa.co.za,brenda@cesa.co.za,cpdverification@cesa.co.za,athromethm@cesa.co.za"; //$Notify="julia@xe.co.za"; 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 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 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; } 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; } //function XMail($to, $subject, $msg, $from, $CC, $type) { // // $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; // // if (!$mail->Send()) // echo $mail->ErrorInfo; //} $sessid = session_id(); if (empty($sessid)) { session_start(); $sessid = session_id(); } $_COOKIE["PHPSESSID"] = $sessid; ?> <link rel="stylesheet" href="/js/jQuery-File-Upload-10.32.0/css/jquery.fileupload.css" /> <link rel="stylesheet" href="/js/jQuery-File-Upload-10.32.0/css/jquery.fileupload-ui.css" /> <!-- CSS adjustments for browsers with JavaScript disabled --> <noscript> <link rel="stylesheet" href="/js/jQuery-File-Upload-10.32.0/css/jquery.fileupload-noscript.css" /> </noscript> <noscript> <link rel="stylesheet" href="/js/jQuery-File-Upload-10.32.0/css/jquery.fileupload-ui-noscript.css" /> </noscript> <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included --> <script src="/js/jQuery-File-Upload-10.32.0/js/vendor/jquery.ui.widget.js"></script> <!-- The Templates plugin is included to render the upload/download listings --> <!-- <script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script> --> <!-- The Iframe Transport is required for browsers without support for XHR file uploads --> <script src="/js/jQuery-File-Upload-10.32.0/js/jquery.iframe-transport.js"></script> <!-- The basic File Upload plugin --> <script src="/js/jQuery-File-Upload-10.32.0/js/jquery.fileupload.js"></script> <script src="https://www.google.com/recaptcha/api.js" async defer></script> <h2 style="background-color:#6DA9D4; padding:5px;">Apply to be a CESA / ECSA Verified CPD Service / Training Provider</h2> <?php $bDisplayForm = true; $sUploadDir = $_SERVER['DOCUMENT_ROOT'] . "/js/jQuery-File-Upload-10.32.0/server/php/files/"; if (isset($_POST["do"])) { $arrRequired = array("DBCompanyName", "DBContactEmail"); $bAllRequired = true; $bAllFiles = true; foreach ($arrRequired as $sField) { if (empty(filter_input(INPUT_POST, $sField, FILTER_SANITIZE_STRING))) { $bAllRequired = false; break; } } if ($bAllRequired) { $sql = "SELECT DisplayOrder, PicklistValue, PicklistLabel FROM Picklists WHERE PicklistType='CPD Provider Documents' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); $i = 0; while ($row = mysqli_fetch_assoc($rec)) { if ($row["PicklistLabel"] == 'Proof of Payment') { continue; } $i++; if (($row["DisplayOrder"] != 40) && ($row["DisplayOrder"] != 70)) { // BBBEE and PoP not required $sFilename = $_REQUEST["FLFile" . $i]; $sFiletype = filter_input(INPUT_POST, "FLName" . $i, FILTER_SANITIZE_STRING); if (empty($sFilename) || !file_exists($sUploadDir . $sFilename)) { echo $i . ' - Not found ' . $sUploadDir . $sFilename . ' - ' . file_exists($sUploadDir . $sFilename) . '<br />'; // var_dump($row); // echo '<br />'; $bAllFiles = false; break; } } } } if (!reCaptcha($_POST["g-recaptcha-response"])) { //TODO: Fix the google captcha verification ?> <div class="alert alert-danger">Error: You could not be verified as not being a robot, please tick the reCaptcha verification option at the bottom of the form.</div> <?php } elseif (!$bAllRequired) { ?> <div class="alert alert-danger">Error: please provide all the required fields.</div> <?php } elseif (!$bAllFiles) { ?> <div class="alert alert-danger">Error: Please upload the required files.</div> <?php } else { try { $sPassword = GenPassword(); if (isset($_FILES['PrevSPNumberCertificate'])) { $uploadfilenamePrevCert = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['PrevSPNumberCertificate']['name'])))); $uploadfilePrevCert = $uploaddir . $uploadfilenamePrevCert; move_uploaded_file($_FILES['ActivityProgramme']['tmp_name'], $uploadfilePrevCert); $uploadfilePrevCert = $uploadfilenamePrevCert; } if (isset($_FILES['OtherVACPDSPNumberCertificate'])) { $uploadfilenameOtherPrevCert = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['OtherVACPDSPNumberCertificate']['name'])))); $uploadfileOtherPrevCert = $uploaddir . $uploadfilenameOtherPrevCert; move_uploaded_file($_FILES['OtherVACPDSPNumberCertificate']['tmp_name'], $uploadfileOtherPrevCert); $uploadfileOtherPrevCert = $uploadfilenameOtherPrevCert; } if (isset($_FILES['AccountabilityStructure'])) { $uploadfilenameAccountabilityStructure = strtolower(str_replace(array("'", "\"", "(", ")", "#", " "), "_", basename(stripslashes($_FILES['AccountabilityStructure']['name'])))); $uploadfileAccountabilityStructure = $uploaddir . $uploadfilenameAccountabilityStructure; move_uploaded_file($_FILES['AccountabilityStructure']['tmp_name'], $uploadfileAccountabilityStructure); $uploadfileAccountabilityStructure = $uploadfilenameAccountabilityStructure; } $sql = "insert into `CPDServiceProvider` ( `CompanyName`, `TradingAs`, `ContactTitle`, `ContactInitials`, `ContactFirstName`, `ContactSurname`, `ContactPosition`, `ContactIDNum`, `PhoneNumber`, `ContactEmail`, `Password`, `PhysicalAddress1`, `PhysicalAddress2`, `PhysicalCity`, `PhysicalCode`, `PhysicalProvince`, `PhysicalCountry`, `Website`, `VATNumber`, `DateUpdated`, `UpdatedBy`, `Archived`, `ContactPhone`, `AdminTitle`, `AdminInitials`, `AdminFirstName`, `AdminSurname`, `AdminPosition`, `AdminIDNum`, `AdminEmail`, `AdminPhone`, `Approved`, `EmailAddress`, CellNumber, ContactCell, AdminCell, SPNumber, PrevSPNumber, PrevSPNumberCertificate, OtherVACPDSPNumber, OtherVACPDSPNumberCertificate, Renewal, DateCreated, AccountabilityStructure) values ( '" . filter_input(INPUT_POST, "DBCompanyName", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBTradingAs", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactTitle", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactInitials", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactFirstName", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactSurname", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactPosition", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBContactIDNum", FILTER_SANITIZE_STRING) . "', '" . CombinePhonePost("DBPhoneNumber") . "', '" . filter_input(INPUT_POST, "DBContactEmail", FILTER_SANITIZE_STRING) . "', '" . $sPassword . "', '" . filter_input(INPUT_POST, "DBPhysicalAddress1", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBPhysicalAddress2", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBPhysicalCity", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBPhysicalCode", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBPhysicalProvince", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBPhysicalCountry", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBWebsite", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBVATNumber", FILTER_SANITIZE_STRING) . "', NOW(), '" . filter_input(INPUT_POST, "DBContactEmail", FILTER_SANITIZE_STRING) . "', 0, '" . CombinePhonePost("DBContactPhone") . "', '" . filter_input(INPUT_POST, "DBAdminTitle", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminInitials", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminFirstName", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminSurname", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminPosition", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminIDNum", FILTER_SANITIZE_STRING) . "', '" . filter_input(INPUT_POST, "DBAdminEmail", FILTER_SANITIZE_STRING) . "', '" . CombinePhonePost("DBAdminPhone") . "', 'P', '" . filter_input(INPUT_POST, "DBEmailAddress", FILTER_SANITIZE_STRING) . "', '" . CombinePhonePost("DBCellNumber") . "', '" . CombinePhonePost("DBContactCell") . "', '" . CombinePhonePost("DBAdminCell") . "', 'Pending Verification', '" . filter_input(INPUT_POST, "DBPrevSPNumber", FILTER_SANITIZE_STRING) . "', '" . $uploadfilePrevCert . "', '" . filter_input(INPUT_POST, "OtherVACPDSPNumber", FILTER_SANITIZE_STRING) . "', '" . $uploadfileOtherPrevCert . "', '" . filter_input(INPUT_POST, "DBRenewal", FILTER_SANITIZE_STRING) . "', " . "NOW(), '" . $uploadfileAccountabilityStructure . "')"; mysqli_query($conni, $sql); $iSPID = mysqli_insert_id($conni); $sForm = ' <table border="1" cellpadding="5" cellspacing="0"> <tr><td colspan=2><p style="font-weight: bold">SERVICE PROVIDER APPLYING FOR APPROVAL IN TERMS OF ECSA CPD POLICY</p> </td> </tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Organisation Details</b></td></tr> <tr><td><b>Company Name *</b></td> <td>' . $_POST["DBCompanyName"] . '</td></tr> <tr><td><b>Known As / Trading As</b></td> <td>' . $_POST["DBTradingAs"] . '</td></tr> <tr><td><b>Renewal *</b></td> <td>' . $_POST["DBRenewal"] . '</td></tr> <tr><td><b>Previous CESA CPD Verification Service Provider Number</b></td> <td>' . $_POST['PrevSPNumber'] . '</td></tr> <tr><td><b>Other Volunteer Association CPD Verified Service Provider Certificate</b></td> <td>' . $_POST["PrevSPNumberCertificate"] . '</td></tr> <tr><td><b>Previous CESA CPD Verification Service Provider Certificate</b></td> <td>' . $uploadfilePrevCert . '</td></tr> <tr><td><b>Other Volunteer Association CPD Verified Service Provider Number</b></td> <td>' . $_POST["OtherVACPDSPNumber"] . '</td></tr> <tr><td><b>Other Volunteer Association CPD Verified Service Provider Certificate</b></td> <td>' . $uploadfileOtherPrevCert . '</td></tr> <tr><td><b>Phone Number</b></td> <td>' . CombinePhonePost("DBPhoneNumber") . '</td></tr> <tr><td><b>Cell Number *</b></td> <td>' . CombinePhonePost("DBCellNumber") . '</td></tr> <tr><td><b>Website</b></td> <td>' . $_POST["DBWebsite"] . '</td></tr> <tr><td><b>Email Address *</b></td> <td>' . $_POST["DBEmailAddress"] . '</td></tr> <tr><td><b>VAT No</b></td> <td>' . $_POST["DBVATNumber"] . '</td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Physical Address</b></td></tr> <tr><td><b>Physical Address Line 1</b></td> <td>' . $_POST["DBPhysicalAddress1"] . '</td></tr> <tr><td><b>Physical Address Line 2</b></td> <td>' . $_POST["DBPhysicalAddress2"] . '</td></tr> <tr><td><b>City *</b></td> <td>' . $_POST["DBPhysicalCity"] . '</td></tr> <tr><td><b>Code *</b></td> <td>' . $_POST["DBPhysicalCode"] . '</td></tr> <tr><td><b>Province *</b></td> <td>' . $_POST["DBPhysicalProvince"] . '</td></tr> <tr><td><b>Country *</b></td> <td>' . $_POST["DBPhysicalCountry"] . '</td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Person who is applying for verification on behalf of the organisation</b></td></tr> <tr><td width="30%"><b>Title *</b></td> <td>' . $_POST["DBContactTitle"] . '</td></tr> <tr><td><b>Initials</b></td> <td>' . $_POST["DBContactInitials"] . '</td></tr> <tr><td><b>First Name (Known As) *</b></td> <td>' . $_POST["DBContactFirstName"] . '</td></tr> <tr><td><b>Surname *</b></td> <td>' . $_POST["DBContactSurname"] . '</td></tr> <tr><td><b>Position Held</b></td> <td>' . $_POST["DBContactPosition"] . '</td></tr> <tr><td><b>ID / Passport Number</b></td> <td>' . $_POST["DBContactIDNum"] . '</td></tr> <tr><td><b>Phone Number</b></td> <td>' . $_POST["DBContactPhone"] . '</td></tr> <tr><td><b>Cell Number *</b></td> <td>' . CombinePhonePost("DBContactCell") . '</td></tr> <tr><td><b>Email Address *</b></td> <td>' . $_POST["DBContactEmail"] . '</td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Person who is acting as the administrator on behalf of the organisation</b></td></tr> <tr><td width="30%"><b>Title</b></td> <td>' . $_POST["DBAdminTitle"] . '</td></tr> <tr><td><b>Initials</b></td> <td>' . $_POST["DBAdminInitials"] . '</td></tr> <tr><td><b>First Name (Known As) *</b></td> <td>' . $_POST["DBAdminFirstName"] . '</td></tr> <tr><td><b>Surname *</b></td> <td>' . $_POST["DBAdminSurname"] . '</td></tr> <tr><td><b>Position Held</b></td> <td>' . $_POST["DBAdminPosition"] . '</td></tr> <tr><td><b>ID / Passport Number</b></td> <td>' . $_POST["DBAdminIDNum"] . '</td></tr> <tr><td><b>Phone Number</b></td> <td>' . CombinePhonePost("DBAdminPhone") . '</td></tr> <tr><td><b>Cell Number *</b></td> <td>' . CombinePhonePost("DBAdminCell") . '</td></tr> <tr><td><b>Email Address *</b></td> <td>' . $_POST["DBAdminEmail"] . '</td></tr> <tr><td colspan="2" bgcolor="#CCCCCC"><b> Upload Documents</b></td></tr> '; for ($i = 1; $i <= intval($_POST["NumFiles"]); $i++) { $target_dir = $_SERVER['DOCUMENT_ROOT'] . "/cpdadmin/providerdocs/"; $sFilename = filter_input(INPUT_POST, "FLFile" . $i, FILTER_SANITIZE_STRING); $sFiletype = filter_input(INPUT_POST, "FLName" . $i, FILTER_SANITIZE_STRING); if (!empty($sFilename) && file_exists($sUploadDir . $sFilename)) { $sNewFilename = $iSPID . $sFilename; $iPrefix = 1; while (file_exists($target_dir . $sNewFilename)) { $sNewFilename = $iPrefix . $sNewFilename; $iPrefix++; } copy($sUploadDir . $sFilename, $target_dir . $sNewFilename); unlink($sUploadDir . $sFilename); $sql = "INSERT INTO CPDProviderDocs (CPDProviderID, DocType, DocFile, UploadedBy, DateUploaded) VALUES (" . $iSPID . ", '" . $sFiletype . "', '" . $sNewFilename . "', '" . filter_input(INPUT_POST, "DBContactEmail", FILTER_SANITIZE_STRING) . "', NOW())"; mysqli_query($conni, $sql); $sForm .= '<tr><td><a href="https://www.cesa.co.za/cpdadmin/providerdocs/' . $sNewFilename . '">' . $sFiletype . '</a></td> <td>File uploaded</td></tr> '; } } $sForm .= ' <tr> <td><b>Accountability Structure</b></td> <td>' . $uploadfileAccountabilityStructure . '</td> </tr> </table>'; $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 APPROVAL OF A CONTINUING PROFESSIONAL DEVELOPMENT (CPD) SERVICE PROVIDER", $sForm, null, ['isHTML' => true, 'from-name' => 'CPD Verification']); $sForm = "<p>Dear " . $_POST["DBContactFirstName"] . " " . $_POST["DBContactSurname"] . "</p> <p>We acknowledge receipt of your application for verification as an ECSA Service Provider.</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($_POST["DBContactEmail"], "Acknowledgement of application for approval of a CPD Service Provider", $sForm, null, ['bcc' => ['cpd@cesa.co.za'], 'cc' => ['cpdverification@cesa.co.za'], 'isHTML' => true, 'from-name' => 'CPD Verification']); $bDisplayForm = false; ?> <div class="alert alert-success">Thank you for your submission. Your information has been received, and will be assessed. You will be notified of the outcome of your assessment once the process is complete.</div> <?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 service provider application", $ex->getMessage() . ' - ' . $ex->getTraceAsString(), null, ['isHTML' => false, 'from-name' => 'CPD Verification']); } } } if ($bDisplayForm) { foreach ($_POST as $key => $val) { $sFieldName = str_replace("DB", "Exist_", $key); ${$sFieldName} = $val; } ?> <p><b>* = required field</b></p> <form method="post" action="/cpd-validation/cpd-service-provider/" enctype="multipart/form-data"> <input type="hidden" name="do" value="1"> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr> <td colspan="2" bgcolor="#CCCCCC"><b> Organisation Details</b></td> </tr> <tr> <td><b>Company Name *</b></td> <td><input type="text" name="DBCompanyName" value="<?php echo $Exist_CompanyName; ?>" size="40" required></td> </tr> <tr> <td><b>Known As / Trading As</b></td> <td><input type="text" name="DBTradingAs" value="<?php echo $Exist_TradingAs; ?>" size="40"></td> </tr> <tr> <td><b>New or Renewal *</b></td> <td> <input type="radio" name="DBRenewal" id="DBRenewal_0" value="0" checked required /> New <input type="radio" name="DBRenewal" id="DBRenewal_1" value="1" required /> Renewal </td> </tr> <tr> <td> <b>Previous CESA CPD Verification Service Provider Number</b> </td> <td> <?php $serviceProviderObj = new CPDServiceProvider($sqlf); echo HTMLHelper::drawSelect(['name' => 'DBPrevSPNumber', 'value' => $PrevSPNumber, 'choices' => $serviceProviderObj->getPreviousSPNumbersSelectArray()]); ?> </td> </tr> <tr> <td> <b>Previous CESA CPD Verification Service Provider Certificate</b> </td> <td> <input id="PrevSPNumberCertificate" name="PrevSPNumberCertificate" type="file" /> </td> </tr> <tr> <td> <b>Other Volunteer Association CPD Verified Service Provider Number</b> </td> <td> <textarea id="OtherVACPDSPNumber" name="OtherVACPDSPNumber" cols="80" rows="5"></textarea> </td> </tr> <tr> <td> <b>Other Volunteer Association CPD Verified Service Provider Certificate</b> </td> <td> <input id="OtherVACPDSPNumberCertificate" name="OtherVACPDSPNumberCertificate" type="file" /> </td> </tr> <tr> <td><b>Phone Number</b><br>Format e.g.: +27 (0)11 463 2022</td> <td><?php echo WritePhoneField("DBPhoneNumber", false); ?></td> </tr> <tr> <td><b>Cell Number *</b><br>Format e.g.: +27 (0)82 XXX YYYY</td> <td><?php echo WritePhoneField("DBCellNumber", true); ?></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>Email Address *</b></td> <td><input type="text" name="DBEmailAddress" value="<?php echo $Exist_EmailAddress; ?>" size="40" required></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 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" required></td> </tr> <tr> <td><b>Code *</b></td> <td><input type="text" name="DBPhysicalCode" value="<?php echo $Exist_PhysicalCode; ?>" size="40" required></td> </tr> <tr> <td><b>Province *</b></td> <td><select name="DBPhysicalProvince" required> <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 } ?> <option value="International" <?php if ($Exist_PhysicalProvince == "International") echo " selected"; ?>>International</option> </select></td> </tr> <tr> <td><b>Country *</b></td> <td><select name="DBPhysicalCountry" required> <?php if (!isset($Exist_PhysicalCountry) || empty($Exist_PhysicalCountry)) $Exist_PhysicalCountry = 'South Africa'; $sql = "SELECT PicklistValue FROM Picklists WHERE PicklistType='Country' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); while ($row = mysqli_fetch_assoc($rec)) { ?> <option value="<?php echo $row["PicklistValue"]; ?>" <?php if ($Exist_PhysicalCountry == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select> </td> </tr> <tr> <td colspan="2" bgcolor="#CCCCCC"><b> Person who is applying for verification on behalf of the organisation</b></td> </tr> <tr> <td width="30%"><b>Title *</b></td> <td><select name="DBContactTitle" id="Contact1_1" required> <?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" id="Contact1_2" value="<?php echo $Exist_ContactInitials; ?>" size="40"></td> </tr> <tr> <td><b>First Name (Known As) *</b></td> <td><input type="text" name="DBContactFirstName" id="Contact1_3" value="<?php echo $Exist_ContactFirstName; ?>" size="40" required></td> </tr> <tr> <td><b>Surname *</b></td> <td><input type="text" name="DBContactSurname" id="Contact1_4" value="<?php echo $Exist_ContactSurname; ?>" size="40" required></td> </tr> <tr> <td><b>Position Held</b></td> <td><input type="text" name="DBContactPosition" id="Contact1_5" value="<?php echo $Exist_ContactPosition; ?>" size="40"></td> </tr> <tr> <td><b>ID / Passport Number</b></td> <td><input type="text" name="DBContactIDNum" id="Contact1_6" value="<?php echo $Exist_ContactIDNum; ?>" size="40"></td> </tr> <tr> <td><b>Phone Number</b></td> <td><?php echo WritePhoneField("DBContactPhone", false); ?></td> </tr> <tr> <td><b>Cell Number *</b></td> <td><?php echo WritePhoneField("DBContactCell", true); ?></td> </tr> <tr> <td><b>Email Address *</b></td> <td><input type="text" name="DBContactEmail" id="Contact1_9" value="<?php echo $Exist_ContactEmail; ?>" size="40" required></td> </tr> <tr> <td colspan="2" bgcolor="#CCCCCC"><b> Person who is acting as the administrator on behalf of the organisation</b></td> </tr> <tr> <td colspan="2"><input type="checkbox" id="SameAs" value="1" onclick="if (this.checked) CopyContact();"> Same as above</td> </tr> <tr> <td width="30%"><b>Title</b></td> <td><select name="DBAdminTitle" id="Contact2_1"> <?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_AdminTitle == $row["PicklistValue"]) echo " selected"; ?>><?php echo $row["PicklistValue"]; ?></option> <?php } ?> </select></td> </tr> <tr> <td><b>Initials</b></td> <td><input type="text" name="DBAdminInitials" id="Contact2_2" value="<?php echo $Exist_AdminInitials; ?>" size="40"></td> </tr> <tr> <td><b>First Name (Known As) *</b></td> <td><input type="text" name="DBAdminFirstName" id="Contact2_3" value="<?php echo $Exist_AdminFirstName; ?>" size="40" required></td> </tr> <tr> <td><b>Surname *</b></td> <td><input type="text" name="DBAdminSurname" id="Contact2_4" value="<?php echo $Exist_AdminSurname; ?>" size="40" required></td> </tr> <tr> <td><b>Position Held</b></td> <td><input type="text" name="DBAdminPosition" id="Contact2_5" value="<?php echo $Exist_AdminPosition; ?>" size="40"></td> </tr> <tr> <td><b>ID / Passport Number</b></td> <td><input type="text" name="DBAdminIDNum" id="Contact2_6" value="<?php echo $Exist_AdminIDNum; ?>" size="40"></td> </tr> <tr> <td><b>Phone Number</b></td> <td><?php echo WritePhoneField("DBAdminPhone", false); ?></td> </tr> <tr> <td><b>Cell Number *</b></td> <td><?php echo WritePhoneField("DBAdminCell", true); ?></td> </tr> <tr> <td><b>Email Address *</b></td> <td><input type="text" name="DBAdminEmail" id="Contact2_9" value="<?php echo $Exist_AdminEmail; ?>" size="40" required></td> </tr> </table> <table border="1" width="100%" cellspacing="0" cellpadding="2" class="tpedittable"> <tr> <td colspan="2" bgcolor="#CCCCCC"><b> Upload Documents</b><br> The CPD Service/Training Provider is required to upload evidence of the following, related to your company, the administration and offering of CPD Activities.</td> </tr> <?php $sql = "SELECT DisplayOrder, PicklistValue, PicklistLabel FROM Picklists WHERE PicklistType='CPD Provider Documents' ORDER BY DisplayOrder, PicklistValue"; $rec = mysqli_query($conni, $sql); $i = 0; $bShowBullet = false; while ($row = mysqli_fetch_assoc($rec)) { if ($row["PicklistLabel"] == 'Proof of Payment') { continue; } $i++; if ($row["DisplayOrder"] == 80) { echo '<tr><td valign="top" colspan="2"><b>Evidence of a comprehensive <a href="https://www.cesa.co.za/wp-content/uploads/2022/03/11-Quality-Management-System-Templates.pdf" target="_blank"><u>Quality Management System (QMS)</u></a>, which includes the following elements:</b></td></tr>'; $bShowBullet = true; } $sFileRequired = " *"; if (($row["DisplayOrder"] == 40) || ($row["DisplayOrder"] == 70)) $sFileRequired = ""; // BBBEE certificate and Proof of Payment ?> <tr> <td valign="top"><b><?php if ($bShowBullet) echo " • "; ?><?php echo $row["PicklistLabel"]; ?><input type="hidden" name="FLName<?php echo $i; ?>" value="<?php echo $row["PicklistValue"]; ?>"><?php echo $sFileRequired; ?></b><?php if ($row["DisplayOrder"] == 50) echo "<br><i>Any valid documents reflecting your company's name and physical office address. i.e. Recent active lease or rental agreement, Municipal rates and taxes invoice</i>"; ?></td> <td valign="top"> <div id="filelist<?php echo $i; ?>"> </div> <input id="FLFile<?php echo $i; ?>" type="hidden" name="FLFile<?php echo $i; ?>" value=""> <input id="fileupload<?php echo $i; ?>" type="file" data-url="/js/jQuery-File-Upload-10.32.0/server/php/"> </td> </tr> <?php } $iNumFiles = $i; ?> <tr> <td> <b>Accountability Structure</b> </td> <td> <input id="AccountabilityStructure" name="AccountabilityStructure" type="file" required /> </td> </tr> <tr> <td colspan="2" align="center"> <p><input type="checkbox" name="Confirm1" value="1" required="required"> I confirm that I am an authorised representative of the above organisation, and authorised to hereby apply on behalf of the organisation to be recognised as a ECSA CPD Verified Service Provider in terms of the Rules: Continuing Professional Development and Renewal of Registration (Board notice 86 of 2017) and Section 10 of the Standard for Continuing Professional Development (<a href="https://www.ecsa.co.za/ECSADocuments/Shared Documents/ECPD-01-STA Standard for Continuing Professional Development.pdf" target="_blank">ECPD-01-STA</a>).</p> <p><input type="checkbox" name="Confirm2" value="1" required="required"> I confirm that the information and documentation supplied is, to the best of my knowledge, accurate and complete.</p> </p> <div class="g-recaptcha" data-sitekey="6LcoIWUrAAAAAKBLHpjS7GyroBey9G6yhilbpyNa"></div> <input type="submit" value="Submit"> </td> </tr> </table> <input type="hidden" name="NumFiles" value="<?php echo $iNumFiles; ?>"> </form> <script> function CopyContact() { for (i = 1; i <= 9; i++) { jQuery('#Contact2_' + i).val(jQuery('#Contact1_' + i).val()); } } function DeleteFile(sFilename, iIndex) { if (confirm('Are you sure you want to delete this file?')) { /* $.ajax({ url: '/php/ajax_cpdprovdocs.php?type=del&filename='+sFilename }); */ jQuery('#uploadfile' + iIndex).remove(); jQuery('#FLFile' + iIndex).val(''); jQuery('#fileupload' + iIndex).show(); } } <?php for ($i = 1; $i <= $iNumFiles; $i++) { ?> function ShowFileUploaded<?php echo $i; ?>(sFilename) { sDelete = '<button id="deletefile<?php echo $i; ?>" type="button" class="btn btn-sm btn-danger" onclick="DeleteFile(\'' + sFilename + '\', <?php echo $i; ?>)">Delete file</button>'; jQuery("<div class='alert alert-success' id='uploadfile<?php echo $i; ?>'></div>").html('<p>Uploaded successfully: <b>' + sFilename + '</b>' + sDelete + '</p>').appendTo('#filelist<?php echo $i; ?>'); jQuery('#fileupload<?php echo $i; ?>').hide(); jQuery('#FLFile<?php echo $i; ?>').val(sFilename); } <?php } ?> jQuery(document).ready(function($) { $('input[name="DBRenewal"]').click(function() { if ($('#DBRenewal_1').is(':checked')) { $('#DBPrevSPNumber').attr('required', 1); $('#PrevSPNumberCertificate').attr('required', 1); } else { $('#DBPrevSPNumber').removeAttr('required'); $('#PrevSPNumberCertificate').removeAttr('required'); } }); <?php for ($i = 1; $i <= $iNumFiles; $i++) { ?> $('#fileupload<?php echo $i; ?>').fileupload({ url: '/js/jQuery-File-Upload-10.32.0/server/php/', dataType: 'json', acceptFileTypes: /(\.|\/)(txt|pdf|doc|docx|xls|xlsx|csv|zip|jpg|png|bmp|tif|tiff|gif|ppt|pptx)$/i, done: function(e, data) { $.each(data.result.files, function(index, file) { if (file.error) { $("<div class='alert alert-danger'></div>").html('<p>' + file.error + ': <b>' + file.name + '</b></p>').appendTo('#filelist<?php echo $i; ?>'); } else { ShowFileUploaded<?php echo $i; ?>(file.name); /* $.ajax({ url: '/php/ajax_cpdprovdocs.php?type=add&filename='+file.name }); */ } }); } }); <?php $sFilename = filter_input(INPUT_POST, "FLFile" . $i, FILTER_SANITIZE_STRING); if (!empty($sFilename) && file_exists($sUploadDir . $sFilename)) { ?> ShowFileUploaded<?php echo $i; ?>("<?php echo $sFilename; ?>"); <?php } } ?> }); </script> <?php } if (isset($conni) && is_object($conni)) { mysqli_close($conni); }