@@ -25,13 +25,13 @@ |
||
25 | 25 | |
26 | 26 | // Add a file note |
27 | 27 | $noteParameters = [ |
28 | - 'strFilename' => 'notes.csv', |
|
29 | - 'route_id' => $route_id, |
|
30 | - 'address_id' => $route_destination_id, |
|
31 | - 'dev_lat' => $addressRand['lat'], |
|
32 | - 'dev_lng' => $addressRand['lng'], |
|
33 | - 'device_type' => 'web', |
|
34 | - 'strUpdateType' => 'ANY_FILE', |
|
28 | + 'strFilename' => 'notes.csv', |
|
29 | + 'route_id' => $route_id, |
|
30 | + 'address_id' => $route_destination_id, |
|
31 | + 'dev_lat' => $addressRand['lat'], |
|
32 | + 'dev_lng' => $addressRand['lng'], |
|
33 | + 'device_type' => 'web', |
|
34 | + 'strUpdateType' => 'ANY_FILE', |
|
35 | 35 | ]; |
36 | 36 | |
37 | 37 | $addressNote = new AddressNote(); |
@@ -10,12 +10,12 @@ |
||
10 | 10 | |
11 | 11 | // Create a custom note type |
12 | 12 | $noteParameters = [ |
13 | - 'type' => 'To Do', |
|
14 | - 'values' => [ |
|
15 | - 'Pass a package', |
|
16 | - 'Pickup package', |
|
17 | - 'Do a service', |
|
18 | - ], |
|
13 | + 'type' => 'To Do', |
|
14 | + 'values' => [ |
|
15 | + 'Pass a package', |
|
16 | + 'Pickup package', |
|
17 | + 'Do a service', |
|
18 | + ], |
|
19 | 19 | ]; |
20 | 20 | |
21 | 21 | $addressNote = new AddressNote(); |
@@ -25,13 +25,13 @@ |
||
25 | 25 | |
26 | 26 | // Add an address note |
27 | 27 | $noteParameters = [ |
28 | - 'route_id' => $route_id, |
|
29 | - 'address_id' => $route_destination_id, |
|
30 | - 'dev_lat' => $addressRand['lat'], |
|
31 | - 'dev_lng' => $addressRand['lng'], |
|
32 | - 'device_type' => 'web', |
|
33 | - 'strUpdateType' => 'dropoff', |
|
34 | - 'strNoteContents' => 'Test', |
|
28 | + 'route_id' => $route_id, |
|
29 | + 'address_id' => $route_destination_id, |
|
30 | + 'dev_lat' => $addressRand['lat'], |
|
31 | + 'dev_lng' => $addressRand['lng'], |
|
32 | + 'device_type' => 'web', |
|
33 | + 'strUpdateType' => 'dropoff', |
|
34 | + 'strNoteContents' => 'Test', |
|
35 | 35 | ]; |
36 | 36 | |
37 | 37 | $addressNote = new AddressNote(); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | // Get two random locations IDs |
12 | 12 | |
13 | 13 | $addressBookLocationParameters = [ |
14 | - 'limit' => 30, |
|
15 | - 'offset' => 0, |
|
14 | + 'limit' => 30, |
|
15 | + 'offset' => 0, |
|
16 | 16 | ]; |
17 | 17 | |
18 | 18 | $abContacts = new AddressBookLocation(); |
@@ -36,6 +36,6 @@ discard block |
||
36 | 36 | $results = $abLocation->getValue($abcResult, 'results'); |
37 | 37 | |
38 | 38 | foreach ($results as $result) { |
39 | - Route4Me::simplePrint($result); |
|
40 | - echo '<br>'; |
|
39 | + Route4Me::simplePrint($result); |
|
40 | + echo '<br>'; |
|
41 | 41 | } |
@@ -13,10 +13,10 @@ |
||
13 | 13 | $abLocation = new AddressBookLocation(); |
14 | 14 | |
15 | 15 | $params = [ |
16 | - 'query' => 'Test', |
|
17 | - 'fields' => 'address_1,address_group,first_name,last_name', |
|
18 | - 'offset' => 0, |
|
19 | - 'limit' => 20, |
|
16 | + 'query' => 'Test', |
|
17 | + 'fields' => 'address_1,address_group,first_name,last_name', |
|
18 | + 'offset' => 0, |
|
19 | + 'limit' => 20, |
|
20 | 20 | ]; |
21 | 21 | |
22 | 22 | $abcResult = $abLocation->searchAddressBookLocations($params); |
@@ -12,8 +12,8 @@ |
||
12 | 12 | |
13 | 13 | // Get reandom address book location |
14 | 14 | $AddressBookLocationParameters = [ |
15 | - 'limit' => 30, |
|
16 | - 'offset' => 0, |
|
15 | + 'limit' => 30, |
|
16 | + 'offset' => 0, |
|
17 | 17 | ]; |
18 | 18 | |
19 | 19 | $randomLocation = $abLocation->getRandomAddressBookLocation($AddressBookLocationParameters); |
@@ -10,24 +10,24 @@ discard block |
||
10 | 10 | |
11 | 11 | //region // Add a location, scheduled daily with custom data. |
12 | 12 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
13 | - 'address_1' => '1604 PARKRIDGE PKWY, Louisville, KY, 40214', |
|
14 | - 'address_alias' => '1604 PARKRIDGE PKWY 40214', |
|
15 | - 'address_group' => 'Scheduled daily', |
|
16 | - 'first_name' => 'Peter', |
|
17 | - 'last_name' => 'Newman', |
|
18 | - 'address_email' => '[email protected]', |
|
19 | - 'address_phone_number' => '65432178', |
|
20 | - 'cached_lat' => 38.141598, |
|
21 | - 'cached_lng' => -85.793846, |
|
22 | - 'address_city' => 'Louisville', |
|
23 | - 'address_custom_data' => ['scheduled' => 'yes', |
|
24 | - 'serice type' => 'publishing', ], |
|
25 | - 'schedule' => [[ |
|
26 | - 'enabled' => true, |
|
27 | - 'mode' => 'daily', |
|
28 | - 'daily' => ['every' => 1], |
|
29 | - ]], |
|
30 | - 'service_time' => 900, |
|
13 | + 'address_1' => '1604 PARKRIDGE PKWY, Louisville, KY, 40214', |
|
14 | + 'address_alias' => '1604 PARKRIDGE PKWY 40214', |
|
15 | + 'address_group' => 'Scheduled daily', |
|
16 | + 'first_name' => 'Peter', |
|
17 | + 'last_name' => 'Newman', |
|
18 | + 'address_email' => '[email protected]', |
|
19 | + 'address_phone_number' => '65432178', |
|
20 | + 'cached_lat' => 38.141598, |
|
21 | + 'cached_lng' => -85.793846, |
|
22 | + 'address_city' => 'Louisville', |
|
23 | + 'address_custom_data' => ['scheduled' => 'yes', |
|
24 | + 'serice type' => 'publishing', ], |
|
25 | + 'schedule' => [[ |
|
26 | + 'enabled' => true, |
|
27 | + 'mode' => 'daily', |
|
28 | + 'daily' => ['every' => 1], |
|
29 | + ]], |
|
30 | + 'service_time' => 900, |
|
31 | 31 | ]); |
32 | 32 | |
33 | 33 | $abContacts1 = new AddressBookLocation(); |
@@ -42,27 +42,27 @@ discard block |
||
42 | 42 | |
43 | 43 | //region // Add a location, scheduled weekly. |
44 | 44 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
45 | - 'address_1' => '1407 MCCOY, Louisville, KY, 40215', |
|
46 | - 'address_alias' => '1407 MCCOY 40215', |
|
47 | - 'address_group' => 'Scheduled weekly', |
|
48 | - 'first_name' => 'Bart', |
|
49 | - 'last_name' => 'Douglas', |
|
50 | - 'address_email' => '[email protected]', |
|
51 | - 'address_phone_number' => '95487454', |
|
52 | - 'cached_lat' => 38.202496, |
|
53 | - 'cached_lng' => -85.786514, |
|
54 | - 'curbside_lat' => 38.202496, |
|
55 | - 'curbside_lng' => -85.786514, |
|
56 | - 'address_city' => 'Louisville', |
|
57 | - 'schedule' => [[ |
|
58 | - 'enabled' => true, |
|
59 | - 'mode' => 'weekly', |
|
60 | - 'weekly' => [ |
|
61 | - 'every' => 1, |
|
62 | - 'weekdays' => [1, 2, 3, 4, 5], |
|
63 | - ], |
|
64 | - ]], |
|
65 | - 'service_time' => 600, |
|
45 | + 'address_1' => '1407 MCCOY, Louisville, KY, 40215', |
|
46 | + 'address_alias' => '1407 MCCOY 40215', |
|
47 | + 'address_group' => 'Scheduled weekly', |
|
48 | + 'first_name' => 'Bart', |
|
49 | + 'last_name' => 'Douglas', |
|
50 | + 'address_email' => '[email protected]', |
|
51 | + 'address_phone_number' => '95487454', |
|
52 | + 'cached_lat' => 38.202496, |
|
53 | + 'cached_lng' => -85.786514, |
|
54 | + 'curbside_lat' => 38.202496, |
|
55 | + 'curbside_lng' => -85.786514, |
|
56 | + 'address_city' => 'Louisville', |
|
57 | + 'schedule' => [[ |
|
58 | + 'enabled' => true, |
|
59 | + 'mode' => 'weekly', |
|
60 | + 'weekly' => [ |
|
61 | + 'every' => 1, |
|
62 | + 'weekdays' => [1, 2, 3, 4, 5], |
|
63 | + ], |
|
64 | + ]], |
|
65 | + 'service_time' => 600, |
|
66 | 66 | ]); |
67 | 67 | |
68 | 68 | $abContacts2 = new AddressBookLocation(); |
@@ -77,33 +77,33 @@ discard block |
||
77 | 77 | |
78 | 78 | //region // Add a location, scheduled monthly (dates mode). |
79 | 79 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
80 | - 'address_1' => '4805 BELLEVUE AVE, Louisville, KY, 40215', |
|
81 | - 'address_2' => '4806 BELLEVUE AVE, Louisville, KY, 40215', |
|
82 | - 'address_alias' => '4805 BELLEVUE AVE 40215', |
|
83 | - 'address_group' => 'Scheduled monthly', |
|
84 | - 'first_name' => 'Bart', |
|
85 | - 'last_name' => 'Douglas', |
|
86 | - 'address_email' => '[email protected]', |
|
87 | - 'address_phone_number' => '95487454', |
|
88 | - 'cached_lat' => 38.178844, |
|
89 | - 'cached_lng' => -85.774864, |
|
90 | - 'curbside_lat' => 38.178844, |
|
91 | - 'curbside_lng' => -85.774864, |
|
92 | - 'address_city' => 'Louisville', |
|
93 | - 'address_country_id' => 'US', |
|
94 | - 'address_state_id' => 'KY', |
|
95 | - 'address_zip' => '40215', |
|
96 | - 'schedule' => [[ |
|
97 | - 'enabled' => true, |
|
98 | - 'mode' => 'monthly', |
|
99 | - 'monthly' => [ |
|
100 | - 'every' => 1, |
|
101 | - 'mode' => 'dates', |
|
102 | - 'dates' => [20, 22, 23, 24, 25], |
|
103 | - ], |
|
104 | - ]], |
|
105 | - 'service_time' => 750, |
|
106 | - 'color' => 'red', |
|
80 | + 'address_1' => '4805 BELLEVUE AVE, Louisville, KY, 40215', |
|
81 | + 'address_2' => '4806 BELLEVUE AVE, Louisville, KY, 40215', |
|
82 | + 'address_alias' => '4805 BELLEVUE AVE 40215', |
|
83 | + 'address_group' => 'Scheduled monthly', |
|
84 | + 'first_name' => 'Bart', |
|
85 | + 'last_name' => 'Douglas', |
|
86 | + 'address_email' => '[email protected]', |
|
87 | + 'address_phone_number' => '95487454', |
|
88 | + 'cached_lat' => 38.178844, |
|
89 | + 'cached_lng' => -85.774864, |
|
90 | + 'curbside_lat' => 38.178844, |
|
91 | + 'curbside_lng' => -85.774864, |
|
92 | + 'address_city' => 'Louisville', |
|
93 | + 'address_country_id' => 'US', |
|
94 | + 'address_state_id' => 'KY', |
|
95 | + 'address_zip' => '40215', |
|
96 | + 'schedule' => [[ |
|
97 | + 'enabled' => true, |
|
98 | + 'mode' => 'monthly', |
|
99 | + 'monthly' => [ |
|
100 | + 'every' => 1, |
|
101 | + 'mode' => 'dates', |
|
102 | + 'dates' => [20, 22, 23, 24, 25], |
|
103 | + ], |
|
104 | + ]], |
|
105 | + 'service_time' => 750, |
|
106 | + 'color' => 'red', |
|
107 | 107 | ]); |
108 | 108 | |
109 | 109 | $abContacts3 = new AddressBookLocation(); |
@@ -118,36 +118,36 @@ discard block |
||
118 | 118 | |
119 | 119 | //region // AAdd a location, scheduled monthly (nth mode). |
120 | 120 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
121 | - 'address_1' => '730 CECIL AVENUE, Louisville, KY, 40211', |
|
122 | - 'address_alias' => '730 CECIL AVENUE 40211', |
|
123 | - 'address_group' => 'Scheduled monthly', |
|
124 | - 'first_name' => 'David', |
|
125 | - 'last_name' => 'Silvester', |
|
126 | - 'address_email' => '[email protected]', |
|
127 | - 'address_phone_number' => '36985214', |
|
128 | - 'cached_lat' => 38.248684, |
|
129 | - 'cached_lng' => -85.821121, |
|
130 | - 'curbside_lat' => 38.248684, |
|
131 | - 'curbside_lng' => -85.821121, |
|
132 | - 'address_city' => 'Louisville', |
|
133 | - 'address_custom_data' => [ |
|
134 | - 'scheduled' => 'yes', |
|
135 | - 'service type' => 'library', |
|
136 | - ], |
|
137 | - 'schedule' => [[ |
|
138 | - 'enabled' => true, |
|
139 | - 'mode' => 'monthly', |
|
140 | - 'monthly' => [ |
|
141 | - 'every' => 1, |
|
142 | - 'mode' => 'nth', |
|
143 | - 'nth' => [ |
|
144 | - 'n' => 1, |
|
145 | - 'what' => 4, |
|
146 | - ], |
|
147 | - ], |
|
148 | - ]], |
|
149 | - 'service_time' => 450, |
|
150 | - 'address_icon' => 'emoji/emoji-bus', |
|
121 | + 'address_1' => '730 CECIL AVENUE, Louisville, KY, 40211', |
|
122 | + 'address_alias' => '730 CECIL AVENUE 40211', |
|
123 | + 'address_group' => 'Scheduled monthly', |
|
124 | + 'first_name' => 'David', |
|
125 | + 'last_name' => 'Silvester', |
|
126 | + 'address_email' => '[email protected]', |
|
127 | + 'address_phone_number' => '36985214', |
|
128 | + 'cached_lat' => 38.248684, |
|
129 | + 'cached_lng' => -85.821121, |
|
130 | + 'curbside_lat' => 38.248684, |
|
131 | + 'curbside_lng' => -85.821121, |
|
132 | + 'address_city' => 'Louisville', |
|
133 | + 'address_custom_data' => [ |
|
134 | + 'scheduled' => 'yes', |
|
135 | + 'service type' => 'library', |
|
136 | + ], |
|
137 | + 'schedule' => [[ |
|
138 | + 'enabled' => true, |
|
139 | + 'mode' => 'monthly', |
|
140 | + 'monthly' => [ |
|
141 | + 'every' => 1, |
|
142 | + 'mode' => 'nth', |
|
143 | + 'nth' => [ |
|
144 | + 'n' => 1, |
|
145 | + 'what' => 4, |
|
146 | + ], |
|
147 | + ], |
|
148 | + ]], |
|
149 | + 'service_time' => 450, |
|
150 | + 'address_icon' => 'emoji/emoji-bus', |
|
151 | 151 | ]); |
152 | 152 | |
153 | 153 | $abContacts4 = new AddressBookLocation(); |
@@ -162,29 +162,29 @@ discard block |
||
162 | 162 | |
163 | 163 | //region // Add a location with the daily scheduling and blacklist. |
164 | 164 | $AddressBookLocationParameters = AddressBookLocation::fromArray([ |
165 | - 'address_1' => '4629 HILLSIDE DRIVE, Louisville, KY, 40216', |
|
166 | - 'address_alias' => '4629 HILLSIDE DRIVE 40216', |
|
167 | - 'address_group' => 'Scheduled daily', |
|
168 | - 'first_name' => 'Kim', |
|
169 | - 'last_name' => 'Shandor', |
|
170 | - 'address_email' => '[email protected]', |
|
171 | - 'address_phone_number' => '9874152', |
|
172 | - 'cached_lat' => 38.176067, |
|
173 | - 'cached_lng' => -85.824638, |
|
174 | - 'curbside_lat' => 38.176067, |
|
175 | - 'curbside_lng' => -85.824638, |
|
176 | - 'address_city' => 'Louisville', |
|
177 | - 'address_custom_data' => [ |
|
178 | - 'scheduled' => 'yes', |
|
179 | - 'serice type' => 'appliance', |
|
180 | - ], |
|
181 | - 'schedule' => [ |
|
182 | - 'enabled' => true, |
|
183 | - 'mode' => 'daily', |
|
184 | - 'daily' => ['every' => 1], |
|
185 | - ], |
|
186 | - 'schedule_blacklist' => ['2017-02-24', '2017-02-25'], |
|
187 | - 'service_time' => 300, |
|
165 | + 'address_1' => '4629 HILLSIDE DRIVE, Louisville, KY, 40216', |
|
166 | + 'address_alias' => '4629 HILLSIDE DRIVE 40216', |
|
167 | + 'address_group' => 'Scheduled daily', |
|
168 | + 'first_name' => 'Kim', |
|
169 | + 'last_name' => 'Shandor', |
|
170 | + 'address_email' => '[email protected]', |
|
171 | + 'address_phone_number' => '9874152', |
|
172 | + 'cached_lat' => 38.176067, |
|
173 | + 'cached_lng' => -85.824638, |
|
174 | + 'curbside_lat' => 38.176067, |
|
175 | + 'curbside_lng' => -85.824638, |
|
176 | + 'address_city' => 'Louisville', |
|
177 | + 'address_custom_data' => [ |
|
178 | + 'scheduled' => 'yes', |
|
179 | + 'serice type' => 'appliance', |
|
180 | + ], |
|
181 | + 'schedule' => [ |
|
182 | + 'enabled' => true, |
|
183 | + 'mode' => 'daily', |
|
184 | + 'daily' => ['every' => 1], |
|
185 | + ], |
|
186 | + 'schedule_blacklist' => ['2017-02-24', '2017-02-25'], |
|
187 | + 'service_time' => 300, |
|
188 | 188 | ]); |
189 | 189 | |
190 | 190 | $abContacts5 = new AddressBookLocation(); |
@@ -21,11 +21,11 @@ discard block |
||
21 | 21 | $addressRand = (array) $route->GetRandomAddressFromRoute($routeId); |
22 | 22 | |
23 | 23 | if (isset($addressRand['is_depot'])) { |
24 | - if ($addressRand['is_depot']) { |
|
25 | - echo "Random chosen address is depot, it cannot be marked! Try again."; |
|
24 | + if ($addressRand['is_depot']) { |
|
25 | + echo "Random chosen address is depot, it cannot be marked! Try again."; |
|
26 | 26 | |
27 | - return; |
|
28 | - } |
|
27 | + return; |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // Get random address's id from selected route above |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | // Mark the address as detected as deoarted |
38 | 38 | $addressParameters = (array) Address::fromArray([ |
39 | - 'route_id' => $routeId, |
|
40 | - 'route_destination_id' => $route_destination_id, |
|
41 | - 'is_departed' => true, |
|
39 | + 'route_id' => $routeId, |
|
40 | + 'route_destination_id' => $route_destination_id, |
|
41 | + 'is_departed' => true, |
|
42 | 42 | ]); |
43 | 43 | |
44 | 44 | $address = new Address(); |
@@ -27,19 +27,19 @@ |
||
27 | 27 | $addresses = []; |
28 | 28 | |
29 | 29 | $address1 = (array) Address::fromArray([ |
30 | - 'address' => '717 5th Ave New York, NY 10021', |
|
31 | - 'alias' => 'Giorgio Armani', |
|
32 | - 'lat' => 40.7669692, |
|
33 | - 'lng' => 73.9693864, |
|
34 | - 'time' => 0, |
|
30 | + 'address' => '717 5th Ave New York, NY 10021', |
|
31 | + 'alias' => 'Giorgio Armani', |
|
32 | + 'lat' => 40.7669692, |
|
33 | + 'lng' => 73.9693864, |
|
34 | + 'time' => 0, |
|
35 | 35 | ]); |
36 | 36 | |
37 | 37 | $addresses[0] = $address1; |
38 | 38 | |
39 | 39 | $OptimizationParameters = (array) OptimizationProblem::fromArray([ |
40 | - 'optimization_problem_id' => $optimization_problem_id, |
|
41 | - 'addresses' => $addresses, |
|
42 | - 'reoptimize' => 1, |
|
40 | + 'optimization_problem_id' => $optimization_problem_id, |
|
41 | + 'addresses' => $addresses, |
|
42 | + 'reoptimize' => 1, |
|
43 | 43 | ]); |
44 | 44 | |
45 | 45 | $optimizationProblem = new OptimizationProblem(); |