Passed
Push — master ( e643a0...1f75e2 )
by Michael
03:19
created
Labels
Severity
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 https://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
use XoopsModules\Oledrion;
21
22
require_once __DIR__ . '/header.php';
23
$GLOBALS['xoopsOption']['template_main'] = 'oledrion_user.tpl';
24
require_once XOOPS_ROOT_PATH . '/header.php';
0 ignored issues
show
The constant XOOPS_ROOT_PATH was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
25
// Check is user
26
$uid = Oledrion\Utility::getCurrentUserID();
27
if (0 == $uid) {
28
    Oledrion\Utility::redirect(_OLEDRION_ERROR23, XOOPS_URL . '/register.php', 4);
0 ignored issues
show
The constant XOOPS_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
29
}
30
// Load header
31
//$handlers = HandlerManager::getInstance();
32
// Get list of this user order
33
$orders   = $list = [];
34
$criteria = new \CriteriaCompo();
0 ignored issues
show
The type CriteriaCompo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
35
$criteria->add(new \Criteria('cmd_uid', $uid));
0 ignored issues
show
The type Criteria was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
36
$criteria->setSort('cmd_id');
37
$criteria->setOrder('DESC');
38
$db              = \XoopsDatabaseFactory::getDatabaseConnection();
0 ignored issues
show
The type XoopsDatabaseFactory was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

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