@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | Route4Me::setApiKey('11111111111111111111111111111111'); |
15 | 15 | |
16 | 16 | $AdressBookLocationParameters = AddressBookLocation::fromArray(array( |
17 | - "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
18 | - "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
19 | - "cached_lat" => 38.024654, |
|
20 | - "cached_lng" => -77.338814 |
|
17 | + "first_name" => "Test FirstName ".strval(rand(10000, 99999)), |
|
18 | + "address_1" => "Test Address1 ".strval(rand(10000, 99999)), |
|
19 | + "cached_lat" => 38.024654, |
|
20 | + "cached_lng" => -77.338814 |
|
21 | 21 | )); |
22 | 22 | |
23 | 23 | $abContacts = new AddressBookLocation(); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $address_id = -1; |
28 | 28 | |
29 | 29 | if (isset($createdContact['address_id'])) { |
30 | - $address_id = $createdContact["address_id"]; |
|
30 | + $address_id = $createdContact["address_id"]; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | assert($address_id!=-1, "Creating of Address Book Location was failed. Try again!.. <br>"); |
@@ -18,14 +18,14 @@ |
||
18 | 18 | |
19 | 19 | $territoryParams['type'] = TerritoryTypes::CIRCLE; |
20 | 20 | $territoryParams['data'] = array( |
21 | - "37.569752822786455,-77.47833251953125", |
|
22 | - "5000" |
|
21 | + "37.569752822786455,-77.47833251953125", |
|
22 | + "5000" |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $TerritoryParameters = Territory::fromArray(array( |
26 | - "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | - "territory_color" => "ff7700", |
|
28 | - "territory" => $territoryParams |
|
26 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | + "territory_color" => "ff7700", |
|
28 | + "territory" => $territoryParams |
|
29 | 29 | )); |
30 | 30 | |
31 | 31 | $territory = new Territory(); |
@@ -16,14 +16,14 @@ |
||
16 | 16 | |
17 | 17 | $territoryParams['type'] = TerritoryTypes::RECT; |
18 | 18 | $territoryParams['data'] = array( |
19 | - "43.51668853502909,-109.3798828125", |
|
20 | - "46.98025235521883,-101.865234375" |
|
19 | + "43.51668853502909,-109.3798828125", |
|
20 | + "46.98025235521883,-101.865234375" |
|
21 | 21 | ); |
22 | 22 | |
23 | 23 | $TerritoryParameters = Territory::fromArray(array( |
24 | - "territory_name" => "Test Rectangular Territory ".strval(rand(10000, 99999)), |
|
25 | - "territory_color" => "ff7700", |
|
26 | - "territory" => $territoryParams |
|
24 | + "territory_name" => "Test Rectangular Territory ".strval(rand(10000, 99999)), |
|
25 | + "territory_color" => "ff7700", |
|
26 | + "territory" => $territoryParams |
|
27 | 27 | )); |
28 | 28 | |
29 | 29 | $territory = new Territory(); |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $territoryParams['type'] = TerritoryTypes::CIRCLE; |
20 | 20 | $territoryParams['data'] = array( |
21 | - "37.569752822786455,-77.47833251953125", |
|
22 | - "5000" |
|
21 | + "37.569752822786455,-77.47833251953125", |
|
22 | + "5000" |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $TerritoryParameters = Territory::fromArray(array( |
26 | - "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | - "territory_color" => "ff7700", |
|
28 | - "territory" => $territoryParams |
|
26 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | + "territory_color" => "ff7700", |
|
28 | + "territory" => $territoryParams |
|
29 | 29 | )); |
30 | 30 | |
31 | 31 | $result = (array)$territory->addTerritory($TerritoryParameters); |
@@ -38,18 +38,18 @@ discard block |
||
38 | 38 | |
39 | 39 | // Update territory |
40 | 40 | $territoryParameters = array ( |
41 | - "type" => TerritoryTypes::RECT, |
|
42 | - "data" => array( |
|
43 | - "29.6600127358956,-95.6593322753906", |
|
44 | - "29.8966150753098,-95.3146362304688" |
|
45 | - ) |
|
41 | + "type" => TerritoryTypes::RECT, |
|
42 | + "data" => array( |
|
43 | + "29.6600127358956,-95.6593322753906", |
|
44 | + "29.8966150753098,-95.3146362304688" |
|
45 | + ) |
|
46 | 46 | ); |
47 | 47 | |
48 | 48 | $TerritoryParameters = Territory::fromArray(array( |
49 | - "territory_id" => $territory_id, |
|
50 | - "territory_name" => "Test Territory Updated as rectangle", |
|
51 | - "territory_color" => "ff5500", |
|
52 | - "territory" => $territoryParameters |
|
49 | + "territory_id" => $territory_id, |
|
50 | + "territory_name" => "Test Territory Updated as rectangle", |
|
51 | + "territory_color" => "ff5500", |
|
52 | + "territory" => $territoryParameters |
|
53 | 53 | )); |
54 | 54 | |
55 | 55 | $result1 = $territory->updateTerritory($TerritoryParameters); |
@@ -16,21 +16,21 @@ |
||
16 | 16 | |
17 | 17 | $territoryParams['type'] = TerritoryTypes::POLY; |
18 | 18 | $territoryParams['data'] = array( |
19 | - "37.769752822786455,-77.67833251953125", |
|
20 | - "37.75886716305343,-77.68974800109863", |
|
21 | - "37.74763966054455,-77.6917221069336", |
|
22 | - "37.74655084306813,-77.68863220214844", |
|
23 | - "37.7502255383101,-77.68125076293945", |
|
24 | - "37.74797991274437,-77.67498512268066", |
|
25 | - "37.73327960206065,-77.6411678314209", |
|
26 | - "37.74430510679532,-77.63172645568848", |
|
27 | - "37.76641925847049,-77.66846199035645" |
|
19 | + "37.769752822786455,-77.67833251953125", |
|
20 | + "37.75886716305343,-77.68974800109863", |
|
21 | + "37.74763966054455,-77.6917221069336", |
|
22 | + "37.74655084306813,-77.68863220214844", |
|
23 | + "37.7502255383101,-77.68125076293945", |
|
24 | + "37.74797991274437,-77.67498512268066", |
|
25 | + "37.73327960206065,-77.6411678314209", |
|
26 | + "37.74430510679532,-77.63172645568848", |
|
27 | + "37.76641925847049,-77.66846199035645" |
|
28 | 28 | ); |
29 | 29 | |
30 | 30 | $TerritoryParameters = Territory::fromArray(array( |
31 | - "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
32 | - "territory_color" => "ff7700", |
|
33 | - "territory" => $territoryParams |
|
31 | + "territory_name" => "Test Polygonian Territory ".strval(rand(10000, 99999)), |
|
32 | + "territory_color" => "ff7700", |
|
33 | + "territory" => $territoryParams |
|
34 | 34 | )); |
35 | 35 | |
36 | 36 | $territory = new Territory(); |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | |
19 | 19 | $territoryParams['type'] = TerritoryTypes::CIRCLE; |
20 | 20 | $territoryParams['data'] = array( |
21 | - "37.569752822786455,-77.47833251953125", |
|
22 | - "5000" |
|
21 | + "37.569752822786455,-77.47833251953125", |
|
22 | + "5000" |
|
23 | 23 | ); |
24 | 24 | |
25 | 25 | $TerritoryParameters = Territory::fromArray(array( |
26 | - "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | - "territory_color" => "ff7700", |
|
28 | - "territory" => $territoryParams |
|
26 | + "territory_name" => "Test Territory ".strval(rand(10000, 99999)), |
|
27 | + "territory_color" => "ff7700", |
|
28 | + "territory" => $territoryParams |
|
29 | 29 | )); |
30 | 30 | |
31 | 31 | $territory = new Territory(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | echo "---------------------------------------------------------------<br><br>"; |
42 | 42 | |
43 | 43 | $params = array( |
44 | - "territory_id" => $territory_id |
|
44 | + "territory_id" => $territory_id |
|
45 | 45 | ); |
46 | 46 | |
47 | 47 | $result1 = $territory->getTerritory($params); |
@@ -6,327 +6,327 @@ |
||
6 | 6 | |
7 | 7 | class Member extends Common |
8 | 8 | { |
9 | - public $device_id; |
|
10 | - public $device_type; |
|
11 | - public $format; |
|
9 | + public $device_id; |
|
10 | + public $device_type; |
|
11 | + public $format; |
|
12 | 12 | |
13 | - public $strEmail; |
|
14 | - public $strPassword; |
|
15 | - public $strPassword_1; |
|
16 | - public $strPassword_2; |
|
17 | - public $strFirstName; |
|
18 | - public $strLastName; |
|
19 | - public $strIndustry; |
|
20 | - public $chkTerms; |
|
21 | - public $plan; |
|
13 | + public $strEmail; |
|
14 | + public $strPassword; |
|
15 | + public $strPassword_1; |
|
16 | + public $strPassword_2; |
|
17 | + public $strFirstName; |
|
18 | + public $strLastName; |
|
19 | + public $strIndustry; |
|
20 | + public $chkTerms; |
|
21 | + public $plan; |
|
22 | 22 | |
23 | - public $session_guid; |
|
24 | - public $member_id; |
|
23 | + public $session_guid; |
|
24 | + public $member_id; |
|
25 | 25 | |
26 | - public $email_address; |
|
27 | - public $first_name; |
|
28 | - public $last_name; |
|
29 | - public $phone_number; |
|
30 | - public $company_name; |
|
31 | - public $webinar_date; |
|
26 | + public $email_address; |
|
27 | + public $first_name; |
|
28 | + public $last_name; |
|
29 | + public $phone_number; |
|
30 | + public $company_name; |
|
31 | + public $webinar_date; |
|
32 | 32 | |
33 | - public $subscription_name; |
|
34 | - public $token; |
|
35 | - public $payload; |
|
33 | + public $subscription_name; |
|
34 | + public $token; |
|
35 | + public $payload; |
|
36 | 36 | |
37 | - public $HIDE_ROUTED_ADDRESSES; |
|
38 | - public $member_phone; |
|
39 | - public $member_zipcode; |
|
40 | - public $route_count; |
|
41 | - public $member_email; |
|
42 | - public $HIDE_VISITED_ADDRESSES; |
|
43 | - public $READONLY_USER; |
|
44 | - public $member_type; |
|
45 | - public $date_of_birth; |
|
46 | - public $member_first_name; |
|
47 | - public $member_password; |
|
48 | - public $HIDE_NONFUTURE_ROUTES; |
|
49 | - public $member_last_name; |
|
50 | - public $SHOW_ALL_VEHICLES; |
|
51 | - public $SHOW_ALL_DRIVERS; |
|
37 | + public $HIDE_ROUTED_ADDRESSES; |
|
38 | + public $member_phone; |
|
39 | + public $member_zipcode; |
|
40 | + public $route_count; |
|
41 | + public $member_email; |
|
42 | + public $HIDE_VISITED_ADDRESSES; |
|
43 | + public $READONLY_USER; |
|
44 | + public $member_type; |
|
45 | + public $date_of_birth; |
|
46 | + public $member_first_name; |
|
47 | + public $member_password; |
|
48 | + public $HIDE_NONFUTURE_ROUTES; |
|
49 | + public $member_last_name; |
|
50 | + public $SHOW_ALL_VEHICLES; |
|
51 | + public $SHOW_ALL_DRIVERS; |
|
52 | 52 | |
53 | - public $config_key; |
|
54 | - public $config_value; |
|
53 | + public $config_key; |
|
54 | + public $config_value; |
|
55 | 55 | |
56 | - public $preferred_units; |
|
57 | - public $preferred_language; |
|
58 | - public $timezone; |
|
59 | - public $OWNER_MEMBER_ID; |
|
60 | - public $user_reg_state_id; |
|
61 | - public $user_reg_country_id; |
|
62 | - public $member_picture; |
|
63 | - public $api_key; |
|
64 | - public $custom_data; |
|
56 | + public $preferred_units; |
|
57 | + public $preferred_language; |
|
58 | + public $timezone; |
|
59 | + public $OWNER_MEMBER_ID; |
|
60 | + public $user_reg_state_id; |
|
61 | + public $user_reg_country_id; |
|
62 | + public $member_picture; |
|
63 | + public $api_key; |
|
64 | + public $custom_data; |
|
65 | 65 | |
66 | - public static function fromArray(array $params) |
|
67 | - { |
|
68 | - $member= new Member(); |
|
69 | - |
|
70 | - foreach($params as $key => $value) { |
|
71 | - if (property_exists($member, $key)) { |
|
72 | - $member->{$key} = $value; |
|
73 | - } |
|
74 | - } |
|
75 | - |
|
76 | - return $member; |
|
77 | - } |
|
66 | + public static function fromArray(array $params) |
|
67 | + { |
|
68 | + $member= new Member(); |
|
69 | + |
|
70 | + foreach($params as $key => $value) { |
|
71 | + if (property_exists($member, $key)) { |
|
72 | + $member->{$key} = $value; |
|
73 | + } |
|
74 | + } |
|
75 | + |
|
76 | + return $member; |
|
77 | + } |
|
78 | 78 | |
79 | - public static function getUsers() |
|
80 | - { |
|
81 | - $response = Route4Me::makeRequst(array( |
|
82 | - 'url' => Endpoint::USER_V4, |
|
83 | - 'method' => 'GET' |
|
84 | - )); |
|
79 | + public static function getUsers() |
|
80 | + { |
|
81 | + $response = Route4Me::makeRequst(array( |
|
82 | + 'url' => Endpoint::USER_V4, |
|
83 | + 'method' => 'GET' |
|
84 | + )); |
|
85 | 85 | |
86 | - return $response; |
|
87 | - } |
|
86 | + return $response; |
|
87 | + } |
|
88 | 88 | |
89 | - public static function getUser($params) |
|
90 | - { |
|
91 | - $response = Route4Me::makeRequst(array( |
|
92 | - 'url' => Endpoint::USER_V4, |
|
93 | - 'method' => 'GET', |
|
94 | - 'query' => array( |
|
95 | - 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
96 | - ) |
|
97 | - )); |
|
89 | + public static function getUser($params) |
|
90 | + { |
|
91 | + $response = Route4Me::makeRequst(array( |
|
92 | + 'url' => Endpoint::USER_V4, |
|
93 | + 'method' => 'GET', |
|
94 | + 'query' => array( |
|
95 | + 'member_id' => isset($params['member_id']) ? $params['member_id'] : null |
|
96 | + ) |
|
97 | + )); |
|
98 | 98 | |
99 | - return $response; |
|
100 | - } |
|
99 | + return $response; |
|
100 | + } |
|
101 | 101 | |
102 | - public static function getUserLocations($param) |
|
103 | - { |
|
104 | - $response = Route4Me::makeRequst(array( |
|
105 | - 'url' => Endpoint::VIEW_USER_LOCATIONS, |
|
106 | - 'method' => 'GET', |
|
107 | - 'query' => array( |
|
108 | - 'query' => $param |
|
109 | - ) |
|
110 | - )); |
|
102 | + public static function getUserLocations($param) |
|
103 | + { |
|
104 | + $response = Route4Me::makeRequst(array( |
|
105 | + 'url' => Endpoint::VIEW_USER_LOCATIONS, |
|
106 | + 'method' => 'GET', |
|
107 | + 'query' => array( |
|
108 | + 'query' => $param |
|
109 | + ) |
|
110 | + )); |
|
111 | 111 | |
112 | - return $response; |
|
113 | - } |
|
112 | + return $response; |
|
113 | + } |
|
114 | 114 | |
115 | - public static function addDeviceRecord($params) |
|
116 | - { |
|
117 | - $allQueryFields = array('device_id', 'device_type'); |
|
118 | - $allBodyFields = array('device_id', 'device_type', 'format'); |
|
119 | - |
|
120 | - $response = Route4Me::makeRequst(array( |
|
121 | - 'url' => Endpoint::VERIFY_DEVICE_LICENSE, |
|
122 | - 'method' => 'POST', |
|
123 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
124 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
125 | - )); |
|
126 | - |
|
127 | - return $response; |
|
128 | - } |
|
115 | + public static function addDeviceRecord($params) |
|
116 | + { |
|
117 | + $allQueryFields = array('device_id', 'device_type'); |
|
118 | + $allBodyFields = array('device_id', 'device_type', 'format'); |
|
119 | + |
|
120 | + $response = Route4Me::makeRequst(array( |
|
121 | + 'url' => Endpoint::VERIFY_DEVICE_LICENSE, |
|
122 | + 'method' => 'POST', |
|
123 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
124 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
125 | + )); |
|
126 | + |
|
127 | + return $response; |
|
128 | + } |
|
129 | 129 | |
130 | - public static function createMember($params) |
|
131 | - { |
|
132 | - $excludeFields = array('session_guid', 'member_id', 'token', 'payload', 'webinar_date', |
|
133 | - 'company_name', 'config_key', 'config_value', 'api_key'); |
|
130 | + public static function createMember($params) |
|
131 | + { |
|
132 | + $excludeFields = array('session_guid', 'member_id', 'token', 'payload', 'webinar_date', |
|
133 | + 'company_name', 'config_key', 'config_value', 'api_key'); |
|
134 | 134 | |
135 | - $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
135 | + $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
136 | 136 | |
137 | - $response = Route4Me::makeRequst(array( |
|
138 | - 'url' => Endpoint::USER_V4, |
|
139 | - 'method' => 'POST', |
|
140 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
141 | - )); |
|
142 | - |
|
143 | - return $response; |
|
144 | - } |
|
137 | + $response = Route4Me::makeRequst(array( |
|
138 | + 'url' => Endpoint::USER_V4, |
|
139 | + 'method' => 'POST', |
|
140 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
141 | + )); |
|
142 | + |
|
143 | + return $response; |
|
144 | + } |
|
145 | 145 | |
146 | - public static function getRandomMemberByType($memberType) |
|
147 | - { |
|
148 | - $members = self::getUsers(); |
|
146 | + public static function getRandomMemberByType($memberType) |
|
147 | + { |
|
148 | + $members = self::getUsers(); |
|
149 | 149 | |
150 | - if (is_null($members)) { |
|
151 | - return null; |
|
152 | - } |
|
150 | + if (is_null($members)) { |
|
151 | + return null; |
|
152 | + } |
|
153 | 153 | |
154 | - if (!isset($members['results'])) { |
|
155 | - return null; |
|
156 | - } |
|
154 | + if (!isset($members['results'])) { |
|
155 | + return null; |
|
156 | + } |
|
157 | 157 | |
158 | - $memberIDs = array(); |
|
158 | + $memberIDs = array(); |
|
159 | 159 | |
160 | - foreach ($members['results'] as $memb) { |
|
161 | - if (isset($memb['member_id']) && isset($memb['member_type'])) { |
|
162 | - if ($memberType==$memb['member_type']) $memberIDs[]=$memb['member_id']; |
|
163 | - } |
|
164 | - } |
|
160 | + foreach ($members['results'] as $memb) { |
|
161 | + if (isset($memb['member_id']) && isset($memb['member_type'])) { |
|
162 | + if ($memberType==$memb['member_type']) $memberIDs[]=$memb['member_id']; |
|
163 | + } |
|
164 | + } |
|
165 | 165 | |
166 | - if (sizeof($memberIDs)<1) { |
|
167 | - return null; |
|
168 | - } |
|
166 | + if (sizeof($memberIDs)<1) { |
|
167 | + return null; |
|
168 | + } |
|
169 | 169 | |
170 | - $randomIndex = rand(0, sizeof($memberIDs) - 1); |
|
170 | + $randomIndex = rand(0, sizeof($memberIDs) - 1); |
|
171 | 171 | |
172 | - return $memberIDs[$randomIndex]; |
|
173 | - } |
|
172 | + return $memberIDs[$randomIndex]; |
|
173 | + } |
|
174 | 174 | |
175 | 175 | |
176 | - public static function updateMember($body) |
|
177 | - { |
|
178 | - $excludeFields = array('session_guid', 'token', 'payload', 'webinar_date', |
|
179 | - 'company_name', 'config_key', 'config_value', 'api_key'); |
|
176 | + public static function updateMember($body) |
|
177 | + { |
|
178 | + $excludeFields = array('session_guid', 'token', 'payload', 'webinar_date', |
|
179 | + 'company_name', 'config_key', 'config_value', 'api_key'); |
|
180 | 180 | |
181 | - $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
181 | + $allBodyFields = Route4Me::getObjectProperties(new Member(), $excludeFields); |
|
182 | 182 | |
183 | - $response = Route4Me::makeRequst(array( |
|
184 | - 'url' => Endpoint::USER_V4, |
|
185 | - 'method' => 'PUT', |
|
186 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $body) |
|
187 | - )); |
|
183 | + $response = Route4Me::makeRequst(array( |
|
184 | + 'url' => Endpoint::USER_V4, |
|
185 | + 'method' => 'PUT', |
|
186 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $body) |
|
187 | + )); |
|
188 | 188 | |
189 | - return $response; |
|
190 | - } |
|
189 | + return $response; |
|
190 | + } |
|
191 | 191 | |
192 | - public static function deleteMember($body) |
|
193 | - { |
|
194 | - $response = Route4Me::makeRequst(array( |
|
195 | - 'url' => Endpoint::USER_V4, |
|
196 | - 'method' => 'DELETE', |
|
197 | - 'body' => array( |
|
198 | - 'member_id' => isset($body->member_id) ? $body->member_id : null |
|
199 | - ) |
|
192 | + public static function deleteMember($body) |
|
193 | + { |
|
194 | + $response = Route4Me::makeRequst(array( |
|
195 | + 'url' => Endpoint::USER_V4, |
|
196 | + 'method' => 'DELETE', |
|
197 | + 'body' => array( |
|
198 | + 'member_id' => isset($body->member_id) ? $body->member_id : null |
|
199 | + ) |
|
200 | 200 | |
201 | - )); |
|
201 | + )); |
|
202 | 202 | |
203 | - return $response; |
|
204 | - } |
|
203 | + return $response; |
|
204 | + } |
|
205 | 205 | |
206 | - public static function newAccountRegistration($params) |
|
207 | - { |
|
208 | - $allQueryFields = array('plan'); |
|
209 | - $allBodyFields = array('strEmail', 'strPassword_1', 'strPassword_2', 'strFirstName', |
|
210 | - 'strLastName', 'format', 'strIndustry', 'chkTerms', |
|
211 | - 'device_type', 'strSubAccountType', 'blDisableMarketing', 'blDisableAccountActivationEmail'); |
|
212 | - |
|
213 | - $response = Route4Me::makeRequst(array( |
|
214 | - 'url' => Endpoint::REGISTER_ACTION, |
|
215 | - 'method' => 'POST', |
|
216 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
217 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
218 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
219 | - )); |
|
220 | - |
|
221 | - return $response; |
|
222 | - } |
|
206 | + public static function newAccountRegistration($params) |
|
207 | + { |
|
208 | + $allQueryFields = array('plan'); |
|
209 | + $allBodyFields = array('strEmail', 'strPassword_1', 'strPassword_2', 'strFirstName', |
|
210 | + 'strLastName', 'format', 'strIndustry', 'chkTerms', |
|
211 | + 'device_type', 'strSubAccountType', 'blDisableMarketing', 'blDisableAccountActivationEmail'); |
|
212 | + |
|
213 | + $response = Route4Me::makeRequst(array( |
|
214 | + 'url' => Endpoint::REGISTER_ACTION, |
|
215 | + 'method' => 'POST', |
|
216 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
217 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
218 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
219 | + )); |
|
220 | + |
|
221 | + return $response; |
|
222 | + } |
|
223 | 223 | |
224 | - public static function validateSession($params) |
|
225 | - { |
|
226 | - $allQueryFields = array('session_guid', 'member_id', 'format'); |
|
227 | - |
|
228 | - $response = Route4Me::makeRequst(array( |
|
229 | - 'url' => Endpoint::VALIDATE_SESSION, |
|
230 | - 'method' => 'GET', |
|
231 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
232 | - )); |
|
233 | - |
|
234 | - return $response; |
|
235 | - } |
|
224 | + public static function validateSession($params) |
|
225 | + { |
|
226 | + $allQueryFields = array('session_guid', 'member_id', 'format'); |
|
227 | + |
|
228 | + $response = Route4Me::makeRequst(array( |
|
229 | + 'url' => Endpoint::VALIDATE_SESSION, |
|
230 | + 'method' => 'GET', |
|
231 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
232 | + )); |
|
233 | + |
|
234 | + return $response; |
|
235 | + } |
|
236 | 236 | |
237 | - public static function memberAuthentication($params) |
|
238 | - { |
|
239 | - $allBodyFields = array('strEmail', 'strPassword', 'format'); |
|
240 | - |
|
241 | - $response = Route4Me::makeRequst(array( |
|
242 | - 'url' => Endpoint::AUTHENTICATE, |
|
243 | - 'method' => 'POST', |
|
244 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
245 | - 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
246 | - )); |
|
247 | - |
|
248 | - return $response; |
|
249 | - } |
|
237 | + public static function memberAuthentication($params) |
|
238 | + { |
|
239 | + $allBodyFields = array('strEmail', 'strPassword', 'format'); |
|
240 | + |
|
241 | + $response = Route4Me::makeRequst(array( |
|
242 | + 'url' => Endpoint::AUTHENTICATE, |
|
243 | + 'method' => 'POST', |
|
244 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params), |
|
245 | + 'HTTPHEADER' => 'Content-Type: multipart/form-data' |
|
246 | + )); |
|
247 | + |
|
248 | + return $response; |
|
249 | + } |
|
250 | 250 | |
251 | - public static function webinarRegistration($params) |
|
252 | - { |
|
253 | - $allBodyFields = array('email_address', 'first_name', 'last_name', 'phone_number', |
|
254 | - 'company_name', 'member_id', 'webinar_date'); |
|
255 | - |
|
256 | - $response = Route4Me::makeRequst(array( |
|
257 | - 'url' => Endpoint::WEBINAR_REGISTER, |
|
258 | - 'method' => 'POST', |
|
259 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
260 | - )); |
|
261 | - |
|
262 | - return $response; |
|
263 | - } |
|
251 | + public static function webinarRegistration($params) |
|
252 | + { |
|
253 | + $allBodyFields = array('email_address', 'first_name', 'last_name', 'phone_number', |
|
254 | + 'company_name', 'member_id', 'webinar_date'); |
|
255 | + |
|
256 | + $response = Route4Me::makeRequst(array( |
|
257 | + 'url' => Endpoint::WEBINAR_REGISTER, |
|
258 | + 'method' => 'POST', |
|
259 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
260 | + )); |
|
261 | + |
|
262 | + return $response; |
|
263 | + } |
|
264 | 264 | |
265 | - public static function purchaseUserLicense($params) |
|
266 | - { |
|
267 | - $allQueryFields = array('device_id'); |
|
268 | - $allBodyFields = array('member_id', 'session_guid', 'device_id', 'device_type', |
|
269 | - 'subscription_name', 'token', 'payload', 'format'); |
|
270 | - |
|
271 | - $response = Route4Me::makeRequst(array( |
|
272 | - 'url' => Endpoint::USER_LICENSE, |
|
273 | - 'method' => 'POST', |
|
274 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
275 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
276 | - )); |
|
277 | - |
|
278 | - return $response; |
|
279 | - } |
|
265 | + public static function purchaseUserLicense($params) |
|
266 | + { |
|
267 | + $allQueryFields = array('device_id'); |
|
268 | + $allBodyFields = array('member_id', 'session_guid', 'device_id', 'device_type', |
|
269 | + 'subscription_name', 'token', 'payload', 'format'); |
|
270 | + |
|
271 | + $response = Route4Me::makeRequst(array( |
|
272 | + 'url' => Endpoint::USER_LICENSE, |
|
273 | + 'method' => 'POST', |
|
274 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params), |
|
275 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
276 | + )); |
|
277 | + |
|
278 | + return $response; |
|
279 | + } |
|
280 | 280 | |
281 | - public static function newMemberConfigKey($params) |
|
282 | - { |
|
283 | - $allBodyFields = array('config_key', 'config_value'); |
|
284 | - |
|
285 | - $response = Route4Me::makeRequst(array( |
|
286 | - 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
287 | - 'method' => 'POST', |
|
288 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
289 | - )); |
|
290 | - |
|
291 | - return $response; |
|
292 | - } |
|
281 | + public static function newMemberConfigKey($params) |
|
282 | + { |
|
283 | + $allBodyFields = array('config_key', 'config_value'); |
|
284 | + |
|
285 | + $response = Route4Me::makeRequst(array( |
|
286 | + 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
287 | + 'method' => 'POST', |
|
288 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
289 | + )); |
|
290 | + |
|
291 | + return $response; |
|
292 | + } |
|
293 | 293 | |
294 | - public static function removeMemberConfigKey($params) |
|
295 | - { |
|
296 | - $allBodyFields = array('config_key'); |
|
297 | - |
|
298 | - $response = Route4Me::makeRequst(array( |
|
299 | - 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
300 | - 'method' => 'DELETE', |
|
301 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
302 | - )); |
|
303 | - |
|
304 | - return $response; |
|
305 | - } |
|
294 | + public static function removeMemberConfigKey($params) |
|
295 | + { |
|
296 | + $allBodyFields = array('config_key'); |
|
297 | + |
|
298 | + $response = Route4Me::makeRequst(array( |
|
299 | + 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
300 | + 'method' => 'DELETE', |
|
301 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
302 | + )); |
|
303 | + |
|
304 | + return $response; |
|
305 | + } |
|
306 | 306 | |
307 | - public static function getMemberConfigData($params) |
|
308 | - { |
|
309 | - $allQueryFields = array('config_key'); |
|
310 | - |
|
311 | - $response = Route4Me::makeRequst(array( |
|
312 | - 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
313 | - 'method' => 'GET', |
|
314 | - 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
315 | - )); |
|
316 | - |
|
317 | - return $response; |
|
318 | - } |
|
307 | + public static function getMemberConfigData($params) |
|
308 | + { |
|
309 | + $allQueryFields = array('config_key'); |
|
310 | + |
|
311 | + $response = Route4Me::makeRequst(array( |
|
312 | + 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
313 | + 'method' => 'GET', |
|
314 | + 'query' => Route4Me::generateRequestParameters($allQueryFields, $params) |
|
315 | + )); |
|
316 | + |
|
317 | + return $response; |
|
318 | + } |
|
319 | 319 | |
320 | - public static function updateMemberConfigKey($params) |
|
321 | - { |
|
322 | - $allBodyFields = array('config_key', 'config_value'); |
|
323 | - |
|
324 | - $response = Route4Me::makeRequst(array( |
|
325 | - 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
326 | - 'method' => 'PUT', |
|
327 | - 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
328 | - )); |
|
329 | - |
|
330 | - return $response; |
|
331 | - } |
|
320 | + public static function updateMemberConfigKey($params) |
|
321 | + { |
|
322 | + $allBodyFields = array('config_key', 'config_value'); |
|
323 | + |
|
324 | + $response = Route4Me::makeRequst(array( |
|
325 | + 'url' => Endpoint::CONFIGURATION_SETTINGS, |
|
326 | + 'method' => 'PUT', |
|
327 | + 'body' => Route4Me::generateRequestParameters($allBodyFields, $params) |
|
328 | + )); |
|
329 | + |
|
330 | + return $response; |
|
331 | + } |
|
332 | 332 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // The example refers to the process of searching for the specified text throughout all routes, belonging to the user's account. |
14 | 14 | |
15 | 15 | $RouteParameters = array( |
16 | - "query" => 'Automated' |
|
16 | + "query" => 'Automated' |
|
17 | 17 | ); |
18 | 18 | |
19 | 19 | $route = new Route(); |
@@ -22,15 +22,15 @@ discard block |
||
22 | 22 | |
23 | 23 | foreach ($routeResults as $routeResult) |
24 | 24 | { |
25 | - $results = (array)$routeResult; |
|
25 | + $results = (array)$routeResult; |
|
26 | 26 | |
27 | - if (isset($results['route_id'])) { |
|
28 | - echo "Route ID - > " . $results['route_id'] . "<br>"; |
|
29 | - } |
|
27 | + if (isset($results['route_id'])) { |
|
28 | + echo "Route ID - > " . $results['route_id'] . "<br>"; |
|
29 | + } |
|
30 | 30 | |
31 | - if (isset($results['parameters']->route_name)) { |
|
32 | - echo "Route name - > ".$results['parameters']->route_name."<br>"; |
|
33 | - } |
|
31 | + if (isset($results['parameters']->route_name)) { |
|
32 | + echo "Route name - > ".$results['parameters']->route_name."<br>"; |
|
33 | + } |
|
34 | 34 | |
35 | - echo "<br>"; |
|
35 | + echo "<br>"; |
|
36 | 36 | } |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | $count = 0; |
26 | 26 | |
27 | 27 | while ($route_id1==$route_id2) { |
28 | - $route_id2 = $route->getRandomRouteId(0, 20); |
|
28 | + $route_id2 = $route->getRandomRouteId(0, 20); |
|
29 | 29 | |
30 | - $count++; |
|
30 | + $count++; |
|
31 | 31 | |
32 | - if ($count>5) { |
|
33 | - break; |
|
34 | - } |
|
32 | + if ($count>5) { |
|
33 | + break; |
|
34 | + } |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | echo "Route ID 1 -> $route_id1 <br> Route ID 2 -> $route_id2 <br>"; |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | $depot = null; |
44 | 44 | |
45 | 45 | foreach ($addresses as $address) { |
46 | - if (isset($address->is_depot)) { |
|
47 | - if ($address->is_depot==true) { |
|
48 | - $depot = $address; |
|
49 | - break; |
|
50 | - } |
|
51 | - } |
|
46 | + if (isset($address->is_depot)) { |
|
47 | + if ($address->is_depot==true) { |
|
48 | + $depot = $address; |
|
49 | + break; |
|
50 | + } |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // Merge the selected routes |
55 | 55 | $params = array( |
56 | - "route_ids" => $route_id1.",".$route_id2, |
|
57 | - "depot_address" => $depot->address, |
|
58 | - "remove_origin" => false, |
|
59 | - "depot_lat" => $depot->lat, |
|
60 | - "depot_lat" => $depot->lng |
|
56 | + "route_ids" => $route_id1.",".$route_id2, |
|
57 | + "depot_address" => $depot->address, |
|
58 | + "remove_origin" => false, |
|
59 | + "depot_lat" => $depot->lat, |
|
60 | + "depot_lat" => $depot->lng |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | $result = $route->mergeRoutes($params); |