commit | author | age
|
c51c83
|
1 |
<?php |
JK |
2 |
function numToType($id, $data, $defaultLow=NULL) { |
|
3 |
$data = explode("\n", trim($data)); |
|
4 |
foreach($data as $line) { |
|
5 |
$line = explode("\t", trim($line)); |
|
6 |
if((int)$line[0] <= (int)$id && (int)$id <= (int)$line[1]) { |
|
7 |
return [ |
|
8 |
'num' => $line[2] . str_pad($id, 3, '0', STR_PAD_LEFT), |
|
9 |
'type' => $line[3], |
|
10 |
'low' => isset($line[4]) ? $line[4] : $defaultLow, |
|
11 |
]; |
|
12 |
} |
|
13 |
} |
|
14 |
return []; |
|
15 |
} |
|
16 |
function numToTypeT($id) { |
|
17 |
$data = <<<'END' |
|
18 |
101 107 HW E1 0 |
|
19 |
108 113 RW E1 0 |
|
20 |
114 126 HW E1 0 |
|
21 |
127 127 RW E1 0 |
|
22 |
128 130 HW E1 0 |
|
23 |
131 132 RW E1 0 |
|
24 |
133 133 HW E1 0 |
|
25 |
134 134 RW E1 0 |
|
26 |
135 136 HW E1 0 |
|
27 |
137 139 RW E1 0 |
|
28 |
140 147 HW E1 0 |
|
29 |
148 150 RW E1 0 |
|
30 |
151 152 HW E1 0 |
|
31 |
153 153 RW E1 0 |
|
32 |
154 154 HW E1 0 |
|
33 |
155 155 RW E1 0 |
|
34 |
156 158 HW E1 0 |
|
35 |
159 159 RW E1 0 |
|
36 |
160 174 HW E1 0 |
|
37 |
201 245 RZ 105N 0 |
|
38 |
246 299 HZ 105N 0 |
|
39 |
301 312 RF GT8S 0 |
|
40 |
313 313 RF GT8C 1 |
|
41 |
314 322 RF GT8S 0 |
|
42 |
323 323 RF GT8N 1 |
|
43 |
324 324 RF GT8S 0 |
|
44 |
325 328 RF GT8N 1 |
|
45 |
401 440 HL EU8N 1 |
|
46 |
451 456 HK N8C-NF 0 |
|
47 |
457 461 HK N8S-NF 1 |
|
48 |
462 462 HK N8C-NF 0 |
|
49 |
601 614 RP NGT6 (1) 2 |
|
50 |
615 626 RP NGT6 (2) 2 |
|
51 |
627 650 RP NGT6 (3) 2 |
|
52 |
801 824 RY NGT8 2 |
|
53 |
899 899 RY 126N 2 |
|
54 |
901 914 RG 2014N 2 |
|
55 |
915 936 HG 2014N 2 |
|
56 |
999 999 HG 405N 1 |
|
57 |
END; |
|
58 |
return numToType($id, $data); |
|
59 |
} |
|
60 |
function numToTypeB($id) { |
|
61 |
$data = <<<'END' |
|
62 |
2 4 DN Solaris Urbino 18 IV Electric |
|
63 |
71 83 BH Solaris Urbino 18 III Hybrid |
|
64 |
84 96 BH Volvo 7900A Hybrid |
|
65 |
103 105 PA Mercedes-Benz 516 |
|
66 |
106 112 DA Autosan M09LE |
|
67 |
113 121 BA Autosan M09LE |
|
68 |
122 128 DA Autosan M09LE |
|
69 |
129 139 BA Autosan M09LE |
|
70 |
141 146 PM MAN NL283 Lion's City |
|
71 |
200 200 DO Mercedes Conecto |
|
72 |
206 210 PO Mercedes O530 C2 Hybrid |
|
73 |
211 218 DO Mercedes O530 |
|
74 |
219 243 PO Mercedes O530 C2 Hybrid |
|
75 |
244 269 DO Mercedes O530 C2 |
|
76 |
270 299 BO Mercedes O530 C2 |
|
77 |
301 338 DU Solaris Urbino 12 IV |
|
78 |
339 340 BU Solaris Urbino 12 IV |
|
79 |
341 345 DU Solaris Urbino 12 III |
|
80 |
400 403 BH Solaris Urbino 12,9 III Hybrid |
|
81 |
404 408 DH Solaris Urbino 12,9 III Hybrid |
|
82 |
501 510 BR Solaris Urbino 18 IV |
|
83 |
511 568 DR Solaris Urbino 18 IV |
|
84 |
569 579 BR Solaris Urbino 18 IV |
|
85 |
580 595 DR Solaris Urbino 18 IV |
|
86 |
601 601 DE Solaris Urbino 12 III Electric |
|
87 |
602 605 DE Solaris Urbino 8,9LE Electric |
|
88 |
606 606 DE Solaris Urbino 12 III Electric |
|
89 |
607 623 DE Solaris Urbino 12 IV Electric |
|
90 |
700 700 DC Mercedes Conecto G |
|
91 |
701 731 DC Mercedes O530G |
|
92 |
732 732 DC Mercedes Conecto G |
|
93 |
737 741 BR Solaris Urbino 18 III |
|
94 |
742 745 DR Solaris Urbino 18 III |
|
95 |
746 764 PR Solaris Urbino 18 III |
|
96 |
765 768 DR Solaris Urbino 18 III |
|
97 |
769 776 PR Solaris Urbino 18 MetroStyle |
|
98 |
777 777 DR Solaris Urbino 18 III |
|
99 |
778 797 PR Solaris Urbino 18 IV |
|
100 |
851 903 BU Solaris Urbino 12 III |
|
101 |
904 905 DU Solaris Urbino 12 III |
|
102 |
906 926 BU Solaris Urbino 12 III |
|
103 |
927 976 PU Solaris Urbino 12 III |
|
104 |
977 977 DU Solaris Urbino 12 III |
|
105 |
978 991 PU Solaris Urbino 12 IV |
|
106 |
992 997 BU Solaris Urbino 12 IV |
|
107 |
END; |
|
108 |
return numToType($id, $data, 2); |
|
109 |
} |