2 header("content-type: text/html; charset=UTF-8");
4 <body id="search-page">
6 <?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
8 <header class="container-fluid">
10 <div class="col-xs-4">
12 <a href="<?php echo CONST_Website_BaseURL;?>">
13 <img alt="logo" src="images/osm_logo.120px.png" width="40" height="40"/>
18 <div id="last-updated" class="col-xs-4 text-center">
21 <?php echo $sDataDate; ?>
23 <div class="col-xs-4 text-right">
24 <div class="btn-group">
25 <button class="dropdown-toggle btn btn-link" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
26 About & Help <span class="caret"></span>
28 <ul class="dropdown-menu dropdown-menu-right">
29 <li><a href="http://wiki.openstreetmap.org/wiki/Nominatim" target="_blank">Documentation</a></li>
30 <li><a href="http://wiki.openstreetmap.org/wiki/Nominatim/FAQ" target="_blank">FAQ</a></li>
31 <li role="separator" class="divider"></li>
32 <li><a href="#" class="" data-toggle="modal" data-target="#report-modal">Report problem with results</a></li>
39 <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
40 <div class="form-group">
41 <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($sQuery); ?>" >
43 <div class="form-group">
44 <button type="submit" class="btn btn-primary btn-sm">Search</button>
45 <?php if (CONST_Search_AreaPolygons) { ?>
46 <!-- <input type="checkbox" value="1" name="polygon" <?php if ($bAsText) echo "checked='checked'"; ?>/> Highlight -->
47 <input type="hidden" value="1" name="polygon" />
49 <input type="hidden" name="viewbox" value="<?php echo $sViewBox; ?>" />
50 <div class="checkbox-inline">
52 <input type="checkbox" id="use_viewbox" <?php if ($sViewBox) echo "checked='checked'"; ?>>
65 <div id="searchresults" class="sidebar">
68 foreach($aSearchResults as $iResNum => $aResult)
71 echo '<div class="result" data-position=' . $i . '>';
73 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
74 echo ' <span class="name">'.htmlspecialchars($aResult['name']).'</span>';
75 // echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
76 // echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
77 if (isset($aResult['label']))
78 echo ' <span class="type">('.$aResult['label'].')</span>';
79 else if ($aResult['type'] == 'yes')
80 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
82 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
83 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
87 if (sizeof($aSearchResults) && $sMoreURL)
89 echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
93 echo '<div class="noresults">No search results found</div>';
103 <div id="intro" class="sidebar">
110 <div id="map-wrapper">
111 <div id="map-position"></div>
119 <p class="disclaimer">
120 Addresses and postcodes are approximate
122 <p class="copyright">
123 © <a href="http://osm.org/copyright">OpenStreetMap</a> contributors
127 <div class="modal fade" id="report-modal">
128 <div class="modal-dialog">
129 <div class="modal-content">
130 <div class="modal-header">
131 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
132 <h4 class="modal-title">Report a problem</h4>
134 <div class="modal-body">
135 <?php include(CONST_BasePath.'/lib/template/includes/report-errors.php'); ?>
137 <div class="modal-footer">
138 <button type="button" class="btn btn-default" data-dismiss="modal">OK</button>
147 <script type="text/javascript">
150 $aNominatimMapInit = [
155 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
157 $aNominatimResults = [];
158 echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
161 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>