Wernis extension added
authorRoland Häder <roland@mxchange.org>
Mon, 17 Mar 2008 12:04:04 +0000 (12:04 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 17 Mar 2008 12:04:04 +0000 (12:04 +0000)
inc/extensions/ext-wernis.php
inc/language/wernis_de.php
inc/libs/wernis_functions.php
inc/modules/admin/what-list_wernis.php
inc/modules/member/what-wernis.php
templates/de/html/member/member_wernis_mode_list_row.tpl

index cce98ab27bdc79984b413c5b9af9d361f5d2ad99..013714a5692f74caae1fd41e391ad8bb39e74aac 100644 (file)
@@ -58,7 +58,9 @@ userid bigint(20) NOT NULL default '0',
 wernis_account varchar(255) NOT NULL default '',
 wernis_amount double(22,5) NOT NULL default '0.00000',
 wernis_timestamp varchar(10) NOT NULL default '0',
 wernis_account varchar(255) NOT NULL default '',
 wernis_amount double(22,5) NOT NULL default '0.00000',
 wernis_timestamp varchar(10) NOT NULL default '0',
-wernis_type ENUM('IN','OUT') NOT NULL default 'OUT',
+wernis_type ENUM('IN','OUT', 'FAILED') NOT NULL default 'FAILED',
+wernis_api_message TINYTEXT,
+wernis_api_status varchar(255) NULL default NULL
 KEY(userid),
 PRIMARY KEY(id)
 ) TYPE=MyISAM";
 KEY(userid),
 PRIMARY KEY(id)
 ) TYPE=MyISAM";
index 7636c372845d800638550e47ed940dc751e3de84..fc61ac1acbe9cc389265e344a0de4ee2f5cd08a8 100644 (file)
@@ -47,14 +47,22 @@ define('WERNIS_ADMIN_API_ID', "WDS66-API-ID (api_id=x)");
 define('WERNIS_ADMIN_API_MD5', "WDS66-API-Key (api_md5=xxxxx; 32-stellig)");
 define('WERNIS_ADMIN_API_URL', "Basis-URL der API-Skripte");
 define('WERNIS_ADMIN_REFID', "Ihre Referral-ID bei WDS66-Portal (= Ihr Username!)");
 define('WERNIS_ADMIN_API_MD5', "WDS66-API-Key (api_md5=xxxxx; 32-stellig)");
 define('WERNIS_ADMIN_API_URL', "Basis-URL der API-Skripte");
 define('WERNIS_ADMIN_REFID', "Ihre Referral-ID bei WDS66-Portal (= Ihr Username!)");
-define('WERNIS_ADMIN_CONFIG_NOTE', "<A href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</A> k&ouml;nnen Sie schon f&uuml;r <strong>5,00&euro;</strong>=<strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> {!POINTS!}-Account dennoch n&ouml;tig!) <strong>Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von {!POINTS!}/Wernis ben&ouml;tigt.");
-define('MEMBER_WERNIS_MODE_CHOOSE', "M&ouml;chten Sie {!POINTS!} zu Ihrem WDS66-Hauptaccount ausbezahlt bekommen oder Wernis hier einzahlen?");
+define('WERNIS_ADMIN_CONFIG_NOTE', "<A href=\"http://www.wds66.com/ref.php?refid=10437\" target=\"_blank\">Hier</A> k&ouml;nnen Sie schon f&uuml;r <strong>5,00&euro;</strong>=<strong>25.000 Abfragen</strong> ein API-Account beantragen (dazu ist ein <strong>kostenloses</strong> {!POINTS!}-Account dennoch n&ouml;tig!) <strong>Geben Sie immer Ihren Usernamen von WDS66-Hauptaccount ein und &uuml;berpr&uuml;fen Sie diesen mehrmals! Er wird zum &Uuml;berweisen von {!POINTS!}/{!POINTS!} ben&ouml;tigt.");
+define('WERNIS_ADMIN_NO_TRANSFERS', "Derzeit keine {!POINTS!} transferiert!");
+define('WERNIS_ADMIN_WDS66_ACCOUNT', "Account bei WDS66-Portal");
+define('WERNIS_ADMIN_TRANSFERED', "{!POINTS!} transferiert");
+define('WERNIS_ADMIN_TIMESTAMP', "Zeitpunkt &Uuml;berweisung");
+define('WERNIS_ADMIN_TYPE', "&Uuml;berweisungsrichtung");
+define('WERNIS_ADMIN_API_MESSAGE', "Nachricht von WDS66-API");
+define('WERNIS_ADMIN_API_STATUS', "Status von WDS66-API");
+define('MEMBER_WERNIS_MODE_CHOOSE', "M&ouml;chten Sie {!POINTS!} zu Ihrem WDS66-Hauptaccount ausbezahlt bekommen oder {!POINTS!} hier einzahlen?");
 define('MEMBER_WERNIS_MODE_CHOOSE2', "Hier klicken um neue &Uuml;berweisung zu starten...");
 define('MEMBER_WERNIS_MODE_CHOOSE2', "Hier klicken um neue &Uuml;berweisung zu starten...");
-define('MEMBER_WERNIS_MODE_WITHDRAW', "Wernis einzahlen");
+define('MEMBER_WERNIS_MODE_WITHDRAW', "{!POINTS!} einzahlen");
 define('MEMBER_WERNIS_MODE_PAYOUT', "{!POINTS!} auszahlen");
 define('MEMBER_WERNIS_MODE_PAYOUT', "{!POINTS!} auszahlen");
-define('WERNIS_STATUS_UNKNWOWN', "Wernis-Typ <u>%s</u> unbekannt.");
+define('WERNIS_STATUS_UNKNWOWN', "{!POINTS!}-Typ <u>%s</u> unbekannt.");
 define('WERNIS_STATUS_WITHDRAW', "Einzahlung von WDS66");
 define('WERNIS_STATUS_PAYOUT', "Auszahlung an WDS66");
 define('WERNIS_STATUS_WITHDRAW', "Einzahlung von WDS66");
 define('WERNIS_STATUS_PAYOUT', "Auszahlung an WDS66");
+define('WERNIS_STATUS_FAILED', "Fehlgeschlagen");
 define('WERNIS_TIMESTAMP', "Buchungszeitmarke");
 define('WERNIS_ACCOUNT', "WDS66-Hauptaccount");
 define('WERNIS_TOTAL_WERNIS', "Gesamt &uuml;berwiesen");
 define('WERNIS_TIMESTAMP', "Buchungszeitmarke");
 define('WERNIS_ACCOUNT', "WDS66-Hauptaccount");
 define('WERNIS_TOTAL_WERNIS', "Gesamt &uuml;berwiesen");
@@ -66,7 +74,7 @@ define('WERNIS_API_REQUEST_DATA_MISSING', "Interner Fehler: Abfragedaten sind ni
 define('WERNIS_API_REQUEST_ERROR', "Abfragefehler: <u>%s</u>");
 define('WERNIS_API_REQUEST_FAILED', "Unbekannter Fehler <u>%s</u> von API erhalten! Bitte im [<A href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</A>], den Fehlercode nennen und wie es dazu gekommen ist.");
 define('WERNIS_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte API-ID und Key &uuml;berpr&uuml;fen. [<A href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</A>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
 define('WERNIS_API_REQUEST_ERROR', "Abfragefehler: <u>%s</u>");
 define('WERNIS_API_REQUEST_FAILED', "Unbekannter Fehler <u>%s</u> von API erhalten! Bitte im [<A href=\"http://forum.mxchange.org\" target=\"_blank\" title=\"Direktlink zum Forum\">Forum melden</A>], den Fehlercode nennen und wie es dazu gekommen ist.");
 define('WERNIS_API_REQUEST_FAILED_AUTH', "Authorisierung an API fehlgeschlagen! Bitte API-ID und Key &uuml;berpr&uuml;fen. [<A href=\"http://www.wds66.com/modules.php?module=export\" target=\"_blank\" title=\"Direkt zum WDS66-Exportaccount\">Hier</A>] direkt zum Export-Account. Sie ben&ouml;tigen Ihren Usernamen und Passwort!");
-define('WERNIS_API_REQUEST_FAILED_USER', "Useraccount nicht gefunden oder Wernis-Passwort ist ung&uuml;ltig!");
+define('WERNIS_API_REQUEST_FAILED_USER', "Useraccount nicht gefunden oder {!POINTS!}-Passwort ist ung&uuml;ltig!");
 define('WERNIS_API_REQUEST_FAILED_OWN', "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.");
 define('WERNIS_API_REQUEST_FAILED_AMOUNT', "Konto weist nicht gen&uuml;gend Deckung auf.");
 define('WERNIS_API_REQUEST_FAILED_API_AMOUNT', "API-Konto weist nicht gen&uuml;gend Deckung auf.");
 define('WERNIS_API_REQUEST_FAILED_OWN', "&Uuml;berweisung an eigenes Account nicht m&ouml;glich.");
 define('WERNIS_API_REQUEST_FAILED_AMOUNT', "Konto weist nicht gen&uuml;gend Deckung auf.");
 define('WERNIS_API_REQUEST_FAILED_API_AMOUNT', "API-Konto weist nicht gen&uuml;gend Deckung auf.");
@@ -81,22 +89,22 @@ define('WERNIS_UNKNOWN_ERROR', "Unbekannter Fehler aufgetreten!");
 define('WERNIS_MEMBER_NO_ACCOUNT', "Noch kein WDS66-Account? Hier entlang!");
 define('WERNIS_MEMBER_API_DATA_MISSING', "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten m&uuml;ssen.");
 define('WERNIS_MEMBER_MIN_PAYOUT_PAYOUT', "Sie haben nicht gen&uuml;gend {!POINTS!} zum Auszahlen! Mindestens: <u>%s</u> {!POINTS!}.");
 define('WERNIS_MEMBER_NO_ACCOUNT', "Noch kein WDS66-Account? Hier entlang!");
 define('WERNIS_MEMBER_API_DATA_MISSING', "Diese Funktion kann derzeit nicht genutzt werden, da wir sie noch einrichten m&uuml;ssen.");
 define('WERNIS_MEMBER_MIN_PAYOUT_PAYOUT', "Sie haben nicht gen&uuml;gend {!POINTS!} zum Auszahlen! Mindestens: <u>%s</u> {!POINTS!}.");
-define('WERNIS_MEMBER_WITHDRAW_TITLE', "Wernis bei {!MAIN_TITLE!} einzahlen:");
+define('WERNIS_MEMBER_WITHDRAW_TITLE', "{!POINTS!} bei {!MAIN_TITLE!} einzahlen:");
 define('WERNIS_MEMBER_WITHDRAW_POINTS_ACCOUNT', "{!POINTS!} hier im Account:");
 define('WERNIS_MEMBER_WITHDRAW_POINTS_ACCOUNT', "{!POINTS!} hier im Account:");
-define('WERNIS_MEMBER_WITHDRAW_MIN_POINTS', "Mindest einzuzahlendes Wernis-Guthaben:");
+define('WERNIS_MEMBER_WITHDRAW_MIN_POINTS', "Mindest einzuzahlendes {!POINTS!}-Guthaben:");
 define('WERNIS_MEMBER_WITHDRAW_SUBMIT', "{!POINTS!} jetzt einzahlen");
 define('WERNIS_MEMBER_WITHDRAW_SUBMIT', "{!POINTS!} jetzt einzahlen");
-define('WERNIS_MEMBER_WITHDRAW_NOTE', "Ihr Wernis-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! Ihr WDS66-Konto sollte ausreichend Deckung aufweisen!");
-define('WERNIS_MEMBER_PAYOUT_TITLE', "Wernis auf Ihr WDS66-Hauptaccount auszahlen");
+define('WERNIS_MEMBER_WITHDRAW_NOTE', "Ihr {!POINTS!}-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei {!POINTS!}-Betrag nur gerade Betr&auml;ge eingeben! Ihr WDS66-Konto sollte ausreichend Deckung aufweisen!");
+define('WERNIS_MEMBER_PAYOUT_TITLE', "{!POINTS!} auf Ihr WDS66-Hauptaccount auszahlen");
 define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes {!POINTS!}-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes {!POINTS!}-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
 define('WERNIS_MEMBER_PAYOUT_POINTS', "Auszahlf&auml;higes {!POINTS!}-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_MIN_POINTS', "Mindestens auszuzahlendes {!POINTS!}-Guthaben");
 define('WERNIS_MEMBER_PAYOUT_SUBMIT', "Auszahlung durchf&uuml;hren");
-define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr Wernis-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei Wernis-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.");
+define('WERNIS_MEMBER_PAYOUT_NOTE', "Ihr {!POINTS!}-Passwort wird bei {!MAIN_TITLE!} nicht gespeichert. Bitte bei {!POINTS!}-Betrag nur gerade Betr&auml;ge eingeben! &Uuml;berpr&uuml;fen Sie vor dem Absenden Ihren WDS66-Usernamen.");
 define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
 define('WERNIS_MEMBER_WDS66_ID', "Username bei WDS66-Portal: [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
-define('WERNIS_MEMBER_WDS66_PASSWORD', "Wernis-Passwort (nicht Accountpasswort!): [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
+define('WERNIS_MEMBER_WDS66_PASSWORD', "{!POINTS!}-Passwort (nicht Accountpasswort!): [<A href=\"http://www.wds66.com/modules.php?module=psw_verg\" target=\"_blank\">Vergessen?</A>]");
 define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
 define('WERNIS_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <u>%s</u> erkannt! Bitte links im Men&uuml; fortfahren.");
 define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben.");
 define('WERNIS_MEMBER_WDS66_AMOUNT', "Zu &uuml;berweisenden Betrag eingeben:");
 define('WERNIS_MEMBER_MODE_INVALID', "Ung&uuml;ltiger Modus <u>%s</u> erkannt! Bitte links im Men&uuml; fortfahren.");
 define('WERNIS_MEMBER_EMPTY_USERNAME', "Sie haben Ihren WDS66-Usernamen nicht eingegeben.");
-define('WERNIS_MEMBER_EMPTY_PASSWORD', "Sieh haben kein Wernis-Passwort eingegeben.");
+define('WERNIS_MEMBER_EMPTY_PASSWORD', "Sieh haben kein {!POINTS!}-Passwort eingegeben.");
 define('WERNIS_MEMBER_EMPTY_AMOUNT', "Sie haben keine zu &uuml;berweisende Betrag angegeben.");
 define('WERNIS_MEMBER_INVALID_USERNAME', "Bitte nur Zahlen f&uuml;r den WDS66-Usernamen eingeben!");
 define('WERNIS_MEMBER_INVALID_AMOUNT', "Bitte nur Zahlen f&uuml;r den zu &uuml;berweisenden Betrag eingeben!");
 define('WERNIS_MEMBER_EMPTY_AMOUNT', "Sie haben keine zu &uuml;berweisende Betrag angegeben.");
 define('WERNIS_MEMBER_INVALID_USERNAME', "Bitte nur Zahlen f&uuml;r den WDS66-Usernamen eingeben!");
 define('WERNIS_MEMBER_INVALID_AMOUNT', "Bitte nur Zahlen f&uuml;r den zu &uuml;berweisenden Betrag eingeben!");
index 812fbf20ec0a60dd94ebe5cc12c0f183ae81514d..ae8ed57e564828690e966d5b168488d99e497471 100644 (file)
@@ -209,7 +209,7 @@ function WERNIS_TEST_API () {
 }
 
 // Widthdraw this amount
 }
 
 // Widthdraw this amount
-function WERNIS_EXECUTE_WITHDRAW($userId, $userMd5, $amount) {
+function WERNIS_EXECUTE_WITHDRAW ($wdsId, $userMd5, $amount) {
        global $_CONFIG;
        $result = false;
 
        global $_CONFIG;
        $result = false;
 
@@ -220,7 +220,7 @@ function WERNIS_EXECUTE_WITHDRAW($userId, $userMd5, $amount) {
        // Prepare the request data
        $requestData = array(
                'sub_request'   => "receive",
        // Prepare the request data
        $requestData = array(
                'sub_request'   => "receive",
-               't_uid'                 => bigintval($userId),
+               't_uid'                 => bigintval($wdsId),
                't_md5'                 => $userMd5,
                'r_uid'                 => $_CONFIG['wernis_refid'],
                'amount'                => bigintval($amount),
                't_md5'                 => $userMd5,
                'r_uid'                 => $_CONFIG['wernis_refid'],
                'amount'                => bigintval($amount),
@@ -233,9 +233,15 @@ function WERNIS_EXECUTE_WITHDRAW($userId, $userMd5, $amount) {
        if ($return['status'] == "OK") {
                // All fine!
                $result = true;
        if ($return['status'] == "OK") {
                // All fine!
                $result = true;
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'IN');
        } else {
                // Status failture text
                WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
        } else {
                // Status failture text
                WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
        }
 
        // Return result
        }
 
        // Return result
@@ -244,7 +250,7 @@ function WERNIS_EXECUTE_WITHDRAW($userId, $userMd5, $amount) {
 
 
 // Payout this amount
 
 
 // Payout this amount
-function WERNIS_EXECUTE_PAYOUT($userId, $userMd5, $amount) {
+function WERNIS_EXECUTE_PAYOUT ($wdsId, $userMd5, $amount) {
        global $_CONFIG;
        $result = false;
 
        global $_CONFIG;
        $result = false;
 
@@ -255,7 +261,7 @@ function WERNIS_EXECUTE_PAYOUT($userId, $userMd5, $amount) {
        // Prepare the request data
        $requestData = array(
                'sub_request'   => "send",
        // Prepare the request data
        $requestData = array(
                'sub_request'   => "send",
-               't_uid'                 => bigintval($userId),
+               't_uid'                 => bigintval($wdsId),
                't_md5'                 => $userMd5,
                'r_uid'                 => $_CONFIG['wernis_refid'],
                'amount'                => bigintval($amount),
                't_md5'                 => $userMd5,
                'r_uid'                 => $_CONFIG['wernis_refid'],
                'amount'                => bigintval($amount),
@@ -268,9 +274,15 @@ function WERNIS_EXECUTE_PAYOUT($userId, $userMd5, $amount) {
        if ($return['status'] == "OK") {
                // All fine!
                $result = true;
        if ($return['status'] == "OK") {
                // All fine!
                $result = true;
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'OUT');
        } else {
                // Status failture text
                WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
        } else {
                // Status failture text
                WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
+
+               // Log the transfer
+               WERNIS_LOG_TRANSFER($wdsId, $amount, 'FAILED', $return['message'], $return['status']);
        }
 
        // Return result
        }
 
        // Return result
@@ -278,7 +290,7 @@ function WERNIS_EXECUTE_PAYOUT($userId, $userMd5, $amount) {
 }
 
 // Translate the status IN/OUT
 }
 
 // Translate the status IN/OUT
-function WERNIS_TRANSFER_STATUS($status) {
+function WERNIS_TRANSFER_STATUS ($status) {
        // Default status
        $return = sprintf(WERNIS_STATUS_UNKNWOWN, $status);
        switch ($status) {
        // Default status
        $return = sprintf(WERNIS_STATUS_UNKNWOWN, $status);
        switch ($status) {
@@ -289,11 +301,21 @@ function WERNIS_TRANSFER_STATUS($status) {
                case "OUT": // Payout
                        $return = WERNIS_STATUS_PAYOUT;
                        break;
                case "OUT": // Payout
                        $return = WERNIS_STATUS_PAYOUT;
                        break;
+
+               case "FAILED": // Payout
+                       $return = WERNIS_STATUS_FAILED;
+                       break;
        }
 
        // Return the status
        return $return;
 }
 
        }
 
        // Return the status
        return $return;
 }
 
+function WERNIS_LOG_TRANSFER ($wdsId, $amount, $type = 'FAILED', $message = null, $status = null) {
+       // Register this wernis movement
+       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_wernis (`userid`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type`, `wernis_api_message`, `wernis_api_status`) VALUES(%d, %d, %d, UNIX_TIMESTAMP(), '%s', '%s', '%s')",
+               array($GLOBALS['userid'], bigintval($wdsId), bigintval($amount), $type, $message, $status), __FILE__, __LINE__);
+}
+
 //
 ?>
 //
 ?>
index b9e0521e4d80ff37eda1531f36c1fc0d74ad065c..0997be5da541e0e10310905017935ef766611d8f 100644 (file)
@@ -40,5 +40,37 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
 // Add description as navigation point
 ADD_DESCR("admin", basename(__FILE__));
 
+// Check for entries
+$result = SQL_QUERY("SELECT id, userid, wernis_account, wernis_amount, wernis_timestamp, wernis_type, wernis_api_message, wernis_api_status FROM "._MYSQL_PREFIX."_user_wernis ORDER BY wernis_timestamp DESC, id DESC",
+       __FILE__, __LINE__);
+
+// Are there some entries to display?
+if (SQL_NUMROWS($result) > 0) {
+       // List all entries
+       $OUT = ""; $SW = 2;
+       while ($content = SQL_FETCHARRAY($result)) {
+               // Translate some data and add color
+               $content['sw']                                  = $SW;
+               $content['link']                                = ADMIN_USER_PROFILE_LINK($content['userid']);
+               $content['wernis_amount']               = TRANSLATE_COMMA($content['wernis_amount']);
+               $content['wernis_timestamp']    = MAKE_DATETIME($content['wernis_timestamp'], "2");
+               $content['raw_type']                    = strtolower($content['wernis_type']);
+               $content['wernis_type']                 = WERNIS_TRANSFER_STATUS($content['wernis_type']);
+
+               // Append it and switch colors
+               $OUT .= LOAD_TEMPLATE("admin_list_wernis_row", true, $content);
+               $SW = 3 - $SW;
+       }
+
+       // Load main template
+       LOAD_TEMPLATE("admin_list_wernis_main", false, $OUT);
+} else {
+       // Nothing to display!
+       LOAD_TEMPLATE("admin_setting_saved", false, WERNIS_ADMIN_NO_TRANSFERS);
+}
+
+// Free the result
+SQL_FREERESULT($result);
+
 //
 ?>
 //
 ?>
index e0cd9f4eb7e6a5124fbb537a32a4887c65924f42..f6ef2687f6a853dcd7eb093734a2445d608589dc 100644 (file)
@@ -89,11 +89,12 @@ if ((!isset($_GET['mode'])) || ($_GET['mode'] == "choose")) {
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
                while ($data = SQL_FETCHARRAY($result)) {
                        // Prepare data for output
                        $rowContent = array(
-                               'stamp'         => MAKE_DATETIME($data['wernis_timestamp'], "2"),
-                               'points'        => TRANSLATE_COMMA($data['wernis_amount']),
-                               'acc'           => bigintval($data['wernis_account']),
-                               'status'        => WERNIS_TRANSFER_STATUS($data['wernis_type']),
-                               'sw'            => $SW,
+                               'stamp'                 => MAKE_DATETIME($data['wernis_timestamp'], "2"),
+                               'points'                => TRANSLATE_COMMA($data['wernis_amount']),
+                               'acc'                   => bigintval($data['wernis_account']),
+                               'status'                => WERNIS_TRANSFER_STATUS($data['wernis_type']),
+                               'raw_type'              => strtolower($data['wernis_type']),
+                               'sw'                    => $SW,
                        );
 
                        // Load row template
                        );
 
                        // Load row template
@@ -204,10 +205,6 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
                                        $DEPTH = 0;
                                        ADD_POINTS_REFSYSTEM($GLOBALS['userid'], bigintval($_POST['amount']), false, 0, false, "direct");
 
                                        $DEPTH = 0;
                                        ADD_POINTS_REFSYSTEM($GLOBALS['userid'], bigintval($_POST['amount']), false, 0, false, "direct");
 
-                                       // 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(), 'IN')",
-                                               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__);
                                        // 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__);
@@ -274,10 +271,6 @@ if ((isset($_POST['ok'])) && (isset($_GET['mode']))) {
                                        $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__);
 
                                        $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__);
-
                                        // All done!
                                        LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_PAYOUT_DONE);
                                        return;
                                        // All done!
                                        LOAD_TEMPLATE("admin_settings_saved", false, WERNIS_MEMBER_PAYOUT_DONE);
                                        return;
index 24ad219252a4f1058d4a4484a40a6f49f55315b9..fd7cc2c4b0ae6c1513629b52010fd777e4d1ed55 100644 (file)
@@ -1,6 +1,6 @@
 <TR>
 <TR>
-       <TD align="center" class="switch_sw$content[sw] bottom2 right2">$content[points] {!POINTS!}</TD>
-       <TD align="center" class="switch_sw$content[sw] bottom2 right2">$content[acc]</TD>
-       <TD align="center" class="switch_sw$content[sw] bottom2 right2">$content[stamp]</TD>
-       <TD align="center" class="switch_sw$content[sw] bottom2">$content[status]</TD>
+       <TD align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom2 right2">$content[points] {!POINTS!}</TD>
+       <TD align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom2 right2">$content[acc]</TD>
+       <TD align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom2 right2">$content[stamp]</TD>
+       <TD align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom2">$content[status]</TD>
 </TR>
 </TR>