Code Duplication    Length = 3-5 lines in 4 locations

class/APCal.php 4 locations

@@ 3546-3550 (lines=5) @@
3543
                if (!($event = $GLOBALS['xoopsDB']->fetchObject($rs))) {
3544
                    die('Record Not Exists.');
3545
                }
3546
                if ($event->rrule_pid > 0) {
3547
                    if (!$GLOBALS['xoopsDB']->query("DELETE FROM $this->table WHERE rrule_pid='$event->rrule_pid' AND id<>'$event_id'")) {
3548
                        echo $GLOBALS['xoopsDB']->error();
3549
                    }
3550
                }
3551
3552
                // UPDATE
3553
                if ($rrule !== '') {
@@ 3657-3659 (lines=3) @@
3654
                    die('Record Not Exists.');
3655
                }
3656
                if ($event->rrule_pid > 0) {
3657
                    if (!$GLOBALS['xoopsDB']->query("DELETE FROM $this->table WHERE rrule_pid='$event->rrule_pid' $whr_sql_append")) {
3658
                        echo $GLOBALS['xoopsDB']->error();
3659
                    }
3660
                    // ����������ɲý����eval�Ǽ����� (XOOPS�Ǥϡ������Ȥκ���
3661
                    if ($GLOBALS['xoopsDB']->getAffectedRows() > 0 && isset($eval_after)) {
3662
                        $id = $event->rrule_pid;
@@ 3666-3668 (lines=3) @@
3663
                        eval($eval_after);
3664
                    }
3665
                } else {
3666
                    if (!$GLOBALS['xoopsDB']->query("DELETE FROM $this->table WHERE id='$event_id' $whr_sql_append")) {
3667
                        echo $GLOBALS['xoopsDB']->error();
3668
                    }
3669
                    // ����������ɲý����eval�Ǽ����� (XOOPS�Ǥϡ������Ȥκ���
3670
                    if ($GLOBALS['xoopsDB']->getAffectedRows() == 1 && isset($eval_after)) {
3671
                        $id = $event_id;
@@ 3692-3694 (lines=3) @@
3689
                $event_id = (int)$_POST['subevent_id'];
3690
                $this->delete_regonline($event_id); // added one line by goffy
3691
3692
                if (!$GLOBALS['xoopsDB']->query("DELETE FROM $this->table WHERE id='$event_id' AND rrule_pid <> id $whr_sql_append")) {
3693
                    echo $GLOBALS['xoopsDB']->error();
3694
                }
3695
            }
3696
            $last_smode   = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_POST['last_smode']);
3697
            $last_caldate = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_POST['last_caldate']);