@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | // Get two random locations IDs |
14 | 14 | |
15 | 15 | $adressBookLocationParameters = array( |
16 | - "limit" => 30, |
|
17 | - "offset" => 0 |
|
16 | + "limit" => 30, |
|
17 | + "offset" => 0 |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | $abContacts = new AddressBookLocation(); |
@@ -38,6 +38,6 @@ discard block |
||
38 | 38 | $results = $ablocation->getValue($abcResult, "results"); |
39 | 39 | |
40 | 40 | foreach ($results as $result) { |
41 | - Route4Me::simplePrint($result); |
|
42 | - echo "<br>"; |
|
41 | + Route4Me::simplePrint($result); |
|
42 | + echo "<br>"; |
|
43 | 43 | } |
@@ -12,24 +12,24 @@ discard block |
||
12 | 12 | |
13 | 13 | #region // Add a location, scheduled daily with custom data. |
14 | 14 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
15 | - "address_1" => "1604 PARKRIDGE PKWY, Louisville, KY, 40214", |
|
16 | - "address_alias" => "1604 PARKRIDGE PKWY 40214", |
|
17 | - "address_group" => "Scheduled daily", |
|
18 | - "first_name" => "Peter", |
|
19 | - "last_name" => "Newman", |
|
20 | - "address_email" => "[email protected]", |
|
21 | - "address_phone_number" => "65432178", |
|
22 | - "cached_lat" => 38.141598, |
|
23 | - "cached_lng" => -85.793846, |
|
24 | - "address_city" => "Louisville", |
|
25 | - "address_custom_data" => array("scheduled" => "yes", |
|
26 | - "serice type" => "publishing"), |
|
27 | - "schedule" => array(array( |
|
28 | - "enabled" => true, |
|
29 | - "mode" => "daily", |
|
30 | - "daily" => array("every" => 1) |
|
31 | - )), |
|
32 | - "service_time" => 900 |
|
15 | + "address_1" => "1604 PARKRIDGE PKWY, Louisville, KY, 40214", |
|
16 | + "address_alias" => "1604 PARKRIDGE PKWY 40214", |
|
17 | + "address_group" => "Scheduled daily", |
|
18 | + "first_name" => "Peter", |
|
19 | + "last_name" => "Newman", |
|
20 | + "address_email" => "[email protected]", |
|
21 | + "address_phone_number" => "65432178", |
|
22 | + "cached_lat" => 38.141598, |
|
23 | + "cached_lng" => -85.793846, |
|
24 | + "address_city" => "Louisville", |
|
25 | + "address_custom_data" => array("scheduled" => "yes", |
|
26 | + "serice type" => "publishing"), |
|
27 | + "schedule" => array(array( |
|
28 | + "enabled" => true, |
|
29 | + "mode" => "daily", |
|
30 | + "daily" => array("every" => 1) |
|
31 | + )), |
|
32 | + "service_time" => 900 |
|
33 | 33 | )); |
34 | 34 | |
35 | 35 | $abContacts1 = new AddressBookLocation(); |
@@ -44,27 +44,27 @@ discard block |
||
44 | 44 | |
45 | 45 | #region // Add a location, scheduled weekly. |
46 | 46 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
47 | - "address_1" => "1407 MCCOY, Louisville, KY, 40215", |
|
48 | - "address_alias" => "1407 MCCOY 40215", |
|
49 | - "address_group" => "Scheduled weekly", |
|
50 | - "first_name" => "Bart", |
|
51 | - "last_name" => "Douglas", |
|
52 | - "address_email" => "[email protected]", |
|
53 | - "address_phone_number" => "95487454", |
|
54 | - "cached_lat" => 38.202496, |
|
55 | - "cached_lng" => -85.786514, |
|
56 | - "curbside_lat" => 38.202496, |
|
57 | - "curbside_lng" => -85.786514, |
|
58 | - "address_city" => "Louisville", |
|
59 | - "schedule" => array(array( |
|
60 | - "enabled" => true, |
|
61 | - "mode" => "weekly", |
|
62 | - "weekly" => array( |
|
63 | - "every" => 1, |
|
64 | - "weekdays" => array(1, 2, 3, 4, 5) |
|
65 | - ) |
|
66 | - )), |
|
67 | - "service_time" => 600 |
|
47 | + "address_1" => "1407 MCCOY, Louisville, KY, 40215", |
|
48 | + "address_alias" => "1407 MCCOY 40215", |
|
49 | + "address_group" => "Scheduled weekly", |
|
50 | + "first_name" => "Bart", |
|
51 | + "last_name" => "Douglas", |
|
52 | + "address_email" => "[email protected]", |
|
53 | + "address_phone_number" => "95487454", |
|
54 | + "cached_lat" => 38.202496, |
|
55 | + "cached_lng" => -85.786514, |
|
56 | + "curbside_lat" => 38.202496, |
|
57 | + "curbside_lng" => -85.786514, |
|
58 | + "address_city" => "Louisville", |
|
59 | + "schedule" => array(array( |
|
60 | + "enabled" => true, |
|
61 | + "mode" => "weekly", |
|
62 | + "weekly" => array( |
|
63 | + "every" => 1, |
|
64 | + "weekdays" => array(1, 2, 3, 4, 5) |
|
65 | + ) |
|
66 | + )), |
|
67 | + "service_time" => 600 |
|
68 | 68 | )); |
69 | 69 | |
70 | 70 | $abContacts2 = new AddressBookLocation(); |
@@ -79,33 +79,33 @@ discard block |
||
79 | 79 | |
80 | 80 | #region // Add a location, scheduled monthly (dates mode). |
81 | 81 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
82 | - "address_1" => "4805 BELLEVUE AVE, Louisville, KY, 40215", |
|
83 | - "address_2" => "4806 BELLEVUE AVE, Louisville, KY, 40215", |
|
84 | - "address_alias" => "4805 BELLEVUE AVE 40215", |
|
85 | - "address_group" => "Scheduled monthly", |
|
86 | - "first_name" => "Bart", |
|
87 | - "last_name" => "Douglas", |
|
88 | - "address_email" => "[email protected]", |
|
89 | - "address_phone_number" => "95487454", |
|
90 | - "cached_lat" => 38.178844, |
|
91 | - "cached_lng" => -85.774864, |
|
92 | - "curbside_lat" => 38.178844, |
|
93 | - "curbside_lng" => -85.774864, |
|
94 | - "address_city" => "Louisville", |
|
95 | - "address_country_id" => "US", |
|
96 | - "address_state_id" => "KY", |
|
97 | - "address_zip" => "40215", |
|
98 | - "schedule" => array(array( |
|
99 | - "enabled" => true, |
|
100 | - "mode" => "monthly", |
|
101 | - "monthly" => array( |
|
102 | - "every" => 1, |
|
103 | - "mode" => "dates", |
|
104 | - "dates" => array(20, 22, 23, 24, 25) |
|
105 | - ) |
|
106 | - )), |
|
107 | - "service_time" => 750, |
|
108 | - "color" => "red" |
|
82 | + "address_1" => "4805 BELLEVUE AVE, Louisville, KY, 40215", |
|
83 | + "address_2" => "4806 BELLEVUE AVE, Louisville, KY, 40215", |
|
84 | + "address_alias" => "4805 BELLEVUE AVE 40215", |
|
85 | + "address_group" => "Scheduled monthly", |
|
86 | + "first_name" => "Bart", |
|
87 | + "last_name" => "Douglas", |
|
88 | + "address_email" => "[email protected]", |
|
89 | + "address_phone_number" => "95487454", |
|
90 | + "cached_lat" => 38.178844, |
|
91 | + "cached_lng" => -85.774864, |
|
92 | + "curbside_lat" => 38.178844, |
|
93 | + "curbside_lng" => -85.774864, |
|
94 | + "address_city" => "Louisville", |
|
95 | + "address_country_id" => "US", |
|
96 | + "address_state_id" => "KY", |
|
97 | + "address_zip" => "40215", |
|
98 | + "schedule" => array(array( |
|
99 | + "enabled" => true, |
|
100 | + "mode" => "monthly", |
|
101 | + "monthly" => array( |
|
102 | + "every" => 1, |
|
103 | + "mode" => "dates", |
|
104 | + "dates" => array(20, 22, 23, 24, 25) |
|
105 | + ) |
|
106 | + )), |
|
107 | + "service_time" => 750, |
|
108 | + "color" => "red" |
|
109 | 109 | )); |
110 | 110 | |
111 | 111 | $abContacts3 = new AddressBookLocation(); |
@@ -120,36 +120,36 @@ discard block |
||
120 | 120 | |
121 | 121 | #region // AAdd a location, scheduled monthly (nth mode). |
122 | 122 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
123 | - "address_1" => "730 CECIL AVENUE, Louisville, KY, 40211", |
|
124 | - "address_alias" => "730 CECIL AVENUE 40211", |
|
125 | - "address_group" => "Scheduled monthly", |
|
126 | - "first_name" => "David", |
|
127 | - "last_name" => "Silvester", |
|
128 | - "address_email" => "[email protected]", |
|
129 | - "address_phone_number" => "36985214", |
|
130 | - "cached_lat" => 38.248684, |
|
131 | - "cached_lng" => -85.821121, |
|
132 | - "curbside_lat" => 38.248684, |
|
133 | - "curbside_lng" => -85.821121, |
|
134 | - "address_city" => "Louisville", |
|
135 | - "address_custom_data" => array( |
|
136 | - "scheduled" => "yes", |
|
137 | - "service type" => "library" |
|
138 | - ), |
|
139 | - "schedule" => array(array( |
|
140 | - "enabled" => true, |
|
141 | - "mode" => "monthly", |
|
142 | - "monthly" => array( |
|
143 | - "every" => 1, |
|
144 | - "mode" => "nth", |
|
145 | - "nth" => array( |
|
146 | - "n" => 1, |
|
147 | - "what" => 4 |
|
148 | - ) |
|
149 | - ) |
|
150 | - )), |
|
151 | - "service_time" => 450, |
|
152 | - "address_icon" => "emoji/emoji-bus" |
|
123 | + "address_1" => "730 CECIL AVENUE, Louisville, KY, 40211", |
|
124 | + "address_alias" => "730 CECIL AVENUE 40211", |
|
125 | + "address_group" => "Scheduled monthly", |
|
126 | + "first_name" => "David", |
|
127 | + "last_name" => "Silvester", |
|
128 | + "address_email" => "[email protected]", |
|
129 | + "address_phone_number" => "36985214", |
|
130 | + "cached_lat" => 38.248684, |
|
131 | + "cached_lng" => -85.821121, |
|
132 | + "curbside_lat" => 38.248684, |
|
133 | + "curbside_lng" => -85.821121, |
|
134 | + "address_city" => "Louisville", |
|
135 | + "address_custom_data" => array( |
|
136 | + "scheduled" => "yes", |
|
137 | + "service type" => "library" |
|
138 | + ), |
|
139 | + "schedule" => array(array( |
|
140 | + "enabled" => true, |
|
141 | + "mode" => "monthly", |
|
142 | + "monthly" => array( |
|
143 | + "every" => 1, |
|
144 | + "mode" => "nth", |
|
145 | + "nth" => array( |
|
146 | + "n" => 1, |
|
147 | + "what" => 4 |
|
148 | + ) |
|
149 | + ) |
|
150 | + )), |
|
151 | + "service_time" => 450, |
|
152 | + "address_icon" => "emoji/emoji-bus" |
|
153 | 153 | )); |
154 | 154 | |
155 | 155 | $abContacts4 = new AddressBookLocation(); |
@@ -165,29 +165,29 @@ discard block |
||
165 | 165 | #region // Add a location with the daily scheduling and blacklist. |
166 | 166 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
167 | 167 | |
168 | - "address_1" => "4629 HILLSIDE DRIVE, Louisville, KY, 40216", |
|
169 | - "address_alias" => "4629 HILLSIDE DRIVE 40216", |
|
170 | - "address_group" => "Scheduled daily", |
|
171 | - "first_name" => "Kim", |
|
172 | - "last_name" => "Shandor", |
|
173 | - "address_email" => "[email protected]", |
|
174 | - "address_phone_number" => "9874152", |
|
175 | - "cached_lat" => 38.176067, |
|
176 | - "cached_lng" => -85.824638, |
|
177 | - "curbside_lat" => 38.176067, |
|
178 | - "curbside_lng" => -85.824638, |
|
179 | - "address_city" => "Louisville", |
|
180 | - "address_custom_data" => array( |
|
181 | - "scheduled" => "yes", |
|
182 | - "serice type" => "appliance" |
|
183 | - ), |
|
184 | - "schedule" => array( |
|
185 | - "enabled" => true, |
|
186 | - "mode" => "daily", |
|
187 | - "daily" => array("every" => 1) |
|
188 | - ), |
|
189 | - "schedule_blacklist" => array("2017-02-24", "2017-02-25"), |
|
190 | - "service_time" => 300 |
|
168 | + "address_1" => "4629 HILLSIDE DRIVE, Louisville, KY, 40216", |
|
169 | + "address_alias" => "4629 HILLSIDE DRIVE 40216", |
|
170 | + "address_group" => "Scheduled daily", |
|
171 | + "first_name" => "Kim", |
|
172 | + "last_name" => "Shandor", |
|
173 | + "address_email" => "[email protected]", |
|
174 | + "address_phone_number" => "9874152", |
|
175 | + "cached_lat" => 38.176067, |
|
176 | + "cached_lng" => -85.824638, |
|
177 | + "curbside_lat" => 38.176067, |
|
178 | + "curbside_lng" => -85.824638, |
|
179 | + "address_city" => "Louisville", |
|
180 | + "address_custom_data" => array( |
|
181 | + "scheduled" => "yes", |
|
182 | + "serice type" => "appliance" |
|
183 | + ), |
|
184 | + "schedule" => array( |
|
185 | + "enabled" => true, |
|
186 | + "mode" => "daily", |
|
187 | + "daily" => array("every" => 1) |
|
188 | + ), |
|
189 | + "schedule_blacklist" => array("2017-02-24", "2017-02-25"), |
|
190 | + "service_time" => 300 |
|
191 | 191 | )); |
192 | 192 | |
193 | 193 | $abContacts5 = new AddressBookLocation(); |
@@ -11,10 +11,10 @@ |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
14 | - "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
15 | - "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
16 | - "cached_lat" => 38.024654, |
|
17 | - "cached_lng" => -77.338814 |
|
14 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
15 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
16 | + "cached_lat" => 38.024654, |
|
17 | + "cached_lng" => -77.338814 |
|
18 | 18 | )); |
19 | 19 | |
20 | 20 | $abContacts = new AddressBookLocation(); |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | assert(!is_null($routeId), "Can't retrieve random route_id"); |
21 | 21 | |
22 | 22 | $activityParameters = ActivityParameters::fromArray(array( |
23 | - "route_id" => $routeId, |
|
24 | - "team" => "true" |
|
23 | + "route_id" => $routeId, |
|
24 | + "team" => "true" |
|
25 | 25 | )); |
26 | 26 | |
27 | 27 | $activities = new ActivityParameters(); |
@@ -30,5 +30,5 @@ discard block |
||
30 | 30 | |
31 | 31 | foreach ($results as $result) { |
32 | 32 | Route4Me::simplePrint($result); |
33 | - echo "<br>"; |
|
33 | + echo "<br>"; |
|
34 | 34 | } |
@@ -29,10 +29,10 @@ |
||
29 | 29 | $address = new Address(); |
30 | 30 | |
31 | 31 | $params = array( |
32 | - "route_id" => $routeId, |
|
33 | - "address_id" => $route_destination_id, |
|
34 | - "is_departed" => 1, |
|
35 | - "member_id" => 1 |
|
32 | + "route_id" => $routeId, |
|
33 | + "address_id" => $route_destination_id, |
|
34 | + "is_departed" => 1, |
|
35 | + "member_id" => 1 |
|
36 | 36 | ); |
37 | 37 | |
38 | 38 | $result = $address->markAsDeparted($params); |
@@ -23,25 +23,25 @@ |
||
23 | 23 | $addresses = array(); |
24 | 24 | |
25 | 25 | $address1 = (array)Address::fromArray(array( |
26 | - 'address' => '146 Bill Johnson Rd NE Milledgeville GA 31061', |
|
27 | - 'lat' => 33.143526, |
|
28 | - 'lng' => -83.240354, |
|
29 | - 'time' => 0 |
|
26 | + 'address' => '146 Bill Johnson Rd NE Milledgeville GA 31061', |
|
27 | + 'lat' => 33.143526, |
|
28 | + 'lng' => -83.240354, |
|
29 | + 'time' => 0 |
|
30 | 30 | )); |
31 | 31 | |
32 | 32 | $address2 = (array)Address::fromArray(array( |
33 | - 'address' => '222 Blake Cir Milledgeville GA 31061', |
|
34 | - 'lat' => 33.177852, |
|
35 | - 'lng' => -83.263535, |
|
36 | - 'time' => 0 |
|
33 | + 'address' => '222 Blake Cir Milledgeville GA 31061', |
|
34 | + 'lat' => 33.177852, |
|
35 | + 'lng' => -83.263535, |
|
36 | + 'time' => 0 |
|
37 | 37 | )); |
38 | 38 | |
39 | 39 | $addresses[] = $address1; |
40 | 40 | $addresses[] = $address2; |
41 | 41 | |
42 | 42 | $routeParameters = array( |
43 | - "route_id" => $routeId, |
|
44 | - "addresses" => array($address1, $address2) |
|
43 | + "route_id" => $routeId, |
|
44 | + "addresses" => array($address1, $address2) |
|
45 | 45 | ); |
46 | 46 | |
47 | 47 | $route1 = new Route(); |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | $addressRand = (array)$route->GetRandomAddressFromRoute($routeId); |
24 | 24 | |
25 | 25 | if (isset($addressRand['is_depot'])) { |
26 | - if ($addressRand['is_depot']) { |
|
27 | - echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
28 | - return; |
|
29 | - } |
|
26 | + if ($addressRand['is_depot']) { |
|
27 | + echo "Random choosed address is depot, it can't be marked!.. Try again."; |
|
28 | + return; |
|
29 | + } |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // Get random address's id from selected route above |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $address = new Address(); |
40 | 40 | |
41 | 41 | $params = array( |
42 | - "route_id" => $routeId, |
|
43 | - "address_id" => $route_destination_id, |
|
44 | - "is_visited" => 1, |
|
45 | - "member_id" => 1 |
|
42 | + "route_id" => $routeId, |
|
43 | + "address_id" => $route_destination_id, |
|
44 | + "is_visited" => 1, |
|
45 | + "member_id" => 1 |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | $result = $address->markAsVisited($params); |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | Route4Me::setApiKey('11111111111111111111111111111111'); |
12 | 12 | |
13 | 13 | $routeParameters = array( |
14 | - 'limit' => 5, |
|
15 | - 'offset' => 0 |
|
14 | + 'limit' => 5, |
|
15 | + 'offset' => 0 |
|
16 | 16 | ); |
17 | 17 | |
18 | 18 | $optimizationProblem = new OptimizationProblem(); |
@@ -20,5 +20,5 @@ discard block |
||
20 | 20 | $optimizations = $optimizationProblem->get($routeParameters); |
21 | 21 | |
22 | 22 | foreach ($optimizations as $optimization) { |
23 | - echo "Optimization problem ID -> ".$optimization->optimization_problem_id."<br>"; |
|
23 | + echo "Optimization problem ID -> ".$optimization->optimization_problem_id."<br>"; |
|
24 | 24 | } |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | 16 | $orderParameters = Order::fromArray(array( |
17 | - "day_added_YYMMDD" => date("Y-m-d", strtotime('-1 days')), |
|
18 | - "offset" => 0, |
|
19 | - "limit" => 5 |
|
17 | + "day_added_YYMMDD" => date("Y-m-d", strtotime('-1 days')), |
|
18 | + "offset" => 0, |
|
19 | + "limit" => 5 |
|
20 | 20 | )); |
21 | 21 | |
22 | 22 | $order = new Order(); |
@@ -24,6 +24,6 @@ discard block |
||
24 | 24 | $response = $order->getOrder($orderParameters); |
25 | 25 | |
26 | 26 | foreach ($response['results'] as $key => $order) { |
27 | - Route4Me::simplePrint($order); |
|
28 | - echo "<br>"; |
|
27 | + Route4Me::simplePrint($order); |
|
28 | + echo "<br>"; |
|
29 | 29 | } |