Subversion Repositories wpShopGermany4

Rev

Rev 4943 | Rev 5945 | 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
	{
2113 robert 8
 
2331 robert 9
		for ($i = 0; $i < count($this->view['chart']['data']); $i++)
2113 robert 10
		{
11
 
2331 robert 12
			$chartJS['legend'][$i] = "{";
2113 robert 13
 
2331 robert 14
			if (isset($this->view['chart']['data'][$i]['label']))
2113 robert 15
			{
2331 robert 16
				$chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
2113 robert 17
			}
18
 
2331 robert 19
			$chartJS['legend'][$i] .= "	highlighter: {";
2113 robert 20
 
2331 robert 21
			$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 22
 
2331 robert 23
			$chartJS['legend'][$i] .= "	}";
2113 robert 24
 
2331 robert 25
			$chartJS['legend'][$i] .= "}";
2113 robert 26
 
2331 robert 27
			$j = 0;
2113 robert 28
 
2331 robert 29
			foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
2113 robert 30
			{
2331 robert 31
 
32
				//immer das Datum vom Rootelement nutzen
33
				$k = 0 ;
34
 
35
				foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
36
				{
37
					if ($j == $k)
38
					{
2486 robert 39
						if ($record['week'] <= (int)date_i18n('W') || $record['year'] < date_i18n('Y'))
2331 robert 40
						{
41
							$chartJS['area']['area'.$i][] = "['".$j."', ".wpsg_hspc($record['total'])."]";
42
 
43
 
44
						}
45
						$chartJS['ticks']['ticks'.$i][] = '['.$j.', \'KW '.$record['week'].'\']';
46
					}
47
					$k++;
48
				}
2113 robert 49
 
2331 robert 50
				if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
51
			  		$chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']';
52
			  	}
53
 
54
			  	$j++;
55
			}
56
 
2113 robert 57
		}
58
 
59
	}
60
 
61
?>
2331 robert 62
 
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
 
77
jQuery(document).ready(function(){
2331 robert 78
	  <?php foreach ($chartJS['area'] as $index => $area) { ?>
79
		 var <?php echo $index; ?> = <?php echo $area; ?>;
80
	  <?php } ?>
2113 robert 81
 
2331 robert 82
	  var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
2113 robert 83
		  animate: true,
84
		  axesDefaults: {
85
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
86
		  },
87
		  series:[
88
          		<?php echo implode(', ', $chartJS['legend']); ?>
89
          ],
90
          legend: {
91
            show: true,
2304 robert 92
            placement: 'outside'
2113 robert 93
          },
94
	      axes:{
95
	        xaxis:{
96
	          	label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
97
	          	syncTicks: false,
98
	          	tickOptions:{formatString:'KW %d'},
2331 robert 99
	          	ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
2113 robert 100
	        },
101
	        yaxis:{
102
                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
103
                tickOptions: {
104
                	formatter: wpsg_statistics_number_format
105
            	},
106
        		min:0
107
            }
108
	      },
109
	      highlighter: {
110
	            show: true
111
	      }
112
	  });
113
 
114
	  wpsg_statistic_addExportButton();
115
 
116
});
117
</script>
118
<?php } else { ?>
119
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
120
<?php } ?>