1<?php
2
3require_once dirname(__FILE__).'/../accesscheck.php';
4if (!defined('PHPLISTINIT')) {
5    exit;
6}
7
8if (!$_GET['id']) {
9    Fatal_Error(s('no such User'));
10
11    return;
12} else {
13    $id = sprintf('%d', $_GET['id']);
14}
15$status = "";
16
17$result = Sql_query("SELECT * FROM {$GLOBALS['tables']['user']} where id = $id");
18if (!Sql_Affected_Rows()) {
19    Fatal_Error(s('no such User'));
20
21    return;
22}
23$user = sql_fetch_array($result);
24
25$bouncels = new WebblerListing(s('Bounces'));
26$bouncels->setElementHeading('Bounce ID');
27$bouncelist = '';
28// check for bounces
29$req = Sql_Query(sprintf('
30select
31message_bounce.id
32, message_bounce.message
33, time
34, bounce
35from
36%s as message_bounce
37where
38user = %d', $GLOBALS['tables']['user_message_bounce'], $user['id']));
39
40if (Sql_Affected_Rows()) {
41    while ($row = Sql_Fetch_Array($req)) {
42        $messagedata = loadMessageData($row['message']);
43        $bouncels->addElement($row['bounce'],
44            PageURL2('bounce', s('view'), 'id=' . $row['bounce']));
45        if (!empty($messagedata['id'])) {
46            $bouncels->addColumn($row['bounce'], s('Campaign title'), stripslashes($messagedata['campaigntitle']));
47        } else {
48            $bouncels->addColumn($row['bounce'], s('Campaign title'), s('Transactional message'));
49        }
50        $bouncels->addColumn($row['bounce'], s('time'), formatDateTime($row['time'], true));
51    }
52    echo $bouncels->display();
53} else {
54    echo s("Bounces data not found");
55}
56