]> git.openstreetmap.org Git - nominatim.git/blob - website/deletable.php
6521e774442e9a97b5cefdf89559581629e0313b
[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
7         $sOutputFormat = 'html';
8         ini_set('memory_limit', '200M');
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 = $oDB->getAll($sSQL);
14         if (PEAR::isError($aPolygons))
15         {
16                 failInternalError("Could not get list of deleted OSM elements.", $sSQL, $aPolygons);
17         }
18
19 //var_dump($aPolygons);
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         {
75                 echo "<th>".$sCol."</th>";
76         }
77         echo "</tr>";
78         foreach($aPolygons as $aRow)
79         {
80                 echo "<tr>";
81                 foreach($aRow as $sCol => $sVal)
82                 {
83                         switch($sCol)
84                         {
85                                 case 'osm_id':
86                                         echo '<td>'.osmLink($aRow).'</td>';
87                                         break;
88                                 case 'place_id':
89                                         echo '<td>'.detailsLink($aRow).'</td>';
90                                         break;
91                                 default:
92                                         echo "<td>".($sVal?$sVal:'&nbsp;')."</td>";
93                                         break;
94                         }
95                 }
96                 echo "</tr>";
97         }
98 ?>
99 </table>
100
101
102
103 </body>
104 </html>