@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | |
26 | 26 | if (isset($addressRand['is_depot'])) |
27 | 27 | { |
28 | - if ($addressRand['is_depot']) { |
|
29 | - echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
30 | - return; |
|
31 | - } |
|
28 | + if ($addressRand['is_depot']) { |
|
29 | + echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
30 | + return; |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // Get random address's id from selected route above |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | // Mark the address as detected as deoarted |
41 | 41 | $addressParameters = (array)Address::fromArray(array( |
42 | - "route_id" => $routeId, |
|
43 | - "route_destination_id" => $route_destination_id, |
|
44 | - "is_departed" => TRUE |
|
42 | + "route_id" => $routeId, |
|
43 | + "route_destination_id" => $route_destination_id, |
|
44 | + "is_departed" => TRUE |
|
45 | 45 | )); |
46 | 46 | |
47 | 47 | $address = new Address(); |
@@ -19,8 +19,8 @@ |
||
19 | 19 | assert(!is_null($route_id), "Can't retrieve a random route ID"); |
20 | 20 | |
21 | 21 | $params = array( |
22 | - 'device_tracking_history' => true, |
|
23 | - 'route_id' => $route_id |
|
22 | + 'device_tracking_history' => true, |
|
23 | + 'route_id' => $route_id |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | // Get route tracking |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | |
19 | 19 | // Select a route with more than 4 addresses. |
20 | 20 | $routesParams = array( |
21 | - "offset" => 0, |
|
22 | - "limit" => 20 |
|
21 | + "offset" => 0, |
|
22 | + "limit" => 20 |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $routes = $route->getRoutes($routesParams); |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | $selectedRoute = null; |
28 | 28 | |
29 | 29 | foreach ($routes as $route1) { |
30 | - if (isset($route1->destination_count)) { |
|
31 | - if ($route1->destination_count>4) { |
|
32 | - $selectedRoute = $route->getRoutes(array('route_id' => $route1->route_id)); |
|
33 | - break; |
|
34 | - } |
|
35 | - } |
|
30 | + if (isset($route1->destination_count)) { |
|
31 | + if ($route1->destination_count>4) { |
|
32 | + $selectedRoute = $route->getRoutes(array('route_id' => $route1->route_id)); |
|
33 | + break; |
|
34 | + } |
|
35 | + } |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | assert(!is_null($selectedRoute), "Can't select a route with more than 4 addresses"); |
@@ -44,19 +44,19 @@ discard block |
||
44 | 44 | echo "Route ID-> $routeID, Route destination ID -> $routeDestinationID <br>"; |
45 | 45 | |
46 | 46 | $params = array( |
47 | - "route_id" => $routeID, |
|
48 | - "route_destination_id" => $routeDestinationID, |
|
49 | - "addresses" => array( |
|
50 | - "0" => array( |
|
51 | - "route_destination_id" => $routeDestinationID, |
|
52 | - "sequence_no" => 3 |
|
53 | - ) |
|
54 | - ) |
|
47 | + "route_id" => $routeID, |
|
48 | + "route_destination_id" => $routeDestinationID, |
|
49 | + "addresses" => array( |
|
50 | + "0" => array( |
|
51 | + "route_destination_id" => $routeDestinationID, |
|
52 | + "sequence_no" => 3 |
|
53 | + ) |
|
54 | + ) |
|
55 | 55 | ); |
56 | 56 | |
57 | 57 | $response = $route->resequenceRoute($params); |
58 | 58 | |
59 | 59 | foreach ($response['addresses'] as $address) { |
60 | - Route4Me::simplePrint($address); |
|
61 | - echo "<br>"; |
|
60 | + Route4Me::simplePrint($address); |
|
61 | + echo "<br>"; |
|
62 | 62 | } |
@@ -23,8 +23,8 @@ |
||
23 | 23 | |
24 | 24 | // Get a route with the directions |
25 | 25 | $params = array( |
26 | - "directions" => 1, |
|
27 | - "route_id" => $route_id |
|
26 | + "directions" => 1, |
|
27 | + "route_id" => $route_id |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | $routeResults = (array)$route->getRoutePoints($params); |
@@ -7,16 +7,16 @@ |
||
7 | 7 | |
8 | 8 | class Track extends Common |
9 | 9 | { |
10 | - public static function set(TrackSetParams $params) |
|
11 | - { |
|
12 | - $allQueryFields = Route4Me::getObjectProperties(new TrackSetParams(), array('tx_id')); |
|
10 | + public static function set(TrackSetParams $params) |
|
11 | + { |
|
12 | + $allQueryFields = Route4Me::getObjectProperties(new TrackSetParams(), array('tx_id')); |
|
13 | 13 | |
14 | - $json = Route4Me::makeRequst(array( |
|
15 | - 'url' => Endpoint::TRACK_SET, |
|
16 | - 'method' => 'GET', |
|
17 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
18 | - )); |
|
14 | + $json = Route4Me::makeRequst(array( |
|
15 | + 'url' => Endpoint::TRACK_SET, |
|
16 | + 'method' => 'GET', |
|
17 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
18 | + )); |
|
19 | 19 | |
20 | - return $json; |
|
21 | - } |
|
20 | + return $json; |
|
21 | + } |
|
22 | 22 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | public static function getTerritory($params) |
42 | 42 | { |
43 | - $allQueryFields = array('territory_id', 'addresses'); |
|
43 | + $allQueryFields = array('territory_id', 'addresses'); |
|
44 | 44 | |
45 | 45 | $territory = Route4Me::makeRequst(array( |
46 | 46 | 'url' => Endpoint::TERRITORY_V4, |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | public static function getTerritories($params) |
55 | 55 | { |
56 | - $allQueryFields = array('offset', 'limit', 'addresses'); |
|
56 | + $allQueryFields = array('offset', 'limit', 'addresses'); |
|
57 | 57 | |
58 | 58 | $response = Route4Me::makeRequst(array( |
59 | 59 | 'url' => Endpoint::TERRITORY_V4, |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | public static function addTerritory($params) |
68 | 68 | { |
69 | - $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
69 | + $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
70 | 70 | |
71 | 71 | $response = Route4Me::makeRequst(array( |
72 | 72 | 'url' => Endpoint::TERRITORY_V4, |
@@ -92,14 +92,14 @@ discard block |
||
92 | 92 | |
93 | 93 | public function updateTerritory($params) |
94 | 94 | { |
95 | - $allQueryFields = array('territory_id'); |
|
96 | - $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
95 | + $allQueryFields = array('territory_id'); |
|
96 | + $allBodyFields = array('territory_name', 'member_id', 'territory_color', 'territory'); |
|
97 | 97 | |
98 | 98 | $response = Route4Me::makeRequst(array( |
99 | 99 | 'url' => Endpoint::TERRITORY_V4, |
100 | 100 | 'method' => 'PUT', |
101 | 101 | 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
102 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
102 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
103 | 103 | )); |
104 | 104 | |
105 | 105 | return $response; |
@@ -6,79 +6,79 @@ |
||
6 | 6 | |
7 | 7 | class ActivityParameters extends Common |
8 | 8 | { |
9 | - public $route_id; |
|
10 | - public $device_id; |
|
11 | - public $member_id; |
|
12 | - public $team; |
|
13 | - public $limit; |
|
14 | - public $offset; |
|
15 | - public $start; |
|
16 | - public $end; |
|
17 | - public $activity_type; |
|
18 | - public $activity_message; |
|
9 | + public $route_id; |
|
10 | + public $device_id; |
|
11 | + public $member_id; |
|
12 | + public $team; |
|
13 | + public $limit; |
|
14 | + public $offset; |
|
15 | + public $start; |
|
16 | + public $end; |
|
17 | + public $activity_type; |
|
18 | + public $activity_message; |
|
19 | 19 | |
20 | - public $activity_id; |
|
21 | - public $activity_timestamp; |
|
22 | - public $route_destination_id; |
|
23 | - public $note_id; |
|
24 | - public $member; |
|
25 | - public $note_type; |
|
26 | - public $note_contents; |
|
27 | - public $route_name; |
|
28 | - public $note_file; |
|
29 | - public $destination_name; |
|
30 | - public $destination_alias; |
|
20 | + public $activity_id; |
|
21 | + public $activity_timestamp; |
|
22 | + public $route_destination_id; |
|
23 | + public $note_id; |
|
24 | + public $member; |
|
25 | + public $note_type; |
|
26 | + public $note_contents; |
|
27 | + public $route_name; |
|
28 | + public $note_file; |
|
29 | + public $destination_name; |
|
30 | + public $destination_alias; |
|
31 | 31 | |
32 | - public static function fromArray(array $params) |
|
33 | - { |
|
34 | - $activityparameters = new ActivityParameters(); |
|
32 | + public static function fromArray(array $params) |
|
33 | + { |
|
34 | + $activityparameters = new ActivityParameters(); |
|
35 | 35 | |
36 | - foreach($params as $key => $value) { |
|
37 | - if (property_exists($activityparameters, $key)) { |
|
38 | - $activityparameters->{$key} = $value; |
|
39 | - } |
|
40 | - } |
|
36 | + foreach($params as $key => $value) { |
|
37 | + if (property_exists($activityparameters, $key)) { |
|
38 | + $activityparameters->{$key} = $value; |
|
39 | + } |
|
40 | + } |
|
41 | 41 | |
42 | - return $activityparameters; |
|
43 | - } |
|
42 | + return $activityparameters; |
|
43 | + } |
|
44 | 44 | |
45 | - public static function getActivities($params) |
|
46 | - { |
|
47 | - $allQueryFields = array('route_id', 'team', 'limit', 'offset', 'start'); |
|
45 | + public static function getActivities($params) |
|
46 | + { |
|
47 | + $allQueryFields = array('route_id', 'team', 'limit', 'offset', 'start'); |
|
48 | 48 | |
49 | - $activity = Route4Me::makeRequst(array( |
|
50 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
51 | - 'method' => 'GET', |
|
52 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
53 | - )); |
|
49 | + $activity = Route4Me::makeRequst(array( |
|
50 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
51 | + 'method' => 'GET', |
|
52 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
53 | + )); |
|
54 | 54 | |
55 | - return $activity; |
|
56 | - } |
|
55 | + return $activity; |
|
56 | + } |
|
57 | 57 | |
58 | - public static function searcActivities($params) |
|
59 | - { |
|
60 | - $allQueryFields = array('route_id', 'limit', 'offset', 'activity_type'); |
|
58 | + public static function searcActivities($params) |
|
59 | + { |
|
60 | + $allQueryFields = array('route_id', 'limit', 'offset', 'activity_type'); |
|
61 | 61 | |
62 | - $activity = Route4Me::makeRequst(array( |
|
63 | - 'url' => Endpoint::GET_ACTIVITIES, |
|
64 | - 'method' => 'GET', |
|
65 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
66 | - )); |
|
62 | + $activity = Route4Me::makeRequst(array( |
|
63 | + 'url' => Endpoint::GET_ACTIVITIES, |
|
64 | + 'method' => 'GET', |
|
65 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
66 | + )); |
|
67 | 67 | |
68 | - return $activity; |
|
69 | - } |
|
68 | + return $activity; |
|
69 | + } |
|
70 | 70 | |
71 | - public static function sendUserMessage($params) |
|
72 | - { |
|
73 | - $allBodyFields = array('activity_type', 'activity_message', 'route_id'); |
|
71 | + public static function sendUserMessage($params) |
|
72 | + { |
|
73 | + $allBodyFields = array('activity_type', 'activity_message', 'route_id'); |
|
74 | 74 | |
75 | - $result = Route4Me::makeRequst(array( |
|
76 | - 'url' => Endpoint::ACTIVITY_FEED, |
|
77 | - 'method' => 'POST', |
|
78 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
79 | - )); |
|
75 | + $result = Route4Me::makeRequst(array( |
|
76 | + 'url' => Endpoint::ACTIVITY_FEED, |
|
77 | + 'method' => 'POST', |
|
78 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
79 | + )); |
|
80 | 80 | |
81 | - return $result; |
|
82 | - } |
|
81 | + return $result; |
|
82 | + } |
|
83 | 83 | |
84 | 84 | } |
@@ -13,13 +13,13 @@ |
||
13 | 13 | Route4Me::setApiKey('11111111111111111111111111111111'); |
14 | 14 | |
15 | 15 | $recordParameters = Member::fromArray(array( |
16 | - 'email_address' => '[email protected]', |
|
17 | - 'first_name' => 'Mmmmm', |
|
18 | - 'last_name' => 'Ccccc', |
|
19 | - 'phone_number' => '454-454544', |
|
20 | - 'company_name' => 'c_name', |
|
21 | - 'member_id' => '123456', |
|
22 | - 'webinar_date' => '2016-06-05 10:00:00' |
|
16 | + 'email_address' => '[email protected]', |
|
17 | + 'first_name' => 'Mmmmm', |
|
18 | + 'last_name' => 'Ccccc', |
|
19 | + 'phone_number' => '454-454544', |
|
20 | + 'company_name' => 'c_name', |
|
21 | + 'member_id' => '123456', |
|
22 | + 'webinar_date' => '2016-06-05 10:00:00' |
|
23 | 23 | )); |
24 | 24 | |
25 | 25 | $member = new Member(); |
@@ -17,10 +17,10 @@ |
||
17 | 17 | // Example refers to the process of searching for text and specifing returned fields. |
18 | 18 | |
19 | 19 | $params = array( |
20 | - 'query' => 'David', |
|
21 | - 'fields' => 'first_name,address_email', |
|
22 | - 'offset' => 0, |
|
23 | - 'limit' => 5 |
|
20 | + 'query' => 'David', |
|
21 | + 'fields' => 'first_name,address_email', |
|
22 | + 'offset' => 0, |
|
23 | + 'limit' => 5 |
|
24 | 24 | ); |
25 | 25 | |
26 | 26 | $abcResult = $ablocation->searchAddressBookLocations($params); |