X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-sub_points.php;h=d4d812341246acfdf322578c29008d29f7ec1390;hb=4f7df133f736da124e6f7bd02008b9093f736451;hp=52da92ab38a6595d28bdb508b3ecb2b2c0e22e14;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689;p=mailer.git diff --git a/inc/modules/admin/what-sub_points.php b/inc/modules/admin/what-sub_points.php index 52da92ab38..d4d8123412 100644 --- a/inc/modules/admin/what-sub_points.php +++ b/inc/modules/admin/what-sub_points.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,31 +50,32 @@ if (getRequestElement('userid') == 'all') { $content['points'] = bigintval(postRequestElement('points')); // Load userid - $result_main = SQL_QUERY("SELECT `userid`,`email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC", + $result_main = SQL_QUERY("SELECT `userid`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC", __FILE__, __LINE__); while ($row = SQL_FETCHARRAY($result_main)) { // Merge both arrays $content = merge_array($content, $row); // Ok, add points to used points, send an email to him and ignore return status - subtractPoints('admin_all', $content['userid'], postRequestElement('points')); + subtractPoints('admin_sub_all', $content['userid'], postRequestElement('points')); // Prepare content $content = array( - 'reason' => SQL_ESCAPE(postRequestElement('reason')), - 'points' => bigintval(postRequestElement('points')) + 'reason' => SQL_ESCAPE(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'subject' => 'admin_sub_all', ); // Load message and send it away $message = loadEmailTemplate('member_sub_points', $content, bigintval($content['userid'])); - sendEmail($row['userid'], '{--ADMIN_SUB_SUBJECT--}', $message); + sendEmail($row['userid'], '{--ADMIN_SUB_POINTS_SUBJECT--}', $message); } // END - while // Free memory SQL_FREERESULT($result_main); // Output message - displayMessage('{--ADMIN_ALL_POINTS_SUBTRACTED--}'); + displayMessage('{--ADMIN_ALL_POINTS_SUB_DONE--}'); } else { // Display form add points loadTemplate('admin_sub_points_all'); @@ -87,17 +88,18 @@ if (getRequestElement('userid') == 'all') { if ((isFormSent()) && (isPostRequestElementSet('points'))) { // Ok, add to used points, send an email to him and ignore return status - subtractPoints('admin_single', bigintval(getRequestElement('userid')), postRequestElement('points')); + subtractPoints('admin_sub_single', bigintval(getRequestElement('userid')), postRequestElement('points')); // Prepare content $content = array( - 'reason' => SQL_ESCAPE(postRequestElement('reason')), - 'points' => bigintval(postRequestElement('points')) + 'reason' => SQL_ESCAPE(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'subject' => 'admin_sub_single', ); // Load email and send it away $message = loadEmailTemplate('member_sub_points', $content, bigintval(getRequestElement('userid'))); - sendEmail(getRequestElement('userid'), '{--ADMIN_SUB_SUBJECT--}', $message); + sendEmail(getRequestElement('userid'), '{--ADMIN_SUB_POINTS_SUBJECT--}', $message); // Output message displayMessage('{--ADMIN_POINTS_SUBTRACTED--}'); @@ -106,15 +108,15 @@ if (getRequestElement('userid') == 'all') { $content['userid'] = bigintval(getRequestElement('userid')); // Load form - loadTemplate('admin_sub_points', false, $content); + loadTemplate('admin_sub_points', FALSE, $content); } } else { // User not found - loadTemplate('admin_settings_unsaved', false, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); + loadTemplate('admin_settings_unsaved', FALSE, '{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } } else { // Output selection form with all confirmed user accounts listed - addMemberSelectionBox(0, true); + addMemberSelectionBox(0, TRUE); } // [EOF]