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 XOOPS Project (http://xoops.org) |
14
|
|
|
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
15
|
|
|
* @package |
16
|
|
|
* @since |
17
|
|
|
* @author XOOPS Development Team |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
21
|
|
|
include_once __DIR__ . '/admin_header.php'; |
22
|
|
|
|
23
|
|
|
xoops_cp_header(); |
24
|
|
|
|
25
|
|
|
$indexAdmin = new ModuleAdmin(); |
26
|
|
|
|
27
|
|
|
$folder = array( |
28
|
|
|
XOOPS_ROOT_PATH . '/uploads/smartpartner/images/', |
29
|
|
|
XOOPS_ROOT_PATH . '/uploads/smartpartner/images/category/' |
30
|
|
|
); |
31
|
|
|
//--------------------- |
32
|
|
|
|
33
|
|
|
// Creating the Partner handler object |
34
|
|
|
$smartPartnerPartnerHandler = smartpartner_gethandler('partner'); |
35
|
|
|
|
36
|
|
|
// Total Partners -- includes everything on the table |
37
|
|
|
$totalpartners = $smartPartnerPartnerHandler->getPartnerCount(_SPARTNER_STATUS_ALL); |
38
|
|
|
|
39
|
|
|
// Total Submitted Partners |
40
|
|
|
$totalsubmitted = $smartPartnerPartnerHandler->getPartnerCount(_SPARTNER_STATUS_SUBMITTED); |
41
|
|
|
|
42
|
|
|
// Total active Partners |
43
|
|
|
$totalactive = $smartPartnerPartnerHandler->getPartnerCount(_SPARTNER_STATUS_ACTIVE); |
44
|
|
|
|
45
|
|
|
// Total inactive Partners |
46
|
|
|
$totalinactive = $smartPartnerPartnerHandler->getPartnerCount(_SPARTNER_STATUS_INACTIVE); |
47
|
|
|
|
48
|
|
|
// Total rejected Partners |
49
|
|
|
$totalrejected = $smartPartnerPartnerHandler->getPartnerCount(_SPARTNER_STATUS_REJECTED); |
50
|
|
|
|
51
|
|
|
//create info block |
52
|
|
|
$indexAdmin->addInfoBox(_AM_SPARTNER_INVENTORY); |
53
|
|
|
|
54
|
|
View Code Duplication |
if ($totalsubmitted > 0) { |
|
|
|
|
55
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . '<a href="category.php">' . _AM_SPARTNER_TOTAL_SUBMITTED . '</a><b>' . '</infolabel>', $totalsubmitted, 'Green'); |
56
|
|
|
} else { |
57
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . _AM_SPARTNER_TOTAL_SUBMITTED . '</infolabel>', $totalsubmitted, 'Green'); |
58
|
|
|
} |
59
|
|
View Code Duplication |
if ($totalactive > 0) { |
|
|
|
|
60
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . '<a href="partner.php">' . _AM_SPARTNER_TOTAL_ACTIVE . '</a><b>' . '</infolabel>', $totalactive, 'Green'); |
61
|
|
|
} else { |
62
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . _AM_SPARTNER_TOTAL_ACTIVE . '</infolabel>', $totalactive, 'Green'); |
63
|
|
|
} |
64
|
|
View Code Duplication |
if ($totalrejected > 0) { |
|
|
|
|
65
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . '<a href="main.php">' . _AM_SPARTNER_TOTAL_REJECTED . '</a><b>' . '</infolabel>', $totalrejected, 'Green'); |
66
|
|
|
} else { |
67
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . _AM_SPARTNER_TOTAL_REJECTED . '</infolabel>', $totalrejected, 'Green'); |
68
|
|
|
} |
69
|
|
View Code Duplication |
if ($totalinactive > 0) { |
|
|
|
|
70
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . '<a href="main.php">' . _AM_SPARTNER_TOTAL_INACTIVE . '</a><b>' . '</infolabel>', $totalinactive, 'Green'); |
71
|
|
|
} else { |
72
|
|
|
$indexAdmin->addInfoBoxLine(_AM_SPARTNER_INVENTORY, '<infolabel>' . _AM_SPARTNER_TOTAL_INACTIVE . '</infolabel>', $totalinactive, 'Green'); |
73
|
|
|
} |
74
|
|
|
//--------------------- |
75
|
|
|
|
76
|
|
|
foreach (array_keys($folder) as $i) { |
77
|
|
|
$indexAdmin->addConfigBoxLine($folder[$i], 'folder'); |
78
|
|
|
$indexAdmin->addConfigBoxLine(array($folder[$i], '777'), 'chmod'); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
echo $indexAdmin->addNavigation(basename(__FILE__)); |
82
|
|
|
echo $indexAdmin->renderIndex(); |
83
|
|
|
|
84
|
|
|
include_once __DIR__ . '/admin_footer.php'; |
85
|
|
|
|
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.