<?php
echo genTitel('01/16/49','Поиск на карте'); $geschlecht=$_GET[geschlecht]; $vorname=$_GET[vorname]; $altervon=$_GET[altervon]; $alterbis=$_GET[alterbis]; $ort=$_GET[ort]; $ortdis=$_GET[ortdis]; $uon=$_GET[uon]; $seite=$_GET[seite]; $rando=$_GET[rando]; if(!$seite || $seite==0) $sza=0; else $sza = $seite * 14 - 1; $acc=0; if(!$rando) $rando = rand(); echo "<table border=0 cellspacing=0 cellpadding=0 align=center style=\"border:1px solid #aaa;\"><tr><td bgcolor=#f5f5f5><form action=index.php method=get onsubmit=\"document.getElementById('submit').disabled=true;document.getElementById('submit').value='Bitte warten...';\"><input type=hidden name=d value=mitglieder><table border=0 cellspacing=5 cellpadding=0 align=center>
<tr><td rowspan=7>&nbsp;&nbsp;</td><td>Пол:</td><td><img src=icon/01/10/09.png width=10 height=10 align=absmiddle><input type=radio name=geschlecht"; if($geschlecht=="w") echo " checked"; echo " value=w id=w><label for=w>женский</label> &nbsp; &nbsp; <img src=icon/01/10/06.png width=10 height=10 align=absmiddle><input type=radio name=geschlecht"; if($geschlecht=="m") echo " checked"; echo " value=m id=m><label for=m>мужской</label></td><td rowspan=7>&nbsp;&nbsp;</td></tr>
<tr><td>Имя:</td><td><input type=text name=vorname style=width:150px value=\"".$vorname."\"></td></tr>
<tr><td>Возраст:</td><td><select name=altervon style=width:60px>"; $s=$minal; while($s<100) { echo "<option"; if($s==$altervon) echo " selected"; echo ">".$s; $s++; } echo "</select> до <select name=alterbis style=width:60px>"; $s=$minal; while($s<100) { echo "<option"; if($s==$alterbis || (!$alterbis && $s==99)) echo " selected"; echo ">".$s; $s++; } echo "</select> </td></tr>
<tr><td><br>Город:</td><td><br><input type=text name=ort style=width:150px value=\"".$ort."\"></td></tr>
<tr><td colspan=2>в округе <select name=ortdis><option>0<option"; if($ortdis=="10") echo " selected"; echo ">10<option"; if($ortdis=="25") echo " selected"; echo ">25<option"; if($ortdis=="50") echo " selected"; echo ">50<option"; if($ortdis=="100") echo " selected"; echo ">100</select> километров</td></tr>
<tr><td colspan=2><br><input type=checkbox name=uon value=ok"; if($uon=="ok") echo " checked"; echo ">Только участники, которые в сети</td></tr>
<tr><td colspan=2 align=right><br><input type=submit value=Поиск id=submit class=formbutton></td></tr></table></form></td><td bgcolor=#f5f5f5>"; $sqlquery="SELECT * FROM ".$dbx."_user WHERE id NOT LIKE ''"; if($geschlecht!="") $sqlquery.=" AND geschlecht='".addslashes($geschlecht)."'"; if($vorname!="") $sqlquery.=" AND vorname='".addslashes($vorname)."'"; if($altervon!="") { $avon=mktime(0,0,0,date("m"),date("d"),date("Y")-$altervon); $sqlquery.=" AND geburtsdatum<".$avon; } if($alterbis!="") { $abis=mktime(0,0,0,date("m"),date("d"),date("Y")-$alterbis); $sqlquery.=" AND geburtsdatum>".$abis; } if($ort!="") { function cb($m) { return str_replace (" ", "::", $m[0]); } $ort = preg_replace_callback('/"(.*?)"/i', "cb", $ort); $ort = str_replace("\"","",$ort); $ort = str_replace("\\","",$ort); $ort = str_replace("+","",$ort); $ort = str_replace("-","",$ort); $ort = str_replace("*","",$ort); $ort = str_replace(",","",$ort); $ort = str_replace(".",". ",$ort); $ort = str_replace(".  ","..",$ort); $ort = str_replace(". ","..",$ort); $ort = str_replace(" AND "," ",$ort); $ort = str_replace(" OR "," ",$ort); $ortabf = explode(" ",$ort); $sqlquery .= " AND ("; if($ortdis!="" && $ortdis!=0 && $ortdis<101) { $oc=0; while($ortabf[$oc]!="") { $ortabf[$oc] = str_replace("..",". ",$ortabf[$oc]); $ortabf[$oc] = str_replace("::"," ",$ortabf[$oc]); $pres = mysql_query("SELECT laenge_WGS84, breite_WGS84 FROM ".$dbx."_geodata_de WHERE plz LIKE '%".$ortabf[$oc]."%' OR ort LIKE '".$ortabf[$oc]."%' ORDER BY ort"); $dt = mysql_fetch_array($pres); if($dt[laenge_WGS84]!="") $koo[] = $dt[laenge_WGS84].";".$dt[breite_WGS84]; $oc++; } $koo = @array_unique($koo); $oc=0; while($koo[$oc]!="") { $nr = explode(";",$koo[$oc]); $phi = $nr[0]; $theta = $nr[1]; $mcres = mysql_query("SELECT plz FROM ".$dbx."_geodata_de WHERE SQRT(POW(".$phi."-laenge_WGS84,2)*6400 + POW(".$theta."-breite_WGS84,2)*12100) < $ortdis"); while($dtt = mysql_fetch_array($mcres)) { if($dtt[plz]!="") { $sc=0; $pzu = explode(",",$dtt[plz]); while($epz = $pzu[$sc]) { $plzs[] = $epz; $sc++; } }} $oc++; }} $oc=0; while($plzs[$oc]!="") { $sqlquery .= "plz='".$plzs[$oc]."' OR "; $oc++; } $oc=0; while($ortabf[$oc]!="") { $ortabf[$oc] = str_replace("..",". ",$ortabf[$oc]); $ortabf[$oc] = str_replace("::"," ",$ortabf[$oc]); if($oc!=0) $sqlort .= " OR "; $sqlquery .= "plz LIKE '".$ortabf[$oc]."%' OR ort LIKE '".$ortabf[$oc]."%'"; $oc++; } $sqlquery .= ")"; } if($uon=="ok") $sqlquery.=" AND online > '".$amin."'"; $getff=mysql_query($sqlquery); $getfff=mysql_query($sqlquery." ORDER BY RAND($rando) LIMIT $sza,14"); $aaanz=mysql_num_rows($getff); $ap1=$sza+1; $dsanz=$ap1+13; if($aaanz<$dsanz) $dsanz=$aaanz; $ans=ceil($aaanz/14); $aks=$seite+1; $next=$seite+1; $prev=$seite-1; ?><script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?php echo $cdb[gmkey]; ?>" type="text/javascript"></script><script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($) {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
var icon = new GIcon();
icon.image = "http://<?php echo $cdb[url]; ?>images/gmarker.png";
icon.shadow = "http://<?php echo $cdb[url]; ?>images/gmarker_shaddow.png";
icon.iconSize = new GSize(20, 20);
icon.shadowSize = new GSize(30, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);
function createMarker(point,u,g,p,o) {
var marker = new GMarker(point, icon);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml('<table border=0 cellspacing=0 cellpadding=5><tr><td><img src=avatar/'+g+' width=60 height=60></td><td align=left><img src=images/user.gif width=8 height=12 align=absmiddle> <a href="<?php
echo genURL('user-\'+u+\'/','index.php?d=user&s=\'+u+\''); ?>"><b>'+u+'</b></a><br><br>'+p+' '+o+'</td></tr></table>');
});
return marker;
}
icon.infoWindowAnchor = new GPoint(5, 1);
map.setCenter(new GLatLng(50.5,12), 5);
map.addControl(new GSmallMapControl());
map.addControl(new GOverviewMapControl(new GSize(100,100)));
<?php
 if(mysql_num_rows($getff)==0) { echo "
map.geocoder = new GClientGeocoder();
map.geocoder.getLatLng('".$ort."', function(point) { if (point) { map.setCenter(point, 7); } } );
}});
//]]>
</script><div id=map style=\"width:510px;height:280px;border-left:1px solid #aaa;\"></div></td></tr></table><br><br>".genMsg('03/16/01','Нет соответствующих членов найдено.'); } else { $userlist="<table border=0 cellspacing=0 cellpadding=0 align=center><tr>"; while($getf=mysql_fetch_array($getfff)) { $acc++; if($getf[geolat]=="0" || $getf[geolang]=="0") { $laender=array("de"=>"Германия","at"=>"Цsterreich","ch"=>"Schweiz","li"=>"Liechtenstein","au"=>"Австралия","be"=>"Бельгия","dk"=>"Dдnemark","fi"=>"Финляндия","fr"=>"Франция","gr"=>"Griechenland","gb"=>"Grossbritannien","it"=>"Италия","ca"=>"Канада","lu"=>"Люксенбург","nz"=>"Neuseeland","nl"=>"Нидерланды","no"=>"Норвегия","pl"=>"Польша","pt"=>"Португалия","se"=>"Швеция","sk"=>"Словакия","es"=>"Испания","tr"=>"Турция","us"=>"США"); $adresse=$getf[plz].",".$getf[ort].",".$laender[$getf[land]]; $adresse="http://maps.google.com/maps/geo?q=".urlencode($adresse)."&output=xml&key=".$cdb[gmkey]; $urlinhalt=utf8_encode(file_get_contents($adresse)); $koordinaten3 = explode("<coordinates>",$urlinhalt); $koordinaten2 = explode("</coordinates>",$koordinaten3[1]); $koordinaten = explode(",",$koordinaten2[0]); $geolat=$koordinaten[1]; $geolang=$koordinaten[0]; $nix=explode("<Thoroughfare>",$urlinhalt); if(($geolat=="" || $geolang=="") && ($getf[land]=="de" || $getf[land]=="ch")) { $getgeo=mysql_query("SELECT laenge_WGS84,breite_WGS84 FROM ".$dbx."_geodata_".$getf[land]." WHERE plz LIKE '%".$getf[plz]."%'"); $geodd=mysql_fetch_array($getgeo); $geolat=$geodd[laenge_WGS84]; $geolang=$geodd[breite_WGS84]; } if($geolat=="" || $geolang=="") { $geolat="123"; $geolang="123"; } mysql_query("UPDATE ".$dbx."_user SET geolat='".$geolat."', geolang='".$geolang."' WHERE id='".$getf[id]."'"); } else { $geolat=$getf[geolat]; $geolang=$getf[geolang]; } if($geolat!="" && $geolang!="" && $geolat!="0" && $geolang!="0" && $geolat!="123" && $geolang!="123") { if(($ort!="" || mysql_num_rows($getff)==1) && $sc!="ok") { echo "
map.setCenter(new GLatLng(".$geolat.",".$geolang."), 7);
"; $sc="ok"; } echo "map.addOverlay(createMarker(new GLatLng(".$geolat.",".$geolang."), \"".ucfirst($getf[user])."\", \""; if(file_exists("avatar/".$getf[id]."_t.jpg")==1) echo $getf[id]."_t.jpg"; elseif(file_exists("avatar/".$getf[id]."_t.png")==1) echo $getf[id]."_t.png"; else echo "leer_".$getf[geschlecht].".gif"; echo "\", \"".$getf[plz]."\", \"".$getf[ort]."\"));\n"; } $userlist.="<td align=center class=small style=width:120px;height:120px; onmouseover=\"document.getElementById('b".$getf[id]."').style.width='80px';document.getElementById('b".$getf[id]."').style.height='80px';\" onmouseout=\"document.getElementById('b".$getf[id]."').style.width='50px';document.getElementById('b".$getf[id]."').style.height='50px';\">
<a href=\"".genURL('user-'.urlencode($getf[user]).'/','index.php?d=user&s='.urlencode($getf[user]))."\">"; if(file_exists("avatar/".$getf[id]."_t.jpg")==1) $userlist.="<img src=avatar/".$getf[id]."_t.jpg?t=".time(); elseif(file_exists("avatar/".$getf[id]."_t.png")==1) $userlist.="<img src=avatar/".$getf[id]."_t.png?t=".time(); else $userlist.="<img src=avatar/leer_".$getf[geschlecht].".gif"; $userlist.=" style=\"width:50px;height:50px;border:1px solid #ccc;padding:2px;vertical-align:middle;margin-bottom:4px;\" id=b".$getf[id]."></a><br><a href=\"".genURL('user-'.urlencode($getf[user]).'/','index.php?d=user&s='.urlencode($getf[user]))."\"><b>".ucfirst($getf[user])."</b></a><br><span class=small style=color:#aaa><img src=images/".$getf[geschlecht].".gif align=absmiddle>&nbsp;".alter(date("d",$getf[geburtsdatum]),date("m",$getf[geburtsdatum]),date("Y",$getf[geburtsdatum]))."</span></td>"; if($acc==7) $userlist.="</tr><tr>"; } $userlist.="</tr></table><br>"; ?>
}});
//]]>
</script><div id=map style="width:510px;height:280px;border-left:1px solid #aaa;"></div></td></tr></table><br><?php
 echo $userlist."<div style=\"border-top:1px solid #ccc; padding: 15px; text-align:center;\" class=small><img src=icon/03/10/32.png width=10 height=10 align=absmiddle> "; if($seite>0) echo "<a href=\"http://".$cdb[url]."?d=mitglieder&geschlecht=".$geschlecht."&vorname=".$vorname."&altervon=".$altervon."&alterbis=".$alterbis."&ort=".$ort."&ortdis=".$ortdis."&uon=".$uon."&rando=".$rando."&seite=".$prev."\">Предыдущая страница</a>"; else echo "<span style=color:#aaa>Предыдущая страница</span>"; echo " &nbsp; &nbsp; | &nbsp; &nbsp; "; echo "Seite $aks von $ans"; echo " &nbsp; &nbsp; | &nbsp; &nbsp; "; if($aaanz>$dsanz) echo "<a href=\"http://".$cdb[url]."?d=mitglieder&geschlecht=".$geschlecht."&vorname=".$vorname."&altervon=".$altervon."&alterbis=".$alterbis."&ort=".$ort."&ortdis=".$ortdis."&uon=".$uon."&rando=".$rando."&seite=".$next."\">Nдchste Seite</a>"; else echo "<span style=color:#aaa>Следующая страница</span>"; echo " <img src=icon/03/10/31.png width=10 height=10 align=absmiddle></div><br>"; } ?>