My UEFGM Course


[insert_php]
global $wpdb;
$myuser = get_current_user_id();
$sql = “SELECT steam FROM wp_mysteam WHERE userid = ‘$myuser'”;
$myExams = $wpdb->get_results($sql);

foreach ($myExams as $myExam) {
if ($myExam->steam == 2) { $health = “progress”; }
if ($myExam->steam == 3) { $asylum = “progress”; }
if ($myExam->steam == 4) { $law = “progress”; }
if ($myExam->steam == 5) { $social = “progress”; }
if ($myExam->steam == 6) { $education = “progress”; }
if ($myExam->steam == 7) { $media = “progress”; }
}

$mysql = “SELECT a.certificate_id, a.taking_id, (select title from wp_watupro_certificates where id = a.certificate_id) as title, (select end_time from wp_watupro_taken_exams where id = a.taking_id) as endDate FROM wp_watupro_user_certificates a WHERE a.user_id = ‘$myuser'”;
$myCerts = $wpdb->get_results($mysql);

if (count($myCerts) > 0)
{
$certificatesHTML = ‘

Certificates earned

‘;
}
foreach ($myCerts as $myCert) {
if ($myCert->certificate_id == 3) { $asylum = “true”; }
if ($myCert->certificate_id == 6) { $education = “true”; }
if ($myCert->certificate_id == 2) { $health = “true”; }
if ($myCert->certificate_id == 4) { $law = “true”; }
if ($myCert->certificate_id == 5) { $social = “true”; }
if ($myCert->certificate_id == 7) { $media = “true”; }

$certID = $myCert->certificate_id;
$takingID = $myCert->taking_id;
$certName = $myCert->title;
$endDate = $myCert->endDate;

$certificatesHTML = $certificatesHTML .’

‘ . $certName . ‘ – ‘ . $endDate . ‘

‘;
}

[/insert_php]
Click on your selected stream of study to start:


[insert_php]
if ($health == “progress”) { echo ‘‘; }
elseif ($health == “true”) { echo ‘‘; }
else { echo ‘‘; }
[/insert_php]

[insert_php]
if ($asylum == “progress”) { echo ‘‘; }
elseif ($asylum == “true”) { echo ‘‘; }
else { echo ‘‘; }
[/insert_php]

[insert_php]
if ($law == “progress”) { echo ‘‘; }
elseif ($law == “true”) { echo ‘‘; }
else { echo ‘‘; }
[/insert_php]

[insert_php]
if ($social == “progress”) { echo ‘‘; }
elseif ($social == “true”) { echo ‘‘; }
else { echo ‘‘; }
[/insert_php]

[insert_php]
if ($education == “progress”) { echo ‘‘; }
elseif ($education == “true”) { echo ‘‘; }
else { echo ‘‘; }
[/insert_php]

[insert_php]
if ($media == “progress”) { echo ‘‘; }
elseif ($media == “true”) { echo ‘‘; }
else { echo ‘‘; }

[/insert_php]


[insert_php]
echo $certificatesHTML;
[/insert_php]