|
@@ 3821-3825 (lines=5) @@
|
| 3818 |
|
$row2 = Database::fetch_array($res_sel2); |
| 3819 |
|
$next_next = $row2['next_item_id']; |
| 3820 |
|
// Update previous item (switch with current). |
| 3821 |
|
if ($previous != 0) { |
| 3822 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET next_item_id = $next |
| 3823 |
|
WHERE c_id = ".$course_id." AND id = $previous"; |
| 3824 |
|
Database::query($sql_upd2); |
| 3825 |
|
} |
| 3826 |
|
// Update current item (switch with previous). |
| 3827 |
|
if ($id != 0) { |
| 3828 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
|
@@ 3827-3832 (lines=6) @@
|
| 3824 |
|
Database::query($sql_upd2); |
| 3825 |
|
} |
| 3826 |
|
// Update current item (switch with previous). |
| 3827 |
|
if ($id != 0) { |
| 3828 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3829 |
|
previous_item_id = $next, next_item_id = $next_next, display_order = display_order+1 |
| 3830 |
|
WHERE c_id = ".$course_id." AND id = $id"; |
| 3831 |
|
Database::query($sql_upd2); |
| 3832 |
|
} |
| 3833 |
|
|
| 3834 |
|
// Update next item (new previous item). |
| 3835 |
|
if ($next != 0) { |
|
@@ 3835-3840 (lines=6) @@
|
| 3832 |
|
} |
| 3833 |
|
|
| 3834 |
|
// Update next item (new previous item). |
| 3835 |
|
if ($next != 0) { |
| 3836 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3837 |
|
previous_item_id = $previous, next_item_id = $id, display_order = display_order-1 |
| 3838 |
|
WHERE c_id = ".$course_id." AND id = $next"; |
| 3839 |
|
Database::query($sql_upd2); |
| 3840 |
|
} |
| 3841 |
|
|
| 3842 |
|
// Update next_next item (switch "previous" with current). |
| 3843 |
|
if ($next_next != 0) { |
|
@@ 3843-3848 (lines=6) @@
|
| 3840 |
|
} |
| 3841 |
|
|
| 3842 |
|
// Update next_next item (switch "previous" with current). |
| 3843 |
|
if ($next_next != 0) { |
| 3844 |
|
$sql_upd2 = "UPDATE $tbl_lp_item SET |
| 3845 |
|
previous_item_id = $id |
| 3846 |
|
WHERE c_id = ".$course_id." AND id = $next_next"; |
| 3847 |
|
Database::query($sql_upd2); |
| 3848 |
|
} |
| 3849 |
|
$display = $display + 1; |
| 3850 |
|
} |
| 3851 |
|
break; |