Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 333-345 (lines=13) @@
330
     * Retrieves the user defined course categories and all the info that goes with it
331
     * @return array containing all the info of the user defined courses categories with the id as key of the array
332
     */
333
    public function get_user_course_categories_info()
334
    {
335
        $current_user_id = api_get_user_id();
336
        $table_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
337
        $sql = "SELECT * FROM " . $table_category . "
338
                WHERE user_id='" . $current_user_id . "'
339
                ORDER BY sort ASC";
340
        $result = Database::query($sql);
341
        while ($row = Database::fetch_array($result)) {
342
            $output[$row['id']] = $row;
343
        }
344
        return $output;
345
    }
346
347
    /**
348
     * Updates the user course category in the chamilo_user database

main/dropbox/dropbox_functions.inc.php 1 location

@@ 1285-1297 (lines=13) @@
1282
* @author Patrick Cool <[email protected]>, Ghent University
1283
* @version march 2006
1284
*/
1285
function get_total_number_feedback($file_id = '')
1286
{
1287
    $course_id = api_get_course_int_id();
1288
    $sql = "SELECT COUNT(feedback_id) AS total, file_id
1289
            FROM ". Database::get_course_table(TABLE_DROPBOX_FEEDBACK) ."
1290
            WHERE c_id = $course_id GROUP BY file_id";
1291
    $result = Database::query($sql);
1292
    $return = array();
1293
    while ($row=Database::fetch_array($result)) {
1294
        $return[$row['file_id']] = $row['total'];
1295
    }
1296
    return $return;
1297
}
1298
1299
1300
/**