<?php require_once 'config.php'; require_once 'src/apiClient.php'; require_once 'src/contrib/apiPlusService.php'; require_once 'src/gMaps.php'; $mysqli = new mysqli(SERVER, USER, PASSWORD, DATABASE); $gmap = new gMaps(MAP_KEY); $client = new apiClient(); $plus = new apiPlusService($client); session_start(); $client->setApplicationName('Globe +'); $client->setClientId(PLUS_CLIENT_ID); $client->setClientSecret(PLUS_CLIENT_SECRET); $client->setRedirectUri(PLUS_REDIRECT_URI); $client->setDeveloperKey(PLUS_DEVELOPPER_KEY); if (isset($_GET['code'])) { $client->authenticate(); $_SESSION['access_token'] = $client->getAccessToken(); header('Location: ' . URL . $_SERVER['PHP_SELF']); } if (isset($_GET['error'])) { header('Location: ' . URL . '?status=error'); die; } if (isset($_SESSION['access_token'])) { $client->setAccessToken($_SESSION['access_token']); } if ($client->getAccessToken()) { $me = $plus->people->get('me'); // These fields are currently filtered through the PHP sanitize filters.
<?php require_once 'gmaps.class.php'; $gmaps = new gMaps(); # Carregar de XML //$gmaps->loadFromXML("markers.xml"); //$gmaps->getMarkers();exit; # Adicionar pin/icons //$gmaps->addIcon("NOME ICON","IMAGEM.EXT","LARGURA","ALTURA"); $gmaps->addIcon("Comercial", "img/icons/Comercial.png", "48", "48"); $gmaps->addIcon("Industrial", "img/icons/Industrial.png", "48", "48"); $gmaps->addIcon("Residencial", "img/icons/Residencial.png", "48", "48"); # Adicionar marcador por latitude e longitute //$gmaps->addMarker("LATITUDE","LONGITUDE","TEXTO HTML","ICON"); //$gmaps->addMarker("LATITUDE","LONGITUDE"); //$gmaps->addMarker("-23.5462057","-46.3022458","<p>Lanchonete Jo�o</p><p><img src=http://tinyurl.com/897xozw /></p><p>R$ 4,50</p>","pizza"); //$gmaps->addMarker("-23.5462057","-46.3022458","<p>Lanchonete Jo�o</p>","pizza"); # Adicionar marcador por CEP e Numero //$gmaps->addMarkerCep("CEP","NUMERO"); //$gmaps->addMarkerCep("08615000","555","<p>Mercado do Jos�</p>","kart"); //$gmaps->addMarkerCep("08665060","110","<p>Imobili�ria do Chico</p>","imovel"); //$gmaps->addMarkerCep("08664580","81","<p>Alguma Coisa Verde</p>","green"); # Adicionar marcador por endereco //$gmaps->addMarkerAddress("RUA, NUMERO, CIDADE, SIGLA UF"); // Define a consulta MySQL include_once 'Models/conecta.php'; $busca = "SELECT * FROM cf_imoveis WHERE imo_destaque= '1' AND imo_website = '1' ORDER BY RAND() LIMIT 6"; // Executa a consulta (query) $query = mysql_query($busca); // Inicia um loop para cada resultado encontrado while ($Imovel = mysql_fetch_array($query)) {