Code Duplication    Length = 15-16 lines in 2 locations

main/inc/lib/agenda.lib.php 1 location

@@ 336-350 (lines=15) @@
333
     *
334
     * @return array
335
     */
336
    public function getRepeatedInfoByEvent($eventId, $courseId)
337
    {
338
        $repeatTable = Database::get_course_table(TABLE_AGENDA_REPEAT);
339
        $eventId = intval($eventId);
340
        $courseId = intval($courseId);
341
        $sql = "SELECT * FROM $repeatTable
342
                WHERE c_id = $courseId AND cal_id = $eventId";
343
        $res = Database::query($sql);
344
        $repeatInfo = array();
345
        if (Database::num_rows($res) > 0) {
346
            $repeatInfo = Database::fetch_array($res, 'ASSOC');
347
        }
348
349
        return $repeatInfo;
350
    }
351
352
    /**
353
     * @param int $eventId

main/inc/lib/api.lib.php 1 location

@@ 2085-2100 (lines=16) @@
2082
 * @param int       Session ID
2083
 * @return array    information of the session
2084
 */
2085
function api_get_session_info($session_id)
2086
{
2087
    $data = array();
2088
    if (!empty($session_id)) {
2089
        $session_id = intval($session_id);
2090
        $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
2091
        $sql = "SELECT * FROM $tbl_session WHERE id = $session_id";
2092
        $result = Database::query($sql);
2093
2094
        if (Database::num_rows($result)>0) {
2095
            $data = Database::fetch_array($result, 'ASSOC');
2096
        }
2097
    }
2098
2099
    return $data;
2100
}
2101
2102
/**
2103
 * Gets the session visibility by session id