Code Duplication    Length = 3-5 lines in 4 locations

class/APCal.php 4 locations

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