function prepareBountyProPage($dbh, $bountyID) { // for discover, the template array must contain // 1) the username // 2) the email of the username // 3) the top 10 bounties $template_array = array("username" => $_SESSION['userLogin'], "email" => $_SESSION['email'], "bountyID" => $bountyID); $args[":bountyID"] = $bountyID; $template_array['bounty'] = getBountyFromBountyID($dbh, $args); $template_array['bounty']['id'] = $bountyID; $args[':username'] = $_SESSION['userLogin']; $template_array['submittedReports'] = getReportsFromUsernameBountyID($dbh, $args); $currentDate = date("Y") . date("m") . date("d"); $bountyDate = $template_array['bounty']['result']['dateEnding']; $bountyDate = substr($bountyDate, 0, 4) . substr($bountyDate, 5, 2) . substr($bountyDate, 8); // echo "<br>".substr($bountyDate, 5, 7)."<br>"; // echo $bountyDate; $idk = $bountyDate < $currentDate; if ($currentDate < $bountyDate) { $template_array['bounty']['expired'] = 0; } else { $template_array['bounty']['expired'] = 1; } return $template_array; }
function prepareTrackPage($dbh, $bountyID) { $template_array['company'] = $company; $args[':bountyID'] = $bountyID; $template_array['bounty'] = getBountyFromBountyID($dbh, $args); $template_array['submittedReports'] = getReportsFromBountyID($dbh, $args); //$template_array['reports'] = getReportsFromBountyID($dbh, $args); $template_array['numReports'] = sizeof($template_array['submittedReports']['result']); return $template_array; }
function prepareHuntpage($dbh, $bountyID) { // for Hunt, the template array must contain // 1) the username // 2) the email of the username // 3) the bounty link // 4) the bounty name // 5) the bounty owner $args[':bountyID'] = $bountyID; $template_array = getBountyFromBountyID($dbh, $args); $template_array["username"] = $_SESSION['userLogin']; $template_array["email"] = $_SESSION['email']; // $template_array= array( // 'id' => $bountyID, // 'name' => '', // 'ownder' => '', // 'bountyLink' => "http://www.soccernet.com" // ); //call for bounty link, name, ownder return $template_array; }
Michael Gilbert getPreferredBounties gets all the reports from the preferred reports table Error Codes: 1: no statement executed Returns array of preferred bounties complete */ $app->get('/api/getPreferredBounties', function () use($dbh) { echo json_encode(getPreferredBounties($dbh)); }); $app->get('/api/getBountyFromBountyID/:bountyID', function ($bountyID) use($dbh) { $args[":bountyID"] = $bountyID; echo json_encode(getBountyFromBountyID($dbh, $args)); // }); $app->get('/api/getClientToken', function () use($dbh) { //$clientToken = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI0YzBlYTU0YjJhZTdkNzkzN2ZiMWFkZTM0ZjYxMTQ4NWI4ZjAwNDhjMTcxNDhhM2MyOTM1YTJjYmE5Y2ZiN2Y0fGNyZWF0ZWRfYXQ9MjAxNS0xMi0xNFQwNDo1NDo0MS4wNzYwMDUyNTMrMDAwMFx1MDAyNm1lcmNoYW50X2lkPWhwYnFwMzU3anRtMnY2a3RcdTAwMjZwdWJsaWNfa2V5PWs4NnJzdnNzeDhmMnc1NjQiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvaHBicXAzNTdqdG0ydjZrdC9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5LmNvbTo0NDMvbWVyY2hhbnRzL2hwYnFwMzU3anRtMnY2a3QvY2xpZW50X2FwaSIsImFzc2V0c1VybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXV0aFVybCI6Imh0dHBzOi8vYXV0aC52ZW5tby5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIiwiYW5hbHl0aWNzIjp7InVybCI6Imh0dHBzOi8vY2xpZW50LWFuYWx5dGljcy5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tIn0sInRocmVlRFNlY3VyZUVuYWJsZWQiOmZhbHNlLCJwYXlwYWxFbmFibGVkIjp0cnVlLCJwYXlwYWwiOnsiZGlzcGxheU5hbWUiOiJTTVUiLCJjbGllbnRJZCI6bnVsbCwicHJpdmFjeVVybCI6Imh0dHA6Ly9leGFtcGxlLmNvbS9wcCIsInVzZXJBZ3JlZW1lbnRVcmwiOiJodHRwOi8vZXhhbXBsZS5jb20vdG9zIiwiYmFzZVVybCI6Imh0dHBzOi8vYXNzZXRzLmJyYWludHJlZWdhdGV3YXkuY29tIiwiYXNzZXRzVXJsIjoiaHR0cHM6Ly9jaGVja291dC5wYXlwYWwuY29tIiwiZGlyZWN0QmFzZVVybCI6bnVsbCwiYWxsb3dIdHRwIjp0cnVlLCJlbnZpcm9ubWVudE5vTmV0d29yayI6dHJ1ZSwiZW52aXJvbm1lbnQiOiJvZmZsaW5lIiwidW52ZXR0ZWRNZXJjaGFudCI6ZmFsc2UsImJyYWludHJlZUNsaWVudElkIjoibWFzdGVyY2xpZW50MyIsImJpbGxpbmdBZ3JlZW1lbnRzRW5hYmxlZCI6bnVsbCwibWVyY2hhbnRBY2NvdW50SWQiOiJzbXUiLCJjdXJyZW5jeUlzb0NvZGUiOiJVU0QifSwiY29pbmJhc2VFbmFibGVkIjpmYWxzZSwibWVyY2hhbnRJZCI6ImhwYnFwMzU3anRtMnY2a3QiLCJ2ZW5tbyI6Im9mZiJ9"; // Braintree_Configuration::environment('sandbox'); // Braintree_Configuration::merchantId('hpbqp357jtm2v6kt'); // Braintree_Configuration::publicKey('k86rsvssx8f2w564'); // Braintree_Configuration::privateKey('9c4a739428d609d7973f5002a5c67d40'); $clientToken = ''; try { $clientToken = Braintree_ClientToken::generate(); } catch (Braintree_Exception_Configuration $e) { $clientToken = $e; } echo json_encode($clientToken);