Code Duplication    Length = 7-8 lines in 5 locations

ro_regonlinehandler.php 5 locations

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