. require_once("../inc/util.inc"); check_get_args(array()); if (!defined("PAYPAL_ADDRESS")) { error_page(tra("This project is not accepting donations.")); } db_init(); $logged_in_user = get_logged_in_user(false); if ($logged_in_user) { $user_id = $logged_in_user->id; } page_head(tra("%1 donations", PROJECT)); if (function_exists("donations_intro")) { donations_intro(); } else { echo "
".tra("This project is accepting donations via %1.", "PayPal")."
".tra("To donate, fill in the amount you want to donate using the field below. PayPal is accepting multiple currencies (Canadian Dollars, Euros, Pounds Sterling, U.S. Dollars, Yen, Australian Dollars, New Zealand Dollars, Swiss Francs, Hong Kong Dollars, Singapore Dollars, Swedish Kronor, Danish Kroner, Polish Zloty, Norwegian Kroner, Hungarian Forint, Czech Koruna). You can use included currency converter to see the donation amount equivalent in different currencies (please note that the rates are only estimates and the actual amount may differ).")."
"; } echo "\n"; $query = mysql_query("SELECT * FROM donation_items"); echo "
\n"; start_table(); // If donation_items table is filled, a list of donation targets is shown $first_row = true; while ($row = mysql_fetch_object($query)) { $col1 = $row->title."
".$row->description.""; $query_amount = mysql_query("SELECT SUM(payment_amount-payment_fee) AS amount FROM donation_paypal WHERE processed = 1 AND item_number = '".$row->id."'"); $acquired = mysql_fetch_object($query_amount)->amount; $required = $row->required; if ($acquired > $required) { $acquired = $acquired - $required; $progress = 100; } else { $progress = round($acquired / ($required) * 100); $progress2 = round($acquired / ($required) * 100,1); } $col2 = "id."\""; if ($first_row) { $first_row = false; $col2 .= " checked=\"checked\""; } $col2 .= ">"; if ($progress == 0) { $col2 .= "
"; } elseif ($progress == 100) { $col2 .= "
"; } else { $col2 .= "
".$progress2."%
"; } row2($col1, $col2); } $amount .= "\n"; $amount .= "\n"; $amount .= "\n"; $estimated .= "\n"; $estimated .= "\n"; echo row2(tra("Amount you would like to donate"), $amount); echo row2(tra("Estimated value in"), $estimated); if ($user_id) { $tmp_user_name = $user_id." (".$logged_in_user->name.")"; echo row2(tra("Anonymous donation")."
".tra("Select this if you dont want your name and account number displayed in donator lists.
If not checked, you will be recorded as user ID %1", $tmp_user_name)."
", ""); } else { echo row2(tra("Anonymous donation")."
".tra("To assign the donation with your user ID, please log in."), " "); } echo row2("", ""); echo row1(tra("Donations are accepted through")."
\"PayPal\""); end_table(); echo "\n"; page_tail(); ?>