@@ 483-495 (lines=13) @@ | ||
480 | * @return array link info |
|
481 | * |
|
482 | **/ |
|
483 | public static function get_link_info($id) |
|
484 | { |
|
485 | $tbl_link = Database:: get_course_table(TABLE_LINK); |
|
486 | $course_id = api_get_course_int_id(); |
|
487 | $sql = "SELECT * FROM " . $tbl_link . " |
|
488 | WHERE c_id = $course_id AND id='" . intval($id) . "' "; |
|
489 | $result = Database::query($sql); |
|
490 | $data = array(); |
|
491 | if (Database::num_rows($result)) { |
|
492 | $data = Database::fetch_array($result); |
|
493 | } |
|
494 | return $data; |
|
495 | } |
|
496 | ||
497 | /** |
|
498 | * @param int $id |
@@ 448-461 (lines=14) @@ | ||
445 | * @param int url id |
|
446 | * @return boolean true if success |
|
447 | * */ |
|
448 | public static function relation_url_session_exist($session_id, $url_id) |
|
449 | { |
|
450 | $table_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
451 | $session_id = intval($session_id); |
|
452 | $url_id = intval($url_id); |
|
453 | $sql = "SELECT session_id FROM $table_url_rel_session |
|
454 | WHERE |
|
455 | access_url_id = ".intval($url_id)." AND |
|
456 | session_id = ".Database::escape_string($session_id); |
|
457 | $result = Database::query($sql); |
|
458 | $num = Database::num_rows($result); |
|
459 | ||
460 | return $num; |
|
461 | } |
|
462 | ||
463 | /** |
|
464 | * Add a group of users into a group of URLs |