Fix science head and principal queries in branch

This commit is contained in:
james 2011-01-05 20:25:14 +00:00
parent afc836e214
commit e6cd95ebfc

View File

@ -142,13 +142,21 @@
*/ */
"school_principals"=>array("name"=>"School principals","query"=> "school_principals"=>array("name"=>"School principals","query"=>
"SELECT school, principal AS firstname, schoolemail AS email FROM schools WHERE schools.year='".$config['FAIRYEAR']."' AND schoolemail!=''"), "SELECT school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
JOIN users ON schools.principal_uid=users.uid AND users.id=(SELECT id FROM users WHERE users.uid=schools.principal_uid ORDER BY `year` DESC LIMIT 1)
WHERE schools.year='".$config['FAIRYEAR']."' AND email!=''"),
"school_scienceheads"=>array("name"=>"School science heads","query"=> "school_scienceheads"=>array("name"=>"School science heads","query"=>
"SELECT school, sciencehead AS firstname, scienceheademail AS email FROM schools WHERE schools.year='".$config['FAIRYEAR']."' AND scienceheademail!=''"), "SELECT school, users.firstname AS firstname, users.lastname AS lastname, users.email AS email FROM schools
JOIN users ON schools.sciencehead_uid=users.uid AND users.id=(SELECT id FROM users WHERE users.uid=schools.sciencehead_uid ORDER BY `year` DESC LIMIT 1)
WHERE schools.year='".$config['FAIRYEAR']."' AND email!=''"),
"school_teachers_thisyear"=>array("name"=>"Teachers (as entered by students) this year","query"=> "school_teachers_thisyear"=>array("name"=>"Teachers (as entered by students) this year","query"=>
"SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year='".$config['FAIRYEAR']."' AND teacheremail!=''"), "SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year='".$config['FAIRYEAR']."' AND teacheremail!=''"),
"school_teachers_lastyear"=>array("name"=>"Teachers (as entered by students) last year","query"=> "school_teachers_lastyear"=>array("name"=>"Teachers (as entered by students) last year","query"=>
"SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year='".($config['FAIRYEAR']-1)."' AND teacheremail!=''"), "SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE year='".($config['FAIRYEAR']-1)."' AND teacheremail!=''"),
"school_teachers_allyears"=>array("name"=>"Teachers (as entered by students) all years","query"=> "school_teachers_allyears"=>array("name"=>"Teachers (as entered by students) all years","query"=>
"SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE teacheremail!=''"), "SELECT DISTINCT(teacheremail) AS email, teachername AS firstname FROM students WHERE teacheremail!=''"),
/* Volunteers */ /* Volunteers */