-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathowner.php
63 lines (61 loc) · 1.95 KB
/
owner.php
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
<?php
require_once('require/class.Connection.php');
require_once('require/class.Spotter.php');
require_once('require/class.Language.php');
require_once('require/class.Stats.php');
require_once('require/class.Common.php');
if (isset($_POST['owner']))
{
header('Location: '.$globalURL.'/owner/'.filter_input(INPUT_POST,'owner',FILTER_SANITIZE_STRING));
//} else if (isset($_GET['airport'])){
} else {
$Spotter= new Spotter();
$Stats = new Stats();
$Common = new Common();
$title = _("Owners");
require_once('header.php');
print '<div class="column">';
print '<h1>'._("Owners").'</h1>';
$owner_names = $Stats->getAllOwnerNames();
if (empty($owner_names)) {
$owner_names = $Spotter->getAllOwnerNames();
}
ksort($owner_names);
$previous = null;
print '<div class="alphabet-legend">';
foreach($owner_names as $value) {
$firstLetter = $Common->remove_accents(strtoupper($Common->replace_mb_substr($value['owner_name'], 0, 1)));
if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
{
if ($previous !== null){
print ' | ';
}
print '<a href="#'.$firstLetter.'">'.$firstLetter.'</a>';
}
if ($firstLetter != "'" && $firstLetter != '"') $previous = $firstLetter;
}
print '</div>';
$previous = null;
foreach($owner_names as $value) {
$firstLetter = $Common->remove_accents(strtoupper($Common->replace_mb_substr($value['owner_name'], 0, 1)));
if ($firstLetter != "")
{
if($previous !== $firstLetter && $firstLetter != "'" && $firstLetter != '"')
{
if ($previous !== null){
print '</div>';
}
print '<a name="'.$firstLetter.'"></a><h4 class="alphabet-header">'.$firstLetter.'</h4><div class="alphabet">';
}
if ($firstLetter != "'" && $firstLetter != '"') $previous = $firstLetter;
print '<div class="alphabet-item">';
print '<a href="'.$globalURL.'/owner/'.$value['owner_name'].'">';
print $value['owner_name'];
print '</a>';
print '</div>';
}
}
print '</div>';
}
require_once('footer.php');
?>