@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
14 | 14 | |
15 | 15 | $gcParameters = (array)Geocoding::fromArray(array( |
16 | - "zipcode" => '00601', |
|
17 | - "housenumber" => 17, |
|
18 | - "offset" => 0, |
|
19 | - "limit" => 10 |
|
16 | + "zipcode" => '00601', |
|
17 | + "housenumber" => 17, |
|
18 | + "offset" => 0, |
|
19 | + "limit" => 10 |
|
20 | 20 | )); |
21 | 21 | |
22 | 22 | $geocoding = new Geocoding(); |
@@ -24,6 +24,6 @@ discard block |
||
24 | 24 | $response = $geocoding->getService($gcParameters); |
25 | 25 | |
26 | 26 | foreach ($response as $gcode) { |
27 | - Route4Me::simplePrint($gcode); |
|
28 | - echo "<br>"; |
|
27 | + Route4Me::simplePrint($gcode); |
|
28 | + echo "<br>"; |
|
29 | 29 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Geocoding; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
14 | 14 | |
15 | 15 | $gcParameters = (array)Geocoding::fromArray(array( |
16 | - "zipcode" => '00601' |
|
16 | + "zipcode" => '00601' |
|
17 | 17 | )); |
18 | 18 | |
19 | 19 | $geocoding = new Geocoding(); |
@@ -21,6 +21,6 @@ discard block |
||
21 | 21 | $response = $geocoding->getZipCode($gcParameters); |
22 | 22 | |
23 | 23 | foreach ($response as $gcode) { |
24 | - Route4Me::simplePrint($gcode); |
|
25 | - echo "<br>"; |
|
24 | + Route4Me::simplePrint($gcode); |
|
25 | + echo "<br>"; |
|
26 | 26 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Geocoding; |
@@ -13,16 +13,16 @@ discard block |
||
13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
14 | 14 | |
15 | 15 | $addressList = array( |
16 | - "Los Angeles International Airport, CA", |
|
17 | - "n512,Florida Pl,Barberton,OH,44203", |
|
18 | - "3495,Purdue St,Cuyahoga Falls,OH,44221" |
|
16 | + "Los Angeles International Airport, CA", |
|
17 | + "n512,Florida Pl,Barberton,OH,44203", |
|
18 | + "3495,Purdue St,Cuyahoga Falls,OH,44221" |
|
19 | 19 | ); |
20 | 20 | |
21 | 21 | $addressesString = implode('\n', $addressList); |
22 | 22 | |
23 | 23 | $geocodingParameters = array( |
24 | - 'strExportFormat' => 'json', |
|
25 | - 'addresses' => $addressesString |
|
24 | + 'strExportFormat' => 'json', |
|
25 | + 'addresses' => $addressesString |
|
26 | 26 | ); |
27 | 27 | |
28 | 28 | $fGeoCoding = new Geocoding(); |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | $bgResults = $fGeoCoding->forwardGeocoding($geocodingParameters); |
31 | 31 | |
32 | 32 | if ($geocodingParameters['strExportFormat'] == 'json') { |
33 | - foreach ($bgResults as $bgResult) { |
|
34 | - Route4Me::simplePrint($bgResult); |
|
35 | - echo "<br>"; |
|
36 | - } |
|
33 | + foreach ($bgResults as $bgResult) { |
|
34 | + Route4Me::simplePrint($bgResult); |
|
35 | + echo "<br>"; |
|
36 | + } |
|
37 | 37 | } else { |
38 | - foreach ($bgResults['destination'] as $bgResult) { |
|
39 | - Route4Me::simplePrint($bgResult); |
|
40 | - echo "<br>"; |
|
41 | - } |
|
38 | + foreach ($bgResults['destination'] as $bgResult) { |
|
39 | + Route4Me::simplePrint($bgResult); |
|
40 | + echo "<br>"; |
|
41 | + } |
|
42 | 42 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $bgResults = $fGeoCoding->forwardGeocoding($geocodingParameters); |
31 | 31 | |
32 | -if ($geocodingParameters['strExportFormat'] == 'json') { |
|
32 | +if ($geocodingParameters['strExportFormat']=='json') { |
|
33 | 33 | foreach ($bgResults as $bgResult) { |
34 | 34 | Route4Me::simplePrint($bgResult); |
35 | 35 | echo "<br>"; |
@@ -27,15 +27,15 @@ |
||
27 | 27 | |
28 | 28 | // Add a custom note to a route |
29 | 29 | $noteParameters = array( |
30 | - 'route_id' => $routeId, |
|
31 | - 'address_id' => $route_destination_id, |
|
32 | - 'format' => 'json', |
|
33 | - 'dev_lat' => 33.132675170898, |
|
34 | - 'dev_lng' => -83.244743347168, |
|
35 | - 'custom_note_type[11]' => 'slippery', |
|
36 | - 'custom_note_type[10]' => 'Backdoor', |
|
37 | - 'strUpdateType' => 'dropoff', |
|
38 | - 'strNoteContents' => 'test1111' |
|
30 | + 'route_id' => $routeId, |
|
31 | + 'address_id' => $route_destination_id, |
|
32 | + 'format' => 'json', |
|
33 | + 'dev_lat' => 33.132675170898, |
|
34 | + 'dev_lng' => -83.244743347168, |
|
35 | + 'custom_note_type[11]' => 'slippery', |
|
36 | + 'custom_note_type[10]' => 'Backdoor', |
|
37 | + 'strUpdateType' => 'dropoff', |
|
38 | + 'strNoteContents' => 'test1111' |
|
39 | 39 | ); |
40 | 40 | |
41 | 41 | $address = new Address(); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -12,12 +12,12 @@ |
||
12 | 12 | |
13 | 13 | // Create a custom note type |
14 | 14 | $noteParameters=array( |
15 | - "type" => 'To Do', |
|
16 | - "values" => array( |
|
17 | - 'Pass a package', |
|
18 | - 'Pickup package', |
|
19 | - 'Do a service' |
|
20 | - ) |
|
15 | + "type" => 'To Do', |
|
16 | + "values" => array( |
|
17 | + 'Pass a package', |
|
18 | + 'Pickup package', |
|
19 | + 'Do a service' |
|
20 | + ) |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | $address = new Address(); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | // Create a custom note type |
14 | -$noteParameters=array( |
|
14 | +$noteParameters = array( |
|
15 | 15 | "type" => 'To Do', |
16 | 16 | "values" => array( |
17 | 17 | 'Pass a package', |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | // Remove a custom note type |
27 | 27 | $noteParameters = array( |
28 | - "id" => $randomCustomNoteID |
|
28 | + "id" => $randomCustomNoteID |
|
29 | 29 | ); |
30 | 30 | |
31 | 31 | $address = new Address(); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | $customNotes = $address->getAllCustomNoteTypes(); |
20 | 20 | |
21 | 21 | assert(!is_null($customNotes), "Can't retrieve all custom note types"); |
22 | -assert(sizeof($customNotes) > 0, "There is no custom note type in the user's account"); |
|
22 | +assert(sizeof($customNotes)>0, "There is no custom note type in the user's account"); |
|
23 | 23 | |
24 | -$randomCustomNoteID = $customNotes[rand(0,sizeof($customNotes)-1)]['note_custom_type_id']; |
|
24 | +$randomCustomNoteID = $customNotes[rand(0, sizeof($customNotes) - 1)]['note_custom_type_id']; |
|
25 | 25 | |
26 | 26 | // Remove a custom note type |
27 | 27 | $noteParameters = array( |
@@ -27,13 +27,13 @@ |
||
27 | 27 | |
28 | 28 | // Add an address note |
29 | 29 | $noteParameters = array( |
30 | - "route_id" => $route_id, |
|
31 | - "address_id" => $route_destination_id, |
|
32 | - "dev_lat" => 33.132675170898, |
|
33 | - "dev_lng" => -83.244743347168, |
|
34 | - "device_type" => "web", |
|
35 | - "strUpdateType" => "dropoff", |
|
36 | - "strNoteContents" => "Test" |
|
30 | + "route_id" => $route_id, |
|
31 | + "address_id" => $route_destination_id, |
|
32 | + "dev_lat" => 33.132675170898, |
|
33 | + "dev_lng" => -83.244743347168, |
|
34 | + "device_type" => "web", |
|
35 | + "strUpdateType" => "dropoff", |
|
36 | + "strNoteContents" => "Test" |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | $address = new Address(); |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -27,13 +27,13 @@ |
||
27 | 27 | |
28 | 28 | // Add a file note |
29 | 29 | $noteParameters=array( |
30 | - "strFilename" => "notes.csv", |
|
31 | - "route_id" => $route_id, |
|
32 | - "address_id" => $route_destination_id, |
|
33 | - "dev_lat" => 33.132675170898, |
|
34 | - "dev_lng" => -83.244743347168, |
|
35 | - "device_type" => "web", |
|
36 | - "strUpdateType" => "ANY_FILE" |
|
30 | + "strFilename" => "notes.csv", |
|
31 | + "route_id" => $route_id, |
|
32 | + "address_id" => $route_destination_id, |
|
33 | + "dev_lat" => 33.132675170898, |
|
34 | + "dev_lng" => -83.244743347168, |
|
35 | + "device_type" => "web", |
|
36 | + "strUpdateType" => "ANY_FILE" |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | $address = new Address(); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | assert(!is_null($route_destination_id), "Can't retrieve random address"); |
27 | 27 | |
28 | 28 | // Add a file note |
29 | -$noteParameters=array( |
|
29 | +$noteParameters = array( |
|
30 | 30 | "strFilename" => "notes.csv", |
31 | 31 | "route_id" => $route_id, |
32 | 32 | "address_id" => $route_destination_id, |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | |
29 | 29 | // Add an address note |
30 | 30 | $noteParameters = array( |
31 | - "route_id" => $route_id, |
|
32 | - "address_id" => $route_destination_id, |
|
33 | - "dev_lat" => 33.132675170898, |
|
34 | - "dev_lng" => -83.244743347168, |
|
35 | - "device_type" => "web", |
|
36 | - "strUpdateType" => "dropoff", |
|
37 | - "strNoteContents" => "Test ". time() |
|
31 | + "route_id" => $route_id, |
|
32 | + "address_id" => $route_destination_id, |
|
33 | + "dev_lat" => 33.132675170898, |
|
34 | + "dev_lng" => -83.244743347168, |
|
35 | + "device_type" => "web", |
|
36 | + "strUpdateType" => "dropoff", |
|
37 | + "strNoteContents" => "Test ". time() |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | $address = new Address(); |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | |
46 | 46 | // Get address notes |
47 | 47 | $noteParameters = array( |
48 | - "route_id" => $route_id, |
|
49 | - "route_destination_id" => $route_destination_id |
|
48 | + "route_id" => $route_id, |
|
49 | + "route_destination_id" => $route_destination_id |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | $address = new Address(); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | echo "Destination note count --> ".$notes['destination_note_count']."<br>"; |
57 | 57 | |
58 | 58 | foreach ($notes['notes'] as $note) { |
59 | - echo "========== Notes ==================<br>"; |
|
60 | - echo "note_id --> ".$note['note_id']."<br>"; |
|
61 | - $content = isset($note['contents']) ? $note['contents'] : ""; |
|
62 | - if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
59 | + echo "========== Notes ==================<br>"; |
|
60 | + echo "note_id --> ".$note['note_id']."<br>"; |
|
61 | + $content = isset($note['contents']) ? $note['contents'] : ""; |
|
62 | + if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
63 | 63 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | -$root = realpath(dirname(__FILE__) . '/../../'); |
|
5 | -require $root . '/vendor/autoload.php'; |
|
4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
5 | +require $root.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | use Route4Me\Route4Me; |
8 | 8 | use Route4Me\Route; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | "dev_lng" => -83.244743347168, |
35 | 35 | "device_type" => "web", |
36 | 36 | "strUpdateType" => "dropoff", |
37 | - "strNoteContents" => "Test ". time() |
|
37 | + "strNoteContents" => "Test ".time() |
|
38 | 38 | ); |
39 | 39 | |
40 | 40 | $address = new Address(); |
@@ -59,5 +59,7 @@ |
||
59 | 59 | echo "========== Notes ==================<br>"; |
60 | 60 | echo "note_id --> ".$note['note_id']."<br>"; |
61 | 61 | $content = isset($note['contents']) ? $note['contents'] : ""; |
62 | - if (strlen($content)>0) echo "contents --> $content"."<br>"; |
|
63 | -} |
|
62 | + if (strlen($content)>0) { |
|
63 | + echo "contents --> $content"."<br>"; |
|
64 | + } |
|
65 | + } |