Subversion Repositories wpShopGermany4

Rev

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