Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

eztrade/user/datasupplier.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: datasupplier.php 9407 2002-04-10 11:49:02Z br $
5 //
6 // Created on: <23-Oct-2000 17:53:46 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 $PageCaching = $ini->variable( "eZTradeMain", "PageCaching");
28
29 // include_once( "ezuser/classes/ezuser.php" );
30 // include_once( "eztrade/classes/ezpricegroup.php" );
31 // include_once( "classes/ezhttptool.php" );
32
33 $user =& eZUser::currentUser();
34 $ini =& eZINI::instance( 'site.ini' );
35 $SiteDesign = $ini->variable( "site", "SiteDesign" );
36
37 $RequireUser = $ini->variable( "eZTradeMain", "RequireUserLogin" ) == "enabled" ? true : false;
38 $ShowPrice = $RequireUser ? is_a( $user, "eZUser" ) : true;
39 $UserReviews = $ini->variable( "eZTradeMain", "UserReviews" );
40
41 $PriceGroup = 0;
42 if ( is_a( $user, "eZUser" ) )
43 {
44 $PriceGroup = eZPriceGroup::correctPriceGroup( $user->groups( false ) );
45 }
46 if ( !$ShowPrice )
47 $PriceGroup = -1;
48
49 $GlobalSectionID = $ini->variable( "eZTradeMain", "DefaultSection" );
50
51 if ( $user )
52 {
53 $groupIDArray =& $user->groups( false );
54 sort( $groupIDArray );
55 }
56 else
57 {
58 $groupIDArray = null;
59 }
60
61
62 switch ( $url_array[2] )
63 {
64
65 case "hotdealsgallery" :
66 {
67 // $RedirectURL = $RedirectURL;
68 $session->setVariable( "RedirectURL", $REQUEST_URI );
69 $CategoryID = $url_array[3];
70 $Offset = $url_array[4];
71 if ( !is_numeric( $Offset ) )
72 $Offset = 0;
73 if ( $PageCaching == "enabled" )
74 {
75 //include_once( "classes/ezcachefile.php" );
76 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
77 array( "hotdealsgallery", $CategoryID, $groupIDArray, $Offset, $PriceGroup ),
78 "cache", "," );
79 if ( $CacheFile->exists() )
80 {
81 include( $CacheFile->filename( true ) );
82 }
83 else
84 {
85 $GenerateStaticPage = "true";
86 include( "kernel/eztrade/user/hotdealsgallery.php" );
87 }
88 }
89 else
90 {
91 include( "kernel/eztrade/user/hotdealsgallery.php" );
92 }
93 break;
94 }
95
96 case "hotdealslist" :
97 {
98 // $RedirectURL = $RedirectURL;
99 $session->setVariable( "RedirectURL", $REQUEST_URI );
100 $CategoryID = $url_array[3];
101 $Offset = $url_array[4];
102 if ( !is_numeric( $Offset ) )
103 $Offset = 0;
104 if ( $PageCaching == "enabled" )
105 {
106 //include_once( "classes/ezcachefile.php" );
107 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
108 array( "hotdealslist", $CategoryID, $groupIDArray, $Offset, $PriceGroup ),
109 "cache", "," );
110 if ( $CacheFile->exists() )
111 {
112 include( $CacheFile->filename( true ) );
113 }
114 else
115 {
116 $GenerateStaticPage = "true";
117 include( "kernel/eztrade/user/hotdealslist.php" );
118 }
119 }
120 else
121 {
122 include( "kernel/eztrade/user/hotdealslist.php" );
123 }
124 break;
125 }
126
127 case "productgallery" :
128 {
129 // $RedirectURL = $RedirectURL;
130 $session->setVariable( "RedirectURL", $REQUEST_URI );
131 $CategoryID = $url_array[3];
132 $Offset = $url_array[4];
133 if ( !is_numeric( $Offset ) )
134 $Offset = 0;
135 if ( $PageCaching == "enabled" )
136 {
137 // include_once( "classes/ezcachefile.php" );
138 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
139 array( "productgallery", $CategoryID, $groupIDArray, $Offset, $PriceGroup ),
140 "cache", "," );
141 if ( $CacheFile->exists() )
142 {
143 include( $CacheFile->filename( true ) );
144 }
145 else
146 {
147 $GenerateStaticPage = "true";
148 include( "kernel/eztrade/user/productgallery.php" );
149 }
150 }
151 else
152 {
153 include( "kernel/eztrade/user/productgallery.php" );
154 }
155 break;
156 }
157
158 case "productlist" :
159 {
160 $CategoryID = $url_array[3];
161 $Offset = $url_array[4];
162 if ( !is_numeric( $Offset ) )
163 $Offset = 0;
164 if ( $PageCaching == "enabled" )
165 {
166 if ( !isset( $groupIDArray ) || !$groupIDArray )
167 $groupIDArray = 0;
168
169 if ( !isset( $PriceGroup ) || !$PriceGroup )
170 $PriceGroup = 0;
171
172 // include_once( "classes/ezcachefile.php" );
173 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
174 array( "productlist", $CategoryID, $Offset, $PriceGroup ),
175 "cache", "," );
176 if ( $CacheFile->exists() )
177 {
178 if ( $CacheFile->filename( true ) != "" )
179 {
180 include( $CacheFile->filename( true ) );
181 // print_r( $CacheFile->filename( true ) );
182 }
183 }
184 else
185 {
186 $GenerateStaticPage = "true";
187 include( "kernel/eztrade/user/productlist.php" );
188 }
189 }
190 else
191 {
192 //$GenerateStaticPage = "false";
193 $GenerateStaticPage = "false";
194 include( "kernel/eztrade/user/productlist.php" );
195 }
196 break;
197 }
198
199 case "sitemap" :
200 {
201 include( "kernel/eztrade/user/sitemap.php" );
202 break;
203 }
204
205 case "productview" :
206 $PrintableVersion = "disabled";
207 if ( $PageCaching == "enabled" )
208 {
209 $ProductID = $url_array[3];
210 $CategoryID = $url_array[4];
211
212 // include_once( "classes/ezcachefile.php" );
213 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
214 array( "productview", $ProductID, $groupIDArray, $PriceGroup ),
215 "cache", "," );
216 if ( $CacheFile->exists() )
217 {
218 include( $CacheFile->filename( true ) );
219 }
220 else
221 {
222 $GenerateStaticPage = "true";
223 include( "kernel/eztrade/user/productview.php" );
224 }
225 }
226 else
227 {
228 $ProductID = $url_array[3];
229 $CategoryID = $url_array[4];
230 include( "kernel/eztrade/user/productview.php" );
231 }
232
233 if ( ( $PrintableVersion != "enabled" ) && ( $UserReviews == "enabled" ) )
234 {
235 $RedirectURL = "/trade/productview/$ProductID/$CategoryID/";
236 $product = new eZProduct( $ProductID );
237 if ( ( $product->id() >= 1 ) ) // && $product->discuss() )
238 {
239 for ( $i = 0; $i < count( $url_array ); $i++ )
240 {
241 if ( ( $url_array[$i] ) == "parent" )
242 {
243 $next = $i + 1;
244 $Offset = $url_array[$next];
245 }
246 }
247 $forum = $product->forum();
248 $ForumID = $forum->id();
249 include( "kernel/ezforum/user/messagereviewlist.php" );
250 }
251 }
252
253 break;
254
255 case "print" :
256 case "productprint" :
257 if ( $PageCaching == "enabled" )
258 {
259 $PrintableVersion = "enabled";
260 $ProductID = $url_array[3];
261 $CategoryID = $url_array[4];
262
263 // include_once( "classes/ezcachefile.php" );
264 $CacheFile = new eZCacheFile( "kernel/eztrade/cache/",
265 array( "productprint", $ProductID, $groupIDArray, $PriceGroup ),
266 "cache", "," );
267 if ( $CacheFile->exists() )
268 {
269 include( $CacheFile->filename( true ) );
270 }
271 else
272 {
273 $GenerateStaticPage = "true";
274 include( "kernel/eztrade/user/productview.php" );
275 }
276 }
277 else
278 {
279 $PrintableVersion = "enabled";
280 $ProductID = $url_array[3];
281 $CategoryID = $url_array[4];
282 include( "kernel/eztrade/user/productview.php" );
283 }
284
285 break;
286
287 case "cart" :
288 {
289 if ( $url_array[3] == "add" )
290 {
291 $Action = "AddToBasket";
292 $ProductID = $url_array[4];
293 }
294
295 if ( $url_array[3] == "remove" )
296 {
297 $Action = "RemoveFromBasket";
298 $CartItemID = $url_array[4];
299 }
300
301 if ( isset( $WishList ) )
302 {
303 include( "kernel/eztrade/user/wishlist.php" );
304
305 // eZHTTPTool::header( "Location: /trade/wishlist/add/$ProductID" );
306 // exit();
307 }
308 else
309 {
310 include( "kernel/eztrade/user/cart.php" );
311 }
312 }
313 break;
314
315 case "wishlist" :
316 {
317 if ( $url_array[3] == "add" )
318 {
319 $Action = "AddToBasket";
320 $ProductID = $url_array[4];
321 }
322
323 if ( $url_array[3] == "movetocart" )
324 {
325 $Action = "MoveToCart";
326 $WishListItemID = $url_array[4];
327 }
328
329 if ( $url_array[3] == "remove" )
330 {
331 $Action = "RemoveFromWishlist";
332 $WishListItemID = $url_array[4];
333 }
334
335 include( "kernel/eztrade/user/wishlist.php" );
336 }
337 break;
338
339 case "viewwishlist" :
340 {
341 if ( $url_array[3] == "movetocart" )
342 {
343 $Action = "MoveToCart";
344 $WishListItemID = $url_array[4];
345 }
346
347 include( "kernel/eztrade/user/viewwishlist.php" );
348 }
349 break;
350
351 case "sendwishlist" :
352 {
353 include( "kernel/eztrade/user/sendwishlist.php" );
354 }
355 break;
356
357 case "voucherview" :
358 {
359 include( "kernel/eztrade/user/voucherview.php" );
360 }
361 break;
362
363 case "vouchermain" :
364 {
365 include( "kernel/eztrade/user/vouchermain.php" );
366 }
367 break;
368
369 case "voucheremailsample" :
370 {
371 include( "kernel/eztrade/user/voucheremailsample.php" );
372 }
373 break;
374
375 case "orderview" :
376 {
377 $OrderID = $url_array[3];
378 include( "kernel/eztrade/user/orderview.php" );
379 }
380 break;
381
382 case "findwishlist" :
383 {
384 include( "kernel/eztrade/user/findwishlist.php" );
385 }
386 break;
387
388 case "customerlogin" :
389 include( "kernel/eztrade/user/customerlogin.php" );
390 break;
391
392 case "precheckout" :
393 {
394 include( "kernel/eztrade/user/precheckout.php" );
395 }
396 break;
397
398 case "checkout" :
399 {
400 include( "kernel/eztrade/user/checkout.php" );
401 }
402 break;
403
404 case "payment" :
405 {
406 include( "kernel/eztrade/user/payment.php" );
407 }
408 break;
409
410 case "paypal" :
411 {
412 $orderID = $url_array[3];
413 $sessionID = $url_array[4];
414 include( "kernel/eztrade/user/paypalnotify.php" );
415
416 }
417 break;
418
419 case "confirmation" :
420 {
421 include( "kernel/eztrade/user/confirmation.php" );
422 }
423 break;
424
425 case "voucherinformation" :
426 {
427 $ProductID = $url_array[3];
428 $PriceRange = $url_array[4];
429 $MailMethod = $url_array[5];
430
431 include( "kernel/eztrade/user/voucherinformation.php" );
432 }
433 break;
434
435 case "ordersendt" :
436 {
437 $OrderID = $url_array[3];
438 include( "kernel/eztrade/user/ordersendt.php" );
439 }
440 break;
441
442 case "search" :
443 {
444 if ( $url_array[3] == "move" )
445 {
446 $Query = urldecode( $url_array[4] );
447 $Offset = urldecode ( $url_array[5] );
448 }
449 include( "kernel/eztrade/user/productsearch.php" );
450 }
451 break;
452
453 case "orderlist" :
454 {
455 if ( $url_array[3] != "" )
456 $Offset = $url_array[3];
457 else
458 $Offset = 0;
459
460 include( "kernel/eztrade/user/orderlist.php" );
461 }
462 break;
463
464 case "extendedsearch" :
465 {
466 $Limit = 10;
467 if ( $url_array[3] == "move" )
468 {
469 $Text = urldecode( $url_array[4] );
470 $PriceRange = urldecode( $url_array[5] );
471 $MainCategories = urldecode ( $url_array[6] );
472 $CategoryArray = urldecode ( $url_array[7] );
473 $Offset = urldecode ( $url_array[8] );
474
475 $Action = "SearchButton";
476 $Next = true;
477 }
478
479 include( "kernel/eztrade/user/extendedsearch.php" );
480 }
481 break;
482
483 case "export" :
484 {
485 if ( $url_array[3] == 'froogle' )
486 {
487 if ( $url_array[4] == 'download' )
488 {
489 $Action = "export";
490 }
491 else
492 {
493 $Action = "export-cron";
494 }
495 include( "kernel/eztrade/admin/export_froogle.php" );
496 }
497 elseif ( $url_array[3] == 'yahoo' )
498 {
499 if ( $url_array[4] == 'download' )
500 {
501 $Action = "export";
502 }
503 else
504 {
505 $Action = "export-cron";
506 }
507 include( "kernel/eztrade/admin/export_yahoo.php" );
508 }
509 else {
510 $Action = "export-cron";
511 include( "kernel/eztrade/admin/export_froogle.php" );
512 }
513 }
514 break;
515
516 // XML rpc interface
517 case "xmlrpc" :
518 {
519 include( "kernel/eztrade/xmlrpc/xmlrpcserver.php" );
520 }
521 break;
522
523 // XML rpc interface
524 case "xmlrpcimport" :
525 {
526 include( "kernel/eztrade/xmlrpc/xmlrpcserverimport.php" );
527 }
528 break;
529
530
531 default :
532 {
533 eZHTTPTool::header( "Location: /error/404" );
534 exit();
535 }
536 break;
537 }
538
539 ?>
$i
$i
Definition: admin/adlist.php:91
$CategoryID
$CategoryID
Definition: admin/articleedit.php:53
$session
$session
Definition: admin/articlelist.php:44
$forum
$forum
Definition: admin/forumlist.php:50
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZPriceGroup\correctPriceGroup
static correctPriceGroup( $group_id, $debug=false)
Definition: ezpricegroup.php:240
eZProduct
Definition: ezproduct.php:71
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$Action
$Action
Definition: companysearch.php:80
$orderID
$orderID
Definition: confirmation.php:34
$url_array
$url_array
Definition: ezaddress/admin/datasupplier.php:34
$Limit
$Limit
Definition: ezarticle/admin/categorylist.php:66
$Offset
$Offset
Definition: ezarticle/user/search.php:110
$RedirectURL
$RedirectURL
Definition: ezforum/user/userlogin.php:91
$user
$user
Definition: eztrade/user/datasupplier.php:33
$GlobalSectionID
$GlobalSectionID
Definition: eztrade/user/datasupplier.php:49
$UserReviews
$UserReviews
Definition: eztrade/user/datasupplier.php:39
$RequireUser
$RequireUser
Definition: eztrade/user/datasupplier.php:37
$ini
$ini
Definition: eztrade/user/datasupplier.php:34
$PriceGroup
$PriceGroup
Definition: eztrade/user/datasupplier.php:41
$ShowPrice
$ShowPrice
Definition: eztrade/user/datasupplier.php:38
$PageCaching
$PageCaching
Definition: eztrade/user/datasupplier.php:27
$SiteDesign
$SiteDesign
Definition: eztrade/user/datasupplier.php:35
exit
exit
Definition: folder.php:81
$product
$product
Definition: homepage.php:202
$MailMethod
$MailMethod
Definition: productview.php:260
$GenerateStaticPage
$GenerateStaticPage
Definition: quizscores.php:95
$REQUEST_URI
$REQUEST_URI
Definition: storestats.php:32
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.