Subversion Repositories wpShopGermany4

Rev

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

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