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