A quick function update

This commit is contained in:
jacob 2010-11-01 21:51:27 +00:00
parent e4d94ffca2
commit 89475dae93

View File

@ -737,18 +737,18 @@ function getTextFromHtml($html) {
}
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
// fetch the data for a specific sponsor
$q = mysql_query("SELECT * , MAX( conferences_id ) FROM users
LEFT JOIN user_roles ON user_roles.users_id = users.id
JOIN roles ON roles.id = user_roles.roles_id
WHERE sponsors_id = '" . $sponsor_id . "'
AND roles.type = 'sponsor'
GROUP BY users.id
HAVING deleted = 'no'
ORDER BY users_sponsor.primary DESC,lastname,firstname
LIMIT 1
");
ORDER BY users.`primary` DESC , lastname, firstname
LIMIT 1");
$r=mysql_fetch_object($q);
return user_load_by_uid($r->uid);
return user_load($r->uid);
}
function projectdivisions_load($conferences_id = false) {