From 33a9ee540162d83f174e2d2e066f021e72aad239 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 10 Feb 2010 05:36:15 +0000 Subject: [PATCH] Show a disabled button for awards with additional materials that have no winners. --- admin/winners.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/admin/winners.php b/admin/winners.php index 78b824fe..3a84b22a 100644 --- a/admin/winners.php +++ b/admin/winners.php @@ -202,9 +202,9 @@ case 'edit_load': case 'additional_materials': $fairs_id = intval($_GET['fairs_id']); - $q = mysql_query("SELECT award_source_fairs_id,external_identifier FROM award_awards WHERE id='$award_awards_id'"); + $q = mysql_query("SELECT * FROM award_awards WHERE id='$award_awards_id'"); if($fairs_id == 0) { - echo "Unsupported Action: Can't get additional materials for fairs_id=0"; + echo "Unsupported Action: Can't get additional materials for fairs_id=0. Edit the project and set it's fair to anything except 'Local/Unspecified'."; exit; } $a = mysql_fetch_assoc($q); @@ -486,15 +486,9 @@ function print_award(&$r, $fairs_id, $editor=false, $editor_data=array()) ORDER BY `order`"); echo mysql_error(); - - if($r['external_additional_materials'] == 1 && $editor==false && $r['award_source_fairs_id'] == NULL) { - echo "
"; - echo ""; - echo "
'; - echo "
"; - } - - + + echo "
"; + $has_winners = false; while($pr=mysql_fetch_object($q)) { if($editor == true) { @@ -552,6 +546,7 @@ function print_award(&$r, $fairs_id, $editor=false, $editor_data=array()) } $winners[] = $w['projects_id']; } + $has_winners = true; echo "({$w['projectnumber']}) {$w['title']}"; echo "
"; } else { @@ -612,6 +607,19 @@ function print_award(&$r, $fairs_id, $editor=false, $editor_data=array())
"; + if($r['external_additional_materials'] == 1 && $editor==false && $r['award_source_fairs_id'] == NULL) { + $d = 'disabled="disabled"'; + $a = ''; + if($has_winners == true) { + echo ""; + $d = ''; + $a = ''; + } + echo "$a
"; + } + echo "
"; + } send_footer();