"; // require "../unlocode/config_hj.inc"; require_once "ti_db_default_link.php"; /* Verbindung aufbauen, auswählen einer Datenbank */ //$link=mysqli_connect("{$_db["host"]}","{$_db["user"]}","{$_db["password"]}") or die("Keine Verbindung möglich: " . mysqli_error()); /* echo "Verbindung zum Datenbankserver erfolgreich"; */ //mysqli_select_db($link,"{$_db["only_db"]}") or die("Auswahl der Datenbank fehlgeschlagen"); //mysqli_query("SET NAMES 'utf8'") or die("Anfrage fehlgeschlagen: " . mysqli_error($link)); import_request_variables("PG", "r_"); $ti_path=$r_ti_path; $r_loli=$r_b_west; $r_lore=$r_b_east; $r_laob=$r_b_north; $r_laun=$r_b_south; $loli= round($r_loli*100); $loli=fmod($loli+54000,36000) -18000; $lore= round($r_lore*100); $lore=fmod(($lore+54000),36000) -18000; if ($loli<$lore) $lobe="lon between $loli and $lore"; else $lobe="($loli < lon OR lon < $lore)"; $laob= round($r_laob*100); $laun= round($r_laun*100); $scale=15-2*$r_level; $today=date(c); $path1=explode("/",$r_ti_path); $path1_stop=array("festivals","milongas","blockthis...."); //echo "dfgh".$ti_path; if (!array_intersect($path1, $path1_stop)){//cities as default if ($ti_path=="/deejays"){ $scale=5-2*$r_level; } $select=" geo_cities.lat,lon,ti_locality.easy_name AS city,geo_cities.id, ti_locality.iso_3166_1,ti_locality.unlocode_short, tango,name_e, c_links,c_danceteachers,c_deejays,c_festivals "; $from=" geo_cities,ti_locality "; $where=" level>=$scale and geo_cities.lat between $laun and $laob and $lobe AND tango AND geo_cities.iso_3166_1 = ti_locality.iso_3166_1 AND geo_cities.unlocode_short = ti_locality.unlocode_short"; if (strstr ($ti_path,"/deejays") ){ $where.=" AND ti_locality.c_deejays>0 "; } $sql = "SELECT $select FROM $from WHERE $where ORDER BY population desc limit 200"; echo "$sql"; $result = $mysqli->query($sql) or die("Query failed : " . $mysqli->error); while ($data = $result->fetch_array(MYSQLI_ASSOC)) { echo "\n"; } } if (strstr($ti_path,"festivals")){ $scale=5-2*$r_level; $sql = "SELECT ti_event.summary AS fname, dtstart_date, dtend_date, lat,lon,geo_cities.name AS city, geo_cities.id,name_e , ti_event.code AS event_code,ti_event.iso_3166_1,tango,ti_event.unlocode_short FROM geo_cities, ti_event WHERE level>=$scale and lat between $laun and $laob and $lobe AND tango AND ti_event.dtstart_date > '$today' AND ti_event.iso_3166_1 = geo_cities.iso_3166_1 AND ti_event.unlocode_short = geo_cities.unlocode_short AND type='festival' ORDER BY population desc limit 200"; //echo "$sql"; $result = $mysqli->query($sql) or die("Query failed : " . $mysqli->error); while ($data = $result->fetch_array(MYSQLI_ASSOC)) { $data["festival_short_y"]=substr($data["code"],0,4); $data["festival_short_a"]=substr($data["code"],9,1); echo "\n"; //echo "\n"; } } // kml.php?loli=-179&lore=179&laob=80&laun=-80&level=0 ?>