]> git.mxchange.org Git - mailer.git/commitdiff
withdraw != payout and SQL error in wernis extension fixed
authorRoland Häder <roland@mxchange.org>
Mon, 18 Feb 2008 23:02:30 +0000 (23:02 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 18 Feb 2008 23:02:30 +0000 (23:02 +0000)
inc/modules/member/what-wernis.php

index 09dfd4a3fe8c59c698c8995e0379910c0c4a6f31..13fb648bb4e6a8d1fb28ab82fc0eab1c4947141a 100644 (file)
@@ -280,19 +280,15 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
                                        }
 
                                        // Remove the points from the account
-                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `points_used` = `points_used` + %d WHERE userid=%d LIMIT 1",
-                                               array(bigintval($_POST['amount']), $GLOBALS['userid']), __FILE__, __LINE__);
+                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `used_points` = `used_points` + %d, `wernis_userid`=%d WHERE userid=%d LIMIT 1",
+                                               array(bigintval($_POST['amount']), bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
 
                                        // Register this wernis movement
                                        $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_wernis (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`) VALUES(%d, %d, %d, UNIX_TIMESTAMP(), 'OUT')",
                                                array($GLOBALS['userid'], bigintval($_POST['wds66_id']), bigintval($_POST['amount'])), __FILE__, __LINE__);
 
-                                       // Update the user data as well..
-                                       $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET `wernis_userid`=%d WHERE userid=%d LIMIT 1",
-                                               array(bigintval($_POST['wds66_id']), $GLOBALS['userid']), __FILE__, __LINE__);
-
                                        // All done!
-                                       LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_WITHDRAW_DONE);
+                                       LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_PAYOUT_DONE);
                                        return;
                                } elseif ((GET_WERNIS_ERROR_CODE() == "user_failed") || (GET_WERNIS_ERROR_CODE() == "own_failed") || (GET_WERNIS_ERROR_CODE() == "amount_failed") || (GET_WERNIS_ERROR_CODE() == "api_amount_failed")) {
                                        // Wrong login data