Failed Conditions
Pull Request — master (#371)
by
unknown
02:05
created

pages/home.page.php (25 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
<header id="single-header">
2
	<div class="row">
3
		<div class="col-md-12 text-center">
4
			<h1>
5
				<?= $config->infos->site_title; ?>
6
				<br>
7
				<small><?= sprintf($config->infos->site_claim, $config->infos->city); ?></small>
8
			</h1>
9
10
		</div>
11
	</div>
12
</header>
13
14
<div class="flex-container row area">
15
16
	<div class="flex-item-homepage big-data"> <!-- LIVEMON -->
17
		<a href="pokemon">
18
			<img src="core/img/pokeball.png" alt="Visit the <?= $config->infos->site_name; ?> Pokedex" width=50 class="big-icon">
19
			<p><big><strong class="total-pkm-js">0</strong> Pokémon</big><br>
20
			<?= sprintf($locales->WIDGET_POKEMON_SUB, $config->infos->city); ?></p>
21
		</a>
22
	</div>
23
24
	<div class="flex-item-homepage big-data"> <!-- GYMS -->
25
		<a href="gym">
26
			<img src="core/img/rocket.png" alt="Discover the <?= $config->infos->site_name; ?> Gyms" width=50 class="big-icon">
27
			<p><big><strong class="total-gym-js">0</strong> <?= $locales->GYMS; ?></big><br>
28
			<?= $locales->WIDGET_GYM_SUB; ?></p>
29
		</a>
30
31
	</div>
32
33
	<?php
34 View Code Duplication
    if (true === !$config->system->no_lures) {
35
        ?>
36
		<div class="flex-item-homepage big-data"> <!-- POKESTOPS -->
37
			<a href="pokestops">
38
				<img src="core/img/lure-module.png" alt="Discover the <?= $config->infos->site_name; ?> Pokéstops" width=50 class="big-icon">
39
				<p><big><strong class="total-lure-js">0</strong> <?= $locales->LURES; ?></big><br>
40
                    <?= sprintf($locales->WIDGET_LURES_SUB, $config->infos->city); ?></p>
41
			</a>
42
		</div>
43
		<?php
44
    }
45 View Code Duplication
    if (true === $config->system->homepage_raids) {
46
        ?>
47
		<div class="flex-item-homepage flex-item-homepage-homepage big-data"> <!-- RAIDS -->
48
			<a href="raids">
49
				<img src="core/img/raid.png" alt="Discover the <?= $config->infos->site_name; ?> Raids" width=50
50
                     class="big-icon">
51
				<p><big><strong class="total-raids-js">0</strong> <?= $locales->RAIDS; ?></big><br>
52
                    <?= sprintf($locales->WIDGET_LURES_SUB, $config->infos->city); ?></p>
53
			</a>
54
		</div>
55
		<?php
56
    }
57
    ?>
58
59
	<div class="flex-item-homepage big-data">
60
		<a href="<?= $config->homewidget->url; ?>" target="_blank">
61
			<img src="<?= $config->homewidget->image; ?>" alt="<?= $config->homewidget->image_alt; ?>" width=50 class="big-icon">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
62
			<p><?= $config->homewidget->text; ?></p>
63
		</a>
64
	</div>
65
66
</div>
67
68
69
<div class="row area big-padding">
70
	<div class="col-md-12 text-center">
71
		<h2 class="text-center sub-title">
72
			<?php
73
            if ($config->system->recents_filter) {
74
                ?>
75
				<?= $locales->RECENT_MYTHIC_SPAWNS; ?>
76
			<?php
77
            } else {
78
                ?>
79
				<?= $locales->RECENT_SPAWNS; ?>
80
			<?php
81
            } ?>
82
		</h2>
83
		<div class="last-mon-js">
84
		<?php
85
        $timers = array();
86
        foreach ($recents as $key => $pokemon) {
87
            $id = $pokemon->id;
88
            $uid = $pokemon->uid; ?>
89
			<div class="col-md-1 col-xs-4 pokemon-single" data-pokeid="<?= $id; ?>" data-pokeuid="<?= $uid; ?>" >
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
90
				<a href="pokemon/<?= $id; ?>"><img src="<?= $pokemons->pokemon->$id->img; ?>" alt="<?= $pokemons->pokemon->$id->name; ?>" class="img-responsive"></a>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
91
				<a href="pokemon/<?= $id; ?>"><p class="pkmn-name"><?= $pokemons->pokemon->$id->name; ?></p></a>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
92
				<a href="<?= $pokemon->location_link; ?>" target="_blank">
93
					<small class="pokemon-timer">00:00:00</small>
94
				</a>
95
				<?php
96
                if ($config->system->recents_encounter_details) {
97
                    if ($pokemon->encdetails->available) {
98
                        if ($config->system->iv_numbers) {
99
                            ?>
100
							<div class="progress" style="height: 15px; margin-bottom: 0">
101
								<div title="Attack IV: <?= $pokemon->encdetails->attack; ?>" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->attack; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
102
									<span class="sr-only"><?= $locales->ATTACK; ?> IV: <?= $pokemon->encdetails->attack; ?></span><?= $pokemon->encdetails->attack; ?>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
103
								</div>
104
								<div title="Defense IV: <?= $pokemon->encdetails->defense; ?>" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->defense; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
105
									<span class="sr-only"><?= $locales->DEFENSE; ?> IV: <?= $pokemon->encdetails->defense; ?></span><?= $pokemon->encdetails->defense; ?>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
106
								</div>
107
								<div title="Stamina IV: <?= $pokemon->encdetails->stamina; ?>" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->stamina; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
108
									<span class="sr-only"><?= $locales->STAMINA; ?> IV: <?= $pokemon->encdetails->stamina; ?></span><?= $pokemon->encdetails->stamina; ?>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
109
								</div>
110
							</div>
111
						<?php
112
                        } else {
113
                            ?>
114
							<div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto;">
115
								<div title="Attack IV: <?= $pokemon->encdetails->attack; ?>" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->attack; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->encdetails->attack) / 3; ?>%">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
116
									<span class="sr-only"><?= $locales->ATTACK; ?> IV: <?= $pokemon->encdetails->attack; ?></span>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
117
								</div>
118
								<div title="Defense IV: <?= $pokemon->encdetails->defense; ?>" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->defense; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->encdetails->defense) / 3; ?>%">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
119
									<span class="sr-only"><?= $locales->DEFENSE; ?> IV: <?= $pokemon->encdetails->defense; ?></span>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
120
								</div>
121
								<div title="Stamina IV: <?= $pokemon->encdetails->stamina; ?>" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->stamina; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= ((100 / 15) * $pokemon->encdetails->stamina) / 3; ?>%">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
122
									<span class="sr-only"><?= $locales->STAMINA; ?> IV: <?= $pokemon->encdetails->stamina; ?></span>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
123
								</div>
124
							</div>
125
					<?php
126
                        } ?>
127
						<small><?= $pokemon->encdetails->cp; ?></small>
128
					<?php
129
                    } else {
130
                        if ($config->system->iv_numbers) {
131
                            ?>
132
							<div class="progress" style="height: 15px; margin-bottom: 0">
133
								<div title="Attack IV: not available" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->attack; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
134
									<span class="sr-only"><?= $locales->ATTACK; ?> IV: <?= $locales->NOT_AVAILABLE; ?></span>?
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
135
								</div>
136
								<div title="Defense IV: not available" class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->defense; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
137
									<span class="sr-only"><?= $locales->DEFENSE; ?> IV: <?= $locales->NOT_AVAILABLE; ?></span>?
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
138
								</div>
139
								<div title="Stamina IV: not available" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?= $pokemon->encdetails->stamina; ?>" aria-valuemin="0" aria-valuemax="45" style="width: <?= (100 / 3); ?>%; line-height: 16px">
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
140
									<span class="sr-only"><?= $locales->STAMINA; ?> IV: <?= $locales->NOT_AVAILABLE; ?></span>?
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
141
								</div>
142
							</div>
143
						<?php
144
                        } else {
145
                            ?>
146
						<div class="progress" style="height: 6px; width: 80%; margin: 5px auto 0 auto;">
147
							<div title="IV not available" class="progress-bar" role="progressbar" style="width: 100%; background-color: rgb(210,210,210)" aria-valuenow="1" aria-valuemin="0" aria-valuemax="1">
148
								<span class="sr-only">IV <?= $locales->NOT_AVAILABLE; ?></span>
149
							</div>
150
						</div>
151
					<?php
152
                        } ?>
153
						<small>???</small>
154
					<?php
155
                    }
156
                } ?>
157
				</div>
158
			<?php
159
            // Array with ids and countdowns to start at the end of this file
160
            $timers[$uid] = $pokemon->last_seen - time();
161
        } ?>
162
		</div>
163
	</div>
164
</div>
165
166
167
<div class="row big padding">
168
	<h2 class="text-center sub-title"><?= $locales->FIGHT_TITLE; ?></h2>
169
170
		<?php
171
            foreach ($home->teams as $team => $total) {
172
                if ($home->teams->rocket) {
173
                    ?>
174
175
					<div class="col-md-3 col-sm-6 col-sm-12 team">
176
						<div class="row">
177
							<div class="col-xs-12 col-sm-12">
178
								<p style="margin-top:0.5em;text-align:center;"><img src="core/img/<?= $team; ?>.png" alt="Team <?= $team; ?>" class="img-responsive" style="display:inline-block" width=80> <strong class="total-<?= $team; ?>-js">0</strong> <?= $locales->GYMS; ?></p>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
179
180
				<?php
181
                } else {
182
                    ?>
183
184
					<div class="col-md-4 col-sm-6 col-sm-12 team">
185
						<div class="row">
186
							<div class="col-xs-12 col-sm-12">
187
								<?php
188
                                    if ('rocket' != $team) {
189
                                        ?>
190
										<p style="margin-top:0.5em;text-align:center;"><img src="core/img/<?= $team; ?>.png" alt="Team <?= $team; ?>" class="img-responsive" style="display:inline-block" width=80> <strong class="total-<?= $team; ?>-js">0</strong> <?= $locales->GYMS; ?></p>
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
191
										<?php
192
                                    }
193
                } ?>
194
							</div>
195
						</div>
196
					</div>					
197
				<?php
198
            } ?>
199
</div>
200
201
202
<script>
203
	document.addEventListener('DOMContentLoaded', function() {
204
		<?php
205
        foreach (array_reverse($timers, true) as $id => $countdown) {
206
            ?>
207
			startTimer(<?= $countdown; ?>,"<?= $id; ?>");
0 ignored issues
show
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
208
		<?php
209
        } ?>
210
	}, false);
211
</script>
212