<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

  $banner_stats_query = tep_db_query("select dayofmonth(banners_history_date) as name, banners_shown as value, banners_clicked as dvalue from " . TABLE_BANNERS_HISTORY . " where banners_id = '" . $banner_id . "' and to_days(now()) - to_days(banners_history_date) < " . $days . " order by banners_history_date"); 
  //
  $liczba_wyswietlen = 0;
  $liczba_klikniec = 0;
  //
  while ($banner_stats = tep_db_fetch_array($banner_stats_query)) {
    $stats[] = array($banner_stats['name'], $banner_stats['value'], $banner_stats['dvalue']);
	$liczba_wyswietlen = $liczba_wyswietlen + (int)$banner_stats['value'];
	$liczba_klikniec = $liczba_klikniec + (int)$banner_stats['dvalue'];
  }

  if (sizeof($stats) < 1) { $liczba_wyswietlen = 0; $liczba_klikniec = 0; }

  $contents[] = array('align' => 'center', 'text' =>'<div id="wynik1" style="border:1px solid #474747;width:190px;text-align:center;"><span class="smallText">Brak zainstalowanej wtyczki flash</span></div><script type="text/javascript">
										    var so = new SWFObject("open-flash-chart.swf", "ofc", "190", "180", "9", "#FFFFFF");
											so.addVariable("variables","true");
											so.addVariable("x_axis_colour","#81af90");
											so.addVariable("x_grid_colour","#e5e5e5");
											so.addVariable("y_axis_colour","#81af90");
											so.addVariable("y_grid_colour","#e5e5e5");							
											so.addVariable("bg_colour","0xffffff");
											so.addVariable("title","Ostatnie 3 dni,{font-size: 14px; color: #130086;}");
											so.addVariable("x_label_style","10,#7f7f7e,0,1");		
											so.addVariable("y_label_style","9,#7f7f7e");
											so.addVariable("x_axis_steps","1");
											so.addVariable("values","'.$liczba_wyswietlen.','.$liczba_klikniec.'");
											so.addVariable("x_labels","Wyświetlenia,Kliknięcia");
											so.addVariable("y_max","'.($liczba_wyswietlen+1).'");
											so.addVariable("y_min","0");
											so.addVariable("filled_bar","80,#ffb400,#ff9000,,10");
											so.addVariable("tool_tip","%23x_label%23%3Cbr%3ELiczba%3A+%23val%23");
											so.addParam("wmode", "transparent");
											so.write("wynik1");			
											</script><br>&nbsp;')
?>											

