mambax7 /
cardealer
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
| 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 | /** |
||||
| 14 | * Module: cardealer |
||||
| 15 | * |
||||
| 16 | * @category Module |
||||
| 17 | * @package cardealer |
||||
| 18 | * @author XOOPS Development Team <[email protected]> - <https://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\Request; |
||||
| 26 | use XoopsModules\Cardealer; |
||||
| 27 | |||||
| 28 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_servpart_list0.tpl'; |
||||
| 29 | require __DIR__ . '/header.php'; |
||||
| 30 | $start = Request::getInt('start', 0); |
||||
| 31 | // Define Stylesheet |
||||
| 32 | $xoTheme->addStylesheet($stylesheet); |
||||
| 33 | |||||
| 34 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
||||
| 35 | |||||
| 36 | // Get Handler |
||||
| 37 | /** @var \XoopsPersistableObjectHandler $servpartHandler */ |
||||
| 38 | $servpartHandler = new Cardealer\ServpartHandler($db); |
||||
| 39 | |||||
| 40 | $servpartPaginationLimit = $helper->getConfig('userpager'); |
||||
| 41 | |||||
| 42 | $criteria = new \CriteriaCompo(); |
||||
| 43 | |||||
| 44 | $criteria->setOrder('DESC'); |
||||
| 45 | $criteria->setLimit($servpartPaginationLimit); |
||||
| 46 | $criteria->setStart($start); |
||||
| 47 | |||||
| 48 | $servpartCount = $servpartHandler->getCount($criteria); |
||||
| 49 | $servpartArray = $servpartHandler->getAll($criteria); |
||||
| 50 | |||||
| 51 | $op = Request::getCmd('op', ''); |
||||
| 52 | $id = Request::getInt('id', 0, 'GET'); |
||||
| 53 | |||||
| 54 | switch ($op) { |
||||
| 55 | case 'view': |
||||
| 56 | // viewItem(); |
||||
| 57 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_servpart.tpl'; |
||||
| 58 | $servpartPaginationLimit = 1; |
||||
| 59 | $myid = $id; |
||||
| 60 | //id |
||||
| 61 | $servpartObject = $servpartHandler->get($myid); |
||||
| 62 | |||||
| 63 | $criteria = new \CriteriaCompo(); |
||||
| 64 | $criteria->setSort('id'); |
||||
| 65 | $criteria->setOrder('DESC'); |
||||
| 66 | $criteria->setLimit($servpartPaginationLimit); |
||||
| 67 | $criteria->setStart($start); |
||||
| 68 | $servpart['id'] = $servpartObject->getVar('id'); |
||||
| 69 | /** @var \XoopsPersistableObjectHandler $partHandler */ |
||||
| 70 | $partHandler = new Cardealer\PartHandler($db); |
||||
| 71 | |||||
| 72 | $servpart['partnum'] = $partHandler->get($servpartObject->getVar('partnum'))->getVar('title'); |
||||
| 73 | /** @var \XoopsPersistableObjectHandler $serviceHandler */ |
||||
| 74 | $serviceHandler = new Cardealer\ServiceHandler($db); |
||||
| 75 | |||||
| 76 | $servpart['itemnum'] = $serviceHandler->get($servpartObject->getVar('itemnum'))->getVar('title'); |
||||
| 77 | $servpart['quantity'] = $servpartObject->getVar('quantity'); |
||||
| 78 | |||||
| 79 | // $GLOBALS['xoopsTpl']->append('servpart', $servpart); |
||||
| 80 | $keywords[] = $servpartObject->getVar('id'); |
||||
| 81 | |||||
| 82 | $GLOBALS['xoopsTpl']->assign('servpart', $servpart); |
||||
| 83 | $start = $id; |
||||
| 84 | |||||
| 85 | // Display Navigation |
||||
| 86 | if ($servpartCount > $servpartPaginationLimit) { |
||||
| 87 | |||||
| 88 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/servpart.php'); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 89 | xoops_load('XoopsPageNav'); |
||||
| 90 | $pagenav = new \XoopsPageNav($servpartCount, $servpartPaginationLimit, $start, 'op=view&id'); |
||||
| 91 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 92 | } |
||||
| 93 | |||||
| 94 | break; |
||||
| 95 | case 'list': |
||||
| 96 | default: |
||||
| 97 | // viewall(); |
||||
| 98 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_servpart_list0.tpl'; |
||||
| 99 | // require __DIR__ . '/header.php'; |
||||
| 100 | |||||
| 101 | if ($servpartCount > 0) { |
||||
| 102 | foreach (array_keys($servpartArray) as $i) { |
||||
| 103 | $servpart['id'] = $servpartArray[$i]->getVar('id'); |
||||
| 104 | /** @var \XoopsPersistableObjectHandler $partHandler */ |
||||
| 105 | $partHandler = new Cardealer\PartHandler($db); |
||||
| 106 | |||||
| 107 | $servpart['partnum'] = $partHandler->get($servpartArray[$i]->getVar('partnum'))->getVar('title'); |
||||
| 108 | /** @var \XoopsPersistableObjectHandler $serviceHandler */ |
||||
| 109 | $serviceHandler = new Cardealer\ServiceHandler($db); |
||||
| 110 | |||||
| 111 | $servpart['itemnum'] = $serviceHandler->get($servpartArray[$i]->getVar('itemnum'))->getVar('title'); |
||||
| 112 | $servpart['quantity'] = $servpartArray[$i]->getVar('quantity'); |
||||
| 113 | $GLOBALS['xoopsTpl']->append('servpart', $servpart); |
||||
| 114 | $keywords[] = $servpartArray[$i]->getVar('id'); |
||||
| 115 | unset($servpart); |
||||
| 116 | } |
||||
| 117 | // Display Navigation |
||||
| 118 | if ($servpartCount > $servpartPaginationLimit) { |
||||
| 119 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/servpart.php'); |
||||
| 120 | xoops_load('XoopsPageNav'); |
||||
| 121 | $pagenav = new \XoopsPageNav($servpartCount, $servpartPaginationLimit, $start, 'start'); |
||||
| 122 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 123 | } |
||||
| 124 | } |
||||
| 125 | } |
||||
| 126 | |||||
| 127 | //keywords |
||||
| 128 | if (isset($keywords)) { |
||||
| 129 | $utility::metaKeywords(xoops_getModuleOption('keywords', $moduleDirName) . ', ' . implode(', ', $keywords)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 130 | } |
||||
| 131 | //description |
||||
| 132 | $utility::metaDescription(MD_CARDEALER_SERVPART_DESC); |
||||
| 133 | // |
||||
| 134 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/servpart.php'); |
||||
| 135 | $GLOBALS['xoopsTpl']->assign('cardealer_url', CARDEALER_URL); |
||||
| 136 | $GLOBALS['xoopsTpl']->assign('adv', xoops_getModuleOption('advertise', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 137 | // |
||||
| 138 | $GLOBALS['xoopsTpl']->assign('bookmarks', xoops_getModuleOption('bookmarks', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 139 | $GLOBALS['xoopsTpl']->assign('fbcomments', xoops_getModuleOption('fbcomments', $moduleDirName)); |
||||
|
0 ignored issues
–
show
The function
xoops_getModuleOption() has been deprecated.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 140 | // |
||||
| 141 | $GLOBALS['xoopsTpl']->assign('admin', CARDEALER_ADMIN); |
||||
|
0 ignored issues
–
show
|
|||||
| 142 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
||||
| 143 | // |
||||
| 144 | require XOOPS_ROOT_PATH . '/footer.php'; |
||||
| 145 |