Subversion Repositories wpShopGermany4

Rev

Rev 5261 | 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
<br /><br />
4
<?php
5
 
2331 robert 6
	if (wpsg_isSizedArray($this->view['chart']['data']))
7
	{
5945 hartmut 8
		unset($this->view['chart']['data']['template']);
9
 
2331 robert 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>KW %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;
2113 robert 29
 
2331 robert 30
			foreach ((array)$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 ($record['week'] <= (int)date_i18n('W') || $record['year'] < date_i18n('Y'))
2331 robert 41
						{
42
							$chartJS['area']['area'.$i][] = "['".$j."', ".wpsg_hspc($record['total'])."]";
43
 
44
 
45
						}
46
						$chartJS['ticks']['ticks'.$i][] = '['.$j.', \'KW '.$record['week'].'\']';
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(',', (array)$chartJS['area']['area'.$i]).']';
53
			  	}
54
 
55
			  	$j++;
56
			}
57
 
2113 robert 58
		}
59
 
60
	}
61
 
62
?>
2331 robert 63
 
64
<?php if ($chartJS['area'] != '') { ?>
2335 robert 65
<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 66
 
2350 robert 67
<br />
68
 
69
<div id="table-data">
70
	<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
71
</div>
72
 
73
<div class="wpsg_clearer"></div>
74
 
2113 robert 75
<script type="text/javascript">
76
 
77
 
78
jQuery(document).ready(function(){
2331 robert 79
	  <?php foreach ($chartJS['area'] as $index => $area) { ?>
80
		 var <?php echo $index; ?> = <?php echo $area; ?>;
81
	  <?php } ?>
2113 robert 82
 
2331 robert 83
	  var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
2113 robert 84
		  animate: true,
85
		  axesDefaults: {
86
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
87
		  },
88
		  series:[
89
          		<?php echo implode(', ', $chartJS['legend']); ?>
90
          ],
91
          legend: {
92
            show: true,
2304 robert 93
            placement: 'outside'
2113 robert 94
          },
95
	      axes:{
96
	        xaxis:{
5945 hartmut 97
	          	label:'<?php echo wpsg_hspc(wpsg_getStr($this->view['chart']['info']['xaxis']['label'])); ?>',
98
	          	label:'<?php echo wpsg_hspc(wpsg_getStr($this->view['chart']['data'][0]['label'])); ?>',
2113 robert 99
	          	syncTicks: false,
100
	          	tickOptions:{formatString:'KW %d'},
2331 robert 101
	          	ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
2113 robert 102
	        },
103
	        yaxis:{
104
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
105
                tickOptions: {
106
                	formatter: wpsg_statistics_number_format
107
            	},
108
        		min:0
109
            }
110
	      },
111
	      highlighter: {
112
	            show: true
113
	      }
114
	  });
115
 
116
	  wpsg_statistic_addExportButton();
117
 
118
});
119
</script>
120
<?php } else { ?>
121
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
122
<?php } ?>