Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

user/orderlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: orderlist.php 7813 2001-10-12 12:11:39Z ce $
5 //
6 // Created on: <21-Sep-2001 17:41:07 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/ezlist.php" );
32
33 $ini =& eZINI::instance( 'site.ini' );
34 $Language = $ini->variable( "eZTradeMain", "Language" );
35 $ShowOrderStatusToUser = $ini->variable( "eZTradeMain", "ShowOrderStatusToUser" ) == "true";
36
37 // include_once( "eztrade/classes/ezproductcategory.php" );
38 // include_once( "eztrade/classes/ezproduct.php" );
39 // include_once( "eztrade/classes/ezorder.php" );
40
41 // include_once( "eztrade/classes/ezorderstatustype.php" );
42
43 $t = new eZTemplate( "kernel/eztrade/user/" . $ini->variable( "eZTradeMain", "TemplateDir" ),
44 "kernel/eztrade/user/intl/", $Language, "orderlist.php" );
45
46 $languageINI = new eZINI( "kernel/eztrade/user/intl/" . $Language . "/orderlist.php.ini", false );
47
48 $t->setAllStrings();
49
50 $t->set_file( "order_list_tpl", "orderlist.tpl" );
51
52 $t->set_block( "order_list_tpl", "order_item_list_tpl", "order_item_list" );
53 $t->set_block( "order_item_list_tpl", "order_status_header_tpl", "order_status_header" );
54 $t->set_block( "order_item_list_tpl", "order_item_tpl", "order_item" );
55
56 $t->set_block( "order_item_tpl", "order_status_tpl", "order_status" );
57
58 $t->set_var( "site_style", $SiteDesign );
59
60 $t->set_var( "query_string", isset( $QueryText ) ? $QueryText : '' );
61
62 if ( !isset( $OrderBy ) )
63 $OrderBy = "Date";
64 if ( !isset( $Limit ) )
65 $Limit = 20;
66
67 $t->set_var( "current_offset", $Offset );
68
69 $order = new eZOrder();
70
71 $user =& eZUser::currentUser();
72
73 if ( !$user )
74 {
75 eZHTTPTool::header( "Location: /trade/customerlogin/?RedirectURL=/trade/orderlist/" );
76 exit();
77 }
78
79 $orderArray = $order->getByUser( $Offset, $Limit, $OrderBy, $user );
80 $total_count = $order->getCountByUser( $user );
81 if ( !$orderArray )
82 $t->set_var( "order_item", "" );
83
84 $locale = new eZLocale( $Language );
85 $currency = new eZCurrency();
86 $i = 0;
87
88 $t->set_var( "full_name", $user->firstName() . " " . $user->lastName() );
89
90 if ( $ShowOrderStatusToUser )
91 $t->parse( "order_status_header", "order_status_header_tpl" );
92 else
93 $t->set_var( "order_status_header" );
94
95 foreach ( $orderArray as $order )
96 {
97 if ( ( $i % 2 ) == 0 )
98 $t->set_var( "td_class", "bgdark" );
99 else
100 $t->set_var( "td_class", "bglight" );
101
102 $t->set_var( "order_id", $order->id() );
103
104 $status = $order->lastStatus( );
105 $dateTime = $status->altered();
106 $t->set_var( "order_date", $locale->format( $dateTime ) );
107
108 if ( $ShowOrderStatusToUser )
109 {
110 $statusType = $status->type();
111
112 if ( $statusType && $statusType->name() != null )
113 $statusName = preg_replace( "#intl-#", "", $statusType->name() );
114 else
115 $statusName = "Pending";
116 // $statusName = $languageINI->variable( "strings", $statusName );
117 $t->set_var( "order_status", $statusName );
118
119 $t->parse( "order_status", "order_status_tpl" );
120 }
121 else
122 $t->set_var( "order_status", "" );
123
124 /*
125 $currency->setValue( $order->totalPrice() );
126 $t->set_var( "order_price", $locale->format( $currency ) );
127 */
128
129
130 $order->orderTotals( $tax, $total );
131
132 if ( isset( $_GET["PricesIncludeVAT"] ) && $PricesIncludeVAT == true )
133 $currency->setValue( $total["inctax"] );
134 else
135 $currency->setValue( $total["extax"] );
136
137 $t->set_var( "order_price", $locale->format( $currency ) );
138
139 $t->parse( "order_item", "order_item_tpl", true );
140 $i++;
141 }
142
143 eZList::drawNavigator( $t, $total_count, $Limit, $Offset, "order_list_tpl" );
144
145
146 $t->parse( "order_item_list", "order_item_list_tpl" );
147 $t->pparse( "output", "order_list_tpl" );
148
149 ?>
$dateTime
$dateTime
Definition: authorview.php:77
$status
$status
Definition: bugedit.php:473
$total
else $total["inctax"]
Definition: checkout.php:1359
eZCurrency
Definition: ezcurrency.php:46
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZINI
Reads and writes .ini style configuration files.
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZLocale
Definition: ezlocale.php:119
eZOrder
Definition: ezorder.php:52
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
exit
exit
Definition: folder.php:81
$PricesIncludeVAT
$PricesIncludeVAT
Definition: homepage.php:47
$statusType
if(count( $usedVouchers) > 0) $statusType
Definition: orderedit.php:620
$OrderBy
$OrderBy
Definition: reciverpopup.php:21
$order
$order
Definition: user/orderlist.php:69
$currency
$currency
Definition: user/orderlist.php:85
$locale
$locale
Definition: user/orderlist.php:84
$t
$t
Definition: user/orderlist.php:43
$languageINI
$languageINI
Definition: user/orderlist.php:46
$user
$user
Definition: user/orderlist.php:71
$ShowOrderStatusToUser
$ShowOrderStatusToUser
Definition: user/orderlist.php:35
$i
$i
Definition: user/orderlist.php:86
$Language
$Language
Definition: user/orderlist.php:34
$ini
$ini
Definition: user/orderlist.php:33
$total_count
$total_count
Definition: user/orderlist.php:80
$orderArray
if(! $user) $orderArray
Definition: user/orderlist.php:79
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.