You are here

function constant_contact_view_activities in Constant Contact 6.3

Same name and namespace in other branches
  1. 7.3 admin.activities.inc \constant_contact_view_activities()

Displays the view activities page

1 string reference to 'constant_contact_view_activities'
constant_contact_menu in ./constant_contact.module
Adds an admin menu for the Cnstant Contact module

File

./admin.activities.inc, line 10

Code

function constant_contact_view_activities() {
  $cc = constant_contact_create_object();
  if (!is_object($cc)) {
    return '';
  }
  $activities = array();
  $_activities = $cc
    ->get_activities();
  if ($_activities) {
    foreach ($_activities as $k => $v) {
      $activities[$v['id']] = $v;
    }
  }
  $html = '';
  $html .= '<table cellspacing="3" cellpadding="3" border="0">';
  $html .= '<tr><th>Created</th><th>Type</th><th>Status</th><th>Errors</th><th>Transactions</th><th colspan="2">&nbsp;</th></tr>';
  foreach ($activities as $id => $v) {
    $html .= '<tr>';
    $html .= '<td>' . date('jS F Y \\- H:i', $cc
      ->convert_timestamp($v['InsertTime'])) . '</td>';
    $html .= '<td>' . $v['Type'] . '</td>';
    $html .= '<td>' . $v['Status'] . '</td>';
    $html .= '<td>' . (isset($v['Errors']) ? $v['Errors'] : 'None') . '</td>';
    $html .= '<td>' . (isset($v['TransactionCount']) ? $v['TransactionCount'] : 'None') . '</td>';
    $html .= '<td>' . l(t('View'), "admin/settings/constant_contact/activities/{$id}") . '</td>';
    $html .= '</tr>';
  }
  $html .= '</table>';
  return $html;
}