@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // Set the api key in the Route4me class |
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | - $params = Member::fromArray(array ( |
|
16 | + $params = Member::fromArray(array( |
|
17 | 17 | "HIDE_ROUTED_ADDRESSES"=> "FALSE", |
18 | 18 | "member_phone"=> "571-259-5939", |
19 | 19 | "member_zipcode"=> "22102", |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // Set the api key in the Route4me class |
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | - $params = Member::fromArray(array ( |
|
16 | + $params = Member::fromArray(array( |
|
17 | 17 | "HIDE_ROUTED_ADDRESSES"=> "FALSE", |
18 | 18 | "member_phone"=> "571-259-5939", |
19 | 19 | "member_zipcode"=> "22102", |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | //require __DIR__.'/../vendor/autoload.php';; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | // Set the api key in the Route4Me class |
12 | 12 | Route4Me::setApiKey('11111111111111111111111111111111'); |
13 | 13 | |
14 | - $route=new Route(); |
|
14 | + $route = new Route(); |
|
15 | 15 | |
16 | - $route_id="5C15E83A4BE005BCD1537955D28D51D7"; |
|
16 | + $route_id = "5C15E83A4BE005BCD1537955D28D51D7"; |
|
17 | 17 | |
18 | 18 | // Note: not every optimization includes information about path points, only thus, which was generated with the parameter route_path_output = "Points" |
19 | 19 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | "route_path_output" => "Points" |
22 | 22 | ); |
23 | 23 | |
24 | - $routeResults=(array)$route->getRoutePoints($route_id,$params); |
|
24 | + $routeResults = (array)$route->getRoutePoints($route_id, $params); |
|
25 | 25 | |
26 | 26 | if (isset($routeResults['addresses'])) { |
27 | 27 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -13,17 +13,17 @@ discard block |
||
13 | 13 | |
14 | 14 | // The example refers to the process of searching for the specified text throughout all routes belonging to the user's account. |
15 | 15 | |
16 | - $RouteParameters=array( |
|
16 | + $RouteParameters = array( |
|
17 | 17 | "query" => 'Tbilisi' |
18 | 18 | ); |
19 | 19 | |
20 | - $route=new Route(); |
|
20 | + $route = new Route(); |
|
21 | 21 | |
22 | - $routeResults=$route->getRoutes(null,$RouteParameters); |
|
22 | + $routeResults = $route->getRoutes(null, $RouteParameters); |
|
23 | 23 | |
24 | 24 | foreach ($routeResults as $routeResult) |
25 | 25 | { |
26 | - $results=(array)$routeResult; |
|
26 | + $results = (array)$routeResult; |
|
27 | 27 | |
28 | 28 | Route4Me::simplePrint($results); |
29 | 29 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -13,23 +13,23 @@ discard block |
||
13 | 13 | // Add Territory and get territory_id |
14 | 14 | //--------------------------------------------------------- |
15 | 15 | $territory = new Territory(); |
16 | - $territory->type = TerritoryTypes::CIRCLE; |
|
17 | - $territory->data = array ( |
|
16 | + $territory->type = TerritoryTypes::CIRCLE; |
|
17 | + $territory->data = array( |
|
18 | 18 | "37.569752822786455,-77.47833251953125", |
19 | 19 | "5000" |
20 | 20 | ); |
21 | 21 | |
22 | - $TerritoryParameters=Territory::fromArray(array( |
|
23 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
22 | + $TerritoryParameters = Territory::fromArray(array( |
|
23 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
24 | 24 | "territory_color" => "ff7700", |
25 | 25 | "territory" => $territory |
26 | 26 | )); |
27 | 27 | |
28 | - $territory=new Territory(); |
|
28 | + $territory = new Territory(); |
|
29 | 29 | |
30 | 30 | $result = (array)$territory->addTerritory($TerritoryParameters); |
31 | 31 | |
32 | - $territory_id=""; |
|
32 | + $territory_id = ""; |
|
33 | 33 | if (isset($result)) { |
34 | 34 | $territory_id = $result["territory_id"]; |
35 | 35 | } else { |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | |
15 | 15 | // Get random route from test routes |
16 | 16 | //-------------------------------------------------------- |
17 | - $route=new Route(); |
|
17 | + $route = new Route(); |
|
18 | 18 | |
19 | - $route_id=$route->getRandomRouteId(0, 10); |
|
19 | + $route_id = $route->getRandomRouteId(0, 10); |
|
20 | 20 | |
21 | 21 | if (is_null($route_id)) { |
22 | 22 | echo "can't retrieve random route_id!.. Try again."; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | // Get random address's id from selected route above |
28 | 28 | //-------------------------------------------------------- |
29 | - $addressRand=(array)$route->GetRandomAddressFromRoute($route_id); |
|
29 | + $addressRand = (array)$route->GetRandomAddressFromRoute($route_id); |
|
30 | 30 | |
31 | 31 | if (isset($addressRand['is_depot'])) |
32 | 32 | { |
@@ -45,18 +45,18 @@ discard block |
||
45 | 45 | } |
46 | 46 | //-------------------------------------------------------- |
47 | 47 | |
48 | - $addressParameters=(array)Address::fromArray(array( |
|
48 | + $addressParameters = (array)Address::fromArray(array( |
|
49 | 49 | "route_id" => $route_id, |
50 | 50 | "route_destination_id" => $address_id, |
51 | 51 | )); |
52 | 52 | |
53 | - $body= array( |
|
53 | + $body = array( |
|
54 | 54 | "is_departed" => TRUE, |
55 | 55 | ); |
56 | 56 | |
57 | - $address=new Address(); |
|
57 | + $address = new Address(); |
|
58 | 58 | |
59 | - $result=$address->markAddress($addressParameters, $body); |
|
59 | + $result = $address->markAddress($addressParameters, $body); |
|
60 | 60 | |
61 | 61 | Route4Me::simplePrint($result); |
62 | 62 | ?> |
63 | 63 | \ No newline at end of file |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | //require __DIR__.'/../vendor/autoload.php';; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Route4Me; |
3 | 3 | |
4 | - $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
4 | + $vdir = $_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
|
5 | 5 | |
6 | 6 | require $vdir.'/../vendor/autoload.php'; |
7 | 7 | //require __DIR__.'/../vendor/autoload.php';; |