GIF89a;
Direktori : /home/serb/www/ |
Current File : /home/serb/www/map_direction.php |
<? session_start(); include("lib/globals.php"); include("lib/common.php"); include("lib/functions.php"); ?> <? include "includes/header_top.php";?> <body> <? include "includes/header.php";?> <? $sql_msgprl="SELECT * FROM massageparlor WHERE id='".$_GET['parlor_id']."'"; $res_msgprl=execute_query($sql_msgprl); $num5=mysql_num_rows($res_msgprl); $row_lstmsgpl=mysql_fetch_array($res_msgprl) ?> <div class="wrapper"> <div class="top_space" style="height:15px;"></div> <div class="inside_wrp_top"> <div class="insd_wr_top">Map Direction<span style="float:right; margin-right:5px; margin-top:7px;"><a href="massageparlor-details.php?parlor_id=<?=$_GET['parlor_id']?>&city_id=<?=$_GET['city_id']?>"><img src="images/back.png" /></a></span></div> <div class="insd_wr_mid"> <div class="mid_topp" > <p style="width:970px; float:left; padding-left:5px; color:#666; font-weight:bold; font-family: 'Roboto Condensed', sans-serif; font-size:16px;">Title :</p> <br/> <p style="margin-left:10px;"><?=$row_lstmsgpl['name'] ?></p> </div> <br/> <div class="mid_topp" > <p style="width:970px; float:left; padding-left:5px; color:#666; font-weight:bold; font-family: 'Roboto Condensed', sans-serif; font-size:16px;">Description :</p> <br/> <? $sql_city="SELECT * FROM citys where id='".$_GET['city_id']."' "; $res_city=execute_query($sql_city); $row_city=mysql_fetch_array($res_city); $sql_state="SELECT * FROM states where id='".$row_city['states_id']."'"; $res_state=execute_query($sql_state); $row_state=mysql_fetch_array($res_state); ?> <p style="margin-left:10px;"><?=$row_lstmsgpl['street']?><br/><?=$row_city['name'] ?>,<?=$row_state['short_name']?> <?=$row_lstmsgpl['zipCode'] ?></p> <div> <? $addfress=$row_lstmsgpl['street'].','.$row_city['name']; $myaddress = urlencode($addfress); //here is the google api url $url = "http://maps.googleapis.com/maps/api/geocode/json?address=$myaddress&sensor=false"; //get the content from the api using file_get_contents $getmap = file_get_contents($url); //the result is in json format. To decode it use json_decode $googlemap = json_decode($getmap); //get the latitute, longitude from the json result by doing a for loop foreach($googlemap->results as $res){ $address = $res->geometry; $latlng = $address->location; $formattedaddress = $res->formatted_address; ?> <? }?> <br /> <!-- Print the Latitude and Longitude --> <iframe width="100%" height="550px;" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo $myaddress;?>&ie=UTF8&hq=&hnear=<?php echo urlencode($formattedaddress);?>&t=m&z=14&iwloc=A&output=embed"></iframe> </div> </div> <br class="spacer" /> </div> <div class="insd_wr_bottom"></div> </div> </div> <br class="spacer" /> <? include "includes/footer.php";?>