Code Duplication    Length = 6-6 lines in 3 locations

admin/categories.php 3 locations

@@ 512-517 (lines=6) @@
509
                                   . " SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom', icon='$savedfilename' WHERE dtypeid = $p_dtypeid";
510
                            $xoopsDB->query($sql) or $eh->show('0013');
511
                        }
512
                    } else {
513
                        $sql = 'UPDATE '
514
                               . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_dtypes')
515
                               . " SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom' WHERE dtypeid = $p_dtypeid";
516
                        $xoopsDB->query($sql) or $eh->show('0013');
517
                    }
518
                } else {
519
                    $sql = 'UPDATE '
520
                           . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_dtypes')
@@ 518-523 (lines=6) @@
515
                               . " SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom' WHERE dtypeid = $p_dtypeid";
516
                        $xoopsDB->query($sql) or $eh->show('0013');
517
                    }
518
                } else {
519
                    $sql = 'UPDATE '
520
                           . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_dtypes')
521
                           . " SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom' WHERE dtypeid = $p_dtypeid";
522
                    $xoopsDB->query($sql) or $eh->show('0013');
523
                }
524
            }
525
        } else {
526
            $sql = 'UPDATE '
@@ 525-530 (lines=6) @@
522
                    $xoopsDB->query($sql) or $eh->show('0013');
523
                }
524
            }
525
        } else {
526
            $sql = 'UPDATE '
527
                   . $xoopsDB->prefix($xoopsModule->getVar('dirname', 'n') . '_dtypes')
528
                   . " SET title = '$p_title', section = '$p_section', fieldtypeid = '$p_fieldtype', defaultyn = '$p_default', activeyn='$p_active', seq='$p_seq', options='$p_options', custom='$p_custom' WHERE dtypeid = $p_dtypeid";
529
            $xoopsDB->query($sql) or $eh->show('0013');
530
        }
531
    }
532
    redirect_header("categories.php?op=edit&catid=$p_catid", 2, _MD_DTYPE_UPDATED);
533
    exit();