Example #1
0
checkerr(ff_setsponsorship($E, $sponsor5, "111EUR"));
checkerr(ff_setsponsorship($E, $sponsor6, "450USD"));
checkerr(ff_setsponsorship($E, $sponsor7, "11538USD"));
checkerr(ff_setsponsorship($E, $sponsor8, "7191USD"));
checkerr(ff_setsponsorship($E, $sponsor9, "3854USD"));
checkerr(ff_setsponsorship($E, $sponsor10, "67USD"));
// Create a subproject
list($rc, $F) = ff_createproject($sponsor1, "F-{$now}", "This project is for testing purposes only.  " . "Do not submit a solution unless you are a test script.", $E);
checkerr($rc, $F);
// Allot funds to the subproject
checkerr(ff_setallotment($sponsor1, $E, $F, 700));
// Create a submission
list($rc, $sub_F1) = ff_submitcode($developer, array(array("pathname" => realpath("./test-payout.php"), "filename" => "test-payout.php", "description" => "")), "", $F);
checkerr($rc, $sub_F1);
// Accept the submission
checkerr(ff_acceptsubmission($sponsor1, $sub_F1));
// Set the payout time to be immediately and execute the payout.
checkerr(admin_expedite_payout($F));
/*
// Set up a monthly sponsorship
checkerr(ff_setsubscription($sponsor,"1000FFC","monthly",
    array($A => "100FFC", $D => "50000FFC")));

// Receive the first monthly sponsorship payment
checkerr(ff_receivefunds( $sponsor, "950FFC", "$now-1", "50FFC",
    true, "Sponsor $now", "sponsor-$now@gignac.org", "CA", "N9H 2E5"));

// Send a repeat payment event
$rc = ff_receivefunds( $sponsor, "950FFC", "$now-1", "50FFC",
    true, "Sponsor $now", "sponsor-$now@gignac.org", "CA", "N9H 2E5");
if( $rc[0] != 7) checkerr(1,"Expected error 7, got: $rc[0] $rc[1]");
Copyright 2008 John-Paul Gignac

This file is part of Fossfactory-src.

Fossfactory-src is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Fossfactory-src is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Fossfactory-src.  If not, see <http://www.gnu.org/licenses/>.
*/
$id = scrub($_REQUEST['id']);
$submissionid = intval($_REQUEST['submissionid']);
$accept = scrub($_REQUEST['accept']);
if ($accept == 'true') {
    list($rc, $err) = ff_acceptsubmission($username, $submissionid);
} elseif ($accept == 'false') {
    list($rc, $err) = ff_rejectsubmission($username, $submissionid, $_REQUEST["rejectreason"], 0);
} elseif ($accept == 'prejudice') {
    list($rc, $err) = ff_rejectsubmission($username, $submissionid, '', 1);
}
header("Location: " . projurl($id, "tab=submissions"));
?>