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_service_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 $serviceHandler */ |
||||
| 38 | $serviceHandler = new Cardealer\ServiceHandler($db); |
||||
| 39 | |||||
| 40 | $servicePaginationLimit = $helper->getConfig('userpager'); |
||||
| 41 | |||||
| 42 | $criteria = new \CriteriaCompo(); |
||||
| 43 | |||||
| 44 | $criteria->setOrder('DESC'); |
||||
| 45 | $criteria->setLimit($servicePaginationLimit); |
||||
| 46 | $criteria->setStart($start); |
||||
| 47 | |||||
| 48 | $serviceCount = $serviceHandler->getCount($criteria); |
||||
| 49 | $serviceArray = $serviceHandler->getAll($criteria); |
||||
| 50 | |||||
| 51 | $op = Request::getCmd('op', ''); |
||||
| 52 | $itemnum = Request::getInt('itemnum', 0, 'GET'); |
||||
| 53 | |||||
| 54 | switch ($op) { |
||||
| 55 | case 'view': |
||||
| 56 | // viewItem(); |
||||
| 57 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_service.tpl'; |
||||
| 58 | $servicePaginationLimit = 1; |
||||
| 59 | $myid = $itemnum; |
||||
| 60 | //itemnum |
||||
| 61 | $serviceObject = $serviceHandler->get($myid); |
||||
| 62 | |||||
| 63 | $criteria = new \CriteriaCompo(); |
||||
| 64 | $criteria->setSort('itemnum'); |
||||
| 65 | $criteria->setOrder('DESC'); |
||||
| 66 | $criteria->setLimit($servicePaginationLimit); |
||||
| 67 | $criteria->setStart($start); |
||||
| 68 | $service['itemnum'] = $serviceObject->getVar('itemnum'); |
||||
| 69 | $service['labor'] = $serviceObject->getVar('labor'); |
||||
| 70 | $service['title'] = $serviceObject->getVar('title'); |
||||
| 71 | $service['description'] = $serviceObject->getVar('description'); |
||||
| 72 | |||||
| 73 | // $GLOBALS['xoopsTpl']->append('service', $service); |
||||
| 74 | $keywords[] = $serviceObject->getVar('title'); |
||||
| 75 | |||||
| 76 | $GLOBALS['xoopsTpl']->assign('service', $service); |
||||
| 77 | $start = $itemnum; |
||||
| 78 | |||||
| 79 | // Display Navigation |
||||
| 80 | if ($serviceCount > $servicePaginationLimit) { |
||||
| 81 | |||||
| 82 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/service.php'); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 83 | xoops_load('XoopsPageNav'); |
||||
| 84 | $pagenav = new \XoopsPageNav($serviceCount, $servicePaginationLimit, $start, 'op=view&itemnum'); |
||||
| 85 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 86 | } |
||||
| 87 | |||||
| 88 | break; |
||||
| 89 | case 'list': |
||||
| 90 | default: |
||||
| 91 | // viewall(); |
||||
| 92 | $GLOBALS['xoopsOption']['template_main'] = 'cardealer_service_list0.tpl'; |
||||
| 93 | // require __DIR__ . '/header.php'; |
||||
| 94 | |||||
| 95 | if ($serviceCount > 0) { |
||||
| 96 | foreach (array_keys($serviceArray) as $i) { |
||||
| 97 | $service['itemnum'] = $serviceArray[$i]->getVar('itemnum'); |
||||
| 98 | $service['labor'] = $serviceArray[$i]->getVar('labor'); |
||||
| 99 | $service['title'] = $serviceArray[$i]->getVar('title'); |
||||
| 100 | $service['description'] = $serviceArray[$i]->getVar('description'); |
||||
| 101 | $GLOBALS['xoopsTpl']->append('service', $service); |
||||
| 102 | $keywords[] = $serviceArray[$i]->getVar('title'); |
||||
| 103 | unset($service); |
||||
| 104 | } |
||||
| 105 | // Display Navigation |
||||
| 106 | if ($serviceCount > $servicePaginationLimit) { |
||||
| 107 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/service.php'); |
||||
| 108 | xoops_load('XoopsPageNav'); |
||||
| 109 | $pagenav = new \XoopsPageNav($serviceCount, $servicePaginationLimit, $start, 'start'); |
||||
| 110 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
||||
| 111 | } |
||||
| 112 | } |
||||
| 113 | } |
||||
| 114 | |||||
| 115 | //keywords |
||||
| 116 | if (isset($keywords)) { |
||||
| 117 | $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...
|
|||||
| 118 | } |
||||
| 119 | //description |
||||
| 120 | $utility::metaDescription(MD_CARDEALER_SERVICE_DESC); |
||||
| 121 | // |
||||
| 122 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/service.php'); |
||||
| 123 | $GLOBALS['xoopsTpl']->assign('cardealer_url', CARDEALER_URL); |
||||
| 124 | $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...
|
|||||
| 125 | // |
||||
| 126 | $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...
|
|||||
| 127 | $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...
|
|||||
| 128 | // |
||||
| 129 | $GLOBALS['xoopsTpl']->assign('admin', CARDEALER_ADMIN); |
||||
|
0 ignored issues
–
show
|
|||||
| 130 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
||||
| 131 | // |
||||
| 132 | require XOOPS_ROOT_PATH . '/footer.php'; |
||||
| 133 |