diff --git a/admin/winners.php b/admin/winners.php index b2471b4..58ddc3c 100644 --- a/admin/winners.php +++ b/admin/winners.php @@ -25,6 +25,8 @@ require_once('../common.inc.php'); require_once('../user.inc.php'); require_once('../projects.inc.php'); +require_once('../fair_additional_materials.inc.php'); + $auth_type = user_auth_required(array('fair','committee'), 'admin'); $award_awards_id = intval($_GET['award_awards_id']); @@ -117,6 +119,7 @@ case 'award_load': award_awards.criteria, award_awards.order AS awards_order, award_awards.per_fair, + award_awards.external_additional_materials, award_types.type FROM award_awards , @@ -151,6 +154,7 @@ case 'edit_load': award_awards.criteria, award_awards.order AS awards_order, award_awards.per_fair, + award_awards.external_additional_materials, award_types.type FROM award_awards , @@ -192,6 +196,24 @@ case 'edit_load': /* Print the award with editor */ print_award($r, $fairs_id, true, $editor_data); exit; + + +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'"); + if($fairs_id == 0) { + echo "Unsupported Action: Can't get additional materials for fairs_id=0"; + exit; + } + $a = mysql_fetch_assoc($q); + $q = mysql_query("SELECT * FROM fairs WHERE id='$fairs_id'"); + $fair = mysql_fetch_assoc($q); + $pdf = fair_additional_materials($fair, $a, $config['FAIRYEAR']); + foreach($pdf['header'] as $h) header($h); +// echo base64_decode($pdf['data64']); + base64_decode($pdf['data64']); + exit; + } @@ -323,7 +345,6 @@ function set_eli(prize_id) } - $(document).ready(function() { $("#winner_editor").dialog({ @@ -369,6 +390,7 @@ $q=mysql_query("SELECT award_awards.name, award_awards.order AS awards_order, award_awards.per_fair, + award_awards.external_additional_materials, award_types.type, sponsors.organization FROM @@ -462,6 +484,14 @@ function print_award(&$r, $fairs_id, $editor=false, $editor_data=array()) `order`"); echo mysql_error(); + if($r['external_additional_materials'] == 1 && $editor==false) { + echo "
"; + echo ""; + echo "
'; + echo "
"; + } + + while($pr=mysql_fetch_object($q)) { if($editor == true) {