// @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
while (list($id, $id2, $type) = SQL_FETCHROW($result)) {
// Load data from stats table...
- $cat = ''; $result_data = false;
- switch ($type)
- {
+ $cat = '';
+ $result_data = false;
+ $PROBLEM = '';
+ $DATA = $content;
+ switch ($type) {
case 'NORMAL':
$result_data = SQL_QUERY_ESC("SELECT
s.subject, s.timestamp_ordered, s.cat_id, s.payment_id, p.sender
WHERE
s.id=%s
LIMIT 1",
- array(bigintval($id)), __FILE__, __LINE__);
- $type = 'mailid'; $DATA = $id; $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
+ array(bigintval($id)), __FILE__, __LINE__);
+ $type = 'mailid';
+ $DATA = $id;
+ $PROBLEM = getMessage('NORMAL_MAIL_PROBLEM');
break;
case 'BONUS':
$result_data = SQL_QUERY_ESC("SELECT subject, timestamp, cat_id, points, 0 FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
- array(bigintval($id2)), __FILE__, __LINE__);
- $type = 'bonusid'; $DATA = $id2; $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
- break;
+ array(bigintval($id2)), __FILE__, __LINE__);
+ $type = 'bonusid';
+ $DATA = $id2;
+ $PROBLEM = getMessage('BONUS_MAIL_PROBLEM');
+ break;
default: // Unknown type detected!
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mail type %s detected.", $type));
// Prepare data for template
$content = array(
'sw' => $SW,
- 'userid' => getUserId(),
+ 'userid' => getUserId(),
'data' => bigintval($DATA),
'type' => $type,
'subject' => $subject,
// Prepare data for template
$content = array(
'sw' => $SW,
- 'data' => $content,
+ 'data' => $DATA,
'probl' => $PROBLEM,
);