diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-01-14 14:55:36 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-01-14 14:55:36 +0000 |
| commit | ad405c7045c6e242080ec9d3ce4c9e586b517c4f (patch) | |
| tree | b41905f4d27f3eaaabd5bad3a39f8d3873540b46 /views/mods/mod_statistics/chartturnover/day.phtml | |
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_statistics/chartturnover/day.phtml')
| -rw-r--r-- | views/mods/mod_statistics/chartturnover/day.phtml | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/views/mods/mod_statistics/chartturnover/day.phtml b/views/mods/mod_statistics/chartturnover/day.phtml new file mode 100644 index 0000000..18c1b4c --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/day.phtml @@ -0,0 +1,118 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php
+
+ if (wpsg_isSizedArray($this->view['chart']['data']))
+ {
+
+ for ($i = 0; $i < count($this->view['chart']['data']); $i++)
+ {
+
+ $chartJS['legend'][$i] = "{";
+
+ if (isset($this->view['chart']['data'][$i]['label']))
+ {
+ $chartJS['legend'][$i] .= "label:'".$this->view['chart']['data'][$i]['label']."',";
+ }
+
+ $chartJS['legend'][$i] .= " highlighter: {";
+
+ $chartJS['legend'][$i] .= " formatString: '<table><tr><td>%s Uhr, %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
+
+ $chartJS['legend'][$i] .= " }";
+
+ $chartJS['legend'][$i] .= "}";
+
+ $j = 0;
+
+ foreach ((array)$this->view['chart']['data'][$i]['records'] as $index => $record)
+ {
+
+ //immer das Datum vom Rootelement nutzen
+ $k = 0 ;
+
+ foreach ($this->view['chart']['data'][0]['records'] as $rindex => $rrecord)
+ {
+ if ($j == $k)
+ {
+ if (mktime($record['hour'], 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(date_i18n('H'), 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))
+ {
+ $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']." ".$rrecord['hour'].":00:00', ".wpsg_hspc($record['total'])."]";
+ }
+ }
+ $k++;
+ }
+
+ if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
+ $chartJS['area']['area'.$i] = '['.implode(',', (array)$chartJS['area']['area'.$i]).']';
+ }
+
+ $j++;
+ }
+
+ }
+
+ }
+
+?>
+
+<?php if ($chartJS['area'] != '') { ?>
+<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>
+
+<br />
+
+<div id="table-data">
+ <?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartturnover/data.phtml'); ?>
+</div>
+
+<div class="wpsg_clearer"></div>
+
+<script type="text/javascript">
+
+
+jQuery(document).ready(function(){
+ <?php foreach ($chartJS['area'] as $index => $area) { ?>
+ var <?php echo $index; ?> = <?php echo $area; ?>;
+ <?php } ?>
+
+ var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [<?php echo implode(',', array_keys($chartJS['area'])); ?>], {
+ animate: true,
+ axesDefaults: {
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
+ },
+ series:[
+ <?php echo implode(', ', $chartJS['legend']); ?>
+ ],
+ legend: {
+ show: true,
+ placement: 'outside'
+ },
+ axes:{
+ xaxis:{
+ renderer:jQuery.jqplot.DateAxisRenderer,
+ label:'<?php echo __('Uhrzeit', 'wpsg'); ?>',
+ tickOptions:{formatString:"%#H:%M"},
+ 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',
+ 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',
+ tickInterval: '1 hours'
+ },
+ yaxis:{
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
+ tickOptions: {
+ formatter: wpsg_statistics_number_format
+ },
+ min:0
+ }
+ },
+ highlighter: {
+ show: true
+ }
+ });
+
+ wpsg_statistic_addExportButton();
+
+});
+</script>
+<?php } else { ?>
+<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
+<?php } ?>
\ No newline at end of file |
