X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-sub_points.php;h=2414889a9c4a3986ac7f9714d744f8ed280c8410;hb=0e269568bd666186509e98594e83bac199ac26da;hp=f4348b36d768645e65f7ab2b8bfe586a2f71784c;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git diff --git a/inc/modules/admin/what-sub_points.php b/inc/modules/admin/what-sub_points.php index f4348b36d7..2414889a9c 100644 --- a/inc/modules/admin/what-sub_points.php +++ b/inc/modules/admin/what-sub_points.php @@ -51,7 +51,7 @@ if (getRequestElement('userid') == 'all') { // Is the form sent? if ((isFormSent()) && (postRequestElement('points') > 0)) { $result_main = SQL_QUERY("SELECT userid, email FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC", - __FILE__, __LINE__); + __FILE__, __LINE__); while ($content = merge_array($content, SQL_FETCHARRAY($result_main))) { // Ok, add points to used points and send an email to him... subtractPoints('admin_all', $content['userid'], postRequestElement('points')); @@ -75,12 +75,10 @@ if (getRequestElement('userid') == 'all') { loadTemplate('admin_sub_points_all'); } } elseif (isGetRequestElementSet('userid')) { - // User ID found in URL so we use this give him some credits - $result = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s AND `status`='CONFIRMED' LIMIT 1", - array(bigintval(getRequestElement('userid'))),__FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + // User id found in URL so we use this give him some credits + if (fetchUserData(getRequestElement('userid'))) { // Selected user does exist - $content = SQL_FETCHARRAY($result); + $content = getUserDataArray(); if ((isFormSent()) && (isPostRequestElementSet(('points')))) { // Ok, add to used points and send an email to him... @@ -108,12 +106,9 @@ if (getRequestElement('userid') == 'all') { // User not found! loadTemplate('admin_settings_saved', false, "
".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."
"); } - - // Free result - SQL_FREERESULT($result); } else { // Output selection form with all confirmed user accounts listed - addMemberSelectionBox('0', true); + addMemberSelectionBox(0, true); } // [EOF]