@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $geocoding = new Geocoding(); |
21 | 21 | |
22 | - foreach($params as $key => $value) { |
|
22 | + foreach ($params as $key => $value) { |
|
23 | 23 | if (property_exists($geocoding, $key)) { |
24 | 24 | $geocoding->{$key} = $value; |
25 | 25 | } |
@@ -6,109 +6,109 @@ |
||
6 | 6 | |
7 | 7 | class Geocoding extends Common |
8 | 8 | { |
9 | - public $strExportFormat; |
|
10 | - public $format; |
|
11 | - public $addresses; |
|
12 | - public $pk; |
|
13 | - public $offset; |
|
14 | - public $limit; |
|
15 | - public $housenumber; |
|
16 | - public $zipcode; |
|
9 | + public $strExportFormat; |
|
10 | + public $format; |
|
11 | + public $addresses; |
|
12 | + public $pk; |
|
13 | + public $offset; |
|
14 | + public $limit; |
|
15 | + public $housenumber; |
|
16 | + public $zipcode; |
|
17 | 17 | |
18 | - public static function fromArray(array $params) |
|
19 | - { |
|
20 | - $geocoding = new Geocoding(); |
|
18 | + public static function fromArray(array $params) |
|
19 | + { |
|
20 | + $geocoding = new Geocoding(); |
|
21 | 21 | |
22 | - foreach($params as $key => $value) { |
|
23 | - if (property_exists($geocoding, $key)) { |
|
24 | - $geocoding->{$key} = $value; |
|
25 | - } |
|
26 | - } |
|
22 | + foreach($params as $key => $value) { |
|
23 | + if (property_exists($geocoding, $key)) { |
|
24 | + $geocoding->{$key} = $value; |
|
25 | + } |
|
26 | + } |
|
27 | 27 | |
28 | - return $geocoding; |
|
29 | - } |
|
28 | + return $geocoding; |
|
29 | + } |
|
30 | 30 | |
31 | - public static function forwardGeocoding($params) |
|
32 | - { |
|
33 | - $allBodyFields = array('strExportFormat', 'addresses'); |
|
31 | + public static function forwardGeocoding($params) |
|
32 | + { |
|
33 | + $allBodyFields = array('strExportFormat', 'addresses'); |
|
34 | 34 | |
35 | - $fgCoding = Route4Me::makeRequst(array( |
|
36 | - 'url' => Endpoint::GEOCODER, |
|
37 | - 'method' => 'POST', |
|
38 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
39 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
40 | - )); |
|
35 | + $fgCoding = Route4Me::makeRequst(array( |
|
36 | + 'url' => Endpoint::GEOCODER, |
|
37 | + 'method' => 'POST', |
|
38 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
39 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
40 | + )); |
|
41 | 41 | |
42 | - return $fgCoding; |
|
43 | - } |
|
42 | + return $fgCoding; |
|
43 | + } |
|
44 | 44 | |
45 | - public static function reverseGeocoding($params) |
|
46 | - { |
|
47 | - $allQueryFields = array('format', 'addresses', 'detailed'); |
|
45 | + public static function reverseGeocoding($params) |
|
46 | + { |
|
47 | + $allQueryFields = array('format', 'addresses', 'detailed'); |
|
48 | 48 | |
49 | - $fgcoding = Route4Me::makeRequst(array( |
|
50 | - 'url' => Endpoint::GEOCODER, |
|
51 | - 'method' => 'POST', |
|
52 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
53 | - )); |
|
49 | + $fgcoding = Route4Me::makeRequst(array( |
|
50 | + 'url' => Endpoint::GEOCODER, |
|
51 | + 'method' => 'POST', |
|
52 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
53 | + )); |
|
54 | 54 | |
55 | - return $fgcoding; |
|
56 | - } |
|
55 | + return $fgcoding; |
|
56 | + } |
|
57 | 57 | |
58 | - public static function getStreetData($params) |
|
59 | - { |
|
60 | - Route4Me::setBaseUrl(Endpoint::STREET_DATA); |
|
58 | + public static function getStreetData($params) |
|
59 | + { |
|
60 | + Route4Me::setBaseUrl(Endpoint::STREET_DATA); |
|
61 | 61 | |
62 | - $allPathFields = array('pk', 'offset', 'limit'); |
|
62 | + $allPathFields = array('pk', 'offset', 'limit'); |
|
63 | 63 | |
64 | - $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
64 | + $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
65 | 65 | |
66 | - $query = array(); |
|
66 | + $query = array(); |
|
67 | 67 | |
68 | - $response = Route4Me::makeRequst(array( |
|
69 | - 'url' => $url_query, |
|
70 | - 'method' => 'GET', |
|
71 | - 'query' => $query |
|
72 | - )); |
|
68 | + $response = Route4Me::makeRequst(array( |
|
69 | + 'url' => $url_query, |
|
70 | + 'method' => 'GET', |
|
71 | + 'query' => $query |
|
72 | + )); |
|
73 | 73 | |
74 | - return $response; |
|
75 | - } |
|
74 | + return $response; |
|
75 | + } |
|
76 | 76 | |
77 | - public static function getZipCode($params) |
|
78 | - { |
|
79 | - Route4Me::setBaseUrl(Endpoint::STREET_DATA_ZIPCODE); |
|
77 | + public static function getZipCode($params) |
|
78 | + { |
|
79 | + Route4Me::setBaseUrl(Endpoint::STREET_DATA_ZIPCODE); |
|
80 | 80 | |
81 | - $allPathFields = array('zipcode', 'offset', 'limit'); |
|
81 | + $allPathFields = array('zipcode', 'offset', 'limit'); |
|
82 | 82 | |
83 | - $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
83 | + $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
84 | 84 | |
85 | - $query = array(); |
|
85 | + $query = array(); |
|
86 | 86 | |
87 | - $response = Route4Me::makeRequst(array( |
|
88 | - 'url' => $url_query, |
|
89 | - 'method' => 'GET', |
|
90 | - 'query' => $query |
|
91 | - )); |
|
87 | + $response = Route4Me::makeRequst(array( |
|
88 | + 'url' => $url_query, |
|
89 | + 'method' => 'GET', |
|
90 | + 'query' => $query |
|
91 | + )); |
|
92 | 92 | |
93 | - return $response; |
|
94 | - } |
|
93 | + return $response; |
|
94 | + } |
|
95 | 95 | |
96 | - public static function getService($params) |
|
97 | - { |
|
98 | - Route4Me::setBaseUrl(Endpoint::STREET_DATA_SERVICE); |
|
96 | + public static function getService($params) |
|
97 | + { |
|
98 | + Route4Me::setBaseUrl(Endpoint::STREET_DATA_SERVICE); |
|
99 | 99 | |
100 | - $allPathFields = array('zipcode', 'housenumber', 'offset', 'limit'); |
|
100 | + $allPathFields = array('zipcode', 'housenumber', 'offset', 'limit'); |
|
101 | 101 | |
102 | - $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
102 | + $url_query = Route4Me::generateUrlPath($allPathFields, $params); |
|
103 | 103 | |
104 | - $query = array(); |
|
104 | + $query = array(); |
|
105 | 105 | |
106 | - $response = Route4Me::makeRequst(array( |
|
107 | - 'url' => $url_query, |
|
108 | - 'method' => 'GET', |
|
109 | - 'query' => $query |
|
110 | - )); |
|
106 | + $response = Route4Me::makeRequst(array( |
|
107 | + 'url' => $url_query, |
|
108 | + 'method' => 'GET', |
|
109 | + 'query' => $query |
|
110 | + )); |
|
111 | 111 | |
112 | - return $response; |
|
113 | - } |
|
112 | + return $response; |
|
113 | + } |
|
114 | 114 | } |
@@ -171,7 +171,7 @@ |
||
171 | 171 | |
172 | 172 | public function mergeRoutes($params) |
173 | 173 | { |
174 | - $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
174 | + $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
175 | 175 | |
176 | 176 | $result = Route4Me::makeRequst(array( |
177 | 177 | 'url' => Endpoint::ROUTES_MERGE, |
@@ -9,410 +9,410 @@ |
||
9 | 9 | |
10 | 10 | class Route extends Common |
11 | 11 | { |
12 | - public $route_id; |
|
13 | - public $member_id; |
|
14 | - public $route_destination_id; |
|
15 | - public $optimization_problem_id; |
|
16 | - public $vehicle_alias; |
|
17 | - public $driver_alias; |
|
18 | - public $trip_distance; |
|
19 | - public $mpg; |
|
20 | - public $gas_price; |
|
21 | - public $route_duration_sec; |
|
22 | - public $destination_count; |
|
23 | - public $parameters; |
|
24 | - public $addresses = array(); |
|
25 | - public $links = array(); |
|
26 | - public $directions = array(); |
|
27 | - public $path = array(); |
|
28 | - public $tracking_history = array(); |
|
29 | - public $recipient_email; |
|
30 | - public $httpheaders; |
|
31 | - public $is_unrouted; |
|
32 | - public $time; |
|
12 | + public $route_id; |
|
13 | + public $member_id; |
|
14 | + public $route_destination_id; |
|
15 | + public $optimization_problem_id; |
|
16 | + public $vehicle_alias; |
|
17 | + public $driver_alias; |
|
18 | + public $trip_distance; |
|
19 | + public $mpg; |
|
20 | + public $gas_price; |
|
21 | + public $route_duration_sec; |
|
22 | + public $destination_count; |
|
23 | + public $parameters; |
|
24 | + public $addresses = array(); |
|
25 | + public $links = array(); |
|
26 | + public $directions = array(); |
|
27 | + public $path = array(); |
|
28 | + public $tracking_history = array(); |
|
29 | + public $recipient_email; |
|
30 | + public $httpheaders; |
|
31 | + public $is_unrouted; |
|
32 | + public $time; |
|
33 | 33 | |
34 | - public $dev_lat; |
|
35 | - public $dev_lng; |
|
34 | + public $dev_lat; |
|
35 | + public $dev_lng; |
|
36 | 36 | |
37 | - public $user_route_rating; |
|
38 | - public $member_email; |
|
39 | - public $member_first_name; |
|
40 | - public $member_last_name; |
|
41 | - public $channel_name; |
|
42 | - public $route_cost; |
|
43 | - public $route_revenue; |
|
44 | - public $net_revenue_per_distance_unit; |
|
45 | - public $created_timestamp; |
|
46 | - public $planned_total_route_duration; |
|
47 | - public $actual_travel_distance; |
|
48 | - public $actual_travel_time; |
|
49 | - public $actual_footsteps; |
|
50 | - public $working_time; |
|
51 | - public $driving_time; |
|
52 | - public $idling_time; |
|
53 | - public $paying_miles; |
|
54 | - public $geofence_polygon_type; |
|
55 | - public $geofence_polygon_size; |
|
56 | - public $notes; |
|
57 | - public $member_config_storage; |
|
37 | + public $user_route_rating; |
|
38 | + public $member_email; |
|
39 | + public $member_first_name; |
|
40 | + public $member_last_name; |
|
41 | + public $channel_name; |
|
42 | + public $route_cost; |
|
43 | + public $route_revenue; |
|
44 | + public $net_revenue_per_distance_unit; |
|
45 | + public $created_timestamp; |
|
46 | + public $planned_total_route_duration; |
|
47 | + public $actual_travel_distance; |
|
48 | + public $actual_travel_time; |
|
49 | + public $actual_footsteps; |
|
50 | + public $working_time; |
|
51 | + public $driving_time; |
|
52 | + public $idling_time; |
|
53 | + public $paying_miles; |
|
54 | + public $geofence_polygon_type; |
|
55 | + public $geofence_polygon_size; |
|
56 | + public $notes; |
|
57 | + public $member_config_storage; |
|
58 | 58 | |
59 | - public static function fromArray(array $params) |
|
60 | - { |
|
61 | - $route = new Route(); |
|
62 | - $route->route_id = Common::getValue($params, 'route_id'); |
|
63 | - $route->member_id = Common::getValue($params, 'member_id'); |
|
64 | - $route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id'); |
|
65 | - $route->vehicle_alias = Common::getValue($params, 'vehicle_alias'); |
|
66 | - $route->driver_alias = Common::getValue($params, 'driver_alias'); |
|
67 | - $route->trip_distance = Common::getValue($params, 'trip_distance'); |
|
68 | - $route->mpg = Common::getValue($params, 'mpg'); |
|
69 | - $route->gas_price = Common::getValue($params, 'gas_price'); |
|
70 | - $route->route_duration_sec = Common::getvalue($params, 'route_duration_sec'); |
|
71 | - $route->destination_count = Common::getvalue($params, 'destination_count'); |
|
72 | - $route->is_unrouted = Common::getvalue($params, 'is_unrouted'); |
|
59 | + public static function fromArray(array $params) |
|
60 | + { |
|
61 | + $route = new Route(); |
|
62 | + $route->route_id = Common::getValue($params, 'route_id'); |
|
63 | + $route->member_id = Common::getValue($params, 'member_id'); |
|
64 | + $route->optimization_problem_id = Common::getValue($params, 'optimization_problem_id'); |
|
65 | + $route->vehicle_alias = Common::getValue($params, 'vehicle_alias'); |
|
66 | + $route->driver_alias = Common::getValue($params, 'driver_alias'); |
|
67 | + $route->trip_distance = Common::getValue($params, 'trip_distance'); |
|
68 | + $route->mpg = Common::getValue($params, 'mpg'); |
|
69 | + $route->gas_price = Common::getValue($params, 'gas_price'); |
|
70 | + $route->route_duration_sec = Common::getvalue($params, 'route_duration_sec'); |
|
71 | + $route->destination_count = Common::getvalue($params, 'destination_count'); |
|
72 | + $route->is_unrouted = Common::getvalue($params, 'is_unrouted'); |
|
73 | 73 | |
74 | - // Make RouteParameters |
|
75 | - if (isset($params['parameters'])) { |
|
76 | - $route->parameters = RouteParameters::fromArray($params['parameters']); |
|
77 | - } |
|
74 | + // Make RouteParameters |
|
75 | + if (isset($params['parameters'])) { |
|
76 | + $route->parameters = RouteParameters::fromArray($params['parameters']); |
|
77 | + } |
|
78 | 78 | |
79 | - if (isset($params['addresses'])) { |
|
80 | - $addresses = array(); |
|
79 | + if (isset($params['addresses'])) { |
|
80 | + $addresses = array(); |
|
81 | 81 | |
82 | - foreach ($params['addresses'] as $address) { |
|
83 | - $addresses[] = Address::fromArray($address); |
|
84 | - } |
|
82 | + foreach ($params['addresses'] as $address) { |
|
83 | + $addresses[] = Address::fromArray($address); |
|
84 | + } |
|
85 | 85 | |
86 | - $route->addresses = $addresses; |
|
87 | - } |
|
86 | + $route->addresses = $addresses; |
|
87 | + } |
|
88 | 88 | |
89 | - $route->links = Common::getValue($params, 'links', array()); |
|
90 | - $route->directions = Common::getValue($params, 'directions', array()); |
|
91 | - $route->path = Common::getValue($params, 'path', array()); |
|
92 | - $route->tracking_history = Common::getValue($params, 'tracking_history', array()); |
|
89 | + $route->links = Common::getValue($params, 'links', array()); |
|
90 | + $route->directions = Common::getValue($params, 'directions', array()); |
|
91 | + $route->path = Common::getValue($params, 'path', array()); |
|
92 | + $route->tracking_history = Common::getValue($params, 'tracking_history', array()); |
|
93 | 93 | |
94 | - return $route; |
|
95 | - } |
|
94 | + return $route; |
|
95 | + } |
|
96 | 96 | |
97 | - public static function getRoutes($params = null) |
|
98 | - { |
|
99 | - $allQueryFields = array('route_id', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset'); |
|
97 | + public static function getRoutes($params = null) |
|
98 | + { |
|
99 | + $allQueryFields = array('route_id', 'route_path_output', 'query', 'directions', 'device_tracking_history', 'limit', 'offset'); |
|
100 | 100 | |
101 | - $result = Route4Me::makeRequst(array( |
|
102 | - 'url' => Endpoint::ROUTE_V4, |
|
103 | - 'method' => 'GET', |
|
104 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
105 | - )); |
|
101 | + $result = Route4Me::makeRequst(array( |
|
102 | + 'url' => Endpoint::ROUTE_V4, |
|
103 | + 'method' => 'GET', |
|
104 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
105 | + )); |
|
106 | 106 | |
107 | - if (isset($params['route_id'])) { |
|
108 | - return Route::fromArray($result); |
|
109 | - } else { |
|
110 | - $routes = array(); |
|
111 | - foreach ($result as $route) { |
|
112 | - $routes[] = Route::fromArray($route); |
|
113 | - } |
|
114 | - return $routes; |
|
115 | - } |
|
116 | - } |
|
107 | + if (isset($params['route_id'])) { |
|
108 | + return Route::fromArray($result); |
|
109 | + } else { |
|
110 | + $routes = array(); |
|
111 | + foreach ($result as $route) { |
|
112 | + $routes[] = Route::fromArray($route); |
|
113 | + } |
|
114 | + return $routes; |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - public function getRoutePoints($params) |
|
119 | - { |
|
120 | - $allQueryFields = array('route_id', 'route_path_output', 'compress_path_points', 'directions'); |
|
118 | + public function getRoutePoints($params) |
|
119 | + { |
|
120 | + $allQueryFields = array('route_id', 'route_path_output', 'compress_path_points', 'directions'); |
|
121 | 121 | |
122 | - $result = Route4Me::makeRequst(array( |
|
123 | - 'url' => Endpoint::ROUTE_V4, |
|
124 | - 'method' => 'GET', |
|
125 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
126 | - )); |
|
122 | + $result = Route4Me::makeRequst(array( |
|
123 | + 'url' => Endpoint::ROUTE_V4, |
|
124 | + 'method' => 'GET', |
|
125 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
126 | + )); |
|
127 | 127 | |
128 | - return $result; |
|
129 | - } |
|
128 | + return $result; |
|
129 | + } |
|
130 | 130 | |
131 | - public function duplicateRoute($route_id) |
|
132 | - { |
|
133 | - $result = Route4Me::makeRequst(array( |
|
134 | - 'url' => Endpoint::ROUTE_DUPLICATE, |
|
135 | - 'method' => 'GET', |
|
136 | - 'query' => array( |
|
137 | - 'route_id' => $route_id, |
|
138 | - 'to' => 'none', |
|
139 | - ) |
|
140 | - )); |
|
131 | + public function duplicateRoute($route_id) |
|
132 | + { |
|
133 | + $result = Route4Me::makeRequst(array( |
|
134 | + 'url' => Endpoint::ROUTE_DUPLICATE, |
|
135 | + 'method' => 'GET', |
|
136 | + 'query' => array( |
|
137 | + 'route_id' => $route_id, |
|
138 | + 'to' => 'none', |
|
139 | + ) |
|
140 | + )); |
|
141 | 141 | |
142 | - return $result; |
|
143 | - } |
|
142 | + return $result; |
|
143 | + } |
|
144 | 144 | |
145 | - public function resequenceRoute($params) |
|
146 | - { |
|
147 | - $allQueryFields = array('route_id', 'route_destination_id'); |
|
148 | - $allBodyFields = array('addresses'); |
|
145 | + public function resequenceRoute($params) |
|
146 | + { |
|
147 | + $allQueryFields = array('route_id', 'route_destination_id'); |
|
148 | + $allBodyFields = array('addresses'); |
|
149 | 149 | |
150 | - $result = Route4Me::makeRequst(array( |
|
151 | - 'url' => Endpoint::ROUTE_V4, |
|
152 | - 'method' => 'PUT', |
|
153 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
154 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
155 | - )); |
|
150 | + $result = Route4Me::makeRequst(array( |
|
151 | + 'url' => Endpoint::ROUTE_V4, |
|
152 | + 'method' => 'PUT', |
|
153 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
154 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
155 | + )); |
|
156 | 156 | |
157 | - return $result; |
|
158 | - } |
|
157 | + return $result; |
|
158 | + } |
|
159 | 159 | |
160 | - public function resequenceAllAddresses($params) |
|
161 | - { |
|
162 | - $allQueryFields = array('route_id', 'disable_optimization', 'optimize'); |
|
160 | + public function resequenceAllAddresses($params) |
|
161 | + { |
|
162 | + $allQueryFields = array('route_id', 'disable_optimization', 'optimize'); |
|
163 | 163 | |
164 | - $result = Route4Me::makeRequst(array( |
|
165 | - 'url' => Endpoint::REOPTIMIZE_V3_2, |
|
166 | - 'method' => 'GET', |
|
167 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
168 | - )); |
|
164 | + $result = Route4Me::makeRequst(array( |
|
165 | + 'url' => Endpoint::REOPTIMIZE_V3_2, |
|
166 | + 'method' => 'GET', |
|
167 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
168 | + )); |
|
169 | 169 | |
170 | - return $result; |
|
171 | - } |
|
170 | + return $result; |
|
171 | + } |
|
172 | 172 | |
173 | - public function mergeRoutes($params) |
|
174 | - { |
|
175 | - $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
173 | + public function mergeRoutes($params) |
|
174 | + { |
|
175 | + $allBodyFields = array('route_ids', 'depot_address', 'remove_origin', 'depot_lat', 'depot_lng'); |
|
176 | 176 | |
177 | - $result = Route4Me::makeRequst(array( |
|
178 | - 'url' => Endpoint::ROUTES_MERGE, |
|
179 | - 'method' => 'POST', |
|
180 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
181 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
182 | - )); |
|
177 | + $result = Route4Me::makeRequst(array( |
|
178 | + 'url' => Endpoint::ROUTES_MERGE, |
|
179 | + 'method' => 'POST', |
|
180 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
181 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
182 | + )); |
|
183 | 183 | |
184 | - return $result; |
|
185 | - } |
|
184 | + return $result; |
|
185 | + } |
|
186 | 186 | |
187 | - public function shareRoute($params) |
|
188 | - { |
|
189 | - $allQueryFields = array('route_id', 'response_format'); |
|
190 | - $allBodyFields = array('recipient_email'); |
|
187 | + public function shareRoute($params) |
|
188 | + { |
|
189 | + $allQueryFields = array('route_id', 'response_format'); |
|
190 | + $allBodyFields = array('recipient_email'); |
|
191 | 191 | |
192 | - $result = Route4Me::makeRequst(array( |
|
193 | - 'url' => Endpoint::ROUTE_SHARE, |
|
194 | - 'method' => 'POST', |
|
195 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
196 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
197 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
198 | - )); |
|
192 | + $result = Route4Me::makeRequst(array( |
|
193 | + 'url' => Endpoint::ROUTE_SHARE, |
|
194 | + 'method' => 'POST', |
|
195 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
196 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
197 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
198 | + )); |
|
199 | 199 | |
200 | - return $result; |
|
201 | - } |
|
200 | + return $result; |
|
201 | + } |
|
202 | 202 | |
203 | - // Returns random route_id from existing routes between $offset and $offset+$limit |
|
204 | - public function getRandomRouteId($offset, $limit) |
|
205 | - { |
|
206 | - $params = array( |
|
207 | - 'offset' => !is_null($offset) ? $offset : 0, |
|
208 | - 'limit' => !is_null($limit) ? $limit : 30 |
|
209 | - ); |
|
203 | + // Returns random route_id from existing routes between $offset and $offset+$limit |
|
204 | + public function getRandomRouteId($offset, $limit) |
|
205 | + { |
|
206 | + $params = array( |
|
207 | + 'offset' => !is_null($offset) ? $offset : 0, |
|
208 | + 'limit' => !is_null($limit) ? $limit : 30 |
|
209 | + ); |
|
210 | 210 | |
211 | - $routes = $this->getRoutes($params); |
|
211 | + $routes = $this->getRoutes($params); |
|
212 | 212 | |
213 | - if (is_null($routes) || sizeof($routes)<1) { |
|
214 | - echo "<br> There are no routes in the account. Please, create the routes first. <br>"; |
|
215 | - return null; |
|
216 | - } |
|
213 | + if (is_null($routes) || sizeof($routes)<1) { |
|
214 | + echo "<br> There are no routes in the account. Please, create the routes first. <br>"; |
|
215 | + return null; |
|
216 | + } |
|
217 | 217 | |
218 | - $randomIndex = rand(0, sizeof($routes) - 1); |
|
218 | + $randomIndex = rand(0, sizeof($routes) - 1); |
|
219 | 219 | |
220 | - return $routes[$randomIndex]->route_id; |
|
221 | - } |
|
220 | + return $routes[$randomIndex]->route_id; |
|
221 | + } |
|
222 | 222 | |
223 | - public function update() |
|
224 | - { |
|
225 | - $route = Route4Me::makeRequst(array( |
|
226 | - 'url' => Endpoint::ROUTE_V4, |
|
227 | - 'method' => 'PUT', |
|
228 | - 'query' => array( |
|
229 | - 'route_id' => isset($this->route_id) ? $this->route_id : null |
|
230 | - ), |
|
231 | - 'body' => array( |
|
232 | - 'parameters' => $this->parameters, |
|
233 | - ), |
|
234 | - 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
235 | - )); |
|
223 | + public function update() |
|
224 | + { |
|
225 | + $route = Route4Me::makeRequst(array( |
|
226 | + 'url' => Endpoint::ROUTE_V4, |
|
227 | + 'method' => 'PUT', |
|
228 | + 'query' => array( |
|
229 | + 'route_id' => isset($this->route_id) ? $this->route_id : null |
|
230 | + ), |
|
231 | + 'body' => array( |
|
232 | + 'parameters' => $this->parameters, |
|
233 | + ), |
|
234 | + 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
235 | + )); |
|
236 | 236 | |
237 | - return Route::fromArray($route); |
|
238 | - } |
|
237 | + return Route::fromArray($route); |
|
238 | + } |
|
239 | 239 | |
240 | - public function updateAddress($address = null) |
|
241 | - { |
|
242 | - $body = sizeof($this->addresses)<1 ? get_object_vars($this->parameters) |
|
243 | - : (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters)); |
|
240 | + public function updateAddress($address = null) |
|
241 | + { |
|
242 | + $body = sizeof($this->addresses)<1 ? get_object_vars($this->parameters) |
|
243 | + : (isset($this->addresses[0]) ? $this->addresses[0] : get_object_vars($this->parameters)); |
|
244 | 244 | |
245 | - $result = Route4Me::makeRequst(array( |
|
246 | - 'url' => Endpoint::ADDRESS_V4, |
|
247 | - 'method' => 'PUT', |
|
248 | - 'query' => array( |
|
249 | - 'route_id' => isset($this->route_id) ? $this->route_id : null, |
|
250 | - 'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null, |
|
251 | - ), |
|
252 | - 'body' => $body, |
|
253 | - 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
254 | - )); |
|
245 | + $result = Route4Me::makeRequst(array( |
|
246 | + 'url' => Endpoint::ADDRESS_V4, |
|
247 | + 'method' => 'PUT', |
|
248 | + 'query' => array( |
|
249 | + 'route_id' => isset($this->route_id) ? $this->route_id : null, |
|
250 | + 'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null, |
|
251 | + ), |
|
252 | + 'body' => $body, |
|
253 | + 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
254 | + )); |
|
255 | 255 | |
256 | - return $result; |
|
257 | - } |
|
256 | + return $result; |
|
257 | + } |
|
258 | 258 | |
259 | - public function updateRouteAddress() |
|
260 | - { |
|
261 | - $result = Route4Me::makeRequst(array( |
|
262 | - 'url' => Endpoint::ADDRESS_V4, |
|
263 | - 'method' => 'PUT', |
|
264 | - 'query' => array( |
|
265 | - 'route_id' => isset($this->route_id) ? $this->route_id : null, |
|
266 | - 'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null, |
|
267 | - ), |
|
268 | - 'body' => array( |
|
269 | - "parameters" => isset($this->parameters) ? get_object_vars($this->parameters) : null, |
|
270 | - "addresses" => isset($this->addresses) ? $this->addresses : null |
|
271 | - ), |
|
272 | - 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
273 | - )); |
|
259 | + public function updateRouteAddress() |
|
260 | + { |
|
261 | + $result = Route4Me::makeRequst(array( |
|
262 | + 'url' => Endpoint::ADDRESS_V4, |
|
263 | + 'method' => 'PUT', |
|
264 | + 'query' => array( |
|
265 | + 'route_id' => isset($this->route_id) ? $this->route_id : null, |
|
266 | + 'route_destination_id' => isset($this->route_destination_id) ? $this->route_destination_id : null, |
|
267 | + ), |
|
268 | + 'body' => array( |
|
269 | + "parameters" => isset($this->parameters) ? get_object_vars($this->parameters) : null, |
|
270 | + "addresses" => isset($this->addresses) ? $this->addresses : null |
|
271 | + ), |
|
272 | + 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
273 | + )); |
|
274 | 274 | |
275 | - return $result; |
|
276 | - } |
|
275 | + return $result; |
|
276 | + } |
|
277 | 277 | |
278 | - public function addAddresses($params) |
|
279 | - { |
|
280 | - $allQueryFields = array('route_id'); |
|
281 | - $allBodyFields = array('addresses'); |
|
278 | + public function addAddresses($params) |
|
279 | + { |
|
280 | + $allQueryFields = array('route_id'); |
|
281 | + $allBodyFields = array('addresses'); |
|
282 | 282 | |
283 | - $route = Route4Me::makeRequst(array( |
|
284 | - 'url' => Endpoint::ROUTE_V4, |
|
285 | - 'method' => 'PUT', |
|
286 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
287 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
288 | - 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
289 | - )); |
|
283 | + $route = Route4Me::makeRequst(array( |
|
284 | + 'url' => Endpoint::ROUTE_V4, |
|
285 | + 'method' => 'PUT', |
|
286 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
287 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
288 | + 'HTTPHEADER' => isset($this->httpheaders) ? $this->httpheaders : null, |
|
289 | + )); |
|
290 | 290 | |
291 | - return Route::fromArray($route); |
|
292 | - } |
|
291 | + return Route::fromArray($route); |
|
292 | + } |
|
293 | 293 | |
294 | - public function insertAddressOptimalPosition(array $params) |
|
295 | - { |
|
296 | - $allQueryFields = array('route_id'); |
|
297 | - $allBodyFields = array('addresses', 'optimal_position'); |
|
294 | + public function insertAddressOptimalPosition(array $params) |
|
295 | + { |
|
296 | + $allQueryFields = array('route_id'); |
|
297 | + $allBodyFields = array('addresses', 'optimal_position'); |
|
298 | 298 | |
299 | - $route = Route4Me::makeRequst(array( |
|
300 | - 'url' => Endpoint::ROUTE_V4, |
|
301 | - 'method' => 'PUT', |
|
302 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
303 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
304 | - )); |
|
299 | + $route = Route4Me::makeRequst(array( |
|
300 | + 'url' => Endpoint::ROUTE_V4, |
|
301 | + 'method' => 'PUT', |
|
302 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
303 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
304 | + )); |
|
305 | 305 | |
306 | - return Route::fromArray($route); |
|
307 | - } |
|
306 | + return Route::fromArray($route); |
|
307 | + } |
|
308 | 308 | |
309 | - public function addNoteFile($params) |
|
310 | - { |
|
311 | - $fname = isset($params['strFilename']) ? $params['strFilename'] : null; |
|
312 | - $rpath = realpath($fname); |
|
309 | + public function addNoteFile($params) |
|
310 | + { |
|
311 | + $fname = isset($params['strFilename']) ? $params['strFilename'] : null; |
|
312 | + $rpath = realpath($fname); |
|
313 | 313 | |
314 | - $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'); |
|
315 | - $allBodyFields = array('strUpdateType', 'strFilename', 'strNoteContents'); |
|
314 | + $allQueryFields = array('route_id', 'address_id', 'dev_lat', 'dev_lng', 'device_type'); |
|
315 | + $allBodyFields = array('strUpdateType', 'strFilename', 'strNoteContents'); |
|
316 | 316 | |
317 | - $result = Route4Me::makeRequst(array( |
|
318 | - 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
319 | - 'method' => 'POST', |
|
320 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
321 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
322 | - 'FILE' => $rpath, |
|
323 | - 'HTTPHEADER' => array( |
|
324 | - 'Content-Type: application/x-www-form-urlencoded' |
|
325 | - ) |
|
326 | - )); |
|
317 | + $result = Route4Me::makeRequst(array( |
|
318 | + 'url' => Endpoint::ROUTE_NOTES_ADD, |
|
319 | + 'method' => 'POST', |
|
320 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
321 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
322 | + 'FILE' => $rpath, |
|
323 | + 'HTTPHEADER' => array( |
|
324 | + 'Content-Type: application/x-www-form-urlencoded' |
|
325 | + ) |
|
326 | + )); |
|
327 | 327 | |
328 | - return $result; |
|
329 | - } |
|
328 | + return $result; |
|
329 | + } |
|
330 | 330 | |
331 | - public function deleteRoutes($route_id) |
|
332 | - { |
|
333 | - $result = Route4Me::makeRequst(array( |
|
334 | - 'url' => Endpoint::ROUTES_DELETE, |
|
335 | - 'method' => 'DELETE', |
|
336 | - 'query' => array( |
|
337 | - 'route_id' => $route_id, |
|
338 | - ) |
|
339 | - )); |
|
331 | + public function deleteRoutes($route_id) |
|
332 | + { |
|
333 | + $result = Route4Me::makeRequst(array( |
|
334 | + 'url' => Endpoint::ROUTES_DELETE, |
|
335 | + 'method' => 'DELETE', |
|
336 | + 'query' => array( |
|
337 | + 'route_id' => $route_id, |
|
338 | + ) |
|
339 | + )); |
|
340 | 340 | |
341 | - return $result; |
|
342 | - } |
|
341 | + return $result; |
|
342 | + } |
|
343 | 343 | |
344 | - public function GetAddressesFromRoute($route_id) |
|
345 | - { |
|
346 | - $route1 = Route::getRoutes(array('route_id' => $route_id)); |
|
344 | + public function GetAddressesFromRoute($route_id) |
|
345 | + { |
|
346 | + $route1 = Route::getRoutes(array('route_id' => $route_id)); |
|
347 | 347 | |
348 | - if (isset($route1)) { |
|
349 | - return $route1->addresses; |
|
350 | - } else { |
|
351 | - return null; |
|
352 | - } |
|
353 | - } |
|
348 | + if (isset($route1)) { |
|
349 | + return $route1->addresses; |
|
350 | + } else { |
|
351 | + return null; |
|
352 | + } |
|
353 | + } |
|
354 | 354 | |
355 | - public function GetRandomAddressFromRoute($route_id) |
|
356 | - { |
|
357 | - $route1 = Route::getRoutes(array('route_id' => $route_id)); |
|
355 | + public function GetRandomAddressFromRoute($route_id) |
|
356 | + { |
|
357 | + $route1 = Route::getRoutes(array('route_id' => $route_id)); |
|
358 | 358 | |
359 | - if (isset($route1)) { |
|
360 | - $addresses = $route1->addresses; |
|
359 | + if (isset($route1)) { |
|
360 | + $addresses = $route1->addresses; |
|
361 | 361 | |
362 | - $rnd = rand(0, sizeof($addresses) - 1); |
|
362 | + $rnd = rand(0, sizeof($addresses) - 1); |
|
363 | 363 | |
364 | - return $addresses[$rnd]; |
|
365 | - } else { |
|
366 | - return null; |
|
367 | - } |
|
368 | - } |
|
364 | + return $addresses[$rnd]; |
|
365 | + } else { |
|
366 | + return null; |
|
367 | + } |
|
368 | + } |
|
369 | 369 | |
370 | - public function getRouteId() |
|
371 | - { |
|
372 | - return $this->route_id; |
|
373 | - } |
|
370 | + public function getRouteId() |
|
371 | + { |
|
372 | + return $this->route_id; |
|
373 | + } |
|
374 | 374 | |
375 | - public function getOptimizationId() |
|
376 | - { |
|
377 | - return $this->optimization_problem_id; |
|
378 | - } |
|
375 | + public function getOptimizationId() |
|
376 | + { |
|
377 | + return $this->optimization_problem_id; |
|
378 | + } |
|
379 | 379 | |
380 | - public function GetLastLocation(array $params) |
|
381 | - { |
|
382 | - $allQueryFields = array('route_id', 'device_tracking_history'); |
|
380 | + public function GetLastLocation(array $params) |
|
381 | + { |
|
382 | + $allQueryFields = array('route_id', 'device_tracking_history'); |
|
383 | 383 | |
384 | - $route = Route4Me::makeRequst(array( |
|
385 | - 'url' => Endpoint::ROUTE_V4, |
|
386 | - 'method' => 'GET', |
|
387 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
388 | - )); |
|
384 | + $route = Route4Me::makeRequst(array( |
|
385 | + 'url' => Endpoint::ROUTE_V4, |
|
386 | + 'method' => 'GET', |
|
387 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
388 | + )); |
|
389 | 389 | |
390 | - return Route::fromArray($route); |
|
391 | - } |
|
390 | + return Route::fromArray($route); |
|
391 | + } |
|
392 | 392 | |
393 | - public function GetTrackingHistoryFromTimeRange(array $params) |
|
394 | - { |
|
395 | - $allQueryFields = array('route_id', 'format', 'time_period', 'start_date', 'end_date'); |
|
393 | + public function GetTrackingHistoryFromTimeRange(array $params) |
|
394 | + { |
|
395 | + $allQueryFields = array('route_id', 'format', 'time_period', 'start_date', 'end_date'); |
|
396 | 396 | |
397 | - $route = Route4Me::makeRequst(array( |
|
398 | - 'url' => Endpoint::GET_DEVICE_LOCATION, |
|
399 | - 'method' => 'GET', |
|
400 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
401 | - )); |
|
397 | + $route = Route4Me::makeRequst(array( |
|
398 | + 'url' => Endpoint::GET_DEVICE_LOCATION, |
|
399 | + 'method' => 'GET', |
|
400 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
401 | + )); |
|
402 | 402 | |
403 | - return $route; |
|
404 | - } |
|
403 | + return $route; |
|
404 | + } |
|
405 | 405 | |
406 | - public function GetAssetTracking(array $params) |
|
407 | - { |
|
408 | - $allQueryFields = array('tracking'); |
|
406 | + public function GetAssetTracking(array $params) |
|
407 | + { |
|
408 | + $allQueryFields = array('tracking'); |
|
409 | 409 | |
410 | - $route = Route4Me::makeRequst(array( |
|
411 | - 'url' => Endpoint::STATUS_V4, |
|
412 | - 'method' => 'GET', |
|
413 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
414 | - )); |
|
410 | + $route = Route4Me::makeRequst(array( |
|
411 | + 'url' => Endpoint::STATUS_V4, |
|
412 | + 'method' => 'GET', |
|
413 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
414 | + )); |
|
415 | 415 | |
416 | - return $route; |
|
417 | - } |
|
416 | + return $route; |
|
417 | + } |
|
418 | 418 | } |
@@ -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); |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | assert(!is_null($routeId), "Can't retrieve random route_id"); |
21 | 21 | |
22 | 22 | $activityParameters = ActivityParameters::fromArray(array( |
23 | - "route_id" => $routeId, |
|
24 | - "team" => "true" |
|
23 | + "route_id" => $routeId, |
|
24 | + "team" => "true" |
|
25 | 25 | )); |
26 | 26 | |
27 | 27 | $activities = new ActivityParameters(); |
@@ -30,5 +30,5 @@ discard block |
||
30 | 30 | |
31 | 31 | foreach ($results as $result) { |
32 | 32 | Route4Me::simplePrint($result); |
33 | - echo "<br>"; |
|
33 | + echo "<br>"; |
|
34 | 34 | } |
@@ -29,10 +29,10 @@ |
||
29 | 29 | $address = new Address(); |
30 | 30 | |
31 | 31 | $params = array( |
32 | - "route_id" => $routeId, |
|
33 | - "address_id" => $route_destination_id, |
|
34 | - "is_departed" => 1, |
|
35 | - "member_id" => 1 |
|
32 | + "route_id" => $routeId, |
|
33 | + "address_id" => $route_destination_id, |
|
34 | + "is_departed" => 1, |
|
35 | + "member_id" => 1 |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | $result = $address->markAsDeparted($params); |
@@ -23,25 +23,25 @@ |
||
23 | 23 | $addresses = array(); |
24 | 24 | |
25 | 25 | $address1 = (array)Address::fromArray(array( |
26 | - 'address' => '146 Bill Johnson Rd NE Milledgeville GA 31061', |
|
27 | - 'lat' => 33.143526, |
|
28 | - 'lng' => -83.240354, |
|
29 | - 'time' => 0 |
|
26 | + 'address' => '146 Bill Johnson Rd NE Milledgeville GA 31061', |
|
27 | + 'lat' => 33.143526, |
|
28 | + 'lng' => -83.240354, |
|
29 | + 'time' => 0 |
|
30 | 30 | )); |
31 | 31 | |
32 | 32 | $address2 = (array)Address::fromArray(array( |
33 | - 'address' => '222 Blake Cir Milledgeville GA 31061', |
|
34 | - 'lat' => 33.177852, |
|
35 | - 'lng' => -83.263535, |
|
36 | - 'time' => 0 |
|
33 | + 'address' => '222 Blake Cir Milledgeville GA 31061', |
|
34 | + 'lat' => 33.177852, |
|
35 | + 'lng' => -83.263535, |
|
36 | + 'time' => 0 |
|
37 | 37 | )); |
38 | 38 | |
39 | 39 | $addresses[] = $address1; |
40 | 40 | $addresses[] = $address2; |
41 | 41 | |
42 | 42 | $routeParameters = array( |
43 | - "route_id" => $routeId, |
|
44 | - "addresses" => array($address1, $address2) |
|
43 | + "route_id" => $routeId, |
|
44 | + "addresses" => array($address1, $address2) |
|
45 | 45 | ); |
46 | 46 | |
47 | 47 | $route1 = new Route(); |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $addressRand = (array)$route->GetRandomAddressFromRoute($routeId); |
24 | 24 | |
25 | 25 | if (isset($addressRand['is_depot'])) { |
26 | - if ($addressRand['is_depot']) { |
|
27 | - echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
28 | - return; |
|
29 | - } |
|
26 | + if ($addressRand['is_depot']) { |
|
27 | + echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
28 | + return; |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // Get random address's id from selected route above |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $address = new Address(); |
40 | 40 | |
41 | 41 | $params = array( |
42 | - "route_id" => $routeId, |
|
43 | - "address_id" => $route_destination_id, |
|
44 | - "is_visited" => 1, |
|
45 | - "member_id" => 1 |
|
42 | + "route_id" => $routeId, |
|
43 | + "address_id" => $route_destination_id, |
|
44 | + "is_visited" => 1, |
|
45 | + "member_id" => 1 |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | $result = $address->markAsVisited($params); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $routeParameters = array( |
14 | - 'limit' => 5, |
|
15 | - 'offset' => 0 |
|
14 | + 'limit' => 5, |
|
15 | + 'offset' => 0 |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | $optimizationProblem = new OptimizationProblem(); |
@@ -20,5 +20,5 @@ discard block |
||
20 | 20 | $optimizations = $optimizationProblem->get($routeParameters); |
21 | 21 | |
22 | 22 | foreach ($optimizations as $optimization) { |
23 | - echo "Optimization problem ID -> ".$optimization->optimization_problem_id."<br>"; |
|
23 | + echo "Optimization problem ID -> ".$optimization->optimization_problem_id."<br>"; |
|
24 | 24 | } |