Subversion Repositories wpShopGermany4

Rev

Rev 5261 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2118 robert 1
<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
2
 
3
<?php if (wpsg_isSizedArray($this->view['chart']['data']['records'])) { ?>
4
 
2335 robert 5
<div id="chartsalestopaymentmethod-bar" style="height:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_width'); ?>px;"></div>
2118 robert 6
 
7
<br/>
3254 robert 8
<h3><?php echo __('Anteile (prozentual)', 'wpsg'); ?></h3>
2350 robert 9
<div id="chartsalestopaymentmethod-pie" style="height:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_width'); ?>px;"></div>
2118 robert 10
 
2350 robert 11
<br/>
12
 
13
<div id="table-data">
14
	<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartsalestopaymentmethod/data.phtml'); ?>
15
</div>
16
 
17
<div class="wpsg_clearer"></div>
18
 
2118 robert 19
<?php
5997 hartmut 20
	$barChartJS = Array();
21
	$pieChartJS = Array();
22
	$barChartJS['amount'] = '';
23
	$barChartJS['payment'] = '';
24
	$barChartJS['total'] = '';
2118 robert 25
 
5997 hartmut 26
	$pieChartJS['amount'] = '';
27
	$pieChartJS['sales'] = '';
28
	$pieChartJS['percent'] = '';
29
 
2118 robert 30
	foreach ($this->view['chart']['data']['records'] as $data)
31
	{
32
		$barChartJS['payment'] .= "'".wpsg_hspc($data['name'])."', ";
33
		$barChartJS['total'] .= wpsg_hspc($data['total']).", ";
5997 hartmut 34
		$pieChartJS['percent'] .= "['".wpsg_hspc($data['name'])."', ".wpsg_hspc($data['percent'])."], ";
2118 robert 35
	}
36
 
37
	$barChartJS['payment'] = substr($barChartJS['payment'], 0, -2);
38
	$barChartJS['total'] = substr($barChartJS['total'], 0, -2);
5997 hartmut 39
	$pieChartJS['percent'] = substr($pieChartJS['percent'], 0, -2);
2118 robert 40
 
41
?>
42
 
43
<script type="text/javascript">
44
	jQuery(document).ready(function()
45
	{
46
 
47
		jQuery.jqplot.config.enablePlugins = true;
48
	    var totals = [<?php echo $barChartJS['total']; ?>];
49
	    var payment = [<?php echo $barChartJS['payment']; ?>];
50
 
51
	    var chartsalestopaymentmethodBar = jQuery.jqplot('chartsalestopaymentmethod-bar', [totals], {
52
	        animate: !jQuery.jqplot.use_excanvas,
53
	        seriesDefaults:{
54
	            renderer:jQuery.jqplot.BarRenderer,
55
	            rendererOptions: {
56
                	varyBarColor: true
57
              	},
58
	            pointLabels: { show: true }
59
	        },
60
	        axesDefaults: {
61
	            labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
62
	        },
63
	        axes: {
64
	            xaxis: {
65
	                renderer: jQuery.jqplot.CategoryAxisRenderer,
66
	                ticks: payment,
5997 hartmut 67
	                label:'<?php echo wpsg_hspc(wpsg_getStr($this->view['chart']['info']['xaxis']['label'])); ?>'
2118 robert 68
	            },
69
	            yaxis:{
70
	                label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
71
	                tickOptions: {
72
	            		formatter: wpsg_statistics_number_format
73
                	},
74
    				min:0
75
	            }
76
	        },
77
	        highlighter: { show: false }
78
	    });
79
 
5997 hartmut 80
	    var data = [<?php echo $pieChartJS['percent']; ?>];
2118 robert 81
 
82
	  	var chartsalestopaymentmethodPie = jQuery.jqplot ('chartsalestopaymentmethod-pie', [data],
83
	    {
84
	      seriesDefaults: {
85
	        renderer: jQuery.jqplot.PieRenderer,
86
	        rendererOptions: { padding: 50, sliceMargin: 4, showDataLabels: true }
87
	      },
88
	      legend: { show:true, location: 'e' }
89
	    }
90
	  	);
91
 
92
	  	wpsg_statistic_addExportButton();
93
 
94
	});
95
</script>
96
 
2336 robert 97
 
2118 robert 98
<?php } else { ?>
99
<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
100
<?php } ?>