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 |
|
5866 |
hartmut |
28 |
if (wpsg_isSizedArray($this->view['chart']['data'][$i]))
|
2333 |
robert |
29 |
{
|
|
|
30 |
|
5866 |
hartmut |
31 |
foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
|
2333 |
robert |
32 |
{
|
5866 |
hartmut |
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 |
{
|
|
|
40 |
//if (mktime($record['hour'], 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(date('H'), 0, 0, date('m'), date('d'), date('Y')))
|
|
|
41 |
//{
|
|
|
42 |
$chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']." ".$rrecord['hour'].":00:00', ".wpsg_hspc($record['total'])."]";
|
|
|
43 |
//}
|
|
|
44 |
}
|
|
|
45 |
$k++;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
|
|
|
49 |
$chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']';
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
$j++;
|
2333 |
robert |
53 |
}
|
|
|
54 |
|
5866 |
hartmut |
55 |
}
|
2333 |
robert |
56 |
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
?>
|
|
|
62 |
|
2350 |
robert |
63 |
<?php if ($chartJS['area'] != '') { ?>
|
|
|
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>
|
2333 |
robert |
65 |
|
2350 |
robert |
66 |
<br/>
|
2304 |
robert |
67 |
|
2350 |
robert |
68 |
<div id="table-data">
|
|
|
69 |
<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnoverperhour/data.phtml'); ?>
|
|
|
70 |
</div>
|
2304 |
robert |
71 |
|
2350 |
robert |
72 |
<div class="wpsg_clearer"></div>
|
2304 |
robert |
73 |
|
|
|
74 |
<script type="text/javascript">
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
jQuery(document).ready(function(){
|
2333 |
robert |
78 |
<?php foreach ($chartJS['area'] as $index => $area) { ?>
|
|
|
79 |
var <?php echo $index; ?> = <?php echo $area; ?>;
|
|
|
80 |
<?php } ?>
|
2304 |
robert |
81 |
|
2333 |
robert |
82 |
var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
|
2304 |
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,
|
|
|
92 |
placement: 'outside'
|
|
|
93 |
},
|
|
|
94 |
axes:{
|
|
|
95 |
xaxis:{
|
|
|
96 |
renderer:jQuery.jqplot.DateAxisRenderer,
|
|
|
97 |
label:'<?php echo __('Uhrzeit', 'wpsg'); ?>',
|
|
|
98 |
tickOptions:{formatString:"%#H:%M"},
|
2333 |
robert |
99 |
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',
|
|
|
100 |
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 |
101 |
tickInterval: '1 hours'
|
|
|
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 } ?>
|