Wiki source code of get_personnel.php
Last modified by YellowFox_RD on 2025/01/23 10:16
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="box" %) | ||
2 | ((( | ||
3 | Table of Contents | ||
4 | ))) | ||
5 | |||
6 | {{toc/}} | ||
7 | |||
8 | Getting data for personnel set in personnel administration | ||
9 | |||
10 | = Description = | ||
11 | |||
12 | (% class="green mark" %)//**GET**//(%%)//** get_personnel.php?company**=RTI_COMPANYKEY**&import**=RTI_VEHICLEKEY&**format=**csv// | ||
13 | |||
14 | = Parameters = | ||
15 | |||
16 | |=Parameter|=Description|=Type|=Note|=Mandatory | ||
17 | |company|RTI company key|string| |yes | ||
18 | |import|RTI import key|string| |yes | ||
19 | |format|export format for list|string|supported output formats:((( | ||
20 | * csv - export as csv formatted file | ||
21 | * json - export as json | ||
22 | * xml - export as xml | ||
23 | )))default: csv|no | ||
24 | |history|show only latest personnel key for each person or all keys for each person|int|((( | ||
25 | * 0 - return only latest key | ||
26 | * 1 - return all keys((( | ||
27 | * will return one entry per key | ||
28 | ))) | ||
29 | )))default: 0|no | ||
30 | |id|limit exported persons list to given id|string|see //strict// parameter|no | ||
31 | |name|limit exported persons list to given name|string|see //strict// parameter|no | ||
32 | |pkey|limit exported persons list to given personnel key|string|see //strict// parameter|no | ||
33 | |group|limit exported persons list to given personnel group|string|see //strict// parameter|no | ||
34 | |strict|switch search between finding the exact given value or return all results where the search string is part of the result|int|((( | ||
35 | * 0 - return all results containing the searched string | ||
36 | * 1 - return only results matching exactly the searched string | ||
37 | )))default: 1 | ||
38 | this setting modifies the behaviour for parameters:~/~/ id, name, pkey, group|no | ||
39 | |||
40 | = Return = | ||
41 | |||
42 | Returning a string in selected format. On error returning "(% class="error" %)**403 - Verboten: Zugriff verweigert.**(%%)" as HTTP-Header. | ||
43 | |||
44 | == Column == | ||
45 | |||
46 | |=CSV Column name|=JSON/XML key name|=Name in personnel administration|=Description|=Note|= | ||
47 | |ID|id|employee number|self defined employee number| | | ||
48 | |NAME|name|Name|complete name of the person| | | ||
49 | |KEY|key[id]|personnel key|personnel key (for bookings via YellowFox)| | | ||
50 | |VALID_FROM|key[valid_from]|personnel key valid from|validity start for the personnel key| |format: YYYY-MM-DD HH:MM:SS | ||
51 | |VALID_TO|key[valid_to]|personnel key valid to|validity end for the personnel key| |format: YYYY-MM-DD HH:MM:SS | ||
52 | |GROUPS|groups[group]|personnel groups|comma separated list with all personnel groups assigned to the person| | | ||
53 | |CARD_NR|card_nr|employee licence number|optional licence number to assign bookings to ReinerSCT| | | ||
54 | |DRV_LICENCE_NR|drv_licence[id]|driver licence|driver licence number|only filled, if tacho archive active| | ||
55 | |DRV_LICENCE_VALID_TO|drv_licence[valid_to]|driver licence valid to|expiration date of driver licence|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
56 | |IDENTITY_CARD_NR|identity_card[id]|identity card|identity card number|only filled, if tacho archive active| | ||
57 | |IDENTITY_CARD_VALID_TO|identity_card[valid_to]|identity card valid to|expiration date of identity card|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
58 | |PASSPORT_NR|passport[id]|passport|passport number|only filled, if tacho archive active| | ||
59 | |PASSPORT_VALID_TO|passport[valid_to]|passport valid to|expiration date of passort|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
60 | |ADR_CERTIFICATE_NR|adr_certificate[id]|ADR certificate|number of ADR certificate (carriage of dangerous goods by road)|only filled, if tacho archive active| | ||
61 | |ADR_CERTICATE_VALID_TO|adr_certificate[valid_to]|ADR cetificate valid to|expiration date of ADR certificate|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
62 | |BKRFQG_VALID_TO|bkrfqg[valid_to]|qualification by keynumber 95 valid to|expiration date of german "**B**erufs**kr**aft**f**ahrer**q**ualifikations**g**esetz"|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
63 | |BIRTHDATE|birthdate|date of birth|date of birth of person|only filled, if tacho archive active | ||
64 | If day and/or month are unknown, the birthdate is filled up with "XX" for the unknown values according to german passport law | ||
65 | (example: 1980-06-XX or 1980-XX-XX)|format: YYYY-MM-DD HH:MM:SS | ||
66 | |JOB_START_DATE|job_start_date|employee since|start date of beeing an employee at this company|only filled, if tacho archive active|format: YYYY-MM-DD HH:MM:SS | ||
67 | |DRV_LICENCE_CHECK_TAG_ID|drv_licence_check[tag_id]|NFC tag id|id of nfc tag for driver licence check| | | ||
68 | |DRV_LICENCE_CHECK_LAST_CHECK|drv_licence_check[last_check]|last [driver licence] check|date of latest driver licence check| |format: YYYY-MM-DD HH:MM:SS | ||
69 | |DRV_LICENCE_CHECK_NEXT_CHECK|drv_licence_check[next_check]|next [driver licence] check|date of next driver licence check| |format YYYY-MM-DD | ||
70 | |DRV_LICENCE_CHECK_INTERVAL|drv_licence_check[interval]|[driver licence] check interval|timerange between 2 driver licence checks in seconds| | | ||
71 | |||
72 | == CSV Format == | ||
73 | |||
74 | Sending a correct request will return a csv formatted file with a headline as first line containing column names. The data itself will be returned in following rows. | ||
75 | |||
76 | === Meta informations === | ||
77 | |||
78 | |=Separator|semicolon ( ; ) | ||
79 | |=text limiter|double quote ( " ) | ||
80 | |=line brak|0x0D 0x0A (CarriageReturn LineFeed) | ||
81 | |=header|row 1 | ||
82 | |||
83 | === Header === | ||
84 | |||
85 | **header informationen** | ||
86 | {{code language="java"}}"ID";"NAME";"KEY";"VALID_FROM";"VALID_TO";"GROUPS";"CARD_NR";"DRV_LICENCE_NR";"DRV_LICENCE_VALID_TO";"IDENTITY_CARD_NR";"IDENTITY_CARD_VALID_TO";"PASSPORT_NR";"PASSPORT_VALID_TO";"ADR_CERTIFICATE_NR";"ADR_CERTIFICATE_VALID_TO";"BKRFQG_VALID_TO";"BIRTHDATE";"JOB_START_DATE"{{/code}} | ||
87 | |||
88 | Beispiel | ||
89 | **example** | ||
90 | {{code language="vb"}}"ID";"NAME";"KEY";"VALID_FROM";"VALID_TO";"GROUPS";"CARD_NR";"DRV_LICENCE_NR";"DRV_LICENCE_VALID_TO";"IDENTITY_CARD_NR";"IDENTITY_CARD_VALID_TO";"PASSPORT_NR";"PASSPORT_VALID_TO";"ADR_CERTIFICATE_NR";"ADR_CERTIFICATE_VALID_TO";"BKRFQG_VALID_TO";"BIRTHDATE";"JOB_START_DATE";"DRV_LICENCE_CHECK_TAG_ID";"DRV_LICENCE_CHECK_LAST_CHECK";"DRV_LICENCE_CHECK_NEXT_CHECK";"DRV_LICENCE_CHECK_INTERVAL" | ||
91 | "0012";"Max Mustermann";"DF1234567890";"2018-01-01 06:43:00";"";"Fahrer,Dresden";"";"YFDD9876";"2021-11-10 23:59:59";"";"";"";"2023-04-30 23:59:59";"";"2020-07-31 23:59:59";"2021-11-30 23:59:59";"1990-02-19 00:00:00";"2014-09-01 00:00:00";""4729000A3341";"2020-03-01 10:43:00";"2020-03-15";"1209600"{{/code}} | ||
92 | |||
93 | == JSON Format == | ||
94 | |||
95 | Retrun a json formatted string with all the available data matching the request parameters. The entries will be returned as key - value relation. Some data such as personnel key or personnel groups are grouped in a sub object. | ||
96 | |||
97 | === Beispiel === | ||
98 | |||
99 | **example** | ||
100 | {{code language="js"}}[ | ||
101 | { | ||
102 | "id":"0013", | ||
103 | "name":"Marion Musterfrau", | ||
104 | "key":{ | ||
105 | "id":"DF9876543210", | ||
106 | "valid_from":"2016-01-01 00:00:00", | ||
107 | "valid_to":null | ||
108 | }, | ||
109 | "card_nr":null, | ||
110 | "groups":[ | ||
111 | "Fahrer", | ||
112 | "Berlin" | ||
113 | ], | ||
114 | "deleted":null, | ||
115 | "drv_licence":{ | ||
116 | "id":"asd09472845", | ||
117 | "valid_to":"2017-02-24 23:59:59" | ||
118 | }, | ||
119 | "identity_card":{ | ||
120 | "id":"hal2001", | ||
121 | "valid_to":"2017-01-11 23:59:59" | ||
122 | }, | ||
123 | "passport":{ | ||
124 | "id":null, | ||
125 | "valid_to":null | ||
126 | }, | ||
127 | "adr_certificate":{ | ||
128 | "id":null, | ||
129 | "valid_to":"2019-05-23 23:59:59" | ||
130 | }, | ||
131 | "bkfqg":{ | ||
132 | "valid_to":null | ||
133 | }, | ||
134 | "birthdate":"1998-05-13 00:00:00", | ||
135 | "job_start_date":"2016-09-01 00:00:00" | ||
136 | }, | ||
137 | { | ||
138 | "id":"0014", | ||
139 | "name":"Patrick Berger", | ||
140 | "key":{ | ||
141 | "id":"00047392", | ||
142 | "valid_from":"2017-07-05 13:20:00", | ||
143 | "valid_to":null | ||
144 | }, | ||
145 | "card_nr":"7937102", | ||
146 | "groups":[ | ||
147 | "B\u00fcro", | ||
148 | "Berlin" | ||
149 | ], | ||
150 | "deleted":null, | ||
151 | "drv_licence":{ | ||
152 | "id":jvg7820185", | ||
153 | "valid_to":"2014-07-18 23:59:59" | ||
154 | }, | ||
155 | "identity_card":{ | ||
156 | "id":"ppa4711", | ||
157 | "valid_to":"2014-07-19 23:59:59" | ||
158 | }, | ||
159 | "passport":{ | ||
160 | "id":null, | ||
161 | "valid_to":null | ||
162 | }, | ||
163 | "adr_certificate":{ | ||
164 | "id":null, | ||
165 | "valid_to":null | ||
166 | }, | ||
167 | "bkfqg":{ | ||
168 | "valid_to":"2019-07-18 25:59:59" | ||
169 | }, | ||
170 | "birthdate":"1996-07-17 00:00:00", | ||
171 | "job_start_date":"2014-07-17 00:00:00", | ||
172 | "drv_licence_check": { | ||
173 | "tag_id": "4729000A3341", | ||
174 | "last_check": "2020-03-01 10:43:00", | ||
175 | "next_check": "2019-03-15", | ||
176 | "interval": 1209600 | ||
177 | } | ||
178 | } | ||
179 | ]{{/code}} | ||
180 | |||
181 | = XML Format = | ||
182 | |||
183 | Return an xml formatted string with main key "<persons>" and data for each single person then grouped in a "<person>" object. Some data such as personnel key or personnel groups are grouped in a sub object. | ||
184 | |||
185 | === Beispiel === | ||
186 | |||
187 | **example** | ||
188 | {{code language="xml"}}<?xml version="1.0"?> | ||
189 | <persons> | ||
190 | <person> | ||
191 | <id>0012</id> | ||
192 | <name>Max Mustermann</name> | ||
193 | <key> | ||
194 | <id>DF1234567890</id> | ||
195 | <valid_from>2018-01-01 06:43:00</valid_from> | ||
196 | <valid_to/> | ||
197 | </key> | ||
198 | <card_nr/> | ||
199 | <groups> | ||
200 | <group>Fahrer</group> | ||
201 | <group>Dresden</group> | ||
202 | </groups> | ||
203 | <deleted/> | ||
204 | <drv_licence> | ||
205 | <id>asd09472845</id> | ||
206 | <valid_to>2020-04-23 23:59:59</valid_to> | ||
207 | </drv_licence> | ||
208 | <identity_card> | ||
209 | <id/> | ||
210 | <valid_to/> | ||
211 | </identity_card> | ||
212 | <passport> | ||
213 | <id>yfdd01723</id> | ||
214 | <valid_to>2023-09-17 23:59:59</valid_to> | ||
215 | </passport> | ||
216 | <adr_certificate> | ||
217 | <id/> | ||
218 | <valid_to>2018-09-30 23:59:59</valid_to> | ||
219 | </adr_certificate> | ||
220 | <bkfqg> | ||
221 | <valid_to/> | ||
222 | </bkfqg> | ||
223 | <birthdate/> | ||
224 | <job_start_date>2012-05-01 00:00:00</job_start_date> | ||
225 | </person> | ||
226 | <person> | ||
227 | <id>0013</id> | ||
228 | <name>Marion Musterfrau</name> | ||
229 | <key> | ||
230 | <id>DF9876543210</id> | ||
231 | <valid_from>2016-01-01 00:00:00</valid_from> | ||
232 | <valid_to>2019-01-01 00:00:00</valid_to> | ||
233 | </key> | ||
234 | <card_nr/> | ||
235 | <groups> | ||
236 | <group>Fahrer</group> | ||
237 | <group>Berlin</group> | ||
238 | </groups> | ||
239 | <deleted/> | ||
240 | <drv_licence> | ||
241 | <id>asd09472845</id> | ||
242 | <valid_to>2020-04-23 23:59:59</valid_to> | ||
243 | </drv_licence> | ||
244 | <identity_card> | ||
245 | <id/> | ||
246 | <valid_to/> | ||
247 | </identity_card> | ||
248 | <passport> | ||
249 | <id>yfdd01723</id> | ||
250 | <valid_to>2023-09-17 23:59:59</valid_to> | ||
251 | </passport> | ||
252 | <adr_certificate> | ||
253 | <id/> | ||
254 | <valid_to>2018-09-30 23:59:59</valid_to> | ||
255 | </adr_certificate> | ||
256 | <bkfqg> | ||
257 | <valid_to/> | ||
258 | </bkfqg> | ||
259 | <birthdate/> | ||
260 | <job_start_date>2012-05-01 00:00:00</job_start_date> | ||
261 | <drv_licence_check> | ||
262 | <tag_id>4729000A3341</tag_id> | ||
263 | <last_check>2020-03-01 10:43:00</last_check> | ||
264 | <next_check>2020-03-15</next_check> | ||
265 | <interval>1209600</interval> | ||
266 | </drv_licence_check> | ||
267 | </person> | ||
268 | </persons>{{/code}} | ||
269 | |||
270 | == Examples == | ||
271 | |||
272 | **Abfrage aller Personen im CSV Format** | ||
273 | {{code language="java"}}https://map.yellowfox.de/rti/get_personnel.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&format=csv{{/code}} | ||
274 | |||
275 | **Abfrage aller Personen der Gruppe "Fahrer" mit allen Schlüsseln** | ||
276 | {{code language="java"}}https://map.yellowfox.de/rti/get_personnel.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&format=xml&group=Fahrer&history=1{{/code}} | ||
277 | |||
278 | **Abfrage der Daten einer Person mit einer bestimmten ID** | ||
279 | {{code language="java"}}https://map.yellowfox.de/rti/get_personnel.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&format=json&history=1&id=1234&strict=1{{/code}} | ||
280 |