Copyright (C) 2008 James Grant This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ?> "; echo ""; echo " Organization"; echo " # of Sponsorships"; echo " # of Awards"; echo " # of Contacts"; // echo " Action"; echo "\n"; while($r=mysql_fetch_object($q)) { echo "\n"; $eh="style=\"cursor:pointer;\" onclick=\"open_editor({$r->id});\""; echo " $r->organization\n"; $numq=mysql_query("SELECT COUNT(id) AS num FROM award_awards WHERE year='".$config['FAIRYEAR']."' AND sponsors_id='$r->id'"); $numr=mysql_fetch_object($numq); $numawards=$numr->num; $numq=mysql_query("SELECT COUNT(id) AS num FROM sponsorships WHERE year='".$config['FAIRYEAR']."' AND sponsors_id='$r->id'"); $numr=mysql_fetch_object($numq); $numsponsorships=$numr->num; $numq=mysql_query("SELECT uid,MAX(year),firstname,lastname,deleted FROM users,users_sponsor WHERE types LIKE '%sponsor%' AND sponsors_id='$r->id' AND users_sponsor.users_id=users.id AND users.deleted='no' GROUP BY uid ORDER BY firstname"); // $numq=mysql_query("SELECT DISTINCT(uid) FROM users_sponsor, users WHERE sponsors_id='$r->id' AND users_sponsor.users_id=users.id AND users.deleted='no'"); $numcontacts=mysql_num_rows($numq); // $numr=mysql_fetch_object($numq); // $numcontacts=$numr->num; echo " "; echo "$numsponsorships  "; echo "id\">\"view\""; echo ""; echo " "; echo "$numawards  "; echo "id\">\"view\""; echo ""; echo " "; echo "$numcontacts  "; // echo "id\">\"view\""; echo ""; echo "\n"; } echo "\n"; ?>