@@ -31,8 +31,8 @@ |
||
| 31 | 31 | $route->parameters = new \stdClass(); |
| 32 | 32 | |
| 33 | 33 | $route->parameters->custom_fields = array( |
| 34 | - "animal" => "tiger", |
|
| 35 | - "bird" => "canary" |
|
| 34 | + "animal" => "tiger", |
|
| 35 | + "bird" => "canary" |
|
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | 38 | $route->httpheaders = 'Content-type: application/json'; |
@@ -31,38 +31,38 @@ |
||
| 31 | 31 | $route->parameters = new \stdClass(); |
| 32 | 32 | |
| 33 | 33 | $route->addresses = array( Address::fromArray(array( |
| 34 | - "alias" => "new address alias", |
|
| 35 | - "first_name" => "Edi", |
|
| 36 | - "last_name" => "Jacobson", |
|
| 37 | - "address" => "230 Arbor Way Milledgeville GA 31061", |
|
| 38 | - "is_depot" => false, |
|
| 39 | - "lat" => 33.129695892334, |
|
| 40 | - "lng" => -83.24577331543, |
|
| 41 | - "sequence_no" => 9, |
|
| 42 | - "is_visited" => true, |
|
| 43 | - "is_departed" => false, |
|
| 44 | - "timestamp_last_visited" => 36000, |
|
| 45 | - "timestamp_last_departed" => null, |
|
| 46 | - "customer_po" => "po_131324566", |
|
| 47 | - "invoice_no" => "in549874", |
|
| 48 | - "reference_no" => "7988544", |
|
| 49 | - "order_no" => "on654754", |
|
| 50 | - "order_id" => 4564, |
|
| 51 | - "weight" => 45, |
|
| 52 | - "cost" => 55.60, |
|
| 53 | - "revenue" => 75.80, |
|
| 54 | - "cube" => 3, |
|
| 55 | - "pieces" => 30, |
|
| 56 | - "email" => "[email protected]", |
|
| 57 | - "phone" => "111-222-333", |
|
| 58 | - "time_window_start" => 36600, |
|
| 59 | - "time_window_end" => 37200, |
|
| 60 | - "time" => 600, |
|
| 61 | - "priority" => 1, |
|
| 62 | - "curbside_lat" => 33.129695892334, |
|
| 63 | - "curbside_lng" => -83.24577331543, |
|
| 64 | - "time_window_start_2" => 39400, |
|
| 65 | - "time_window_end_2" => 40000 |
|
| 34 | + "alias" => "new address alias", |
|
| 35 | + "first_name" => "Edi", |
|
| 36 | + "last_name" => "Jacobson", |
|
| 37 | + "address" => "230 Arbor Way Milledgeville GA 31061", |
|
| 38 | + "is_depot" => false, |
|
| 39 | + "lat" => 33.129695892334, |
|
| 40 | + "lng" => -83.24577331543, |
|
| 41 | + "sequence_no" => 9, |
|
| 42 | + "is_visited" => true, |
|
| 43 | + "is_departed" => false, |
|
| 44 | + "timestamp_last_visited" => 36000, |
|
| 45 | + "timestamp_last_departed" => null, |
|
| 46 | + "customer_po" => "po_131324566", |
|
| 47 | + "invoice_no" => "in549874", |
|
| 48 | + "reference_no" => "7988544", |
|
| 49 | + "order_no" => "on654754", |
|
| 50 | + "order_id" => 4564, |
|
| 51 | + "weight" => 45, |
|
| 52 | + "cost" => 55.60, |
|
| 53 | + "revenue" => 75.80, |
|
| 54 | + "cube" => 3, |
|
| 55 | + "pieces" => 30, |
|
| 56 | + "email" => "[email protected]", |
|
| 57 | + "phone" => "111-222-333", |
|
| 58 | + "time_window_start" => 36600, |
|
| 59 | + "time_window_end" => 37200, |
|
| 60 | + "time" => 600, |
|
| 61 | + "priority" => 1, |
|
| 62 | + "curbside_lat" => 33.129695892334, |
|
| 63 | + "curbside_lng" => -83.24577331543, |
|
| 64 | + "time_window_start_2" => 39400, |
|
| 65 | + "time_window_end_2" => 40000 |
|
| 66 | 66 | ))); |
| 67 | 67 | |
| 68 | 68 | $route->httpheaders = 'Content-type: application/json'; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $route->parameters = new \stdClass(); |
| 31 | 31 | |
| 32 | 32 | $route->parameters = array( |
| 33 | - "recompute_directions" => 1 |
|
| 33 | + "recompute_directions" => 1 |
|
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | $route->httpheaders = 'Content-type: application/json'; |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | |
| 22 | 22 | // Resequence all addresses |
| 23 | 23 | $params = array( |
| 24 | - "route_id" => $route_id, |
|
| 25 | - "disable_optimization" => 0, |
|
| 26 | - "optimize" => "Distance" |
|
| 24 | + "route_id" => $route_id, |
|
| 25 | + "disable_optimization" => 0, |
|
| 26 | + "optimize" => "Distance" |
|
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | $resequence = $route->resequenceAllAddresses($params); |
@@ -11,8 +11,8 @@ discard block |
||
| 11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 12 | 12 | |
| 13 | 13 | $RouteParameters = array( |
| 14 | - "limit" => 30, |
|
| 15 | - "offset" => 0 |
|
| 14 | + "limit" => 30, |
|
| 15 | + "offset" => 0 |
|
| 16 | 16 | ); |
| 17 | 17 | |
| 18 | 18 | $route = new Route(); |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | foreach ($routeResults as $routeResult) |
| 23 | 23 | { |
| 24 | - $results = (array)$routeResult; |
|
| 24 | + $results = (array)$routeResult; |
|
| 25 | 25 | |
| 26 | - Route4Me::simplePrint($results); |
|
| 26 | + Route4Me::simplePrint($results); |
|
| 27 | 27 | |
| 28 | - echo "<br>"; |
|
| 28 | + echo "<br>"; |
|
| 29 | 29 | } |
@@ -21,9 +21,9 @@ |
||
| 21 | 21 | |
| 22 | 22 | // Share a route with an email |
| 23 | 23 | $params = array( |
| 24 | - "route_id" => $route_id, |
|
| 25 | - "response_format" => "json", |
|
| 26 | - "recipient_email" => "[email protected]" |
|
| 24 | + "route_id" => $route_id, |
|
| 25 | + "response_format" => "json", |
|
| 26 | + "recipient_email" => "[email protected]" |
|
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | $result = $route->shareRoute($params); |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | $route->parameters = new \stdClass(); |
| 31 | 31 | |
| 32 | 32 | $route->parameters = array( |
| 33 | - "member_id" => $randomRoute->member_id, |
|
| 34 | - "optimize" => "Distance", |
|
| 35 | - "route_max_duration" => "82400", |
|
| 36 | - "route_name" => "updated " . date('m-d-Y') |
|
| 33 | + "member_id" => $randomRoute->member_id, |
|
| 34 | + "optimize" => "Distance", |
|
| 35 | + "route_max_duration" => "82400", |
|
| 36 | + "route_name" => "updated " . date('m-d-Y') |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | $route->httpheaders = 'Content-type: application/json'; |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // Select a terriotry with the addresses from the list |
| 19 | 19 | $params = array( |
| 20 | - "offset" => 0, |
|
| 21 | - "limit" => 50, |
|
| 22 | - "addresses" => 1 |
|
| 20 | + "offset" => 0, |
|
| 21 | + "limit" => 50, |
|
| 22 | + "addresses" => 1 |
|
| 23 | 23 | ); |
| 24 | 24 | |
| 25 | 25 | $results = $territory->getTerritories($params); |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | $territory1 = null; |
| 29 | 29 | |
| 30 | 30 | foreach ($results as $terr) { |
| 31 | - if (isset($terr['addresses'])) { |
|
| 32 | - if (sizeof($terr['addresses'])>0) { |
|
| 33 | - $territory1 = $terr; |
|
| 34 | - break; |
|
| 35 | - } |
|
| 36 | - } |
|
| 31 | + if (isset($terr['addresses'])) { |
|
| 32 | + if (sizeof($terr['addresses'])>0) { |
|
| 33 | + $territory1 = $terr; |
|
| 34 | + break; |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | assert(isset($territory1['territory_id']), "Can't retrieve a random territory ID"); |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | // Get a territory with the addresses |
| 45 | 45 | $params = array( |
| 46 | - "territory_id" => $territory_id, |
|
| 47 | - "addresses" => 1 |
|
| 46 | + "territory_id" => $territory_id, |
|
| 47 | + "addresses" => 1 |
|
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | 50 | $result1 = $territory->getTerritory($params); |
@@ -13,13 +13,13 @@ |
||
| 13 | 13 | $territory = new Territory(); |
| 14 | 14 | |
| 15 | 15 | $queryparameters = array ( |
| 16 | - "offset" => 0, |
|
| 17 | - "limit" => 20 |
|
| 16 | + "offset" => 0, |
|
| 17 | + "limit" => 20 |
|
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | 20 | $response = $territory->getTerritories($queryparameters); |
| 21 | 21 | |
| 22 | 22 | foreach ($response as $terr1) { |
| 23 | 23 | Route4Me::simplePrint($terr1, true); |
| 24 | - echo "<br>"; |
|
| 24 | + echo "<br>"; |
|
| 25 | 25 | } |