mambax7 /
pedigree
| 1 | <?php |
||
| 2 | // ------------------------------------------------------------------------- |
||
| 3 | |||
| 4 | use XoopsModules\Pedigree; |
||
| 5 | |||
| 6 | //require_once dirname(dirname(__DIR__)) . '/mainfile.php'; |
||
| 7 | require_once __DIR__ . '/header.php'; |
||
| 8 | $moduleDirName = basename(__DIR__); |
||
| 9 | xoops_loadLanguage('main', $moduleDirName); |
||
| 10 | include XOOPS_ROOT_PATH . '/header.php'; |
||
| 11 | // Include any common code for this module. |
||
| 12 | require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php'; |
||
| 13 | |||
| 14 | global $xoopsTpl, $xoopsDB; |
||
| 15 | |||
| 16 | //get module configuration |
||
| 17 | /** @var XoopsModuleHandler $moduleHandler */ |
||
| 18 | $moduleHandler = xoops_getHandler('module'); |
||
| 19 | $module = $moduleHandler->getByDirname($moduleDirName); |
||
| 20 | $configHandler = xoops_getHandler('config'); |
||
| 21 | $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 22 | |||
| 23 | echo '<form method="post" action="convert.php">convert:<input type="text" name="van">'; |
||
| 24 | echo 'to:<input type="text" name="naar">'; |
||
| 25 | echo '<input type="submit"></form>'; |
||
| 26 | |||
| 27 | if ('' != $_POST['naar']) { |
||
| 28 | $query = 'update ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " set user4 = '" . $_POST['naar'] . "' where user4 = '" . $_POST['van'] . "'"; |
||
| 29 | echo $query . '<br>'; |
||
| 30 | $GLOBALS['xoopsDB']->query($query); |
||
| 31 | } |
||
| 32 | |||
| 33 | $result = $GLOBALS['xoopsDB']->query("SELECT user4, count('user4') AS X FROM " . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " GROUP BY 'user4'"); |
||
| 34 | $count = 0; |
||
| 35 | $total = 0; |
||
| 36 | while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) { |
||
| 37 | ++$count; |
||
| 38 | echo $row['user4'] . ' - ' . $row['X'] . '<br>'; |
||
| 39 | $total += $row['X']; |
||
| 40 | } |
||
| 41 | echo '<hr>' . $count . '-' . $total; |
||
| 42 | |||
| 43 | //comments and footer |
||
| 44 | include XOOPS_ROOT_PATH . '/footer.php'; |
||
| 45 |