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 | * @copyright {@link https://xoops.org/ XOOPS Project} |
||||
14 | * @license {@link http://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
||||
15 | * @package efqdirectory |
||||
16 | * @since |
||||
17 | * @author Martijn Hertog (aka wtravel) |
||||
18 | * @author XOOPS Development Team, |
||||
19 | */ |
||||
20 | |||||
21 | require_once __DIR__ . '/admin_header.php'; |
||||
22 | //include __DIR__ . '/../../../include/cp_header.php'; |
||||
0 ignored issues
–
show
|
|||||
23 | //$mydirname = $xoopsModule->getVar('dirname'); |
||||
24 | |||||
25 | xoops_cp_header(); |
||||
0 ignored issues
–
show
The function
xoops_cp_header was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
26 | include __DIR__ . '/../include/functions.php'; |
||||
27 | |||||
28 | //adminmenu(-1); |
||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
67% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||||
29 | View Code Duplication | if (file_exists(__DIR__ . '/../language/' . $xoopsConfig['language'] . '/main.php')) { |
|||
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||||
30 | include __DIR__ . '/../language/' . $xoopsConfig['language'] . '/main.php'; |
||||
31 | } else { |
||||
32 | include __DIR__ . '/../language/english/main.php'; |
||||
33 | } |
||||
34 | |||||
35 | $couponHandler = xoops_getModuleHandler('coupon', $moddir); |
||||
0 ignored issues
–
show
The function
xoops_getModuleHandler was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
36 | //$couponHandler = new ListingsCouponHandler; |
||||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
38% of this comment could be valid code. Did you maybe forget this after debugging?
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it. The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production. This check looks for comments that seem to be mostly valid code and reports them. ![]() |
|||||
37 | |||||
38 | if (!isset($_GET['op'])) { |
||||
39 | header('location', 'index.php'); |
||||
0 ignored issues
–
show
'index.php' of type string is incompatible with the type boolean expected by parameter $replace of header() .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
40 | } |
||||
41 | $op = trim($_GET['op']); |
||||
42 | $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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||
43 | |||||
44 | switch ($op) { |
||||
45 | case 'expired': |
||||
46 | $criteria->add(new Criteria('expire', time(), '<')); |
||||
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||||
47 | $criteria->add(new Criteria('expire', '0', '!=')); |
||||
48 | break; |
||||
49 | |||||
50 | case 'noexp': |
||||
51 | $criteria->add(new Criteria('expire', '0', '=')); |
||||
52 | break; |
||||
53 | |||||
54 | case 'future': |
||||
55 | $criteria->add(new Criteria('publish', time(), '>')); |
||||
56 | break; |
||||
57 | } |
||||
58 | $coupons = $couponHandler->getObjects($criteria, false); |
||||
59 | $coupons = $couponHandler->prepare2show($coupons); |
||||
60 | $output = '<table>'; |
||||
61 | foreach ($coupons as $catid => $category) { |
||||
62 | $output .= '<tr> |
||||
63 | <th colspan="2"> |
||||
64 | ' . $category['catTitle'] . '; |
||||
65 | </th> |
||||
66 | </tr>'; |
||||
67 | foreach ($category['coupons'] as $key => $coupon) { |
||||
68 | if (!isset($class) || ($class !== 'odd')) { |
||||
69 | $class = 'odd'; |
||||
70 | } else { |
||||
71 | $class = 'even'; |
||||
72 | } |
||||
73 | $output .= "<tr class='" . $class . '\'> |
||||
74 | <td>'; |
||||
75 | $output .= '<a href="' . XOOPS_URL . '/modules/' . $moddir . '/addcoupon.php?couponid=' . $coupon['couponid'] . '"><img src="' . XOOPS_URL . '/modules/' . $mydirname . '/assets/images/editicon.gif" alt="' . _MD_EDITCOUPON . '"></a> |
||||
0 ignored issues
–
show
|
|||||
76 | <a href="' . XOOPS_URL . '/modules/' . $moddir . '/singlelink.php?lid=' . $coupon['lid'] . '">' . $coupon['linkTitle'] . '</a><br> |
||||
77 | <br> |
||||
78 | ' . _MD_PUBLISHEDON . ' ' . $coupon['publish']; |
||||
79 | if ($coupon['expire'] > 0) { |
||||
80 | $output .= '<br>' . _MD_EXPIRESON . $coupon['expire']; |
||||
81 | } |
||||
82 | $output .= '<br>' . _MD_COUPONHITS . ' : ' . $coupon['counter']; |
||||
83 | $output .= '</div> |
||||
84 | </td> |
||||
85 | <td valign="top">' . $coupon['heading'] . '<br>' . $coupon['description'] . '</td> |
||||
86 | </tr> |
||||
87 | <tr> |
||||
88 | <td colspan="2" class="foot"> |
||||
89 | <a href="' . XOOPS_URL . '/modules/' . $moddir . '/addcoupon.php?couponid=' . $coupon['couponid'] . '">' . _MD_EDITCOUPON . '</a> |
||||
90 | </tr>'; |
||||
91 | } |
||||
92 | } |
||||
93 | $output .= '</table>'; |
||||
94 | if (count($coupons) < 1) { |
||||
95 | $output = _MD_NOSAVINGS; |
||||
96 | } |
||||
97 | |||||
98 | echo $output; |
||||
99 | |||||
100 | xoops_cp_footer(); |
||||
0 ignored issues
–
show
The function
xoops_cp_footer was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||
101 | echo '<p class="mytext"> </p>'; |
||||
102 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.