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