<script type="text/javascript">
//<![CDATA[
// this variable will collect the html which will eventually be placed in the side_bar
var side_bar_html = "";
// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var gmarkers = [];
var map = null;
var dettagli="<a href='index.php'>vai</a>";
function initialize() {
// create the map
var myOptions = {
zoom: 13,
center: new google.maps.LatLng(40.635711,17.942255),
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
navigationControl: false,
panControl: false,
scaleControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
google.maps.event.addListener(map, 'click', function() {
infowindow.close();
});
// Add markers to the map
// Set up three markers with info windows
// add the points
<?php
include("vita/core.php");
$cat=$_GET['tv'];
$spe=$_GET['vl'];
// seleziona la citta
$scitta= $_POST['scitta'];
foreach($scitta as $scitto){
$scitta = $scitto;}
// seleziona la t immobile
$timmo= $_POST['timmo'];
foreach($timmo as $timmi){
$timmo = $timmi;}
// seleziona prezzo
$sprezzo= $_POST['sprezzo'];
foreach($sprezzo as $sprezzi){
$sprezzo = $sprezzi;}
// seleziona mq
$smq= $_POST['smq'];
foreach($smq as $smqu){
$smq = $smqu;}
$wh="";
if(isset($_POST['scitta'])){
$wh.=" AND citta='".$scitta."' ";
}
if(isset($_POST['timmo'])){
$wh.=" AND tipologia='".$timmo."' ";
}
if(isset($_POST['smq'])){
if($smq=='51'){ $wh.=" AND mq >'".$smq."'"; }
else { $wh.=" AND mq <='".$smq."'";}
}
if(isset($_POST['sprezzo'])){
if($sprezzo=='4'){ $wh.=" AND prezzo >'".$sprezzo."'"; }
else { $wh.=" AND prezzo <='".$sprezzo."'";}
}
$rileva=mysql_query("SELECT * FROM mappa WHERE 1=1 and categoria='$cat' and commerce='$spe' $wh ORDER BY data_creazione DESC") or die(mysql_error());
if(mysql_num_rows($rileva)>0){
while($arrayr=mysql_fetch_array($rileva)){
$nome=$arrayr['nome'];
$info=$arrayr['info'];
$coordinate=$arrayr['coordinate'];
$identify=$arrayr['collega'];
$image=$arrayr['image'];
$category=$arrayr['categoria'];
echo'var point = new google.maps.LatLng('.$coordinate.');
var marker = createMarker(point,"<table><tr><td><div id=spostato><img src=img/'.$image.' style=width:150px; height:150px;></td><td><div id=stampato>'.$nome.' - '.$info.'</div></div></td></tr></table>","<div class=testoprimario>'.$nome.' - '.$category.'<br><br><table><tr><td><img src=img/'.$image.' style=width:150px; ></td><td> '.$info.'</div></td></tr></table><br><br><img src=img/guarda.gif> <a class=via href=index.php?pagina=Scheda&identify='.$identify.'>Visualizza la galleria</a><br><br><img src=img/guarda.gif> <a class=via href=index.php?pagina=Scheda&identify='.$identify.'>Visualizza la scheda completa</a>");';
}}
?>
// put the assembled side_bar_html contents into the side_bar div
document.getElementById("side_bar").innerHTML = side_bar_html;
}
var infowindow = new google.maps.InfoWindow(
{
maxWidth: 300,
maxHeight: 300
});
// This function picks up the click and opens the corresponding info window
function myclick(i) {
google.maps.event.trigger(gmarkers[i], "click");
}
// A function to create the marker and set up the event window function
function createMarker(latlng, name, html) {
var contentString = html;
var marker = new google.maps.Marker({
position: latlng,
map: map,
zIndex: Math.round(latlng.lat()*-100000)<<5
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
});
// save the info we need to use later for the side_bar
gmarkers.push(marker);
// add a line to the side_bar html
side_bar_html += ' <a style=color:#121273; href="javascript:myclick(' + (gmarkers.length-1) + ')">' + name + '<\/a><br>';
}
// This Javascript is based on code provided by the
// Community Church Javascript Team
// http://www.bisphamchurch.org.uk/
// http://econym.org.uk/gmap/
// from the v2 tutorial page at:
// http://econym.org.uk/gmap/basic2.htm
//]]>
</script><img src='img/surprise.jpg' class='bg'>
<div id='pag'>Risultati della ricerca:
</div>
<div id='openyourmind_1'>
<!-- you can use tables or divs for the overall layout -->
<table style='position:relative; left:50%; margin-left:-650px;'><tr><td valign="top" style="width:600px;" frame="below"> <div id="side_bar" style='background:white;'></div>
</td>
<td valign="top" style="width:700px; text-decoration: underline; color: #4444ff;">
<a name='mappa'> <div id="map_canvas" style="width: 700px; float:right; height: 500px; "></div>
</td>
</tr>
</table>
</div><br><div id='spacedue'></div>
<div id='quart'><center><a href='' class='quart'>Scarica l'app per mobile</a> <a href='' class='quart'>Seguici su Facebook</a>
<a href='' class='quart'>Seguici su Twitter</a> <a href='' class='quart'>Contattaci via email</a> <a href='' class='quart'>Sito ottimizzato per Chrome</a></center></div>
<div id='spacetre'></div>