summaryrefslogtreecommitdiff
path: root/lib/deck/mvent.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:43:37 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:43:37 +0200
commit8ea62323ae3b193b3088bc07f83ff2108dcca2fd (patch)
tree75edac7f64c5846ffc20f783caf7c5ff418c08d5 /lib/deck/mvent.php
parent738639355db0dd88682385873c047b3f96969622 (diff)
downloadBits-8ea62323ae3b193b3088bc07f83ff2108dcca2fd.tar.gz
Bits-8ea62323ae3b193b3088bc07f83ff2108dcca2fd.zip
Bugfixes.
Diffstat (limited to 'lib/deck/mvent.php')
-rw-r--r--lib/deck/mvent.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/deck/mvent.php b/lib/deck/mvent.php
index 10d585a..28a7fa3 100644
--- a/lib/deck/mvent.php
+++ b/lib/deck/mvent.php
@@ -23,8 +23,8 @@ if ($pos > $mn) {
$error = "A position is at least one...";
} else {
sql("UPDATE cards SET number = 0 WHERE id = $cardid");
- sql("UPDATE cards SET number = number - 1 WHERE number > " . $card['number']);
- sql("UPDATE cards SET number = number + 1 WHERE number >= $pos");
+ sql("UPDATE cards SET number = number - 1 WHERE number > " . $card['number'] . " AND deck = $deckid ORDER BY number ASC");
+ sql("UPDATE cards SET number = number + 1 WHERE number >= $pos AND deck = $deckid ORDER BY number DESC");
sql("UPDATE cards SET number = $pos WHERE id = $cardid");
sql("UPDATE deck_study SET need_check = 1 WHERE deck = $deckid");
header("Location: view-deck-$deckid");