2 header("content-type: text/html; charset=UTF-8");
4 <?php include(CONST_BasePath.'/lib/template/includes/html-header.php'); ?>
5 <link href="css/common.css" rel="stylesheet" type="text/css" />
6 <link href="css/search.css" rel="stylesheet" type="text/css" />
9 <body id="search-page">
11 <?php include(CONST_BasePath.'/lib/template/includes/html-top-navigation.php'); ?>
13 <div class="top-bar" id="structured-query-selector">
14 <div class="search-type-link">
15 <a id="switch-to-reverse" href="<?php echo CONST_Website_BaseURL; ?>reverse.php?format=html">reverse search</a>
18 if (empty($aMoreParams['q']) and empty($aMoreParams['street']) and empty($aMoreParams['city']) and empty($aMoreParams['county']) and empty($aMoreParams['state']) and empty($aMoreParams['country']) and empty($aMoreParams['postalcode'])) {
19 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="simple" value="simple" checked="checked">';
20 echo '<label for="simple">simple</label></div>';
21 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="structured" value="structured">';
22 echo '<label for="structured">structured</label></div>';
24 elseif (!empty($aMoreParams['q'])) {
25 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="simple" value="simple" checked="checked">';
26 echo '<label for="simple">simple</label></div>';
27 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="structured" value="structured">';
28 echo '<label for="structured">structured</label></div>';
31 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="simple" value="simple">';
32 echo '<label for="simple">simple</label></div>';
33 echo '<div class="radio-inline"><input type="radio" name="query-selector" id="structured" value="structured" checked="checked">';
34 echo '<label for="structured">structured</label></div>';
38 <form role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
39 <div class="form-group-simple"
41 if (empty($aMoreParams['q']) and empty($aMoreParams['street']) and empty($aMoreParams['city']) and empty($aMoreParams['county']) and empty($aMoreParams['state']) and empty($aMoreParams['country']) and empty($aMoreParams['postalcode'])) {
42 echo "style='display:block;'";
44 elseif (empty($aMoreParams['q'])) {
45 echo "style='display:none;'";
48 <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($aMoreParams['q']); ?>" >
50 <div class="form-group-structured"
52 if (empty($aMoreParams['street']) and empty($aMoreParams['city']) and empty($aMoreParams['county']) and empty($aMoreParams['state']) and empty($aMoreParams['country']) and empty($aMoreParams['postalcode'])) {
53 echo "style='display:none;'";
56 echo "style='display:block;'";
59 <div class="form-inline">
60 <input id="street" name="street" type="text" class="form-control input-sm" placeholder="House number/Street" value="<?php echo htmlspecialchars($aMoreParams['street']); ?>" >
61 <input id="city" name="city" type="text" class="form-control input-sm" placeholder="City" value="<?php echo htmlspecialchars($aMoreParams['city']); ?>" >
62 <input id="county" name="county" type="text" class="form-control input-sm" placeholder="County" value="<?php echo htmlspecialchars($aMoreParams['county']); ?>" >
63 <input id="state" name="state" type="text" class="form-control input-sm" placeholder="State" value="<?php echo htmlspecialchars($aMoreParams['state']); ?>" >
64 <input id="country" name="country" type="text" class="form-control input-sm" placeholder="Country" value="<?php echo htmlspecialchars($aMoreParams['country']); ?>" >
65 <input id="postalcode" name="postalcode" type="text" class="form-control input-sm" placeholder="Postal Code" value="<?php echo htmlspecialchars($aMoreParams['postalcode']); ?>" >
67 <div class="form-group search-button-group">
68 <button type="submit" class="btn btn-primary btn-sm">Search</button>
69 <?php if (CONST_Search_AreaPolygons) { ?>
70 <input type="hidden" value="1" name="polygon_geojson" />
72 <input type="hidden" name="viewbox" value="<?php if (isset($aMoreParams['viewbox'])) echo ($aMoreParams['viewbox']); ?>" />
73 <div class="checkbox-inline">
74 <input type="checkbox" id="use_viewbox" <?php if (isset($aMoreParams['viewbox'])) echo "checked='checked'"; ?>>
75 <label for="use_viewbox">apply viewbox</label>
83 <?php if ($sQuery) { ?>
85 <div id="searchresults" class="sidebar">
88 foreach($aSearchResults as $iResNum => $aResult)
91 echo '<div class="result" data-position=' . $i . '>';
93 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
94 echo ' <span class="name">'.htmlspecialchars($aResult['name']).'</span>';
95 // echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
96 // echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
97 if (isset($aResult['label']))
98 echo ' <span class="type">('.$aResult['label'].')</span>';
99 else if ($aResult['type'] == 'yes')
100 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
102 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
103 echo detailsPermaLink($aResult, 'details', 'class="btn btn-default btn-xs details"');
107 if (!empty($aSearchResults) && $sMoreURL)
109 echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
113 echo '<div class="noresults">No search results found</div>';
121 <div id="intro" class="sidebar">
122 <?php include(CONST_BasePath.'/lib/template/includes/introduction.php'); ?>
127 <div id="map-wrapper">
128 <div id="map-position">
129 <div id="map-position-inner"></div>
130 <div id="map-position-close"><a href="#">hide</a></div>
135 </div> <!-- /content -->
139 <script type="text/javascript">
142 $aNominatimMapInit = array(
143 'zoom' => CONST_Default_Zoom,
144 'lat' => CONST_Default_Lat,
145 'lon' => CONST_Default_Lon,
146 'tile_url' => CONST_Map_Tile_URL,
147 'tile_attribution' => CONST_Map_Tile_Attribution
149 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
151 echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
154 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>