forked from science-ation/science-ation
Added getRegistrationsId() function, returning the registration ID for the specified user
This commit is contained in:
parent
96f36d4681
commit
6519392bd5
@ -655,6 +655,26 @@ function addRegistration($userId){
|
|||||||
return $regnum;
|
return $regnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the registration id for a specific user.
|
||||||
|
//Accepts either the user object or the user id, and returns the registration id, or NULL if none is set, error message if something's borked
|
||||||
|
function getRegistrationsId($user){
|
||||||
|
// get the user id
|
||||||
|
if(is_array($user)){
|
||||||
|
if(!array_key_exists('id', $user)) return "register_participants.inc.php::getRegistrationsId -> Invalid user object";
|
||||||
|
$uid = $user['id'];
|
||||||
|
}else{
|
||||||
|
$uid = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
// grab their registrations id
|
||||||
|
$result = mysql_fetch_assoc(mysql_query("SELECT registrations_id FROM users WHERE id = $uid"));
|
||||||
|
if(mysql_error()){
|
||||||
|
return "register_participants.inc.php::getRegistrationsId -> " . $mysql_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result['registrations_id'];
|
||||||
|
}
|
||||||
|
|
||||||
function getProject($registrations_id){
|
function getProject($registrations_id){
|
||||||
global $conference;
|
global $conference;
|
||||||
// FIXME - in the future, this should be able to handle a many-to-many
|
// FIXME - in the future, this should be able to handle a many-to-many
|
||||||
|
Loading…
Reference in New Issue
Block a user