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 <form class="form-inline" role="search" accept-charset="UTF-8" action="<?php echo CONST_Website_BaseURL; ?>search.php">
14 <div class="form-group">
15 <input id="q" name="q" type="text" class="form-control input-sm" placeholder="Search" value="<?php echo htmlspecialchars($sQuery); ?>" >
17 <div class="form-group">
18 <button type="submit" class="btn btn-primary btn-sm">Search</button>
19 <?php if (CONST_Search_AreaPolygons) { ?>
20 <!-- <input type="checkbox" value="1" name="polygon" <?php if ($bAsText) echo "checked='checked'"; ?>/> Highlight -->
21 <input type="hidden" value="1" name="polygon" />
23 <input type="hidden" name="viewbox" value="<?php echo $sViewBox; ?>" />
24 <div class="checkbox-inline">
26 <input type="checkbox" id="use_viewbox" <?php if ($sViewBox) echo "checked='checked'"; ?>>
36 <?php if ($sQuery) { ?>
38 <div id="searchresults" class="sidebar">
41 foreach($aSearchResults as $iResNum => $aResult)
44 echo '<div class="result" data-position=' . $i . '>';
46 echo (isset($aResult['icon'])?'<img alt="icon" src="'.$aResult['icon'].'"/>':'');
47 echo ' <span class="name">'.htmlspecialchars($aResult['name']).'</span>';
48 // echo ' <span class="latlon">'.round($aResult['lat'],3).','.round($aResult['lon'],3).'</span>';
49 // echo ' <span class="place_id">'.$aResult['place_id'].'</span>';
50 if (isset($aResult['label']))
51 echo ' <span class="type">('.$aResult['label'].')</span>';
52 else if ($aResult['type'] == 'yes')
53 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['class'])).')</span>';
55 echo ' <span class="type">('.ucwords(str_replace('_',' ',$aResult['type'])).')</span>';
56 echo ' <a class="btn btn-default btn-xs details" href="details.php?place_id='.$aResult['place_id'].'">details</a>';
60 if (sizeof($aSearchResults) && $sMoreURL)
62 echo '<div class="more"><a class="btn btn-primary" href="'.htmlentities($sMoreURL).'">Search for more results</a></div>';
66 echo '<div class="noresults">No search results found</div>';
74 <div id="intro" class="sidebar">
75 <?php include(CONST_BasePath.'/lib/template/includes/introduction.php'); ?>
80 <div id="map-wrapper">
81 <div id="map-position"></div>
85 </div> <!-- /content -->
93 <script type="text/javascript">
96 $aNominatimMapInit = [
101 echo 'var nominatim_map_init = ' . json_encode($aNominatimMapInit, JSON_PRETTY_PRINT) . ';';
103 $aNominatimResults = [];
104 echo 'var nominatim_results = ' . json_encode($aSearchResults, JSON_PRETTY_PRINT) . ';';
107 <?php include(CONST_BasePath.'/lib/template/includes/html-footer.php'); ?>