[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 banner_yearly.php

Zen Cart 源代码 banner_yearly.php




下载文件

文件名: banner_yearly.php
文件类型: PHP文件
文件大小: 1.72 KiB
MD5: 419b8eba5a6a0543f24221ecdfc6ef68

banner_yearly.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2008 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: banner_yearly.php 8744 2008-06-28 02:20:51Z drbyte $
  8.  */
  9. if (!defined('IS_ADMIN_FLAG')) {
  10.   die('Illegal Access');
  11. }
  12.  
  13.   include(DIR_WS_CLASSES . 'phplot.php');
  14.  
  15.   $stats = array(array('0', '0', '0'));
  16.   $banner_stats = $db->Execute("select year(banners_history_date) as year,
  17.                                       sum(banners_shown) as value, sum(banners_clicked) as dvalue
  18.                                from " . TABLE_BANNERS_HISTORY . "
  19.                                where banners_id = '" . $banner_id . "' group by year");
  20.  
  21.   while (!$banner_stats->EOF) {
  22.     $stats[] = array($banner_stats->fields['year'], (($banner_stats->fields['value']) ? $banner_stats->fields['value'] : '0'), (($banner_stats->fields['dvalue']) ? $banner_stats->fields['dvalue'] : '0'));
  23.     $banner_stats->MoveNext();
  24.   }
  25.  
  26.   $graph = new PHPlot(600, 350, 'images/graphs/banner_yearly-' . $banner_id . '.' . $banner_extension);
  27.  
  28.   $graph->SetFileFormat($banner_extension);
  29.   $graph->SetIsInline(1);
  30.   $graph->SetPrintImage(0);
  31.  
  32.   $graph->SetSkipBottomTick(1);
  33.   $graph->SetDrawYGrid(1);
  34.   $graph->SetPrecisionY(0);
  35.   $graph->SetPlotType('lines');
  36.  
  37.   $graph->SetPlotBorderType('left');
  38.   $graph->SetTitleFontSize('4');
  39.   $graph->SetTitle(sprintf(TEXT_BANNERS_YEARLY_STATISTICS, $banner->fields['banners_title']));
  40.  
  41.   $graph->SetBackgroundColor('white');
  42.  
  43.   $graph->SetVertTickPosition('plotleft');
  44.   $graph->SetDataValues($stats);
  45.   $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
  46.  
  47.   $graph->DrawGraph();
  48.  
  49.   $graph->PrintImage();
  50. ?>