statDetails()   B
last analyzed

Complexity

Conditions 7
Paths 7

Size

Total Lines 45
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 40
c 3
b 0
f 0
dl 0
loc 45
rs 8.3466
cc 7
nc 7
nop 4
1
<?php
2
3
use XoopsModules\Statistics\Utility;
4
5
require_once dirname(dirname(__DIR__)) . '/mainfile.php';
6
//require_once __DIR__ . '/include/statutils.php';
7
8
$op = \Xmf\Request::getCmd('op', 'main');
9
if (\Xmf\Request::hasVar('year', 'GET')) {
10
    $year = $_GET['year'];
11
}
12
if (\Xmf\Request::hasVar('month', 'GET')) {
13
    $month = $_GET['month'];
14
}
15
if (\Xmf\Request::hasVar('date', 'GET')) {
16
    $date = $_GET['date'];
17
}
18
19
require_once XOOPS_ROOT_PATH . '/header.php';
20
21
function statDetails($op, $year, $month, $date)
22
{
23
    global $xoopsTpl, $xoopsOption;
24
25
    $xoopsTpl->assign('lang_stat_thissite', $_SERVER['HTTP_HOST']);
26
27
    $l_size = getimagesize('assets/images/leftbar.gif');
0 ignored issues
show
Unused Code introduced by
The assignment to $l_size is dead and can be removed.
Loading history...
28
    $m_size = getimagesize('assets/images/mainbar.gif');
0 ignored issues
show
Unused Code introduced by
The assignment to $m_size is dead and can be removed.
Loading history...
29
    $r_size = getimagesize('assets/images/rightbar.gif');
0 ignored issues
show
Unused Code introduced by
The assignment to $r_size is dead and can be removed.
Loading history...
30
31
    switch ($op) {
32
        case b_yearlystats:
0 ignored issues
show
Bug introduced by
The constant b_yearlystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
33
            $GLOBALS['xoopsOption']['template_main'] = 'y_statdetails.tpl';
34
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_BHITDETAIL);
35
            Utility::getBlockedMonthlyStats($year);
36
            break;
37
        case b_monthlystats:
0 ignored issues
show
Bug introduced by
The constant b_monthlystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
38
            $GLOBALS['xoopsOption']['template_main'] = 'm_statdetails.tpl';
39
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_BHITDETAIL);
40
            Utility::getBlockedDailyStats($year, $month);
41
            break;
42
        case b_dailystats:
0 ignored issues
show
Bug introduced by
The constant b_dailystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
43
            $GLOBALS['xoopsOption']['template_main'] = 'd_statdetails.tpl';
44
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_BHITDETAIL);
45
            Utility::getBlockedHourlyStats($year, $month, $date);
46
            break;
47
        case yearlystats:
0 ignored issues
show
Bug introduced by
The constant yearlystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
48
            $GLOBALS['xoopsOption']['template_main'] = 'y_statdetails.tpl';
49
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_HITDETAIL);
50
            Utility::getMonthlyStats($year);
51
            break;
52
        case monthlystats:
0 ignored issues
show
Bug introduced by
The constant monthlystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
53
            $GLOBALS['xoopsOption']['template_main'] = 'm_statdetails.tpl';
54
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_HITDETAIL);
55
            Utility::getDailyStats($year, $month);
56
            break;
57
        case dailystats:
0 ignored issues
show
Bug introduced by
The constant dailystats was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
58
            $GLOBALS['xoopsOption']['template_main'] = 'd_statdetails.tpl';
59
            $xoopsTpl->assign('lang_stat_hitdetail', STATS_HITDETAIL);
60
            Utility::getHourlyStats($year, $month, $date);
61
            break;
62
        default:
63
            $GLOBALS['xoopsOption']['template_main'] = 'statdetails.tpl';
64
            $xoopsTpl->assign('lang_stat_invalidoperation', STATS_INVALIDOPERATION);
65
            break;
66
    }
67
}
68
69
statDetails($op, $year, $month, $date);
70
71
require_once XOOPS_ROOT_PATH . '/footer.php';
72