function mapTypeURL($type) { return moveURL(long(), lat(), zoom(), $type); } function selfURL() { return moveURL(long(), lat(), zoom(), maptype()); } function moveURL($long, $lat, $zoom, $maptype) { $params = array("zoom" => $zoom, "long" => $long, "lat" => $lat, "maptype" => $maptype, "loc" => (int) $_REQUEST['loc']); return "detail.php?" . http_build_query($params); } $tabs = new Tabs(selfURL(), "tab", array("Map")); $tabs_html = $tabs->html(); $tab = $tabs->active(); $tab = tab(); $width = pix("x", $phone); $height = pix("y", $phone); $parent = false; if ($_REQUEST['loc']) { $db = new db(); $stmt = $db->connection->prepare("SELECT * FROM Buildings WHERE id = " . $_REQUEST['loc']); $stmt->execute(); $data = $stmt->fetchAll(); } if ($data[0]['parent'] != '') { $db = new db(); $stmt_1 = $db->connection->prepare("SELECT * FROM Buildings WHERE id = " . $data[0]['parent']); $stmt_1->execute(); $parent_data = $stmt_1->fetchAll();