Documentation is available at paypal-cancel.php
- <?php
- ################################################################
- # This file is part of SlidingDoors #
- # Copyright 2001-2004. Eric D. Nielsen, All rights reserverd #
- # SlidingDoors is availible for license under the GPL, see #
- # the COPYING file in the root directory of the install for #
- # the full terms of the GPL. #
- # #
- # File: done.php #
- # Author: Eric D. Nielsen #
- # Description: This page allows people to make PayPal
- # payments for their registration
- # Internal Links: index.php #
- # 2002 MITBDT Open DanceSport Competition page #
- # by-school.php #
- # External Links: 2002 MITBDT Open DanceSport Competition page #
- # SlidingDoors information page #
- # Comp-in-a-box information page #
- # OpenImpetus information page #
- # Change Log: 11/05/04 -- created -- edn #
- ################################################################
- // {{{ Top Matter
- include "include_others.inc";
- $display = new HTMLDisplay($db);
- if (isset($_POST["custom"]))
- {
- $incomeID=$_POST["custom"];
- }
- else
- {
- $incomeID = $_GET["custom"];
- }
- if (!isset($SD_payment_email) || $SD_payment_email=="")
- {
- die ("This competition is not accepting PayPal Payments.");
- }
- // }}}
- // {{{ Table Generation
- $query = "SELECT firstname, lastname, paid_amount FROM income NATURAL JOIN income_line_items NATURAL JOIN people_paid NATURAL JOIN people WHERE incomeid=$incomeID ORDER BY lastname, firstname;";
- $result =$db->query($query);
- $confirmTable = "<table><tr><th>Name</th><th>Amount</th></tr>\n";
- $numrows = $result->numrows();
- $total = 0;
- if ($numrows!=0)
- {
- for ($i=0;$i < $numrows;$i++)
- {
- list($first,$last, $amount) = $result->getRowAt($i);
- $total+=$amount;
- $amount=number_format($amount,2);
- $confirmTable.="<tr><td>$last, $first</td><td align=\"right\">\$$amount</td></tr>\n";
- }
- }
- else
- {
- $confirmTable.="<tr><td colspan=\"2\"><i>Error -- payment cancelled reported, but no people included on invoice.";
- }
- if ($SD_absorb_PayPalFee==FALSE)
- {
- $payPalFee = 0.35+0.029*$totalPay;
- $payPalFee=ceil($payPalFee*100)/100;
- $baseTotalPay_s=number_format($totalPay,2);
- $totalPay+=$payPalFee;
- $totalPay_s=number_format($totalPay,2);
- $confirmTable.=<<<END_HTML
- <tr><th align="right">Sub Total</th><th align="right">\$$baseTotalPay_s</th></tr>
- <tr><th align="right">PayPal Fee</th><th align="right">\$$payPalFee</th></tr>
- <tr><th align="right">Total</th><th></th><th align="right">\$$totalPay_s</th></tr>
- END_HTML;}
- else
- {
- $total_s=number_format($total,2);
- $confirmTable.=<<<END_HTML
- <tr><th align="right">Total</th><th align="right">\$$total_s</th></tr>
- END_HTML;
- }
- $query = "DELETE FROM people_paid where itemid in (SELECT itemid FROM income_line_items where incomeid=$incomeID);";
- $db->query($query);
- $query = "DELETE FROM income_line_items WHERE incomeid=$incomeID;";
- $db->query($query);
- $query = "DELETE FROM income_email_details WHERE incomeid=$incomeID;";
- $db->query($query);
- $query = "DELETE FROM income WHERE incomeid=$incomeID;";
- $confirmTable.="</table>\n";
- // }}}
- // {{{ Page Display
- $page = $display->beginPage();
- $page.=$display->instructionBox("PayPal Cancelled",
- "
- <p>
- PayPal reports that you have <b>canceled</b> your on-line payment. We have
- deleted the pending records. You will need to either pay by check or
- restart the PayPal process, by retrieving your registration from the <a href=\"/\">Registation Home Page</a>.
- </p>
- <p>
- For your records, this <b>cancelled transaction</b> would have covered:
- </p>
- $confirmTable
- <p>
- Your registration <b>is not complete</b> until payment is received.
- We look forward to seeing you at the competition.
- You can either browse the <a href=\"../../stats/$unixname/\">event registrations</a>
- or check for other <a href=\"../../../\">open events</a> or simply close the browser.
- </p>
- ");
- $page .= $display->sectionBreak();
- $page .= $display->compinaboxBox();
- $page .= $display->endPage();
- echo $page;
- // }}}
- ?>
Documentation generated on Tue, 25 Apr 2006 13:06:54 -0400 by phpDocumentor 1.3.0RC3