public function post_index()
 {
     $address = Input::get('address');
     $address = urlencode($address);
     $loc = geocoder::getLocation($address);
     return View::make('geocode')->with('lng', $loc['lng'])->with('lat', $loc['lat']);
 }
Esempio n. 2
0
$lat16 = $loc16[lat];
$lng16 = $loc16[lng];
$address17 = urlencode($locationName17);
$loc17 = geocoder::getLocation($address17);
$lat17 = $loc17[lat];
$lng17 = $loc17[lng];
$address18 = urlencode($locationName18);
$loc18 = geocoder::getLocation($address18);
$lat18 = $loc18[lat];
$lng18 = $loc18[lng];
$address19 = urlencode($locationName19);
$loc19 = geocoder::getLocation($address19);
$lat19 = $loc19[lat];
$lng19 = $loc19[lng];
$address20 = urlencode($locationName20);
$loc20 = geocoder::getLocation($address20);
$lat20 = $loc20[lat];
$lng20 = $loc20[lng];
?>

<?php 
if (!empty($_POST['address1'])) {
    ?>
<div class="row-fluid">
    <div class="span2"></div>
    <div class="span8">
        <div class="well" style="background-color: #ffffff; border: 2px solid #1fbad6;text-align:center;">
        


<?php 
Esempio n. 3
0
                 break;
             }
             //end if loctype = locality
             if ($i == $length - 1) {
                 //if last element and no loc type then move to next loc type and start over
                 $i_type++;
             }
             $i++;
             sleep(2);
             //give geocoder a rest so no over_query_limit error
         }
         //end foreach locs
     } while (!$match);
     //end do while no loc types match
 } else {
     $location = geocoder::getLocation($loc);
     $formatted_address = geocoder::getFormatted($loc);
 }
 $lat = $location['lat'];
 $lng = $location['lng'];
 /*echo "location array: ";
 		print_r($location); //////////////////debug
 		echo "<br/>formated address: " . $formatted_address;	 ////////////////////////debug* /
 		
 		$locs = explode(',', $loc); //create an array of locations delimited by comma
 		echo "<br/>locations delimited: ";
 		print_r($locs);
 		foreach($locs as $value){
 			$one = urlencode($value);
 			echo "<br/>urlencoded: " .  $one;
 			echo "<br/>types: " . geocoder::getLocType($one);
Esempio n. 4
0
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Message>Thank you for contacting us! Please remember to have your message be in the form: location/disability/problem you're facing/name(optional)</Message>
</Response>
<?php 
include 'mapsclass.php';
include 'stringparse.php';
$servername = "ec2-54-170-43-20.eu-west-1.compute.amazonaws.com";
$username = "******";
$password = "******";
$dbname = "add_db";
$smsstring = $_REQUEST['Body'];
$checkflag = checkparse($smsstring);
$parsed = parsetolist($smsstring);
$address = urlencode($parsed[0]);
$loc = geocoder::getLocation($address);
$numberstring = $_REQUEST['From'];
if (sizeof($parsed) > 3) {
    $nameout = $parsed[3];
} else {
    $nameout = 'NA';
}
$conn = new mysqli($servername, $username, $password, $dbname);
$sql = "INSERT INTO RawSMSData(`msg_contents`,`phone_number`) \n\tVALUES('{$smsstring}','{$numberstring}');";
$conn->query($sql);
$last_id = $conn->insert_id;
$sql = "INSERT INTO Report(`sms_id`,`disability_prose`,`location_prose`,`problem_prose`,`lat`,`long`,`location_is_precise`,`time_sent`,`requires_editing`,`is_solved`,`time_updated`,`name`) \n\tVALUES({$last_id},'{$parsed['1']}','{$parsed['0']}','{$parsed['2']}',{$loc['lat']},{$loc['lng']},0,NOW(),{$checkflag},0,NOW(),'{$nameout}');";
$conn->query($sql);
$conn->close();