@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | $orderParameters=Order::fromArray(array( |
| 17 | - "scheduled_for_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
| 18 | - "offset" => 0, |
|
| 19 | - "limit" => 5 |
|
| 17 | + "scheduled_for_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
| 18 | + "offset" => 0, |
|
| 19 | + "limit" => 5 |
|
| 20 | 20 | )); |
| 21 | 21 | |
| 22 | 22 | $order = new Order(); |
@@ -24,6 +24,6 @@ discard block |
||
| 24 | 24 | $response = $order->getOrder($orderParameters); |
| 25 | 25 | |
| 26 | 26 | foreach ($response['results'] as $key => $order) { |
| 27 | - Route4Me::simplePrint($order); |
|
| 28 | - echo "<br>"; |
|
| 27 | + Route4Me::simplePrint($order); |
|
| 28 | + echo "<br>"; |
|
| 29 | 29 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -13,8 +13,8 @@ discard block |
||
| 13 | 13 | // This example not available for demo API key |
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | -$orderParameters=Order::fromArray(array( |
|
| 17 | - "scheduled_for_YYMMDD" => date("Y-m-d", strtotime( '-1 days' )), |
|
| 16 | +$orderParameters = Order::fromArray(array( |
|
| 17 | + "scheduled_for_YYMMDD" => date("Y-m-d", strtotime('-1 days')), |
|
| 18 | 18 | "offset" => 0, |
| 19 | 19 | "limit" => 5 |
| 20 | 20 | )); |
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | $randomOrder['address_2']="Lviv"; |
| 28 | 28 | $randomOrder['EXT_FIELD_phone']="032268593"; |
| 29 | 29 | $randomOrder['EXT_FIELD_custom_data']=array( |
| 30 | - 0 => array( |
|
| 31 | - "customer_no" => "11" |
|
| 32 | - ) |
|
| 33 | - ); |
|
| 30 | + 0 => array( |
|
| 31 | + "customer_no" => "11" |
|
| 32 | + ) |
|
| 33 | + ); |
|
| 34 | 34 | |
| 35 | 35 | $response = $order->updateOrder($randomOrder); |
| 36 | 36 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | assert(!is_null($randomOrder), "Can't retrieve a random order"); |
| 25 | 25 | |
| 26 | 26 | // Update the order |
| 27 | -$randomOrder['address_2']="Lviv"; |
|
| 28 | -$randomOrder['EXT_FIELD_phone']="032268593"; |
|
| 29 | -$randomOrder['EXT_FIELD_custom_data']=array( |
|
| 27 | +$randomOrder['address_2'] = "Lviv"; |
|
| 28 | +$randomOrder['EXT_FIELD_phone'] = "032268593"; |
|
| 29 | +$randomOrder['EXT_FIELD_custom_data'] = array( |
|
| 30 | 30 | 0 => array( |
| 31 | 31 | "customer_no" => "11" |
| 32 | 32 | ) |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | $orderParameters=Order::fromArray(array( |
| 17 | - "query" => "Automated Order", |
|
| 18 | - "offset" => 0, |
|
| 19 | - "limit" => 5 |
|
| 17 | + "query" => "Automated Order", |
|
| 18 | + "offset" => 0, |
|
| 19 | + "limit" => 5 |
|
| 20 | 20 | )); |
| 21 | 21 | |
| 22 | 22 | $order = new Order(); |
@@ -24,6 +24,6 @@ discard block |
||
| 24 | 24 | $response = $order->getOrder($orderParameters); |
| 25 | 25 | |
| 26 | 26 | foreach ($response['results'] as $key => $order) { |
| 27 | - Route4Me::simplePrint($order); |
|
| 28 | - echo "<br>"; |
|
| 27 | + Route4Me::simplePrint($order); |
|
| 28 | + echo "<br>"; |
|
| 29 | 29 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // This example not available for demo API key |
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | -$orderParameters=Order::fromArray(array( |
|
| 16 | +$orderParameters = Order::fromArray(array( |
|
| 17 | 17 | "query" => "Automated Order", |
| 18 | 18 | "offset" => 0, |
| 19 | 19 | "limit" => 5 |
@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | 16 | $orderParameters=Order::fromArray(array( |
| 17 | - "fields" => "order_id,member_id", |
|
| 18 | - "offset" => 0, |
|
| 19 | - "limit" => 5 |
|
| 17 | + "fields" => "order_id,member_id", |
|
| 18 | + "offset" => 0, |
|
| 19 | + "limit" => 5 |
|
| 20 | 20 | )); |
| 21 | 21 | |
| 22 | 22 | $order = new Order(); |
@@ -24,5 +24,5 @@ discard block |
||
| 24 | 24 | $response = $order->getOrder($orderParameters); |
| 25 | 25 | |
| 26 | 26 | foreach ($response as $key => $order) { |
| 27 | - Route4Me::simplePrint($order); |
|
| 27 | + Route4Me::simplePrint($order); |
|
| 28 | 28 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | // This example not available for demo API key |
| 14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
| 15 | 15 | |
| 16 | -$orderParameters=Order::fromArray(array( |
|
| 16 | +$orderParameters = Order::fromArray(array( |
|
| 17 | 17 | "fields" => "order_id,member_id", |
| 18 | 18 | "offset" => 0, |
| 19 | 19 | "limit" => 5 |
@@ -26,9 +26,9 @@ |
||
| 26 | 26 | |
| 27 | 27 | // Add an order to an optimization |
| 28 | 28 | $orderParameters=array( |
| 29 | - "optimization_problem_id" => $optimizationProblemId, |
|
| 30 | - "redirect" => 0, |
|
| 31 | - "device_type" => "web", |
|
| 29 | + "optimization_problem_id" => $optimizationProblemId, |
|
| 30 | + "redirect" => 0, |
|
| 31 | + "device_type" => "web", |
|
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | $jfile = file_get_contents("add_order_to_optimization_data.json"); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | assert(!is_null($optimizationProblemId), "Can't retrieve a random optimization problem ID"); |
| 26 | 26 | |
| 27 | 27 | // Add an order to an optimization |
| 28 | -$orderParameters=array( |
|
| 28 | +$orderParameters = array( |
|
| 29 | 29 | "optimization_problem_id" => $optimizationProblemId, |
| 30 | 30 | "redirect" => 0, |
| 31 | 31 | "device_type" => "web", |
@@ -37,6 +37,6 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $order = new Order(); |
| 39 | 39 | |
| 40 | -$response = $order->addOrder2Optimization($orderParameters,$body); |
|
| 40 | +$response = $order->addOrder2Optimization($orderParameters, $body); |
|
| 41 | 41 | |
| 42 | 42 | Route4Me::simplePrint($response); |
@@ -30,10 +30,10 @@ |
||
| 30 | 30 | |
| 31 | 31 | // Remove 2 random orders |
| 32 | 32 | $orderParameters = Order::fromArray(array( |
| 33 | - 'order_ids' => array ( |
|
| 34 | - 0 => $randomOrderID1, |
|
| 35 | - 1 => $randomOrderID2, |
|
| 36 | - ) |
|
| 33 | + 'order_ids' => array ( |
|
| 34 | + 0 => $randomOrderID1, |
|
| 35 | + 1 => $randomOrderID2, |
|
| 36 | + ) |
|
| 37 | 37 | )); |
| 38 | 38 | |
| 39 | 39 | $response = $order->removeOrder($orderParameters); |
@@ -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 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // Remove 2 random orders |
| 32 | 32 | $orderParameters = Order::fromArray(array( |
| 33 | - 'order_ids' => array ( |
|
| 33 | + 'order_ids' => array( |
|
| 34 | 34 | 0 => $randomOrderID1, |
| 35 | 35 | 1 => $randomOrderID2, |
| 36 | 36 | ) |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | |
| 26 | 26 | // Add an order to a route |
| 27 | 27 | $orderParameters=Order::fromArray(array( |
| 28 | - "route_id" => $routeID, |
|
| 29 | - "redirect" => 0, |
|
| 28 | + "route_id" => $routeID, |
|
| 29 | + "redirect" => 0, |
|
| 30 | 30 | )); |
| 31 | 31 | |
| 32 | 32 | $jfile = file_get_contents("add_order_to_route_data.json"); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Route4Me; |
| 3 | 3 | |
| 4 | -$root=realpath(dirname(__FILE__).'/../../'); |
|
| 4 | +$root = realpath(dirname(__FILE__).'/../../'); |
|
| 5 | 5 | require $root.'/vendor/autoload.php'; |
| 6 | 6 | |
| 7 | 7 | use Route4Me\Route4Me; |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | // Get random route ID |
| 20 | 20 | $route = new Route(); |
| 21 | 21 | |
| 22 | -$routeID=$route->getRandomRouteId(0, 10); |
|
| 22 | +$routeID = $route->getRandomRouteId(0, 10); |
|
| 23 | 23 | |
| 24 | 24 | assert(!is_null($routeID), "Can't retrieve a random route ID"); |
| 25 | 25 | |
| 26 | 26 | // Add an order to a route |
| 27 | -$orderParameters=Order::fromArray(array( |
|
| 27 | +$orderParameters = Order::fromArray(array( |
|
| 28 | 28 | "route_id" => $routeID, |
| 29 | 29 | "redirect" => 0, |
| 30 | 30 | )); |
@@ -35,6 +35,6 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | $order = new Order(); |
| 37 | 37 | |
| 38 | -$response = $order->addOrder2Route($orderParameters,$body); |
|
| 38 | +$response = $order->addOrder2Route($orderParameters, $body); |
|
| 39 | 39 | |
| 40 | 40 | Route4Me::simplePrint($response); |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | $territory = new Territory(); |
| 16 | 16 | $territory->type = TerritoryTypes::CIRCLE; |
| 17 | 17 | $territory->data = array ( |
| 18 | - "37.569752822786455,-77.47833251953125", |
|
| 19 | - "5000" |
|
| 18 | + "37.569752822786455,-77.47833251953125", |
|
| 19 | + "5000" |
|
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | 22 | $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
| 23 | - "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000,99999)), |
|
| 24 | - "territory_color" => "ff7700", |
|
| 25 | - "territory" => $territory |
|
| 23 | + "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000,99999)), |
|
| 24 | + "territory_color" => "ff7700", |
|
| 25 | + "territory" => $territory |
|
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | 28 | $avoidancezone = new AvoidanceZone(); |
@@ -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\Enum\TerritoryTypes; |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | |
| 15 | 15 | $territory = new Territory(); |
| 16 | 16 | $territory->type = TerritoryTypes::CIRCLE; |
| 17 | -$territory->data = array ( |
|
| 17 | +$territory->data = array( |
|
| 18 | 18 | "37.569752822786455,-77.47833251953125", |
| 19 | 19 | "5000" |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | 22 | $AvoisanceZoneParameters = AvoidanceZone::fromArray(array( |
| 23 | - "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000,99999)), |
|
| 23 | + "territory_name" => "Test Circle Avoidance Zone ".strval(rand(10000, 99999)), |
|
| 24 | 24 | "territory_color" => "ff7700", |
| 25 | 25 | "territory" => $territory |
| 26 | 26 | )); |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | $territory = new Territory(); |
| 16 | 16 | $territory->type = TerritoryTypes::RECT; |
| 17 | 17 | $territory->data = array ( |
| 18 | - "43.51668853502909,-109.3798828125", |
|
| 19 | - "46.98025235521883,-101.865234375" |
|
| 18 | + "43.51668853502909,-109.3798828125", |
|
| 19 | + "46.98025235521883,-101.865234375" |
|
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | 22 | $AvoidanceZoneParameters = AvoidanceZone::fromArray(array( |
| 23 | - "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000,99999)), |
|
| 24 | - "territory_color" => "ff7700", |
|
| 25 | - "territory" => $territory |
|
| 23 | + "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000,99999)), |
|
| 24 | + "territory_color" => "ff7700", |
|
| 25 | + "territory" => $territory |
|
| 26 | 26 | )); |
| 27 | 27 | |
| 28 | 28 | $avoidancezone = new AvoidanceZone(); |
@@ -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\Enum\TerritoryTypes; |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | // Example refers to the process of creating Avoidance Zone with rectangular shape |
| 14 | 14 | |
| 15 | 15 | $territory = new Territory(); |
| 16 | -$territory->type = TerritoryTypes::RECT; |
|
| 17 | -$territory->data = array ( |
|
| 16 | +$territory->type = TerritoryTypes::RECT; |
|
| 17 | +$territory->data = array( |
|
| 18 | 18 | "43.51668853502909,-109.3798828125", |
| 19 | 19 | "46.98025235521883,-101.865234375" |
| 20 | 20 | ); |
| 21 | 21 | |
| 22 | 22 | $AvoidanceZoneParameters = AvoidanceZone::fromArray(array( |
| 23 | - "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000,99999)), |
|
| 23 | + "territory_name" => "Test Rectangular Avoidance Zone ".strval(rand(10000, 99999)), |
|
| 24 | 24 | "territory_color" => "ff7700", |
| 25 | 25 | "territory" => $territory |
| 26 | 26 | )); |