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