2 header("content-type: text/html; charset=UTF-8");
4 <?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
5 <link href="css/search.css" rel="stylesheet" type="text/css" />
8 <body id="search-page">
11 <header class="container-fluid">
13 <div class="col-xs-4">
15 <a href="<?php echo CONST_Website_BaseURL;?>">
16 <img alt="logo" src="images/osm_logo.120px.png" width="40" height="40"/>
21 <div id="last-updated" class="col-xs-4 text-center">
24 <?php echo $sDataDate; ?>
26 <div class="col-xs-4 text-right">
27 <div class="btn-group">
28 <button class="dropdown-toggle btn btn-link" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
29 About & Help <span class="caret"></span>
31 <ul class="dropdown-menu dropdown-menu-right">
32 <li><a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a></li>
33 <li><a href="http://wiki.openstreetmap.org/wiki/Nominatim/FAQ" target="_blank">FAQ</a></li>
34 <li role="separator" class="divider"></li>
35 <li><a href="#" class="" data-toggle="modal" data-target="#report-modal">Report problem with results</a></li>
42 <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
43 <div class="form-group">
44 <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($sQuery); ?>" >
46 <div class="form-group">
47 <button type="submit" class="btn btn-primary btn-sm">Search</button>
48 <?php if (CONST_Search_AreaPolygons) { ?>
49 <!-- <input type="checkbox" value="1" name="polygon" <?php if ($bAsText) echo "checked='checked'"; ?>/> Highlight -->
50 <input type="hidden" value="1" name="polygon" />
52 <input type="hidden" name="viewbox" value="<?php echo $sViewBox; ?>" />
53 <div class="checkbox-inline">
55 <input type="checkbox" id="use_viewbox" <?php if ($sViewBox) echo "checked='checked'"; ?>>
65 <?php if ($sQuery) { ?>
67 <div id="searchresults" class="sidebar">
70 foreach($aSearchResults as $iResNum => $aResult)
73 echo '<div class="result" data-position=' . $i . '>';
75 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
76 echo ' <span class="name">'.htmlspecialchars($aResult['name']).'</span>';
77 // echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
78 // echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
79 if (isset($aResult['label']))
80 echo ' <span class="type">('.$aResult['label'].')</span>';
81 else if ($aResult['type'] == 'yes')
82 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
84 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
85 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
89 if (sizeof($aSearchResults) && $sMoreURL)
91 echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
95 echo '<div class="noresults">No search results found</div>';
103 <div id="intro" class="sidebar">
104 <?php include(CONST_BasePath.'/lib/template/includes/introduction.php'); ?>
109 <div id="map-wrapper">
110 <div id="map-position"></div>
114 </div> <!-- /content -->
117 <p class="disclaimer">
118 Addresses and postcodes are approximate
120 <p class="copyright">
121 © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors
125 <div class="modal fade" id="report-modal">
126 <div class="modal-dialog">
127 <div class="modal-content">
128 <div class="modal-header">
129 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
130 <h4 class="modal-title">Report a problem</h4>
132 <div class="modal-body">
133 <?php include(CONST_BasePath.'/lib/template/includes/report-errors.php'); ?>
135 <div class="modal-footer">
136 <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
145 <script type="text/javascript">
148 $aNominatimMapInit = [
153 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
155 $aNominatimResults = [];
156 echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
159 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>