[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_monthly.php

Zen Cart 源代码 banner_monthly.php




下载文件

文件名: banner_monthly.php
文件类型: PHP文件
文件大小: 1.92 KiB
MD5: 46e0e6da2bce7013f753b2b4f495beee

banner_monthly.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2011 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_monthly.php 18695 2011-05-04 05:24:19Z drbyte $
  8.  */
  9. if (!defined('IS_ADMIN_FLAG')) {
  10.   die('Illegal Access');
  11. }
  12.  
  13.   include(DIR_WS_CLASSES . 'phplot.php');
  14.  
  15.   $year = (($_GET['year']) ? zen_db_input($_GET['year']) : date('Y'));
  16.  
  17.   $stats = array();
  18.   for ($i=1; $i<13; $i++) {
  19.     $stats[] = array(strftime('%b', mktime(0,0,0,$i)), '0', '0');
  20.   }
  21.  
  22.   $banner_stats = $db->Execute("select month(banners_history_date) as banner_month, sum(banners_shown) as value, sum(banners_clicked) as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banner_id . "' and year(banners_history_date) = '" . $year . "' group by banner_month");
  23.   while (!$banner_stats->EOF) {
  24.     $stats[($banner_stats->fields['banner_month']-1)] = array(strftime('%b', mktime(0,0,0,$banner_stats->fields['banner_month'])), (($banner_stats->fields['value']) ? $banner_stats->fields['value'] : '0'), (($banner_stats->fields['dvalue']) ? $banner_stats->fields['dvalue'] : '0'));
  25.     $banner_stats->MoveNext();
  26.   }
  27.  
  28.   $graph = new PHPlot(600, 350, 'images/graphs/banner_monthly-' . $banner_id . '.' . $banner_extension);
  29.  
  30.   $graph->SetFileFormat($banner_extension);
  31.   $graph->SetIsInline(1);
  32.   $graph->SetPrintImage(0);
  33.  
  34.   $graph->SetSkipBottomTick(1);
  35.   $graph->SetDrawYGrid(1);
  36.   $graph->SetPrecisionY(0);
  37.   $graph->SetPlotType('lines');
  38.  
  39.   $graph->SetPlotBorderType('left');
  40.   $graph->SetTitleFontSize('4');
  41.   $graph->SetTitle(sprintf(TEXT_BANNERS_MONTHLY_STATISTICS, $banner->fields['banners_title'], $year));
  42.  
  43.   $graph->SetBackgroundColor('white');
  44.  
  45.   $graph->SetVertTickPosition('plotleft');
  46.   $graph->SetDataValues($stats);
  47.   $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
  48.  
  49.   $graph->DrawGraph();
  50.  
  51.   $graph->PrintImage();
  52.  


cron