source: trunk/src/map/inc/suggestions.php@ 7810

Last change on this file since 7810 was 7805, checked in by janveeden, 15 years ago

Comitted some images I forgot to upload. Searchlist now shows nodes, and filters on name automatically while typing. Next up is getting it to filter on locations of nodes too.

File size: 1000 bytes
Line 
1<?php
2require_once("../../config.php");
3require_once($config['root']."/map/inc/kmlHandler.php");
4
5$markers = get_node_array($config['kml_file']);
6$suggested_markers = array();
7
8if(isset($_GET['value']))
9{
10 $typed_value = $_GET['value'];
11}
12else
13{
14 $typed_value = "";
15}
16
17foreach($markers as $marker)
18{
19 $markernames[] = (string)$marker['name'];
20}
21
22if (strlen($typed_value) > 0)
23 {
24 for($i=0; $i<count($markernames); $i++)
25 {
26 $hint= "";
27 if (strtolower($typed_value)==strtolower(substr($markernames[$i],0,strlen($typed_value))))
28 {
29
30 $suggested_markers[]=$markernames[$i];
31 }
32 }
33 }
34
35if ($suggested_markers == null)
36{
37 if (strlen($typed_value) > 0)
38 {
39 $suggested_markers[] = "Geen suggesties";
40 }
41 else
42 {
43 $suggested_markers = $markernames;
44 }
45}
46
47echo "<select multiple>";
48foreach($suggested_markers as $name)
49{
50 $name = (string)$name;
51 echo "<option value='{$name}'>{$name}</option>";
52}
53echo "</select>";
54
55?>
56
57
58
Note: See TracBrowser for help on using the repository browser.