diff --git a/admin/reports_acscript.php b/admin/reports_acscript.php index 0bc9c157..f6dad034 100644 --- a/admin/reports_acscript.php +++ b/admin/reports_acscript.php @@ -24,11 +24,7 @@ if(is_array($_GET['show_category'])) { $show_category = array(); foreach($_GET['show_category'] as $id=>$val) { - $show_category[] = "projects.projectcategories_id='$id'"; - } - if($show_unawarded_prizes=="yes") - { - $show_category[] = "projects.projectcategories_id IS NULL"; + $show_category[] = "award_awards_projectcategories.projectcategories_id='$id'"; } $and_categories = join(' OR ', $show_category); } else { @@ -68,14 +64,18 @@ if(!$scriptformat) $scriptformat="default"; FROM award_awards, award_types, - sponsors + sponsors, + award_awards_projectcategories WHERE award_awards.year='$foryear' AND award_types.year='$foryear' AND award_awards.award_types_id=award_types.id AND award_awards.sponsors_id=sponsors.id + AND award_awards.id=award_awards_projectcategories.award_awards_id AND award_awards.excludefromac='0' + AND ($and_categories) $awardtype + GROUP BY award_awards.id ORDER BY awards_order"); echo mysql_error(); @@ -107,7 +107,6 @@ if(!$scriptformat) $scriptformat="default"; award_awards_id='{$r->id}' AND award_prizes.year='$foryear' AND award_prizes.excludefromac='0' - AND ($and_categories) ORDER BY `order`, projects.projectnumber");