Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

vattypes.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: vattypes.php 6233 2001-07-20 11:42:02Z jakobn $
5 //
6 // Created on: <19-Feb-2001 13:34:10 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
28 // include_once( "classes/INIFile.php" );
29 // include_once( "classes/eztemplate.php" );
30 // include_once( "classes/ezhttptool.php" );
31
32 $ini =& eZINI::instance( 'site.ini' );
33
34 $Language = $ini->variable( "eZTradeMain", "Language" );
35
36 // include_once( "eztrade/classes/ezvattype.php" );
37
38
39 if ( isset( $Action ) && $Action == "Store" )
40 {
41 $i =0;
42 foreach ( $VatID as $id )
43 {
44 $type = new eZVATType( $VatID[$i] );
45 $type->setName( $VatName[$i] );
46 $type->setValue( $VatValue[$i] );
47 $type->store();
48 $i++;
49 }
50 }
51
52 if ( isset( $Action ) && $Action == "Add" )
53 {
54 $type = new eZVATType();
55 $type->setName( "" );
56 $type->setValue( 0 );
57 $type->store();
58 }
59
60 if ( isset( $Action ) && $Action == "Delete" )
61 {
62 foreach ( $VatArrayID as $id )
63 {
64 $type = new eZVATType( $id );
65 $type->delete();
66 }
67 }
68
69 $t = new eZTemplate( "kernel/eztrade/admin/" . $ini->variable( "eZTradeMain", "AdminTemplateDir" ),
70 "kernel/eztrade/admin/intl/", $Language, "vattypes.php" );
71
72 $t->setAllStrings();
73
74 $t->set_file( array( "vat_types_tpl" => "vattypes.tpl" ) );
75
76 $t->set_block( "vat_types_tpl", "vat_item_tpl", "vat_item" );
77
78
79 $type = new eZVATType();
80
81 $types =& $type->getAll();
82
83 $i=0;
84 foreach ( $types as $item )
85 {
86 if ( ( $i % 2 ) == 0 )
87 {
88 $t->set_var( "td_class", "bglight" );
89 }
90 else
91 {
92 $t->set_var( "td_class", "bgdark" );
93 }
94
95 $t->set_var( "vat_id", $item->id() );
96 $t->set_var( "vat_name", $item->name() );
97 $t->set_var( "vat_value", $item->value() );
98
99 $t->parse( "vat_item", "vat_item_tpl", true );
100
101 $i++;
102 }
103
104 if ( count ( $types ) == 0 )
105 $t->set_var( "vat_item", "" );
106
107
108 $t->pparse( "output", "vat_types_tpl" );
109
110 ?>
eZTemplate
Definition: eztemplate.php:107
eZVATType
Definition: ezvattype.php:41
$item
$item
Definition: classes/admin/linklist.php:228
$Action
$Action
Definition: companysearch.php:80
$id
$id
Definition: companytypelist.php:193
$t
if(isset( $Action) && $Action=="Store") if(isset( $Action) && $Action=="Add") if(isset( $Action) && $Action=="Delete") $t
Definition: vattypes.php:69
$i
$i
Definition: vattypes.php:83
$Language
$Language
Definition: vattypes.php:34
$ini
$ini
Definition: vattypes.php:32
$types
$types
Definition: vattypes.php:81
$type
$type
Definition: vattypes.php:79
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.