Code Duplication    Length = 7-8 lines in 5 locations

ro_regonlinehandler.php 5 locations

@@ 323-330 (lines=8) @@
320
                     . ".ron_eventid)=$eventid)";
321
            $res   = $GLOBALS['xoopsDB']->query($query);
322
        }
323
        if ($email1 !== '') {
324
            $submitter = $xoopsUser->getVar('uid');
325
            $query     = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email1', $submitter, ". time().")";
326
            $res       = $GLOBALS['xoopsDB']->query($query);
327
            if (!$res) {
328
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
329
            }
330
        }
331
        if ($email2 !== '') {
332
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email2', $submitter, ". time().")";
333
            $res   = $GLOBALS['xoopsDB']->query($query);
@@ 331-337 (lines=7) @@
328
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
329
            }
330
        }
331
        if ($email2 !== '') {
332
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email2', $submitter, ". time().")";
333
            $res   = $GLOBALS['xoopsDB']->query($query);
334
            if (!$res) {
335
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
336
            }
337
        }
338
        if ($email3 !== '') {
339
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email3', $submitter, ". time().")";
340
            $res   = $GLOBALS['xoopsDB']->query($query);
@@ 338-344 (lines=7) @@
335
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
336
            }
337
        }
338
        if ($email3 !== '') {
339
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email3', $submitter, ". time().")";
340
            $res   = $GLOBALS['xoopsDB']->query($query);
341
            if (!$res) {
342
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
343
            }
344
        }
345
        if ($email4 !== '') {
346
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email4', $submitter, ". time().")";
347
            $res   = $GLOBALS['xoopsDB']->query($query);
@@ 345-351 (lines=7) @@
342
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
343
            }
344
        }
345
        if ($email4 !== '') {
346
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email4', $submitter, ". time().")";
347
            $res   = $GLOBALS['xoopsDB']->query($query);
348
            if (!$res) {
349
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
350
            }
351
        }
352
        if ($email5 !== '') {
353
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email5', $submitter, ". time().")";
354
            $res   = $GLOBALS['xoopsDB']->query($query);
@@ 352-358 (lines=7) @@
349
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
350
            }
351
        }
352
        if ($email5 !== '') {
353
            $query = 'Insert into ' . $GLOBALS['xoopsDB']->prefix('apcal_ro_notify') . " (ron_eventid, ron_email, ron_submitter, ron_date_created) values ($eventid, '$email5', $submitter, ". time().")";
354
            $res   = $GLOBALS['xoopsDB']->query($query);
355
            if (!$res) {
356
                redirect_header($eventurl, 3, _APCAL_RO_ERROR_RO_ACTIVATE);
357
            }
358
        }
359
        redirect_header($eventurl, 3, _APCAL_RO_SUCCESS_RO_ACTIVATE);
360
    }
361
}