Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

voucherlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: voucherlist.php 7416 2001-09-24 10:19:16Z ce $
5 //
6 // Created on: <20-Dec-2000 18:18:28 bf>
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
32 $ini =& eZINI::instance( 'site.ini' );
33 $Language = $ini->variable( "eZTradeMain", "Language" );
34
35 // include_once( "eztrade/classes/ezproductcategory.php" );
36 // include_once( "eztrade/classes/ezproduct.php" );
37 // include_once( "eztrade/classes/ezvoucher.php" );
38
39 if( isset( $Delete ) )
40 {
41 foreach( $DeleteArrayID as $voucherID )
42 {
43 $voucher = new eZVoucher( $voucherID );
44 $voucher->delete();
45 }
46 }
47
48 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
49 "kernel/eztrade/admin/intl/", $Language, "voucherlist.php" );
50
51 $t->setAllStrings();
52
53 $t->set_file( array(
54 "voucher_list_page_tpl" => "voucherlist.tpl"
55 ) );
56
57
58 // voucher
59 $t->set_block( "voucher_list_page_tpl", "voucher_list_tpl", "voucher_list" );
60 $t->set_block( "voucher_list_tpl", "voucher_item_tpl", "voucher_item" );
61 $t->set_block( "voucher_item_tpl", "voucher_is_available_tpl", "voucher_is_available" );
62 $t->set_block( "voucher_item_tpl", "voucher_is_not_available_tpl", "voucher_is_not_available" );
63
64 $t->set_var( "site_style", $SiteDesign );
65
66 $voucherlist = eZVoucher::getAll( );
67
68 // categories
69 $i=0;
70 $t->set_var( "voucher_list", "" );
71
72 $locale = new eZLocale( $Language );
73 $currency = new eZCurrency();
74
75 foreach ( $voucherlist as $voucherItem )
76 {
77 $t->set_var( "voucher_id", $voucherItem->id() );
78
79 $t->set_var( "voucher_created", $locale->format( $voucherItem->created() ) );
80
81 $currency->setValue( $voucherItem->price() );
82 $t->set_var( "voucher_price", $locale->format( $currency ) );
83
84 $currency->setValue( $voucherItem->price() );
85 $t->set_var( "voucher_price", $locale->format( $currency ) );
86
87 if ( $voucherItem->isAvailable() )
88 {
89 $t->set_var( "voucher_is_not_available", "" );
90 $t->parse( "voucher_is_available", "voucher_is_available_tpl" );
91 }
92 else
93 {
94 $t->set_var( "voucher_is_available", "" );
95 $t->parse( "voucher_is_not_available", "voucher_is_not_available_tpl" );
96 }
97
98 if ( ( $i % 2 ) == 0 )
99 $t->set_var( "td_class", "bglight" );
100 else
101 $t->set_var( "td_class", "bgdark" );
102
103 $t->parse( "voucher_item", "voucher_item_tpl", true );
104 $i++;
105 }
106
107 if ( count( $voucherlist ) > 0 )
108 $t->parse( "voucher_list", "voucher_list_tpl" );
109 else
110 $t->set_var( "voucher_list", "" );
111
112
113 $t->pparse( "output", "voucher_list_page_tpl" );
114
115 ?>
eZCurrency
Definition: ezcurrency.php:46
eZLocale
Definition: ezlocale.php:119
eZTemplate
Definition: eztemplate.php:107
eZVoucher
Definition: ezvoucher.php:54
eZVoucher\getAll
static & getAll( $offset=0, $limit=20)
Definition: ezvoucher.php:196
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$voucherlist
$voucherlist
Definition: voucherlist.php:66
$currency
$currency
Definition: voucherlist.php:73
$locale
$locale
Definition: voucherlist.php:72
$i
$i
Definition: voucherlist.php:69
$Language
$Language
Definition: voucherlist.php:33
$ini
$ini
Definition: voucherlist.php:32
$t
if(isset( $Delete)) $t
Definition: voucherlist.php:48
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.