From 95c559fa08df5a67cf7866374a6c180dc984ee8d Mon Sep 17 00:00:00 2001 From: james Date: Fri, 7 Nov 2008 03:23:42 +0000 Subject: [PATCH] Add sponsorship levels to the sponsor main page --- sponsor_main.php | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/sponsor_main.php b/sponsor_main.php index c028d4e..c679734 100644 --- a/sponsor_main.php +++ b/sponsor_main.php @@ -47,7 +47,7 @@ // echo " ".theme_icon("")."
".i18n("Manage My Roles")."
"; echo " \n"; echo "\n"; - echo "

Your sponsorships

\n"; + echo "

Your Sponsorships

\n"; $sq=mysql_query("SELECT sponsorships.id, sponsors.organization, @@ -71,6 +71,7 @@ echo " ".i18n("Amount")."\n"; echo " ".i18n("Action").""; echo "\n"; + $total=0; while($sr=mysql_fetch_object($sq)) { echo "id\" class=\"fundraising{$sr->status}\">"; echo "$sr->name\n"; @@ -86,6 +87,41 @@ echo " "; echo "\n"; echo "\n"; + $total+=$sr->value; + } + echo "\n"; + echo "
\n"; + echo "
\n"; + + echo "

Sponsorship Levels

\n"; + $q=mysql_query("SELECT * FROM sponsorships_levels WHERE year='".$config['FAIRYEAR']."' ORDER BY max DESC"); + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + $first=true; + while($r=mysql_fetch_object($q)) { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } echo "
".i18n("Level")."".i18n("Description / Benefits")."".i18n("Range")."
"; + if($total>=$r->min && $total<=$r->max) { + echo "".i18n("You are here"); + echo " >>"; + echo ""; + } + echo "$r->level$r->description"; + if($first) { + echo format_money($r->min)."+"; + $first=false; + } + else + echo format_money($r->min)."-".format_money($r->max); + + echo "
\n";