Completed
Branch master (9d3fbd)
by Michael
02:59
created

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
/**
13
 * oledrion
14
 *
15
 * @copyright   The XOOPS Project http://sourceforge.net/projects/xoops/
16
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
17
 * @author      Hossein Azizabadi ([email protected])
18
 * @version     $Id$
19
 */
20
21
require 'header.php';
22
$xoopsOption['template_main'] = 'oledrion_user.tpl';
23
require_once XOOPS_ROOT_PATH . '/header.php';
24
// Check is user
25
$uid = oledrion_utils::getCurrentUserID();
26
if ($uid == 0) {
27
    oledrion_utils::redirect(_OLEDRION_ERROR23, XOOPS_URL . '/register.php', 4);
28
}
29
// Load header
30
$handlers = oledrion_handler::getInstance();
31
// Get list of this user order
32
$orders = $list = array();
33
$criteria = new CriteriaCompo();
34
$criteria->add(new Criteria('cmd_uid', $uid));
35
$criteria->setSort('cmd_id');
36
$criteria->setOrder('DESC');
37
$orders = $handlers->h_oledrion_commands->getObjects($criteria, false);
0 ignored issues
show
The property h_oledrion_commands does not exist on object<oledrion_handler>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
38
if (!empty($orders)) {
39
    foreach ($orders as $item) {
40
        $command = $item->toArray();
41
        /* $caddy = $h_oledrion_caddy->getCaddyFromCommand($command['cmd_id']);
42
        foreach ($caddy as $item) {
43
            $tmp[] = $item->getVar('caddy_product_id');
44
        }
45
        $tmp = array_unique($tmp);
46
        foreach ($caddy as $itemCaddy) {
47
            $products = $h_oledrion_products->getProductsFromIDs($tmp, true);
48
            $product = $products[$itemCaddy->getVar('caddy_product_id')];
49
            $productForTemplate[] = $product->toArray(); // Produit
50
        }
51
        $command['all_products'] = $productForTemplate; */
52
        $command['cmd_url'] = OLEDRION_URL . 'invoice.php?id=' . $command['cmd_id'] . '&pass=' . $command['cmd_password'];
53
        switch ($command['cmd_state']) {
54
            case 0:
55
                $command['cmd_state_title'] = _OLEDRION_USER_STATE0;
56
                break;
57
58
            case 1:
59
                $command['cmd_state_title'] = _OLEDRION_USER_STATE1;
60
                break;
61
62
            case 2:
63
                $command['cmd_state_title'] = _OLEDRION_USER_STATE2;
64
                break;
65
66
            case 3:
67
                $command['cmd_state_title'] = _OLEDRION_USER_STATE3;
68
                break;
69
70
            case 4:
71
                $command['cmd_state_title'] = _OLEDRION_USER_STATE4;
72
                break;
73
74
            case 5:
75
                $command['cmd_state_title'] = _OLEDRION_USER_STATE5;
76
                break;
77
78
            case 6:
79
                $command['cmd_state_title'] = _OLEDRION_USER_STATE6;
80
                break;
81
82
            case 7:
83
                $command['cmd_state_title'] = _OLEDRION_USER_STATE7;
84
                break;
85
86
            case 8:
87
                $command['cmd_state_title'] = _OLEDRION_USER_STATE8;
88
                break;
89
        }
90
        $list[] = $command;
91
    }
92
}
93
94
$xoopsTpl->assign('list', $list);
95
oledrion_utils::setCSS();
96
oledrion_utils::setLocalCSS($xoopsConfig['language']);
97
$title = _OLEDRION_USER . ' - ' . oledrion_utils::getModuleName();
98
oledrion_utils::setMetas($title, $title);
99
require_once XOOPS_ROOT_PATH . '/footer.php';
100