56 lines
No EOL
2.2 KiB
PHP
56 lines
No EOL
2.2 KiB
PHP
<?php
|
|
|
|
include('php/library.php');
|
|
|
|
$data = unserialize(file_get_contents('data/coordinates.data'));
|
|
foreach ($data as $key => $value) {
|
|
$string = explode(', ', $key);
|
|
$index[$key] = implode(', ', array_reverse($string));
|
|
}
|
|
|
|
asort($index);
|
|
foreach ($index as $key => $value) {
|
|
$html_ .= '<tr>';
|
|
if ($data[$key]['latitude'] == 0 && $data[$key]['longitude'] == 0)
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right; color: rgb(255, 0, 0)">' . htmlentities($key) . '</td>';
|
|
else {
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html_ .= htmlentities($key);
|
|
$html_ .= '</td>';
|
|
$string = explode(' / ', coordinates2string($data[$key]['latitude'], $data[$key]['longitude']));
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html_ .= $string[0];
|
|
$html_ .= '</td>';
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html_ .= $string[1];
|
|
$html_ .= '</td>';
|
|
$string = explode(' / ', coordinates2string($data[$key]['spanLatitude'], $data[$key]['spanLongitude']));
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html_ .= substr($string[0], 0, -1);
|
|
$html_ .= '</td>';
|
|
$html_ .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html_ .= substr($string[1], 0, -1);
|
|
$html_ .= '</td>';
|
|
$count++;
|
|
}
|
|
$html_ .= '</td>';
|
|
$html_ .= '</tr>';
|
|
}
|
|
$html .= '<table style="border: 0px">';
|
|
$html .= '<tr>';
|
|
$html .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html .= number_format(count($data)) . ' locations';
|
|
$html .= '</td>';
|
|
$html .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html .= number_format($count) . ' known';
|
|
$html .= '</td>';
|
|
$html .= '<td style="padding-right: 10px; font-family: Monaco; font-size: 10px; text-align: right">';
|
|
$html .= number_format(count($data) - $count) . ' unknown';
|
|
$html .= '</td>';
|
|
$html .= '</tr>';
|
|
$html .= $html_;
|
|
$html .= '</table>';
|
|
|
|
echo $html;
|
|
|
|
?>
|