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