Advertisement
Guest User

Untitled

a guest
Sep 28th, 2017
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 22.73 KB | None | 0 0
  1. <?php
  2. session_start(); // start up PHP session to retrieve from variables from previous pages!
  3.  
  4. $vapis=0;
  5.  
  6. if($_POST['workshopname']==""){
  7.     $_SESSION["wserr"]=1;
  8.     $vaipis=1;
  9. }else{
  10.     $_SESSION["wserrv"]=$_POST['workshopname'];
  11.     $_SESSION["wserr"]=0;
  12. }  
  13.  
  14. if($_POST['date']==""){
  15.     $_SESSION["daterr"]=1;
  16.     $vaipis=1;
  17. }else{
  18.     $_SESSION["daterrv"]=$_POST['date'];
  19.     $_SESSION["daterr"]=0;
  20. }  
  21.  
  22. if($_POST['location']==""){
  23.     $_SESSION["locerr"]=1; 
  24.     $vaipis=1;
  25. }else{
  26.     $_SESSION["locerrv"]=$_POST['location'];
  27.     $_SESSION["locerr"]=0; 
  28. }
  29.  
  30. if($_POST['name']==""){
  31.     $_SESSION["namerr"]=1;
  32.     $vaipis=1;
  33. }else{
  34.     $_SESSION["namerrv"]=$_POST['name'];
  35.     $_SESSION["namerr"]=0;
  36. }
  37.  
  38. if($_POST['organisation']==""){
  39.    
  40. }else{
  41.     $_SESSION["organisation"]=$_POST['organisation'];
  42. }
  43.  
  44.  
  45. if($_POST['email']==""){
  46.     $_SESSION["emailerr"]=1;
  47.     $vaipis=1;
  48. }else{
  49.     $_SESSION["emailerrv"]=$_POST['email'];
  50.     $_SESSION["emailerr"]=0;
  51. }
  52.  
  53. if($_POST['phone']==""){
  54.     $_SESSION["phonerr"]=1;
  55.     $vaipis=1;
  56. }else{
  57.     $_SESSION["phonerrv"]=$_POST['phone'];
  58.     $_SESSION["phonerr"]=0;
  59. }
  60.  
  61. if($_POST['postal1']==""){
  62.     $_SESSION["p1err"]=1;
  63.     $vaipis=1;
  64. }else{
  65.     $_SESSION["p1errv"]=$_POST['postal1'];
  66.     $_SESSION["p1err"]=0;
  67. }
  68.  
  69. if($vapis==1){
  70.     //header("location:workshop-registration.php");
  71.     exit(0);
  72. }
  73.  
  74. if($_POST['attendee1']==""){
  75.     $_SESSION["a1err"]=1;
  76.     header("location:workshop-registration.php");
  77. }else{
  78.     $_SESSION["a1errv"]=$_POST['attendee1'];
  79.     $_SESSION["a1err"]=0;
  80. }
  81.  
  82. if(!isset($_POST['acceptterms'])){
  83.     $_SESSION["accterm"]=1;
  84.     header("location:workshop-registration.php");
  85. }
  86.  
  87. $_SESSION['date'] = $_POST['date'];
  88. $_SESSION['name'] = $_POST['name'];
  89. $_SESSION['organisation'] = $_POST['organisation'];
  90. $_SESSION['workshopnamefull'] = $_POST['workshopnamefull'];
  91. $_SESSION['invoice_id'] = $invoice_id;
  92. $_SESSION['totalattending'] = $_POST['attendeecount'];
  93. $totalatt=$_POST['attendeecount'];
  94. $_SESSION['costextax'] = $_POST['costextax'];
  95. $_SESSION['gstcost'] = $_POST['gstcost'];
  96. $_SESSION['totalcost2'] = $_POST['totalcost2'];
  97.    
  98.            
  99. if (isset($_POST['btnProcess'])){
  100.     // attempt to connect to database and insert next unique record and retrieve as the next invoice number
  101.     $hostname="localhost";
  102.     $user="lili2764_literh";
  103.     $pass="kWHRR5g";
  104.     $database="lili2764_literh_db";
  105.     $connection = mysqli_connect($hostname, $user, $pass) or die ("Unable to connect!");
  106.     mysqli_select_db($connection, $database) or die(mysqli_errno($connection) . ": " . mysqli_error($connection) . "<br>");
  107.  
  108.     // Returns next value for an invoice, taken from a table with a single auto-incremented field.
  109.     function get_next_counter($invoicesoutstanding) {
  110.         // Insert new row, auto-incrementing counter, get inserted value which is the next id to use.
  111.         $rc = mysqli_query($connection, 'INSERT INTO '.$invoicesoutstanding.' VALUES ((NULL), NOW())');
  112.         if($rc === false)
  113.             die('MySQL error: '.mysqli_error($connection));
  114.         $next_counter = mysqli_insert_id($connection);
  115.         return $next_counter;                  
  116.     }          
  117.    
  118.     $invoice_id = get_next_counter('invoicesoutstanding');     
  119.            
  120.     // set up session variables for retrieval at later pages (eg. invoice display)
  121.     $_SESSION['date'] = $_POST['date'];
  122.     $_SESSION['name'] = $_POST['name'];
  123.     $_SESSION['organisation'] = $_POST['organisation'];
  124.     $_SESSION['workshopnamefull'] = $_POST['workshopnamefull'];
  125.     $_SESSION['invoice_id'] = $invoice_id;
  126.     $_SESSION['totalattending'] = $_POST['attendeecount'];
  127.     $totalatt=$_POST['attendeecount'];
  128.     $_SESSION['costextax'] = $_POST['costextax'];
  129.     $_SESSION['gstcost'] = $_POST['gstcost'];
  130.     $_SESSION['totalcost2'] = $_POST['totalcost2'];
  131.  
  132.  
  133.  
  134.     // Assign a cost to the selected workshop
  135.     $workshopname = $_POST['workshopname'];
  136.    
  137.     if (($workshopname == 'prep') || ($workshopname == 'intervention-strategies') || ($workshopname == 'six-traits') || ($workshopname == 'blp1-6') || ($workshopname == 'rtc3-6')) {
  138.         $workshopcost = '275';     
  139.     }
  140.     elseif (($workshopname == 'literacy-apps') || ($workshopname == 'guidedreading') || ($workshopname == 'literacy-blocks') || ($workshopname == 'readingstamina')) {
  141.         $workshopcost = '85';      
  142.     }
  143.     elseif (($workshopname == 'aides') || ($workshopname == 'aides-r')) {
  144.         $workshopcost = '195';     
  145.     }  
  146.    
  147.  
  148.     // Retrive field variable from form and removed slashes added by PHP - eg. for apostrophes in words
  149.     $workshopdate = $_POST['date'];
  150.    
  151.     if($workshopdate==""){
  152.         $_SESSION["daterr"]=1;
  153.         echo $_SESSION["daterr"];
  154.         header("location:workshop-registration.php");
  155.     }  
  156.    
  157.     $organisation = stripslashes($_POST['organisation']);
  158.     $postal1 = stripslashes($_POST['postal1']);
  159.  
  160.     for($i=1;$i<=$_POST['attendeecount'];$i++)
  161.     {
  162.         $var="attendee".$i;
  163.         $attendeename[$i-1] = stripslashes($_POST[$var]);
  164.     }
  165.  
  166.     // Some slashes still appearing in workshop-registration-4.php - run stripslashes again. Not sure of a more efficient way to do this?
  167.     $organisation = stripslashes($organisation);
  168.     $postal1 = stripslashes($postal1);
  169.  
  170.     // Assign full name to selected workshop
  171.     if ($workshopname == 'prep') {
  172.         $workshopnamefull = 'Prep Reading and Writing';
  173.     }
  174.     if ($workshopname == 'intervention-strategies') {
  175.         $workshopnamefull = 'Intervention Strategies'; 
  176.     }
  177.     if ($workshopname == 'six-traits') {
  178.         $workshopnamefull = 'The Six Traits of Writing';   
  179.     }
  180.     if ($workshopname == 'rtc3-6') {
  181.         $workshopnamefull = 'Reciprocal Teaching and Comprehension Strategies';
  182.     }          
  183.     if ($workshopname == 'blp1-6') {
  184.         $workshopnamefull = 'A Balanced Literacy Program'; 
  185.     }
  186.     if ($workshopname == 'aides') {
  187.         $workshopnamefull = 'Teachers Aides Literacy Workshop';
  188.     }
  189.     if ($workshopname == 'guidedreading') {
  190.         $workshopnamefull = 'Guided Reading';  
  191.     }
  192.     if ($workshopname == 'literacy-apps') {
  193.         $workshopnamefull = 'Meaningful Apps for Teaching Literacy';   
  194.     }                  
  195.     if ($workshopname == 'literacy-blocks') {
  196.         $workshopnamefull = 'Teaching Approaches: Reading and Writing (incl. Literacy Block)'; 
  197.     }      
  198.     if ($workshopname == 'readingstamina') {
  199.         $workshopnamefull = 'Reading Stamina'; 
  200.     }                          
  201.  
  202.     // Determine how many people have been registered
  203.     $totalattending=0;
  204.     for($i=1;$i<=$_POST['attendeecount'];$i++)
  205.     {
  206.         $var="attendee".$i;
  207.         if($attendeename[$i-1]!="")
  208.         {
  209.             $totalattending++;
  210.         }
  211.     }
  212.  
  213.  
  214.     // work out total cost of registrations including GST (note totalcost has a different variable name when formated due to an unknown error when using 5 people for full-day w'shop
  215.     $totalcost1 = $totalattending * $workshopcost * 110 / 100;
  216.     $totalcost2 = number_format($totalcost1,2);
  217.     $costextax = $totalattending * $workshopcost;
  218.     $gstcost = $totalcost1 / 11;
  219.  
  220.     // GST set to 0 for non Australian locations
  221.     if (($location == 'Auckland') || ($location == 'Wellington')) {
  222.                             $gstcost = '0';    
  223.                             $totalcost = $totalattending * $workshopcost;
  224.                             //$totalcost2 = $totalcost2 / 11 * 10;
  225.                             $totalcost2 = number_format($totalcost,2);
  226.                         }
  227.  
  228.     $costextax = number_format($costextax,2);
  229.     $gstcost = number_format($gstcost,2);                  
  230.                
  231.                
  232.     // Amount for transfer to eway for processing - remove cents - eway payment system can't handle cents? code removed as live process does handle cents but not test.        
  233.     // $roundoff = explode(".", $totalcost1);
  234.     // $txtAmount = $roundoff[0].".00";
  235.     // $txtAmount = $txtAmount * 100;
  236.  
  237.     // Amount sent to eway payment gateway (no decimal point)
  238.     $txtAmount = $totalcost1 * 100;
  239.                            
  240.  
  241.     // additional session variables for retrieval at later pages (eg. invoice display)
  242.     $_SESSION['organisation'] = stripslashes($_POST['organisation']);
  243.     $_SESSION['postal1'] = stripslashes($_POST['postal1']);
  244.  
  245.     for($i=1;$i<=$_POST['attendeecount'];$i++)
  246.     {
  247.         $vars="attendee".$i."name";
  248.         $_SESSION[$var]=stripslashes($attendeename[$i-1]);
  249.     }
  250.  
  251.     // Some slashes still appearing in workshop-registration-4.php - run stripslashes again. Not sure of a more efficient way to do this?
  252.     $_SESSION['organisation'] = stripslashes($_SESSION['organisation']);
  253.     $_SESSION['postal1'] = stripslashes($_SESSION['postal1']);                                 
  254.  
  255.      
  256.     /**************** Send confirmation email to Litsol, Cassie and client.  **********************/
  257.     /* See mailer-registration.php file in scripts folder for fully commented script.
  258.     /*  EMAIL VALIDATION */  
  259.     if(!isset($_SERVER['HTTP_USER_AGENT'])){
  260.        die("Forbidden - You are not authorized to view this page");
  261.        exit;
  262.     }
  263.     if(!$_SERVER['REQUEST_METHOD'] == "POST"){
  264.        die("Forbidden - You are not authorized to view this page");
  265.        exit;    
  266.     }
  267.     $authHosts = array("literacysolutions.com.au");
  268.     $fromArray = parse_url(strtolower($_SERVER['HTTP_REFERER']));
  269.     $wwwUsed = strpos($fromArray['host'], "www.");
  270.     if(!in_array(($wwwUsed === false ? $fromArray['host'] : substr(stristr($fromArray['host'], '.'), 1)), $authHosts)){    
  271.        header("HTTP/1.0 403 Forbidden");
  272.        exit;    
  273.     }
  274.     $badStrings = array("content-type:",
  275.                          "mime-version:",
  276.                          "content-transfer-encoding:",
  277.                          "bcc:",
  278.                          "to:",
  279.                          "cc:");
  280.     foreach($_POST as $k => $v){
  281.        foreach($badStrings as $v2){
  282.            $v = strtolower($v);
  283.            if(strpos($v, $v2) !== false){
  284.                 header("HTTP/1.0 403 Forbidden");
  285.                exit;
  286.            }
  287.        }
  288.     }    
  289.     unset($k, $v, $v2, $badStrings, $authHosts, $fromArray, $wwwUsed);
  290.     /* END EMAIL VALIDATION */
  291.  
  292.     $sendTo = "info@literacysolutions.com.au";
  293.     $subject = "Workshop Registration & Tax Invoice - Payment Required";
  294.     $headers = "From: " . $_POST["litsolname"] ." ". "<" . $_POST["litsolemail"] .">\r\n";
  295.     $headers .= "Reply-To: " . $_POST["litsolemail"] . "\r\n";
  296.     $headers .= "Cc: cassie@literacysolutions.com.au, " . $_POST["email"] . "\r\n";
  297.     $headers .= "Return-path: " . $_POST["email"];
  298.  
  299.     // Following code necessary to remove multiple added slashes on apostropes in names. more added at each form page.  Find more efficient way to do this.
  300.     $name = stripslashes($name);
  301.     $name = stripslashes($name);
  302.     $name = stripslashes($name);
  303.     $name = stripslashes($name);
  304.     $organisation = stripslashes($organisation);
  305.     $organisation = stripslashes($organisation);
  306.     $organisation = stripslashes($organisation);
  307.     $organisation = stripslashes($organisation);
  308.     $postal1 = stripslashes($postal1);
  309.     $postal1 = stripslashes($postal1);
  310.     $postal1 = stripslashes($postal1);
  311.     $postal1 = stripslashes($postal1);
  312.     $instructions = stripslashes($instructions);
  313.     $instructions = stripslashes($instructions);
  314.     $instructions = stripslashes($instructions);
  315.     $instructions = stripslashes($instructions);
  316.  
  317.     if (!empty($organisation)) {                           
  318.         $to = $organisation;                                                                     
  319.     }                              
  320.     else {$to = $name;
  321.     }  
  322.  
  323.     $message =
  324.     "------ WORKSHOP REGISTRATION -----\r\n".
  325.     "\r\nThank you, literacy workshop registration details have been received as detailed below.\r\n".
  326.     "     ------------------------------------\r\n".
  327.     "Location: ". $_POST["location"] ."\r\n".
  328.     "Workshop: ". $_SESSION["workshopnamefull"] ."\r\n".
  329.     "     ------------------------------------\r\n".
  330.     "Date: ". $_POST["date"] ."\r\n".
  331.     "     ------------------------------------\r\n".
  332.     "Name: ". $name ."\r\n".
  333.     "School: ". $organisation ."\r\n".
  334.     "Email: ". $_POST["email"] ."\r\n".
  335.     "Phone: ". $_POST["phone"] ."\r\n".
  336.     "Address: ". $postal1 ."\r\n".
  337.     "     ------------------------------------\r\n";
  338. /*
  339.     for($i=1;$i<=$_POST['attendeecount'];$i++)
  340.     {
  341.         $stringaman=stripslashes(trim(implode("",explode("\\",$attendeename[$i-1]))));
  342.         $message=$message."Attendee $i: ".stripslashes($stringaman)."\r\n";
  343.     }
  344. */
  345.     $ic=1;
  346.     for($i=1;$i<=$_POST['attendeecount'];$i++)
  347.     {
  348.         $stringaman=stripslashes(trim(implode("",explode("\\",$attendeename[$i-1]))));
  349.         if($stringaman!=""){
  350.             $message=$message."Attendee $ic: ".stripslashes($stringaman)."\r\n";
  351.             $ic++;         
  352.         }
  353.     }
  354.     $message=$message."     ------------------------------------\r\n".
  355.     "Instructions:\r\n".
  356.     $instructions ."\r\n".
  357.     "     ------------------------------------\r\n".
  358.     "Note:\r\n".
  359.     "Full-day workshops commence at 8:45am and finish at 2:45pm.\r\n".
  360.     "After school workshops commence at 3:30pm and finish at 5:15pm.\r\n".
  361.     "\r\n".
  362.     "Please see our website at http://www.literacysolutions.com.au/workshops/ for workshop venues and further details. Should you have any questions, feel free to contact us at info@literacysolutions.com.au.\r\n".
  363.     "\r\n".
  364.     "Cancellations\r\n".
  365.     "As part of your registration, you accepted the Term and Conditions of registration which in part state:\r\n".
  366.     "Cancellations received 20 business days or more prior to the workshop date incur a 10% charge per registration to cover administration costs. Cancellations received less than 20 business days, but more than five business days prior to the workshop, incur a 50% charge per registration to cover administration, catering and facility costs. Cancellations received five business days or less before a workshop are non refundable or if payment is yet to be made, the full cost of the course is payable.\r\n".
  367.     "----------------------------------------------\r\n".
  368.     "----------------------------------------------\r\n".
  369.     "\r\n".
  370.     "\r\n".
  371.     "\r\n".
  372.     "----------------- TAX INVOICE ----------------\r\n\r\n".
  373.     "Invoice number: " . $invoice_id . "\r\n".
  374.     "Date: " . Date('l d F Y') . "\r\n".
  375.     "To: " . $to . "\r\n".
  376.     "Address: ". $postal1 ."\r\n".
  377.     "\r\n".
  378.     "Registration Details\r\n".
  379.     "Registration (x". $totalattending . ") for " . $workshopnamefull . "\r\n$" . $costextax . "\r\n".
  380.     "GST: $" . $_SESSION["gstcost"] . "\r\n".
  381.     "Total paid: $0.00\r\n".
  382.     "Balance due: $" . $_SESSION["totalcost2"] . "\r\n".
  383.     "     ------------------------------------\r\n".
  384.     "Literacy Solutions Pty Ltd\r\n".
  385.     "PO Box 1350\r\n".
  386.     "Carindale Qld 4152\r\n".
  387.     "Telephone: (07) 3901 8373\r\n".
  388.     "Mobile: 0412 401 676\r\n".
  389.     "Fax: (07) 3324 1322\r\n".
  390.     "Email: cassie@literacysolutions.com.au\r\n".
  391.     "ABN: 75 603 254 066\r\n".
  392.     "www.literacysolutions.com.au\r\n".
  393.     "----------------------------------------------\r\n".
  394.     "----------------------------------------------\r\n".
  395.     "Payments can be made by cheque or EFT.\r\n".
  396.     "Account name: Literacy Solutions\r\n".
  397.     "BSB: 638060\r\n".
  398.     "Account: 13542028\r\n".
  399.     "\r\n".
  400.     "\r\n".
  401.     "\r\n".
  402.     "\r\n".
  403.     "\r\n".
  404.     "\r\n".
  405.     "Marketing stream:"."\r\n".
  406.     "    Flyer faxed: ". $_POST["flyerfaxed"] ."\r\n".
  407.     "   Flyer mailed: ". $_POST["flyermailed"] ."\r\n".
  408.     "       Brochure: ". $_POST["brochure"] ."\r\n".
  409.     "  Advertisement: ". $_POST["advertisement"] ."\r\n".
  410.     "Email to school: ". $_POST["emailschool"] ."\r\n".
  411.     "   Email direct: ". $_POST["emailtoyou"] ."\r\n".
  412.     "  Search engine: ". $_POST["searchengine"] ."\r\n".
  413.     "      Editorial: ". $_POST["editorial"] ."\r\n".
  414.     "  Word of mouth: ". $_POST["wordofmouth"] ."\r\n".
  415.     "      Dont know: ". $_POST["dontknow"] ."\r\n";
  416.     //mail($sendTo, $subject, $message, $headers);
  417.     header("location:http://www.literacysolutions.com.au/workshops/workshop-registration-3a.php");
  418.     /**************** END confirmation email.  **********************/      
  419.    
  420. }else{
  421. ?>
  422. <!DOCTYPE html>
  423. <html>
  424. <head>
  425.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  426.     <title>Payment options: Literacy Solutions</title>
  427.     <?php include("../includes/head-code.htm"); ?>
  428.     <script src="/scripts/forms.js" type="text/javascript"></script>               
  429. </head>
  430.  
  431. <body id="workshops">
  432. <?php include("../includes/header.htm");
  433. ?>
  434.  
  435. <div id="content">
  436.     <div id="mainContent" class="fullWidth">
  437.         <article class="topContent">        
  438.             <h1>Payment options</h1>  
  439.             <div id="formsteps"><div><strong>STEP 1</strong><br />Registration details</div><div class="formstepselected"><strong>STEP 2</strong><br />Payment options</div><div><strong>STEP 3</strong><br />Make payment</div><div><strong>STEP 4</strong><br />Invoice</div></div>          
  440.                
  441.             <!--<div class="simple"> -->       
  442.                 <form name="registrationform" id="longform" title="registration" method="post" action="https://www.literacysolutions.com.au/workshops/workshop-registration-3.php">          
  443.                     <?php
  444.                     // Put all previous page form parameteres into a hidden field for passing on to next page
  445.                     foreach ($_POST as $key => $val) {
  446.                       echo '<input type="hidden" name="' . $key . '" value="'
  447.                         . htmlentities($val, ENT_QUOTES) . '" />' . "\r\n";
  448.                     }
  449.                                    
  450.                     $workshopdate = $_POST['date'];
  451.                     $location = $_POST['location'];
  452.                    
  453.                     $_SESSION['date'] = $_POST['date'];
  454.                     $_SESSION['name'] = $_POST['name'];
  455.                     $_SESSION['organisation'] = $_POST['organisation'];
  456.                     $_SESSION['workshopnamefull'] = $_POST['workshopnamefull'];
  457.                     $_SESSION['invoice_id'] = $invoice_id;
  458.                     $_SESSION['totalattending'] = $_POST['attendeecount'];
  459.                     $totalatt=$_POST['attendeecount'];
  460.                     $_SESSION['costextax'] = $_POST['costextax'];
  461.                     $_SESSION['gstcost'] = $_POST['gstcost'];
  462.                     $_SESSION['totalcost2'] = $_POST['totalcost2'];
  463.                     $totalattending=0;
  464.                     for($i=1;$i<=$_POST['attendeecount'];$i++)
  465.                     {
  466.                         $var="attendee".$i;
  467.                         if($_POST[$var]!="")
  468.                         {
  469.                             $totalattending++;
  470.                         }
  471.                     }
  472.    
  473.                     // Assign a cost to the selected workshop
  474.                     if (($workshopname == 'prep') || ($workshopname == 'intervention-strategies') || ($workshopname == 'six-traits') || ($workshopname == 'blp1-6') || ($workshopname == 'rtc3-6')) {
  475.                         $workshopcost = '275';     
  476.                     }
  477.                     elseif (($workshopname == 'literacy-apps') || ($workshopname == 'guidedreading') || ($workshopname == 'literacy-blocks') || ($workshopname == 'readingstamina')) {
  478.                         $workshopcost = '85';      
  479.                     }
  480.                     elseif (($workshopname == 'aides') || ($workshopname == 'aides-r')) {
  481.                         $workshopcost = '195';     
  482.                     }  
  483.                    
  484.                    
  485.                     // Assign full name to selected workshop
  486.                     if ($workshopname == 'prep') {
  487.                         $workshopnamefull = 'Prep Reading and Writing';
  488.                     }
  489.                     if ($workshopname == 'intervention-strategies') {
  490.                         $workshopnamefull = 'Intervention Strategies'; 
  491.                     }
  492.                     if ($workshopname == 'six-traits') {
  493.                         $workshopnamefull = 'The Six Traits of Writing';   
  494.                     }
  495.                     if ($workshopname == 'rtc3-6') {
  496.                         $workshopnamefull = 'Reciprocal Teaching and Comprehension Strategies';
  497.                     }          
  498.                     if ($workshopname == 'blp1-6') {
  499.                         $workshopnamefull = 'A Balanced Literacy Program'; 
  500.                     }
  501.                     if ($workshopname == 'aides') {
  502.                         $workshopnamefull = 'Teachers Aides Literacy Workshop';
  503.                     }
  504.                     if ($workshopname == 'guidedreading') {
  505.                         $workshopnamefull = 'Guided Reading';  
  506.                     }
  507.                     if ($workshopname == 'literacy-apps') {
  508.                         $workshopnamefull = 'Meaningful Apps for Teaching Literacy';   
  509.                     }                  
  510.                     if ($workshopname == 'literacy-blocks') {
  511.                         $workshopnamefull = 'Teaching Approaches: Reading and Writing (incl. Literacy Block)'; 
  512.                     }      
  513.                     if ($workshopname == 'readingstamina') {
  514.                         $workshopnamefull = 'Reading Stamina'; 
  515.                     }                                                                                                  
  516.                    
  517.                     // change language depending on number of registrations submitted
  518.                     if ($totalattending > 1) {
  519.                         $personpeople = 'people';
  520.                     }
  521.                     else {$personpeople = 'person';
  522.                     }
  523.                    
  524.                     // work out total cost of registrations including GST
  525.                     $costextax = $totalattending * $workshopcost;
  526.                     $totalcost = $totalattending * $workshopcost * 110 / 100;
  527.                     $gstcost = $totalcost - $costextax;
  528.                    
  529.                     // GST set to 0 for non Australian locations
  530.                     if (($location == 'Auckland') || ($location == 'Wellington')) {
  531.                         $gstcost = '0';    
  532.                         $totalcost = $totalattending * $workshopcost;
  533.                     }
  534.            
  535.                    
  536.                     $costextax = number_format($costextax,2);
  537.                     $totalcost = number_format($totalcost,2);
  538.                     $gstcost = number_format($gstcost,2);
  539.                    
  540.                     $_SESSION['gstcost'] = $gstcost;
  541.                     $_SESSION['totalcost2'] = $totalcost;
  542.                     //$_SESSION['totalcost2'] = number_format($totalcost,2);
  543.                    
  544.                    
  545.                     echo "<p>You are about to register <strong>" . $totalattending . "</strong> " . $personpeople . " to attend:</p>
  546.                     <p><strong><cite>" .  $workshopnamefull . "</cite> (" . $location . ") on " . $workshopdate . ".</strong></p>              
  547.                    <p>To confirm this booking you will need to make your payment. The total cost including GST (where applicable) is <strong>$" . $totalcost . "</strong>.</p>";
  548.                     ?>  
  549.                                                                        
  550.                     <input type="hidden" name="workshopnamefull" id="workshopnamefull" value="<?php echo $workshopnamefull; ?>" />
  551.                     <div class="input alignleft">
  552.                         <input type="submit" class="submit" value="Pay Now by Credit Card" />                
  553.                     </div>
  554.                 </form>          
  555.                
  556.                 <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OR</p>
  557.                
  558.                 <form name="offline-payment" id="offline-payment" title="offline-payment" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ENCTYPE="multipart/form-data">          
  559.                     <?php
  560.                     // Put all previous page form parameters into a hidden field for passing on to next page
  561.                     foreach ($_POST as $key => $val) {
  562.                       echo '<input type="hidden" name="' . $key . '" value="'
  563.                         . htmlentities($val, ENT_QUOTES) . '" />' . "\r\n";
  564.                     }                  
  565.                     ?>                                                     
  566.    
  567.                     <input type="hidden" name="workshopnamefull" id="workshopnamefull" value="<?php echo $workshopnamefull; ?>" />
  568.                     <div class="input alignleft">
  569.                         <input type="submit" class="submit" name="btnProcess" id="btnProcess" value="Pay Later by Cheque or EFT" />
  570.                     </div>
  571.                 </form>            
  572.          
  573.             <!--</div>-->      
  574.         </article>                       
  575.     </div>  <!-- close mainContent -->      
  576. </div>   <!-- close content -->  
  577.  
  578. <?php include("../includes/footer.htm"); ?>
  579.  
  580. <script>
  581.   var navigation = responsiveNav("#nav");
  582. </script>
  583.  
  584. </body>
  585. </html>
  586. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement