Subversion Repositories wpShopGermany4

Rev

Rev 4943 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2113 robert 1
<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
2
 
3
<?php
4
 
2331 robert 5
	if (wpsg_isSizedArray($this->view['chart']['data']))
6
	{
7
 
8
		for ($i = 0; $i < count($this->view['chart']['data']); $i++)
2113 robert 9
		{
10
 
2331 robert 11
			$chartJS['legend'][$i] = "{";
2113 robert 12
 
2331 robert 13
			if (isset($this->view['chart']['data'][$i]['label']))
2113 robert 14
			{
2331 robert 15
				$chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
2113 robert 16
			}
17
 
2331 robert 18
			$chartJS['legend'][$i] .= "	highlighter: {";
2113 robert 19
 
2331 robert 20
			$chartJS['legend'][$i] .= "		formatString: '<table><tr><td>%s ".$this->view['chart']['data'][$i]['year'].", %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
2113 robert 21
 
2331 robert 22
			$chartJS['legend'][$i] .= "	}";
2113 robert 23
 
2331 robert 24
			$chartJS['legend'][$i] .= "}";
2113 robert 25
 
2331 robert 26
			$j = 0;
27
 
28
			foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
2113 robert 29
			{
2331 robert 30
 
31
				//immer das Datum vom Rootelement nutzen
32
				$k = 0 ;
33
 
34
				foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
35
				{
36
					if ($j == $k)
37
					{
2486 robert 38
						if (mktime(0, 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))
2331 robert 39
						{
40
							$chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']."', ".wpsg_hspc($record['total'])."]";
41
						}
42
					}
43
					$k++;
44
				}
2113 robert 45
 
2331 robert 46
				if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
47
			  		$chartJS['area']['area'.$i] = '['.implode(',', $chartJS['area']['area'.$i]).']';
48
			  	}
49
 
50
			  	$j++;
51
			}
52
 
2113 robert 53
		}
54
 
55
	}
56
 
57
?>
2331 robert 58
<?php if ($chartJS['area'] != '') { ?>
2335 robert 59
<div id="chartannualturnover-line" style="height:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_line_chart_width'); ?>px;"></div>
2113 robert 60
 
2350 robert 61
<br />
62
 
63
<div id="table-data">
64
	<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
65
</div>
66
 
67
<div class="wpsg_clearer"></div>
68
 
2113 robert 69
<script type="text/javascript">
70
 
71
 
72
jQuery(document).ready(function(){
2331 robert 73
	  <?php foreach ($chartJS['area'] as $index => $area) { ?>
74
		 var <?php echo $index; ?> = <?php echo $area; ?>;
75
	  <?php } ?>
2113 robert 76
 
2331 robert 77
	  var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
2113 robert 78
		  animate: true,
79
		  axesDefaults: {
80
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
81
		  },
82
		  series:[
83
          		<?php echo implode(', ', $chartJS['legend']); ?>
84
          ],
85
          legend: {
86
            show: true,
2304 robert 87
            placement: 'outside'
2113 robert 88
          },
89
	      axes:{
90
	        xaxis:{
91
	          	renderer:jQuery.jqplot.DateAxisRenderer,
92
	          	label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
93
	          	tickOptions:{formatString:'%d'},
94
	          	tickInterval: '1 day',
2331 robert 95
	          	min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['min']); ?>',
96
	          	max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['max']); ?>'
2113 robert 97
	        },
98
	        yaxis:{
99
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
100
                tickOptions: {
101
                	formatter: wpsg_statistics_number_format
102
            	},
103
        		min:0
104
            }
105
	      },
106
	      highlighter: {
107
	            show: true
108
	      }
109
	  });
110
 
111
	  wpsg_statistic_addExportButton();
112
 
113
});
114
</script>
115
<?php } else { ?>
116
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
117
<?php } ?>