Failed Conditions
Pull Request — master (#368)
by
unknown
04:48
created

index.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
include_once('config.php');
4
include_once('functions.php');
5
include_once('core/process/data.loader.php');
6
7
?>
8
9
<!DOCTYPE html>
10
<html>
11
	<head>
12
		<meta charset="utf-8">
13
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
14
		<meta name="viewport" content="width=device-width, initial-scale=1">
15
16
		<?php include_once('core/inc/meta.inc.php') ?>
17
18
		<!-- Bootstrap -->
19
		<link href="core/css/bootstrap.min.css" rel="stylesheet">
20
		<link href="https://fonts.googleapis.com/css?family=Lato:400,300,700" rel="stylesheet" type="text/css">
21
		<link href="core/css/font-awesome.min.css" rel="stylesheet">
22
		<link href="<?php auto_ver('core/css/style.css'); ?>" rel="stylesheet">
23
		<?php if ($page == "pokemon") { ?>
24
			<link href="<?php auto_ver('core/css/jQRangeSlider-bootstrap.min.css'); ?>" rel="stylesheet">
25
		<?php } ?>
26
	</head>
27
	<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
28
29
		<?php
30
		// Google Analytics
31
		if (is_file("analyticstracking.php")) {
32
			include_once("analyticstracking.php");
33
		}
34
		?>
35
36
		<nav class="navbar navbar-default navbar-fixed-top">
37
			<div class="container">
38
				<!-- Brand and toggle get grouped for better mobile display -->
39
				<div class="navbar-header">
40
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu" aria-expanded="false">
41
						<span class="sr-only">Toggle navigation</span>
42
						<span class="icon-bar"></span>
43
						<span class="icon-bar"></span>
44
						<span class="icon-bar"></span>
45
					</button>
46
					<a class="navbar-brand" href="<?= HOST_URL ?>"><img src="<?= $config->infos->logo_path ?>" width="25" style="display:inline-block;" alt="<?= $config->infos->site_name ?>" id="logo-img" /> <?= $config->infos->site_name ?></a>
47
				</div>
48
49
				<!-- Collect the nav links, forms, and other content for toggling -->
50
				<div class="collapse navbar-collapse" id="menu">
51
					<ul class="nav navbar-nav navbar-right">
52
53
						<?php
54
						if (!isset($config->menu)) {
55
							echo "Please update variables.json file with menu values";
56
							exit();
57
						}
58
59
						foreach ($config->menu as $menu) {
0 ignored issues
show
Blank line found at start of control structure
Loading history...
60
							
61
							printMenuitems($menu, 1, $locales);
62
0 ignored issues
show
Blank line found at end of control structure
Loading history...
63
						}
64
						?>
65
66
					</ul>
67
				</div> <!-- /.navbar-collapse -->
68
			</div> <!-- /.container-fluid -->
69
		</nav>
70
71
		<div class="container">
72
			<?php
73
			# Include the pages
74
			if (!empty($_GET['page'])) {
75
				$file = SYS_PATH.'/pages/'.$page.'.page.php';
76
77
				if (is_file($file)) {
78
					echo '<!-- Page :: '.$page.' -->';
79
					include($file);
80
				} else {
81
					include('pages/home.page.php');
82
				}
83
			} else {
84
				include('pages/home.page.php');
85
			}
86
87
			?>
88
		</div>
89
90
		<footer>
91
			<div class="container">
92
				<div class="row">
93
					<div class="col-md-12 text-center">
94
						<img src="core/img/logo.png" width=50 class="big-icon" alt="Brusselopole icon">
95
						<h2><?= $locales->FOOTER_TITLE ?></h2>
96
						<p><?= $locales->FOOTER_SUB ?></p>
97
						<?= $locales->FOOTER_VISUAL_CONTENT ?>
98
						<p><?= $locales->FOOTER_MADE_BY ?></p>
99
						<h3>Pokémon™</h3>
100
						<?= $locales->FOOTER_POKEMON_CONTENT ?>
101
					</div>
102
				</div>
103
			</div>
104
		</footer>
105
106
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
107
		<script src="core/js/bootstrap.min.js"></script>
108
109
		<?php // Load scripts only for page
110
		if (empty($page)) { ?>
111
112
			<script src="<?php auto_ver('core/js/home.script.js') ?>"></script>
113
114
			<script>
115
				updateCounter(<?= $home->pokemon_now ?>,'.total-pkm-js');
116
				updateCounter(<?= $home->pokestop_lured ?>,'.total-lure-js');
117
				updateCounter(<?= $home->active_raids ?>,'.total-raids-js');
118
				updateCounter(<?= $home->gyms ?>,'.total-gym-js');
119
120
				updateCounter(<?= $home->teams->valor ?>,'.total-valor-js');
121
				updateCounter(<?= $home->teams->mystic ?>,'.total-mystic-js');
122
				updateCounter(<?= $home->teams->instinct ?>,'.total-instinct-js');
123
				updateCounter(<?= $home->teams->rocket ?>,'.total-rocket-js');
124
			</script>
125
		<?php
126
		} else {
127
			switch ($page) {
128
				case 'pokemon':
129
					?>
130
131
					<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
132
					<script src="core/js/pokemon.graph.js.php?id=<?= $pokemon_id ?>"></script>
133
134
					<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
135
					<script src="<?php auto_ver('core/js/jQAllRangeSliders-withRuler.min.js') ?>"></script>
136
					<script src="<?php auto_ver('core/js/pokemon.maps.js') ?>"></script>
137
					<script>
138
						var pokemon_id = <?= $pokemon_id ?>;
139
					</script>
140
					<script src="https://maps.googleapis.com/maps/api/js?key=<?= $config->system->GMaps_Key ?>&libraries=visualization&callback=initMap&v=3"></script>
141
142
					<?php
143
					break;
144
145
				case 'pokestops':
146
					?>
147
148
					<script src="<?php auto_ver('core/js/pokestops.maps.js') ?>"></script>
149
					<script src="https://maps.googleapis.com/maps/api/js?key=<?= $config->system->GMaps_Key ?>&libraries=visualization&callback=initMap&v=3"></script>
150
151
					<?php
152
					break;
153
154
				case 'gym':
155
					?>
156
157
					<script src="<?php auto_ver('core/js/gym.script.js') ?>"></script>
158
					<script>
159
						updateCounter(<?= $teams->valor->gym_owned ?>,'.gym-valor-js');
160
						updateCounter(<?= $teams->valor->average ?>,'.average-valor-js');
161
162
						updateCounter(<?= $teams->instinct->gym_owned ?>,'.gym-instinct-js');
163
						updateCounter(<?= $teams->instinct->average ?>,'.average-instinct-js');
164
165
						updateCounter(<?= $teams->mystic->gym_owned ?>,'.gym-mystic-js');
166
						updateCounter(<?= $teams->mystic->average ?>,'.average-mystic-js');
167
					</script>
168
169
					<script src="<?php auto_ver('core/js/gym.maps.js') ?>"></script>
170
					<script src="https://maps.googleapis.com/maps/api/js?key=<?= $config->system->GMaps_Key ?>&libraries=visualization&callback=initMap&v=3"></script>
171
172
					<?php
173
					break;
174
175
				case 'pokedex':
176
					?>
177
178
					<script src="core/js/holmes.min.js"></script>
179
					<script>
180
						// holmes setup
181
						var h = new holmes({
182
							input: '.search input',
183
							find: '.results .pokemon-single',
184
							placeholder: '<h3>— No results, my dear Ash. —</h3>',
185
							class: {
186
								visible: 'visible',
187
								hidden: 'hidden'
188
							}
189
						});
190
					</script>
191
192
					<?php
193
					break;
194
195
				case 'dashboard':
196
					?>
197
198
					<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
199
					<script src="core/js/dashboard.graph.js.php"></script>
200
201
					<?php
202
					break;
203
204
				case 'trainer':
205
					?>
206
207
					<script src="<?php auto_ver('core/js/trainer.content.js') ?>"></script>
208
					<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
209
					<script src="core/js/trainer.graph.js.php"></script>
210
211
					<?php
212
					break;
213
214
				case 'nests':
215
					?>
216
217
					<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.countdown/2.2.0/jquery.countdown.min.js"></script>
218
					<script src="core/js/nests.maps.js.php"></script>
219
					<script src="https://maps.googleapis.com/maps/api/js?key=<?= $config->system->GMaps_Key ?>&libraries=visualization&callback=initMap&v=3"></script>
220
221
					<?php
222
					break;
223
224
				case 'raids':
225
					?>
226
227
					<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.countdown/2.2.0/jquery.countdown.min.js"></script>
228
					<script src="<?php auto_ver('core/js/raids.content.js') ?>"></script>
229
230
					<?php
231
					break;
232
233
				case 'gymhistory':
234
					?>
235
236
					<script src="<?php auto_ver('core/js/gymhistory.content.js') ?>"></script>
237
238
					<?php
239
					break;
240
			}
241
		}
242
		?>
243
244
	</body>
245
</html>
246