Exemple #1
0
/**
 * gets the participant details from NCGENES
 *
 *
 * @param string $DonorCode
 */
function doGetParticipant($DonorCode)
{
    // include the site constants
    include_once 'Constants.php';
    // include the participant object
    include_once "Participant.php";
    // create a new participant object
    $p = new Participant();
    // construct values for participant
    $p->load($DonorCode);
    // did we find the donor
    $foundDonor = $p->getDONOR_CODE();
    // if we got the donor loaded
    if (isset($foundDonor) && !empty($foundDonor)) {
        echo json_encode($p->getParticipantDetails());
    } else {
        echo '{"error": "Donor ' . $DonorCode . ' not found"}';
    }
    // terminate the data stream
    die;
}