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/charttopsellertosales | |
- Testweise 4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5261 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_statistics/charttopsellertosales')
| -rw-r--r-- | views/mods/mod_statistics/charttopsellertosales/all.phtml | 171 | ||||
| -rw-r--r-- | views/mods/mod_statistics/charttopsellertosales/data.phtml | 82 |
2 files changed, 253 insertions, 0 deletions
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 |
