Completed
Push — master ( c8eead...62889a )
by Michael
04:13
created

convert.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
// -------------------------------------------------------------------------
3
4
require_once dirname(dirname(__DIR__)) . '/mainfile.php';
5
6
/*
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
7
if (file_exists(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/language/" . $xoopsConfig['language'] . "/main.php")) {
8
    require_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/language/" . $xoopsConfig['language'] . "/main.php";
9
} else {
10
    include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/language/english/main.php";
11
}
12
*/
13
14
xoops_loadLanguage('main', basename(dirname(__DIR__)));
15
16
include XOOPS_ROOT_PATH . '/header.php';
17
// Include any common code for this module.
18
require_once(XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->dirname() . "/include/functions.php");
19
20
global $xoopsTpl, $xoopsDB;
21
22
//get module configuration
23
$module_handler =& xoops_gethandler('module');
24
$module         =& $module_handler->getByDirname("pedigree");
25
$config_handler =& xoops_gethandler('config');
26
$moduleConfig   =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
27
28
echo "<form method=\"post\" action=\"convert.php\">convert:<input type=\"text\" name=\"van\">";
29
echo "to:<input type=\"text\" name=\"naar\">";
30
echo "<input type=\"submit\"></form>";
31
32 View Code Duplication
if ($_POST['naar'] != "") {
33
    $query = "update " . $xoopsDB->prefix("pedigree_tree") . " set user4 = '" . $_POST['naar'] . "' where user4 = '" . $_POST['van'] . "'";
34
    echo $query . "<br />";
35
    $xoopsDB->queryF($query);
36
}
37
38
$result = $xoopsDB->query("select user4, count('user4') as X from " . $xoopsDB->prefix("pedigree_tree") . " group by 'user4'");
39
$count  = 0;
40
$total  = 0;
41
while ($row = $xoopsDB->fetchArray($result)) {
42
    ++$count;
43
    echo $row['user4'] . " - " . $row['X'] . "<br>";
44
    $total = $total + $row['X'];
45
}
46
echo "<hr>" . $count . "-" . $total;
47
48
//comments and footer
49
include XOOPS_ROOT_PATH . "/footer.php";
50