@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
5 | 5 | |
6 | - require $vdir.'/../vendor/autoload.php'; |
|
6 | + require $vdir.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | use Route4Me\Route4Me; |
9 | 9 | use Route4Me\Member; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | $vdir=$_SERVER['DOCUMENT_ROOT'].'/route4me/examples/'; |
3 | - require $vdir.'/../vendor/autoload.php'; |
|
3 | + require $vdir.'/../vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | use Route4Me\MyQ; |
6 | 6 |
@@ -68,60 +68,60 @@ discard block |
||
68 | 68 | |
69 | 69 | public static function fromArray(array $params) { |
70 | 70 | $member= new Member(); |
71 | - foreach($params as $key => $value) { |
|
72 | - if (property_exists($member, $key)) { |
|
73 | - $member->{$key} = $value; |
|
74 | - } |
|
71 | + foreach($params as $key => $value) { |
|
72 | + if (property_exists($member, $key)) { |
|
73 | + $member->{$key} = $value; |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $member; |
78 | 78 | } |
79 | 79 | |
80 | 80 | public static function getUsers() |
81 | - { |
|
82 | - $response = Route4Me::makeRequst(array( |
|
83 | - 'url' => self::$apiUrl, |
|
84 | - 'method' => 'GET' |
|
85 | - )); |
|
81 | + { |
|
82 | + $response = Route4Me::makeRequst(array( |
|
83 | + 'url' => self::$apiUrl, |
|
84 | + 'method' => 'GET' |
|
85 | + )); |
|
86 | 86 | //var_dump($response); die(""); |
87 | 87 | return $response; |
88 | 88 | } |
89 | 89 | |
90 | 90 | public static function getUser($params) |
91 | - { |
|
92 | - $response = Route4Me::makeRequst(array( |
|
93 | - 'url' => self::$apiUrl, |
|
94 | - 'method' => 'GET', |
|
95 | - 'query' => array( |
|
96 | - 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
91 | + { |
|
92 | + $response = Route4Me::makeRequst(array( |
|
93 | + 'url' => self::$apiUrl, |
|
94 | + 'method' => 'GET', |
|
95 | + 'query' => array( |
|
96 | + 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
97 | 97 | ) |
98 | - )); |
|
98 | + )); |
|
99 | 99 | //var_dump($response); die(""); |
100 | 100 | return $response; |
101 | 101 | } |
102 | 102 | |
103 | 103 | public static function getUserLocations($param) |
104 | - { |
|
105 | - $response = Route4Me::makeRequst(array( |
|
106 | - 'url' => self::$apiUserLocations, |
|
107 | - 'method' => 'GET', |
|
108 | - 'query' => array( |
|
109 | - 'query' => $param |
|
104 | + { |
|
105 | + $response = Route4Me::makeRequst(array( |
|
106 | + 'url' => self::$apiUserLocations, |
|
107 | + 'method' => 'GET', |
|
108 | + 'query' => array( |
|
109 | + 'query' => $param |
|
110 | 110 | ) |
111 | - )); |
|
111 | + )); |
|
112 | 112 | //var_dump($response); die(""); |
113 | 113 | return $response; |
114 | 114 | } |
115 | 115 | |
116 | 116 | public static function addDeviceRecord($body) |
117 | - { |
|
118 | - $response = Route4Me::makeRequst(array( |
|
119 | - 'url' => self::$apiUrlDevice, |
|
120 | - 'method' => 'POST', |
|
121 | - 'body' => array( |
|
117 | + { |
|
118 | + $response = Route4Me::makeRequst(array( |
|
119 | + 'url' => self::$apiUrlDevice, |
|
120 | + 'method' => 'POST', |
|
121 | + 'body' => array( |
|
122 | 122 | 'device_id' => isset($body->device_id) ? $body->device_id: null, |
123 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | - 'format' => isset($body->format) ? $body->format : null |
|
123 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
124 | + 'format' => isset($body->format) ? $body->format : null |
|
125 | 125 | ) |
126 | 126 | |
127 | 127 | )); |
@@ -129,25 +129,25 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | public static function createMember($body) |
132 | - { |
|
133 | - $response = Route4Me::makeRequst(array( |
|
134 | - 'url' => self::$apiUrl, |
|
135 | - 'method' => 'POST', |
|
136 | - 'body' => array( |
|
132 | + { |
|
133 | + $response = Route4Me::makeRequst(array( |
|
134 | + 'url' => self::$apiUrl, |
|
135 | + 'method' => 'POST', |
|
136 | + 'body' => array( |
|
137 | 137 | 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
138 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
138 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
139 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
140 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
141 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
142 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
143 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
144 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
145 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
146 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
147 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
148 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
149 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
150 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
151 | 151 | ) |
152 | 152 | |
153 | 153 | )); |
@@ -155,26 +155,26 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | public static function updateMember($body) |
158 | - { |
|
159 | - $response = Route4Me::makeRequst(array( |
|
160 | - 'url' => self::$apiUrl, |
|
161 | - 'method' => 'PUT', |
|
162 | - 'body' => array( |
|
158 | + { |
|
159 | + $response = Route4Me::makeRequst(array( |
|
160 | + 'url' => self::$apiUrl, |
|
161 | + 'method' => 'PUT', |
|
162 | + 'body' => array( |
|
163 | 163 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
164 | - 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | - 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | - 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | - 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | - 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | - 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | - 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | - 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | - 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | - 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | - 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | - 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | - 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | - 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
164 | + 'member_phone' => isset($body->member_phone) ? $body->member_phone : null, |
|
165 | + 'HIDE_ROUTED_ADDRESSES' => isset($body->HIDE_ROUTED_ADDRESSES) ? $body->HIDE_ROUTED_ADDRESSES: null, |
|
166 | + 'member_zipcode' => isset($body->member_zipcode) ? $body->member_zipcode : null, |
|
167 | + 'route_count' => isset($body->route_count) ? $body->route_count : null, |
|
168 | + 'member_email' => isset($body->member_email) ? $body->member_email : null, |
|
169 | + 'HIDE_VISITED_ADDRESSES' => isset($body->HIDE_VISITED_ADDRESSES) ? $body->HIDE_VISITED_ADDRESSES : null, |
|
170 | + 'READONLY_USER' => isset($body->READONLY_USER) ? $body->READONLY_USER : null, |
|
171 | + 'date_of_birth' => isset($body->date_of_birth) ? $body->date_of_birth : null, |
|
172 | + 'member_first_name' => isset($body->member_first_name) ? $body->member_first_name : null, |
|
173 | + 'member_password' => isset($body->member_password) ? $body->member_password : null, |
|
174 | + 'HIDE_NONFUTURE_ROUTES' => isset($body->HIDE_NONFUTURE_ROUTES) ? $body->HIDE_NONFUTURE_ROUTES : null, |
|
175 | + 'member_last_name' => isset($body->member_last_name) ? $body->member_last_name : null, |
|
176 | + 'SHOW_ALL_VEHICLES' => isset($body->SHOW_ALL_VEHICLES) ? $body->SHOW_ALL_VEHICLES : null, |
|
177 | + 'SHOW_ALL_DRIVERS' => isset($body->SHOW_ALL_DRIVERS) ? $body->SHOW_ALL_DRIVERS : null |
|
178 | 178 | ) |
179 | 179 | |
180 | 180 | )); |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | public static function deleteMember($body) |
185 | - { |
|
186 | - $response = Route4Me::makeRequst(array( |
|
187 | - 'url' => self::$apiUrl, |
|
188 | - 'method' => 'DELETE', |
|
189 | - 'body' => array( |
|
185 | + { |
|
186 | + $response = Route4Me::makeRequst(array( |
|
187 | + 'url' => self::$apiUrl, |
|
188 | + 'method' => 'DELETE', |
|
189 | + 'body' => array( |
|
190 | 190 | 'member_id' => isset($body->member_id) ? $body->member_id: null |
191 | 191 | ) |
192 | 192 | |
@@ -195,50 +195,50 @@ discard block |
||
195 | 195 | } |
196 | 196 | |
197 | 197 | public static function newAccountRegistration($body) |
198 | - { |
|
199 | - $response = Route4Me::makeRequst(array( |
|
200 | - 'url' => self::$apiUrlRegistr, |
|
201 | - 'method' => 'POST', |
|
202 | - 'body' => array( |
|
198 | + { |
|
199 | + $response = Route4Me::makeRequst(array( |
|
200 | + 'url' => self::$apiUrlRegistr, |
|
201 | + 'method' => 'POST', |
|
202 | + 'body' => array( |
|
203 | 203 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
204 | - 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | - 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | - 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | - 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | - 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | - 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | - 'plan' => isset($body->plan) ? $body->plan: null, |
|
211 | - 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType: null, |
|
212 | - 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing: false, |
|
213 | - 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail: false |
|
204 | + 'strPassword_1' => isset($body->strPassword_1) ? $body->strPassword_1 : null, |
|
205 | + 'strPassword_2' => isset($body->strPassword_2) ? $body->strPassword_2 : null, |
|
206 | + 'strFirstName' => isset($body->strFirstName) ? $body->strFirstName: null, |
|
207 | + 'strLastName' => isset($body->strLastName) ? $body->strLastName: null, |
|
208 | + 'strIndustry' => isset($body->strIndustry) ? $body->strIndustry: null, |
|
209 | + 'chkTerms' => isset($body->chkTerms) ? $body->chkTerms: null, |
|
210 | + 'plan' => isset($body->plan) ? $body->plan: null, |
|
211 | + 'strSubAccountType' => isset($body->strSubAccountType) ? $body->strSubAccountType: null, |
|
212 | + 'blDisableMarketing' => isset($body->blDisableMarketing) ? $body->blDisableMarketing: false, |
|
213 | + 'blDisableAccountActivationEmail' => isset($body->blDisableAccountActivationEmail) ? $body->blDisableAccountActivationEmail: false |
|
214 | 214 | ) |
215 | 215 | )); |
216 | 216 | return $response; |
217 | 217 | } |
218 | 218 | |
219 | 219 | public static function validateSession($params) |
220 | - { |
|
221 | - $response = Route4Me::makeRequst(array( |
|
222 | - 'url' => self::$apiUrlSessValid, |
|
223 | - 'method' => 'GET', |
|
224 | - 'query' => array( |
|
220 | + { |
|
221 | + $response = Route4Me::makeRequst(array( |
|
222 | + 'url' => self::$apiUrlSessValid, |
|
223 | + 'method' => 'GET', |
|
224 | + 'query' => array( |
|
225 | 225 | 'session_guid' => isset($params->session_guid) ? $params->session_guid: null, |
226 | - 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
227 | - 'format' => isset($params->format) ? $params->format : null |
|
226 | + 'member_id' => isset($params->member_id) ? $params->member_id : null, |
|
227 | + 'format' => isset($params->format) ? $params->format : null |
|
228 | 228 | ) |
229 | 229 | )); |
230 | 230 | return $response; |
231 | 231 | } |
232 | 232 | |
233 | 233 | public static function memberAuthentication($body) |
234 | - { |
|
235 | - $response = Route4Me::makeRequst(array( |
|
236 | - 'url' => self::$apiUrlAuthen, |
|
237 | - 'method' => 'POST', |
|
238 | - 'body' => array( |
|
234 | + { |
|
235 | + $response = Route4Me::makeRequst(array( |
|
236 | + 'url' => self::$apiUrlAuthen, |
|
237 | + 'method' => 'POST', |
|
238 | + 'body' => array( |
|
239 | 239 | 'strEmail' => isset($body->strEmail) ? $body->strEmail: null, |
240 | - 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
241 | - 'format' => isset($body->format) ? $body->format : null |
|
240 | + 'strPassword' => isset($body->strPassword) ? $body->strPassword : null, |
|
241 | + 'format' => isset($body->format) ? $body->format : null |
|
242 | 242 | ) |
243 | 243 | |
244 | 244 | )); |
@@ -246,18 +246,18 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | public static function webinarRegistration($body) |
249 | - { |
|
250 | - $response = Route4Me::makeRequst(array( |
|
251 | - 'url' => self::$apiUrlWebinar, |
|
252 | - 'method' => 'POST', |
|
253 | - 'body' => array( |
|
249 | + { |
|
250 | + $response = Route4Me::makeRequst(array( |
|
251 | + 'url' => self::$apiUrlWebinar, |
|
252 | + 'method' => 'POST', |
|
253 | + 'body' => array( |
|
254 | 254 | 'email_address' => isset($body->email_address) ? $body->email_address: null, |
255 | - 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
256 | - 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
257 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
258 | - 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
259 | - 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
260 | - 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
255 | + 'first_name' => isset($body->first_name) ? $body->first_name : null, |
|
256 | + 'last_name' => isset($body->last_name) ? $body->last_name : null, |
|
257 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
258 | + 'phone_number' => isset($body->phone_number) ? $body->phone_number : null, |
|
259 | + 'member_id' => isset($body->member_id) ? $body->member_id : null, |
|
260 | + 'webiinar_date' => isset($body->webiinar_date) ? $body->webiinar_date : null, |
|
261 | 261 | ) |
262 | 262 | |
263 | 263 | )); |
@@ -265,19 +265,19 @@ discard block |
||
265 | 265 | } |
266 | 266 | |
267 | 267 | public static function purchaseUserLicense($body) |
268 | - { |
|
269 | - $response = Route4Me::makeRequst(array( |
|
270 | - 'url' => self::$apiUrlLicense, |
|
271 | - 'method' => 'POST', |
|
272 | - 'body' => array( |
|
268 | + { |
|
269 | + $response = Route4Me::makeRequst(array( |
|
270 | + 'url' => self::$apiUrlLicense, |
|
271 | + 'method' => 'POST', |
|
272 | + 'body' => array( |
|
273 | 273 | 'member_id' => isset($body->member_id) ? $body->member_id: null, |
274 | - 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
275 | - 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
276 | - 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
277 | - 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
278 | - 'token' => isset($body->token) ? $body->token : null, |
|
279 | - 'payload' => isset($body->payload) ? $body->payload : null, |
|
280 | - 'format' => isset($body->format) ? $body->format : null, |
|
274 | + 'session_guid' => isset($body->session_guid) ? $body->session_guid : null, |
|
275 | + 'device_id' => isset($body->device_id) ? $body->device_id : null, |
|
276 | + 'device_type' => isset($body->device_type) ? $body->device_type : null, |
|
277 | + 'subscription_name' => isset($body->subscription_name) ? $body->subscription_name : null, |
|
278 | + 'token' => isset($body->token) ? $body->token : null, |
|
279 | + 'payload' => isset($body->payload) ? $body->payload : null, |
|
280 | + 'format' => isset($body->format) ? $body->format : null, |
|
281 | 281 | ) |
282 | 282 | |
283 | 283 | )); |
@@ -285,24 +285,24 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | public static function newMemberConfigKey($body) |
288 | - { |
|
289 | - $response = Route4Me::makeRequst(array( |
|
290 | - 'url' => self::$apiMemberConfig, |
|
291 | - 'method' => 'POST', |
|
292 | - 'body' => array( |
|
288 | + { |
|
289 | + $response = Route4Me::makeRequst(array( |
|
290 | + 'url' => self::$apiMemberConfig, |
|
291 | + 'method' => 'POST', |
|
292 | + 'body' => array( |
|
293 | 293 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
294 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
294 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
295 | 295 | ) |
296 | 296 | )); |
297 | 297 | return $response; |
298 | 298 | } |
299 | 299 | |
300 | 300 | public static function removeMemberConfigKey($body) |
301 | - { |
|
302 | - $response = Route4Me::makeRequst(array( |
|
303 | - 'url' => self::$apiMemberConfig, |
|
304 | - 'method' => 'DELETE', |
|
305 | - 'body' => array( |
|
301 | + { |
|
302 | + $response = Route4Me::makeRequst(array( |
|
303 | + 'url' => self::$apiMemberConfig, |
|
304 | + 'method' => 'DELETE', |
|
305 | + 'body' => array( |
|
306 | 306 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
307 | 307 | ) |
308 | 308 | )); |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | public static function getMemberConfigData($body) |
313 | - { |
|
314 | - $response = Route4Me::makeRequst(array( |
|
315 | - 'url' => self::$apiMemberConfig, |
|
316 | - 'method' => 'GET', |
|
317 | - 'query' => array( |
|
313 | + { |
|
314 | + $response = Route4Me::makeRequst(array( |
|
315 | + 'url' => self::$apiMemberConfig, |
|
316 | + 'method' => 'GET', |
|
317 | + 'query' => array( |
|
318 | 318 | 'config_key' => isset($body->config_key) ? $body->config_key: null |
319 | 319 | ) |
320 | 320 | )); |
@@ -322,13 +322,13 @@ discard block |
||
322 | 322 | } |
323 | 323 | |
324 | 324 | public static function updateMemberConfigKey($body) |
325 | - { |
|
326 | - $response = Route4Me::makeRequst(array( |
|
327 | - 'url' => self::$apiMemberConfig, |
|
328 | - 'method' => 'PUT', |
|
329 | - 'body' => array( |
|
325 | + { |
|
326 | + $response = Route4Me::makeRequst(array( |
|
327 | + 'url' => self::$apiMemberConfig, |
|
328 | + 'method' => 'PUT', |
|
329 | + 'body' => array( |
|
330 | 330 | 'config_key' => isset($body->config_key) ? $body->config_key: null, |
331 | - 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
331 | + 'config_value' => isset($body->config_value) ? $body->config_value : null |
|
332 | 332 | ) |
333 | 333 | )); |
334 | 334 | return $response; |
@@ -12,156 +12,156 @@ discard block |
||
12 | 12 | |
13 | 13 | class OptimizationProblem extends Common |
14 | 14 | { |
15 | - static public $apiUrl = '/api.v4/optimization_problem.php'; |
|
15 | + static public $apiUrl = '/api.v4/optimization_problem.php'; |
|
16 | 16 | static public $apiUrl_addr = '/api.v4/address.php'; |
17 | - static public $apiHybridUrl = '/api.v4/hybrid_date_optimization.php'; |
|
18 | - static public $apiHybridDepotUrl = '/api/change_hybrid_optimization_depot.php'; |
|
17 | + static public $apiHybridUrl = '/api.v4/hybrid_date_optimization.php'; |
|
18 | + static public $apiHybridDepotUrl = '/api/change_hybrid_optimization_depot.php'; |
|
19 | 19 | |
20 | - public $optimization_problem_id; |
|
21 | - public $user_errors = array(); |
|
22 | - public $state; |
|
23 | - public $parameters; |
|
24 | - public $sent_to_background; |
|
25 | - public $addresses = array(); |
|
26 | - public $routes = array(); |
|
27 | - public $links = array(); |
|
20 | + public $optimization_problem_id; |
|
21 | + public $user_errors = array(); |
|
22 | + public $state; |
|
23 | + public $parameters; |
|
24 | + public $sent_to_background; |
|
25 | + public $addresses = array(); |
|
26 | + public $routes = array(); |
|
27 | + public $links = array(); |
|
28 | 28 | |
29 | - function __construct() |
|
30 | - { |
|
31 | - $this->parameters = new RouteParameters; |
|
32 | - } |
|
29 | + function __construct() |
|
30 | + { |
|
31 | + $this->parameters = new RouteParameters; |
|
32 | + } |
|
33 | 33 | |
34 | - public static function fromArray(array $params) |
|
35 | - { |
|
36 | - $problem = new OptimizationProblem; |
|
37 | - $problem->optimization_problem_id = Common::getValue($params, 'optimization_problem_id'); |
|
38 | - $problem->user_errors = Common::getValue($params, 'user_errors', array()); |
|
39 | - $problem->state = Common::getValue($params, 'state', array()); |
|
40 | - $problem->sent_to_background = Common::getValue($params, 'sent_to_background', array()); |
|
41 | - $problem->links = Common::getValue($params, 'links', array()); |
|
34 | + public static function fromArray(array $params) |
|
35 | + { |
|
36 | + $problem = new OptimizationProblem; |
|
37 | + $problem->optimization_problem_id = Common::getValue($params, 'optimization_problem_id'); |
|
38 | + $problem->user_errors = Common::getValue($params, 'user_errors', array()); |
|
39 | + $problem->state = Common::getValue($params, 'state', array()); |
|
40 | + $problem->sent_to_background = Common::getValue($params, 'sent_to_background', array()); |
|
41 | + $problem->links = Common::getValue($params, 'links', array()); |
|
42 | 42 | |
43 | - if (isset($params['parameters'])) { |
|
44 | - $problem->parameters = RouteParameters::fromArray($params['parameters']); |
|
45 | - } |
|
43 | + if (isset($params['parameters'])) { |
|
44 | + $problem->parameters = RouteParameters::fromArray($params['parameters']); |
|
45 | + } |
|
46 | 46 | |
47 | - if (isset($params['addresses'])) { |
|
48 | - $addresses = array(); |
|
49 | - foreach ($params['addresses'] as $address) { |
|
50 | - $addresses[] = Address::fromArray($address); |
|
51 | - } |
|
52 | - $problem->addresses = $addresses; |
|
53 | - } |
|
47 | + if (isset($params['addresses'])) { |
|
48 | + $addresses = array(); |
|
49 | + foreach ($params['addresses'] as $address) { |
|
50 | + $addresses[] = Address::fromArray($address); |
|
51 | + } |
|
52 | + $problem->addresses = $addresses; |
|
53 | + } |
|
54 | 54 | |
55 | - if (isset($params['routes'])) { |
|
56 | - $routes = array(); |
|
57 | - foreach ($params['routes'] as $route) { |
|
58 | - $routes[] = Route::fromArray($address); |
|
59 | - } |
|
60 | - $problem->routes = $routes; |
|
61 | - } |
|
55 | + if (isset($params['routes'])) { |
|
56 | + $routes = array(); |
|
57 | + foreach ($params['routes'] as $route) { |
|
58 | + $routes[] = Route::fromArray($address); |
|
59 | + } |
|
60 | + $problem->routes = $routes; |
|
61 | + } |
|
62 | 62 | |
63 | - return $problem; |
|
64 | - } |
|
63 | + return $problem; |
|
64 | + } |
|
65 | 65 | |
66 | - public static function optimize(OptimizationProblemParams $params) |
|
67 | - { |
|
68 | - $optimize = Route4Me::makeRequst(array( |
|
69 | - 'url' => self::$apiUrl, |
|
70 | - 'method' => 'POST', |
|
71 | - 'query' => array( |
|
72 | - 'directions' => isset($params->directions) ? $params->directions: null, |
|
73 | - 'format' => isset($params->format) ? $params->format: null, |
|
74 | - 'route_path_output' => isset($params->route_path_output) ? $params->route_path_output: null, |
|
75 | - 'optimized_callback_url' => isset($params->optimized_callback_url) ? $params->optimized_callback_url: null |
|
76 | - ), |
|
77 | - 'body' => array( |
|
78 | - 'addresses' => $params->getAddressesArray(), |
|
79 | - 'parameters' => $params->getParametersArray() |
|
80 | - ) |
|
81 | - )); |
|
66 | + public static function optimize(OptimizationProblemParams $params) |
|
67 | + { |
|
68 | + $optimize = Route4Me::makeRequst(array( |
|
69 | + 'url' => self::$apiUrl, |
|
70 | + 'method' => 'POST', |
|
71 | + 'query' => array( |
|
72 | + 'directions' => isset($params->directions) ? $params->directions: null, |
|
73 | + 'format' => isset($params->format) ? $params->format: null, |
|
74 | + 'route_path_output' => isset($params->route_path_output) ? $params->route_path_output: null, |
|
75 | + 'optimized_callback_url' => isset($params->optimized_callback_url) ? $params->optimized_callback_url: null |
|
76 | + ), |
|
77 | + 'body' => array( |
|
78 | + 'addresses' => $params->getAddressesArray(), |
|
79 | + 'parameters' => $params->getParametersArray() |
|
80 | + ) |
|
81 | + )); |
|
82 | 82 | |
83 | - return OptimizationProblem::fromArray($optimize); |
|
84 | - } |
|
83 | + return OptimizationProblem::fromArray($optimize); |
|
84 | + } |
|
85 | 85 | |
86 | - public static function get($params) |
|
87 | - { |
|
88 | - $optimize = Route4Me::makeRequst(array( |
|
89 | - 'url' => self::$apiUrl, |
|
90 | - 'method' => 'GET', |
|
91 | - 'query' => array( |
|
92 | - 'state' => isset($params['state']) ? $params['state'] : null, |
|
93 | - 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
94 | - 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
95 | - 'optimization_problem_id' => isset($params['optimization_problem_id']) |
|
96 | - ? $params['optimization_problem_id'] : null, |
|
97 | - 'wait_for_final_state' => isset($params['wait_for_final_state']) |
|
98 | - ? $params['wait_for_final_state'] : null, |
|
99 | - ) |
|
100 | - )); |
|
86 | + public static function get($params) |
|
87 | + { |
|
88 | + $optimize = Route4Me::makeRequst(array( |
|
89 | + 'url' => self::$apiUrl, |
|
90 | + 'method' => 'GET', |
|
91 | + 'query' => array( |
|
92 | + 'state' => isset($params['state']) ? $params['state'] : null, |
|
93 | + 'limit' => isset($params['limit']) ? $params['limit'] : null, |
|
94 | + 'offset' => isset($params['offset']) ? $params['offset'] : null, |
|
95 | + 'optimization_problem_id' => isset($params['optimization_problem_id']) |
|
96 | + ? $params['optimization_problem_id'] : null, |
|
97 | + 'wait_for_final_state' => isset($params['wait_for_final_state']) |
|
98 | + ? $params['wait_for_final_state'] : null, |
|
99 | + ) |
|
100 | + )); |
|
101 | 101 | |
102 | - if (isset($optimize['optimizations'])) { |
|
103 | - $problems = array(); |
|
104 | - foreach($optimize['optimizations'] as $problem) { |
|
105 | - $problems[] = OptimizationProblem::fromArray($problem); |
|
106 | - } |
|
107 | - return $problems; |
|
108 | - } else { |
|
109 | - return OptimizationProblem::fromArray($optimize); |
|
110 | - } |
|
111 | - } |
|
102 | + if (isset($optimize['optimizations'])) { |
|
103 | + $problems = array(); |
|
104 | + foreach($optimize['optimizations'] as $problem) { |
|
105 | + $problems[] = OptimizationProblem::fromArray($problem); |
|
106 | + } |
|
107 | + return $problems; |
|
108 | + } else { |
|
109 | + return OptimizationProblem::fromArray($optimize); |
|
110 | + } |
|
111 | + } |
|
112 | 112 | |
113 | - public static function reoptimize($params) |
|
114 | - { |
|
115 | - $param = new OptimizationProblemParams; |
|
116 | - $param->optimization_problem_id = isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null; |
|
117 | - $param->reoptimize = 1; |
|
113 | + public static function reoptimize($params) |
|
114 | + { |
|
115 | + $param = new OptimizationProblemParams; |
|
116 | + $param->optimization_problem_id = isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null; |
|
117 | + $param->reoptimize = 1; |
|
118 | 118 | |
119 | - return self::update((array)$param); |
|
120 | - } |
|
119 | + return self::update((array)$param); |
|
120 | + } |
|
121 | 121 | |
122 | - public static function update($params) |
|
123 | - { |
|
122 | + public static function update($params) |
|
123 | + { |
|
124 | 124 | $optimize = Route4Me::makeRequst(array( |
125 | - 'url' => self::$apiUrl, |
|
126 | - 'method' => 'PUT', |
|
127 | - 'query' => array( |
|
128 | - 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
129 | - 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
130 | - 'reoptimize' => isset($params['reoptimize']) ? $params['reoptimize'] : null, |
|
131 | - ) |
|
132 | - )); |
|
125 | + 'url' => self::$apiUrl, |
|
126 | + 'method' => 'PUT', |
|
127 | + 'query' => array( |
|
128 | + 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
129 | + 'addresses' => isset($params['addresses']) ? $params['addresses'] : null, |
|
130 | + 'reoptimize' => isset($params['reoptimize']) ? $params['reoptimize'] : null, |
|
131 | + ) |
|
132 | + )); |
|
133 | 133 | |
134 | 134 | return $optimize; |
135 | - } |
|
135 | + } |
|
136 | 136 | |
137 | - public function getOptimizationId() |
|
138 | - { |
|
139 | - return $this->optimization_problem_id; |
|
140 | - } |
|
137 | + public function getOptimizationId() |
|
138 | + { |
|
139 | + return $this->optimization_problem_id; |
|
140 | + } |
|
141 | 141 | |
142 | - public function getRoutes() |
|
143 | - { |
|
144 | - return $this->routes; |
|
145 | - } |
|
142 | + public function getRoutes() |
|
143 | + { |
|
144 | + return $this->routes; |
|
145 | + } |
|
146 | 146 | |
147 | 147 | public function getRandomOptimizationId($offset,$limit) |
148 | 148 | { |
149 | 149 | $query['limit'] = isset($params['limit']) ? $params['limit'] : 30; |
150 | - $query['offset'] = isset($params['offset']) ? $params['offset'] : 0; |
|
150 | + $query['offset'] = isset($params['offset']) ? $params['offset'] : 0; |
|
151 | 151 | |
152 | 152 | $json = Route4Me::makeRequst(array( |
153 | - 'url' => self::$apiUrl, |
|
154 | - 'method' => 'GET', |
|
155 | - 'query' => $query |
|
156 | - )); |
|
153 | + 'url' => self::$apiUrl, |
|
154 | + 'method' => 'GET', |
|
155 | + 'query' => $query |
|
156 | + )); |
|
157 | 157 | |
158 | 158 | $optimizations = array(); |
159 | - foreach($json as $optimization) { |
|
159 | + foreach($json as $optimization) { |
|
160 | 160 | if (gettype($optimization)!="array") continue; |
161 | 161 | foreach ($optimization as $otp1) { |
162 | 162 | $optimizations[] = $otp1; |
163 | 163 | } |
164 | - } |
|
164 | + } |
|
165 | 165 | |
166 | 166 | $num=rand(0,sizeof($optimizations)-1); |
167 | 167 | //echo "num=$num.<br>".sizeof($optimizations)."<br>"; |
@@ -201,13 +201,13 @@ discard block |
||
201 | 201 | public function removeAddress($params) |
202 | 202 | { |
203 | 203 | $response = Route4Me::makeRequst(array( |
204 | - 'url' => self::$apiUrl_addr, |
|
205 | - 'method' => 'DELETE', |
|
206 | - 'query' => array( |
|
207 | - 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
208 | - 'route_destination_id' => isset($params['route_destination_id']) ? $params['route_destination_id'] : null, |
|
209 | - ) |
|
210 | - )); |
|
204 | + 'url' => self::$apiUrl_addr, |
|
205 | + 'method' => 'DELETE', |
|
206 | + 'query' => array( |
|
207 | + 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
208 | + 'route_destination_id' => isset($params['route_destination_id']) ? $params['route_destination_id'] : null, |
|
209 | + ) |
|
210 | + )); |
|
211 | 211 | |
212 | 212 | return $response; |
213 | 213 | } |
@@ -215,48 +215,48 @@ discard block |
||
215 | 215 | public function removeOptimization($params) |
216 | 216 | { |
217 | 217 | $response = Route4Me::makeRequst(array( |
218 | - 'url' => self::$apiUrl, |
|
219 | - 'method' => 'DELETE', |
|
220 | - 'query' => array( |
|
221 | - 'redirect' => isset($params['redirect']) ? $params['redirect'] : null, |
|
222 | - ), |
|
223 | - 'body' => array( |
|
218 | + 'url' => self::$apiUrl, |
|
219 | + 'method' => 'DELETE', |
|
220 | + 'query' => array( |
|
221 | + 'redirect' => isset($params['redirect']) ? $params['redirect'] : null, |
|
222 | + ), |
|
223 | + 'body' => array( |
|
224 | 224 | 'optimization_problem_ids' => isset($params['optimization_problem_ids']) ? $params['optimization_problem_ids'] : null, |
225 | 225 | ) |
226 | - )); |
|
226 | + )); |
|
227 | 227 | |
228 | 228 | return $response; |
229 | 229 | } |
230 | 230 | |
231 | - public function getHybridOptimization($params) |
|
232 | - { |
|
233 | - $optimize = Route4Me::makeRequst(array( |
|
234 | - 'url' => self::$apiHybridUrl, |
|
235 | - 'method' => 'GET', |
|
236 | - 'query' => array( |
|
237 | - 'target_date_string' => isset($params['target_date_string']) ? $params['target_date_string'] : null, |
|
238 | - 'timezone_offset_minutes' => isset($params['timezone_offset_minutes']) ? $params['timezone_offset_minutes'] : null |
|
239 | - ) |
|
240 | - )); |
|
231 | + public function getHybridOptimization($params) |
|
232 | + { |
|
233 | + $optimize = Route4Me::makeRequst(array( |
|
234 | + 'url' => self::$apiHybridUrl, |
|
235 | + 'method' => 'GET', |
|
236 | + 'query' => array( |
|
237 | + 'target_date_string' => isset($params['target_date_string']) ? $params['target_date_string'] : null, |
|
238 | + 'timezone_offset_minutes' => isset($params['timezone_offset_minutes']) ? $params['timezone_offset_minutes'] : null |
|
239 | + ) |
|
240 | + )); |
|
241 | 241 | |
242 | - return $optimize; |
|
243 | - } |
|
242 | + return $optimize; |
|
243 | + } |
|
244 | 244 | |
245 | - Public function addDepotsToHybrid($params) |
|
246 | - { |
|
247 | - $depots = Route4Me::makeRequst(array( |
|
248 | - 'url' => self::$apiHybridDepotUrl, |
|
249 | - 'method' => 'POST', |
|
250 | - 'query' => array( |
|
251 | - 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
252 | - ), |
|
253 | - 'body' => array( |
|
254 | - 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
255 | - 'delete_old_depots' => isset($params['delete_old_depots']) ? $params['delete_old_depots'] : null, |
|
256 | - 'new_depots' => isset($params['new_depots']) ? $params['new_depots'] : null, |
|
257 | - ) |
|
258 | - )); |
|
245 | + Public function addDepotsToHybrid($params) |
|
246 | + { |
|
247 | + $depots = Route4Me::makeRequst(array( |
|
248 | + 'url' => self::$apiHybridDepotUrl, |
|
249 | + 'method' => 'POST', |
|
250 | + 'query' => array( |
|
251 | + 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
252 | + ), |
|
253 | + 'body' => array( |
|
254 | + 'optimization_problem_id' => isset($params['optimization_problem_id']) ? $params['optimization_problem_id'] : null, |
|
255 | + 'delete_old_depots' => isset($params['delete_old_depots']) ? $params['delete_old_depots'] : null, |
|
256 | + 'new_depots' => isset($params['new_depots']) ? $params['new_depots'] : null, |
|
257 | + ) |
|
258 | + )); |
|
259 | 259 | |
260 | - return $depots; |
|
261 | - } |
|
260 | + return $depots; |
|
261 | + } |
|
262 | 262 | } |
@@ -7,37 +7,37 @@ discard block |
||
7 | 7 | |
8 | 8 | class Route4Me |
9 | 9 | { |
10 | - static public $apiKey; |
|
11 | - static public $baseUrl = 'https://route4me.com'; |
|
10 | + static public $apiKey; |
|
11 | + static public $baseUrl = 'https://route4me.com'; |
|
12 | 12 | |
13 | - public static function setApiKey($apiKey) |
|
14 | - { |
|
15 | - self::$apiKey = $apiKey; |
|
16 | - } |
|
13 | + public static function setApiKey($apiKey) |
|
14 | + { |
|
15 | + self::$apiKey = $apiKey; |
|
16 | + } |
|
17 | 17 | |
18 | - public static function getApiKey() |
|
19 | - { |
|
20 | - return self::$apiKey; |
|
21 | - } |
|
18 | + public static function getApiKey() |
|
19 | + { |
|
20 | + return self::$apiKey; |
|
21 | + } |
|
22 | 22 | |
23 | - public static function setBaseUrl($baseUrl) |
|
24 | - { |
|
25 | - self::$baseUrl = $baseUrl; |
|
26 | - } |
|
23 | + public static function setBaseUrl($baseUrl) |
|
24 | + { |
|
25 | + self::$baseUrl = $baseUrl; |
|
26 | + } |
|
27 | 27 | |
28 | - public static function getBaseUrl() |
|
29 | - { |
|
30 | - return self::$baseUrl; |
|
31 | - } |
|
28 | + public static function getBaseUrl() |
|
29 | + { |
|
30 | + return self::$baseUrl; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | public static function fileUploadRequest($options) { |
34 | 34 | $query = isset($options['query']) ? |
35 | - array_filter($options['query']) : array(); |
|
35 | + array_filter($options['query']) : array(); |
|
36 | 36 | |
37 | 37 | if (sizeof($query)==0) return null; |
38 | 38 | |
39 | 39 | $body = isset($options['body']) ? |
40 | - array_filter($options['body']) : null; |
|
40 | + array_filter($options['body']) : null; |
|
41 | 41 | |
42 | 42 | $fname = isset($body['strFilename']) ? $body['strFilename'] : ''; |
43 | 43 | if ($fname=='') return null; |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | $fp=fopen(realpath($fname),"r"); |
48 | 48 | |
49 | 49 | $url = self::$baseUrl.$options['url'] . '?' . http_build_query(array_merge( |
50 | - array( 'api_key' => self::getApiKey()), $query) |
|
51 | - ); |
|
50 | + array( 'api_key' => self::getApiKey()), $query) |
|
51 | + ); |
|
52 | 52 | |
53 | 53 | //self::simplePrint($body);die(""); |
54 | 54 | //echo "url=".$url."<br>";die(""); |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | $ch = curl_init($url); |
57 | 57 | |
58 | 58 | $curlOpts = array( |
59 | - CURLOPT_RETURNTRANSFER => true, |
|
60 | - CURLOPT_TIMEOUT => 60, |
|
61 | - CURLOPT_FOLLOWLOCATION => true, |
|
62 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
63 | - CURLOPT_SSL_VERIFYPEER => FALSE |
|
64 | - ); |
|
59 | + CURLOPT_RETURNTRANSFER => true, |
|
60 | + CURLOPT_TIMEOUT => 60, |
|
61 | + CURLOPT_FOLLOWLOCATION => true, |
|
62 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
63 | + CURLOPT_SSL_VERIFYPEER => FALSE |
|
64 | + ); |
|
65 | 65 | |
66 | 66 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
67 | 67 | |
@@ -77,65 +77,65 @@ discard block |
||
77 | 77 | fclose($fp); |
78 | 78 | //var_dump($result); die(''); |
79 | 79 | $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
80 | - curl_close($ch); |
|
80 | + curl_close($ch); |
|
81 | 81 | //echo "code = $code <br>"; |
82 | 82 | $json = json_decode($result, true); |
83 | 83 | //var_dump($json); die(""); |
84 | - if (200 == $code) { |
|
85 | - return $json; |
|
86 | - } elseif (isset($json['errors'])) { |
|
87 | - throw new ApiError(implode(', ', $json['errors'])); |
|
88 | - } else { |
|
89 | - throw new ApiError('Something wrong'); |
|
90 | - } |
|
84 | + if (200 == $code) { |
|
85 | + return $json; |
|
86 | + } elseif (isset($json['errors'])) { |
|
87 | + throw new ApiError(implode(', ', $json['errors'])); |
|
88 | + } else { |
|
89 | + throw new ApiError('Something wrong'); |
|
90 | + } |
|
91 | 91 | } |
92 | 92 | |
93 | - public static function makeRequst($options) { |
|
94 | - $errorHandler = new myErrorHandler(); |
|
93 | + public static function makeRequst($options) { |
|
94 | + $errorHandler = new myErrorHandler(); |
|
95 | 95 | |
96 | - $old_error_handler = set_error_handler(array( $errorHandler, "proc_error")); |
|
97 | - $method = isset($options['method']) ? $options['method'] : 'GET'; |
|
98 | - $query = isset($options['query']) ? |
|
99 | - array_filter($options['query']) : array(); |
|
96 | + $old_error_handler = set_error_handler(array( $errorHandler, "proc_error")); |
|
97 | + $method = isset($options['method']) ? $options['method'] : 'GET'; |
|
98 | + $query = isset($options['query']) ? |
|
99 | + array_filter($options['query']) : array(); |
|
100 | 100 | //echo "query=".$query['member_id'];die(""); |
101 | - $body = isset($options['body']) ? |
|
102 | - array_filter($options['body']) : null; |
|
101 | + $body = isset($options['body']) ? |
|
102 | + array_filter($options['body']) : null; |
|
103 | 103 | $file = isset($options['FILE']) ? $options['FILE'] : null; |
104 | - $headers = array( |
|
105 | - "User-Agent: Route4Me php-sdk" |
|
106 | - ); |
|
104 | + $headers = array( |
|
105 | + "User-Agent: Route4Me php-sdk" |
|
106 | + ); |
|
107 | 107 | |
108 | - if (isset($options['HTTPHEADER'])) { |
|
109 | - $headers[]=$options['HTTPHEADER']; |
|
110 | - } |
|
108 | + if (isset($options['HTTPHEADER'])) { |
|
109 | + $headers[]=$options['HTTPHEADER']; |
|
110 | + } |
|
111 | 111 | |
112 | 112 | if (isset($options['HTTPHEADERS'])) { |
113 | - foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
114 | - } |
|
115 | - //self::simplePrint($headers); die(""); |
|
116 | - $ch = curl_init(); |
|
117 | - $url = $options['url'] . '?' . http_build_query(array_merge( |
|
118 | - $query, array( 'api_key' => self::getApiKey()) |
|
119 | - )); |
|
113 | + foreach ($options['HTTPHEADERS'] As $header) $headers[]=$header; |
|
114 | + } |
|
115 | + //self::simplePrint($headers); die(""); |
|
116 | + $ch = curl_init(); |
|
117 | + $url = $options['url'] . '?' . http_build_query(array_merge( |
|
118 | + $query, array( 'api_key' => self::getApiKey()) |
|
119 | + )); |
|
120 | 120 | //var_dump($body); echo "<br><br>"; |
121 | 121 | //$jfile=json_encode($body); echo "<br><br>".$jfile; die("STOPPPP"); |
122 | 122 | |
123 | - //self::simplePrint($headers); die(""); |
|
123 | + //self::simplePrint($headers); die(""); |
|
124 | 124 | $baseUrl=self::getBaseUrl(); |
125 | 125 | |
126 | 126 | if (strpos($url,'move_route_destination')>0) $baseUrl='https://www.route4me.com'; |
127 | - $curlOpts = arraY( |
|
128 | - CURLOPT_URL => $baseUrl. $url, |
|
129 | - CURLOPT_RETURNTRANSFER => true, |
|
130 | - CURLOPT_TIMEOUT => 60, |
|
131 | - CURLOPT_FOLLOWLOCATION => true, |
|
132 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
133 | - CURLOPT_SSL_VERIFYPEER => FALSE, |
|
134 | - CURLOPT_HTTPHEADER => $headers |
|
135 | - ); |
|
127 | + $curlOpts = arraY( |
|
128 | + CURLOPT_URL => $baseUrl. $url, |
|
129 | + CURLOPT_RETURNTRANSFER => true, |
|
130 | + CURLOPT_TIMEOUT => 60, |
|
131 | + CURLOPT_FOLLOWLOCATION => true, |
|
132 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
133 | + CURLOPT_SSL_VERIFYPEER => FALSE, |
|
134 | + CURLOPT_HTTPHEADER => $headers |
|
135 | + ); |
|
136 | 136 | |
137 | 137 | //echo "url=".$baseUrl.$url."<br>";die(""); |
138 | - curl_setopt_array($ch, $curlOpts); |
|
138 | + curl_setopt_array($ch, $curlOpts); |
|
139 | 139 | |
140 | 140 | if ($file !=null) { |
141 | 141 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
@@ -144,21 +144,21 @@ discard block |
||
144 | 144 | curl_setopt($ch, CURLOPT_INFILESIZE, filesize($file)); |
145 | 145 | } |
146 | 146 | |
147 | - switch($method) { |
|
148 | - case 'DELETE': |
|
149 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
147 | + switch($method) { |
|
148 | + case 'DELETE': |
|
149 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
150 | 150 | |
151 | 151 | if (isset($body)) { |
152 | 152 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
153 | 153 | } |
154 | - break; |
|
154 | + break; |
|
155 | 155 | case 'DELETEARRAY': |
156 | 156 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
157 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
158 | - break; |
|
159 | - case 'PUT': |
|
157 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
158 | + break; |
|
159 | + case 'PUT': |
|
160 | 160 | //$jfile=json_encode($body); echo $jfile; die(""); |
161 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
161 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
162 | 162 | if (isset($query)) { |
163 | 163 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
164 | 164 | } |
@@ -167,9 +167,9 @@ discard block |
||
167 | 167 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
168 | 168 | } |
169 | 169 | break; |
170 | - case 'POST': |
|
170 | + case 'POST': |
|
171 | 171 | if (isset($query)) { |
172 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
172 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | //echo "<br><br>". json_encode($body); |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | } |
179 | 179 | break; |
180 | 180 | case 'ADD': |
181 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
182 | - } |
|
181 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
182 | + } |
|
183 | 183 | |
184 | - $result = curl_exec($ch); |
|
184 | + $result = curl_exec($ch); |
|
185 | 185 | //var_dump($result); die(""); |
186 | 186 | $isxml=FALSE; |
187 | 187 | $jxml=""; |
@@ -192,64 +192,64 @@ discard block |
||
192 | 192 | $isxml = TRUE; |
193 | 193 | } |
194 | 194 | |
195 | - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
196 | - curl_close($ch); |
|
195 | + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
196 | + curl_close($ch); |
|
197 | 197 | //echo "code -> $code <br>"; |
198 | 198 | |
199 | - if (200 == $code) { |
|
200 | - if ($isxml) { |
|
201 | - $json = $jxml; |
|
202 | - } else $json = json_decode($result, true); |
|
203 | - //var_dump($json); die(""); |
|
204 | - if (isset($json['errors'])) { |
|
205 | - throw new ApiError(implode(', ', $json['errors'])); |
|
206 | - } else { |
|
207 | - return $json; |
|
208 | - } |
|
209 | - } elseif (409 == $code) { |
|
199 | + if (200 == $code) { |
|
200 | + if ($isxml) { |
|
201 | + $json = $jxml; |
|
202 | + } else $json = json_decode($result, true); |
|
203 | + //var_dump($json); die(""); |
|
204 | + if (isset($json['errors'])) { |
|
205 | + throw new ApiError(implode(', ', $json['errors'])); |
|
206 | + } else { |
|
207 | + return $json; |
|
208 | + } |
|
209 | + } elseif (409 == $code) { |
|
210 | 210 | |
211 | - //throw new ApiError('Wrong API key'); |
|
212 | - } else { |
|
213 | - throw new ApiError('Something wrong'); |
|
214 | - } |
|
215 | - } |
|
211 | + //throw new ApiError('Wrong API key'); |
|
212 | + } else { |
|
213 | + throw new ApiError('Something wrong'); |
|
214 | + } |
|
215 | + } |
|
216 | 216 | |
217 | 217 | public static function makeUrlRequst($url, $options) { |
218 | 218 | $method = isset($options['method']) ? $options['method'] : 'GET'; |
219 | - $query = isset($options['query']) ? |
|
220 | - array_filter($options['query']) : array(); |
|
221 | - $body = isset($options['body']) ? |
|
222 | - array_filter($options['body']) : null; |
|
223 | - $ch = curl_init(); |
|
219 | + $query = isset($options['query']) ? |
|
220 | + array_filter($options['query']) : array(); |
|
221 | + $body = isset($options['body']) ? |
|
222 | + array_filter($options['body']) : null; |
|
223 | + $ch = curl_init(); |
|
224 | 224 | |
225 | 225 | $curlOpts = arraY( |
226 | - CURLOPT_URL => $url, |
|
227 | - CURLOPT_RETURNTRANSFER => true, |
|
228 | - CURLOPT_TIMEOUT => 60, |
|
229 | - CURLOPT_FOLLOWLOCATION => true, |
|
230 | - CURLOPT_SSL_VERIFYHOST => FALSE, |
|
231 | - CURLOPT_SSL_VERIFYPEER => FALSE, |
|
232 | - CURLOPT_HTTPHEADER => array( |
|
233 | - 'User-Agent' => 'Route4Me php-sdk' |
|
234 | - ) |
|
235 | - ); |
|
226 | + CURLOPT_URL => $url, |
|
227 | + CURLOPT_RETURNTRANSFER => true, |
|
228 | + CURLOPT_TIMEOUT => 60, |
|
229 | + CURLOPT_FOLLOWLOCATION => true, |
|
230 | + CURLOPT_SSL_VERIFYHOST => FALSE, |
|
231 | + CURLOPT_SSL_VERIFYPEER => FALSE, |
|
232 | + CURLOPT_HTTPHEADER => array( |
|
233 | + 'User-Agent' => 'Route4Me php-sdk' |
|
234 | + ) |
|
235 | + ); |
|
236 | 236 | |
237 | 237 | curl_setopt_array($ch, $curlOpts); |
238 | 238 | |
239 | - switch($method) { |
|
240 | - case 'DELETE': |
|
241 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
239 | + switch($method) { |
|
240 | + case 'DELETE': |
|
241 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
|
242 | 242 | |
243 | 243 | if (isset($body)) { |
244 | 244 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
245 | 245 | } |
246 | - break; |
|
246 | + break; |
|
247 | 247 | case 'DELETEARRAY': |
248 | 248 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); |
249 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
250 | - break; |
|
251 | - case 'PUT': |
|
252 | - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
249 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
250 | + break; |
|
251 | + case 'PUT': |
|
252 | + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); |
|
253 | 253 | if (isset($query)) { |
254 | 254 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
255 | 255 | } |
@@ -258,10 +258,10 @@ discard block |
||
258 | 258 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); |
259 | 259 | } |
260 | 260 | break; |
261 | - case 'POST': |
|
261 | + case 'POST': |
|
262 | 262 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); |
263 | 263 | if (isset($query)) { |
264 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
264 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | if (isset($body)) { |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | } |
270 | 270 | break; |
271 | 271 | case 'ADD': |
272 | - curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
273 | - } |
|
272 | + curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($query)); break; |
|
273 | + } |
|
274 | 274 | |
275 | 275 | $result = curl_exec($ch); |
276 | 276 | |
@@ -283,21 +283,21 @@ discard block |
||
283 | 283 | $isxml = TRUE; |
284 | 284 | } |
285 | 285 | |
286 | - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
287 | - curl_close($ch); |
|
286 | + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
|
287 | + curl_close($ch); |
|
288 | 288 | |
289 | 289 | if ($isxml) { |
290 | 290 | $json = $jxml; |
291 | 291 | } else $json = json_decode($result, true); |
292 | 292 | |
293 | 293 | |
294 | - if (200 == $code) { |
|
295 | - return $json; |
|
296 | - } elseif (isset($json['errors'])) { |
|
297 | - throw new ApiError(implode(', ', $json['errors'])); |
|
298 | - } else { |
|
299 | - throw new ApiError('Something wrong'); |
|
300 | - } |
|
294 | + if (200 == $code) { |
|
295 | + return $json; |
|
296 | + } elseif (isset($json['errors'])) { |
|
297 | + throw new ApiError(implode(', ', $json['errors'])); |
|
298 | + } else { |
|
299 | + throw new ApiError('Something wrong'); |
|
300 | + } |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | /** |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | $locationsFieldsMapping['monthly_nth_wwhat']=17; |
44 | 44 | |
45 | 45 | if (($handle = fopen("$source_file", "r")) !== FALSE) { |
46 | - $oAbook = new AddressBookLocation(); |
|
46 | + $oAbook = new AddressBookLocation(); |
|
47 | 47 | |
48 | - $results=$oAbook->addLocationsFromCsvFile($handle, $locationsFieldsMapping); //Temporarry |
|
48 | + $results=$oAbook->addLocationsFromCsvFile($handle, $locationsFieldsMapping); //Temporarry |
|
49 | 49 | |
50 | - echo "Errors: <br><br>"; |
|
51 | - foreach ($results['fail'] as $evalue) { |
|
52 | - echo $evalue."<br>"; |
|
53 | - } |
|
50 | + echo "Errors: <br><br>"; |
|
51 | + foreach ($results['fail'] as $evalue) { |
|
52 | + echo $evalue."<br>"; |
|
53 | + } |
|
54 | 54 | |
55 | - echo "Successes: <br><br>"; |
|
56 | - foreach ($results['success'] as $svalue) { |
|
57 | - echo $svalue."<br>"; |
|
58 | - } |
|
55 | + echo "Successes: <br><br>"; |
|
56 | + foreach ($results['success'] as $svalue) { |
|
57 | + echo $svalue."<br>"; |
|
58 | + } |
|
59 | 59 | |
60 | - } |
|
60 | + } |
|
61 | 61 | |
62 | 62 | /* Add orders with schedules from a CSV file */ |
63 | 63 | |
@@ -76,91 +76,91 @@ discard block |
||
76 | 76 | $ordersFieldsMapping['day_scheduled_for_YYMMDD']=8; |
77 | 77 | |
78 | 78 | if (($handle = fopen("$orders_file", "r")) !== FALSE) { |
79 | - $order = new Order(); |
|
80 | - $results=$order->addOrdersFromCsvFile($handle, $ordersFieldsMapping); |
|
79 | + $order = new Order(); |
|
80 | + $results=$order->addOrdersFromCsvFile($handle, $ordersFieldsMapping); |
|
81 | 81 | |
82 | - echo "Errors: <br><br>"; |
|
83 | - foreach ($results['fail'] as $evalue) { |
|
84 | - echo $evalue."<br>"; |
|
85 | - } |
|
82 | + echo "Errors: <br><br>"; |
|
83 | + foreach ($results['fail'] as $evalue) { |
|
84 | + echo $evalue."<br>"; |
|
85 | + } |
|
86 | 86 | |
87 | - echo "Successes: <br><br>"; |
|
88 | - foreach ($results['success'] as $svalue) { |
|
89 | - echo $svalue."<br>"; |
|
90 | - } |
|
87 | + echo "Successes: <br><br>"; |
|
88 | + foreach ($results['success'] as $svalue) { |
|
89 | + echo $svalue."<br>"; |
|
90 | + } |
|
91 | 91 | |
92 | - } |
|
92 | + } |
|
93 | 93 | |
94 | 94 | /* Get Hybrid Optimization */ |
95 | 95 | |
96 | - $ep = time()+604800; |
|
97 | - $sched_date = date("Y-m-d", $ep); |
|
96 | + $ep = time()+604800; |
|
97 | + $sched_date = date("Y-m-d", $ep); |
|
98 | 98 | |
99 | - $hybridParams = array( |
|
100 | - "target_date_string" => $sched_date, |
|
101 | - "timezone_offset_minutes" => 480 |
|
102 | - ); |
|
99 | + $hybridParams = array( |
|
100 | + "target_date_string" => $sched_date, |
|
101 | + "timezone_offset_minutes" => 480 |
|
102 | + ); |
|
103 | 103 | |
104 | - $optimization = new OptimizationProblem(); |
|
105 | - $hybridOptimization = $optimization->getHybridOptimization($hybridParams); |
|
104 | + $optimization = new OptimizationProblem(); |
|
105 | + $hybridOptimization = $optimization->getHybridOptimization($hybridParams); |
|
106 | 106 | |
107 | - if ($hybridOptimization!=null) { |
|
107 | + if ($hybridOptimization!=null) { |
|
108 | 108 | |
109 | - if (isset($hybridOptimization['optimization_problem_id'])) { |
|
110 | - $optid = $hybridOptimization['optimization_problem_id']; |
|
109 | + if (isset($hybridOptimization['optimization_problem_id'])) { |
|
110 | + $optid = $hybridOptimization['optimization_problem_id']; |
|
111 | 111 | |
112 | - echo "Hibrid optimization with optimization_problem_id=$optid <br><br>"; |
|
112 | + echo "Hibrid optimization with optimization_problem_id=$optid <br><br>"; |
|
113 | 113 | |
114 | - /* Add depots to the Hybrid Optimization */ |
|
115 | - $depotfile = "depots.csv"; |
|
114 | + /* Add depots to the Hybrid Optimization */ |
|
115 | + $depotfile = "depots.csv"; |
|
116 | 116 | |
117 | - if (($handle = fopen("$depotfile", "r")) !== FALSE) { |
|
117 | + if (($handle = fopen("$depotfile", "r")) !== FALSE) { |
|
118 | 118 | |
119 | - $columns = fgetcsv($handle, $max_line_length, $delemietr); |
|
119 | + $columns = fgetcsv($handle, $max_line_length, $delemietr); |
|
120 | 120 | |
121 | - if (!$columns) { |
|
122 | - $error['message'] = 'Empty'; |
|
123 | - return ($error); |
|
124 | - } |
|
121 | + if (!$columns) { |
|
122 | + $error['message'] = 'Empty'; |
|
123 | + return ($error); |
|
124 | + } |
|
125 | 125 | |
126 | - $depotsParams = array( |
|
127 | - 'optimization_problem_id' => $optid, |
|
128 | - 'delete_old_depots' => true, |
|
129 | - ); |
|
126 | + $depotsParams = array( |
|
127 | + 'optimization_problem_id' => $optid, |
|
128 | + 'delete_old_depots' => true, |
|
129 | + ); |
|
130 | 130 | |
131 | - $iRow=1; |
|
132 | - $depotAddresses = array(); |
|
131 | + $iRow=1; |
|
132 | + $depotAddresses = array(); |
|
133 | 133 | |
134 | - while (($rows = fgetcsv($handle, $max_line_length, $delemietr)) !== false) { |
|
135 | - if ($rows[0] && $rows[1] && $rows[3] && array(null) !== $rows) { |
|
136 | - $depotAddress['lat']= $rows[0]; |
|
137 | - $depotAddress['lng']= $rows[1]; |
|
138 | - $depotAddress['address']= $rows[3]; |
|
139 | - array_push($depotAddresses,$depotAddress); |
|
140 | - } |
|
141 | - } |
|
134 | + while (($rows = fgetcsv($handle, $max_line_length, $delemietr)) !== false) { |
|
135 | + if ($rows[0] && $rows[1] && $rows[3] && array(null) !== $rows) { |
|
136 | + $depotAddress['lat']= $rows[0]; |
|
137 | + $depotAddress['lng']= $rows[1]; |
|
138 | + $depotAddress['address']= $rows[3]; |
|
139 | + array_push($depotAddresses,$depotAddress); |
|
140 | + } |
|
141 | + } |
|
142 | 142 | |
143 | - $depotsParams['new_depots'] = $depotAddresses; |
|
143 | + $depotsParams['new_depots'] = $depotAddresses; |
|
144 | 144 | |
145 | - $optProblem = new OptimizationProblem(); |
|
145 | + $optProblem = new OptimizationProblem(); |
|
146 | 146 | |
147 | - $resultDepots = $optProblem->addDepotsToHybrid($depotsParams); |
|
147 | + $resultDepots = $optProblem->addDepotsToHybrid($depotsParams); |
|
148 | 148 | |
149 | - var_dump($resultDepots); |
|
149 | + var_dump($resultDepots); |
|
150 | 150 | |
151 | - /* Reoptimize hybrid optimization */ |
|
151 | + /* Reoptimize hybrid optimization */ |
|
152 | 152 | |
153 | - if ($resultDepots!=null) { |
|
154 | - $problemParams = array( |
|
155 | - 'optimization_problem_id' => $optid |
|
156 | - ); |
|
157 | - $problem = OptimizationProblem::reoptimize($problemParams); |
|
153 | + if ($resultDepots!=null) { |
|
154 | + $problemParams = array( |
|
155 | + 'optimization_problem_id' => $optid |
|
156 | + ); |
|
157 | + $problem = OptimizationProblem::reoptimize($problemParams); |
|
158 | 158 | |
159 | - Route4Me::simplePrint($problem); |
|
160 | - } |
|
161 | - } |
|
159 | + Route4Me::simplePrint($problem); |
|
160 | + } |
|
161 | + } |
|
162 | 162 | |
163 | - } |
|
163 | + } |
|
164 | 164 | |
165 | - } |
|
165 | + } |
|
166 | 166 | ?> |
167 | 167 | \ No newline at end of file |