Quick Search:

View

Revision:

Diff

Diff from 404 to:

Annotations

Annotate by Age | Author | Mixed | None
/fisheye/browse/osCommerce/branches/hpdl/oscommerce/includes/classes/order_total.php

Annotated File View

hpdl
1
1 <?php
2 /*
hpdl
153
3   $Id: order_total.php 404 2006-01-25 22:55:27Z hpdl $
hpdl
1
4
5   osCommerce, Open Source E-Commerce Solutions
6   http://www.oscommerce.com
7
hpdl
404
8   Copyright (c) 2006 osCommerce
hpdl
1
9
10   Released under the GNU General Public License
11 */
12
13   class order_total {
14     var $modules;
15
16 // class constructor
17     function order_total() {
hpdl
377
18       global $osC_Language;
19
hpdl
1
20       if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {
21         $this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);
22
hpdl
404
23         $osC_Language->load('modules-order_total');
24
hpdl
1
25         reset($this->modules);
26         while (list(, $value) = each($this->modules)) {
hpdl
273
27           include('includes/modules/order_total/' . $value);
hpdl
1
28
29           $class = substr($value, 0, strrpos($value, '.'));
30           $GLOBALS[$class] = new $class;
31         }
32       }
33     }
34
35     function process() {
36       $order_total_array = array();
37       if (is_array($this->modules)) {
38         reset($this->modules);
39         while (list(, $value) = each($this->modules)) {
40           $class = substr($value, 0, strrpos($value, '.'));
41           if ($GLOBALS[$class]->enabled) {
42             $GLOBALS[$class]->process();
43
44             for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {
45               if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {
46                 $order_total_array[] = array('code' => $GLOBALS[$class]->code,
47                                              'title' => $GLOBALS[$class]->output[$i]['title'],
48                                              'text' => $GLOBALS[$class]->output[$i]['text'],
49                                              'value' => $GLOBALS[$class]->output[$i]['value'],
50                                              'sort_order' => $GLOBALS[$class]->sort_order);
51               }
52             }
53           }
54         }
55       }
56
57       return $order_total_array;
58     }
59
60     function output() {
61       $output_string = '';
62       if (is_array($this->modules)) {
63         reset($this->modules);
64         while (list(, $value) = each($this->modules)) {
65           $class = substr($value, 0, strrpos($value, '.'));
66           if ($GLOBALS[$class]->enabled) {
67             $size = sizeof($GLOBALS[$class]->output);
68             for ($i=0; $i<$size; $i++) {
69               $output_string .= '              <tr>' . "\n" .
70                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .
71                                 '                <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .
72                                 '              </tr>';
73             }
74           }
75         }
76       }
77
78       return $output_string;
79     }
80   }
81 ?>
    \ No newline at end of file