]> git.openstreetmap.org Git - nominatim.git/blob - website/deletable.php
Merge pull request #533 from mtmail/PSR2-php-tests
[nominatim.git] / website / deletable.php
1 <?php
2
3 require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
4 require_once(CONST_BasePath.'/lib/init-website.php');
5 require_once(CONST_BasePath.'/lib/log.php');
6 require_once(CONST_BasePath.'/lib/output.php');
7 ini_set('memory_limit', '200M');
8
9 $sOutputFormat = 'html';
10
11 $oDB =& getDB();
12
13 $sSQL = "select placex.place_id, calculated_country_code as country_code, name->'name' as name, i.* from placex, import_polygon_delete i where placex.osm_id = i.osm_id and placex.osm_type = i.osm_type and placex.class = i.class and placex.type = i.type";
14 $aPolygons = chksql($oDB->getAll($sSQL), "Could not get list of deleted OSM elements.");
15
16 if (CONST_DEBUG) {
17     var_dump($aPolygons);
18     exit;
19 }
20
21 ?>
22 <!DOCTYPE html>
23 <html>
24 <head>
25     <meta charset="utf-8"/>
26     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
27     
28     <title>Nominatim Deleted Data</title>
29     
30     <meta name="description" content="List of OSM data that has been deleted" lang="en-US" />
31
32 </head>
33
34 <body>
35 <style type="text/css">
36 table {
37     border-width: 1px;
38     border-spacing: 0px;
39     border-style: solid;
40     border-color: gray;
41     border-collapse: collapse;
42     background-color: white;
43     margin: 10px;
44 }
45 table th {
46     border-width: 1px;
47     padding: 2px;
48     border-style: inset;
49     border-color: gray;
50     border-left-color: #ddd;
51     border-right-color: #ddd;
52     background-color: #eee;
53     -moz-border-radius: 0px 0px 0px 0px;
54 }
55 table td {
56     border-width: 1px;
57     padding: 2px;
58     border-style: inset;
59     border-color: gray;
60     border-left-color: #ddd;
61     border-right-color: #ddd;
62     background-color: white;
63     -moz-border-radius: 0px 0px 0px 0px;
64 }
65 </style>
66
67 <p>Objects in this table have been deleted in OSM but are still in the Nominatim database.</p>
68
69 <table>
70 <?php
71
72 if (!$aPolygons) exit;
73 echo "<tr>";
74 // var_dump($aPolygons[0]);
75 foreach ($aPolygons[0] as $sCol => $sVal) {
76     echo "<th>".$sCol."</th>";
77 }
78 echo "</tr>";
79 foreach ($aPolygons as $aRow) {
80     echo "<tr>";
81     foreach ($aRow as $sCol => $sVal) {
82         switch ($sCol) {
83             case 'osm_id':
84                 echo '<td>'.osmLink($aRow).'</td>';
85                 break;
86             case 'place_id':
87                 echo '<td>'.detailsLink($aRow).'</td>';
88                 break;
89             default:
90                 echo "<td>".($sVal?$sVal:'&nbsp;')."</td>";
91                 break;
92         }
93     }
94     echo "</tr>";
95 }
96
97 ?>
98 </table>
99
100
101
102 </body>
103 </html>