Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

voucher.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: voucher.php 9407 2002-04-10 11:49:02Z br $
5 //
6 // Created on: <08-Feb-2001 14:11:48 ce>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
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 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezcurrency.php" );
31 // include_once( "classes/ezhttptool.php" );
32 // include_once( "classes/ezcctool.php" );
33 // include_once( "eztrade/classes/ezvoucher.php" );
34
35 if ( isset ( $Back ) )
36 {
37 eZHTTPTool::header( "Location: /trade/checkout/" );
38 exit();
39 }
40
41
42 $ini =& eZINI::instance( 'site.ini' );
43
44 $Language = $ini->variable( "eZTradeMain", "Language" );
45
46 $session->setVariable( "PayWithVocuher", "" );
47
48 $t = new eZTemplate( "kernel/eztrade/user/" . $ini->variable( "eZTradeMain", "TemplateDir" ),
49 "kernel/eztrade/user/intl/", $Language, "voucher.php" );
50
51 $t->set_file( "voucher_tpl", "voucher.tpl" );
52
53 $t->setAllStrings();
54
55 $t->set_block( "voucher_tpl", "error_tpl", "error" );
56 $t->set_var( "error", "" );
57
58 if ( $Action == "Verify" )
59 {
60 $voucher = eZVoucher::getFromKeyNumber( $KeyNumber );
61 if ( is_a ( $voucher, "eZVoucher" ) )
62 {
63 $array[] = $voucher->id();
64
65
66 $append = $session->arrayValue( "PayWithVoucher" );
67
68
69 $array = array_merge( $array, $append );
70
71 $session->setArray( "PayWithVoucher", $array );
72 $session->arrayValue( "PayWithVoucher" );
73
74 eZHTTPTool::header( "Location: /trade/checkout/" );
75 exit();
76
77 }
78
79 $t->parse( "error", "error_tpl" );
80 $PaymentSuccess = false;
81 }
82
83
84 // $ChargeTotal is the value to charge the customer with
85
86 $t->set_var( "order_id", $PreOrderID );
87 $t->set_var( "payment_type", $PaymentType );
88
89 $t->pparse( "output", "voucher_tpl" );
90 ?>
$session
$session
Definition: admin/articlelist.php:44
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZTemplate
Definition: eztemplate.php:107
eZVoucher\getFromKeyNumber
getFromKeyNumber(&$key, $available=true)
Definition: ezvoucher.php:428
$Action
$Action
Definition: companysearch.php:80
exit
exit
Definition: folder.php:81
$PaymentSuccess
$PaymentSuccess
Definition: invoice.php:29
$PreOrderID
$PreOrderID
Definition: payment.php:135
$t
$t
Definition: voucher.php:48
$Language
$Language
Definition: voucher.php:44
$ini
if(isset( $Back)) $ini
Definition: voucher.php:42
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.