Subversion Repositories wpShopGermany4

Rev

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

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