session_start();
require_once('config.php');
require_once("connect.php");
require_once("funcs.php");
$location = $_SERVER['SERVER_NAME'];
$name = $_GET['name'];
if(strpos($name,"union") !== false || strpos($name,"'") !== false
|| strpos($name,"\\") !== false)
{
header("location: //$location");
}
global $database;
if(isset($_SESSION['lat']) && isset($_SESSION['lng']))
{
$_SESSION['lat'] = (float)$_SESSION['lat'];
$_SESSION['lng'] = (float)$_SESSION['lng'];
$distance_allowed = 1;
} else {
$_SESSION['lat'] = 0;
$_SESSION['lng'] = 0;
}
if($_SESSION['lat'] == 0 || $_SESSION['lng'] == 0) {
$distance_found = 0;
} else {
$distance_found = 1;
}
$stmt = $database->prepare("SELECT *,( 6371 * acos( cos( radians( :lat ) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians( :lng ) ) + sin( radians( :lat ) ) * sin( radians( lat ) ) ) ) AS distance FROM zimmers WHERE name= :name");
$stmt->execute(array(':name' => $name,':lat' => $_SESSION['lat'],':lng' => $_SESSION['lng']));
if($stmt->rowCount()){
$row = $stmt->fetch();
extract($row);
} else {
header("location: //$location");
}
$txt = stripslashes($txt);
$phone1 = stripslashes($phone1);
$phone2 = stripslashes($phone2);
$phone3 = stripslashes($phone3);
$name = stripslashes($name);
$yeshov = stripslashes($yeshov);
$azor = stripslashes($azor);
$tior = stripslashes($tior);
$milot = stripslashes($milot);
$title = stripslashes($title);
$logotxt = stripslashes($logotxt);
$linklogo = stripslashes($linklogo);
$font = stripslashes($font);
$stxtlogo = stripslashes($stxtlogo);
$topman = stripslashes($topman);
$iflink2 = stripslashes($iflink2);
$gg_allow = stripslashes($gg_allow);
$gg_id = stripslashes($gg_id);
$gg2_allow = stripslashes($gg2_allow);
$gg2_id = stripslashes($gg2_id);
$ifphone = stripslashes($ifphone);
$ifsid = stripslashes($ifsid);
$txttop = stripslashes($txttop);
$ifmap = stripslashes($ifmap);
$catv = stripslashes($catv);
$link = "/".urlencode($name).'.html';
$canon = "\n";?>
getpageheader($milot,$tior,$title,$canon);?>
getpagenavigation(); ?>
$phone2 = file_get_contents_curl_curl(PICBANK.'/xmlphoneasaf.php?gid='.$gg_id);?>
$prace = file_get_contents_curl_curl(PICBANK.'/xmlpraceasaf.php?gid='.$gg_id);?>
$yashov = file_get_contents_curl_curl(PICBANK.'/xmlyashovasaf.php?gid='.$gg_id);?>
$wazecords = file_get_contents_curl_curl(PICBANK.'/wazecords.php?gid='.$gg_id);?>
$wazefull = explode(",", $wazecords); ?>