| @@ 62-69 (lines=8) @@ | ||
| 59 | $sql = 'SELECT ref_id FROM '.$tbl_grade_links.' |
|
| 60 | WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE; |
|
| 61 | $rs_attendance = Database::query($sql); |
|
| 62 | if (Database::num_rows($rs_attendance) > 0) { |
|
| 63 | $row_attendance = Database::fetch_array($rs_attendance); |
|
| 64 | $attendance_id = $row_attendance['ref_id']; |
|
| 65 | $sql = 'UPDATE '.$tbl_attendance.' SET |
|
| 66 | attendance_weight ='.floatval($final_weight).' |
|
| 67 | WHERE c_id = '.$course_id.' AND id = '.intval($attendance_id); |
|
| 68 | Database::query($sql); |
|
| 69 | } |
|
| 70 | ||
| 71 | //Update weight into forum thread |
|
| 72 | $sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$final_weight.' |
|
| @@ 1161-1166 (lines=6) @@ | ||
| 1158 | WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE; |
|
| 1159 | ||
| 1160 | $rs_attendance = Database::query($sql); |
|
| 1161 | if (Database::num_rows($rs_attendance) > 0) { |
|
| 1162 | $row_attendance = Database::fetch_array($rs_attendance); |
|
| 1163 | $sql = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.$weight.' |
|
| 1164 | WHERE c_id = '.$course_id.' AND id = '.intval($row_attendance['ref_id']); |
|
| 1165 | Database::query($sql); |
|
| 1166 | } |
|
| 1167 | // Update weight into forum thread |
|
| 1168 | $sql = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$weight.' |
|
| 1169 | WHERE |
|