コード例 #1
0
ファイル: donator.php プロジェクト: thibmo/hackthis.co.uk
<?php

$custom_css = array('faq.scss');
$custom_js = array('faq.js');
require_once 'init.php';
$donations = new donations($app);
if (isset($_POST['donate'])) {
    $amount = floatval(ltrim($_POST['donate'], "£"));
    $_SESSION['donate_anon'] = isset($_POST['anon']) && $_POST['anon'];
    if ($amount && $amount > 0 && $amount < 10000) {
        $donations->makeTransaction($amount, $_POST['size']);
    }
}
require_once 'header.php';
if (isset($_GET['token']) && isset($_GET['PayerID'])) {
    $status = $donations->confirmPayment($_GET['token'], $_GET['PayerID']);
    if ($status) {
        $app->utils->message('Thank you for your donation, you are awesome!', 'good');
    } else {
        $app->utils->message('Something went wrong');
    }
}
?>
    <h1>Become a Donator</h1>
    In order to support our growth and the costs of maintaining and developing new features, we've added some perks and are offering them as a thank you to those who support us with a small donation:<br/>
    <p>
        <h2 class='no-margin'>£1 or more</h2>
        Get yourself listed on our donator hall of fame.
    </p>
    <p>
        <h2 class='no-margin'>£5 or more</h2>
コード例 #2
0
<?php

require 'donations.php';
//create the new object
$testDonation = new donations();
echo "1. Donation Object Creation: ";
if ($testDonation != null) {
    echo "Passed.<br>\n";
} else {
    echo "Failed.<br>\n";
}
//make sure the database is clear
$testDonation->clearIt();
//add a new entry to the database
$testDonation->sqlInsert("AAA", "AAA", "AAA", "AAA", "AAA", 3, 0);
//test to find entries with ISNEW value 1, should return null
echo "2. Database contains 0 entries ISNEW=1, query for rows ISNEW=1 should return no entries: ";
$returnedRows = $testDonation->rowInfo(1);
if (count($returnedRows) == 0) {
    echo "Passed.<br>\n";
} else {
    echo "Failed.<br>\n";
}
//test to find entries with ISNEW value 0, should return 1 entry
echo "3. Database contains 1 entries ISNEW=1, query for rows ISNEW=1 should return 1 entry: ";
$returnedRows = $testDonation->rowInfo(0);
if (count($returnedRows) == 1) {
    echo "Passed.<br>\n";
} else {
    echo "Failed.<br>\n";
}
コード例 #3
0
ファイル: donateMail.php プロジェクト: TRMassey/ProjectB
     $donorValue = 3;
 }
 if (isset($_POST['produce']) && isset($_POST['perishables'])) {
     $donorValue = 4;
 }
 if (isset($_POST['produce']) && isset($_POST['shelf-stable'])) {
     $donorValue = 5;
 }
 if (isset($_POST['shelf-stable']) && isset($_POST['perishables'])) {
     $donorValue = 6;
 }
 if (isset($_POST['produce']) && isset($_POST['shelf-stable']) && isset($_POST['perishables'])) {
     $donorValue = 6;
 }
 // enter data into database
 $dbEntry = new donations();
 $dbEntry->sqlInsert($donorName, $donorContact, $donorEmail, $donorPhone, $donorDesc, $donorValue, $vendorName, 1);
 // set email subject
 $subject = "Scheduled Pickup Requested";
 // set donation detais
 $donationDetails = "Donation Details:\n" . $donorDesc . "\n\n";
 $donationDetails .= "Donation Type:\n" . $donorType . "\n\n";
 // set donor and vendor messages
 $vendorMessage = "\nTo: " . $vendorEmail . "\nForm: " . $donorEmail . "\n\n";
 $vendorMessage .= $donorContact . " from " . $donorName . " has requested to schedule a pickup.\n\n";
 $vendorMessage .= "Contact Information:\nDonorEmail: " . $donorEmail . "\n";
 $vendorMessage .= "Donor Phone Number: " . $donorPhone . "\n\n" . $donationDetails;
 $donorMessage = "\nTo: " . $donorEmail . "\nFrom: " . $vendorEmail . "\n\n";
 $donorMessage .= "You have requested to schedule a pickup from " . $vendorName . ".\n\n";
 $donorMessage .= "Contact Information:\nDistributor Email: " . $vendorEmail . "\n";
 $donorMessage .= "Phone Number: " . $vendorPhone . "\n\n" . $donationDetails;