diff --git a/admin/communication.inc.php b/admin/communication.inc.php index 4d90c16..122e2de 100644 --- a/admin/communication.inc.php +++ b/admin/communication.inc.php @@ -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']."'"),