- if ((isFormSent()) && (REQUEST_POST('points') > 0)) {
- $result_main = SQL_QUERY("SELECT userid, email FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `status`='CONFIRMED' ORDER BY `userid` ASC",
- __FILE__, __LINE__);
- while ($content = SQL_FETCHARRAY($result_main)) {
- // Ok, add points to used points and send an email to him...
- SUB_POINTS("admin_all", $content['userid'], REQUEST_POST('points'));
-
- // Add more content
- $content['text'] = SQL_ESCAPE(REQUEST_POST('reason'));
- $content['points'] = bigintval(REQUEST_POST('points'));
+ if ((isFormSent()) && (postRequestElement('points') > 0)) {
+ // Add points to all accounts
+ $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",
+ __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_sub_all', $content['userid'], postRequestElement('points'));
+
+ // Prepare content
+ $content = array(
+ 'reason' => SQL_ESCAPE(postRequestElement('reason')),
+ 'points' => bigintval(postRequestElement('points')),
+ 'subject' => 'admin_sub_all',
+ );