summaryrefslogtreecommitdiff
path: root/views/mods/mod_statistics/charttopsellertosales/data.phtml
blob: b13119bdf6d6ee205bd3fcd3ddc2dc10c330444a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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>