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 | |
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_statistics')
20 files changed, 2031 insertions, 0 deletions
diff --git a/views/mods/mod_statistics/admin_setcapabilities.phtml b/views/mods/mod_statistics/admin_setcapabilities.phtml new file mode 100644 index 0000000..cf31ee6 --- /dev/null +++ b/views/mods/mod_statistics/admin_setcapabilities.phtml @@ -0,0 +1,19 @@ +<?php
+
+ /**
+ * Template für die Integration in die Verwaltung der Berechtigungen
+ */
+
+ global $wpdb; $arRoles = get_option($wpdb->prefix."user_roles");
+
+?>
+<tr>
+ <td class="wpsg_col_capname"><?php echo __('Statistik', 'wpsg'); ?></td>
+ <?php foreach ($arRoles as $role_key => $r) { ?>
+ <td class="wpsg_col_cap">
+ <input type="hidden" name="wpsg_cap[<?php echo $role_key; ?>][wpsg_statistics]" value="0" />
+ <input type="checkbox" <?php echo (($r['capabilities']['wpsg_statistics'] == "1")?'checked="checked"':''); ?> name="wpsg_cap[<?php echo $role_key; ?>][wpsg_statistics]" value="1" />
+ </td>
+ <?php } ?>
+ <td></td>
+</tr>
\ No newline at end of file diff --git a/views/mods/mod_statistics/chartsalestopaymentmethod/all.phtml b/views/mods/mod_statistics/chartsalestopaymentmethod/all.phtml new file mode 100644 index 0000000..c519090 --- /dev/null +++ b/views/mods/mod_statistics/chartsalestopaymentmethod/all.phtml @@ -0,0 +1,91 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php if (wpsg_isSizedArray($this->view['chart']['data']['records'])) { ?>
+
+<div id="chartsalestopaymentmethod-bar" style="height:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_width'); ?>px;"></div>
+
+<br/>
+<h3><?php echo __('Anteile (prozentual)', 'wpsg'); ?></h3>
+<div id="chartsalestopaymentmethod-pie" style="height:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_width'); ?>px;"></div>
+
+<br/>
+
+<div id="table-data">
+ <?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/chartsalestopaymentmethod/data.phtml'); ?>
+</div>
+
+<div class="wpsg_clearer"></div>
+
+<?php
+
+ foreach ($this->view['chart']['data']['records'] as $data)
+ {
+ $barChartJS['payment'] .= "'".wpsg_hspc($data['name'])."', ";
+ $barChartJS['total'] .= wpsg_hspc($data['total']).", ";
+ $pieChartJS .= "['".wpsg_hspc($data['name'])."', ".wpsg_hspc($data['percent'])."], ";
+ }
+
+ $barChartJS['payment'] = substr($barChartJS['payment'], 0, -2);
+ $barChartJS['total'] = substr($barChartJS['total'], 0, -2);
+ $pieChartJS = substr($pieChartJS, 0, -2);
+
+?>
+
+<script type="text/javascript">
+ jQuery(document).ready(function()
+ {
+
+ jQuery.jqplot.config.enablePlugins = true;
+ var totals = [<?php echo $barChartJS['total']; ?>];
+ var payment = [<?php echo $barChartJS['payment']; ?>];
+
+ var chartsalestopaymentmethodBar = jQuery.jqplot('chartsalestopaymentmethod-bar', [totals], {
+ animate: !jQuery.jqplot.use_excanvas,
+ seriesDefaults:{
+ renderer:jQuery.jqplot.BarRenderer,
+ rendererOptions: {
+ varyBarColor: true
+ },
+ pointLabels: { show: true }
+ },
+ axesDefaults: {
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
+ },
+ axes: {
+ xaxis: {
+ renderer: jQuery.jqplot.CategoryAxisRenderer,
+ ticks: payment,
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>'
+ },
+ yaxis:{
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
+ tickOptions: {
+ formatter: wpsg_statistics_number_format
+ },
+ min:0
+ }
+ },
+ highlighter: { show: false }
+ });
+
+ var data = [<?php echo $pieChartJS; ?>];
+
+ var chartsalestopaymentmethodPie = jQuery.jqplot ('chartsalestopaymentmethod-pie', [data],
+ {
+ seriesDefaults: {
+ renderer: jQuery.jqplot.PieRenderer,
+ rendererOptions: { padding: 50, sliceMargin: 4, showDataLabels: true }
+ },
+ legend: { show:true, location: 'e' }
+ }
+ );
+
+ wpsg_statistic_addExportButton();
+
+ });
+</script>
+
+
+<?php } else { ?>
+<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
+<?php } ?>
\ No newline at end of file diff --git a/views/mods/mod_statistics/chartsalestopaymentmethod/data.phtml b/views/mods/mod_statistics/chartsalestopaymentmethod/data.phtml new file mode 100644 index 0000000..f65ad5a --- /dev/null +++ b/views/mods/mod_statistics/chartsalestopaymentmethod/data.phtml @@ -0,0 +1,68 @@ +<table style="width:auto !important;" class="widefat fixed tags" border="0" cellspacing="0" cellpadding="0">
+ <thead>
+ <tr>
+ <th class="manage-column sortable">
+ <a id="name" class="sortable <?php if($this->view['filter']['sort'] == 'name' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'name' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Zahlungsart', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="total" class="sortable <?php if($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Umsatz in', 'wpsg').' '.$this->get_option('wpsg_currency'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="percent" class="sortable <?php if($this->view['filter']['sort'] == 'percent' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'percent' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Prozent', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </thead>
+ <tbody class="the-list">
+ <?php foreach ($this->view['chart']['data']['records'] as $data) { ?>
+ <tr class="alternate">
+ <td><strong><?php echo wpsg_hspc($data['name']); ?></strong></td>
+ <td class="td-right"><?php echo wpsg_ff($data['total']); ?></td>
+ <td class="td-right"><?php echo wpsg_ff($data['percent']); ?></td>
+ </tr>
+ <?php } ?>
+ </tbody>
+</table>
+
+<script type="text/javascript">
+
+jQuery(document).ready(function(){
+
+ jQuery('.sortable').bind('click', function(){
+
+ var order = '';
+ if(jQuery(this).hasClass('orderup'))
+ {
+ jQuery('#wpsg_statistics_order').val('orderup');
+ }
+ else
+ {
+ jQuery('#wpsg_statistics_order').val('orderdown');
+ }
+
+ jQuery('#wpsg_statistics_sort').val(jQuery(this).attr('id'));
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_statistics&noheader=1&do=sorting',
+ type: 'post',
+ data: jQuery('#wpsg_statistics_form').serialize(),
+ success: function(data) {
+ jQuery('#table-data').html(data);
+
+ }
+ } );
+
+ return false;
+ });
+
+});
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_statistics/charttopsellertosales/all.phtml b/views/mods/mod_statistics/charttopsellertosales/all.phtml new file mode 100644 index 0000000..dfff484 --- /dev/null +++ b/views/mods/mod_statistics/charttopsellertosales/all.phtml @@ -0,0 +1,171 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php if (wpsg_isSizedArray($this->view['chart']['data']['records'])) { ?>
+<div id="charttopsellertosales-bar" style="height:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_bar_chart_width'); ?>px;"></div>
+
+<br />
+<h3><?php echo __('Umsatz (prozentual)', 'wpsg'); ?><h3>
+<div id="charttopsellertosales-pie-sales" style="height:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_width'); ?>px;"></div>
+
+<br />
+<h3><?php echo __('Menge (prozentual)', 'wpsg'); ?><h3>
+<div id="charttopsellertosales-pie-amount" style="height:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_height'); ?>px; width:<?php echo $this->get_option('wpsg_mod_statistics_pie_chart_width'); ?>px;"></div>
+
+<br/>
+
+<div id="table-data">
+ <?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/charttopsellertosales/data.phtml'); ?>
+</div>
+
+<div class="wpsg_clearer"></div>
+
+<?php
+
+ foreach ($this->view['chart']['data']['records'] as $data)
+ {
+ $barChartJS['payment'] .= "'".wpsg_hspc($data['name'])."', ";
+ $barChartJS['amount'] .= "['".wpsg_hspc($data['name'])."','".wpsg_hspc($data['amount'])."'], ";
+ $barChartJS['total'] .= wpsg_hspc($data['total']).", ";
+ $pieChartJS['amount'] .= "['".wpsg_hspc($data['name'])."', ".wpsg_hspc($data['percent-amount'])."], ";
+ $pieChartJS['sales'] .= "['".wpsg_hspc($data['name'])."', ".wpsg_hspc($data['percent-sales'])."], ";
+ }
+
+ $barChartJS['amount'] = substr($barChartJS['amount'], 0, -2);
+ $barChartJS['payment'] = substr($barChartJS['payment'], 0, -2);
+ $barChartJS['total'] = substr($barChartJS['total'], 0, -2);
+
+ $pieChartJS['amount'] = substr($pieChartJS['amount'], 0, -2);
+ $pieChartJS['sales'] = substr($pieChartJS['sales'], 0, -2);
+
+?>
+
+<script type="text/javascript">
+ jQuery(document).ready(function(){
+ jQuery.jqplot.config.enablePlugins = true;
+ var totals = [<?php echo $barChartJS['total']; ?>];
+ var payment = [<?php echo $barChartJS['payment']; ?>];
+ var amount = [<?php echo $barChartJS['amount']; ?>];
+
+ //eries:[{renderer:jQuery.jqplot.BarRenderer}, {xaxis:'x2axis', yaxis:'y2axis'}],
+
+ var charttopsellertosalesBar = jQuery.jqplot('charttopsellertosales-bar', [totals, amount], {
+ animate: !jQuery.jqplot.use_excanvas,
+ axesDefaults: {
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
+ },
+ /*{Each series has same options as seriesDefaults},
+ {You can override each series individually here}*/
+ series:[
+ {
+ renderer:jQuery.jqplot.BarRenderer,
+ rendererOptions: {
+ varyBarColor: true
+ },
+ pointLabels: { show: true }
+ },
+ {
+ xaxis:'x2axis',
+ yaxis:'y2axis'
+ }
+ ],
+ grid: {
+ drawGridLines: false
+ },
+ axes: {
+ xaxis: {
+ renderer: jQuery.jqplot.CategoryAxisRenderer,
+ ticks: payment,
+ tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
+ tickOptions: {
+ angle: -50,
+ fontFamily: 'Arial',
+ fontSize: '10pt',
+ fontWeight: 'normal',
+ textColor: '#666666'
+ },
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ labelOptions: {
+ fontFamily: 'Arial',
+ fontSize: '14pt',
+ fontWeight: 'bold',
+ textColor: '#666666'
+ }
+ },
+ x2axis: {
+ renderer: jQuery.jqplot.CategoryAxisRenderer,
+ label: '',
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
+ tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
+ showMarker: false,
+ showTickMarks:false,
+ showticks: false,
+ tickOptions: {
+ }
+ },
+ yaxis:{
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['yaxis']['label']); ?>',
+ tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
+ tickOptions: {
+ fontFamily: 'Arial',
+ fontSize: '8pt',
+ fontWeight: 'normal',
+ textColor: '#666666',
+ formatter: wpsg_statistics_number_format
+ },
+ min:0
+ },
+ y2axis: {
+ label: '<?php echo __('Menge', 'wpsg'); ?>',
+ labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
+ tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
+ tickOptions: {
+ showGridline: false,
+ fontFamily: 'Arial',
+ fontSize: '8pt',
+ fontWeight: 'normal',
+ textColor: '#666666',
+ formatter: wpsg_statistics_integer_format
+ },
+ min:0,
+ max: <?php echo $this->view['chart']['data']['y2max']; ?>,
+ }
+ },
+ highlighter: { show: false }
+ });
+
+ var data = [<?php echo $pieChartJS['sales']; ?>];
+
+ var charttopsellertosalesPieSales = jQuery.jqplot ('charttopsellertosales-pie-sales', [data],
+ {
+ seriesDefaults: {
+ renderer: jQuery.jqplot.PieRenderer,
+ rendererOptions: { padding: 50, sliceMargin: 4, showDataLabels: true }
+ },
+ legend: { show:true, location: 'e' }
+ }
+ );
+
+ var data = [<?php echo $pieChartJS['amount']; ?>];
+
+ var charttopsellertosalesPieAmount = jQuery.jqplot ('charttopsellertosales-pie-amount', [data],
+ {
+ seriesDefaults: {
+ renderer: jQuery.jqplot.PieRenderer,
+ rendererOptions: { padding: 50, sliceMargin: 4, showDataLabels: true }
+ },
+ legend: { show:true, location: 'e' }
+ }
+ );
+
+ wpsg_statistic_addExportButton();
+
+ });
+</script>
+
+<style type="text/css">
+ .jqplot-x2axis { display:none; }
+</style>
+
+<?php } else { ?>
+<?php echo __('Keine Daten zur Auswertung vorhanden.', 'wpsg'); ?>
+<?php } ?>
diff --git a/views/mods/mod_statistics/charttopsellertosales/data.phtml b/views/mods/mod_statistics/charttopsellertosales/data.phtml new file mode 100644 index 0000000..b13119b --- /dev/null +++ b/views/mods/mod_statistics/charttopsellertosales/data.phtml @@ -0,0 +1,82 @@ +<table style="width:auto !important;" class="widefat fixed tags" border="0" cellspacing="0" cellpadding="0">
+ <thead>
+ <tr>
+ <th class="manage-column">
+ <a id="name" class="sortable <?php if($this->view['filter']['sort'] == 'name' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'name' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Produkt', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="total" class="sortable <?php if($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Umsatz in', 'wpsg').' '.$this->get_option('wpsg_currency'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="percent-sales" class="sortable <?php if($this->view['filter']['sort'] == 'percent-sales' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'percent-sales' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Prozent (Umsatz)', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="amount" class="sortable <?php if($this->view['filter']['sort'] == 'amount' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'amount' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Menge', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="percent-amount" class="sortable <?php if($this->view['filter']['sort'] == 'percent-amount' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'percent-amount' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Prozent (Menge)', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </thead>
+ <tbody class="the-list">
+ <?php foreach ($this->view['chart']['data']['records'] as $data) { ?>
+ <tr class="alternate">
+ <td><strong><?php echo wpsg_hspc($data['name']); ?></strong></td>
+ <td class="td-right"><?php echo wpsg_ff($data['total']); ?></td>
+ <td class="td-right"><?php echo wpsg_ff($data['percent-sales']); ?></td>
+ <td class="td-right"><?php echo wpsg_hspc($data['amount']); ?></td>
+ <td class="td-right"><?php echo wpsg_ff($data['percent-amount']); ?></td>
+ </tr>
+ <?php } ?>
+ </tbody>
+</table>
+
+<script type="text/javascript">
+
+jQuery(document).ready(function(){
+
+ jQuery('.sortable').bind('click', function(){
+
+ var order = '';
+ if(jQuery(this).hasClass('orderup'))
+ {
+ jQuery('#wpsg_statistics_order').val('orderup');
+ }
+ else
+ {
+ jQuery('#wpsg_statistics_order').val('orderdown');
+ }
+
+ jQuery('#wpsg_statistics_sort').val(jQuery(this).attr('id'));
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_statistics&noheader=1&do=sorting',
+ type: 'post',
+ data: jQuery('#wpsg_statistics_form').serialize(),
+ success: function(data) {
+ jQuery('#table-data').html(data);
+
+ }
+ } );
+
+ return false;
+ });
+
+});
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_statistics/chartturnover/all.phtml b/views/mods/mod_statistics/chartturnover/all.phtml new file mode 100644 index 0000000..c9e7181 --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/all.phtml @@ -0,0 +1,123 @@ +<?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, %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 ($record['year'] <= date_i18n('Y'))
+ {
+ $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'."1".'/'."1"."', ".wpsg_hspc($record['total'])."]";
+ }
+ }
+ $k++;
+ }
+
+ if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
+ $chartJS['area']['area'.$i] = '['.implode(',', $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">
+
+function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
+ // display series_label, x-axis_tick, y-axis value
+ return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
+}
+
+
+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 wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ tickOptions:{formatString:'%Y'},
+ tickInterval: '1 year',
+ min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/01/01',
+ max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/01/01'
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnover/customrange.phtml b/views/mods/mod_statistics/chartturnover/customrange.phtml new file mode 100644 index 0000000..3f046ae --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/customrange.phtml @@ -0,0 +1,112 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php
+
+ if (wpsg_isSizedArray($this->view['chart']['data']['records'])) {
+
+ $i = 0;
+ $j = 0;
+
+ foreach ($this->view['chart']['data']['records'] as $data)
+ {
+
+ $series = "{";
+
+ if (isset($this->view['chart']['data']['label']))
+ {
+ $series .= "label:'".$this->view['chart']['data']['label'].' '.$data['year']."',";
+ }
+ else
+ {
+ $series .= "label:'".date_i18n('F', strtotime($data['day'].'.'.$data['month'].'.'.$data['year'])).' '.$data['year']."', ";
+ }
+
+ $series .= " highlighter: {";
+
+ $series .= " formatString: '<table><tr><td>%s ".$data['month']." ".$data['year'].", %s. ".$this->get_option('wpsg_currency')."</td></tr></table>'";
+
+ $series .= " }";
+
+ $series .= "}";
+
+ if (!in_array($series, (array)$chartJS['legend']) || !isset($chartJS['legend'][$i]))
+ {
+ $chartJS['legend'][$i] = $series;
+ }
+
+ $chartJS['year'] .= "['".$data['year'].'/'.$data['month'].'/'."1"."', ".wpsg_hspc($data['total'])."], ";
+
+ if ($j == count($this->view['chart']['data']['records']) - 1) {
+ $chartJS['year'] = 'var year = ['.substr($chartJS['year'], 0, -2).'];';
+ }
+
+ $j++;
+
+ }
+
+ }
+?>
+
+<?php if ($chartJS['year'] != '') { ?>
+<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">
+
+function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
+ // display series_label, x-axis_tick, y-axis value
+ return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
+}
+
+
+jQuery(document).ready(function(){
+ <?php echo $chartJS['year']; ?>
+
+ var chartannualturnoverLine = jQuery.jqplot('chartannualturnover-line', [year], {
+ 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 wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ tickOptions:{formatString:'%b'},
+ tickInterval: '1 month',
+ min:'<?php echo date('Y', $this->view['chart']['data']['min']); ?>/<?php echo date('m', $this->view['chart']['data']['min']); ?>/<?php echo date('d', $this->view['chart']['data']['min']); ?>',
+ max:'<?php echo date('Y', $this->view['chart']['data']['max']); ?>/<?php echo date('m', $this->view['chart']['data']['max']); ?>/<?php echo date('d', $this->view['chart']['data']['max']); ?>'
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnover/data.phtml b/views/mods/mod_statistics/chartturnover/data.phtml new file mode 100644 index 0000000..7d5e89c --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/data.phtml @@ -0,0 +1,111 @@ +<?php foreach ($this->view['chart']['data'] as $index => $data) { ?>
+<?php if (is_numeric($index)) { ?>
+<div class="wpsg-table-data-wrapper">
+ <table style="width:auto !important;" class="widefat fixed tags" border="0" cellspacing="0" cellpadding="0">
+ <thead>
+ <tr>
+ <th colspan="4">
+ <?php
+
+ $i = 0;
+
+ foreach ((array)$data['records'] as $record)
+ {
+ if ($i == 0)
+ {
+ echo wpsg_hspc($data['label']);
+ }
+ $i++;
+ }
+ ?>
+ </th>
+ </tr>
+ <!-- Spaltensortierung -->
+ <tr>
+ <th class="manage-column">
+ <a id="tstamp" class="sortable <?php if($this->view['filter']['sort'] == 'tstamp' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'tstamp' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Zeitpunkt', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="th-right manage-column">
+ <a id="total" class="sortable <?php if($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Umsatz in', 'wpsg').' '.$this->get_option('wpsg_currency'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="th-right manage-column">
+ <a id="orders" class="sortable <?php if($this->view['filter']['sort'] == 'orders' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'orders' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Bestellungen', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="th-right manage-column">
+ <a id="avg_total" class="sortable <?php if($this->view['filter']['sort'] == 'avg_total' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'avg_total' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('ø in ', 'wpsg').' '.$this->get_option('wpsg_currency'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </thead>
+ <tbody class="the-list">
+ <?php
+
+ $i = 0;
+
+ foreach ((array)$data['records'] as $record)
+ {
+ if ($i%2 == 0) { $class = 'alternate'; } else { $class = ''; }
+ ?>
+ <tr class="<?php echo $class; ?>">
+ <td><strong><?php echo wpsg_hspc($record['label']); ?></strong></td>
+ <td class="td-right"><?php echo wpsg_ff($record['total']); ?></td>
+ <td class="td-right"><?php echo wpsg_hspc($record['orders']); ?></td>
+ <td class="td-right"><?php echo wpsg_ff($record['avg_total']); ?></td>
+ </tr>
+ <?php
+ $i++;
+ }
+ ?>
+ </tbody>
+ </table>
+</div>
+<?php } ?>
+<?php } ?>
+
+<div class="clearer"></div>
+
+<script type="text/javascript">
+
+jQuery(document).ready(function(){
+
+ jQuery('.sortable').bind('click', function(){
+
+ var order = '';
+ if(jQuery(this).hasClass('orderup'))
+ {
+ jQuery('#wpsg_statistics_order').val('orderup');
+ }
+ else
+ {
+ jQuery('#wpsg_statistics_order').val('orderdown');
+ }
+
+ jQuery('#wpsg_statistics_sort').val(jQuery(this).attr('id'));
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_statistics&noheader=1&do=sorting',
+ type: 'post',
+ data: jQuery('#wpsg_statistics_form').serialize(),
+ success: function(data) {
+ jQuery('#table-data').html(data);
+
+ }
+ } );
+
+ return false;
+ });
+
+});
+
+</script>
\ No newline at end of file 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 diff --git a/views/mods/mod_statistics/chartturnover/month.phtml b/views/mods/mod_statistics/chartturnover/month.phtml new file mode 100644 index 0000000..5ef077a --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/month.phtml @@ -0,0 +1,117 @@ +<?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 ".$this->view['chart']['data'][$i]['year'].", %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(0, 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))
+ {
+ $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']."', ".wpsg_hspc($record['total'])."]";
+ }
+ }
+ $k++;
+ }
+
+ if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
+ $chartJS['area']['area'.$i] = '['.implode(',', $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 wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ tickOptions:{formatString:'%d'},
+ tickInterval: '1 day',
+ min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['min']); ?>',
+ max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['max']); ?>'
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnover/quarter.phtml b/views/mods/mod_statistics/chartturnover/quarter.phtml new file mode 100644 index 0000000..36fc4cf --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/quarter.phtml @@ -0,0 +1,120 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<br /><br />
+<?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>KW %s ".$this->view['chart']['data'][$i]['year'].", %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 ($record['week'] <= (int)date_i18n('W') || $record['year'] < date_i18n('Y'))
+ {
+ $chartJS['area']['area'.$i][] = "['".$j."', ".wpsg_hspc($record['total'])."]";
+
+
+ }
+ $chartJS['ticks']['ticks'.$i][] = '['.$j.', \'KW '.$record['week'].'\']';
+ }
+ $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:{
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ syncTicks: false,
+ tickOptions:{formatString:'KW %d'},
+ ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnover/week.phtml b/views/mods/mod_statistics/chartturnover/week.phtml new file mode 100644 index 0000000..57dd4a5 --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/week.phtml @@ -0,0 +1,118 @@ +<?php $this->render(WPSG_PATH_VIEW.'/mods/mod_statistics/simplefilter.phtml'); ?>
+
+<?php
+
+ if (wpsg_isSizedArray($this->view['chart']['data']))
+ {
+
+ $series = '';
+
+ 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 ".$this->view['chart']['data'][$i]['year'].", %s ".$this->get_option('wpsg_currency')."</td></tr></table>'";
+
+ $chartJS['legend'][$i] .= " }";
+
+ $chartJS['legend'][$i] .= "}";
+
+ $j = 0;
+
+ foreach ($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(0, 0, 0, $record['month'], $record['day'], $record['year']) <= mktime(0, 0, 0, date_i18n('m'), date_i18n('d'), date_i18n('Y')))
+ {
+ $chartJS['area']['area'.$i][] = "['".$rrecord['year'].'/'.$rrecord['month'].'/'.$rrecord['day']."', ".wpsg_hspc($record['total'])."]";
+ }
+ }
+ $k++;
+ }
+
+ if ($j == count($this->view['chart']['data'][$i]['records']) - 1) {
+ $chartJS['area']['area'.$i] = '['.implode(',', $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 __('Tag', 'wpsg'); ?>',
+ tickOptions:{formatString:'%d.%m.%Y'},
+ tickInterval: '1 day',
+ min:'<?php echo date('Y', $this->view['chart']['data'][0]['firstdayofweek']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['firstdayofweek']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['firstdayofweek']); ?>',
+ max:'<?php echo date('Y', $this->view['chart']['data'][0]['lastdayofweek']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['lastdayofweek']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['lastdayofweek']); ?>'
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnover/year.phtml b/views/mods/mod_statistics/chartturnover/year.phtml new file mode 100644 index 0000000..2be39aa --- /dev/null +++ b/views/mods/mod_statistics/chartturnover/year.phtml @@ -0,0 +1,127 @@ +<?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: { useXTickMarks: true, ";
+
+ $chartJS['legend'][$i] .= " formatString: '<table><tr><td>%s, %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(0, 0, 0, $record['month'], 1, $record['year']) <= mktime(0, 0, 0, date_i18n('m'), 1, date_i18n('Y')))
+ {
+ $chartJS['area']['area'.$i][] .= "['".$j."', ".wpsg_hspc($record['total'])."]";
+ }
+ $chartJS['ticks']['ticks'.$i][] = '['.$j.', \''.$record['tick'].'\']';
+ }
+ $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">
+
+function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
+ // display series_label, x-axis_tick, y-axis value
+ return plot.series[seriesIndex]["label"] + ", " + plot.data[seriesIndex][pointIndex];
+}
+
+
+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:{
+ rendererOptions:{tickRenderer:
+ jQuery.jqplot.CanvasAxisTickRenderer},
+ label:'<?php echo wpsg_hspc($this->view['chart']['info']['xaxis']['label']); ?>',
+ syncTicks: false,
+ tickOptions:{formatString:'%d'},
+ ticks: [<?php echo implode(',', $chartJS['ticks']['ticks0']); ?>]
+ /*tickInterval: '1 month'
+ min:'<?php echo date('Y', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['min']); ?>/<?php echo date('d', $this->view['chart']['data'][0]['min']); ?>',
+ max:'<?php echo date('Y', $this->view['chart']['data'][0]['max']); ?>/<?php echo date('m', $this->view['chart']['data'][0]['max']); ?>/1'*/
+ },
+ 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 diff --git a/views/mods/mod_statistics/chartturnoverperhour/all.phtml b/views/mods/mod_statistics/chartturnoverperhour/all.phtml new file mode 100644 index 0000000..1698126 --- /dev/null +++ b/views/mods/mod_statistics/chartturnoverperhour/all.phtml @@ -0,0 +1,117 @@ +<?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('H'), 0, 0, date('m'), date('d'), date('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/chartturnoverperhour/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 diff --git a/views/mods/mod_statistics/chartturnoverperhour/data.phtml b/views/mods/mod_statistics/chartturnoverperhour/data.phtml new file mode 100644 index 0000000..3e98ee4 --- /dev/null +++ b/views/mods/mod_statistics/chartturnoverperhour/data.phtml @@ -0,0 +1,103 @@ +<?php foreach ($this->view['chart']['data'] as $index => $data) { ?>
+<?php if (is_numeric($index)) { ?>
+<div class="wpsg-table-data-wrapper">
+ <table style="width:auto !important;" class="widefat fixed tags" border="0" cellspacing="0" cellpadding="0">
+ <thead>
+ <tr>
+ <th colspan="3">
+ <?php
+
+ $i = 0;
+
+ foreach ((array)$data['records'] as $record)
+ {
+ if ($i == 0)
+ {
+ echo wpsg_hspc($data['label']);
+ }
+ $i++;
+ }
+ ?>
+ </th>
+ </tr>
+ <tr>
+ <th class="manage-column">
+ <a id="tstamp" class="sortable <?php if($this->view['filter']['sort'] == 'tstamp' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'tstamp' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Uhrzeit', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="total" class="sortable <?php if($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'total' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Umsatz in', 'wpsg').' '.$this->get_option('wpsg_currency'); ?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ <th class="manage-column th-right">
+ <a id="orders" class="sortable <?php if($this->view['filter']['sort'] == 'orders' && $this->view['filter']['order'] == 'orderup') { echo 'active orderdown'; } elseif($this->view['filter']['sort'] == 'orders' && $this->view['filter']['order'] == 'orderdown'){ echo 'active orderup'; } ?>" href="/">
+ <span><?php echo __('Bestellungen', 'wpsg')?></span>
+ <span class="sorting-indicator"></span>
+ </a>
+ </th>
+ </tr>
+ </thead>
+ <tbody class="the-list">
+ <?php
+
+ $i = 0;
+
+ foreach ((array)$data['records'] as $record)
+ {
+ if ($i%2 == 0) { $class = 'alternate'; } else { $class = ''; }
+ ?>
+ <tr class="<?php echo $class; ?>">
+ <td><strong><?php echo wpsg_hspc($record['hour']); ?></strong></td>
+ <td class="td-right"><?php echo wpsg_ff($record['total']); ?></td>
+ <td class="td-right"><?php echo (($record['orders'] > 0)?wpsg_hspc($record['orders']):'0'); ?></td>
+ </tr>
+ <?php
+ $i++;
+ }
+ ?>
+ </tbody>
+ </table>
+</div>
+<?php } ?>
+<?php } ?>
+
+<div class="clearer"></div>
+
+<script type="text/javascript">
+
+jQuery(document).ready(function(){
+
+ jQuery('.sortable').bind('click', function(){
+
+ var order = '';
+ if(jQuery(this).hasClass('orderup'))
+ {
+ jQuery('#wpsg_statistics_order').val('orderup');
+ }
+ else
+ {
+ jQuery('#wpsg_statistics_order').val('orderdown');
+ }
+
+ jQuery('#wpsg_statistics_sort').val(jQuery(this).attr('id'));
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_statistics&noheader=1&do=sorting',
+ type: 'post',
+ data: jQuery('#wpsg_statistics_form').serialize(),
+ success: function(data) {
+ jQuery('#table-data').html(data);
+
+ }
+ } );
+
+ return false;
+ });
+
+});
+
+</script>
\ No newline at end of file diff --git a/views/mods/mod_statistics/customermap/all.phtml b/views/mods/mod_statistics/customermap/all.phtml new file mode 100644 index 0000000..b35624c --- /dev/null +++ b/views/mods/mod_statistics/customermap/all.phtml @@ -0,0 +1,48 @@ +<?php
+
+ /**
+ * Template für die Anzeige der Kundenkarte innerhalb des Statistikmoduls
+ */
+
+?>
+<script type="text/javascript">/* <![CDATA[ */
+
+ function wpsg_mod_statistics_initialize()
+ {
+
+ var mapOptions = {
+ center: new google.maps.LatLng(-34.397, 150.644),
+ zoom: 5,
+ mapTypeId: google.maps.MapTypeId.ROADMAP
+ };
+
+ var map = new google.maps.Map(document.getElementById("wpsg_mod_statistics_map"), mapOptions);
+ var bounds = new google.maps.LatLngBounds();
+
+ <?php $i = 1; foreach ($this->view['wpsg_mod_statistics']['marker'] as $m) { ?>
+ var marker<?php echo $i; ?> = new google.maps.Marker({
+ position: new google.maps.LatLng(<?php echo $m['long']; ?>, <?php echo $m['lat']; ?>),
+ map: map
+ } );
+ google.maps.event.addListener(marker<?php echo $i; ?>, 'click', function() {
+ location.href = '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Customer&action=edit&edit_id='.$m['customer']['id']; ?>';
+ } );
+ bounds.extend(marker<?php echo $i; ?>.getPosition());
+ <?php $i ++; } ?>
+
+ map.fitBounds(bounds);
+ map.setZoom(15);
+
+ } // function wpsg_mod_statistics_initialize()
+
+ google.maps.event.addDomListener(window, 'load', wpsg_mod_statistics_initialize);
+
+/* ]]> */</script>
+
+<div style="" id="wpsg_mod_customermap_layer">
+ <div class="postbox" id="wpsg_modcustomermap">
+ <div style="height:500px;">
+ <div style="width:100%; height:100%" id="wpsg_mod_statistics_map"></div>
+ </div>
+ </div>
+</div>
\ No newline at end of file diff --git a/views/mods/mod_statistics/settings_edit.phtml b/views/mods/mod_statistics/settings_edit.phtml new file mode 100644 index 0000000..eaa1d87 --- /dev/null +++ b/views/mods/mod_statistics/settings_edit.phtml @@ -0,0 +1,133 @@ +<br/>
+
+<div class="wpsg_admin_box" id="wpsg_tab">
+ <div class="head">
+ <div class="title">
+ <div class="tab" id="tab1"><?php echo __('Auswertung Bestellstatus', 'wpsg'); ?></div>
+ <div class="tab" id="tab2"><?php echo __('Piwik', 'wpsg'); ?></div>
+ <div class="tab" id="tab3"><?php echo __('Google', 'wpsg'); ?></div>
+ <div class="tab" id="tab4"><?php echo __('Sonstiges', 'wpsg'); ?></div>
+ <div class="wpsg_clear"></div>
+ </div>
+ </div>
+ <div class="content" id="wpsg_statistics_list">
+
+ <div id="tabcontent1" class="tabcontent">
+
+ <br/>
+
+ <?php
+
+ $arSelectedStatus = explode(',', $this->get_option('wpsg_mod_statistics_status'));
+
+ echo __('Bitte wählen Sie die Zustände aus unter welchen die Bestellung eines Produktes als abgeschlossen Gültigkeit besitzt.', 'wpsg');
+ ?>
+ <br/><br/>
+ <?php
+ foreach ($this->arStatus as $statusCode => $statusName)
+ {
+ echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_status['.$statusCode.']', $statusName, (is_array($arSelectedStatus) && is_string($arSelectedStatus[0]) && strlen($arSelectedStatus[0]) && in_array($statusCode, $arSelectedStatus)?true:false));
+ }
+ ?>
+ <div class="wpsg_clearer"></div>
+ </div>
+
+ <div id="tabcontent2" class="tabcontent">
+
+ <br/>
+
+ <?php echo __('Ermöglicht die Integration des Trackintools "Piwik".', 'wpsg'); ?>
+
+ <br/><br/>
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_url', __('URL zur Piwik Installation', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_url'), array('hint' => __('Ohne Protokoll, Beispiel: piwik.domain.de', 'wpsg'))); ?>
+ <br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_generel', __('Allgemeine Protokollierung', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_generel')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_SiteId', __('Piwik Seiten ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_SiteId'), array('help' => 'wpsg_mod_statistics_piwik_SiteId')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_ecommerce', __('Käufe (eCommerce) tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_ecommerce')); ?>
+ <br /><br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_basket', __('Warenkorb tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_basket')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_basket_target', __('Ziel ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_basket_target')); ?>
+ <br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_checkout', __('Checkout tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_checkout_target', __('Ziel ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout_target')); ?>
+ <br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_checkout2', __('Checkout2 tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout2')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_checkout2_target', __('Ziel ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_checkout2_target')); ?>
+ <br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_overview', __('Overview tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_overview')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_overview_target', __('Ziel ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_overview_target')); ?>
+ <br />
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_piwik_done', __('Done tracken', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_done')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_statistics_piwik_done_target', __('Ziel ID', 'wpsg'), $this->get_option('wpsg_mod_statistics_piwik_done_target')); ?>
+ <div class="wpsg_clearer"></div>
+ </div>
+
+ <div id="tabcontent3" class="tabcontent">
+ <?php
+
+ echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_active', __('Google Analytics aktivieren', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_active'), array('help' => 'wpsg_mod_statistics_google_active'));
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_google_tracking_code', __('Tracking-Code', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_tracking_code'), array('help' => 'wpsg_mod_statistics_google_tracking_code'));
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_google_domainname', __('Domainname', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_domainname'), array('help' => 'wpsg_mod_statistics_google_domainname'));
+
+ echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_anonymise_ip_address', __('IP Adresse anonymisieren', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_anonymise_ip_address'), array('help' => 'wpsg_mod_statistics_google_anonymise_ip_address'));
+
+ //echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_enable_first_touch_tracking', __('Enable First Touch Tracking', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_enable_first_touch_tracking'));
+
+ echo wpsg_drawForm_Checkbox('wpsg_mod_statistics_google_track_page_load_time', __('Ladegeschwindigkeit der Website erfassen', 'wpsg'), $this->get_option('wpsg_mod_statistics_google_track_page_load_time'), array('help' => 'wpsg_mod_statistics_google_track_page_load_time'));
+ ?>
+ <h3><?php echo __('Zieleinrichtung in Google Analytics', 'wpsg'); ?></h3>
+
+ <?php echo __('Ziel', 'wpsg'); ?> :
+ <ul>
+ <li>
+ <?php
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_google_done', __('Bestellabschluss', 'wpsg'), trim(str_replace(get_site_url(), '', $this->getURL(wpsg_ShopController::URL_BASKET).'?wpsg_done')).'=', array('text' => true));
+
+ ?>
+ </li>
+ </ul>
+ <?php echo __('Trichter (optional)', 'wpsg'); ?>:
+ <ul>
+
+ <li><?php echo wpsg_drawForm_Input('wpsg_mod_statistics_google_basket', __('Warenkorb', 'wpsg'), trim(str_replace(get_site_url(), '', $this->getURL(wpsg_ShopController::URL_BASKET))), array('text' => true)); ?></li>
+ <li><?php echo wpsg_drawForm_Input('wpsg_mod_statistics_google_checkout', __('Adresse', 'wpsg'), trim(str_replace(get_site_url(), '', $this->getURL(wpsg_ShopController::URL_CHECKOUT))).'=', array('text' => true)); ?></li>
+ <li><?php echo wpsg_drawForm_Input('wpsg_mod_statistics_google_checkout2', __('Versand', 'wpsg'), trim(str_replace(get_site_url(), '', $this->getURL(wpsg_ShopController::URL_CHECKOUT2))).'=', array('text' => true)); ?></li>
+ <li><?php echo wpsg_drawForm_Input('wpsg_mod_statistics_google_overview', __('Warenkorbübersicht', 'wpsg'), trim(str_replace(get_site_url(), '', $this->getURL(wpsg_ShopController::URL_OVERVIEW))).'=', array('text' => true)); ?></li>
+
+ </ul>
+
+ <div class="wpsg_clearer"></div>
+ </div>
+
+ <div id="tabcontent4" class="tabcontent">
+ <?php
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_line_chart_width', __('Liniendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_line_chart_width'), array('help' => 'wpsg_mod_statistics_line_chart_width'));
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_line_chart_height', __('Liniendiagramm (Hoehe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_line_chart_height'), array('help' => 'wpsg_mod_statistics_line_chart_height'));
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_pie_chart_width', __('Kuchendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_pie_chart_width'), array('help' => 'wpsg_mod_statistics_pie_chart_width'));
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_pie_chart_height', __('Kuchendiagramm (Höhe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_pie_chart_height'), array('help' => 'wpsg_mod_statistics_pie_chart_height'));
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_bar_chart_width', __('Balkendiagramm (Breite in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_bar_chart_width'), array('help' => 'wpsg_mod_statistics_bar_chart_width'));
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_bar_chart_height', __('Balkendiagramm (Höhe in px)', 'wpsg'), $this->get_option('wpsg_mod_statistics_bar_chart_height'), array('help' => 'wpsg_mod_statistics_bar_chart_height'));
+
+ echo wpsg_drawForm_Input('wpsg_mod_statistics_topproductcount', __('Anzeige Top-Produkte', 'wpsg'), $this->get_option('wpsg_mod_statistics_topproductcount'), array('help' => 'wpsg_mod_statistics_topproductcount'));
+ ?>
+ <div class="wpsg_clearer"></div>
+ </div>
+
+ </div>
+</div>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function() {
+ jQuery('#wpsg_tab').wpsg_tab( {
+ 'cookiename': 'wpsg_statistics_tab'
+ } );
+ } );
+
+</script>
diff --git a/views/mods/mod_statistics/simplefilter.phtml b/views/mods/mod_statistics/simplefilter.phtml new file mode 100644 index 0000000..306befc --- /dev/null +++ b/views/mods/mod_statistics/simplefilter.phtml @@ -0,0 +1,104 @@ +<script type="text/javascript">
+
+ function checkForRelated(el)
+ {
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_statistics&noheader=1&do=related&selection='+jQuery(el).val(),
+ dataType: 'json',
+ success: function(data) {
+
+ jQuery('#filter-related-wrapper').empty();
+
+ if (!jQuery.isEmptyObject(data))
+ {
+ jQuery('#filter-related-wrapper').html('<label style="width:8em; margin-left:10px; height:2em; line-height:2em; padding:2px; display:block; float:left;" for="filter-related"><?php echo __('im Vergleich zu', 'wpsg'); ?></label><select name="filter[related]" id="filter-related" size="1"><option value=""><?php echo __('-- Bitte wählen ---', 'wpsg'); ?></option></select>');
+ jQuery.each(data, function(i, item) {
+ jQuery('#filter-related').append('<option value="' + item.value + '">' + item.name + '</option>');
+ });
+ }
+
+ <?php
+ if ($this->view['filter']['related'] > 0)
+ {
+ ?>
+ jQuery("#filter-related").val("<?php echo $this->view['filter']['related']; ?>");
+ <?php
+ }
+ ?>
+ }
+ } );
+ }
+
+</script>
+
+<?php foreach ($this->view['charts'][$_REQUEST['id']]['type'] as $type => $data) { ?>
+<a class="<?php echo (($_REQUEST['type'] == $type)?'current':''); ?>" href="admin.php?page=wpsg-Statistics&id=<?php echo $_REQUEST['id']; ?>&type=<?php echo $type; ?>"><?php echo wpsg_hspc($data['name']); ?></a>
+<?php } ?>
+
+<br />
+
+<form name="wpsg_statistics_form" id="wpsg_statistics_form" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Statistics">
+
+ <label style="width:5em; height:2em; line-height:2em; padding:2px; display:block; float:left;" for="filter-standard"><?php echo __('Auswahl', 'wpsg'); ?></label>
+
+ <div style="float:left;" id="filter-standard-wrapper">
+ <select name="filter[standard]" id="filter-standard" size="1" onchange="<?php if ($_REQUEST['id'] == 0 || $_REQUEST['id'] == 1) { ?>checkForRelated(this);<?php } ?>">
+ <?php foreach ($this->view['standardFilter'] as $index => $filter) { ?>
+ <option value="<?php echo wpsg_hspc($index)?>" <?php if ($index == $this->view['filter']['standard']) { ?>selected="selected"<?php } ?>><?php echo wpsg_hspc($filter['name']); ?></option>
+ <?php } ?>
+ </select>
+ </div>
+
+ <div style="float:left;" id="filter-related-wrapper">
+
+ </div>
+
+ <input style="float:left; margin-left:25px;" type="submit" class="button-secondary" value="<?php echo __('Anzeigen', 'wpsg'); ?>" />
+
+ <div class="wpsg_clear"></div><br/>
+
+ <div class="customfilter" style="display:none;">
+ <?php echo wpsg_drawForm_Date('filter[day][0]', __('von', 'wpsg'), $this->view['filter']['day'][0]['d'].'.'.$this->view['filter']['day'][0]['m'].'.'.$this->view['filter']['day'][0]['Y'], array('time' => false)); ?>
+ <?php echo wpsg_drawForm_Date('filter[day][1]', __('bis', 'wpsg'), $this->view['filter']['day'][1]['d'].'.'.$this->view['filter']['day'][1]['m'].'.'.$this->view['filter']['day'][1]['Y'], array('time' => false)); ?>
+ </div>
+
+ <input type="hidden" id="wpsg_statistics_order" name="filter[order]" value="<?php echo wpsg_hspc($this->view['filter']['order']); ?>" />
+ <input type="hidden" id="wpsg_statistics_sort" name="filter[sort]" value="<?php echo wpsg_hspc($this->view['filter']['sort']); ?>" />
+
+ <input type="hidden" id="wpsg_statistics_type" name="type" value="<?php echo wpsg_hspc($_REQUEST['type']); ?>" />
+
+ <input type="hidden" name="id" value="<?php echo wpsg_hspc($_REQUEST['id']); ?>" />
+
+</form>
+
+<script type="text/javascript">
+
+ jQuery(document).ready(function(){
+
+
+ jQuery('#filter-standard').bind('change', function(){
+
+ if (parseInt(jQuery(this).val()) == 11)
+ {
+ jQuery('.customfilter').css('display', 'block');
+ jQuery('.customfilter .customfilter-input').each(function(index, value) {
+ jQuery(this).removeAttr('disabled');
+ });
+ }
+ else
+ {
+ jQuery('.customfilter').css('display', 'none');
+ jQuery('.customfilter .customfilter-input').each(function(index, value) {
+ jQuery(this).attr('disabled', 'disabled');
+ });
+ }
+
+ });
+
+ jQuery('#filter-standard').trigger('change');
+
+ });
+
+</script>
+
+<br /><br />
\ No newline at end of file diff --git a/views/mods/mod_statistics/statistics.phtml b/views/mods/mod_statistics/statistics.phtml new file mode 100644 index 0000000..8f64b62 --- /dev/null +++ b/views/mods/mod_statistics/statistics.phtml @@ -0,0 +1,128 @@ +<!-- Root-Template für Statistikdaten -->
+
+ <script type="text/javascript">
+
+ function wpsg_statistic_addExportButton()
+ {
+
+ var z = 0;
+
+ if (!jQuery.jqplot.use_excanvas) {
+ jQuery('div.jqplot-target').each(function(){
+ var outerDiv = jQuery(document.createElement('div'));
+ var header = jQuery(document.createElement('div'));
+ var div = jQuery(document.createElement('div'));
+
+ outerDiv.append(header);
+ outerDiv.append(div);
+
+ outerDiv.addClass('jqplot-image-container' + z);
+ header.addClass('jqplot-image-container-header');
+ div.addClass('jqplot-image-container-content');
+
+ header.html('<?php echo '<span style="font-size:11px;">'.__('Um das Bild auf Ihrer Festplatte zu speichern, klicken Sie mit der rechten Maustaste auf das Bild und wählen Sie "Bild speichern unter..."', 'wpsg').'</span>'; ?>');
+ header.append('<br /><br />');
+
+ jQuery(this).after(outerDiv);
+ outerDiv.hide();
+
+ outerDiv = header = div = close = null;
+
+ if (!jQuery.jqplot._noToImageButton) {
+ var btn = jQuery(document.createElement('button'));
+ btn.addClass('button');
+ btn.text('Bild exportieren');
+ btn.css('margin-top', '25px');
+ btn.addClass('jqplot-image-button');
+ btn.attr('id', 'exportbtn-'+z);
+
+ btn.bind('click', {chart: jQuery(this)}, function(evt) {
+
+ var btnId = jQuery(this).attr('id');
+ btnId = btnId.split('-');
+ btnId = btnId[1];
+
+ var imgelem = evt.data.chart.jqplotToImageElem();
+ var div = jQuery(this).nextAll('div.jqplot-image-container' + btnId).first();
+ div.children('div.jqplot-image-container-content').empty();
+ div.children('div.jqplot-image-container-content').append(imgelem);
+
+
+
+ jQuery('div.jqplot-image-container' + btnId).dialog( {
+ 'modal': true,
+ 'width': 650,
+ 'height': 620,
+ 'title': '<?php echo __('Export', 'wpsg'); ?>'
+ } );
+ div = null;
+
+ });
+ z++;
+ jQuery(this).after(btn);
+ btn.after('<br />');
+ btn = null;
+ }
+ });
+ }
+
+ }
+
+ </script>
+
+ <div class="icon32 icon32-posts-post" id="icon-edit"><br></div>
+ <h2>
+ <?php echo __('Statistik', 'wpsg'); ?>
+ </h2>
+
+ <br/>
+
+ <div class="wpsg_admin_submenu" style="margin-top:8px;">
+
+ <div class="head">
+ <div class="title"><?php echo __('Auswahl', 'wpsg'); ?></div>
+ <div style="clear:both;"></div>
+ </div>
+
+ <ul>
+ <?php foreach ($this->view['charts'] as $index => $chart) { ?>
+
+ <li class="<?php echo ((strtolower($index) == $_REQUEST['id'])?'current':''); ?>"><a href="admin.php?page=wpsg-Statistics&id=<?php echo wpsg_hspc($index); ?>"><?php echo wpsg_hspc($chart['name']); ?></a></li>
+
+ <?php } ?>
+ </ul>
+ <div style="clear:both; margin-bottom:10px; margin-left:0px; margin-right:8px;"></div>
+
+ </div>
+
+ <div style="padding-right:10px; margin-left:210px; float:none;" class="subsubsub">
+
+ <?php
+
+ if (wpsg_isSizedString($this->view['chart']['data']['template']))
+ {
+ $templateFile = $this->view['chart']['data']['template'].'.phtml';
+ }
+ else
+ {
+ $templateFile = str_replace('get', '', strtolower($this->view['standardFilter'][$this->view['filter']['standard']]['func']).'.phtml');
+ }
+
+ $templatePath = WPSG_PATH_VIEW.'/mods/mod_statistics/'.strtolower($this->view['charts'][$_REQUEST['id']]['func']).'/'.$templateFile;
+
+ if (is_file($templatePath))
+ {
+ $this->render($templatePath);
+ }
+ else
+ {
+
+ wpsg_debug($templatePath);
+ echo '<strong>'.__('Ungültige Anfrage', 'wpsg').'</strong>';
+
+ }
+ ?>
+
+ </div>
+
+ <div style="clear:both; margin-bottom:10px; margin-left:0px; margin-right:8px;"></div>
\ No newline at end of file diff --git a/views/mods/mod_statistics/totals.phtml b/views/mods/mod_statistics/totals.phtml new file mode 100644 index 0000000..f07ffcd --- /dev/null +++ b/views/mods/mod_statistics/totals.phtml @@ -0,0 +1,21 @@ +<!-- Dashboard Widget -->
+
+<div id="<?php echo $this->view['modul_name']; ?>_totals">
+
+ <?php foreach((array)$this->view['rows'] as $rows) { ?>
+ <div class="<?php echo $this->view['modul_name']; ?>_totals_row">
+ <?php foreach ($rows as $index => $value) { ?>
+ <div class="<?php echo $this->view['modul_name']; ?>_totals_block" style="width:<?php echo 100/count($rows); ?>%">
+ <?php if (!preg_match('/####/', $index)) { ?>
+ <span class="label"><a href="/" onclick="return false;"><?php echo $index; ?></a></span>
+ <?php } ?>
+ <?php if (wpsg_isSizedString($value)) { ?>
+ <span class="number"><?php echo $value; ?></span>
+ <?php } ?>
+ </div>
+ <?php } ?>
+ <div class="wpsg_clear"></div>
+ </div>
+ <?php } ?>
+
+</div>
|
