| @@ 3378-3399 (lines=22) @@ | ||
| 3375 | * @author Isaac Flores <[email protected]>, U.N.A.S University |
|
| 3376 | * @version December 2008, dokeos 1.8.6 |
|
| 3377 | */ |
|
| 3378 | function current_qualify_of_thread($threadId, $sessionId, $userId) |
|
| 3379 | { |
|
| 3380 | $table_threads_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY); |
|
| 3381 | ||
| 3382 | $course_id = api_get_course_int_id(); |
|
| 3383 | $currentUserId = api_get_user_id(); |
|
| 3384 | $sessionId = intval($sessionId); |
|
| 3385 | $threadId = intval($threadId); |
|
| 3386 | ||
| 3387 | $sql = "SELECT qualify FROM $table_threads_qualify |
|
| 3388 | WHERE |
|
| 3389 | c_id = $course_id AND |
|
| 3390 | thread_id = $threadId AND |
|
| 3391 | session_id = $sessionId AND |
|
| 3392 | qualify_user_id = $currentUserId AND |
|
| 3393 | user_id = $userId |
|
| 3394 | "; |
|
| 3395 | $res = Database::query($sql); |
|
| 3396 | $row = Database::fetch_array($res, 'ASSOC'); |
|
| 3397 | ||
| 3398 | return $row['qualify']; |
|
| 3399 | } |
|
| 3400 | ||
| 3401 | /** |
|
| 3402 | * This function stores a reply in the forum_post table. |
|
| @@ 810-837 (lines=28) @@ | ||
| 807 | * @param int Thematic advance id |
|
| 808 | * @return int Affected rows |
|
| 809 | */ |
|
| 810 | public function thematic_advance_destroy($thematic_advance_id) |
|
| 811 | { |
|
| 812 | $_course = api_get_course_info(); |
|
| 813 | $course_id = api_get_course_int_id(); |
|
| 814 | ||
| 815 | // definition database table |
|
| 816 | $tbl_thematic_advance = Database::get_course_table(TABLE_THEMATIC_ADVANCE); |
|
| 817 | ||
| 818 | // protect data |
|
| 819 | $thematic_advance_id = intval($thematic_advance_id); |
|
| 820 | $user_id = api_get_user_id(); |
|
| 821 | ||
| 822 | $sql = "DELETE FROM $tbl_thematic_advance |
|
| 823 | WHERE c_id = $course_id AND id = $thematic_advance_id "; |
|
| 824 | $result = Database::query($sql); |
|
| 825 | $affected_rows = Database::affected_rows($result); |
|
| 826 | if ($affected_rows) { |
|
| 827 | api_item_property_update( |
|
| 828 | $_course, |
|
| 829 | 'thematic_advance', |
|
| 830 | $thematic_advance_id, |
|
| 831 | 'ThematicAdvanceDeleted', |
|
| 832 | $user_id |
|
| 833 | ); |
|
| 834 | } |
|
| 835 | ||
| 836 | return $affected_rows; |
|
| 837 | } |
|
| 838 | ||
| 839 | /** |
|
| 840 | * get thematic plan data |
|