Add special award subset of sponsors that can be contacted

This commit is contained in:
james 2010-11-22 18:14:03 +00:00
parent 6e955082e9
commit 4f388734a9

View File

@ -88,6 +88,51 @@
ORDER BY users.email
"),
"sponsors_specialawards"=>array("name"=>"Organization sponsors for Special Awards","query"=>
"SELECT DISTINCT sponsors.id, organization, email
FROM sponsors
JOIN award_awards ON sponsors.id=award_awards.sponsors_id
WHERE
email!=''
AND award_awards.award_types_id=2
ORDER BY email"),
"sponsors_primarycontacts_specialawards"=>array("name"=>"Organization sponsors for Special Awards (primary contacts)","query"=>
"SELECT DISTINCT uid, MAX(users.year) AS year, sponsors.organization, users.firstname, users.lastname, users.email, deleted, users_sponsor.primary
FROM sponsors,
users_sponsor,
users,
award_awards
WHERE
users.id=users_sponsor.users_id
AND users_sponsor.sponsors_id=sponsors.id
AND users.types LIKE '%sponsor%'
AND users.email!=''
AND sponsors.id=award_awards.sponsors_id
AND award_awards.award_types_id=2
GROUP BY uid
HAVING deleted='no' AND users_sponsor.primary='yes'
ORDER BY users.email
"),
"sponsors_allcontacts_specialawards"=>array("name"=>"Organization sponsors for Special Awards (all contacts)","query"=>
"SELECT DISTINCT(users.email), sponsors.organization, users.firstname, users.lastname, users.email
FROM sponsors,
users_sponsor,
users,
award_awards
WHERE
users.id=users_sponsor.users_id
AND users_sponsor.sponsors_id=sponsors.id
AND users.types LIKE '%sponsor%'
AND users.deleted='no'
AND users.email!=''
AND sponsors.id=award_awards.sponsors_id
AND award_awards.award_types_id=2
ORDER BY users.email
"),
/*
"special_award_sponsors_unconfirmed"=>array("name"=>"Special award sponsors (unconfirmed only)","query"=>
"SELECT DISTINCT(award_sponsors.id), organization, firstname, lastname, award_contacts.email FROM award_sponsors, award_awards, award_contacts WHERE award_awards.sponsors_id=award_sponsors.id AND award_contacts.award_sponsors_id=award_sponsors.id AND award_sponsors.confirmed='no' AND award_awards.award_types_id='2' AND award_contacts.year='".$config['FAIRYEAR']."'"),