Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #1  
Old 30th November 2013, 20:26
hatijahat hatijahat is offline
Senior Member
 
Join Date: Dec 2012
Malaysia
Posts: 43
Default Donation progress bar
hello to all who read this.
i need a little help with this mod, it's seem working on the page but when i update account to test seem the bar not moving at all..
how to make it working..? what sql i have to add in my database?
i'm a noob in sql and all these coding thing.. hope get a guide from a pro in here..


the image :
Click the image to open in full size.

the code:
Code:
//====donation progress bar by snuggles enjoy
$total_funds = sql_query("SELECT sum(cash) as USD FROM funds");
$arr_funds = mysql_fetch_array($total_funds);
$funds_so_far = $arr_funds["total_funds"];
$totalneeded = "264";    //=== set this to your monthly wanted amount
$funds_difference = $totalneeded - $funds_so_far;
$Progress_so_far = number_format($funds_so_far / $totalneeded * 100, 1);
if($Progress_so_far >= 100)
$Progress_so_far = "100";
echo"<table width=140 height=20 border=2><tr><td bgcolor=white align=center valign=middle width=$Progress_so_far%>$Progress_so_far%</td><td bgcolor=grey align=center valign=middle</td></tr></table>";
//end
}
Reply With Quote
  #2  
Old 27th December 2013, 23:02
Jarsky Jarsky is offline
Member
 
Join Date: Dec 2013
New Zealand
Posts: 1
Default
Check you have any values in your SQL table for $total_funds
Reply With Quote
  #3  
Old 30th December 2013, 04:45
hatijahat hatijahat is offline
Senior Member
 
Join Date: Dec 2012
Malaysia
Posts: 43
Default
Quote:
Originally Posted by Jarsky View Post
Check you have any values in your SQL table for $total_funds
i don't know how to add the SQL..
can anyone make one?
Reply With Quote
  #4  
Old 30th December 2013, 09:15
KrackerMan's Avatar
KrackerMan KrackerMan is offline
Senior Member
 
Join Date: Aug 2010
United States
Posts: 109
Default
Code:
    CREATE TABLE `funds` (
      `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
      `cash` DECIMAL(8,2) NOT NULL DEFAULT '0.00',
      `user` INT(10) UNSIGNED NOT NULL DEFAULT '0',
      `added` INT(11) NOT NULL,
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
Quote:
ALTER TABLE users ADD `donoruntil` INT(11) UNSIGNED NOT NULL DEFAULT '0';
ALTER TABLE users ADD `donated` DECIMAL(8,2) NOT NULL DEFAULT '0.00';
ALTER TABLE users ADD `total_donated` DECIMAL(8,2) NOT NULL DEFAULT '0.00';
Reply With Quote
The Following User Says Thank You to KrackerMan For This Useful Post:
hatijahat (2nd January 2014)
Reply

Tags
bar , donation , progress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 11:37. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.