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_vehicle_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 $vehicleHandler */ |
||||
| 38 | $vehicleHandler = new Cardealer\VehicleHandler($db); |
||||
| 39 | |||||
| 40 | $vehiclePaginationLimit = $helper->getConfig('userpager'); |
||||
| 41 | |||||
| 42 | $criteria = new \CriteriaCompo(); |
||||
| 43 | |||||
| 44 | $criteria->setOrder('DESC'); |
||||
| 45 | $criteria->setLimit($vehiclePaginationLimit); |
||||
| 46 | $criteria->setStart($start); |
||||
| 47 | |||||
| 48 | $vehicleCount = $vehicleHandler->getCount($criteria); |
||||
| 49 | $vehicleArray = $vehicleHandler->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_vehicle.tpl'; |
||||
| 58 | $vehiclePaginationLimit = 1; |
||||
| 59 | $myid = $id; |
||||
| 60 | //id |
||||
| 61 | $vehicleObject = $vehicleHandler->get($myid); |
||||
| 62 | |||||
| 63 | $criteria = new \CriteriaCompo(); |
||||
| 64 | $criteria->setSort('id'); |
||||
| 65 | $criteria->setOrder('DESC'); |
||||
| 66 | $criteria->setLimit($vehiclePaginationLimit); |
||||
| 67 | $criteria->setStart($start); |
||||
| 68 | $vehicle['id'] = $vehicleObject->getVar('id'); |
||||
| 69 | /** @var \XoopsPersistableObjectHandler $customerHandler */ |
||||
| 70 | $customerHandler = new Cardealer\CustomerHandler($db); |
||||
| 71 | |||||
| 72 | $vehicle['custnum'] = $customerHandler->get($vehicleObject->getVar('custnum'))->getVar('custname'); |
||||
| 73 | $vehicle['make'] = $vehicleObject->getVar('make'); |
||||
| 74 | $vehicle['model'] = $vehicleObject->getVar('model'); |
||||
| 75 | $vehicle['year'] = $vehicleObject->getVar('year'); |
||||
| 76 | $vehicle['pictures'] = $vehicleObject->getVar('pictures'); |
||||
| 77 | $vehicle['serialnum'] = $vehicleObject->getVar('serialnum'); |
||||
| 78 | |||||
| 79 | // $GLOBALS['xoopsTpl']->append('vehicle', $vehicle); |
||||
| 80 | $keywords[] = $vehicleObject->getVar('serialnum'); |
||||
| 81 | |||||
| 82 | $GLOBALS['xoopsTpl']->assign('vehicle', $vehicle); |
||||
| 83 | $start = $id; |
||||
| 84 | |||||
| 85 | // Display Navigation |
||||
| 86 | if ($vehicleCount > $vehiclePaginationLimit) { |
||||
| 87 | |||||
| 88 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/vehicle.php'); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 89 | xoops_load('XoopsPageNav'); |
||||
| 90 | $pagenav = new \XoopsPageNav($vehicleCount, $vehiclePaginationLimit, $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_vehicle_list0.tpl'; |
||||
| 99 | // require __DIR__ . '/header.php'; |
||||
| 100 | |||||
| 101 | if ($vehicleCount > 0) { |
||||
| 102 | foreach (array_keys($vehicleArray) as $i) { |
||||
| 103 | $vehicle['id'] = $vehicleArray[$i]->getVar('id'); |
||||
| 104 | /** @var \XoopsPersistableObjectHandler $customerHandler */ |
||||
| 105 | $customerHandler = new Cardealer\CustomerHandler($db); |
||||
| 106 | |||||
| 107 | $vehicle['custnum'] = $customerHandler->get($vehicleArray[$i]->getVar('custnum'))->getVar('custname'); |
||||
| 108 | $vehicle['make'] = $vehicleArray[$i]->getVar('make'); |
||||
| 109 | $vehicle['model'] = $vehicleArray[$i]->getVar('model'); |
||||
| 110 | $vehicle['year'] = $vehicleArray[$i]->getVar('year'); |
||||
| 111 | $vehicle['pictures'] = $vehicleArray[$i]->getVar('pictures'); |
||||
| 112 | $vehicle['serialnum'] = $vehicleArray[$i]->getVar('serialnum'); |
||||
| 113 | $GLOBALS['xoopsTpl']->append('vehicle', $vehicle); |
||||
| 114 | $keywords[] = $vehicleArray[$i]->getVar('serialnum'); |
||||
| 115 | unset($vehicle); |
||||
| 116 | } |
||||
| 117 | // Display Navigation |
||||
| 118 | if ($vehicleCount > $vehiclePaginationLimit) { |
||||
| 119 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/vehicle.php'); |
||||
| 120 | xoops_load('XoopsPageNav'); |
||||
| 121 | $pagenav = new \XoopsPageNav($vehicleCount, $vehiclePaginationLimit, $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_VEHICLE_DESC); |
||||
| 133 | // |
||||
| 134 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', CARDEALER_URL . '/vehicle.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 |