@@ 3679-3696 (lines=18) @@ | ||
3676 | * @author Patrick Cool <[email protected]>, Ghent University |
|
3677 | * @version January 2007 |
|
3678 | */ |
|
3679 | public static function get_number_of_survey_invitations() |
|
3680 | { |
|
3681 | $course_id = api_get_course_int_id(); |
|
3682 | ||
3683 | // Database table definition |
|
3684 | $table_survey_invitation = Database :: get_course_table(TABLE_SURVEY_INVITATION); |
|
3685 | ||
3686 | $sql = "SELECT count(user) AS total |
|
3687 | FROM $table_survey_invitation |
|
3688 | WHERE |
|
3689 | c_id = $course_id AND |
|
3690 | survey_id='".intval($_GET['survey_id'])."' AND |
|
3691 | session_id='".api_get_session_id()."' "; |
|
3692 | $res = Database::query($sql); |
|
3693 | $row = Database::fetch_array($res,'ASSOC'); |
|
3694 | ||
3695 | return $row['total']; |
|
3696 | } |
|
3697 | ||
3698 | /** |
|
3699 | * Save the invitation mail |
@@ 5510-5520 (lines=11) @@ | ||
5507 | * @author Christian Fasanando |
|
5508 | * @author Julio Montoya <[email protected]> Adding security |
|
5509 | */ |
|
5510 | function get_name_thread_by_id($thread_id) |
|
5511 | { |
|
5512 | $t_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD); |
|
5513 | $course_id = api_get_course_int_id(); |
|
5514 | $sql = "SELECT thread_title FROM ".$t_forum_thread." |
|
5515 | WHERE c_id = $course_id AND thread_id = '".intval($thread_id)."' "; |
|
5516 | $result = Database::query($sql); |
|
5517 | $row = Database::fetch_array($result); |
|
5518 | ||
5519 | return $row[0]; |
|
5520 | } |
|
5521 | ||
5522 | /** |
|
5523 | * This function gets all the post written by an user |
@@ 4370-4386 (lines=17) @@ | ||
4367 | * @param int $item_id |
|
4368 | * @param array $course_info |
|
4369 | */ |
|
4370 | function makeInvisible($item_id, $course_info) |
|
4371 | { |
|
4372 | $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION); |
|
4373 | $item_id = intval($item_id); |
|
4374 | $course_id = $course_info['real_id']; |
|
4375 | $sql = "UPDATE " . $work_table . " |
|
4376 | SET accepted = 0 |
|
4377 | WHERE c_id = $course_id AND id = '" . $item_id . "'"; |
|
4378 | Database::query($sql); |
|
4379 | api_item_property_update( |
|
4380 | $course_info, |
|
4381 | 'work', |
|
4382 | $item_id, |
|
4383 | 'invisible', |
|
4384 | api_get_user_id() |
|
4385 | ); |
|
4386 | } |
|
4387 | ||
4388 | /** |
|
4389 | * @param int $item_id |