Example #1
0
?>
<p>
<table border=1 cellspacing=0 cellpadding=3>
<tr><th align=left>Account Group</th>
<?php 
list($rc, $currencies) = ff_currencies();
foreach ($currencies as $code => $c) {
    print "<th align=right>" . htmlentities($code) . "</th>";
}
?>
</tr>
<?php 
foreach ($report as $acct => $change) {
    print "<tr><td>" . htmlentities($acct) . "</td>";
    foreach ($currencies as $code => $c) {
        print "<td align=right>" . format_for_entryfield(currency_value($change, $code)) . "</td>";
    }
    print "</tr>\n";
}
?>
</table>
</p>

<?php 
foreach ($currencies as $code => $c) {
    list($rc, $transactions) = admin_getpaypaltransactions($code, $from, $to);
    ?>
<p>
<h2><?php 
    echo htmlentities($code);
    ?>
Example #2
0
    </tr>
<?php 
}
$totalsubscription += $reservedeposit;
?>
    <tr class='feerow'>
        <td valign=top width="0%">&nbsp;</td>
        <td valign=top width="100%">Randomly Selected Featured Project</td>
        <td align=right valign=top width="0"><nobr>&nbsp;&nbsp;<span class=oldvalue><?php 
echo htmlentities(convert_money($reservedeposit . $currency["code"]));
?>
</span><span class=newvalue><?php 
echo htmlentities($currency["prefix"]);
?>
 <input name="reserve_deposit" id="dreserve" value="<?php 
echo format_for_entryfield($reservedeposit);
?>
" size=5 maxLength=10 style="text-align:right;font-size:small"></span></nobr></td>
    </tr>
    <tr class='extrarow'>
        <td valign=top width="0%">&nbsp;</td>
        <td valign=top width="100%"><b>Total Monthly Sponsorship Amount</b></td>
        <td align=right valign=top width="0%"><nobr>&nbsp;&nbsp;<b class=oldvalue><?php 
echo format_money($totalsubscription . $currency["code"]);
?>
 per month</b><b class=newvalue id="totalsubscription"><?php 
echo format_money($totalsubscription . $currency["code"]);
?>
 per month</b></nobr></td>
    </tr>
</table>
Example #3
0
}
if (isset($_REQUEST["group"])) {
    admin_groupwithdrawals();
    header("Location: withdrawals.php");
    exit;
}
if (isset($_REQUEST["f"])) {
    list($rc, $withdrawals) = admin_getwithdrawals($_REQUEST["f"]);
    if ($rc) {
        header("Location: withdrawals.php");
        exit;
    }
    header("Content-type: text/plain");
    foreach ($withdrawals as $withdrawal) {
        $code = ereg_replace("[^A-Z]", "", $withdrawal["amount"]);
        $amount = format_for_entryfield(ereg_replace("[A-Z]", "", $withdrawal["amount"]), $code);
        print "{$withdrawal['email']}\t{$amount}\t{$code}\t{$withdrawal['username']}\n";
    }
    exit;
}
if (isset($_REQUEST["miny"])) {
    $min = "{$_REQUEST['miny']}{$_REQUEST['minm']}{$_REQUEST['mind']}";
    $max = "{$_REQUEST['maxy']}{$_REQUEST['maxm']}{$_REQUEST['maxd']}";
} else {
    $min = date("Ymd");
    $max = false;
}
apply_template("Withdrawals", array(array("name" => "Administration", "href" => "admin.php"), array("name" => "Withdrawals", "href" => "withdrawals.php")));
?>
<h1>Withdrawals</h1>
     // Write the subscription details
     webscr_write_array($subscr_file, $details);
 } else {
     if ($_REQUEST["cmd"] === "_subscr-find") {
         $subscr_file = "{$GLOBALS['DATADIR']}/fake-paypal/subscriptions/" . urlencode($GLOBALS["username"]);
         if (!file_exists($subscr_file)) {
             print "Trying to cancel a non-existent subscription.";
             exit;
         }
         $details = webscr_parse_file($subscr_file);
         unlink($subscr_file);
         // This is for cancelling a subscription.
         $IPN = array("txn_type" => "subscr_cancel", "last_name" => $details["last_name"], "residence_county" => "CA", "mc_currency" => "CAD", "item_name" => $details["item_name"], "business" => $_REQUEST["alias"], "recurring" => "1", "payer_email" => $details["payer_email"], "first_name" => $details["first_name"], "receiver_email" => $_REQUEST["alias"], "item_number" => $details["item_number"], "custom" => $details["custom"], "charset" => "windows-1252", "notify_version" => "2.4", "period3" => $details["period3"], "mc_amount3" => $details["amount"]);
     } else {
         if ($_REQUEST["cmd"] === "_xclick") {
             $IPN = $PDT = array("txn_type" => "web_accept", "payment_date" => date("H:i:s M d, Y T"), "last_name" => "Mann", "residence_county" => "CA", "item_name" => $_REQUEST["item_name"], "payment_gross" => '', "mc_currency" => $_REQUEST["currency_code"], "business" => $_REQUEST["business"], "tax" => format_for_entryfield("0", $currency["code"]), "payer_email" => "*****@*****.**", "txn_id" => $txn_id, "quantity" => "1", "receiver_email" => $_REQUEST["business"], "first_name" => "Richard", "payment_status" => "Cleared", "shipping" => format_for_entryfield("0", $currency["code"]), "mc_gross" => $_REQUEST["amount"], "mc_fee" => format_for_entryfield(max(100, round($_REQUEST["amount"] * 0.05 * $currency["multiplier"])), $currency["code"]), "custom" => $_REQUEST["custom"], "charset" => "windows-1252");
         }
     }
 }
 if (is_array($IPN)) {
     // Save the IPN data into a file.
     @mkdir("{$GLOBALS['DATADIR']}/fake-paypal");
     @mkdir("{$GLOBALS['DATADIR']}/fake-paypal/ipn");
     $ipnfile = tempnam("{$GLOBALS['DATADIR']}/fake-paypal/ipn/", "ipn");
     chmod($ipnfile, 0644);
     webscr_write_array($ipnfile, $IPN);
 }
 if (is_array($PDT)) {
     // Save the PDT data into a file.
     $txfile = "{$GLOBALS['DATADIR']}/fake-paypal/pdt/{$txn_id}";
     @mkdir("{$GLOBALS['DATADIR']}/fake-paypal");
Example #5
0
 foreach ($lines as $line) {
     if (ereg("^([^=]*)=([^=]*)\$", $line, $parts)) {
         $details[urldecode($parts[1])] = urldecode($parts[2]);
     }
 }
 // If this payment isn't due yet, then skip it.
 if (intval($details["due"]) > time()) {
     continue;
 }
 $currency = $currencies[$details["currency"]];
 // Schedule an IPN
 $txn_id = "fake-paypal-" . scrub(microtime());
 @mkdir("{$GLOBALS['DATADIR']}/fake-paypal/ipn");
 $ipnfile = tempnam("{$GLOBALS['DATADIR']}/fake-paypal/ipn/", "ipn");
 chmod($ipnfile, 0644);
 $IPN = array("txn_type" => "subscr_payment", "payment_date" => date("H:i:s M d, Y T"), "subscr_id" => $details["subscr_id"], "last_name" => $details["last_name"], "residence_county" => "CA", "item_name" => $details["item_name"], "payment_gross" => '', "mc_currency" => $details["currency"], "business" => $details["business"], "payer_email" => $details["payer_email"], "txn_id" => $txn_id, "receiver_email" => $details["business"], "first_name" => $details["first_name"], "payment_status" => "Completed", "mc_gross" => $details["amount"], "mc_fee" => format_for_entryfield(max(100, round($details["amount"] * 0.05 * $currency["multiplier"])), $currency["code"]), "custom" => $details["custom"], "charset" => "windows-1252", "notify_version" => 2.4);
 if ($details["delay"] === 'yes') {
     $IPN["payment_status"] = "Pending";
     unset($IPN["mc_fee"]);
     $details["delay"] = 'pending';
 } else {
     if ($details["delay"] === 'pending') {
         $details["delay"] = 'yes';
         $txn_id = $details["txn_id"];
         $IPN["txn_id"] = $txn_id;
     }
 }
 $out = fopen($ipnfile, "w");
 foreach ($IPN as $key => $value) {
     fwrite($out, urlencode($key) . "=" . urlencode($value) . "\n");
 }