summaryrefslogtreecommitdiff
path: root/views/mods/mod_statistics/statistics.phtml
blob: fc27f1ffe835cc1102593aafb46764b37c5dea40 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!-- 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>
	
	<div class="wpsg_products" id="wpsg-bs">
	
		<nav class="navbar navbar-default">
			<div class="container-fluid">
				<div class="navbar-header">
					<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
				</div>
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li role="presentation" class="<?php echo ((!isset($_REQUEST['action']))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt"><?php echo __("Statistik", "wpsg"); ?></a></li>
<!-- 
						<li role="presentation" class="wpsg_showhide_filter <?php echo (($this->view['hasFilter'] === true)?'active':''); ?>"><a href="#" onclick="return false;"><span class="glyphicon glyphicon-search"></span><?php echo __("Suche", "wpsg"); ?></a></li>
				 		<li role="presentation" class="<?php echo ((wpsg_isSizedString($_REQUEST['action'], 'add'))?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=add"><span class="glyphicon glyphicon-plus"></span><?php echo __("Hinzufügen", "wpsg"); ?></a></li>
-->				 		
					</ul>
				</div>
			</div>
		</nav>
	</div>

	<div id="wpsg-bs" >
		<div class="wpsg_admin_submenu" >
			
			<div class="list-group" id="wpsg_statistics_tabs">
				<span class="list-group-head list-group-item"><?php echo __('Auswahl', 'wpsg'); ?></span>
			
			<?php foreach ($this->view['charts'] as $index => $chart) { ?>
	
				<a class="list-group-item <?php echo ((strtolower($index) == $_REQUEST['id'])?'active':''); ?>" href="admin.php?page=wpsg-Statistics&amp;id=<?php echo wpsg_hspc($index); ?>"><?php echo wpsg_hspc($chart['name']); ?></a>
			
			<?php } ?>
			</div>
	
			<div style="clear:both; margin-bottom:10px; margin-left:0px; margin-right:8px;"></div>
				
		</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>