From: Roland Häder Date: Mon, 18 Feb 2008 23:02:30 +0000 (+0000) Subject: withdraw != payout and SQL error in wernis extension fixed X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ea51845b3ed3223a02046ae66dc48c4e65d7f491;p=mailer.git withdraw != payout and SQL error in wernis extension fixed --- diff --git a/inc/modules/member/what-wernis.php b/inc/modules/member/what-wernis.php index 09dfd4a3fe..13fb648bb4 100644 --- a/inc/modules/member/what-wernis.php +++ b/inc/modules/member/what-wernis.php @@ -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