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   {@link http://xoops.org/ XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author      Hossein Azizabadi ([email protected])
18
 */
19
20
require __DIR__ . '/header.php';
21
$GLOBALS['xoopsOption']['template_main'] = 'oledrion_user.tpl';
22
require_once XOOPS_ROOT_PATH . '/header.php';
23
// Check is user
24
$uid = Oledrion_utils::getCurrentUserID();
25
if ($uid == 0) {
26
    Oledrion_utils::redirect(_OLEDRION_ERROR23, XOOPS_URL . '/register.php', 4);
27
}
28
// Load header
29
$handlers = OledrionHandler::getInstance();
30
// Get list of this user order
31
$orders   = $list = array();
32
$criteria = new CriteriaCompo();
33
$criteria->add(new Criteria('cmd_uid', $uid));
34
$criteria->setSort('cmd_id');
35
$criteria->setOrder('DESC');
36
$orders = $handlers->h_oledrion_commands->getObjects($criteria, false);
0 ignored issues
show
The property h_oledrion_commands does not exist on object<OledrionHandler>. 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...
37
if (!empty($orders)) {
38
    foreach ($orders as $item) {
39
        $command = $item->toArray();
40
        /* $caddy = $h_oledrion_caddy->getCaddyFromCommand($command['cmd_id']);
41
        foreach ($caddy as $item) {
42
            $tmp[] = $item->getVar('caddy_product_id');
43
        }
44
        $tmp = array_unique($tmp);
45
        foreach ($caddy as $itemCaddy) {
46
            $products = $h_oledrion_products->getProductsFromIDs($tmp, true);
47
            $product = $products[$itemCaddy->getVar('caddy_product_id')];
48
            $productForTemplate[] = $product->toArray(); // Produit
49
        }
50
        $command['all_products'] = $productForTemplate; */
51
        $command['cmd_url'] = OLEDRION_URL . 'invoice.php?id=' . $command['cmd_id'] . '&pass=' . $command['cmd_password'];
52
        switch ($command['cmd_state']) {
53
            case 0:
54
                $command['cmd_state_title'] = _OLEDRION_USER_STATE0;
55
                break;
56
57
            case 1:
58
                $command['cmd_state_title'] = _OLEDRION_USER_STATE1;
59
                break;
60
61
            case 2:
62
                $command['cmd_state_title'] = _OLEDRION_USER_STATE2;
63
                break;
64
65
            case 3:
66
                $command['cmd_state_title'] = _OLEDRION_USER_STATE3;
67
                break;
68
69
            case 4:
70
                $command['cmd_state_title'] = _OLEDRION_USER_STATE4;
71
                break;
72
73
            case 5:
74
                $command['cmd_state_title'] = _OLEDRION_USER_STATE5;
75
                break;
76
77
            case 6:
78
                $command['cmd_state_title'] = _OLEDRION_USER_STATE6;
79
                break;
80
81
            case 7:
82
                $command['cmd_state_title'] = _OLEDRION_USER_STATE7;
83
                break;
84
85
            case 8:
86
                $command['cmd_state_title'] = _OLEDRION_USER_STATE8;
87
                break;
88
        }
89
        $list[] = $command;
90
    }
91
}
92
93
$xoopsTpl->assign('list', $list);
94
Oledrion_utils::setCSS();
95
Oledrion_utils::setLocalCSS($xoopsConfig['language']);
96
$title = _OLEDRION_USER . ' - ' . Oledrion_utils::getModuleName();
97
Oledrion_utils::setMetas($title, $title);
98
require_once XOOPS_ROOT_PATH . '/footer.php';
99