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

Zen Cart 源代码 banner_daily.php




下载文件

文件名: banner_daily.php
文件类型: PHP文件
文件大小: 2.03 KiB
MD5: 9e04f6237f4a2385e21d616f04392ccc

banner_daily.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_daily.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.   $month = (($_GET['month']) ? zen_db_input($_GET['month']) : date('n'));
  17.  
  18.   $days = (date('t', mktime(0,0,0,$month))+1);
  19.   $stats = array();
  20.   for ($i=1; $i<$days; $i++) {
  21.     $stats[] = array($i, '0', '0');
  22.   }
  23.  
  24.   $banner_stats = $db->Execute("select dayofmonth(banners_history_date) as banner_day, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . (int)$banner_id . "' and month(banners_history_date) = '" . $month . "' and year(banners_history_date) = '" . $year . "'");
  25.   while (!$banner_stats->EOF) {
  26.     $stats[($banner_stats->fields['banner_day']-1)] = array($banner_stats->fields['banner_day'], (($banner_stats->fields['value']) ? $banner_stats->fields['value'] : '0'), (($banner_stats->fields['dvalue']) ? $banner_stats->fields['dvalue'] : '0'));
  27.     $banner_stats->MoveNext();
  28.   }
  29.  
  30.   $graph = new PHPlot(600, 350, 'images/graphs/banner_daily-' . $banner_id . '.' . $banner_extension);
  31.  
  32.   $graph->SetFileFormat($banner_extension);
  33.   $graph->SetIsInline(1);
  34.   $graph->SetPrintImage(0);
  35.  
  36.   $graph->SetSkipBottomTick(1);
  37.   $graph->SetDrawYGrid(1);
  38.   $graph->SetPrecisionY(0);
  39.   $graph->SetPlotType('lines');
  40.  
  41.   $graph->SetPlotBorderType('left');
  42.   $graph->SetTitleFontSize('4');
  43.   $graph->SetTitle(sprintf(TEXT_BANNERS_DAILY_STATISTICS, $banner->fields['banners_title'], strftime('%B', mktime(0,0,0,$month)), $year));
  44.  
  45.   $graph->SetBackgroundColor('white');
  46.  
  47.   $graph->SetVertTickPosition('plotleft');
  48.   $graph->SetDataValues($stats);
  49.   $graph->SetDataColors(array('blue','red'),array('blue', 'red'));
  50.  
  51.   $graph->DrawGraph();
  52.  
  53.   $graph->PrintImage();
  54.