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