@@ -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 | // Example refers to the process of creating Territory with polygonian shape |
14 | 14 | |
15 | 15 | $territory = new Territory(); |
16 | -$territory->type = TerritoryTypes::POLY; |
|
17 | -$territory->data = array ( |
|
16 | +$territory->type = TerritoryTypes::POLY; |
|
17 | +$territory->data = array( |
|
18 | 18 | "37.769752822786455,-77.67833251953125", |
19 | 19 | "37.75886716305343,-77.68974800109863", |
20 | 20 | "37.74763966054455,-77.6917221069336", |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | "37.76641925847049,-77.66846199035645" |
27 | 27 | ); |
28 | 28 | |
29 | -$TerritoryParameters=Territory::fromArray(array( |
|
30 | - "territory_name" => "Test Polygonian Territory ".strval(rand(10000,99999)), |
|
29 | +$TerritoryParameters = Territory::fromArray(array( |
|
30 | + "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
31 | 31 | "territory_color" => "ff7700", |
32 | 32 | "territory" => $territory |
33 | 33 | )); |
@@ -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; |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | |
16 | 16 | // Add Territory and get territory_id |
17 | 17 | $territory = new Territory(); |
18 | -$territory->type = TerritoryTypes::CIRCLE; |
|
19 | -$territory->data = array ( |
|
18 | +$territory->type = TerritoryTypes::CIRCLE; |
|
19 | +$territory->data = array( |
|
20 | 20 | "37.569752822786455,-77.47833251953125", |
21 | 21 | "5000" |
22 | 22 | ); |
23 | 23 | |
24 | 24 | $TerritoryParameters = Territory::fromArray(array( |
25 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
25 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
26 | 26 | "territory_color" => "ff7700", |
27 | 27 | "territory" => $territory |
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; |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $territory = new Territory(); |
14 | -$territory->type = TerritoryTypes::CIRCLE; |
|
15 | -$territory->data = array ( |
|
14 | +$territory->type = TerritoryTypes::CIRCLE; |
|
15 | +$territory->data = array( |
|
16 | 16 | "37.569752822786455,-77.47833251953125", |
17 | 17 | "5000" |
18 | 18 | ); |
19 | 19 | |
20 | -$TerritoryParameters= Territory::fromArray(array( |
|
21 | - "territory_name" => "Test Territory ".strval(rand(10000,99999)), |
|
20 | +$TerritoryParameters = Territory::fromArray(array( |
|
21 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
22 | 22 | "territory_color" => "ff7700", |
23 | 23 | "territory" => $territory |
24 | 24 | )); |
@@ -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,14 +25,14 @@ discard block |
||
25 | 25 | $json = json_decode(file_get_contents('./addresses.json'), true); |
26 | 26 | |
27 | 27 | $addresses = array(); |
28 | -foreach($json as $address) { |
|
28 | +foreach ($json as $address) { |
|
29 | 29 | $addresses[] = Address::fromArray($address); |
30 | 30 | } |
31 | 31 | |
32 | 32 | $parameters = RouteParameters::fromArray(array( |
33 | 33 | "algorithm_type" => Algorithmtype::CVRP_TW_SD, |
34 | 34 | "route_name" => "Multiple Depot, Multiple Driver, Time Window", |
35 | - "route_date" => time() + 24*60*60, |
|
35 | + "route_date" => time() + 24 * 60 * 60, |
|
36 | 36 | "route_time" => 60 * 60 * 7, |
37 | 37 | "rt" => TRUE, |
38 | 38 | "distance_unit" => DistanceUnit::MILES, |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | 'url' => Endpoint::OPTIMIZATION_PROBLEM, |
94 | 94 | 'method' => 'GET', |
95 | 95 | 'query' => array( |
96 | - 'state' => isset($params['state']) ? $params['state'] : null, |
|
97 | - 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
96 | + 'state' => isset($params['state']) ? $params['state'] : null, |
|
97 | + 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
98 | 98 | 'offset' => isset($params['offset']) ? $params['offset'] : null, |
99 | 99 | 'optimization_problem_id' => isset($params['optimization_problem_id']) |
100 | 100 | ? $params['optimization_problem_id'] : null, |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | if (isset($optimize['optimizations'])) { |
107 | 107 | $problems = array(); |
108 | 108 | |
109 | - foreach($optimize['optimizations'] as $problem) { |
|
109 | + foreach ($optimize['optimizations'] as $problem) { |
|
110 | 110 | $problems[] = OptimizationProblem::fromArray($problem); |
111 | 111 | } |
112 | 112 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | return $this->routes; |
152 | 152 | } |
153 | 153 | |
154 | - public function getRandomOptimizationId($offset,$limit) |
|
154 | + public function getRandomOptimizationId($offset, $limit) |
|
155 | 155 | { |
156 | 156 | $query['limit'] = isset($params['limit']) ? $params['limit'] : 30; |
157 | 157 | $query['offset'] = isset($params['offset']) ? $params['offset'] : 0; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | )); |
164 | 164 | |
165 | 165 | $optimizations = array(); |
166 | - foreach($json as $optimization) { |
|
166 | + foreach ($json as $optimization) { |
|
167 | 167 | if (gettype($optimization)!="array") continue; |
168 | 168 | |
169 | 169 | foreach ($optimization as $otp1) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | - $num = rand(0,sizeof($optimizations)-1); |
|
174 | + $num = rand(0, sizeof($optimizations) - 1); |
|
175 | 175 | |
176 | 176 | $rOptimization = $optimizations[$num]; |
177 | 177 | |
@@ -180,9 +180,9 @@ discard block |
||
180 | 180 | |
181 | 181 | public function getAddresses($opt_id) |
182 | 182 | { |
183 | - if ($opt_id == null) return null; |
|
183 | + if ($opt_id==null) return null; |
|
184 | 184 | |
185 | - $params = array( "optimization_problem_id" => $opt_id ); |
|
185 | + $params = array("optimization_problem_id" => $opt_id); |
|
186 | 186 | |
187 | 187 | $optimization = (array)$this->get($params); |
188 | 188 | |
@@ -195,12 +195,12 @@ discard block |
||
195 | 195 | { |
196 | 196 | $addresses = (array)$this->getAddresses($opt_id); |
197 | 197 | |
198 | - if ($addresses == null) { |
|
198 | + if ($addresses==null) { |
|
199 | 199 | echo "There are no addresses in this optimization!.. Try again."; |
200 | 200 | return null; |
201 | 201 | } |
202 | 202 | |
203 | - $num = rand(0,sizeof($addresses)-1); |
|
203 | + $num = rand(0, sizeof($addresses) - 1); |
|
204 | 204 | |
205 | 205 | $rAddress = $addresses[$num]; |
206 | 206 |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | public $custom_user_fields; |
62 | 62 | |
63 | 63 | public static function fromArray(array $params) { |
64 | - $order= new Order(); |
|
65 | - foreach($params as $key => $value) { |
|
64 | + $order = new Order(); |
|
65 | + foreach ($params as $key => $value) { |
|
66 | 66 | if (property_exists($order, $key)) { |
67 | 67 | $order->{$key} = $value; |
68 | 68 | } |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | 'url' => Endpoint::ORDER_V4, |
78 | 78 | 'method' => 'POST', |
79 | 79 | 'body' => array( |
80 | - 'address_1' => isset($params->address_1) ? $params->address_1: null, |
|
81 | - 'address_2' => isset($params->address_2) ? $params->address_2: null, |
|
82 | - 'member_id' => isset($params->member_id) ? $params->member_id: null, |
|
80 | + 'address_1' => isset($params->address_1) ? $params->address_1 : null, |
|
81 | + 'address_2' => isset($params->address_2) ? $params->address_2 : null, |
|
82 | + 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
83 | 83 | 'cached_lat' => isset($params->cached_lat) ? $params->cached_lat : null, |
84 | 84 | 'cached_lng' => isset($params->cached_lng) ? $params->cached_lng : null, |
85 | 85 | 'curbside_lat' => isset($params->curbside_lat) ? $params->curbside_lat : null, |
@@ -88,40 +88,40 @@ discard block |
||
88 | 88 | 'order_icon' => isset($params->order_icon) ? $params->order_icon : null, |
89 | 89 | 'day_scheduled_for_YYMMDD' => isset($params->day_scheduled_for_YYMMDD) ? $params->day_scheduled_for_YYMMDD : null, |
90 | 90 | 'address_alias' => isset($params->address_alias) ? $params->address_alias : null, |
91 | - 'address_city' => isset($params->address_city) ? $params->address_city: null, |
|
92 | - 'address_state_id' => isset($params->address_state_id) ? $params->address_state_id: null, |
|
93 | - 'address_country_id' => isset($params->address_country_id) ? $params->address_country_id: null, |
|
94 | - 'address_zip' => isset($params->address_zip) ? $params->address_zip: null, |
|
95 | - 'local_time_window_start' => isset($params->local_time_window_start) ? $params->local_time_window_start: null, |
|
96 | - 'local_time_window_end' => isset($params->local_time_window_end) ? $params->local_time_window_end: null, |
|
97 | - 'local_time_window_start_2' => isset($params->local_time_window_start_2) ? $params->local_time_window_start_2: null, |
|
98 | - 'local_time_window_end_2' => isset($params->local_time_window_end_2) ? $params->local_time_window_end_2: null, |
|
99 | - 'service_time' => isset($params->service_time) ? $params->service_time: null, |
|
100 | - 'local_timezone_string' => isset($params->local_timezone_string) ? $params->local_timezone_string: null, |
|
101 | - 'EXT_FIELD_first_name' => isset($params->EXT_FIELD_first_name) ? $params->EXT_FIELD_first_name: null, |
|
102 | - 'EXT_FIELD_last_name' => isset($params->EXT_FIELD_last_name) ? $params->EXT_FIELD_last_name: null, |
|
103 | - 'EXT_FIELD_email' => isset($params->EXT_FIELD_email) ? $params->EXT_FIELD_email: null, |
|
104 | - 'EXT_FIELD_phone' => isset($params->EXT_FIELD_phone) ? $params->EXT_FIELD_phone: null, |
|
105 | - 'EXT_FIELD_custom_data' => isset($params->EXT_FIELD_custom_data) ? $params->EXT_FIELD_custom_data: null, |
|
106 | - 'is_validated' => isset($params->is_validated) ? $params->is_validated: null, |
|
107 | - 'is_pending' => isset($params->is_pending) ? $params->is_pending: null, |
|
108 | - 'is_accepted' => isset($params->is_accepted) ? $params->is_accepted: null, |
|
109 | - 'is_started' => isset($params->is_started) ? $params->is_started: null, |
|
110 | - 'is_completed' => isset($params->is_completed) ? $params->is_completed: null, |
|
111 | - 'custom_user_fields' => isset($params->custom_user_fields) ? $params->custom_user_fields: null |
|
91 | + 'address_city' => isset($params->address_city) ? $params->address_city : null, |
|
92 | + 'address_state_id' => isset($params->address_state_id) ? $params->address_state_id : null, |
|
93 | + 'address_country_id' => isset($params->address_country_id) ? $params->address_country_id : null, |
|
94 | + 'address_zip' => isset($params->address_zip) ? $params->address_zip : null, |
|
95 | + 'local_time_window_start' => isset($params->local_time_window_start) ? $params->local_time_window_start : null, |
|
96 | + 'local_time_window_end' => isset($params->local_time_window_end) ? $params->local_time_window_end : null, |
|
97 | + 'local_time_window_start_2' => isset($params->local_time_window_start_2) ? $params->local_time_window_start_2 : null, |
|
98 | + 'local_time_window_end_2' => isset($params->local_time_window_end_2) ? $params->local_time_window_end_2 : null, |
|
99 | + 'service_time' => isset($params->service_time) ? $params->service_time : null, |
|
100 | + 'local_timezone_string' => isset($params->local_timezone_string) ? $params->local_timezone_string : null, |
|
101 | + 'EXT_FIELD_first_name' => isset($params->EXT_FIELD_first_name) ? $params->EXT_FIELD_first_name : null, |
|
102 | + 'EXT_FIELD_last_name' => isset($params->EXT_FIELD_last_name) ? $params->EXT_FIELD_last_name : null, |
|
103 | + 'EXT_FIELD_email' => isset($params->EXT_FIELD_email) ? $params->EXT_FIELD_email : null, |
|
104 | + 'EXT_FIELD_phone' => isset($params->EXT_FIELD_phone) ? $params->EXT_FIELD_phone : null, |
|
105 | + 'EXT_FIELD_custom_data' => isset($params->EXT_FIELD_custom_data) ? $params->EXT_FIELD_custom_data : null, |
|
106 | + 'is_validated' => isset($params->is_validated) ? $params->is_validated : null, |
|
107 | + 'is_pending' => isset($params->is_pending) ? $params->is_pending : null, |
|
108 | + 'is_accepted' => isset($params->is_accepted) ? $params->is_accepted : null, |
|
109 | + 'is_started' => isset($params->is_started) ? $params->is_started : null, |
|
110 | + 'is_completed' => isset($params->is_completed) ? $params->is_completed : null, |
|
111 | + 'custom_user_fields' => isset($params->custom_user_fields) ? $params->custom_user_fields : null |
|
112 | 112 | ) |
113 | 113 | )); |
114 | 114 | |
115 | 115 | return $response; |
116 | 116 | } |
117 | 117 | |
118 | - public static function addOrder2Route($params,$body) |
|
118 | + public static function addOrder2Route($params, $body) |
|
119 | 119 | { |
120 | 120 | $response = Route4Me::makeRequst(array( |
121 | 121 | 'url' => Endpoint::ROUTE_V4, |
122 | 122 | 'method' => 'PUT', |
123 | 123 | 'query' => array( |
124 | - 'route_id' => isset($params->route_id) ? $params->route_id: null, |
|
124 | + 'route_id' => isset($params->route_id) ? $params->route_id : null, |
|
125 | 125 | 'redirect' => isset($params->redirect) ? $params->redirect : null |
126 | 126 | ), |
127 | 127 | 'body' => (array)$body |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $response; |
131 | 131 | } |
132 | 132 | |
133 | - public static function addOrder2Optimization($params,$body) |
|
133 | + public static function addOrder2Optimization($params, $body) |
|
134 | 134 | { |
135 | 135 | $response = Route4Me::makeRequst(array( |
136 | 136 | 'url' => Endpoint::OPTIMIZATION_PROBLEM, |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | 'url' => Endpoint::ORDER_V4, |
153 | 153 | 'method' => 'GET', |
154 | 154 | 'query' => array( |
155 | - 'order_id' => isset($params->order_id) ? $params->order_id: null, |
|
156 | - 'fields' => isset($params->fields) ? $params->fields: null, |
|
157 | - 'day_added_YYMMDD' => isset($params->day_added_YYMMDD) ? $params->day_added_YYMMDD: null, |
|
158 | - 'scheduled_for_YYMMDD' => isset($params->scheduled_for_YYMMDD) ? $params->scheduled_for_YYMMDD: null, |
|
159 | - 'query' => isset($params->query) ? $params->query: null, |
|
160 | - 'offset' => isset($params->offset) ? $params->offset: null, |
|
161 | - 'limit' => isset($params->limit) ? $params->limit: null |
|
155 | + 'order_id' => isset($params->order_id) ? $params->order_id : null, |
|
156 | + 'fields' => isset($params->fields) ? $params->fields : null, |
|
157 | + 'day_added_YYMMDD' => isset($params->day_added_YYMMDD) ? $params->day_added_YYMMDD : null, |
|
158 | + 'scheduled_for_YYMMDD' => isset($params->scheduled_for_YYMMDD) ? $params->scheduled_for_YYMMDD : null, |
|
159 | + 'query' => isset($params->query) ? $params->query : null, |
|
160 | + 'offset' => isset($params->offset) ? $params->offset : null, |
|
161 | + 'limit' => isset($params->limit) ? $params->limit : null |
|
162 | 162 | ) |
163 | 163 | )); |
164 | 164 | |
@@ -171,15 +171,15 @@ discard block |
||
171 | 171 | 'url' => Endpoint::ORDER_V4, |
172 | 172 | 'method' => 'GET', |
173 | 173 | 'query' => array( |
174 | - 'offset' => isset($params->offset) ? $params->offset: null, |
|
175 | - 'limit' => isset($params->limit) ? $params->limit: null |
|
174 | + 'offset' => isset($params->offset) ? $params->offset : null, |
|
175 | + 'limit' => isset($params->limit) ? $params->limit : null |
|
176 | 176 | ) |
177 | 177 | )); |
178 | 178 | |
179 | 179 | return $response; |
180 | 180 | } |
181 | 181 | |
182 | - public function getRandomOrderId($offset,$limit) |
|
182 | + public function getRandomOrderId($offset, $limit) |
|
183 | 183 | { |
184 | 184 | $params = array('offset' => $offset, 'limit' => $limit); |
185 | 185 | |
@@ -188,14 +188,14 @@ discard block |
||
188 | 188 | if (is_null($orders)) return null; |
189 | 189 | if (!isset($orders['results'])) return null; |
190 | 190 | |
191 | - $randomIndex = rand(0, sizeof($orders['results'])-1); |
|
191 | + $randomIndex = rand(0, sizeof($orders['results']) - 1); |
|
192 | 192 | |
193 | 193 | $order = $orders['results'][$randomIndex]; |
194 | 194 | |
195 | 195 | return $order['order_id']; |
196 | 196 | } |
197 | 197 | |
198 | - public function getRandomOrder($offset,$limit) |
|
198 | + public function getRandomOrder($offset, $limit) |
|
199 | 199 | { |
200 | 200 | $params = array('offset' => $offset, 'limit' => $limit); |
201 | 201 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | if (is_null($orders)) return null; |
205 | 205 | if (!isset($orders['results'])) return null; |
206 | 206 | |
207 | - $randomIndex = rand(0, sizeof($orders['results'])-1); |
|
207 | + $randomIndex = rand(0, sizeof($orders['results']) - 1); |
|
208 | 208 | |
209 | 209 | $order = $orders['results'][$randomIndex]; |
210 | 210 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | 'url' => Endpoint::ORDER_V4, |
218 | 218 | 'method' => 'DELETE', |
219 | 219 | 'body' => array( |
220 | - 'order_ids' => isset($params->order_ids) ? $params->order_ids: null |
|
220 | + 'order_ids' => isset($params->order_ids) ? $params->order_ids : null |
|
221 | 221 | ) |
222 | 222 | )); |
223 | 223 | |
@@ -241,12 +241,12 @@ discard block |
||
241 | 241 | 'url' => Endpoint::ORDER_V4, |
242 | 242 | 'method' => 'GET', |
243 | 243 | 'query' => array( |
244 | - 'day_added_YYMMDD' => isset($params->day_added_YYMMDD) ? $params->day_added_YYMMDD: null, |
|
245 | - 'scheduled_for_YYMMDD' => isset($params->scheduled_for_YYMMDD) ? $params->scheduled_for_YYMMDD: null, |
|
246 | - 'fields' => isset($params->fields) ? $params->fields: null, |
|
247 | - 'offset' => isset($params->offset) ? $params->offset: null, |
|
248 | - 'limit' => isset($params->limit) ? $params->limit: null, |
|
249 | - 'query' => isset($params->query) ? $params->query: null, |
|
244 | + 'day_added_YYMMDD' => isset($params->day_added_YYMMDD) ? $params->day_added_YYMMDD : null, |
|
245 | + 'scheduled_for_YYMMDD' => isset($params->scheduled_for_YYMMDD) ? $params->scheduled_for_YYMMDD : null, |
|
246 | + 'fields' => isset($params->fields) ? $params->fields : null, |
|
247 | + 'offset' => isset($params->offset) ? $params->offset : null, |
|
248 | + 'limit' => isset($params->limit) ? $params->limit : null, |
|
249 | + 'query' => isset($params->query) ? $params->query : null, |
|
250 | 250 | ) |
251 | 251 | )); |
252 | 252 | |
@@ -283,19 +283,19 @@ discard block |
||
283 | 283 | $columns = fgetcsv($csvFileHandle, $max_line_length, $delemietr); |
284 | 284 | |
285 | 285 | if (!empty($columns)) { |
286 | - array_push($results['fail'],'Empty CSV table'); |
|
286 | + array_push($results['fail'], 'Empty CSV table'); |
|
287 | 287 | return ($results); |
288 | 288 | } |
289 | 289 | |
290 | - $iRow=1; |
|
290 | + $iRow = 1; |
|
291 | 291 | |
292 | - while (($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr)) !== false) { |
|
293 | - if ($rows[$ordersFieldsMapping['cached_lat']] && $rows[$ordersFieldsMapping['cached_lng']] && $rows[$ordersFieldsMapping['address_1']] && array(null) !== $rows) { |
|
292 | + while (($rows = fgetcsv($csvFileHandle, $max_line_length, $delemietr))!==false) { |
|
293 | + if ($rows[$ordersFieldsMapping['cached_lat']] && $rows[$ordersFieldsMapping['cached_lng']] && $rows[$ordersFieldsMapping['address_1']] && array(null)!==$rows) { |
|
294 | 294 | |
295 | 295 | $cached_lat = 0.000; |
296 | 296 | |
297 | 297 | if (!$this->validateLatitude($rows[$ordersFieldsMapping['cached_lat']])) { |
298 | - array_push($results['fail'],"$iRow --> Wrong cached_lat"); |
|
298 | + array_push($results['fail'], "$iRow --> Wrong cached_lat"); |
|
299 | 299 | $iRow++; |
300 | 300 | continue; |
301 | 301 | } |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $cached_lng = 0.000; |
305 | 305 | |
306 | 306 | if (!$this->validateLongitude($rows[$ordersFieldsMapping['cached_lng']])) { |
307 | - array_push($results['fail'],"$iRow --> Wrong cached_lng"); |
|
307 | + array_push($results['fail'], "$iRow --> Wrong cached_lng"); |
|
308 | 308 | $iRow++; |
309 | 309 | continue; |
310 | 310 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | if (isset($ordersFieldsMapping['curbside_lat'])) { |
314 | 314 | if (!$this->validateLatitude($rows[$ordersFieldsMapping['curbside_lat']])) { |
315 | - array_push($results['fail'],"$iRow --> Wrong curbside_lat"); |
|
315 | + array_push($results['fail'], "$iRow --> Wrong curbside_lat"); |
|
316 | 316 | $iRow++; |
317 | 317 | continue; |
318 | 318 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | |
321 | 321 | if (isset($ordersFieldsMapping['curbside_lng'])) { |
322 | 322 | if (!$this->validateLongitude($rows[$ordersFieldsMapping['curbside_lng']])) { |
323 | - array_push($results['fail'],"$iRow --> Wrong curbside_lng"); |
|
323 | + array_push($results['fail'], "$iRow --> Wrong curbside_lng"); |
|
324 | 324 | $iRow++; |
325 | 325 | continue; |
326 | 326 | } |
@@ -328,10 +328,10 @@ discard block |
||
328 | 328 | |
329 | 329 | $address = $rows[$ordersFieldsMapping['address_1']]; |
330 | 330 | |
331 | - if (isset($ordersFieldsMapping['order_city'])) $address.=', '.$rows[$ordersFieldsMapping['order_city']]; |
|
332 | - if (isset($ordersFieldsMapping['order_state_id'])) $address.=', '.$rows[$ordersFieldsMapping['order_state_id']]; |
|
333 | - if (isset($ordersFieldsMapping['order_zip_code'])) $address.=', '.$rows[$ordersFieldsMapping['order_zip_code']]; |
|
334 | - if (isset($ordersFieldsMapping['order_country_id'])) $address.=', '.$rows[$ordersFieldsMapping['order_country_id']]; |
|
331 | + if (isset($ordersFieldsMapping['order_city'])) $address .= ', '.$rows[$ordersFieldsMapping['order_city']]; |
|
332 | + if (isset($ordersFieldsMapping['order_state_id'])) $address .= ', '.$rows[$ordersFieldsMapping['order_state_id']]; |
|
333 | + if (isset($ordersFieldsMapping['order_zip_code'])) $address .= ', '.$rows[$ordersFieldsMapping['order_zip_code']]; |
|
334 | + if (isset($ordersFieldsMapping['order_country_id'])) $address .= ', '.$rows[$ordersFieldsMapping['order_country_id']]; |
|
335 | 335 | |
336 | 336 | echo "$iRow --> ".$ordersFieldsMapping['day_scheduled_for_YYMMDD'].", ".$rows[$ordersFieldsMapping['day_scheduled_for_YYMMDD']]."<br>"; |
337 | 337 | |
@@ -373,10 +373,10 @@ discard block |
||
373 | 373 | |
374 | 374 | $orderResults = $order->addOrder($orderParameters); |
375 | 375 | |
376 | - array_push($results['success'],"The order with order_id = ".strval($orderResults["order_id"])." added successfuly."); |
|
376 | + array_push($results['success'], "The order with order_id = ".strval($orderResults["order_id"])." added successfuly."); |
|
377 | 377 | } |
378 | 378 | else { |
379 | - array_push($results['fail'],"$iRow --> one of the parameters cached_lat, cached_lng, address_1 is not set"); |
|
379 | + array_push($results['fail'], "$iRow --> one of the parameters cached_lat, cached_lng, address_1 is not set"); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | $iRow++; |
@@ -19,7 +19,7 @@ discard block |
||
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 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public static function forwardGeocoding($params) |
32 | 32 | { |
33 | 33 | $body = array( |
34 | - 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat']: null, |
|
34 | + 'strExportFormat' => isset($params['strExportFormat']) ? $params['strExportFormat'] : null, |
|
35 | 35 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
36 | 36 | ); |
37 | 37 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | public static function reverseGeocoding($params) |
49 | 49 | { |
50 | 50 | $query = array( |
51 | - 'format' => isset($params['format']) ? $params['format']: null, |
|
51 | + 'format' => isset($params['format']) ? $params['format'] : null, |
|
52 | 52 | 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
53 | 53 | 'detailed' => isset($params['detailed']) ? $params['detailed'] : null, |
54 | 54 | ); |
@@ -67,15 +67,15 @@ discard block |
||
67 | 67 | $url_query = Endpoint::STREET_DATA; |
68 | 68 | |
69 | 69 | if (isset($params['pk'])) { |
70 | - $url_query.=$params['pk'].'/'; |
|
70 | + $url_query .= $params['pk'].'/'; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if (isset($params['offset'])) { |
74 | - $url_query.=$params['offset'].'/'; |
|
74 | + $url_query .= $params['offset'].'/'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | if (isset($params['limit'])) { |
78 | - $url_query.=$params['limit'].'/'; |
|
78 | + $url_query .= $params['limit'].'/'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $query = array(); |
@@ -93,15 +93,15 @@ discard block |
||
93 | 93 | $url_query = Endpoint::STREET_DATA_ZIPCODE; |
94 | 94 | |
95 | 95 | if (isset($params['zipcode'])) { |
96 | - $url_query.=$params['zipcode'].'/'; |
|
96 | + $url_query .= $params['zipcode'].'/'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if (isset($params['offset'])) { |
100 | - $url_query.=$params['offset'].'/'; |
|
100 | + $url_query .= $params['offset'].'/'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | if (isset($params['limit'])) { |
104 | - $url_query.=$params['limit'].'/'; |
|
104 | + $url_query .= $params['limit'].'/'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | $query = array(); |
@@ -119,19 +119,19 @@ discard block |
||
119 | 119 | $url_query = Endpoint::STREET_DATA_SERVICE; |
120 | 120 | |
121 | 121 | if (isset($params['zipcode'])) { |
122 | - $url_query.=$params['zipcode'].'/'; |
|
122 | + $url_query .= $params['zipcode'].'/'; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if (isset($params['housenumber'])) { |
126 | - $url_query.=$params['housenumber'].'/'; |
|
126 | + $url_query .= $params['housenumber'].'/'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if (isset($params['offset'])) { |
130 | - $url_query.=$params['offset'].'/'; |
|
130 | + $url_query .= $params['offset'].'/'; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | if (isset($params['limit'])) { |
134 | - $url_query.=$params['limit'].'/'; |
|
134 | + $url_query .= $params['limit'].'/'; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $query = array(); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $activityparameters = new ActivityParameters(); |
35 | 35 | |
36 | - foreach($params as $key => $value) { |
|
36 | + foreach ($params as $key => $value) { |
|
37 | 37 | if (property_exists($activityparameters, $key)) { |
38 | 38 | $activityparameters->{$key} = $value; |
39 | 39 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | |
8 | 8 | class Territory extends Common |
9 | 9 | { |
10 | - public $territory_id; // Territory id |
|
10 | + public $territory_id; // Territory id |
|
11 | 11 | public $territory_name; |
12 | 12 | public $territory_color; |
13 | 13 | public $addresses; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $territoryparameters = new Territory(); |
31 | 31 | |
32 | - foreach($params as $key => $value) { |
|
32 | + foreach ($params as $key => $value) { |
|
33 | 33 | if (property_exists($territoryparameters, $key)) { |
34 | 34 | $territoryparameters->{$key} = $value; |
35 | 35 | } |