Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/php/certificate/
Upload File :
Current File : /var/www/cesa.co.za/php/certificate/validate_marketing_certificate.php

<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

require_once($_SERVER['DOCUMENT_ROOT'] . '/cfg/config.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/echasl23/ewcfg7.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/cesanet/inc_shared.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/echasl23/phpqrcode/qrlib.php');
require_once($_SERVER['DOCUMENT_ROOT'] . '/php/includes/Certificates.php');

$sqlf = new sqlFunctions(EW_CONN_HOST, EW_CONN_USER, EW_CONN_PASS, EW_CONN_DB);

// echo $sqlf;
// exit;

// Echo class of variable $sqlf
// echo get_class($sqlf) . '<br />';

$certificateObject = new Certificates($sqlf);

$row = $certificateObject->findOneMarketingByAttendeeId($_REQUEST['attendee_id']);

if (is_array($row) && count($row) > 0) {

    $certificateDate = new DateTime($row['StartDate']);
    $certificateEndDate = new DateTime($row['EndDate']);
    ?>
    <h1><center>This is to acknowledge that</center></h1>
    <h1><center><?php echo $row['ContactFirstName'] . ' ' . $row['ContactLastName']; ?></center></h1>
    <h1><center>Attended the conference</center></h1>
    <h1><center><?php echo $row['EventName']; ?></center></h1>
    <h1><center>On <?php
            echo $certificateDate->format('j F Y');

            if ($certificateDate->format('j F Y') != $certificateEndDate->format('j F Y')) {
                echo ' - ' . $certificateEndDate->format('j F Y');
            }
            ?></center></h1>
    <?php
    if ($row['AccredNum'] != '') {
        ?>
        <h6><center>This qualifies for <?php echo $row['CPD']; ?> CPD Point<?php echo ($row['CPD'] > 1) ? 's' : ''; ?></center></h6>
        <h6><center>for Continuing Professional Development</center></h6>
        <h3><center><?php echo $row['AccredNum']; ?></center></h3>
        <?php
    }
} else {
    ?>
    <h1><center>This link is not valid</center></h1>
    <?php
}