| @@ 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 ='.api_float_val($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 = 'UPDATE '.$tbl_forum_thread.' SET |
|
| @@ 1268-1274 (lines=7) @@ | ||
| 1265 | WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE; |
|
| 1266 | ||
| 1267 | $rs_attendance = Database::query($sql); |
|
| 1268 | if (Database::num_rows($rs_attendance) > 0) { |
|
| 1269 | $row_attendance = Database::fetch_array($rs_attendance); |
|
| 1270 | $sql = 'UPDATE '.$tbl_attendance.' SET |
|
| 1271 | attendance_weight ='.api_float_val($weight).' |
|
| 1272 | WHERE c_id = '.$course_id.' AND id = '.intval($row_attendance['ref_id']); |
|
| 1273 | Database::query($sql); |
|
| 1274 | } |
|
| 1275 | // Update weight into forum thread |
|
| 1276 | $sql = 'UPDATE '.$tbl_forum_thread.' SET |
|
| 1277 | thread_weight = '.api_float_val($weight).' |
|