X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-add_points.php;h=f376333cae938d4e899bd1109b8a959417f04309;hb=095f5ab59b539834d2c67e5d409d01820e10d8be;hp=03546b16d751609971c0f1c1f557900dc339d572;hpb=9f6c30cc0e06098171d773d671292081ecee3d29;p=mailer.git diff --git a/inc/modules/admin/what-add_points.php b/inc/modules/admin/what-add_points.php index 03546b16d7..f376333cae 100644 --- a/inc/modules/admin/what-add_points.php +++ b/inc/modules/admin/what-add_points.php @@ -1,7 +1,7 @@ sqlEscapeString(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'userid' => $row['userid'], + 'subject' => 'admin_add_all', + ); // Load email template and send email away - $message = loadEmailTemplate('add-points', $content, bigintval($content['userid'])); - sendEmail(bigintval($content['userid']), getMessage('ADMIN_ADD_SUBJ'), $message); + $message = loadEmailTemplate('member_add_points', $content, bigintval($content['userid'])); + sendEmail(bigintval($content['userid']), '{--ADMIN_ADD_POINTS_SUBJECT--}', $message); } // END - while // Free memory - SQL_FREERESULT($result_main); + sqlFreeResult($result_main); // Output message - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ALL_POINTS_ADDED')); + displayMessage('{--ADMIN_ALL_POINTS_ADDED--}'); } else { // Display form add points loadTemplate('admin_add_points_all'); @@ -88,36 +92,42 @@ if (getRequestElement('userid') == 'all') { // Selected user does exist $content = getUserDataArray(); - if ((isFormSent()) && (isPostRequestElementSet(('points')))) { + if ((isFormSent()) && (isPostRequestElementSet('points'))) { + // Init referral system + initReferralSystem(); + // Add points and send an email to him... - addPointsDirectly('admin_single', bigintval(getRequestElement('userid')), bigintval(postRequestElement('points'))); + addPointsThroughReferralSystem('admin_add_single', bigintval(getRequestElement('userid')), bigintval(postRequestElement('points'))); // Prepare content $content = array( - 'text' => SQL_ESCAPE(postRequestElement('reason')), - 'points' => bigintval(postRequestElement('points')) + 'reason' => sqlEscapeString(postRequestElement('reason')), + 'points' => bigintval(postRequestElement('points')), + 'subject' => 'admin_add_single', ); - // Message laden - $message = loadEmailTemplate('add-points', $content, bigintval(getRequestElement('userid'))); + // Load message + $message = loadEmailTemplate('member_add_points', $content, bigintval(getRequestElement('userid'))); + + // Send the email out + sendEmail(bigintval(getRequestElement('userid')), '{--ADMIN_ADD_POINTS_SUBJECT--}', $message); - sendEmail(bigintval(getRequestElement('userid')), getMessage('ADMIN_ADD_SUBJ'), $message); - loadTemplate('admin_settings_saved', false, getMessage('ADMIN_POINTS_ADDED')); + // ... and display a message + displayMessage('{--ADMIN_POINTS_ADDED--}'); } else { // Prepare content - $content['user'] = "".$content['surname']." ".$content['family'].""; $content['userid'] = bigintval(getRequestElement('userid')); // Output template - loadTemplate('admin_add_points', false, $content); + loadTemplate('admin_add_points', FALSE, $content); } } else { - // User not found! - loadTemplate('admin_settings_saved', false, "
".sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid'))."
"); + // User not found + displayErrorMessage('{%message,ADMIN_MEMBER_404=' . bigintval(getRequestElement('userid')) . '%}'); } } else { // Output selection form with all confirmed user accounts listed - addMemberSelectionBox(0, true); + addMemberSelectionBox(0, TRUE); } // [EOF]