Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

confirmation.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: confirmation.php 9407 2002-04-10 11:49:02Z br $
5 //
6 // <Bj�rn Reiten> <br@ez.no>
7 // Created on: <20-Mar-2002 14:11:34 br>
8 //
9 // This source file is part of Exponential Basic, publishing software.
10 // Copyright (C) 1999-2001 eZ systems as
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27
28 // include_once( "classes/INIFile.php" );
29 // include_once( "ezsession/classes/ezsession.php" );
30 // include_once( "ezuser/classes/ezuser.php" );
31 // include_once( "eztrade/classes/ezorderconfirmation.php" );
32
33 $session =& eZSession::globalSession();
34 $orderID = $session->variable( "OrderID" );
35
36 $ini =& eZINI::instance( 'site.ini' );
37 $wwwDir = $ini->WWWDir;
38 $indexFile = $ini->Index;
39
40 $orderConfirmation = $session->variable( "OrderConfirmation" );
41
42
43 if ( is_numeric( $orderID ) && $orderConfirmation == $orderID )
44 {
45 $confirmation = new eZOrderConfirmation( $orderID );
46 $result = $confirmation->confirmOrder( $session->id() );
47
48 // redirect to the confirmation site if the order is sent
49 $user =& eZUser::currentUser();
50 if ( $user && $result )
51 {
52 if ( $result == true )
53 {
54 $session->setVariable( "OrderConfirmation", "" );
55 eZHTTPTool::header( "Location: https://" . $HTTP_HOST . $wwwDir . $indexFile . "/trade/ordersendt/$orderID/" );
56 exit();
57 }
58 else
59 {
60 eZHTTPTool::header( "Location: http://" . $HTTP_HOST . $wwwDir . $indexFile . "/trade/checkout/" );
61 exit();
62 }
63 }
64 else
65 { //ends up here!
66 eZHTTPTool::header( "Location: https://" . $HTTP_HOST . $wwwDir . $indexFile . "/trade/checkout/" );
67 exit();
68 }
69 }
70 else if ( is_numeric( $orderID ) )
71 {
72 eZHTTPTool::header( "Location: https://" . $HTTP_HOST . $wwwDir . $indexFile . "/trade/ordersendt/$orderID/" );
73 exit();
74 }
75 else
76 {
77 eZHTTPTool::header( "Location: http://" . $HTTP_HOST . $wwwDir . $indexFile . "/trade/checkout/" );
78 exit();
79 }
80
81 ?>
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZOrderConfirmation
Definition: ezorderconfirmation.php:68
eZSession\globalSession
static & globalSession( $id="", $fetch=true)
Definition: kernel/ezsession/classes/ezsession.php:614
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$result
$result
Definition: companysearch.php:94
$indexFile
$indexFile
Definition: confirmation.php:38
$wwwDir
$wwwDir
Definition: confirmation.php:37
$ini
$ini
Definition: confirmation.php:36
$orderConfirmation
$orderConfirmation
Definition: confirmation.php:40
$session
$session
Definition: confirmation.php:33
$orderID
$orderID
Definition: confirmation.php:34
exit
exit
Definition: folder.php:81
$user
$user
Definition: user/adlist.php:39
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.