Passed
Push — master ( 48d769...5ccf6e )
by Michael
07:14
created
include/functions.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     $max_imgheight     = $GLOBALS['xoopsModuleConfig']['maximgheight']; //1000;
67 67
     $allowed_mimetypes = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png'];
68 68
     //    $img_dir = XOOPS_ROOT_PATH . "/modules/" . $GLOBALS['xoopsModule']->dirname() . "/images" ;
69
-    $img_dir = $GLOBALS['xoopsModuleConfig']['uploaddir'] . '/images';
69
+    $img_dir = $GLOBALS['xoopsModuleConfig']['uploaddir'].'/images';
70 70
     require_once $GLOBALS['xoops']->path('class/uploader.php');
71 71
     $field = $_POST['xoops_upload_file'][$num];
72 72
     if (!empty($field) || '' != $field) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     */
122 122
 
123 123
     // load the image
124
-    require_once $GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModule']->dirname() . '/library/Zebra_Image.php');
124
+    require_once $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModule']->dirname().'/library/Zebra_Image.php');
125 125
     $thumbnail_widths = [150, 400];
126 126
 
127 127
     // indicate a target image
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
     // create a new instance of the class
134 134
     $image = new Zebra_Image();
135 135
     // indicate a source image (a GIF, PNG or JPEG file)
136
-    $image->source_path = PEDIGREE_UPLOAD_PATH . "/images/{$filename}";
136
+    $image->source_path = PEDIGREE_UPLOAD_PATH."/images/{$filename}";
137 137
 
138 138
     foreach ($thumbnail_widths as $thumbnail_width) {
139 139
 
140 140
         // generate & output thumbnail
141
-        $output_filename    = PEDIGREE_UPLOAD_PATH . '/images/thumbnails/' . basename($filename) . "_{$thumbnail_width}.{$config_output_format}";
141
+        $output_filename    = PEDIGREE_UPLOAD_PATH.'/images/thumbnails/'.basename($filename)."_{$thumbnail_width}.{$config_output_format}";
142 142
         $image->target_path = $output_filename;
143 143
         // since in this example we're going to have a jpeg file, let's set the output
144 144
         // image's quality
@@ -293,17 +293,17 @@  discard block
 block discarded – undo
293 293
             $x = $columns[$i]['columnnumber'];
294 294
             if (is_array($columns[$i]['lookupval'])) {
295 295
                 foreach ($columns[$i]['lookupval'] as $key => $keyValue) {
296
-                    if ($keyValue['id'] == $rowResult['user' . $x]) {
296
+                    if ($keyValue['id'] == $rowResult['user'.$x]) {
297 297
                         $value = $keyValue['value'];
298 298
                     }
299 299
                 }
300 300
                 //debug information
301 301
                 ///echo $columns[$i]['columnname']."is an array !";
302 302
             } //format value - cant use object because of query count
303
-            elseif (0 === strncmp($rowResult['user' . $x], 'http://', 7)) {
304
-                $value = '<a href="' . $rowResult['user' . $x] . '">' . $rowResult['user' . $x] . '</a>';
303
+            elseif (0 === strncmp($rowResult['user'.$x], 'http://', 7)) {
304
+                $value = '<a href="'.$rowResult['user'.$x].'">'.$rowResult['user'.$x].'</a>';
305 305
             } else {
306
-                $value = $rowResult['user' . $x];
306
+                $value = $rowResult['user'.$x];
307 307
             }
308 308
             $columnvalue[] = ['value' => $value];
309 309
         }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             'id'          => $rowResult['d_id'],
312 312
             'name'        => $name,
313 313
             'gender'      => $gender,
314
-            'link'        => '<a href="dog.php?id=' . $rowResult['d_id'] . '">' . $name . '</a>',
314
+            'link'        => '<a href="dog.php?id='.$rowResult['d_id'].'">'.$name.'</a>',
315 315
             'colour'      => '',
316 316
             'number'      => '',
317 317
             'usercolumns' => $columnvalue
@@ -332,9 +332,9 @@  discard block
 block discarded – undo
332 332
 {
333 333
     global $numofcolumns1, $nummatch1, $pages1, $columns1, $dogs1;
334 334
     if ('0' == $pa && '0' == $ma) {
335
-        $sqlQuery = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE father = ' . $pa . ' AND mother = ' . $ma . ' AND id != ' . $oid . " AND father != '0' AND mother !='0' ORDER BY naam";
335
+        $sqlQuery = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE father = '.$pa.' AND mother = '.$ma.' AND id != '.$oid." AND father != '0' AND mother !='0' ORDER BY naam";
336 336
     } else {
337
-        $sqlQuery = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE father = ' . $pa . ' AND mother = ' . $ma . ' AND id != ' . $oid . ' ORDER BY naam';
337
+        $sqlQuery = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE father = '.$pa.' AND mother = '.$ma.' AND id != '.$oid.' ORDER BY naam';
338 338
     }
339 339
     $queryResult = $GLOBALS['xoopsDB']->query($sqlQuery);
340 340
     $nummatch1   = $GLOBALS['xoopsDB']->getRowsNum($queryResult);
@@ -381,17 +381,17 @@  discard block
 block discarded – undo
381 381
             $x = $columns1[$i]['columnnumber'];
382 382
             if (is_array($columns1[$i]['lookupval'])) {
383 383
                 foreach ($columns1[$i]['lookupval'] as $key => $keyValue) {
384
-                    if ($keyValue['id'] == $rowResult['user' . $x]) {
384
+                    if ($keyValue['id'] == $rowResult['user'.$x]) {
385 385
                         $value = $keyValue['value'];
386 386
                     }
387 387
                 }
388 388
                 //debug information
389 389
                 ///echo $columns[$i]['columnname']."is an array !";
390 390
             } //format value - cant use object because of query count
391
-            elseif (0 === strncmp($rowResult['user' . $x], 'http://', 7)) {
392
-                $value = '<a href="' . $rowResult['user' . $x] . '">' . $rowResult['user' . $x] . '</a>';
391
+            elseif (0 === strncmp($rowResult['user'.$x], 'http://', 7)) {
392
+                $value = '<a href="'.$rowResult['user'.$x].'">'.$rowResult['user'.$x].'</a>';
393 393
             } else {
394
-                $value = $rowResult['user' . $x];
394
+                $value = $rowResult['user'.$x];
395 395
             }
396 396
             $columnvalue1[] = ['value' => $value];
397 397
         }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             'id'          => $rowResult['id'],
400 400
             'name'        => $name,
401 401
             'gender'      => $gender,
402
-            'link'        => '<a href="dog.php?id=' . $rowResult['id'] . '">' . $name . '</a>',
402
+            'link'        => '<a href="dog.php?id='.$rowResult['id'].'">'.$name.'</a>',
403 403
             'colour'      => '',
404 404
             'number'      => '',
405 405
             'usercolumns' => $columnvalue1
@@ -420,9 +420,9 @@  discard block
 block discarded – undo
420 420
     $content = '';
421 421
 
422 422
     if (0 == $breeder) {
423
-        $sqlQuery = 'SELECT id, naam, roft FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id_owner = '" . $oid . "' ORDER BY naam";
423
+        $sqlQuery = 'SELECT id, naam, roft FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id_owner = '".$oid."' ORDER BY naam";
424 424
     } else {
425
-        $sqlQuery = 'SELECT id, naam, roft FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id_breeder = '" . $oid . "' ORDER BY naam";
425
+        $sqlQuery = 'SELECT id, naam, roft FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id_breeder = '".$oid."' ORDER BY naam";
426 426
     }
427 427
     $queryResult = $GLOBALS['xoopsDB']->query($sqlQuery);
428 428
     while (false !== ($rowResult = $GLOBALS['xoopsDB']->fetchArray($queryResult))) {
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
         } else {
432 432
             $gender = '<img src="assets/images/female.gif">';
433 433
         }
434
-        $link    = '<a href="dog.php?id=' . $rowResult['id'] . '">' . stripslashes($rowResult['naam']) . '</a>';
435
-        $content .= $gender . ' ' . $link . '<br>';
434
+        $link = '<a href="dog.php?id='.$rowResult['id'].'">'.stripslashes($rowResult['naam']).'</a>';
435
+        $content .= $gender.' '.$link.'<br>';
436 436
     }
437 437
 
438 438
     return $content;
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 function getName($oid)
447 447
 {
448 448
     $oid         = (int)$oid;
449
-    $sqlQuery    = 'SELECT naam FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id = '{$oid}'";
449
+    $sqlQuery    = 'SELECT naam FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id = '{$oid}'";
450 450
     $queryResult = $GLOBALS['xoopsDB']->query($sqlQuery);
451 451
     while (false !== ($rowResult = $GLOBALS['xoopsDB']->fetchArray($queryResult))) {
452 452
         $an = stripslashes($rowResult['naam']);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
  */
462 462
 function showParent($PA)
463 463
 {
464
-    $sqlQuery    = 'SELECT naam FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id='" . $PA . "'";
464
+    $sqlQuery    = 'SELECT naam FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id='".$PA."'";
465 465
     $queryResult = $GLOBALS['xoopsDB']->query($sqlQuery);
466 466
     while (false !== ($rowResult = $GLOBALS['xoopsDB']->fetchArray($queryResult))) {
467 467
         $result = $rowResult['naam'];
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
  */
481 481
 function findId($naam_hond)
482 482
 {
483
-    $sqlQuery    = 'SELECT id FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " where naam= '$naam_hond'";
483
+    $sqlQuery    = 'SELECT id FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." where naam= '$naam_hond'";
484 484
     $queryResult = $GLOBALS['xoopsDB']->query($sqlQuery);
485 485
     while (false !== ($rowResult = $GLOBALS['xoopsDB']->fetchArray($queryResult))) {
486 486
         $result = $rowResult['id'];
@@ -533,19 +533,19 @@  discard block
 block discarded – undo
533 533
         $gender = '';
534 534
         if ((!empty($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser'] instanceof \XoopsUser)
535 535
             && ($row['user'] == $GLOBALS['xoopsUser']->getVar('uid') || true === $modadmin)) {
536
-            $gender = "<a href='dog.php?id={$row['id']}'><img src='images/edit.png' alt='" . _EDIT . "'></a>
537
-                     . <a href='delete.php?id={$row['id']}'><img src='images/delete.png' alt='" . _DELETE . "'></a>";
536
+            $gender = "<a href='dog.php?id={$row['id']}'><img src='images/edit.png' alt='"._EDIT."'></a>
537
+                     . <a href='delete.php?id={$row['id']}'><img src='images/delete.png' alt='"._DELETE."'></a>";
538 538
         }
539 539
 
540 540
         $genImg = (0 == $row['roft']) ? 'male.gif' : 'female.gif';
541 541
         $gender .= "<img src='assets/images/{$genImg}'>";
542 542
 
543 543
         if ('' != $row['foto']) {
544
-            $camera = ' <img src="' . PEDIGREE_UPLOAD_URL . '/images/dog-icon25.png">';
544
+            $camera = ' <img src="'.PEDIGREE_UPLOAD_URL.'/images/dog-icon25.png">';
545 545
         } else {
546 546
             $camera = '';
547 547
         }
548
-        $name = stripslashes($row['naam']) . $camera;
548
+        $name = stripslashes($row['naam']).$camera;
549 549
         unset($columnvalue);
550 550
 
551 551
         //fill array
@@ -554,22 +554,22 @@  discard block
 block discarded – undo
554 554
             $lookuparray = $columns[$i]['lookuparray'];
555 555
             if (is_array($lookuparray)) {
556 556
                 foreach ($lookuparray as $index => $indexValue) {
557
-                    if ($lookuparray[$index]['id'] == $row['user' . $x]) {
557
+                    if ($lookuparray[$index]['id'] == $row['user'.$x]) {
558 558
                         //echo "<h1>".$lookuparray[$index]['id']."</h1>";
559 559
                         $value = $lookuparray[$index]['value'];
560 560
                     }
561 561
                 }
562 562
             } //format value - cant use object because of query count
563
-            elseif (0 === strncmp($row['user' . $x], 'http://', 7)) {
564
-                $value = '<a href="' . $row['user' . $x] . '">' . $row['user' . $x] . '</a>';
563
+            elseif (0 === strncmp($row['user'.$x], 'http://', 7)) {
564
+                $value = '<a href="'.$row['user'.$x].'">'.$row['user'.$x].'</a>';
565 565
             } else {
566
-                $value = $row['user' . $x];
566
+                $value = $row['user'.$x];
567 567
             }
568 568
             $columnvalue[] = ['value' => $value];
569 569
             unset($value);
570 570
         }
571 571
 
572
-        $linkto = '<a href="' . $link . $row[$element] . '">' . $name . '</a>';
572
+        $linkto = '<a href="'.$link.$row[$element].'">'.$name.'</a>';
573 573
         //create array
574 574
         $dogs[] = [
575 575
             'id'          => $row['id'],
@@ -599,10 +599,10 @@  discard block
 block discarded – undo
599 599
 function animal_block_addCatSelect($cats)
600 600
 {
601 601
     if (is_array($cats)) {
602
-        $cat_sql = '(' . current($cats);
602
+        $cat_sql = '('.current($cats);
603 603
         array_shift($cats);
604 604
         foreach ($cats as $cat) {
605
-            $cat_sql .= ',' . $cat;
605
+            $cat_sql .= ','.$cat;
606 606
         }
607 607
         $cat_sql .= ')';
608 608
     }
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
             $letter_array['letter'] = $letter;
711 711
             $letter_array['count']  = $countsByLetters[$letter];
712 712
             //            $letter_array['url']    = "" . XOOPS_URL . "/modules/" . $helper->getModule()->dirname() . "/viewcat.php?list={$letter}";
713
-            $letter_array['url'] = '' . XOOPS_URL . '/modules/' . $helper->getModule()->dirname() . "/result.php?f=naam&amp;l=1&amp;w={$letter}%25&amp;o=naam";
713
+            $letter_array['url'] = ''.XOOPS_URL.'/modules/'.$helper->getModule()->dirname()."/result.php?f=naam&amp;l=1&amp;w={$letter}%25&amp;o=naam";
714 714
         } else {
715 715
             $letter_array['letter'] = $letter;
716 716
             $letter_array['count']  = 0;
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
     $letterschoiceTpl          = new \XoopsTpl();
729 729
     $letterschoiceTpl->caching = false; // Disable cache
730 730
     $letterschoiceTpl->assign('alphabet', $alphabet_array);
731
-    $html = $letterschoiceTpl->fetch('db:' . $helper->getModule()->dirname() . '_common_letterschoice.tpl');
731
+    $html = $letterschoiceTpl->fetch('db:'.$helper->getModule()->dirname().'_common_letterschoice.tpl');
732 732
     unset($letterschoiceTpl);
733 733
 
734 734
     return $html;
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
     if (!$withLink) {
775 775
         return $pedigreeModuleName;
776 776
     } else {
777
-        return '<a href="' . PEDIGREE_URL . '/">{$pedigreeModuleName}</a>';
777
+        return '<a href="'.PEDIGREE_URL.'/">{$pedigreeModuleName}</a>';
778 778
     }
779 779
 }
780 780
 
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
     $GLOBALS['xoopsDB'] = \XoopsDatabaseFactory::getDatabaseConnection();
796 796
     $realName           = $GLOBALS['xoopsDB']->prefix($table);
797 797
 
798
-    $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
798
+    $sql = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
799 799
     $ret = $GLOBALS['xoopsDB']->queryF($sql);
800 800
 
801 801
     while (false !== (list($m_table) = $GLOBALS['xoopsDB']->fetchRow($ret))) {
@@ -899,10 +899,10 @@  discard block
 block discarded – undo
899 899
     $queryString = $_SERVER['QUERY_STRING'];
900 900
 
901 901
     if ('' != $queryString) {
902
-        $queryString = '?' . $queryString;
902
+        $queryString = '?'.$queryString;
903 903
     }
904 904
 
905
-    $currentURL = $http . $httpHost . $phpSelf . $queryString;
905
+    $currentURL = $http.$httpHost.$phpSelf.$queryString;
906 906
 
907 907
     $urls                = [];
908 908
     $urls['http']        = $http;
Please login to merge, or discard this patch.
add_dog.php 2 patches
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
         //gender
153 153
         $gender_radio = new \XoopsFormRadio('<b>' . _MA_PEDIGREE_FLD_GEND . '</b>', 'roft', $value = '0');
154 154
         $gender_radio->addOptionArray([
155
-                                          '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
156
-                                          '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
157
-                                      ]);
155
+                                            '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
156
+                                            '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
157
+                                        ]);
158 158
         $form->addElement($gender_radio);
159 159
         if ('1' == $moduleConfig['ownerbreeder']) {
160 160
             //breeder
@@ -295,24 +295,24 @@  discard block
 block discarded – undo
295 295
         //insert into pedigree_temp
296 296
         //        $query = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . " VALUES ('" . $random . "','" . Pedigree\Utility::unHtmlEntities($name) . "','" . $id_owner . "','" . $id_breeder . "','" . $user . "','" . $roft . "','','','" . $foto . "', ''" . $usersql . ')';
297 297
         $query = 'INSERT INTO '
298
-                 . $GLOBALS['xoopsDB']->prefix('pedigree_temp')
299
-                 . " VALUES ('"
300
-                 . $GLOBALS['xoopsDB']->escape($random)
301
-                 . "','"
302
-                 . $GLOBALS['xoopsDB']->escape(Pedigree\Utility::unHtmlEntities($name))
303
-                 . "','"
304
-                 . $GLOBALS['xoopsDB']->escape($id_owner)
305
-                 . "','"
306
-                 . $GLOBALS['xoopsDB']->escape($id_breeder)
307
-                 . "','"
308
-                 . $GLOBALS['xoopsDB']->escape($user)
309
-                 . "','"
310
-                 . $GLOBALS['xoopsDB']->escape($roft)
311
-                 . "','0','0','"
312
-                 . $GLOBALS['xoopsDB']->escape($foto)
313
-                 . "', ''"
314
-                 . $usersql
315
-                 . ')';
298
+                    . $GLOBALS['xoopsDB']->prefix('pedigree_temp')
299
+                    . " VALUES ('"
300
+                    . $GLOBALS['xoopsDB']->escape($random)
301
+                    . "','"
302
+                    . $GLOBALS['xoopsDB']->escape(Pedigree\Utility::unHtmlEntities($name))
303
+                    . "','"
304
+                    . $GLOBALS['xoopsDB']->escape($id_owner)
305
+                    . "','"
306
+                    . $GLOBALS['xoopsDB']->escape($id_breeder)
307
+                    . "','"
308
+                    . $GLOBALS['xoopsDB']->escape($user)
309
+                    . "','"
310
+                    . $GLOBALS['xoopsDB']->escape($roft)
311
+                    . "','0','0','"
312
+                    . $GLOBALS['xoopsDB']->escape($foto)
313
+                    . "', ''"
314
+                    . $usersql
315
+                    . ')';
316 316
         //echo $query; die();
317 317
         $GLOBALS['xoopsDB']->queryF($query);
318 318
         redirect_header('add_dog.php?f=sire&random=' . $random . '&st=' . $st . '&r=1&l=a', 1, strtr(_MA_PEDIGREE_ADD_SIREPLZ, ['[father]' => $moduleConfig['father']]));
@@ -757,26 +757,26 @@  discard block
 block discarded – undo
757 757
         //insert into pedigree
758 758
         //$query = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " VALUES ('','" . addslashes($row['naam']) . "','" . $row['id_owner'] . "','" . $row['id_breeder'] . "','" . $row['user'] . "','" . $row['roft'] . "','" . $_GET['seldam'] . "','" . $row['father'] . "','" . addslashes($row['foto']) . "',''" . $usersql . ')';
759 759
         $sql = 'INSERT INTO '
760
-               . $GLOBALS['xoopsDB']->prefix('pedigree_tree')
761
-               . " VALUES (0,'"
762
-               . $GLOBALS['xoopsDB']->escape($row['naam'])
763
-               . "','"
764
-               . $GLOBALS['xoopsDB']->escape($row['id_owner'])
765
-               . "','"
766
-               . $GLOBALS['xoopsDB']->escape($row['id_breeder'])
767
-               . "','"
768
-               . $GLOBALS['xoopsDB']->escape($row['user'])
769
-               . "','"
770
-               . $GLOBALS['xoopsDB']->escape($row['roft'])
771
-               . "','"
772
-               . $GLOBALS['xoopsDB']->escape($_GET['seldam'])
773
-               . "','"
774
-               . $GLOBALS['xoopsDB']->escape($row['father'])
775
-               . "','"
776
-               . $GLOBALS['xoopsDB']->escape($row['foto'])
777
-               . "',''"
778
-               . $usersql
779
-               . ')';
760
+                . $GLOBALS['xoopsDB']->prefix('pedigree_tree')
761
+                . " VALUES (0,'"
762
+                . $GLOBALS['xoopsDB']->escape($row['naam'])
763
+                . "','"
764
+                . $GLOBALS['xoopsDB']->escape($row['id_owner'])
765
+                . "','"
766
+                . $GLOBALS['xoopsDB']->escape($row['id_breeder'])
767
+                . "','"
768
+                . $GLOBALS['xoopsDB']->escape($row['user'])
769
+                . "','"
770
+                . $GLOBALS['xoopsDB']->escape($row['roft'])
771
+                . "','"
772
+                . $GLOBALS['xoopsDB']->escape($_GET['seldam'])
773
+                . "','"
774
+                . $GLOBALS['xoopsDB']->escape($row['father'])
775
+                . "','"
776
+                . $GLOBALS['xoopsDB']->escape($row['foto'])
777
+                . "',''"
778
+                . $usersql
779
+                . ')';
780 780
         $GLOBALS['xoopsDB']->queryF($sql);
781 781
         //echo $query; die();
782 782
     }
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -5,21 +5,21 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Pedigree;
6 6
 
7 7
 //require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 //$moduleDirName = basename(__DIR__);
10 10
 xoops_loadLanguage('main', $moduleDirName);
11 11
 // Include any common code for this module.
12
-require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/common.php';
12
+require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/include/common.php';
13 13
 
14 14
 $GLOBALS['xoopsOption']['template_main'] = 'pedigree_adddog.tpl';
15 15
 
16
-include XOOPS_ROOT_PATH . '/header.php';
16
+include XOOPS_ROOT_PATH.'/header.php';
17 17
 $xoopsTpl->assign('page_title', 'Pedigree database - Update details');
18 18
 
19 19
 //check for access
20 20
 $xoopsModule = XoopsModule::getByDirname($moduleDirName);
21 21
 if (empty($xoopsUser)) {
22
-    redirect_header('index.php', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
22
+    redirect_header('index.php', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
23 23
 }
24 24
 
25 25
 //create function variable from url
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 
71 71
     //check for access
72 72
     if (empty($GLOBALS['xoopsUser']) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)) {
73
-        redirect_header('javascript:history.go(-1)', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
73
+        redirect_header('javascript:history.go(-1)', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
74 74
     }
75 75
     if (0 == $xoopsUser->getVar('uid')) {
76
-        redirect_header('javascript:history.go(-1)', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
76
+        redirect_header('javascript:history.go(-1)', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
77 77
     }
78 78
     //create form
79
-    include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
79
+    include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
80 80
     $form = new \XoopsThemeForm(strtr(_MA_PEDIGREE_ADD_DOG, ['[animalType]' => $moduleConfig['animalType']]), 'dogname', 'add_dog.php?f=checkName', 'post', true);
81 81
     $form->addElement(new \XoopsFormHiddenToken($name = 'XOOPS_TOKEN_REQUEST', $timeout = 360));
82 82
     //create random value
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $form->addElement(new \XoopsFormHidden('user', $xoopsUser->getVar('uid')));
87 87
 
88 88
     //name
89
-    $form->addElement(new \XoopsFormText('<b>' . _MA_PEDIGREE_FLD_NAME . '</b>', 'naam', $size = 50, $maxsize = 255, $value = ''));
89
+    $form->addElement(new \XoopsFormText('<b>'._MA_PEDIGREE_FLD_NAME.'</b>', 'naam', $size = 50, $maxsize = 255, $value = ''));
90 90
     $string = strtr(_MA_PEDIGREE_FLD_NAME_EX, ['[animalType]' => $moduleConfig['animalType']]);
91 91
     $form->addElement(new \XoopsFormLabel(_MA_PEDIGREE_EXPLAIN, $string));
92 92
 
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
     $name = Request::getString('naam', '', 'POST');
114 114
     //query
115 115
     //$queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE naam LIKE'%" . $name . "%' ORDER BY naam";
116
-    $queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE naam LIKE'%" . $GLOBALS['xoopsDB']->escape($name) . "%' ORDER BY naam";
116
+    $queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE naam LIKE'%".$GLOBALS['xoopsDB']->escape($name)."%' ORDER BY naam";
117 117
     $result      = $GLOBALS['xoopsDB']->query($queryString);
118 118
     $numResults  = $GLOBALS['xoopsDB']->getRowsNum($result);
119 119
     if ($numResults >= 1 && !isset($_GET['r'])) {
120 120
         //create form
121
-        include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
121
+        include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
122 122
         $form = new \XoopsThemeForm(strtr(_MA_PEDIGREE_ADD_DOG, ['[animalType]' => $moduleConfig['animalType']]), 'dogname', 'add_dog.php?f=checkName&r=1', 'post', true);
123 123
         //other elements
124 124
         $form->addElement(new \XoopsFormHiddenToken($name = 'XOOPS_TOKEN_REQUEST', $timeout = 360));
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $form->addElement(new \XoopsFormHidden('user', $xoopsUser->getVar('uid')));
127 127
         while (false !== ($row = $GLOBALS['xoopsDB']->fetchBoth($result))) {
128 128
             //name
129
-            $form->addElement(new \XoopsFormLabel('<b>' . _MA_PEDIGREE_FLD_NAME . '</b>', '<a href="dog.php?id=' . $row['id'] . '">' . stripslashes($row['naam']) . '</a>'));
129
+            $form->addElement(new \XoopsFormLabel('<b>'._MA_PEDIGREE_FLD_NAME.'</b>', '<a href="dog.php?id='.$row['id'].'">'.stripslashes($row['naam']).'</a>'));
130 130
         }
131 131
         $form->addElement(new \XoopsFormLabel(_MA_PEDIGREE_EXPLAIN, strtr(_MA_PEDIGREE_ADD_KNOWN, ['[animalTypes]' => $moduleConfig['animalTypes']])));
132 132
         //submit button
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $xoopsTpl->assign('form', $form->render());
136 136
     } else {
137 137
         //create form
138
-        include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
138
+        include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
139 139
         $form = new \XoopsThemeForm(strtr(_MA_PEDIGREE_ADD_DOG, ['[animalType]' => $moduleConfig['animalType']]), 'dogname', 'add_dog.php?f=sire', 'post', true);
140 140
         //added to handle upload
141 141
         $form->setExtra("enctype='multipart/form-data'");
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
         $form->addElement(new \XoopsFormHidden('user', $_POST['user']));
149 149
 
150 150
         //name
151
-        $form->addElement(new \XoopsFormLabel('<b>' . _MA_PEDIGREE_FLD_NAME . '</b>', stripslashes($_POST['naam'])));
151
+        $form->addElement(new \XoopsFormLabel('<b>'._MA_PEDIGREE_FLD_NAME.'</b>', stripslashes($_POST['naam'])));
152 152
         //gender
153
-        $gender_radio = new \XoopsFormRadio('<b>' . _MA_PEDIGREE_FLD_GEND . '</b>', 'roft', $value = '0');
153
+        $gender_radio = new \XoopsFormRadio('<b>'._MA_PEDIGREE_FLD_GEND.'</b>', 'roft', $value = '0');
154 154
         $gender_radio->addOptionArray([
155 155
                                           '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
156 156
                                           '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
@@ -158,23 +158,23 @@  discard block
 block discarded – undo
158 158
         $form->addElement($gender_radio);
159 159
         if ('1' == $moduleConfig['ownerbreeder']) {
160 160
             //breeder
161
-            $breeder_select = new \XoopsFormSelect('<b>' . _MA_PEDIGREE_FLD_BREE . '</b>', $name = 'id_breeder', $value = '0', $size = 1, $multiple = false);
162
-            $queryfok       = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' ORDER BY lastname';
161
+            $breeder_select = new \XoopsFormSelect('<b>'._MA_PEDIGREE_FLD_BREE.'</b>', $name = 'id_breeder', $value = '0', $size = 1, $multiple = false);
162
+            $queryfok       = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' ORDER BY lastname';
163 163
             $resfok         = $GLOBALS['xoopsDB']->query($queryfok);
164 164
             $breeder_select->addOption('0', $name = _MA_PEDIGREE_UNKNOWN);
165 165
             while (false !== ($rowfok = $GLOBALS['xoopsDB']->fetchArray($resfok))) {
166
-                $breeder_select->addOption($rowfok['id'], $name = $rowfok['lastname'] . ', ' . $rowfok['firstname']);
166
+                $breeder_select->addOption($rowfok['id'], $name = $rowfok['lastname'].', '.$rowfok['firstname']);
167 167
             }
168 168
             $form->addElement($breeder_select);
169 169
             $form->addElement(new \XoopsFormLabel(_MA_PEDIGREE_EXPLAIN, strtr(_MA_PEDIGREE_FLD_BREE_EX, ['[animalType]' => $moduleConfig['animalType']])));
170 170
 
171 171
             //owner
172
-            $owner_select = new \XoopsFormSelect('<b>' . _MA_PEDIGREE_FLD_OWNE . '</b>', $name = 'id_owner', $value = '0', $size = 1, $multiple = false);
173
-            $queryfok     = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' ORDER BY lastname';
172
+            $owner_select = new \XoopsFormSelect('<b>'._MA_PEDIGREE_FLD_OWNE.'</b>', $name = 'id_owner', $value = '0', $size = 1, $multiple = false);
173
+            $queryfok     = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' ORDER BY lastname';
174 174
             $resfok       = $GLOBALS['xoopsDB']->query($queryfok);
175 175
             $owner_select->addOption('0', $name = _MA_PEDIGREE_UNKNOWN);
176 176
             while (false !== ($rowfok = $GLOBALS['xoopsDB']->fetchArray($resfok))) {
177
-                $owner_select->addOption($rowfok['id'], $name = $rowfok['lastname'] . ', ' . $rowfok['firstname']);
177
+                $owner_select->addOption($rowfok['id'], $name = $rowfok['lastname'].', '.$rowfok['firstname']);
178 178
             }
179 179
             $form->addElement($owner_select);
180 180
             $form->addElement(new \XoopsFormLabel(_MA_PEDIGREE_EXPLAIN, strtr(_MA_PEDIGREE_FLD_OWNE_EX, ['[animalType]' => $moduleConfig['animalType']])));
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
     //check for access
225 225
     if (empty($GLOBALS['xoopsUser']) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)) {
226
-        redirect_header('javascript:history.go(-1)', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
226
+        redirect_header('javascript:history.go(-1)', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
227 227
     }
228 228
     $user = isset($_POST['user']) ? $_POST['user'] : null;
229 229
     if (empty($random)) {
@@ -273,18 +273,18 @@  discard block
 block discarded – undo
273 273
             $fieldObject = new $fieldType($userField, $animal);
274 274
             if ($userField->isActive()) {
275 275
                 //check if _FILES variable exists for user picturefield
276
-                $currentfield = 'user' . $iValue;
276
+                $currentfield = 'user'.$iValue;
277 277
                 $pictureField = $_FILES[$currentfield]['name'];
278 278
                 if ('Picture' === $fieldType && (!empty($pictureField) || '' != $pictureField)) {
279 279
                     $userpicture = Pedigree\Utility::uploadPicture($numPictureField);
280
-                    $usersql .= ",'" . $userpicture . "'";
280
+                    $usersql .= ",'".$userpicture."'";
281 281
                     ++$numPictureField;
282 282
                 } elseif ($userField->isLocked()) {
283 283
                     //userfield is locked, substitute default value
284
-                    $usersql .= ",'" . $userField->defaultvalue . "'";
284
+                    $usersql .= ",'".$userField->defaultvalue."'";
285 285
                 } else {
286 286
                     //echo $fieldType.":".$i.":".$fields[$i]."<br>";
287
-                    $usersql .= ",'" . Pedigree\Utility::unHtmlEntities($_POST['user' . $iValue]) . "'";
287
+                    $usersql .= ",'".Pedigree\Utility::unHtmlEntities($_POST['user'.$iValue])."'";
288 288
                 }
289 289
             } else {
290 290
                 $usersql .= ",''";
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                  . ')';
316 316
         //echo $query; die();
317 317
         $GLOBALS['xoopsDB']->queryF($query);
318
-        redirect_header('add_dog.php?f=sire&random=' . $random . '&st=' . $st . '&r=1&l=a', 1, strtr(_MA_PEDIGREE_ADD_SIREPLZ, ['[father]' => $moduleConfig['father']]));
318
+        redirect_header('add_dog.php?f=sire&random='.$random.'&st='.$st.'&r=1&l=a', 1, strtr(_MA_PEDIGREE_ADD_SIREPLZ, ['[father]' => $moduleConfig['father']]));
319 319
     }
320 320
     //find letter on which to start else set to 'a'
321 321
     $l = Request::getString('l', 'A', 'GET');
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     //create list of males dog to select from
330 330
     $perPage = $moduleConfig['perpage'];
331 331
     //count total number of dogs
332
-    $numDog = 'SELECT count(id) FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE roft='0' AND naam LIKE '" . $l . "%'";
332
+    $numDog = 'SELECT count(id) FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE roft='0' AND naam LIKE '".$l."%'";
333 333
     $numRes = $GLOBALS['xoopsDB']->query($numDog);
334 334
     //total number of dogs the query will find
335 335
     list($numResults) = $GLOBALS['xoopsDB']->fetchRow($numRes);
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
     $pages = '';
345 345
     for ($i = 65; $i <= 90; ++$i) {
346 346
         if ($l == chr($i)) {
347
-            $pages .= '<b><a href="add_dog.php?f=sire&r=1&random=' . $random . '&l=' . chr($i) . '">' . chr($i) . '</a></b>&nbsp;';
347
+            $pages .= '<b><a href="add_dog.php?f=sire&r=1&random='.$random.'&l='.chr($i).'">'.chr($i).'</a></b>&nbsp;';
348 348
         } else {
349
-            $pages .= '<a href="add_dog.php?f=sire&r=1&random=' . $random . '&l=' . chr($i) . '">' . chr($i) . '</a>&nbsp;';
349
+            $pages .= '<a href="add_dog.php?f=sire&r=1&random='.$random.'&l='.chr($i).'">'.chr($i).'</a>&nbsp;';
350 350
         }
351 351
     }
352 352
     $pages .= '-&nbsp;';
353
-    $pages .= '<a href="add_dog.php?f=sire&r=1&random=' . $random . '&l=Ã…">Ã…</a>&nbsp;';
354
-    $pages .= '<a href="add_dog.php?f=sire&r=1&random=' . $random . '&l=Ö">Ö</a>&nbsp;';
353
+    $pages .= '<a href="add_dog.php?f=sire&r=1&random='.$random.'&l=Ã…">Ã…</a>&nbsp;';
354
+    $pages .= '<a href="add_dog.php?f=sire&r=1&random='.$random.'&l=Ö">Ö</a>&nbsp;';
355 355
     //create linebreak
356 356
     $pages .= '<br>';
357 357
     //create previous button
358 358
     if ($numPages > 1) {
359 359
         if ($currentPage > 1) {
360
-            $pages .= '<a href="add_dog.php?f=sire&r=1&l=' . $l . '&random=' . $random . '&st=' . ($st - $perPage) . '">' . _MA_PEDIGREE_PREVIOUS . '</a>&nbsp;&nbsp';
360
+            $pages .= '<a href="add_dog.php?f=sire&r=1&l='.$l.'&random='.$random.'&st='.($st - $perPage).'">'._MA_PEDIGREE_PREVIOUS.'</a>&nbsp;&nbsp';
361 361
         }
362 362
     }
363 363
     //create numbers
@@ -367,20 +367,20 @@  discard block
 block discarded – undo
367 367
             $pages .= '<br>';
368 368
         }
369 369
         if ($x != $currentPage) {
370
-            $pages .= '<a href="add_dog.php?f=sire&r=1&l=' . $l . '&random=' . $random . '&st=' . ($perPage * ($x - 1)) . '">' . $x . '</a>&nbsp;&nbsp;';
370
+            $pages .= '<a href="add_dog.php?f=sire&r=1&l='.$l.'&random='.$random.'&st='.($perPage * ($x - 1)).'">'.$x.'</a>&nbsp;&nbsp;';
371 371
         } else {
372
-            $pages .= $x . '&nbsp;&nbsp';
372
+            $pages .= $x.'&nbsp;&nbsp';
373 373
         }
374 374
     }
375 375
     //create next button
376 376
     if ($numPages > 1) {
377 377
         if ($currentPage < $numPages) {
378
-            $pages .= '<a href="add_dog.php?f=sire&r=1&l=' . $l . '&random=' . $random . '&st=' . ($st + $perPage) . '">' . _MA_PEDIGREE_NEXT . '</a>&nbsp;&nbsp';
378
+            $pages .= '<a href="add_dog.php?f=sire&r=1&l='.$l.'&random='.$random.'&st='.($st + $perPage).'">'._MA_PEDIGREE_NEXT.'</a>&nbsp;&nbsp';
379 379
         }
380 380
     }
381 381
 
382 382
     //query
383
-    $queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE roft = '0' AND naam LIKE '" . $l . "%'ORDER BY naam LIMIT " . $st . ', ' . $perPage;
383
+    $queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE roft = '0' AND naam LIKE '".$l."%'ORDER BY naam LIMIT ".$st.', '.$perPage;
384 384
     $result      = $GLOBALS['xoopsDB']->query($queryString);
385 385
 
386 386
     $animal = new Pedigree\Animal();
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
         'id'          => '0',
418 418
         'name'        => '',
419 419
         'gender'      => '',
420
-        'link'        => '<a href="add_dog.php?f=dam&random=' . $random . '&selsire=0">' . strtr(_MA_PEDIGREE_ADD_SIREUNKNOWN, ['[father]' => $moduleConfig['father']]) . '</a>',
420
+        'link'        => '<a href="add_dog.php?f=dam&random='.$random.'&selsire=0">'.strtr(_MA_PEDIGREE_ADD_SIREUNKNOWN, ['[father]' => $moduleConfig['father']]).'</a>',
421 421
         'colour'      => '',
422 422
         'number'      => '',
423 423
         'usercolumns' => $empty
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         } else {
431 431
             $camera = '';
432 432
         }
433
-        $name = stripslashes($row['naam']) . $camera;
433
+        $name = stripslashes($row['naam']).$camera;
434 434
         //empty array
435 435
         unset($columnvalue);
436 436
         //fill array
@@ -438,17 +438,17 @@  discard block
 block discarded – undo
438 438
             $x = $columns[$i]['columnnumber'];
439 439
             if (is_array($columns[$i]['lookupval'])) {
440 440
                 foreach ($columns[$i]['lookupval'] as $key => $keyValue) {
441
-                    if ($key == $row['user' . $x]) {
441
+                    if ($key == $row['user'.$x]) {
442 442
                         $value = $keyValue['value'];
443 443
                     }
444 444
                 }
445 445
                 //debug information
446 446
                 ///echo $columns[$i]['columnname']."is an array !";
447 447
             } //format value - cant use object because of query count
448
-            elseif (0 === strncmp($row['user' . $x], 'http://', 7)) {
449
-                $value = '<a href="' . $row['user' . $x] . '">' . $row['user' . $x] . '</a>';
448
+            elseif (0 === strncmp($row['user'.$x], 'http://', 7)) {
449
+                $value = '<a href="'.$row['user'.$x].'">'.$row['user'.$x].'</a>';
450 450
             } else {
451
-                $value = $row['user' . $x];
451
+                $value = $row['user'.$x];
452 452
             }
453 453
             $columnvalue[] = ['value' => $value];
454 454
         }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             'id'          => $row['id'],
457 457
             'name'        => $name,
458 458
             'gender'      => '<img src="assets/images/male.gif">',
459
-            'link'        => '<a href="add_dog.php?f=dam&random=' . $random . '&selsire=' . $row['id'] . '">' . $name . '</a>',
459
+            'link'        => '<a href="add_dog.php?f=dam&random='.$random.'&selsire='.$row['id'].'">'.$name.'</a>',
460 460
             'colour'      => '',
461 461
             'number'      => '',
462 462
             'usercolumns' => $columnvalue
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
     //check for access
514 514
     $xoopsModule = XoopsModule::getByDirname($moduleDirName);
515 515
     if (empty($GLOBALS['xoopsUser']) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)) {
516
-        redirect_header('javascript:history.go(-1)', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
516
+        redirect_header('javascript:history.go(-1)', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
517 517
     }
518 518
     //    if (empty($random)) {
519 519
     //$random = isset($_POST['random']) ? $_POST['random'] : null;
@@ -541,16 +541,16 @@  discard block
 block discarded – undo
541 541
         //insert into pedigree_temp
542 542
         //        $query = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . ' SET father =' . $_GET['selsire'] . ' WHERE id=' . $random;
543 543
         //        $GLOBALS['xoopsDB']->queryF($query);
544
-        $query = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . ' SET father =' . Request::getInt('selsire', 0, 'GET') . ' WHERE id=' . $random;
544
+        $query = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_temp').' SET father ='.Request::getInt('selsire', 0, 'GET').' WHERE id='.$random;
545 545
         $GLOBALS['xoopsDB']->queryF($query);
546
-        redirect_header('add_dog.php?f=dam&random=' . $random . '&st=' . $st . '&r=1&l=a', 1, strtr(_MA_PEDIGREE_ADD_SIREOK, ['[mother]' => $moduleConfig['mother']]));
546
+        redirect_header('add_dog.php?f=dam&random='.$random.'&st='.$st.'&r=1&l=a', 1, strtr(_MA_PEDIGREE_ADD_SIREOK, ['[mother]' => $moduleConfig['mother']]));
547 547
     }
548 548
 
549 549
     $xoopsTpl->assign('sire', '1');
550 550
     //create list of males dog to select from
551 551
     $perPage = $moduleConfig['perpage'];
552 552
     //count total number of dogs
553
-    $numDog = 'SELECT count(id) FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE roft='1' AND naam LIKE '" . $l . "%'";
553
+    $numDog = 'SELECT count(id) FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE roft='1' AND naam LIKE '".$l."%'";
554 554
     $numRes = $GLOBALS['xoopsDB']->query($numDog);
555 555
     list($numResults) = $GLOBALS['xoopsDB']->fetchRow($numRes);
556 556
     $numPages = floor($numResults / $perPage) + 1;
@@ -562,19 +562,19 @@  discard block
 block discarded – undo
562 562
     $pages = '';
563 563
     for ($i = 65; $i <= 90; ++$i) {
564 564
         if ($l == chr($i)) {
565
-            $pages .= '<b><a href="add_dog.php?f=dam&r=1&random=' . $random . '&l=' . chr($i) . '">' . chr($i) . '</a></b>&nbsp;';
565
+            $pages .= '<b><a href="add_dog.php?f=dam&r=1&random='.$random.'&l='.chr($i).'">'.chr($i).'</a></b>&nbsp;';
566 566
         } else {
567
-            $pages .= '<a href="add_dog.php?f=dam&r=1&random=' . $random . '&l=' . chr($i) . '">' . chr($i) . '</a>&nbsp;';
567
+            $pages .= '<a href="add_dog.php?f=dam&r=1&random='.$random.'&l='.chr($i).'">'.chr($i).'</a>&nbsp;';
568 568
         }
569 569
     }
570 570
     $pages .= '-&nbsp;';
571
-    $pages .= '<a href="add_dog.php?f=dam&r=1&random=' . $random . '&l=Ã…">Ã…</a>&nbsp;';
572
-    $pages .= '<a href="add_dog.php?f=dam&r=1&random=' . $random . '&l=Ö">Ö</a>&nbsp;';
571
+    $pages .= '<a href="add_dog.php?f=dam&r=1&random='.$random.'&l=Ã…">Ã…</a>&nbsp;';
572
+    $pages .= '<a href="add_dog.php?f=dam&r=1&random='.$random.'&l=Ö">Ö</a>&nbsp;';
573 573
     $pages .= '<br>';
574 574
     //create previous button
575 575
     if ($numPages > 1) {
576 576
         if ($currentPage > 1) {
577
-            $pages .= '<a href="add_dog.php?f=dam&r=1&l=' . $l . '&random=' . $random . '&st=' . ($st - $perPage) . '">' . _MA_PEDIGREE_PREVIOUS . '</a>&nbsp;&nbsp';
577
+            $pages .= '<a href="add_dog.php?f=dam&r=1&l='.$l.'&random='.$random.'&st='.($st - $perPage).'">'._MA_PEDIGREE_PREVIOUS.'</a>&nbsp;&nbsp';
578 578
         }
579 579
     }
580 580
     //create numbers
@@ -584,20 +584,20 @@  discard block
 block discarded – undo
584 584
             $pages .= '<br>';
585 585
         }
586 586
         if ($x != $currentPage) {
587
-            $pages .= '<a href="add_dog.php?f=dam&r=1&l=' . $l . '&random=' . $random . '&st=' . ($perPage * ($x - 1)) . '">' . $x . '</a>&nbsp;&nbsp;';
587
+            $pages .= '<a href="add_dog.php?f=dam&r=1&l='.$l.'&random='.$random.'&st='.($perPage * ($x - 1)).'">'.$x.'</a>&nbsp;&nbsp;';
588 588
         } else {
589
-            $pages .= $x . '&nbsp;&nbsp';
589
+            $pages .= $x.'&nbsp;&nbsp';
590 590
         }
591 591
     }
592 592
     //create next button
593 593
     if ($numPages > 1) {
594 594
         if ($currentPage < $numPages) {
595
-            $pages .= '<a href="add_dog.php?f=dam&l=' . $l . '&r=1&random=' . $random . '&st=' . ($st + $perPage) . '">' . _MA_PEDIGREE_NEXT . '</a>&nbsp;&nbsp;';
595
+            $pages .= '<a href="add_dog.php?f=dam&l='.$l.'&r=1&random='.$random.'&st='.($st + $perPage).'">'._MA_PEDIGREE_NEXT.'</a>&nbsp;&nbsp;';
596 596
         }
597 597
     }
598 598
 
599 599
     //query
600
-    $queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE roft = '1' AND naam LIKE '" . $l . "%' ORDER BY naam LIMIT " . $st . ', ' . $perPage;
600
+    $queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE roft = '1' AND naam LIKE '".$l."%' ORDER BY naam LIMIT ".$st.', '.$perPage;
601 601
     $result      = $GLOBALS['xoopsDB']->query($queryString);
602 602
 
603 603
     $animal = new Pedigree\Animal();
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
         'id'          => '0',
635 635
         'name'        => '',
636 636
         'gender'      => '',
637
-        'link'        => '<a href="add_dog.php?f=check&random=' . $random . '&seldam=0">' . strtr(_MA_PEDIGREE_ADD_DAMUNKNOWN, ['[mother]' => $moduleConfig['mother']]) . '</a>',
637
+        'link'        => '<a href="add_dog.php?f=check&random='.$random.'&seldam=0">'.strtr(_MA_PEDIGREE_ADD_DAMUNKNOWN, ['[mother]' => $moduleConfig['mother']]).'</a>',
638 638
         'colour'      => '',
639 639
         'number'      => '',
640 640
         'usercolumns' => $empty
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
         } else {
648 648
             $camera = '';
649 649
         }
650
-        $name = stripslashes($row['naam']) . $camera;
650
+        $name = stripslashes($row['naam']).$camera;
651 651
         //empty array
652 652
         unset($columnvalue);
653 653
         //fill array
@@ -655,17 +655,17 @@  discard block
 block discarded – undo
655 655
             $x = $columns[$i]['columnnumber'];
656 656
             if (is_array($columns[$i]['lookupval'])) {
657 657
                 foreach ($columns[$i]['lookupval'] as $key => $keyValue) {
658
-                    if ($key == $row['user' . $x]) {
658
+                    if ($key == $row['user'.$x]) {
659 659
                         $value = $keyValue['value'];
660 660
                     }
661 661
                 }
662 662
                 //debug information
663 663
                 ///echo $columns[$i]['columnname']."is an array !";
664 664
             } //format value - cant use object because of query count
665
-            elseif (0 === strncmp($row['user' . $x], 'http://', 7)) {
666
-                $value = '<a href="' . $row['user' . $x] . '">' . $row['user' . $x] . '</a>';
665
+            elseif (0 === strncmp($row['user'.$x], 'http://', 7)) {
666
+                $value = '<a href="'.$row['user'.$x].'">'.$row['user'.$x].'</a>';
667 667
             } else {
668
-                $value = $row['user' . $x];
668
+                $value = $row['user'.$x];
669 669
             }
670 670
             $columnvalue[] = ['value' => $value];
671 671
         }
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
             'id'          => $row['id'],
674 674
             'name'        => $name,
675 675
             'gender'      => '<img src="assets/images/female.gif">',
676
-            'link'        => '<a href="add_dog.php?f=check&random=' . $random . '&seldam=' . $row['id'] . '">' . $name . '</a>',
676
+            'link'        => '<a href="add_dog.php?f=check&random='.$random.'&seldam='.$row['id'].'">'.$name.'</a>',
677 677
             'colour'      => '',
678 678
             'number'      => '',
679 679
             'usercolumns' => $columnvalue
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
     //check for access
725 725
     $xoopsModule = XoopsModule::getByDirname($moduleDirName);
726 726
     if (empty($xoopsUser)) {
727
-        redirect_header('index.php', 3, _NOPERM . '<br>' . _MA_PEDIGREE_REGIST);
727
+        redirect_header('index.php', 3, _NOPERM.'<br>'._MA_PEDIGREE_REGIST);
728 728
     }
729 729
     if (empty($random)) {
730 730
         $random = $_POST['random'];
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     }
735 735
 
736 736
     //query
737
-    $queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . ' WHERE id = ' . $random;
737
+    $queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_temp').' WHERE id = '.$random;
738 738
     $result      = $GLOBALS['xoopsDB']->query($queryString);
739 739
     while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
740 740
         //create animal object
@@ -748,9 +748,9 @@  discard block
 block discarded – undo
748 748
             $fieldType   = $userField->getSetting('FieldType');
749 749
             $fieldObject = new $fieldType($userField, $animal);
750 750
             if ($userField->isActive()) {
751
-                $usersql .= ",'" . addslashes($row['user' . $iValue]) . "'";
751
+                $usersql .= ",'".addslashes($row['user'.$iValue])."'";
752 752
             } else {
753
-                $usersql .= ",'" . $fieldObject->defaultvalue . "'";
753
+                $usersql .= ",'".$fieldObject->defaultvalue."'";
754 754
             }
755 755
             //echo $fields[$i]."<br>";
756 756
         }
@@ -780,10 +780,10 @@  discard block
 block discarded – undo
780 780
         $GLOBALS['xoopsDB']->queryF($sql);
781 781
         //echo $query; die();
782 782
     }
783
-    $sqlQuery = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_temp') . " WHERE id='" . $random . "'";
783
+    $sqlQuery = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_temp')." WHERE id='".$random."'";
784 784
     $GLOBALS['xoopsDB']->queryF($sqlQuery);
785 785
     redirect_header('latest.php', 1, strtr(_MA_PEDIGREE_ADD_OK, ['[animalType]' => $moduleConfig['animalType']]));
786 786
 }
787 787
 
788 788
 //footer
789
-include XOOPS_ROOT_PATH . '/footer.php';
789
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
language/english/common.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -21,59 +21,59 @@
 block discarded – undo
21 21
 $moduleDirName      = basename(dirname(dirname(__DIR__)));
22 22
 $moduleDirNameUpper = strtoupper($moduleDirName);
23 23
 
24
-define('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS', 'GD library support: ');
25
-define('CO_' . $moduleDirNameUpper . '_GDLIBVERSION', 'GD Library version: ');
26
-define('CO_' . $moduleDirNameUpper . '_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
27
-define('CO_' . $moduleDirNameUpper . '_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
28
-define('CO_' . $moduleDirNameUpper . '_IMAGEINFO', 'Server status');
29
-define('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
30
-define('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
31
-define('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
32
-define('CO_' . $moduleDirNameUpper . '_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
33
-define('CO_' . $moduleDirNameUpper . '_OFF', "<span style='font-weight: bold;'>OFF</span>");
34
-define('CO_' . $moduleDirNameUpper . '_ON', "<span style='font-weight: bold;'>ON</span>");
35
-define('CO_' . $moduleDirNameUpper . '_SERVERPATH', 'Server path to XOOPS root: ');
36
-define('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS', 'Server uploads status: ');
37
-define('CO_' . $moduleDirNameUpper . '_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
38
-define('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
24
+define('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS', 'GD library support: ');
25
+define('CO_'.$moduleDirNameUpper.'_GDLIBVERSION', 'GD Library version: ');
26
+define('CO_'.$moduleDirNameUpper.'_GDOFF', "<span style='font-weight: bold;'>Disabled</span> (No thumbnails available)");
27
+define('CO_'.$moduleDirNameUpper.'_GDON', "<span style='font-weight: bold;'>Enabled</span> (Thumbsnails available)");
28
+define('CO_'.$moduleDirNameUpper.'_IMAGEINFO', 'Server status');
29
+define('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE', 'Max post size permitted (post_max_size directive in php.ini): ');
30
+define('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE', 'Max upload size permitted (upload_max_filesize directive in php.ini): ');
31
+define('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT', 'Memory limit (memory_limit directive in php.ini): ');
32
+define('CO_'.$moduleDirNameUpper.'_METAVERSION', "<span style='font-weight: bold;'>Downloads meta version:</span> ");
33
+define('CO_'.$moduleDirNameUpper.'_OFF', "<span style='font-weight: bold;'>OFF</span>");
34
+define('CO_'.$moduleDirNameUpper.'_ON', "<span style='font-weight: bold;'>ON</span>");
35
+define('CO_'.$moduleDirNameUpper.'_SERVERPATH', 'Server path to XOOPS root: ');
36
+define('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS', 'Server uploads status: ');
37
+define('CO_'.$moduleDirNameUpper.'_SPHPINI', "<span style='font-weight: bold;'>Information taken from PHP ini file:</span>");
38
+define('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC', 'Note. Upload path *MUST* contain the full server path of your upload folder.');
39 39
 
40
-define('CO_' . $moduleDirNameUpper . '_PRINT', "<span style='font-weight: bold;'>Print</span>");
41
-define('CO_' . $moduleDirNameUpper . '_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
40
+define('CO_'.$moduleDirNameUpper.'_PRINT', "<span style='font-weight: bold;'>Print</span>");
41
+define('CO_'.$moduleDirNameUpper.'_PDF', "<span style='font-weight: bold;'>Create PDF</span>");
42 42
 
43 43
 
44
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
45
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED1', "Update failed - couldn't add new fields");
46
-define('CO_' . $moduleDirNameUpper . '_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
47
-define('CO_' . $moduleDirNameUpper . '_ERROR_COLUMN', 'Could not create column in database : %s');
48
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
49
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
50
-define('CO_' . $moduleDirNameUpper . '_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
44
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED0', "Update failed - couldn't rename field '%s'");
45
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED1', "Update failed - couldn't add new fields");
46
+define('CO_'.$moduleDirNameUpper.'_UPGRADEFAILED2', "Update failed - couldn't rename table '%s'");
47
+define('CO_'.$moduleDirNameUpper.'_ERROR_COLUMN', 'Could not create column in database : %s');
48
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS', 'This module requires XOOPS %s+ (%s installed)');
49
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP', 'This module requires PHP version %s+ (%s installed)');
50
+define('CO_'.$moduleDirNameUpper.'_ERROR_TAG_REMOVAL', 'Could not remove tags from Tag Module');
51 51
 
52
-define('CO_' . $moduleDirNameUpper . '_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
52
+define('CO_'.$moduleDirNameUpper.'_FOLDERS_DELETED_OK', 'Upload Folders have been deleted');
53 53
 
54 54
 // Error Msgs
55
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
56
-define('CO_' . $moduleDirNameUpper . '_ERROR_BAD_REMOVE', 'Could not delete %s');
57
-define('CO_' . $moduleDirNameUpper . '_ERROR_NO_PLUGIN', 'Could not load plugin');
55
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH', 'Could not delete %s directory');
56
+define('CO_'.$moduleDirNameUpper.'_ERROR_BAD_REMOVE', 'Could not delete %s');
57
+define('CO_'.$moduleDirNameUpper.'_ERROR_NO_PLUGIN', 'Could not load plugin');
58 58
 
59 59
 
60 60
 //Help
61
-define('CO_' . $moduleDirNameUpper . '_DIRNAME', basename(dirname(dirname(__DIR__))));
62
-define('CO_' . $moduleDirNameUpper . '_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
63
-define('CO_' . $moduleDirNameUpper . '_BACK_2_ADMIN', 'Back to Administration of ');
64
-define('CO_' . $moduleDirNameUpper . '_OVERVIEW', 'Overview');
61
+define('CO_'.$moduleDirNameUpper.'_DIRNAME', basename(dirname(dirname(__DIR__))));
62
+define('CO_'.$moduleDirNameUpper.'_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
63
+define('CO_'.$moduleDirNameUpper.'_BACK_2_ADMIN', 'Back to Administration of ');
64
+define('CO_'.$moduleDirNameUpper.'_OVERVIEW', 'Overview');
65 65
 
66 66
 //define('CO_' . $moduleDirNameUpper . '_HELP_DIR', __DIR__);
67 67
 
68 68
 //help multi-page
69
-define('CO_' . $moduleDirNameUpper . '_DISCLAIMER', 'Disclaimer');
70
-define('CO_' . $moduleDirNameUpper . '_LICENSE', 'License');
71
-define('CO_' . $moduleDirNameUpper . '_SUPPORT', 'Support');
69
+define('CO_'.$moduleDirNameUpper.'_DISCLAIMER', 'Disclaimer');
70
+define('CO_'.$moduleDirNameUpper.'_LICENSE', 'License');
71
+define('CO_'.$moduleDirNameUpper.'_SUPPORT', 'Support');
72 72
 
73 73
 //Sample Data
74
-define('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA', 'Add Sample Data (will delete ALL current data)');
75
-define('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully');
76
-define('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA', 'Export Tables to YAML');
77
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
78
-define('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
74
+define('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA', 'Add Sample Data (will delete ALL current data)');
75
+define('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS', 'Sample Date uploaded successfully');
76
+define('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA', 'Export Tables to YAML');
77
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', 'Show Sample Button?');
78
+define('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', 'If yes, the "Add Sample Data" button will be visible to the Admin. It is Yes as a default for first installation.');
79 79
 
Please login to merge, or discard this patch.
result.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -251,11 +251,11 @@
 block discarded – undo
251 251
 //add data to smarty template
252 252
 //assign dog
253 253
 $GLOBALS['xoopsTpl']->assign([
254
-                                 'dogs'         => $animals,
255
-                                 'columns'      => $columns,
256
-                                 'numofcolumns' => $numofcolumns,
257
-                                 'tsarray'      => Pedigree\Utility::sortTable($numofcolumns)
258
-                             ]);
254
+                                    'dogs'         => $animals,
255
+                                    'columns'      => $columns,
256
+                                    'numofcolumns' => $numofcolumns,
257
+                                    'tsarray'      => Pedigree\Utility::sortTable($numofcolumns)
258
+                                ]);
259 259
 //assign links
260 260
 
261 261
 //find last shown number
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Pedigree;
6 6
 
7 7
 //require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 
10 10
 $moduleDirName = basename(__DIR__);
11 11
 xoops_loadLanguage('main', $moduleDirName);
12 12
 
13 13
 // Include any common code for this module.
14
-require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
14
+require_once XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/include/common.php';
15 15
 
16 16
 $GLOBALS['xoopsOption']['template_main'] = 'pedigree_result.tpl';
17 17
 include $GLOBALS['xoops']->path('/header.php');
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 if (!isset($_GET['w'])) {
46
-    $w = '%' . $q . '%';
46
+    $w = '%'.$q.'%';
47 47
 }
48 48
 
49 49
 if (isset($_GET['p'])) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 }
99 99
 
100 100
 //count total number of dogs
101
-$numDog = 'SELECT COUNT(id) FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE ' . $f . ' ' . $l . " '" . $w . "'";
101
+$numDog = 'SELECT COUNT(id) FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE '.$f.' '.$l." '".$w."'";
102 102
 $numRes = $GLOBALS['xoopsDB']->query($numDog);
103 103
 //total number of dogs the query will find
104 104
 list($numResults) = $GLOBALS['xoopsDB']->fetchRow($numRes);
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
 
121 121
 $length = strlen($w);
122 122
 if ('%' === substr($w, $length - 1, $length)) {
123
-    $whe = substr($w, 0, $length - 1) . '%25';
123
+    $whe = substr($w, 0, $length - 1).'%25';
124 124
     if (0 === strncmp($whe, '%', 1)) {
125 125
         $length = strlen($whe);
126
-        $whe    = '%25' . substr($whe, 1, $length);
126
+        $whe    = '%25'.substr($whe, 1, $length);
127 127
     }
128 128
 } else {
129 129
     $whe = $w;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 //create previous button
133 133
 if ($numPages > 1) {
134 134
     if ($currentPage > 1) {
135
-        $pages .= '<a href="result.php?f=' . $f . '&amp;l=' . $l . '&amp;w=' . $whe . '&amp;o=' . $o . '&amp;d=' . $d . '&amp;st=' . ($st - $perPage) . '">' . _MA_PEDIGREE_PREVIOUS . '</a>&nbsp;&nbsp;';
135
+        $pages .= '<a href="result.php?f='.$f.'&amp;l='.$l.'&amp;w='.$whe.'&amp;o='.$o.'&amp;d='.$d.'&amp;st='.($st - $perPage).'">'._MA_PEDIGREE_PREVIOUS.'</a>&nbsp;&nbsp;';
136 136
 }
137 137
 
138 138
 //create numbers
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
             $pages .= '<br>';
143 143
     }
144 144
         if ($x != $currentPage) {
145
-            $pages .= '<a href="result.php?f=' . $f . '&l=' . $l . '&w=' . $whe . '&o=' . $o . '&d=' . $d . '&st=' . ($perPage * ($x - 1)) . '">' . $x . '</a>&nbsp;&nbsp;';
145
+            $pages .= '<a href="result.php?f='.$f.'&l='.$l.'&w='.$whe.'&o='.$o.'&d='.$d.'&st='.($perPage * ($x - 1)).'">'.$x.'</a>&nbsp;&nbsp;';
146 146
     } else {
147
-        $pages .= '<b>' . $x . '</b>&nbsp;&nbsp';
147
+        $pages .= '<b>'.$x.'</b>&nbsp;&nbsp';
148 148
     }
149 149
 }
150 150
 }
151 151
 //create next button
152 152
 if ($numPages > 1) {
153 153
     if ($currentPage < $numPages) {
154
-        $pages .= '<a href="result.php?f=' . $f . '&amp;l=' . $l . '&amp;w=' . $whe . '&amp;o=' . $o . '&amp;d=' . $d . '&amp;st=' . ($st + $perPage) . '">' . _MA_PEDIGREE_NEXT . '</a>&nbsp;&nbsp';
154
+        $pages .= '<a href="result.php?f='.$f.'&amp;l='.$l.'&amp;w='.$whe.'&amp;o='.$o.'&amp;d='.$d.'&amp;st='.($st + $perPage).'">'._MA_PEDIGREE_NEXT.'</a>&nbsp;&nbsp';
155 155
     }
156 156
 }
157 157
 
158 158
 //query
159
-$queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE ' . $f . ' ' . $l . " '" . $w . "' ORDER BY " . $o . ' ' . $d . ' LIMIT ' . $st . ', ' . $perPage;
159
+$queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE '.$f.' '.$l." '".$w."' ORDER BY ".$o.' '.$d.' LIMIT '.$st.', '.$perPage;
160 160
 $result      = $GLOBALS['xoopsDB']->query($queryString);
161 161
 
162 162
 $animal = new Pedigree\Animal();
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
     $gender = '';
195 195
     if ((!empty($GLOBALS['xoopsUser']) && ($GLOBALS['xoopsUser'] instanceof \XoopsUser))
196 196
         && (($row['user'] == $xoopsUser->getVar('uid')) || (true === $modadmin))) {
197
-        $gender = "<a href='dog.php?id={$row['id']}'><img src=" . $pathIcon16 . '/edit.png alt=' . _EDIT . "'></a>
198
-              <a href='delete.php?id={$row['id']}'><img src=" . $pathIcon16 . '/delete.png alt=' . _DELETE . "'></a>";
197
+        $gender = "<a href='dog.php?id={$row['id']}'><img src=".$pathIcon16.'/edit.png alt='._EDIT."'></a>
198
+              <a href='delete.php?id={$row['id']}'><img src=".$pathIcon16.'/delete.png alt='._DELETE."'></a>";
199 199
     }
200 200
     if (0 == $row['roft']) {
201 201
         $gender .= "<img src='assets/images/male.gif'>";
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
         $camera = '';
211 211
     }
212 212
 
213
-    $name = stripslashes($row['naam']) . $camera;
213
+    $name = stripslashes($row['naam']).$camera;
214 214
     //empty array
215 215
     unset($columnvalue);
216 216
     //fill array
217 217
     for ($i = 1; $i < $numofcolumns; ++$i) {
218
-        $x = 'user' . $columns[$i]['columnnumber'];
218
+        $x = 'user'.$columns[$i]['columnnumber'];
219 219
         //echo $x."columnnumber";
220 220
         if (is_array($columns[$i]['lookupval'])) {
221 221
             foreach ($columns[$i]['lookupval'] as $key => $keyValue) {
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 }
267 267
 //create string
268 268
 $matches     = strtr(_MA_PEDIGREE_MATCHES, ['[animalTypes]' => $moduleConfig['animalTypes']]);
269
-$nummatchstr = "{$numResults}{$matches}" . ($st + 1) . " - {$lastshown} ({$numPages} pages)";
269
+$nummatchstr = "{$numResults}{$matches}".($st + 1)." - {$lastshown} ({$numPages} pages)";
270 270
 $GLOBALS['xoopsTpl']->assign('nummatch', $nummatchstr);
271 271
 $GLOBALS['xoopsTpl']->assign('pages', $pages);
272 272
 
Please login to merge, or discard this patch.
edit.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,9 +102,9 @@
 block discarded – undo
102 102
         $roft         = $row['roft'];
103 103
         $gender_radio = new \XoopsFormRadio('<b>' . _MA_PEDIGREE_FLD_GEND . '</b>', 'roft', $value = $roft);
104 104
         $gender_radio->addOptionArray([
105
-                                          '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
106
-                                          '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
107
-                                      ]);
105
+                                            '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
106
+                                            '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
107
+                                        ]);
108 108
         $form->addElement($gender_radio);
109 109
         //father
110 110
         $sql       = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id='" . $row['father'] . "'";
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -5,19 +5,19 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Pedigree;
6 6
 
7 7
 //require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 $moduleDirName = basename(__DIR__);
10 10
 xoops_loadLanguage('main', $moduleDirName);
11 11
 
12 12
 //needed for generation of pie charts
13 13
 ob_start();
14
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/class_eq_pie.php';
14
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/include/class_eq_pie.php';
15 15
 
16 16
 $GLOBALS['xoopsOption']['template_main'] = 'pedigree_edit.tpl';
17 17
 
18
-include XOOPS_ROOT_PATH . '/header.php';
18
+include XOOPS_ROOT_PATH.'/header.php';
19 19
 // Include any common code for this module.
20
-require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
20
+require_once XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/include/common.php';
21 21
 
22 22
 global $xoopsTpl, $xoopsDB;
23 23
 
@@ -45,21 +45,21 @@  discard block
 block discarded – undo
45 45
     foreach ($fields as $i => $iValue) {
46 46
         $userField = new Pedigree\Field($fields[$i], $animal->getConfig());
47 47
         if ($userField->isActive()) {
48
-            $currentfield = 'user' . $iValue;
48
+            $currentfield = 'user'.$iValue;
49 49
             $pictureField = $_FILES[$currentfield]['name'];
50 50
             if (empty($pictureField) || '' == $pictureField) {
51
-                $newvalue = $_POST['user' . $iValue];
51
+                $newvalue = $_POST['user'.$iValue];
52 52
             } else {
53 53
                 $newvalue = Pedigree\Utility::uploadPicture(0);
54 54
             }
55
-            $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' SET user' . $iValue . "='" . $GLOBALS['xoopsDB']->escape($newvalue) . "' WHERE id='" . $a . "'";
55
+            $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' SET user'.$iValue."='".$GLOBALS['xoopsDB']->escape($newvalue)."' WHERE id='".$a."'";
56 56
             $GLOBALS['xoopsDB']->query($sql);
57 57
         }
58 58
     }
59 59
     //    $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET naam = '" . $_POST['naam'] . "', roft = '" . $_POST['roft'] . "' WHERE id='" . $a . "'";
60 60
     $NAAM = Request::getString('naam', '', 'post');
61 61
     $roft = Request::getString('roft', '', 'post');
62
-    $sql  = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET naam = '" . $GLOBALS['xoopsDB']->escape($NAAM) . "', roft = '" . $GLOBALS['xoopsDB']->escape($roft) . "' WHERE id='" . $a . "'";
62
+    $sql  = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." SET naam = '".$GLOBALS['xoopsDB']->escape($NAAM)."', roft = '".$GLOBALS['xoopsDB']->escape($roft)."' WHERE id='".$a."'";
63 63
     $GLOBALS['xoopsDB']->query($sql);
64 64
     $pictureField = $_FILES['photo']['name'];
65 65
     if (empty($pictureField) || '' == $pictureField) {
@@ -67,15 +67,15 @@  discard block
 block discarded – undo
67 67
     } else {
68 68
         $foto = Pedigree\Utility::uploadPicture(0);
69 69
         //      $sql  = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET foto='" . $foto . "' WHERE id='" . $a . "'";
70
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET foto='" . $GLOBALS['xoopsDB']->escape($foto) . "' WHERE id='" . $a . "'";
70
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." SET foto='".$GLOBALS['xoopsDB']->escape($foto)."' WHERE id='".$a."'";
71 71
     }
72 72
     $GLOBALS['xoopsDB']->query($sql);
73 73
     if ('1' == $moduleConfig['ownerbreeder']) {
74 74
         //      $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET id_owner = '" . $_POST['id_owner'] . "', id_breeder = '" . $_POST['id_breeder'] . "' WHERE id='" . $a . "'";
75
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " SET id_owner = '" . Request::getInt('id_owner', 0, 'post') . "', id_breeder = '" . Request::getInt('id_breeder', 0, 'post') . "' WHERE id='" . $a . "'";
75
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." SET id_owner = '".Request::getInt('id_owner', 0, 'post')."', id_breeder = '".Request::getInt('id_breeder', 0, 'post')."' WHERE id='".$a."'";
76 76
         $GLOBALS['xoopsDB']->query($sql);
77 77
     }
78
-    redirect_header('dog.php?id=' . $a, 2, 'Your changes have been saved');
78
+    redirect_header('dog.php?id='.$a, 2, 'Your changes have been saved');
79 79
 }
80 80
 
81 81
 /**
@@ -87,70 +87,70 @@  discard block
 block discarded – undo
87 87
     if (isset($_GET['id'])) {
88 88
         $id = $_GET['id'];
89 89
     }
90
-    include XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
90
+    include XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
91 91
 
92
-    $sql    = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . ' WHERE id=' . $id;
92
+    $sql    = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree').' WHERE id='.$id;
93 93
     $result = $GLOBALS['xoopsDB']->query($sql);
94 94
     while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
95
-        $form = new \XoopsThemeForm('Edit ' . $row['naam'], 'dogname', 'edit.php?f=save', 'post', true);
95
+        $form = new \XoopsThemeForm('Edit '.$row['naam'], 'dogname', 'edit.php?f=save', 'post', true);
96 96
         $form->addElement(new \XoopsFormHiddenToken($name = 'XOOPS_TOKEN_REQUEST', $timeout = 360));
97 97
         $form->addElement(new \XoopsFormHidden('id', $id));
98 98
         //name
99 99
         $naam = htmlentities(stripslashes($row['naam']), ENT_QUOTES);
100
-        $form->addElement(new \XoopsFormText('<b>' . _MA_PEDIGREE_FLD_NAME . '</b>', 'naam', $size = 50, $maxsize = 255, $value = $naam));
100
+        $form->addElement(new \XoopsFormText('<b>'._MA_PEDIGREE_FLD_NAME.'</b>', 'naam', $size = 50, $maxsize = 255, $value = $naam));
101 101
         //gender
102 102
         $roft         = $row['roft'];
103
-        $gender_radio = new \XoopsFormRadio('<b>' . _MA_PEDIGREE_FLD_GEND . '</b>', 'roft', $value = $roft);
103
+        $gender_radio = new \XoopsFormRadio('<b>'._MA_PEDIGREE_FLD_GEND.'</b>', 'roft', $value = $roft);
104 104
         $gender_radio->addOptionArray([
105 105
                                           '0' => strtr(_MA_PEDIGREE_FLD_MALE, ['[male]' => $moduleConfig['male']]),
106 106
                                           '1' => strtr(_MA_PEDIGREE_FLD_FEMA, ['[female]' => $moduleConfig['female']])
107 107
                                       ]);
108 108
         $form->addElement($gender_radio);
109 109
         //father
110
-        $sql       = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id='" . $row['father'] . "'";
110
+        $sql       = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id='".$row['father']."'";
111 111
         $resfather = $GLOBALS['xoopsDB']->query($sql);
112 112
         $numfields = $GLOBALS['xoopsDB']->getRowsNum($resfather);
113 113
         if ('0' == !$numfields) {
114 114
             while (false !== ($rowfetch = $GLOBALS['xoopsDB']->fetchArray($resfather))) {
115
-                $form->addElement(new \XoopsFormLabel('<b>' . strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]) . '</b>', '<img src="assets/images/male.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=0&letter=a">' . $rowfetch['naam'] . '</a>'));
115
+                $form->addElement(new \XoopsFormLabel('<b>'.strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]).'</b>', '<img src="assets/images/male.gif"><a href="seldog.php?curval='.$row['id'].'&gend=0&letter=a">'.$rowfetch['naam'].'</a>'));
116 116
             }
117 117
         } else {
118
-            $form->addElement(new \XoopsFormLabel('<b>' . strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]) . '</b>', '<img src="assets/images/male.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=0&letter=a">Unknown</a>'));
118
+            $form->addElement(new \XoopsFormLabel('<b>'.strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]).'</b>', '<img src="assets/images/male.gif"><a href="seldog.php?curval='.$row['id'].'&gend=0&letter=a">Unknown</a>'));
119 119
         }
120 120
         //mother
121
-        $sql       = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE id='" . $row['mother'] . "'";
121
+        $sql       = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE id='".$row['mother']."'";
122 122
         $resmother = $GLOBALS['xoopsDB']->query($sql);
123 123
         $numfields = $GLOBALS['xoopsDB']->getRowsNum($resmother);
124 124
         if ('0' == !$numfields) {
125 125
             while (false !== ($rowfetch = $GLOBALS['xoopsDB']->fetchArray($resmother))) {
126
-                $form->addElement(new \XoopsFormLabel('<b>' . strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]) . '</b>', '<img src="assets/images/female.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=1&letter=a">' . $rowfetch['naam'] . '</a>'));
126
+                $form->addElement(new \XoopsFormLabel('<b>'.strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]).'</b>', '<img src="assets/images/female.gif"><a href="seldog.php?curval='.$row['id'].'&gend=1&letter=a">'.$rowfetch['naam'].'</a>'));
127 127
             }
128 128
         } else {
129
-            $form->addElement(new \XoopsFormLabel('<b>' . strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]) . '</b>', '<img src="assets/images/female.gif"><a href="seldog.php?curval=' . $row['id'] . '&gend=1&letter=a">Unknown</a>'));
129
+            $form->addElement(new \XoopsFormLabel('<b>'.strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]).'</b>', '<img src="assets/images/female.gif"><a href="seldog.php?curval='.$row['id'].'&gend=1&letter=a">Unknown</a>'));
130 130
         }
131 131
         //owner/breeder
132 132
         if ('1' == $moduleConfig['ownerbreeder']) {
133
-            $owner_select = new \XoopsFormSelect('<b>' . _MA_PEDIGREE_FLD_OWNE . '</b>', $name = 'id_owner', $value = $row['id_owner'], $size = 1, $multiple = false);
134
-            $queryeig     = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' ORDER BY "lastname"';
133
+            $owner_select = new \XoopsFormSelect('<b>'._MA_PEDIGREE_FLD_OWNE.'</b>', $name = 'id_owner', $value = $row['id_owner'], $size = 1, $multiple = false);
134
+            $queryeig     = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' ORDER BY "lastname"';
135 135
             $reseig       = $GLOBALS['xoopsDB']->query($queryeig);
136 136
             $owner_select->addOption(0, $name = _MA_PEDIGREE_UNKNOWN);
137 137
             while (false !== ($roweig = $GLOBALS['xoopsDB']->fetchArray($reseig))) {
138
-                $owner_select->addOption($roweig['id'], $name = $roweig['lastname'] . ', ' . $roweig['firstname']);
138
+                $owner_select->addOption($roweig['id'], $name = $roweig['lastname'].', '.$roweig['firstname']);
139 139
             }
140 140
             $form->addElement($owner_select);
141 141
             //breeder
142
-            $breeder_select = new \XoopsFormSelect('<b>' . _MA_PEDIGREE_FLD_BREE . '</b>', $name = 'id_breeder', $value = $row['id_breeder'], $size = 1, $multiple = false);
143
-            $queryfok       = 'SELECT id, lastname, firstname FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_owner') . ' ORDER BY "lastname"';
142
+            $breeder_select = new \XoopsFormSelect('<b>'._MA_PEDIGREE_FLD_BREE.'</b>', $name = 'id_breeder', $value = $row['id_breeder'], $size = 1, $multiple = false);
143
+            $queryfok       = 'SELECT id, lastname, firstname FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_owner').' ORDER BY "lastname"';
144 144
             $resfok         = $GLOBALS['xoopsDB']->query($queryfok);
145 145
             $breeder_select->addOption(0, $name = _MA_PEDIGREE_UNKNOWN);
146 146
             while (false !== ($rowfok = $GLOBALS['xoopsDB']->fetchArray($resfok))) {
147
-                $breeder_select->addOption($rowfok['id'], $name = $rowfok['lastname'] . ', ' . $rowfok['firstname']);
147
+                $breeder_select->addOption($rowfok['id'], $name = $rowfok['lastname'].', '.$rowfok['firstname']);
148 148
             }
149 149
             $form->addElement($breeder_select);
150 150
         }
151 151
         //picture
152 152
         if ('' != $row['foto']) {
153
-            $picture = '<img src=' . PEDIGREE_UPLOAD_URL . '/images/thumbnails/' . $row['foto'] . '_400.jpeg>';
153
+            $picture = '<img src='.PEDIGREE_UPLOAD_URL.'/images/thumbnails/'.$row['foto'].'_400.jpeg>';
154 154
             $form->addElement(new \XoopsFormLabel('<b>Picture</b>', $picture));
155 155
         } else {
156 156
             $picture = '';
@@ -179,4 +179,4 @@  discard block
 block discarded – undo
179 179
 }
180 180
 
181 181
 //comments and footer
182
-include XOOPS_ROOT_PATH . '/footer.php';
182
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
seldog.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
 //add data to smarty template
203 203
 //assign dog
204 204
 $GLOBALS['xoopsTpl']->assign([
205
-                                 'dogs'         => $dogs,
206
-                                 'columns'      => $columns,
207
-                                 'numofcolumns' => $numofcolumns,
208
-                                 'tsarray'      => Pedigree\Utility::sortTable($numofcolumns)
209
-                             ]);
205
+                                    'dogs'         => $dogs,
206
+                                    'columns'      => $columns,
207
+                                    'numofcolumns' => $numofcolumns,
208
+                                    'tsarray'      => Pedigree\Utility::sortTable($numofcolumns)
209
+                                ]);
210 210
 //add data to smarty template
211 211
 if (0 == $gend) {
212 212
     $selTtlParent = strtr(_MA_PEDIGREE_FLD_FATH, ['[father]' => $moduleConfig['father']]);
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
 $matches     = strtr(_MA_PEDIGREE_MATCHES, ['[animalTypes]' => $moduleConfig['animalTypes']]);
226 226
 $nummatchstr = "{$numResults}{$matches}" . ($st + 1) . " - {$lastshown} ({$numPages} pages)";
227 227
 $GLOBALS['xoopsTpl']->assign([
228
-                                 'nummatch' => $nummatchstr,
229
-                                 'pages'    => $pages,
230
-                                 'curval'   => $curval
231
-                             ]);
228
+                                    'nummatch' => $nummatchstr,
229
+                                    'pages'    => $pages,
230
+                                    'curval'   => $curval
231
+                                ]);
232 232
 
233 233
 //mb ========= MOTHER LETTERS===============================
234 234
 $myObject = Pedigree\Helper::getInstance();
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 use XoopsModules\Pedigree;
6 6
 
7 7
 //require_once  dirname(dirname(__DIR__)) . '/mainfile.php';
8
-require_once __DIR__ . '/header.php';
8
+require_once __DIR__.'/header.php';
9 9
 
10 10
 $moduleDirName = basename(__DIR__);
11 11
 xoops_loadLanguage('main', $moduleDirName);
12 12
 xoops_load('Pedigree\Animal', $moduleDirName);
13 13
 
14 14
 // Include any common code for this module.
15
-require_once XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/include/common.php';
15
+require_once XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/include/common.php';
16 16
 
17 17
 /*
18 18
 // Get all HTTP post or get parameters into global variables that are prefixed with "param_"
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 $GLOBALS['xoopsTpl']->assign('page_title', _MI_PEDIGREE_TITLE);
44 44
 
45 45
 //count total number of dogs
46
-$numDog = 'SELECT id FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE naam LIKE '{$letter}%' AND roft = '{$gend}'";
46
+$numDog = 'SELECT id FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE naam LIKE '{$letter}%' AND roft = '{$gend}'";
47 47
 $numRes = $GLOBALS['xoopsDB']->query($numDog);
48 48
 //total number of dogs the query will find
49 49
 $numResults = $GLOBALS['xoopsDB']->getRowsNum($numRes);
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 $pages = '';
60 60
 for ($i = 65; $i <= 90; ++$i) {
61 61
     if ($letter == chr($i)) {
62
-        $pages .= "<b><a href='seldog.php?gend={$gend}&curval={$curval}&letter=" . chr($i) . "'>" . chr($i) . '</a></b>&nbsp;';
62
+        $pages .= "<b><a href='seldog.php?gend={$gend}&curval={$curval}&letter=".chr($i)."'>".chr($i).'</a></b>&nbsp;';
63 63
     } else {
64
-        $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter=" . chr($i) . "'>" . chr($i) . '</a>&nbsp;';
64
+        $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter=".chr($i)."'>".chr($i).'</a>&nbsp;';
65 65
     }
66 66
 }
67 67
 $pages .= '-&nbsp;';
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $pages .= '<br>';
72 72
 //create previous button
73 73
 if (($numPages > 1) && ($currentPage > 1)) {
74
-    $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=" . ($st - $perPage) . "'>" . _MA_PEDIGREE_PREVIOUS . '</a>&nbsp;&nbsp';
74
+    $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=".($st - $perPage)."'>"._MA_PEDIGREE_PREVIOUS.'</a>&nbsp;&nbsp';
75 75
 }
76 76
 //create numbers
77 77
 for ($x = 1; $x < ($numPages + 1); ++$x) {
@@ -80,18 +80,18 @@  discard block
 block discarded – undo
80 80
         $pages .= '<br>';
81 81
     }
82 82
     if ($x != $currentPage) {
83
-        $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=" . ($perPage * ($x - 1)) . "'>{$x}</a>&nbsp;&nbsp";
83
+        $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=".($perPage * ($x - 1))."'>{$x}</a>&nbsp;&nbsp";
84 84
     } else {
85 85
         $pages .= "{$x}&nbsp;&nbsp";
86 86
     }
87 87
 }
88 88
 //create next button
89 89
 if (($numPages > 1) && ($currentPage < $numPages)) {
90
-    $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=" . ($st + $perPage) . "'>" . _MA_PEDIGREE_NEXT . '</a>&nbsp;&nbsp';
90
+    $pages .= "<a href='seldog.php?gend={$gend}&curval={$curval}&letter={$letter}&st=".($st + $perPage)."'>"._MA_PEDIGREE_NEXT.'</a>&nbsp;&nbsp';
91 91
 }
92 92
 
93 93
 //query
94
-$queryString = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('pedigree_tree') . " WHERE naam LIKE '{$letter}%' AND roft = '{$gend}' ORDER BY naam LIMIT {$st}, {$perPage}";
94
+$queryString = 'SELECT * FROM '.$GLOBALS['xoopsDB']->prefix('pedigree_tree')." WHERE naam LIKE '{$letter}%' AND roft = '{$gend}' ORDER BY naam LIMIT {$st}, {$perPage}";
95 95
 $result      = $GLOBALS['xoopsDB']->query($queryString);
96 96
 
97 97
 $animal = new Pedigree\Animal();
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         'id'          => '0',
135 135
         'name'        => '',
136 136
         'gender'      => '',
137
-        'link'        => "<a href='updatepage.php?gend={$gend}&curval={$curval}&thisid=0'>" . strtr(_MA_PEDIGREE_ADD_SIREUNKNOWN, ['[father]' => $moduleConfig['father']]) . '</a>',
137
+        'link'        => "<a href='updatepage.php?gend={$gend}&curval={$curval}&thisid=0'>".strtr(_MA_PEDIGREE_ADD_SIREUNKNOWN, ['[father]' => $moduleConfig['father']]).'</a>',
138 138
         'colour'      => '',
139 139
         'number'      => '',
140 140
         'usercolumns' => $empty
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         'id'          => '0',
145 145
         'name'        => '',
146 146
         'gender'      => '',
147
-        'link'        => "<a href='updatepage.php?gend={$gend}&curval={$curval}&thisid=0'>" . strtr(_MA_PEDIGREE_ADD_DAMUNKNOWN, ['[mother]' => $moduleConfig['mother']]) . '</a>',
147
+        'link'        => "<a href='updatepage.php?gend={$gend}&curval={$curval}&thisid=0'>".strtr(_MA_PEDIGREE_ADD_DAMUNKNOWN, ['[mother]' => $moduleConfig['mother']]).'</a>',
148 148
         'colour'      => '',
149 149
         'number'      => '',
150 150
         'usercolumns' => $empty
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 while (false !== ($row = $GLOBALS['xoopsDB']->fetchArray($result))) {
155 155
     //create picture information
156 156
     $camera = ('' != $row['foto']) ? ' <img src="assets/images/camera.png">' : '';
157
-    $name   = stripslashes($row['naam']) . $camera;
157
+    $name   = stripslashes($row['naam']).$camera;
158 158
     //empty array
159 159
     unset($columnvalue);
160 160
     //fill array
161 161
     for ($i = 1; $i < $numofcolumns; ++$i) {
162
-        $x = 'user' . $columns[$i]['columnnumber'];
162
+        $x = 'user'.$columns[$i]['columnnumber'];
163 163
         if (is_array($columns[$i]['lookupval'])) {
164 164
             foreach ($columns[$i]['lookupval'] as $key => $keyValue) {
165 165
                 if ($key == $row[$x]) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 } else {
214 214
     $selTtlParent = strtr(_MA_PEDIGREE_FLD_MOTH, ['[mother]' => $moduleConfig['mother']]);
215 215
 }
216
-$seltitle = _MA_PEDIGREE_SEL . $selTtlParent . _MA_PEDIGREE_FROM . Pedigree\Utility::getName($curval);
216
+$seltitle = _MA_PEDIGREE_SEL.$selTtlParent._MA_PEDIGREE_FROM.Pedigree\Utility::getName($curval);
217 217
 
218 218
 $GLOBALS['xoopsTpl']->assign('seltitle', $seltitle);
219 219
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 //create string
224 224
 /* @todo: move hard coded language string to language files */
225 225
 $matches     = strtr(_MA_PEDIGREE_MATCHES, ['[animalTypes]' => $moduleConfig['animalTypes']]);
226
-$nummatchstr = "{$numResults}{$matches}" . ($st + 1) . " - {$lastshown} ({$numPages} pages)";
226
+$nummatchstr = "{$numResults}{$matches}".($st + 1)." - {$lastshown} ({$numPages} pages)";
227 227
 $GLOBALS['xoopsTpl']->assign([
228 228
                                  'nummatch' => $nummatchstr,
229 229
                                  'pages'    => $pages,
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 $link         = "seldog.php?gend={$gend}&curval={$curval}&letter=";
242 242
 
243 243
 $criteria = $myObject->getHandler('Tree')->getActiveCriteria($roft);
244
-$criteria->setGroupby('UPPER(LEFT(' . $name . ',1))');
244
+$criteria->setGroupby('UPPER(LEFT('.$name.',1))');
245 245
 
246 246
 $motherArray['letters'] = Pedigree\Utility::lettersChoice($myObject, $activeObject, $criteria, $name, $link);
247 247
 //$catarray['toolbar']          = pedigree_toolbar();
Please login to merge, or discard this patch.