$page = isset($_GET['nextLink']) ? $_GET['nextLink'] : null; switch ($_GET['event_type']) { case 'sends': $event = $ConstantContact->getContactSends($contactSearch[0], $page); break; case 'clicks': $event = $ConstantContact->getContactClicks($contactSearch[0], $page); break; case 'opens': $event = $ConstantContact->getContactOpens($contactSearch[0], $page); break; case 'forwards': $event = $ConstantContact->getContactForwards($contactSearch[0], $page); break; case 'optouts': $event = $ConstantContact->getContactOptOuts($contactSearch[0], $page); break; case 'bounces': $event = $ConstantContact->getContactBounces($contactSearch[0], $page); break; } // Display the results of the search if (count($event) > 0) { echo "<h3>There are " . count($event['events']) . " " . $_GET['event_type'] . " for " . $_GET['email_address'] . "</h3>"; if ($event['nextLink']) { echo '<a href="contactReporting.php?nextLink=' . $event['nextLink'] . '&email_address=' . $_GET['email_address'] . '&event_type=' . $_GET['event_type'] . '"> Next Page</a>'; } echo "<table>"; foreach ($event['events'] as $e) { foreach ($e as $key => $value) { echo "<tr><td style='font-weight: bold;'>" . $key . "</td><td>" . $value . "</td></tr>";