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) { function getUserForSponsor($sponsor_id) {
// loop through each contact and draw a form with their data in it. // fetch the data for a specific sponsor
$q = mysql_query("SELECT *,MAX(year) FROM users LEFT JOIN users_sponsor ON users_sponsor.users_id=users.id $q = mysql_query("SELECT * , MAX( conferences_id ) FROM users
WHERE LEFT JOIN user_roles ON user_roles.users_id = users.id
sponsors_id='" . $sponsor_id . "' JOIN roles ON roles.id = user_roles.roles_id
AND types LIKE '%sponsor%' WHERE sponsors_id = '" . $sponsor_id . "'
GROUP BY uid AND roles.type = 'sponsor'
HAVING deleted='no' GROUP BY users.id
ORDER BY users_sponsor.primary DESC,lastname,firstname HAVING deleted = 'no'
LIMIT 1 ORDER BY users.`primary` DESC , lastname, firstname
"); LIMIT 1");
$r=mysql_fetch_object($q); $r=mysql_fetch_object($q);
return user_load_by_uid($r->uid); return user_load($r->uid);
} }
function projectdivisions_load($conferences_id = false) { function projectdivisions_load($conferences_id = false) {