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