forked from science-ation/science-ation
oops forgot to commit the getUserForSponsor function!
This commit is contained in:
parent
9a44ff29e1
commit
3c364b84c6
@ -1286,5 +1286,20 @@ function getTextFromHtml($html) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
function getUserForSponsor($sponsor_id) {
|
||||
// loop through each contact and draw a form with their data in it.
|
||||
$q = mysql_query("SELECT *,MAX(year) FROM users LEFT JOIN users_sponsor ON users_sponsor.users_id=users.id
|
||||
WHERE
|
||||
sponsors_id='" . $sponsor_id . "'
|
||||
AND types LIKE '%sponsor%'
|
||||
GROUP BY uid
|
||||
HAVING deleted='no'
|
||||
ORDER BY users_sponsor.primary DESC,lastname,firstname
|
||||
LIMIT 1
|
||||
");
|
||||
$r=mysql_fetch_object($q);
|
||||
return user_load_by_uid($r->uid);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user