View Single Post
  #1  
Old 30th November 2014, 16:16
ADRIEN69 ADRIEN69 is offline
Member
 
Join Date: Nov 2014
Posts: 11
Default mod progression donation
hello,
I want to put a donation system better than on my site.

example:

-progress bar
- amount paid by the members
- Maximum amount of donation

could someone explain to me the process please

thank you to you

my donate_block.php :
PHP Code:
<?php
begin_block
(T_("DONATE"));
$totalneeded "100"//=== set this to your monthly wanted amount
$totalneeded3 ="$".sprintf("%01.2f"$totalneeded);
$month1 sqlesc(gmdate("m"));
$year1 sqlesc(gmdate("Y"));
$total_funds1 SQL_Query_exec("SELECT sum(cash) as total_funds FROM `funds` WHERE month=$month1 && year = $year1");
$arr_funds mysql_fetch_array($total_funds1);
$funds_so_far $arr_funds["total_funds"];
$funds_difference $totalneeded $funds_so_far;
$Progress_so_far $funds_so_far $totalneeded 100;

$Percent $Progress_so_far;
$Percent floor(($Percent) * 100 .5) * .01;

if(
$Progress_so_far >= $totalneeded)
$Progress_so_far "100";
$Progress_so_far2 $Progress_so_far;
if (
$funds_so_far <= 300){
$pic "images/donate/loadbarred.gif";
$Progress_so_far2 20;
}
elseif (
$funds_so_far <= 500)
$pic "images/donate/loadbaryellow.gif";
else 
$pic "images/donate/loadbargreen.gif";
if(
$totalneeded >= $funds_so_far) {
$monthly_goal "[ ".round($Progress_so_far)."%";
$monthly_goal22 " of monthly goal.]";
}
else
$monthly_goal "[ Monthly goal met! ]";


print(
"<center><table cellpadding=3 class=main border=0>".
"<td class=row3 align=center><p align=center>"."<table width=175 hight=17 border=2><td width=$Progress_so_far2% height=15 background=$pic align=center valign=middle>".
"$monthly_goal</td><td style='padding: 0px; background-image: 
url(images/donate/loadbarbg.gif); background-repeat: repeat-x'>"
.
"$monthly_goal22</td></tr></table> ".
"<a href=\"donate.php\"><img src=\"images/donate/donate.gif\"></a>");

print(
"</td></tr></table></center>");
end_block();
?>
my image : Click the image to open in full size.

thank you for your answer
Reply With Quote