| @@ 69-76 (lines=8) @@ | ||
| 66 | $sql = 'SELECT ref_id FROM '.$tbl_grade_links.' |
|
| 67 | WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE; |
|
| 68 | $rs_attendance = Database::query($sql); |
|
| 69 | if (Database::num_rows($rs_attendance) > 0) { |
|
| 70 | $row_attendance = Database::fetch_array($rs_attendance); |
|
| 71 | $attendance_id = $row_attendance['ref_id']; |
|
| 72 | $sql = 'UPDATE '.$tbl_attendance.' SET |
|
| 73 | attendance_weight ='.floatval($final_weight).' |
|
| 74 | WHERE c_id = '.$course_id.' AND id = '.intval($attendance_id); |
|
| 75 | Database::query($sql); |
|
| 76 | } |
|
| 77 | ||
| 78 | //Update weight into forum thread |
|
| 79 | $sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$final_weight.' |
|
| @@ 1231-1236 (lines=6) @@ | ||
| 1228 | WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE; |
|
| 1229 | ||
| 1230 | $rs_attendance = Database::query($sql); |
|
| 1231 | if (Database::num_rows($rs_attendance) > 0) { |
|
| 1232 | $row_attendance = Database::fetch_array($rs_attendance); |
|
| 1233 | $sql = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.$weight.' |
|
| 1234 | WHERE c_id = '.$course_id.' AND id = '.intval($row_attendance['ref_id']); |
|
| 1235 | Database::query($sql); |
|
| 1236 | } |
|
| 1237 | // Update weight into forum thread |
|
| 1238 | $sql = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$weight.' |
|
| 1239 | WHERE |
|