Passed
Push — master ( 564764...ba995b )
by Michael
03:51
created

convert.php (1 issue)

Labels
Severity
1
<?php
2
// -------------------------------------------------------------------------
3
4
//require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
5
require_once __DIR__ . '/header.php';
6
$moduleDirName = basename(__DIR__);
7
xoops_loadLanguage('main', $moduleDirName);
8
include XOOPS_ROOT_PATH . '/header.php';
9
// Include any common code for this module.
10
require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
11
12
global $xoopsTpl, $xoopsDB;
13
14
//get module configuration
15
/** @var XoopsModuleHandler $moduleHandler */
16
$moduleHandler = xoops_getHandler('module');
17
$module = $moduleHandler->getByDirname($moduleDirName);
18
$configHandler = xoops_getHandler('config');
19
$moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid'));
0 ignored issues
show
The method getConfigsByCat() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
$moduleConfig = $configHandler->/** @scrutinizer ignore-call */ getConfigsByCat(0, $module->getVar('mid'));
Loading history...
20
21
echo '<form method="post" action="convert.php">convert:<input type="text" name="van">';
22
echo 'to:<input type="text" name="naar">';
23
echo '<input type="submit"></form>';
24
25
if ('' != $_POST['naar']) {
26
    $query = 'update ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " set user4 = '" . $_POST['naar'] . "' where user4 = '" . $_POST['van'] . "'";
27
    echo $query . '<br>';
28
    $GLOBALS['xoopsDB']->query($query);
29
}
30
31
$result = $GLOBALS['xoopsDB']->query("SELECT user4, count('user4') AS X FROM " . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " GROUP BY 'user4'");
32
$count = 0;
33
$total = 0;
34
while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
35
    ++$count;
36
    echo $row['user4'] . ' - ' . $row['X'] . '<br>';
37
    $total += $row['X'];
38
}
39
echo '<hr>' . $count . '-' . $total;
40
41
//comments and footer
42
include XOOPS_ROOT_PATH . '/footer.php';
43