2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Add get_token_value function

This commit is contained in:
Adam Zammit
2017-02-03 11:50:55 +11:00
parent 1a4b41fd04
commit 05722b32a3
4 changed files with 53 additions and 601 deletions

View File

@@ -71,6 +71,31 @@ function limerpc_init ($url,$user,$pass)
return true;
}
function get_token_value($questionnaire_id,$token, $value = 'sent')
{
global $limeRPC;
global $limeKey;
global $db;
$sql = "SELECT r.rpc_url, r.username, r.password, r.description, q.lime_id
FROM remote as r, questionnaire as q
WHERE q.questoinnaire_d = '$questionnaire_id'
AND q.remote_id = r.id";
$r = $db->GetRow($sql);
$ret = false;
if (limerpc_init($r['rpc_url'],$r['username'],$r['password']) === true) {
$l = $limeRPC->get_participant_properties($limeKey,$r['lime_id'],array('token'=>$token),array($value));
if (isset($l[$value]) {
$ret= $l[$value];
}
}
return $ret;
}
function get_survey_list ()
{