1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
You may not change or alter any portion of this comment or credits |
5
|
|
|
of supporting developers from this source code or any supporting source code |
6
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
7
|
|
|
|
8
|
|
|
This program is distributed in the hope that it will be useful, |
9
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
*/ |
12
|
|
|
/** |
13
|
|
|
* Module: Equipment |
14
|
|
|
* |
15
|
|
|
* @category Module |
16
|
|
|
* @package equipment |
17
|
|
|
* @author swt02026 (https://github.com/swt02026/) |
18
|
|
|
* @author XOOPS Development Team <http://xoops.org> |
19
|
|
|
* @copyright {@link https://xoops.org/ XOOPS Project} |
20
|
|
|
* @license GPL 2.0 or later |
21
|
|
|
* @link https://xoops.org/ |
22
|
|
|
* @since 1.0.0 |
23
|
|
|
*/ |
24
|
|
|
|
25
|
|
|
use Xmf\Module\Admin; |
26
|
|
|
|
27
|
|
|
use Xmf\Request; |
28
|
|
|
|
29
|
|
|
require_once __DIR__ . '/admin_header.php'; |
30
|
|
|
// Display Admin header |
31
|
|
|
xoops_cp_header(); |
32
|
|
|
//count "total Equipment" |
33
|
|
|
/** @var XoopsPersistableObjectHandler $equipmentHandler */ |
34
|
|
|
$totalEquipment = $equipmentHandler->getCount(); |
35
|
|
|
//count "total Rentals" |
36
|
|
|
/** @var XoopsPersistableObjectHandler $rentalsHandler */ |
37
|
|
|
$totalRentals = $rentalsHandler->getCount(); |
38
|
|
|
//count "total Customer" |
39
|
|
|
/** @var XoopsPersistableObjectHandler $customerHandler */ |
40
|
|
|
$totalCustomer = $customerHandler->getCount(); |
41
|
|
|
// InfoBox Statistics |
42
|
|
|
$adminObject->addInfoBox(AM_EQUIPMENT_STATISTICS); |
43
|
|
|
|
44
|
|
|
// InfoBox equipment |
45
|
|
|
$adminObject->addInfoBoxLine(sprintf(AM_EQUIPMENT_THEREARE_EQUIPMENT, $totalEquipment)); |
46
|
|
|
|
47
|
|
|
// InfoBox rentals |
48
|
|
|
$adminObject->addInfoBoxLine(sprintf(AM_EQUIPMENT_THEREARE_RENTALS, $totalRentals)); |
49
|
|
|
|
50
|
|
|
// InfoBox customer |
51
|
|
|
$adminObject->addInfoBoxLine(sprintf(AM_EQUIPMENT_THEREARE_CUSTOMER, $totalCustomer)); |
52
|
|
|
// Render Index |
|
|
|
|
53
|
|
|
//echo $adminObject->displayNavigation(basename(__FILE__)); |
54
|
|
|
//echo $adminObject->displayIndex(); |
55
|
|
|
|
56
|
|
|
//---------------- XMF ------------------- |
57
|
|
|
// code marker |
58
|
|
|
$adminObject->displayNavigation(basename(__FILE__)); |
59
|
|
|
$adminObject->addConfigModuleVersion('system', 212); |
60
|
|
|
//$adminObject->addConfigWarning('These are just examples!'); |
|
|
|
|
61
|
|
|
//$adminObject->addConfigBoxLine('notarealmodule', 'module'); |
62
|
|
|
//$adminObject->addConfigBoxLine(array('notarealmodule', 'warning'), 'module'); |
63
|
|
|
|
64
|
|
|
require_once __DIR__ . '/../testdata/index.php'; |
65
|
|
|
$adminObject->addItemButton(AM_EQUIPMENT_ADD_SAMPLEDATA, '__DIR__ . /../../testdata/index.php?op=load', 'add'); |
66
|
|
|
$adminObject->displayButton('left', ''); |
67
|
|
|
|
68
|
|
|
$adminObject->displayIndex(); |
69
|
|
|
|
70
|
|
|
require_once __DIR__ . '/admin_footer.php'; |
71
|
|
|
|
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.