You are here

function ad_report_bargraph in Advertisement 5.2

Same name and namespace in other branches
  1. 5 report/ad_report.module \ad_report_bargraph()
  2. 6.3 report/ad_report.module \ad_report_bargraph()
  3. 6 report/ad_report.module \ad_report_bargraph()
  4. 6.2 report/ad_report.module \ad_report_bargraph()
  5. 7 report/ad_report.module \ad_report_bargraph()

Page to display ad with bargraph.

1 string reference to 'ad_report_bargraph'
ad_report_menu in report/ad_report.module
Implementation of hook_menu().

File

report/ad_report.module, line 377
Provides comprehensive charts and reports about advertising statistics.

Code

function ad_report_bargraph($data, $url, $type = 'node', $start = 0, $end = 0) {
  if ($type == 'node') {
    drupal_set_title($data->title);
  }
  $start_date = _ad_report_get_date_from_path($start);
  $end_date = _ad_report_get_date_from_path($end);
  $output = drupal_get_form('ad_report_range_form', $type, $url, $start_date, $end_date);
  if ($start && $end) {
    switch ($type) {
      case 'node':
        $ad = db_fetch_object(db_query('SELECT aid, redirect, adtype FROM {ads} WHERE aid = %d', $data->nid));
        if ($ad->aid) {
          $output .= '<img src="' . url("ad_report/{$data->nid}/bargraph/node/{$start}/{$end}") . '" />';
          $output .= theme('box', '', module_invoke("ad_{$data->adtype}", 'display_ad', $ad));
          $output .= ad_report_group_table($data->nid, $type, $start, $end);
        }
        $output .= module_invoke('ad', 'click_history', $data->nid);
        break;
      default:
        $output = '<img src="' . url("ad_report/{$data->uid}/bargraph/{$granularity}/{$type}") . '" />';
        break;
    }
  }
  return $output;
}