Subversion Repositories wpShopGermany4

Rev

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