client_applications_contacts

Versions
mediamosa-174
client_applications_contacts($id)

Callback of the 'vpx/client_applications/contacts_administration' path Show Contacts for a client applications.

Parameters

integer $id An integer containing the client application id.

Return value

string A table with client application contacts information.

Code

client_applications/client_applications.module, line 479

<?php
function client_applications_contacts($id) {

  $response = t('Technical and administrative contact for a client application.');

  //rows for the client_applications table
  $contacts_rows = array();
  //contacts header
  $contacts_header = array(
    array('data' => t('Client application ID')),
    array('data' => t('Name')),
    array('data' => t('Phone')),
    array('data' => t('E-mail')),
    array('data' => t('Type')),
    );
    // Return the HTML.
  $sql = 'SELECT * FROM {client_applications} WHERE id = %d';
  $sql .= tablesort_sql($contacts_header);
  $count_sql = 'SELECT COUNT(*) FROM {client_applications} WHERE id = %d';
  $result = pager_query($sql, 30, 0, $count_sql, $id, $id);
  // drupal_set_message(t('This is the client application contacts list'));
  while ($column = db_fetch_object($result)) {
    $contacts_rows[] = array( 'data' => array($column->id, $column->technical_name, $column->technical_phone, $column->technical_email, t('TECHNICAL')));
    $contacts_rows[] = array( 'data' => array($column->id, $column->administrative_name, $column->administrative_phone, $column->administrative_email, t('ADMINISTRATIVE')));
  }
  $response .= theme('table', $contacts_header, $contacts_rows);
  return $response;
}
?>