From 3f3d242f6d07b3f509335da130ffd62938aafa1d Mon Sep 17 00:00:00 2001 From: james Date: Wed, 28 Nov 2007 21:04:36 +0000 Subject: [PATCH] Dont try to process awards if there is no awards to process Change the class on the prize edit page to be tableview and tableedit instead of summarytable and none (for consistency with the awards page) --- admin/award_download.php | 10 +++++++++- admin/award_prizes.php | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/admin/award_download.php b/admin/award_download.php index eba3210..b883638 100644 --- a/admin/award_download.php +++ b/admin/award_download.php @@ -89,8 +89,14 @@ $ar=$response['awardresponse'][0]; $postback=$ar['postback'][0]; echo i18n("Postback URL: %1",array($postback))."
"; - $numawards=count($ar['awards'][0]['award']); + if($ar['awards'][0]['award']) + $numawards=count($ar['awards'][0]['award']); + else + $numawards=0; + echo i18n("Number of Awards: %1",array($numawards))."
"; + if($numawards>0) { + foreach($ar['awards'][0]['award'] AS $award) { $identifier=$award['identifier'][0]; $year=$award['year'][0]; @@ -274,6 +280,7 @@ echo mysql_error(); } echo "
"; + } } echo ""; @@ -286,6 +293,7 @@ echo mysql_error(); } else echo error(i18n("Invalid XML response. Expecting '%1', received '%2'",array("awardresponse",$keys[0]))); +// echo "response=".print_r($datastream); echo "
"; } diff --git a/admin/award_prizes.php b/admin/award_prizes.php index 76825ec..eac5846 100644 --- a/admin/award_prizes.php +++ b/admin/award_prizes.php @@ -134,7 +134,7 @@ if($_GET['action']=="edit") echo "\n"; - echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; echo "\n"; @@ -187,7 +187,7 @@ echo ""; echo ""; - echo "
".i18n("Prize Description")."
(".i18n("If non cash/scholarship").")
prize)."\" size=\"40\" maxlength=\"128\" />
".i18n("Cash Amount")."\$cash)."\" size=\"10\" maxlength=\"10\" />
".i18n("Scholarship Amount")."\$scholarship)."\" size=\"10\" maxlength=\"10\" />
"; + echo "
"; echo ""; echo " "; echo " ";
".i18n("Order")."".i18n("Prize Description")."