|
@@ 3845-3849 (lines=5) @@
|
| 3842 |
|
$row2 = Database::fetch_array($res_sel2); |
| 3843 |
|
$next_next = $row2['next_item_id']; |
| 3844 |
|
// Update previous item (switch with current). |
| 3845 |
|
if ($previous != 0) { |
| 3846 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET next_item_id = $next |
| 3847 |
|
WHERE c_id = ".$course_id." AND id = $previous"; |
| 3848 |
|
Database::query($sql_upd2); |
| 3849 |
|
} |
| 3850 |
|
// Update current item (switch with previous). |
| 3851 |
|
if ($id != 0) { |
| 3852 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
|
@@ 3851-3856 (lines=6) @@
|
| 3848 |
|
Database::query($sql_upd2); |
| 3849 |
|
} |
| 3850 |
|
// Update current item (switch with previous). |
| 3851 |
|
if ($id != 0) { |
| 3852 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3853 |
|
previous_item_id = $next, next_item_id = $next_next, display_order = display_order+1 |
| 3854 |
|
WHERE c_id = ".$course_id." AND id = $id"; |
| 3855 |
|
Database::query($sql_upd2); |
| 3856 |
|
} |
| 3857 |
|
|
| 3858 |
|
// Update next item (new previous item). |
| 3859 |
|
if ($next != 0) { |
|
@@ 3859-3864 (lines=6) @@
|
| 3856 |
|
} |
| 3857 |
|
|
| 3858 |
|
// Update next item (new previous item). |
| 3859 |
|
if ($next != 0) { |
| 3860 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3861 |
|
previous_item_id = $previous, next_item_id = $id, display_order = display_order-1 |
| 3862 |
|
WHERE c_id = ".$course_id." AND id = $next"; |
| 3863 |
|
Database::query($sql_upd2); |
| 3864 |
|
} |
| 3865 |
|
|
| 3866 |
|
// Update next_next item (switch "previous" with current). |
| 3867 |
|
if ($next_next != 0) { |
|
@@ 3867-3872 (lines=6) @@
|
| 3864 |
|
} |
| 3865 |
|
|
| 3866 |
|
// Update next_next item (switch "previous" with current). |
| 3867 |
|
if ($next_next != 0) { |
| 3868 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3869 |
|
previous_item_id = $id |
| 3870 |
|
WHERE c_id = ".$course_id." AND id = $next_next"; |
| 3871 |
|
Database::query($sql_upd2); |
| 3872 |
|
} |
| 3873 |
|
$display = $display + 1; |
| 3874 |
|
} |
| 3875 |
|
break; |