Compare commits
716 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b58db8e199 | ||
|
c55de7cc2f | ||
|
4cd7f19ce1 | ||
|
eb562f5618 | ||
|
1760970994 | ||
|
4468ca343b | ||
|
43c8713631 | ||
|
11b79da442 | ||
|
9379ded255 | ||
|
6faedb9a61 | ||
|
60fc910c79 | ||
|
7cc6225df9 | ||
|
74625df613 | ||
|
b0a67aea50 | ||
|
bded5edd36 | ||
|
0563a93adf | ||
|
792b92f433 | ||
|
bea9900e3d | ||
|
bdb51766ab | ||
|
e999388e97 | ||
|
fc290e76af | ||
|
11618454d8 | ||
|
eac4ac48e4 | ||
|
2ba274de1d | ||
|
b4acea6de5 | ||
|
4dd354504e | ||
|
66031ac43b | ||
|
4de0c30270 | ||
|
e93df1d6d6 | ||
|
6ccb83fa0a | ||
|
66ecfde615 | ||
|
60f238563d | ||
|
0fd0b918d0 | ||
|
4b1a9d694d | ||
|
b91a480dc6 | ||
|
f8261fb887 | ||
|
be94b95f19 | ||
|
2304bf9621 | ||
|
b7ebfa4709 | ||
|
77496f7f99 | ||
|
c3de83ff53 | ||
|
8644465a17 | ||
|
0012899b5f | ||
|
ff3e54cb93 | ||
|
488a1938bf | ||
|
d75d919229 | ||
|
19c421633a | ||
|
8b6a1300e4 | ||
|
b9c59977b0 | ||
|
a292d63f1b | ||
|
520bb9fe93 | ||
|
438c98ba01 | ||
|
75d55a72cd | ||
|
26ea2e1021 | ||
|
141435a398 | ||
|
60a6c7eb67 | ||
|
62761b4baa | ||
|
4e3714c3f9 | ||
|
9f04226286 | ||
|
75b9abeda8 | ||
|
42bc186318 | ||
|
d0d4b48841 | ||
|
2ad397baf3 | ||
|
22e907ceaf | ||
|
a66fc30119 | ||
|
73f5b36ef4 | ||
|
cbae95cf2b | ||
|
64a9931738 | ||
|
7dc7ff1448 | ||
|
9e92c2d37f | ||
|
30247e5d6a | ||
|
852f9b44de | ||
|
45434cdd18 | ||
|
b423521cde | ||
|
05e8f08303 | ||
|
892ffa1a2f | ||
|
5d23396a7a | ||
|
02d03a2ae9 | ||
|
f2ed829a9e | ||
|
97055a0419 | ||
|
c1b1686296 | ||
|
421791ba52 | ||
|
85b1d508ca | ||
|
6a3e9a46f8 | ||
|
450ee12ca4 | ||
|
6ceddc996c | ||
|
9340bc0bda | ||
|
890d2c4413 | ||
|
ff5a9e873b | ||
|
1842cd69ac | ||
|
fdf3404474 | ||
|
b2e40da0bf | ||
|
27fbb5cc88 | ||
|
5850c4d01d | ||
|
13c993ecb2 | ||
|
1acb527a0f | ||
|
3cd3d64bce | ||
|
6ff82d3605 | ||
|
25954f56f0 | ||
|
68c145a5bc | ||
|
83d600a7f6 | ||
|
6caf2367ed | ||
|
b9b22b5419 | ||
|
9b69570b99 | ||
|
14c6b4da57 | ||
|
ccf56c244d | ||
|
3f0c0ee3d8 | ||
|
145ac5c5a2 | ||
|
d6178bd605 | ||
|
d0ab07b9ec | ||
|
95b28dd4e3 | ||
|
0f6c4199e7 | ||
|
be731c385e | ||
|
6de76230f9 | ||
|
0eb6e77392 | ||
|
ea4c44d795 | ||
|
ced20326a5 | ||
|
9106f9953a | ||
|
ac8d185c6e | ||
|
c1095051d5 | ||
|
6ad6809b93 | ||
|
81a4903082 | ||
|
553daa922a | ||
|
20a402b3bb | ||
|
5b0653c733 | ||
|
ebb28ccf66 | ||
|
0ddcbb8acf | ||
|
d1b9bc1680 | ||
|
7708d7e07f | ||
|
6b7d630d45 | ||
|
9e1a679673 | ||
|
0f50b3423f | ||
|
a6c3ca14dd | ||
|
0324f3d011 | ||
|
180d3c517c | ||
|
aae9aee43d | ||
|
c7bb17a356 | ||
|
a468c819db | ||
|
264fb038ec | ||
|
c5186ab16d | ||
|
76a6fe2729 | ||
|
be0044abb2 | ||
|
ed1344f1c2 | ||
|
c3abbe6309 | ||
|
da758ca158 | ||
|
a12911e0ba | ||
|
d62a0c6426 | ||
|
a7f156df7c | ||
|
5c6c6cc7a8 | ||
|
11487e840b | ||
|
0be7f283b8 | ||
|
179d144a14 | ||
|
306086e55c | ||
|
ce921c949d | ||
|
63cac55c42 | ||
|
e5c70079d6 | ||
|
2442b51573 | ||
|
f96dc7aacf | ||
|
03d2c27a06 | ||
|
98ddb0fa1b | ||
|
804dac6b5e | ||
|
f51a12d0b7 | ||
|
f5f3f4d6bd | ||
|
1c1aeeabad | ||
|
521ae3283c | ||
|
5495651d1a | ||
|
f80e46f290 | ||
|
d8136e5c64 | ||
|
768e646e23 | ||
|
445b032338 | ||
|
93001d1ca8 | ||
|
a05d55efbc | ||
|
d2b9904fc5 | ||
|
2c8eaf28ef | ||
|
4af63ee34a | ||
|
d5fe23f22e | ||
|
c867f4b7e9 | ||
|
dfa32f9d4b | ||
|
f468e6c399 | ||
|
c8cf7cf631 | ||
|
309f8b018e | ||
|
46be540357 | ||
|
60db1c1b23 | ||
|
11fea4fc5e | ||
|
270d20bff5 | ||
|
8799499edc | ||
|
b0070cb684 | ||
|
f3d9d8094b | ||
|
f18bea387b | ||
|
6bdcd9cc49 | ||
|
e970864ce0 | ||
|
c625945bfb | ||
|
fbf5602231 | ||
|
2cf480ced5 | ||
|
e9a011cecf | ||
|
53198b87b1 | ||
|
b8b7b82cd6 | ||
|
43b765d2ac | ||
|
cf9c3275f4 | ||
|
30351c395e | ||
|
467e193b1c | ||
|
3db44ee7fe | ||
|
ea16090016 | ||
|
5fbc4ca441 | ||
|
2b2e3ce7c8 | ||
|
44a554b1d0 | ||
|
d69bceeb3b | ||
|
dab30b5827 | ||
|
794fdd3ede | ||
|
334d5230b1 | ||
|
338399980a | ||
|
caf10cc374 | ||
|
1c3ec01d3e | ||
|
c4b9b85332 | ||
|
94664d64cc | ||
|
868a29c1fb | ||
|
33dd6ce019 | ||
|
715bc738bb | ||
|
fe28de01bc | ||
|
304ee7214f | ||
|
c60ef54c96 | ||
|
25db7c39a3 | ||
|
e8903e3a3b | ||
|
d70a618e46 | ||
|
3a0297f7f2 | ||
|
f7790dabb2 | ||
|
03bc810cf7 | ||
|
417cc6b5c2 | ||
|
6d95964c80 | ||
|
d83c25b669 | ||
|
92250c6062 | ||
|
6b3bec9fd7 | ||
|
2e81bcfc64 | ||
|
7db57802b6 | ||
|
d4fdab888f | ||
|
e0eacb08d7 | ||
|
0a55a7533c | ||
|
d04eb4d3e2 | ||
|
7402364ed5 | ||
|
34f4e1631a | ||
|
df53fd0171 | ||
|
93d286be93 | ||
|
a5da7d3653 | ||
|
94147c5f19 | ||
|
1c2e9004f3 | ||
|
2dc866f460 | ||
|
14b5e2f719 | ||
|
91dc69b866 | ||
|
fd84706a1d | ||
|
5d92f4280e | ||
|
d9b4f5b1ec | ||
|
bfd6f6dc7b | ||
|
b524fc01ae | ||
|
4e6ea9eb61 | ||
|
42a18c7e60 | ||
|
fd506669c6 | ||
|
c74b893705 | ||
|
1adede67a6 | ||
|
3ae25390d7 | ||
|
6497478240 | ||
|
a0fbf6f3d8 | ||
|
f19070ecf3 | ||
|
7bdb5814f7 | ||
|
525d25eccc | ||
|
eae820245e | ||
|
9e96e1be8a | ||
|
9eea8297f2 | ||
|
09160ef110 | ||
|
b361e60fb0 | ||
|
50ec9d7ec0 | ||
|
eddb4c0fdc | ||
|
581ad1f077 | ||
|
67dae3e2c5 | ||
|
2aaa0f6a36 | ||
|
945b896151 | ||
|
9fa0cd16c8 | ||
|
f6bb92a155 | ||
|
73044d4ab0 | ||
|
a5e1276536 | ||
|
97f8530201 | ||
|
53e213202b | ||
|
be27698f9f | ||
|
d1886c6574 | ||
|
f8e2c6ec4e | ||
|
e245b51209 | ||
|
6c7a6c717e | ||
|
0bc56554d7 | ||
|
e0527b9f45 | ||
|
18f1af1bac | ||
|
4791d69e62 | ||
|
76d6f46cbe | ||
|
8dd654db46 | ||
|
5f086acac2 | ||
|
6fadb21ba2 | ||
|
ac58c75011 | ||
|
dafd8f6779 | ||
|
9023ca1964 | ||
|
2598a463b7 | ||
|
6356f3566c | ||
|
3504e1cc3d | ||
|
fa8593b78f | ||
|
17f0a9a4d2 | ||
|
9ed373a98b | ||
|
efb06c8008 | ||
|
57365a7569 | ||
|
a25f27dc9f | ||
|
78c876967a | ||
|
da21fbb9ea | ||
|
aa2ce5dc88 | ||
|
0c80ae1cfa | ||
|
00c733aa3c | ||
|
ff3c3a8f20 | ||
|
0eb5508d5a | ||
|
b90e69652a | ||
|
703024e86f | ||
|
8ae644be21 | ||
|
0a09e1ed43 | ||
|
c91f9c106c | ||
|
f5bffeae06 | ||
|
e6a84a4664 | ||
|
8f6cf506de | ||
|
5e49e72289 | ||
|
7c326f50d8 | ||
|
48015282ec | ||
|
0a3cf2fdba | ||
|
4563fc2bfa | ||
|
7152fd4b07 | ||
|
47b65d3552 | ||
|
244498f87f | ||
|
79560f3c98 | ||
|
c3dd9c1210 | ||
|
0e6a91593f | ||
|
8254caacbf | ||
|
23d2725176 | ||
|
bf590d6fea | ||
|
95e59b12cb | ||
|
e7599efef6 | ||
|
9f56ca6b7d | ||
|
c39f3cf112 | ||
|
f5e9b4952e | ||
|
fe91510c3f | ||
|
c5f050e524 | ||
|
be4fd9ada7 | ||
|
c551178e6a | ||
|
f0c8c1c57d | ||
|
219b083e72 | ||
|
cd9cc5cb94 | ||
|
6f6da818ba | ||
|
bf05ec8075 | ||
|
c7b2ae1d50 | ||
|
497411b3b8 | ||
|
c260d1d0fe | ||
|
70e4538478 | ||
|
0b940a63ea | ||
|
95b316bf84 | ||
|
5925d006fe | ||
|
c79f5d0b35 | ||
|
00958fa103 | ||
|
7220a171a1 | ||
|
195bd06153 | ||
|
b8bee93904 | ||
|
d3c3204553 | ||
|
5342f09b9d | ||
|
7099dc3052 | ||
|
e6ba519cd7 | ||
|
3da1a66bd1 | ||
|
e82d5e1b18 | ||
|
dedb38020f | ||
|
05c6a0e662 | ||
|
574a5768c5 | ||
|
98ed695c8a | ||
|
81e8d49c47 | ||
|
ea616542e7 | ||
|
c1b3d87ed4 | ||
|
3dfd7e0d5b | ||
|
a012b6afbc | ||
|
efa772045f | ||
|
8b47c8be3c | ||
|
9a47daa238 | ||
|
fc3e47891a | ||
|
b122693d3a | ||
|
3c595a2929 | ||
|
a9ede731f5 | ||
|
cac6a65eef | ||
|
40420f890c | ||
|
af6083d61c | ||
|
482685566c | ||
|
a2287cbabf | ||
|
ae57b0ba50 | ||
|
f8fc36a6de | ||
|
f3c067614a | ||
|
9863ace419 | ||
|
3db0bee58d | ||
|
93a9b0da8b | ||
|
61744e8c93 | ||
|
446465b589 | ||
|
7cccbb79c3 | ||
|
845cdcfe5d | ||
|
615bb0c382 | ||
|
381425dd52 | ||
|
1eacec23a0 | ||
|
95ca467b50 | ||
|
8005a79209 | ||
|
1c7d90e31b | ||
|
fdfe3c3be9 | ||
|
f1ecfdfc2c | ||
|
b9eb49484a | ||
|
aa8a1d0ef7 | ||
|
42ec588d93 | ||
|
0bff4286cf | ||
|
6ba76fc324 | ||
|
99e7a183aa | ||
|
94d22673fe | ||
|
2fe7c24bae | ||
|
57481cd9ba | ||
|
4960e228ab | ||
|
22e6ba32b7 | ||
|
aba40d6db4 | ||
|
73c0f03392 | ||
|
d6c7cede38 | ||
|
364302465c | ||
|
0ee56adbf4 | ||
|
4bb145b015 | ||
|
7c13c5ce40 | ||
|
8e57e7c33b | ||
|
178ef2307a | ||
|
957d03b921 | ||
|
709e1c8cd6 | ||
|
4b8e58a38e | ||
|
67c4f3be21 | ||
|
54148e8aef | ||
|
19668c044b | ||
|
278b80f1b8 | ||
|
8a9b75bec5 | ||
|
d333322832 | ||
|
bee08ee26a | ||
|
059240f555 | ||
|
f0913c515d | ||
|
9a2594138e | ||
|
f545eab553 | ||
|
435158f3c6 | ||
|
53c4d9f455 | ||
|
1461d0558c | ||
|
6e7d56fd9e | ||
|
128d839244 | ||
|
42f2251fb5 | ||
|
13086b7d75 | ||
|
22fae79a30 | ||
|
07d75e39bb | ||
|
178cef5c8a | ||
|
1218dd36cd | ||
|
2988c62bad | ||
|
53290f9459 | ||
|
71abbf9d0c | ||
|
4f15258cb1 | ||
|
6e93199716 | ||
|
529eea1b2d | ||
|
c17a045b44 | ||
|
8a1f30297b | ||
|
a97d662c1e | ||
|
fe62ad1d16 | ||
|
a923e2e880 | ||
|
199fb7fa16 | ||
|
17c105c511 | ||
|
3bca76b7ea | ||
|
7217d4ed8c | ||
|
ab66181bf8 | ||
|
dd1185961a | ||
|
075ec5834f | ||
|
43647f9302 | ||
|
c1575a95f0 | ||
|
455a52a031 | ||
|
8137bfa4d8 | ||
|
8e39533a08 | ||
|
f055c91aaa | ||
|
0e0f9716fe | ||
|
a4b5087953 | ||
|
4e679eebfe | ||
|
1dcea931ae | ||
|
4ff6f522c9 | ||
|
66a4907ea9 | ||
|
f50600052d | ||
|
d8bb586e62 | ||
|
af3f29e44f | ||
|
a29b84d0d9 | ||
|
f78d26b924 | ||
|
8a6038e632 | ||
|
4e0f417d4d | ||
|
c0a9f811fa | ||
|
12a8c1deeb | ||
|
49baff3c24 | ||
|
ea77f96da0 | ||
|
7c7a889a8e | ||
|
fa49756607 | ||
|
10ad12907e | ||
|
95e32389b3 | ||
|
ac15cab3c4 | ||
|
ddff95b07a | ||
|
051e6bf4ec | ||
|
997691ab0b | ||
|
bff74bde19 | ||
|
417a389ef8 | ||
|
a980d4c142 | ||
|
50a9b1059e | ||
|
e8251426f9 | ||
|
0fa5e6b3af | ||
|
81fd319fbf | ||
|
232fa817f8 | ||
|
622caa96a3 | ||
|
78f48be0a7 | ||
|
1319ddb9b7 | ||
|
0b443143d1 | ||
|
9d32f9bb5d | ||
|
9d453a469d | ||
|
256855bfd7 | ||
|
d6f2ae7bb1 | ||
|
b0868c0f6c | ||
|
8815dfef2a | ||
|
896aa2eeac | ||
|
bc21fb496d | ||
|
bff96c7c0c | ||
|
5269b38cbc | ||
|
b82d14cbbd | ||
|
2be3753e05 | ||
|
0f14fde062 | ||
|
9574e822fe | ||
|
a9e6bcfe81 | ||
|
8f4ec2b52e | ||
|
a5c5535f7f | ||
|
9a3aa94b62 | ||
|
8d8183d046 | ||
|
a380341859 | ||
|
778894124d | ||
|
e6f918145a | ||
|
9d20d6be2c | ||
|
45cef89a9e | ||
|
70c287d2f5 | ||
|
1197019b33 | ||
|
14533369af | ||
|
5da7b2024d | ||
|
477a88ff93 | ||
|
6ce76b387e | ||
|
cd84a35fc4 | ||
|
d743b072cc | ||
|
126c6c0b2e | ||
|
f18756dfd3 | ||
|
83903c3015 | ||
|
25bb0c99cb | ||
|
25fab72aa9 | ||
|
02f06ce981 | ||
|
935d4cc543 | ||
|
4868b5bb66 | ||
|
5697797219 | ||
|
6c68a247dd | ||
|
62dd3f0534 | ||
|
090fdefab4 | ||
|
d87ebbfbdb | ||
|
c8a42d2a8a | ||
|
64e8ac9700 | ||
|
414f3089ea | ||
|
5fe6f3e8c8 | ||
|
9f6312a903 | ||
|
39cd8e87ae | ||
|
83715c928c | ||
|
438582c8b6 | ||
|
03373f88d5 | ||
|
8045d7cde1 | ||
|
65f528233e | ||
|
e3ad9cdeed | ||
|
dc1b423b26 | ||
|
4b18ed1eaf | ||
|
2ade7e965b | ||
|
e55ac955b3 | ||
|
bbc6fea24b | ||
|
ce0d3e7e85 | ||
|
07b7935a88 | ||
|
0373d4c2e0 | ||
|
4277f9acf3 | ||
|
110e3ab982 | ||
|
690022c456 | ||
|
2c044a505a | ||
|
26e264d805 | ||
|
e688ef3dad | ||
|
cb4dd5c606 | ||
|
026c95cd32 | ||
|
987e1a2741 | ||
|
46e76e3214 | ||
|
bc716c5c99 | ||
|
8d618d8f30 | ||
|
66cce834f5 | ||
|
33adc2a710 | ||
|
2c01f122e0 | ||
|
ba60d2a129 | ||
|
05983cb38d | ||
|
b1c927177c | ||
|
fb34016e43 | ||
|
a4f15c8ef7 | ||
|
3c9ad75281 | ||
|
569b19bc3a | ||
|
ea1cc53e85 | ||
|
cd599e0149 | ||
|
763056f1a9 | ||
|
e85d237814 | ||
|
44ac096e1c | ||
|
bcddca20ac | ||
|
fd3e43e8cd | ||
|
6f0de74424 | ||
|
c29a6f3906 | ||
|
63b581ecb4 | ||
|
b3a99a7c05 | ||
|
1adc0b9b3d | ||
|
c83293cbae | ||
|
ffb1cfd3cf | ||
|
eeef28dbe0 | ||
|
4d9fc87bcc | ||
|
62c5a61535 | ||
|
3088c6448c | ||
|
3d4252ab84 | ||
|
22e061bfb0 | ||
|
ddb150510e | ||
|
113b9d9a90 | ||
|
592a430e9c | ||
|
49e90814d6 | ||
|
e46ceb4141 | ||
|
077dccc36d | ||
|
9881353394 | ||
|
49969bf6e2 | ||
|
acc0c0b473 | ||
|
8042bc869e | ||
|
5469feabb5 | ||
|
e644d8d867 | ||
|
a3372d2dd3 | ||
|
346c66b4d4 | ||
|
1567e05254 | ||
|
c959544273 | ||
|
db482794e8 | ||
|
7c9e0b9fa7 | ||
|
04856fb1ce | ||
|
bafa0521d9 | ||
|
69d7c0c85d | ||
|
5e9842acb5 | ||
|
a85fade8d5 | ||
|
4e1499f86a | ||
|
f01a3c32e1 | ||
|
1c394cfa7f | ||
|
acef060fc3 | ||
|
cbf6a0d5f1 | ||
|
355bc8166e | ||
|
522f525a46 | ||
|
84cf54ae7f | ||
|
47120fada0 | ||
|
c2b96e3381 | ||
|
6355d071ae | ||
|
aac917766b | ||
|
c9b3cd0ca8 | ||
|
03675190d6 | ||
|
4805ad43b2 | ||
|
90d62a9f43 | ||
|
8ec2fb7438 | ||
|
99fc7e5294 | ||
|
7ba26456c3 | ||
|
498bb5bdc0 | ||
|
42043337bc | ||
|
e20833bb3e | ||
|
5e96b96f08 | ||
|
dfc3196443 | ||
|
041a622fdc | ||
|
ab8a049e66 | ||
|
e405306fbf | ||
|
6d8aa5dd33 | ||
|
7fcad41926 | ||
|
177a83ca53 | ||
|
c5ebeefd1d | ||
|
350bb4496b | ||
|
0675673b6d | ||
|
0693f4ce38 | ||
|
debcbc2354 | ||
|
d4dbb45380 | ||
|
f778e95e8b | ||
|
b57e7f36f2 | ||
|
b1b7d295dc | ||
|
2393023528 | ||
|
93c04caedc | ||
|
7366af4f0c | ||
|
501a292d53 | ||
|
4c2b4ca89c | ||
|
452345162a | ||
|
84d3b1f10a | ||
|
b78959fb74 | ||
|
9985625f70 | ||
|
b8604ddaf7 | ||
|
2d73295860 | ||
|
df6139014d | ||
|
576304115e | ||
|
d9559a652d | ||
|
835fe60aa8 | ||
|
45a94d4f2e | ||
|
0ef4141403 | ||
|
b21fbf2e57 | ||
|
76cfc12524 | ||
|
7c5ae0588e | ||
|
5daa44a547 | ||
|
ad53a99cfa | ||
|
379d2c2550 | ||
|
ba30881186 | ||
|
dfce60d65f | ||
|
fcc55646ab | ||
|
d711c48c3b | ||
|
134aef7cdc | ||
|
e594ee8738 | ||
|
640f4f4292 | ||
|
2f5b0d73c1 | ||
|
bb2f46d1b5 | ||
|
3bb328bba3 | ||
|
85fa53f39b | ||
|
d4690e128b |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
/.settings/
|
||||
/.buildpath
|
||||
/.project
|
||||
/vendor/
|
||||
/composer-develop.lock
|
19
README
19
README
@ -1,19 +0,0 @@
|
||||
A FAIRE
|
||||
|
||||
- Un seul fichier autoload_classmap.php
|
||||
application/
|
||||
library/Application
|
||||
library/Metier
|
||||
library/Scores
|
||||
library/SdMetier
|
||||
library/Zend
|
||||
|
||||
- Revoir les services WsScores :
|
||||
Simplification des noms {Service}/v{Version}/Config.php, Service.php, Types.php
|
||||
todo : a supprimer les anciennes class, uniquement pour reperer les changements
|
||||
|
||||
- Modifier library/framework => librairie compatible PSR-autoloading et la placer dans Metier
|
||||
|
||||
- Nouveau batch genTypes.php : permet de générer automatiquement la config à partir du fichier type
|
||||
|
||||
- Faire la nouvelle librairie Scoring : Intégration plus modulaire
|
22
README.md
Normal file
22
README.md
Normal file
@ -0,0 +1,22 @@
|
||||
# WebService
|
||||
## Installation du projet
|
||||
|
||||
1. Création de la configuration du VHOST apache
|
||||
2. Référencer le domaine virtuel dans le fichier host de la machine
|
||||
* ex : 192.168.33.10 webservice.sd.dev
|
||||
3. Executer composer install pour charger les librairies externes dans vendor
|
||||
4. Configurer l'application (application.ini)
|
||||
* exemple fourni - `docs/config` ou projet `ansible`
|
||||
|
||||
Voir le fichier `docs/README` pour plus d'éléments
|
||||
|
||||
|
||||
## Mode développement pour les librairies externes
|
||||
|
||||
Utiliser la branche `develop` de `scores/library`
|
||||
|
||||
`$ COMPOSER=composer-develop.json composer install`
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,8 @@
|
||||
<?php
|
||||
use Monolog\Logger;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Processor\IntrospectionProcessor;
|
||||
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
protected function _initConfig()
|
||||
@ -9,12 +13,7 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
define('MYSQL_HOST', $config->profil->db->metier->params->host);
|
||||
define('MYSQL_USER', $config->profil->db->metier->params->username);
|
||||
define('MYSQL_PASS', $config->profil->db->metier->params->password);
|
||||
define('MYSQL_DEFAULT_DB', 'jo');
|
||||
define('MYSQL_SQL_LOG', 'NONE');
|
||||
|
||||
define('DOC_WEB_LOCAL' , $config->profil->path->shared.'/files/');
|
||||
define('DOC_WEB_URL' , '/fichier/');
|
||||
define('LOG_PATH' , $config->profil->path->shared.'/log');
|
||||
define('LOG_PATH', $config->profil->path->shared.'/log');
|
||||
|
||||
// Entreprise
|
||||
define('SPHINX_ENT_HOST', $config->profil->sphinx->ent->host);
|
||||
@ -40,158 +39,180 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
define('SPHINX_HOST', $config->profil->sphinx->ent->host);
|
||||
define('SPHINX_PORT', intval($config->profil->sphinx->ent->port));
|
||||
|
||||
define('INFOGREFFE_DISPO_WEB', false);
|
||||
define('INFOGREFFE_DISPO_WS', false);
|
||||
define('INFOGREFFE_WS_URL', 'https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE');
|
||||
define('INFOGREFFE_WS_USER', '85000109');
|
||||
define('INFOGREFFE_WS_PASS', '166');
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
//Initialisation global des paramètres de vue
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
|
||||
$view = $this->getResource('view');
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('HTML5');
|
||||
$view = $this->getResource('view');
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('HTML5');
|
||||
|
||||
$view->headMeta()
|
||||
->appendName('viewport', 'width=device-width, initial-scale=1.0')
|
||||
->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
$view->headMeta()
|
||||
->appendName('viewport', 'width=device-width, initial-scale=1.0')
|
||||
->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
//Favicon - Touch icon for iOS 2.0+ and Android 2.1+
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'apple-touch-icon-precomposed',
|
||||
'href' => '/favicon-152.png'
|
||||
));
|
||||
//Favicon - targeted to any additional png size
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'icon',
|
||||
'type' => 'image/png',
|
||||
'href' => '/favicon-32.png'
|
||||
));
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'shortcut icon',
|
||||
'type' => 'image/x-icon',
|
||||
'href' => '/favicon.ico')
|
||||
);
|
||||
//Favicon - Touch icon for iOS 2.0+ and Android 2.1+
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'apple-touch-icon-precomposed',
|
||||
'href' => '/favicon-152.png'
|
||||
));
|
||||
//Favicon - targeted to any additional png size
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'icon',
|
||||
'type' => 'image/png',
|
||||
'href' => '/favicon-32.png'
|
||||
));
|
||||
$view->headLink()->headLink(array(
|
||||
'rel' => 'shortcut icon',
|
||||
'type' => 'image/x-icon',
|
||||
'href' => '/favicon.ico')
|
||||
);
|
||||
|
||||
$view->headLink()
|
||||
->appendStylesheet('/libs/bootstrap-3.3.6/css/bootstrap.min.css', 'all')
|
||||
->appendStylesheet('/themes/default/css/docs.css', 'all')
|
||||
->appendStylesheet('/themes/default/css/main.css', 'all');
|
||||
$view->headLink()
|
||||
->appendStylesheet('/assets/libs/bootstrap-3.3.7/css/bootstrap.min.css', 'all')
|
||||
->appendStylesheet('/assets/themes/default/css/docs.css', 'all')
|
||||
->appendStylesheet('/assets/themes/default/css/main.css', 'all');
|
||||
|
||||
$view->headScript()
|
||||
->appendFile('/libs/html5shiv.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
|
||||
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
|
||||
->appendFile('/libs/jquery-1.12.0.min.js', 'text/javascript')
|
||||
->appendFile('/libs/bootstrap-3.3.6/js/bootstrap.min.js', 'text/javascript');
|
||||
$view->headScript()
|
||||
->appendFile('/assets/libs/html5shiv.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
|
||||
->appendFile('/assets/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'))
|
||||
->appendFile('/assets/libs/jquery-1.12.4.min.js', 'text/javascript')
|
||||
->appendFile('/assets/libs/bootstrap-3.3.7/js/bootstrap.min.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Web Service API - Scores & Decisions');
|
||||
}
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Web Service API - Scores & Decisions');
|
||||
}
|
||||
|
||||
protected function _initRouter()
|
||||
{
|
||||
$this->bootstrap('frontController');
|
||||
$front = $this->getResource('frontController');
|
||||
$router = $front->getRouter();
|
||||
protected function _initRouter()
|
||||
{
|
||||
$this->bootstrap('frontController');
|
||||
$front = $this->getResource('frontController');
|
||||
$router = $front->getRouter();
|
||||
|
||||
//Lire les services disponibles et créer les routes
|
||||
$services = require_once APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$route = new Zend_Controller_Router_Route($section.'/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute($section, $route);
|
||||
// Lire les services disponibles et créer les routes
|
||||
$services = require_once APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach ($services as $section => $params) {
|
||||
if ($params['actif']) {
|
||||
$route = new Zend_Controller_Router_Route($section.'/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute($section, $route);
|
||||
}
|
||||
}
|
||||
|
||||
$route = new Zend_Controller_Router_Route('jsonrpc/'.$section.'/:version', array(
|
||||
'controller' => 'jsonrpc',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute('jsonrpc-'.$section, $route);
|
||||
}
|
||||
}
|
||||
// Route pour WS Clients
|
||||
$route = new Zend_Controller_Router_Route('clients/:client/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => 'clients',
|
||||
'client' => '',
|
||||
'version' => ''
|
||||
));
|
||||
$router->addRoute('client', $route);
|
||||
|
||||
//Route pour WS Clients
|
||||
$route = new Zend_Controller_Router_Route('clients/:client/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => 'clients',
|
||||
'client' => '',
|
||||
'version' => ''
|
||||
));
|
||||
$router->addRoute('client', $route);
|
||||
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
|
||||
'controller' => 'fichier',
|
||||
'fichier' => '',
|
||||
));
|
||||
$router->addRoute('fichier', $fichierRoute);
|
||||
return $router;
|
||||
}
|
||||
|
||||
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
|
||||
'controller' => 'fichier',
|
||||
'fichier' => '',
|
||||
));
|
||||
$router->addRoute('fichier', $fichierRoute);
|
||||
return $router;
|
||||
}
|
||||
protected function _initDb()
|
||||
{
|
||||
$c = new Zend_Config($this->getOptions());
|
||||
try {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
} catch (Exception $e) {
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
echo '<pre>';
|
||||
print_r($e);
|
||||
echo '</pre>';
|
||||
} else {
|
||||
echo "Le service rencontre actuellement un problème technique.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
protected function _initDb()
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
try {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
} catch ( Exception $e ) {
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
echo '<pre>'; print_r($e); echo '</pre>';
|
||||
} else {
|
||||
echo "Le service rencontre actuellement un problème technique.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
/**
|
||||
* Set the default adapter to use with all model
|
||||
*/
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default adapter to use with all model
|
||||
*/
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
}
|
||||
protected function _initDoctrine()
|
||||
{
|
||||
$c = new Zend_Config($this->getOptions());
|
||||
|
||||
protected function _initWsDebug()
|
||||
{
|
||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||
$autoloader->registerNamespace('WsDebug');
|
||||
$config = new \Doctrine\DBAL\Configuration();
|
||||
|
||||
$options = array(
|
||||
'plugins' => array(
|
||||
'Exception',
|
||||
),
|
||||
);
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
$logger = new Scores_Logger_Sql();
|
||||
$config->setSQLLogger($logger);
|
||||
}
|
||||
|
||||
$debug = new WsDebug_Controller_Plugin_Debug($options);
|
||||
$connectionParams = array(
|
||||
'dbname' => $c->profil->db->metier->params->dbname,
|
||||
'user' => $c->profil->db->metier->params->username,
|
||||
'password' => $c->profil->db->metier->params->password,
|
||||
'host' => $c->profil->db->metier->params->host,
|
||||
'charset' => 'utf8',
|
||||
'driver' => 'pdo_mysql',
|
||||
);
|
||||
|
||||
$this->bootstrap('frontController');
|
||||
$frontController = $this->getResource('frontController');
|
||||
$frontController->registerPlugin($debug);
|
||||
}
|
||||
try {
|
||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
echo '<pre>';
|
||||
print_r($e);
|
||||
echo '</pre>';
|
||||
} else {
|
||||
echo "Le service rencontre actuellement un problème technique.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
if ( APPLICATION_ENV!='development' ) {
|
||||
//MetadataCache pour la base de données
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 14400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
}
|
||||
}
|
||||
}
|
||||
Zend_Registry::set('doctrine', $conn);
|
||||
}
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
if (APPLICATION_ENV!='development') {
|
||||
//MetadataCache pour la base de données
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 14400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core', 'Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _initLogger()
|
||||
{
|
||||
$config = new Zend_Config($this->getOptions());
|
||||
$logFile = $config->profil->path->shared.'/log/application.log';
|
||||
|
||||
$log = new Logger('APP');
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
$level = Logger::DEBUG;
|
||||
} else {
|
||||
$level = Logger::NOTICE;
|
||||
}
|
||||
$log->pushHandler(new StreamHandler($logFile, $level));
|
||||
$log->pushProcessor(new IntrospectionProcessor());
|
||||
|
||||
Zend_Registry::set('logger', $log);
|
||||
}
|
||||
}
|
||||
|
40
application/bin.bootstrap.php
Normal file
40
application/bin.bootstrap.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $c);
|
||||
|
||||
// Database - Zend Style
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
||||
|
||||
// Database - Doctrine Style
|
||||
$config = new \Doctrine\DBAL\Configuration();
|
||||
$connectionParams = array(
|
||||
'dbname' => $c->profil->db->metier->params->dbname,
|
||||
'user' => $c->profil->db->metier->params->username,
|
||||
'password' => $c->profil->db->metier->params->password,
|
||||
'host' => $c->profil->db->metier->params->host,
|
||||
'charset' => 'utf8',
|
||||
'driver' => 'pdo_mysql',
|
||||
);
|
||||
|
||||
try {
|
||||
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
|
||||
Zend_Registry::set('doctrine', $conn);
|
||||
} catch (\Doctrine\DBAL\DBALException $e) {
|
||||
echo "Connection Database impossible.\n";
|
||||
exit;
|
||||
}
|
1
application/configs/.gitignore
vendored
Normal file
1
application/configs/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/application.ini
|
@ -26,9 +26,6 @@ return array(
|
||||
'action' => 'services',
|
||||
'pages' => array(),
|
||||
),
|
||||
array(
|
||||
'uri' => '#',
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
@ -55,4 +52,4 @@ return array(
|
||||
'action' => 'about',
|
||||
'pages' => array(),
|
||||
),
|
||||
);
|
||||
);
|
||||
|
@ -1,109 +1,107 @@
|
||||
<?php
|
||||
class DemoController extends Zend_Controller_Action
|
||||
{
|
||||
protected $_username;
|
||||
protected $_hash;
|
||||
protected $_username;
|
||||
protected $_hash;
|
||||
|
||||
protected $methods = array(
|
||||
'getIdentite' => array(
|
||||
'ws' => 'entreprise/v0.8?wsdl',
|
||||
'form' => 'getIdentite',
|
||||
),
|
||||
);
|
||||
protected $methods = array(
|
||||
'getIdentite' => array(
|
||||
'ws' => 'entreprise/v0.8?wsdl',
|
||||
'form' => 'getIdentite',
|
||||
),
|
||||
);
|
||||
|
||||
public function init()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$this->_username = $auth->getIdentity()->username;
|
||||
$this->_hash = $auth->getIdentity()->hash;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
public function init()
|
||||
{
|
||||
//Liste
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$this->_username = $auth->getIdentity()->username;
|
||||
$this->_hash = $auth->getIdentity()->hash;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste
|
||||
|
||||
|
||||
$tabMethods = array();
|
||||
foreach($this->methods as $method => $element){
|
||||
$url = $this->view->url(array(
|
||||
'controller' => 'demo',
|
||||
'action' => 'method',
|
||||
'name' => $method,
|
||||
));
|
||||
$tabMethods[] = array(
|
||||
'nom' => $method,
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
foreach ($this->methods as $method => $element) {
|
||||
$url = $this->view->url(array(
|
||||
'controller' => 'demo',
|
||||
'action' => 'method',
|
||||
'name' => $method,
|
||||
));
|
||||
$tabMethods[] = array(
|
||||
'nom' => $method,
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->assign('methods', $tabMethods);
|
||||
$this->view->assign('methods', $tabMethods);
|
||||
}
|
||||
|
||||
public function methodAction()
|
||||
{
|
||||
$method = $this->_getParam('name','');
|
||||
$this->view->assign('method', $method);
|
||||
//Affichage du formulaire
|
||||
if (array_key_exists($method, $this->methods)){
|
||||
$class = 'Scores_Ws_Form_'.ucfirst($method);
|
||||
if (class_exists($class)){
|
||||
$form = new $class;
|
||||
$form->addElement('hidden', 'method', array(
|
||||
'value' => $method,
|
||||
));
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
}
|
||||
$this->view->assign('form', $form);
|
||||
} else {
|
||||
$this->view->assign('message',"Impossible d'afficher le formulaire !");
|
||||
}
|
||||
}
|
||||
}
|
||||
public function methodAction()
|
||||
{
|
||||
$method = $this->_getParam('name', '');
|
||||
$this->view->assign('method', $method);
|
||||
//Affichage du formulaire
|
||||
if (array_key_exists($method, $this->methods)) {
|
||||
$class = 'Scores_Ws_Form_'.ucfirst($method);
|
||||
if (class_exists($class)) {
|
||||
$form = new $class;
|
||||
$form->addElement('hidden', 'method', array(
|
||||
'value' => $method,
|
||||
));
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
}
|
||||
$this->view->assign('form', $form);
|
||||
} else {
|
||||
$this->view->assign('message', "Impossible d'afficher le formulaire !");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requeteAction()
|
||||
{
|
||||
public function requeteAction()
|
||||
{
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$method = $formData['method'];
|
||||
$class = 'Scores_Ws_Form_'.ucfirst($method);
|
||||
if (class_exists($class)) {
|
||||
$form = new $class;
|
||||
if ($form->isValid($formData)) {
|
||||
$method = $formData['method'];
|
||||
$siret = $formData['siret'];
|
||||
$accesWs = $this->methods[$method]['ws'];
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$options = array(
|
||||
'login' => $this->_username,
|
||||
'password' => $this->_hash,
|
||||
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS
|
||||
);
|
||||
$client = new Zend_Soap_Client('http://'.$hostName.'/'.$accesWs, $options);
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
try {
|
||||
$reponse = $client->getIdentite($params);
|
||||
} catch (Zend_Soap_Client_Exception $e) {
|
||||
$reponse = $e->getMessage();
|
||||
}
|
||||
$soap = array(
|
||||
'requete' => $params,
|
||||
'reponse' => $reponse,
|
||||
);
|
||||
$this->view->assign('soap',$soap);
|
||||
$xml = array(
|
||||
'requete' => $client->getLastRequest(),
|
||||
'reponse' => $client->getLastResponse()
|
||||
);
|
||||
$this->view->assign('xml',$xml);
|
||||
} else {
|
||||
$this->_forward('method', 'demo', null, array('name'=> 'getIdentite'));
|
||||
}
|
||||
}
|
||||
$method = $formData['method'];
|
||||
$class = 'Scores_Ws_Form_'.ucfirst($method);
|
||||
if (class_exists($class)) {
|
||||
$form = new $class;
|
||||
if ($form->isValid($formData)) {
|
||||
$method = $formData['method'];
|
||||
$siret = $formData['siret'];
|
||||
$accesWs = $this->methods[$method]['ws'];
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$options = array(
|
||||
'login' => $this->_username,
|
||||
'password' => $this->_hash,
|
||||
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS
|
||||
);
|
||||
$client = new Zend_Soap_Client('http://'.$hostName.'/'.$accesWs, $options);
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
try {
|
||||
$reponse = $client->getIdentite($params);
|
||||
} catch (Zend_Soap_Client_Exception $e) {
|
||||
$reponse = $e->getMessage();
|
||||
}
|
||||
$soap = array(
|
||||
'requete' => $params,
|
||||
'reponse' => $reponse,
|
||||
);
|
||||
$this->view->assign('soap', $soap);
|
||||
$xml = array(
|
||||
'requete' => $client->getLastRequest(),
|
||||
'reponse' => $client->getLastResponse()
|
||||
);
|
||||
$this->view->assign('xml', $xml);
|
||||
} else {
|
||||
$this->_forward('method', 'demo', null, array('name'=> 'getIdentite'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,196 +2,188 @@
|
||||
class DocumentationController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
/**
|
||||
/**
|
||||
* Affichage de la documentation des webservices
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Do nothing
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des services
|
||||
*/
|
||||
public function servicesAction()
|
||||
{
|
||||
public function servicesAction()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* Liste des version par service
|
||||
*/
|
||||
public function servicevAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$name = $request->getParam('name');
|
||||
|
||||
/**
|
||||
* Liste des version par service
|
||||
*/
|
||||
public function servicevAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$name = $request->getParam('name');
|
||||
$this->view->key = $name;
|
||||
}
|
||||
|
||||
$this->view->key = $name;
|
||||
}
|
||||
public function serviceAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type', 'sd');
|
||||
$ws = strtolower($request->getParam('name', 'entreprise'));
|
||||
|
||||
public function serviceAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type', 'sd');
|
||||
$ws = strtolower($request->getParam('name','entreprise'));
|
||||
$myService = $this->view->WsServices[$ws];
|
||||
|
||||
$myService = $this->view->WsServices[$ws];
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $myService['versions'];
|
||||
foreach ($configServiceVersions as $section => $params) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $myService['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
$this->view->assign('serviceName', $myService['name']);
|
||||
$this->view->assign('serviceVersion', $version);
|
||||
|
||||
$this->view->assign('serviceName', $myService['name']);
|
||||
$this->view->assign('serviceVersion', $version);
|
||||
|
||||
$isDeprecated = false;
|
||||
if ( $myService['versions'][$version]['defaut'] == '' ) {
|
||||
$isDeprecated = false;
|
||||
if ($myService['versions'][$version]['defaut'] == '') {
|
||||
$isDeprecated = true;
|
||||
}
|
||||
$this->view->assign('isDeprecated', $isDeprecated);
|
||||
|
||||
if ( $type == 'client') {
|
||||
$client = $ws;
|
||||
$ws = 'entreprise';
|
||||
}
|
||||
if ($type == 'client') {
|
||||
$client = $ws;
|
||||
$ws = 'entreprise';
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ( $type == 'client') {
|
||||
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
|
||||
} else {
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
}
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ($type == 'client') {
|
||||
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
|
||||
} else {
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if ( $type == 'client') {
|
||||
$wsdl_url.= '/clients/'.$client.'/v'.$version;
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version;
|
||||
}
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '?wsdl-auto';
|
||||
}
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if ($type == 'client') {
|
||||
$wsdl_url.= '/clients/'.$client.'/v'.$version;
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version;
|
||||
}
|
||||
if (APPLICATION_ENV == 'production') {
|
||||
$wsdl_url.= '?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '?wsdl-auto';
|
||||
}
|
||||
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_Ws_Doc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_Ws_Doc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach ($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
}
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste les exemples de code disponible pour chaque méthode
|
||||
*/
|
||||
public function exemplesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$ws = strtolower($request->getParam('ws','Entreprise'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
public function exemplesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$ws = strtolower($request->getParam('ws', 'Entreprise'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ($clients as $section => $params) {
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists($auth->getIdentity()->idClient, $wsClients)){
|
||||
if (array_key_exists($auth->getIdentity()->idClient, $wsClients)) {
|
||||
$this->_forward('clients', 'documentation', null, array(
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
));
|
||||
} else {
|
||||
|
||||
$this->_forward('clients', 'documentation', null, array(
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
));
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach ($services as $section => $params) {
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
if (array_key_exists($ws, $wsServices)) {
|
||||
if (isset($wsServices['idClient']) && $idClient!=$wsServices['idClient']) {
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if (isset($wsServices['user']) && !in_array($username, $wsServices['user'])) {
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['versions'];
|
||||
foreach ($configServiceVersions as $section => $params) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
if ( array_key_exists($ws, $wsServices) )
|
||||
{
|
||||
if ( isset($wsServices['idClient']) && $idClient!=$wsServices['idClient'] )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if ( isset($wsServices['user']) && !in_array($username, $wsServices['user']) )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = include $pathClassService.'Config.php';
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl-auto';
|
||||
}
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_Ws_Doc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
|
||||
}
|
||||
}
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if (APPLICATION_ENV == 'production') {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl-auto';
|
||||
}
|
||||
// Affichage de la documentation
|
||||
$doc = new Scores_Ws_Doc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach ($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage exemple de code avec coloration syntaxique
|
||||
@ -200,24 +192,23 @@ class DocumentationController extends Zend_Controller_Action
|
||||
*/
|
||||
public function codeAction()
|
||||
{
|
||||
$langage = strtolower($this->_getParam('langage',''));
|
||||
$element = $this->_getParam('element','');
|
||||
$langage = strtolower($this->_getParam('langage', ''));
|
||||
$element = $this->_getParam('element', '');
|
||||
|
||||
$fichier = APPLICATION_PATH . '/../public/assets/code/' . $element . '-' . $langage . '.txt';
|
||||
if (file_exists($fichier)){
|
||||
$sourceCode = file_get_contents($fichier);
|
||||
$fichier = APPLICATION_PATH . '/../public/assets/code/' . $element . '-' . $langage . '.txt';
|
||||
if (file_exists($fichier)) {
|
||||
$sourceCode = file_get_contents($fichier);
|
||||
|
||||
require_once 'Vendors/geshi/geshi.php';
|
||||
$geshi = new GeSHi($sourceCode, $langage);
|
||||
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
|
||||
$sourceHighlight = $geshi->parse_code();
|
||||
$geshi = new GeSHi($sourceCode, $langage);
|
||||
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
|
||||
$sourceHighlight = $geshi->parse_code();
|
||||
|
||||
$this->view->assign('langage', strtoupper($langage));
|
||||
$this->view->assign('code', $sourceHighlight);
|
||||
} else {
|
||||
$this->view->assign('langage',
|
||||
'Element non traités, Vous pouvez aussi nous fournir des exemples.');
|
||||
}
|
||||
$this->view->assign('langage', strtoupper($langage));
|
||||
$this->view->assign('code', $sourceHighlight);
|
||||
} else {
|
||||
$this->view->assign('langage',
|
||||
'Element non traités, Vous pouvez aussi nous fournir des exemples.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -225,9 +216,8 @@ class DocumentationController extends Zend_Controller_Action
|
||||
*/
|
||||
public function erreurAction()
|
||||
{
|
||||
$ws = new Scores_Ws_Server();
|
||||
$erreurs = $ws->listError;
|
||||
$this->view->assign('erreurs', $erreurs);
|
||||
$ws = new Scores_Ws_Server();
|
||||
$erreurs = $ws->listError;
|
||||
$this->view->assign('erreurs', $erreurs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
class ErrorController extends Zend_Controller_Action
|
||||
{
|
||||
public function errorAction()
|
||||
public function errorAction()
|
||||
{
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
@ -44,4 +44,3 @@ class ErrorController extends Zend_Controller_Action
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
class ExportController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
echo "Export";
|
||||
}
|
||||
|
||||
protected function checkFile($path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,256 +1,261 @@
|
||||
<?php
|
||||
class FichierController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
}
|
||||
/**
|
||||
* PDO Connection with Doctrine
|
||||
* @var \Doctrine\DBAL\Connection
|
||||
*/
|
||||
protected $conn;
|
||||
|
||||
public function bodaccAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$this->conn = Zend_Registry::get('doctrine');
|
||||
}
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$directory = $c->profil->path->shared.'/datafile/bodacc/histo';
|
||||
public function bodaccAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$c = Zend_Registry::get('config');
|
||||
$directory = $c->profil->path->shared.'/datafile/bodacc/histo';
|
||||
|
||||
$q = $this->getRequest()->getParam('q');
|
||||
$filename = base64_decode($q);
|
||||
$q = $this->getRequest()->getParam('q');
|
||||
$filename = base64_decode($q);
|
||||
|
||||
$file = $directory.'/'.$filename;
|
||||
$file = $directory.'/'.$filename;
|
||||
|
||||
if (file_exists($file) && filesize($file)>0) {
|
||||
if (file_exists($file) && filesize($file) > 0) {
|
||||
|
||||
//Log de la requete
|
||||
$data = array(
|
||||
'login' => $auth->getIdentity()->username,
|
||||
'idClient' => $auth->getIdentity()->idClient,
|
||||
'page' => 'histobodacc',
|
||||
'siren' => '',
|
||||
'nic' => '',
|
||||
'params' => $file,
|
||||
'test' => 0,
|
||||
'raisonSociale' => '',
|
||||
'cp' => '',
|
||||
'ville' => '',
|
||||
'ipClient' => $_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
$logs = new Application_Model_Sdv1Logs();
|
||||
$logs->insert($data);
|
||||
//Log de la requete
|
||||
$data = array(
|
||||
'login' => $auth->getIdentity()->username,
|
||||
'idClient' => $auth->getIdentity()->idClient,
|
||||
'page' => 'histobodacc',
|
||||
'siren' => '',
|
||||
'nic' => '',
|
||||
'params' => $file,
|
||||
'test' => 0,
|
||||
'raisonSociale' => '',
|
||||
'cp' => '',
|
||||
'ville' => '',
|
||||
'ipClient' => $_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
$this->conn->insert('sdv1.logs', $data);
|
||||
|
||||
$content_type = 'application/pdf';
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
} else {
|
||||
echo "Authentification échoué.";
|
||||
}
|
||||
}
|
||||
$content_type = 'application/pdf';
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
} else {
|
||||
echo "Authentification échoué.";
|
||||
}
|
||||
}
|
||||
|
||||
public function logsAction()
|
||||
{
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/'.$file;
|
||||
public function logsAction()
|
||||
{
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/'.$filename;
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
public function csvAction()
|
||||
{
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/'. $filename;
|
||||
public function csvAction()
|
||||
{
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/'. $filename;
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
public function kbisAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = realpath($c->profil->path->shared).'/datafile/kbis/'.$filename;
|
||||
public function kbisAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = realpath($c->profil->path->shared).'/datafile/kbis/'.$filename;
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
public function associationsAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' . $filename;
|
||||
public function associationsAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' . $filename;
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
public function greffesAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' .$filename;
|
||||
public function greffesAction()
|
||||
{
|
||||
$content_type = 'application/pdf';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' .$filename;
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
|
||||
public function crmAction()
|
||||
{
|
||||
$content_type = 'application/x-bzip';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' .$filename;
|
||||
public function crmAction()
|
||||
{
|
||||
$content_type = 'application/x-bzip';
|
||||
$filename = $this->getRequest()->getParam('fichier');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared . '/files/' .$filename;
|
||||
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
}
|
||||
// --- Envoi du fichier sur la sortie standard
|
||||
if (file_exists($file)) {
|
||||
$modules = array(); //apache_get_modules();
|
||||
if (in_array('mod_xsendfile', $modules)) {
|
||||
header('X-Sendfile: ' . $file);
|
||||
header('Content-Type: ' . $content_type);
|
||||
header('Content-Disposition: inline; filename="' . $content_type . '"');
|
||||
exit;
|
||||
} else {
|
||||
ini_set('zlib.output_compression', '0');
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-Type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($file)));
|
||||
header('Content-Disposition: inline; filename="' . basename($file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
readfile($file);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
class ImportController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function fileformAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->inlineScript()->appendFile('/scripts/jquery.form.js');
|
||||
$this->view->inlineScript()->appendFile('/scripts/jqueryprogressbar.js');
|
||||
|
||||
$this->view->assign('filesize', ini_get('upload_max_filesize'));
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
$login = $request->getParam('login', null);
|
||||
|
||||
$this->view->assign('idClient', $idClient);
|
||||
$this->view->assign('login', $login);
|
||||
}
|
||||
|
||||
public function fileuploadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient');
|
||||
$login = $request->getParam('login');
|
||||
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
|
||||
$path = realpath($config->data).'/validation';
|
||||
if(!file_exists($path)) mkdir($path);
|
||||
|
||||
if ( isset($_FILES) && count($_FILES)==1 ){
|
||||
$n = $_FILES['fichier']['name'];
|
||||
$s = $_FILES['fichier']['size'];
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
|
||||
$extValide = array('csv');
|
||||
$extension = strrchr($n,'.');
|
||||
$extension = substr($extension,1);
|
||||
//Vérifier l'extension du fichier
|
||||
if(!in_array($extension, $extValide)){
|
||||
echo "Extension de fichier incorrect !";
|
||||
} elseif (move_uploaded_file($tmp_name, $path.'/'.$idClient.'-'.$name.'.'.$extension)){
|
||||
echo "Fichier envoyé, <a href=\"".
|
||||
$this->view->url(array(
|
||||
'controller' => 'import',
|
||||
'action' => 'checkfile',
|
||||
'file' => $idClient.'-'.$name.'.'.$extension,
|
||||
))."\">Vérifier le format</a>";
|
||||
} else {
|
||||
echo "Erreur : ".$_FILES['fichier']['error'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Etat de progression de l'upload du fichier
|
||||
*/
|
||||
public function fileprogressAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key', '');
|
||||
if (!empty($key)) {
|
||||
//$rep sera égal à false si la clef n'existe pas dans le cache apc
|
||||
$rep = apc_fetch('upload_'.$key);
|
||||
echo json_encode($rep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,10 +1,15 @@
|
||||
<?php
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction(){}
|
||||
public function indexAction()
|
||||
{
|
||||
}
|
||||
|
||||
public function contactAction(){}
|
||||
public function contactAction()
|
||||
{
|
||||
}
|
||||
|
||||
public function aboutAction(){}
|
||||
public function aboutAction()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,108 +1,106 @@
|
||||
<?php
|
||||
class JsonrpcController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Nom du service
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//Service spécifique client
|
||||
if ($serviceName == 'clients') {
|
||||
$client = $request->getParam('client', '');
|
||||
//Liste des clients
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params ) {
|
||||
if ($params['actif']){
|
||||
$clients[] = $section;
|
||||
}
|
||||
}
|
||||
if (!in_array($client, $clients)){
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
//Liste des versions
|
||||
foreach( $configServiceVersions as $section => $params ) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) ) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] ) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ($serviceName == 'clients') {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.ini';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.php';
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
//On redéfini le nom du service
|
||||
$serviceName = 'Entreprise';
|
||||
$fichierWsdl = ucfirst($client).'-'.$serviceName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.ini';
|
||||
$pathServiceClassPhp = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.php';
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
$fichierWsdl = ucfirst($serviceName).'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$wsConfig = new Zend_Config_Ini($pathServiceClassIni);
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Instance du server
|
||||
$server = new Zend_Json_Server();
|
||||
// Define class name
|
||||
$server->setClass(ucfirst($serviceName));
|
||||
|
||||
// Gestion du SMD
|
||||
if($this->getRequest()->isGet()){
|
||||
// Indiquer URL endpoint
|
||||
//$this->getHelper('url')->url(array('controller'=>'', 'action'=>'' ));
|
||||
$server->setTarget('/jsonrpc/'.$serviceName.'/'.$version.'/')
|
||||
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
|
||||
// Grab the SMD
|
||||
$smd = $server->getServiceMap();
|
||||
|
||||
//Return the SMD to the client
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json');
|
||||
}
|
||||
echo $smd;
|
||||
return;
|
||||
} else {
|
||||
$server->setAutoEmitResponse(true);
|
||||
$server->handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Nom du service
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//Service spécifique client
|
||||
if ($serviceName == 'clients') {
|
||||
$client = $request->getParam('client', '');
|
||||
//Liste des clients
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ($listeClients as $section => $params) {
|
||||
if ($params['actif']) {
|
||||
$clients[] = $section;
|
||||
}
|
||||
}
|
||||
if (!in_array($client, $clients)) {
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
} else {
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
//Liste des versions
|
||||
foreach ($configServiceVersions as $section => $params) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if (!array_key_exists($version, $serviceVersions)) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if (!$serviceVersions[$version]['actif']) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ($serviceName == 'clients') {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.ini';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.php';
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
//On redéfini le nom du service
|
||||
$serviceName = 'Entreprise';
|
||||
$fichierWsdl = ucfirst($client).'-'.$serviceName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.ini';
|
||||
$pathServiceClassPhp = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.php';
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
$fichierWsdl = ucfirst($serviceName).'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$wsConfig = new Zend_Config_Ini($pathServiceClassIni);
|
||||
foreach ($wsConfig->Type->toArray() as $Type) {
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Instance du server
|
||||
$server = new Zend_Json_Server();
|
||||
// Define class name
|
||||
$server->setClass(ucfirst($serviceName));
|
||||
|
||||
// Gestion du SMD
|
||||
if ($this->getRequest()->isGet()) {
|
||||
// Indiquer URL endpoint
|
||||
//$this->getHelper('url')->url(array('controller'=>'', 'action'=>'' ));
|
||||
$server->setTarget('/jsonrpc/'.$serviceName.'/'.$version.'/')
|
||||
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
|
||||
// Grab the SMD
|
||||
$smd = $server->getServiceMap();
|
||||
|
||||
//Return the SMD to the client
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json');
|
||||
}
|
||||
echo $smd;
|
||||
return;
|
||||
} else {
|
||||
$server->setAutoEmitResponse(true);
|
||||
$server->handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,131 +1,128 @@
|
||||
<?php
|
||||
use League\Csv\Writer;
|
||||
|
||||
class RefController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction ()
|
||||
{
|
||||
//Ne fait rien...
|
||||
}
|
||||
public function indexAction()
|
||||
{
|
||||
//Ne fait rien...
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès au fichier
|
||||
*/
|
||||
public function fichierAction ()
|
||||
{
|
||||
//Lecture du nom du fichier
|
||||
$fichier = $this->_getParam('q','');
|
||||
$fichier = $fichier . '.csv';
|
||||
if (!empty($fichier) && file_exists('fichiers/'.$fichier))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
/**
|
||||
* Donne accès au fichier
|
||||
*/
|
||||
public function fichierAction()
|
||||
{
|
||||
//Lecture du nom du fichier
|
||||
$fichier = $this->_getParam('q', '');
|
||||
$fichier = $fichier . '.csv';
|
||||
if (!empty($fichier) && file_exists('fichiers/'.$fichier)) {
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
list($nomFichier, $extFichier) = explode('.',$fichier);
|
||||
//Distribution du fichier sur la sortie standard
|
||||
switch ($extFichier) {
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition) {
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichier\"");
|
||||
break;
|
||||
}
|
||||
list($nomFichier, $extFichier) = explode('.', $fichier);
|
||||
//Distribution du fichier sur la sortie standard
|
||||
switch ($extFichier) {
|
||||
case 'png': $content_type = 'image/png'; break;
|
||||
case 'gif': $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg': $content_type = 'image/jpeg'; break;
|
||||
case 'pdf': $content_type = 'application/pdf'; break;
|
||||
case 'csv': $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition) {
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichier\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents('assets/fichiers/'.$fichier);
|
||||
$data = file_get_contents('assets/fichiers/'.$fichier);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
} else {
|
||||
$this->view->assign('message', 'Fichier introuvable !');
|
||||
}
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
} else {
|
||||
$this->view->assign('message', 'Fichier introuvable !');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès aux données contenues dans une table de base de données
|
||||
*/
|
||||
public function tableAction ()
|
||||
{
|
||||
$requetesql = $this->_getParam('q','');
|
||||
$fichierCsv = $requetesql.'.csv';
|
||||
$fichierSql = $requetesql.'.sql';
|
||||
/**
|
||||
* Donne accès aux données contenues dans une table de base de données
|
||||
*/
|
||||
public function tableAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$requetesql = $request->getParam('q', '');
|
||||
$fichierCsv = $requetesql.'.csv';
|
||||
$fichierSql = $requetesql.'.sql';
|
||||
|
||||
//Emplacement des fichiers générés - lien symbolique en PRODUCTION
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/files/fichiers/';
|
||||
if (!is_dir($path)) { mkdir($path); }
|
||||
if (!empty($requetesql))
|
||||
{
|
||||
if (!file_exists($path . $fichierCsv))
|
||||
{
|
||||
if (file_exists('assets/sql/'.$fichierSql))
|
||||
{
|
||||
//Connexion mysql
|
||||
$sql = file_get_contents('assets/sql/'.$fichierSql);
|
||||
$db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
||||
$rows = $db->fetchAll($sql);
|
||||
if (count($rows) > 0) {
|
||||
$fp = fopen($path . $fichierCsv.'.tmp', 'w');
|
||||
//Write header
|
||||
$headers = array_keys($rows[0]);
|
||||
fputcsv($fp, $headers, ',', '"');
|
||||
//Write content
|
||||
foreach($rows as $fields) {
|
||||
fputcsv($fp, $fields, ',', '"');
|
||||
}
|
||||
fclose($fp);
|
||||
rename($path . $fichierCsv.'.tmp', $path . $fichierCsv);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Emplacement des fichiers générés - lien symbolique en PRODUCTION
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared . '/files/fichiers/';
|
||||
if (!is_dir($path)) {
|
||||
mkdir($path);
|
||||
}
|
||||
if (!empty($requetesql)) {
|
||||
if (!file_exists($path . $fichierCsv)) {
|
||||
if (file_exists('assets/sql/'.$fichierSql)) {
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
$conn = Zend_Registry::get('doctrine');
|
||||
$sql = file_get_contents('assets/sql/'.$fichierSql);
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->setFetchMode(\PDO::FETCH_ASSOC);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$csv = Writer::createFromPath($path . $fichierCsv.'.tmp', 'w');
|
||||
$csv->setNewline("\r\n");
|
||||
$headers = array_keys($stmt->fetch());
|
||||
$csv->insertOne($headers);
|
||||
$csv->insertAll($stmt);
|
||||
}
|
||||
rename($path . $fichierCsv.'.tmp', $path . $fichierCsv);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($path . $fichierCsv))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
//Distribution du fichier sur la sortie standard
|
||||
list($nomFichier, $extFichier) = explode('.',$fichierCsv);
|
||||
switch ($extFichier)
|
||||
{
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition)
|
||||
{
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichierCsv\"");
|
||||
break;
|
||||
}
|
||||
if (file_exists($path . $fichierCsv)) {
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
//Distribution du fichier sur la sortie standard
|
||||
list($nomFichier, $extFichier) = explode('.', $fichierCsv);
|
||||
switch ($extFichier) {
|
||||
case 'png': $content_type = 'image/png'; break;
|
||||
case 'gif': $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg': $content_type = 'image/jpeg'; break;
|
||||
case 'pdf': $content_type = 'application/pdf'; break;
|
||||
case 'csv': $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition) {
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichierCsv\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents($path . $fichierCsv);
|
||||
$data = file_get_contents($path . $fichierCsv);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', 'Paramètres incorrects !');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', 'Paramètres incorrects !');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,202 +7,196 @@ class ServiceController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* Be sure we don't make any render
|
||||
*/
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$request = $this->getRequest();
|
||||
|
||||
// --- Get the service name, make sure the string is in lower case
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
// --- Get the service name, make sure the string is in lower case
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
// --- ClassName and Directory with first letter capitalized
|
||||
$serviceClassName = ucfirst($serviceName);
|
||||
// --- ClassName and Directory with first letter capitalized
|
||||
$serviceClassName = ucfirst($serviceName);
|
||||
|
||||
// --- Customize service for customers
|
||||
if ( 'clients' == $serviceName )
|
||||
{
|
||||
$client = strtolower($request->getParam('client', ''));
|
||||
$clientClassName = ucfirst($client);
|
||||
// --- Get list of customers
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params )
|
||||
{
|
||||
if ($params['actif'])
|
||||
{
|
||||
$clients[$section] = $params;
|
||||
}
|
||||
}
|
||||
if (!array_key_exists($client, $clients))
|
||||
{
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// --- Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
// --- Customize service for customers
|
||||
if ('clients' == $serviceName) {
|
||||
$client = strtolower($request->getParam('client', ''));
|
||||
$clientClassName = ucfirst($client);
|
||||
// --- Get list of customers
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ($listeClients as $section => $params) {
|
||||
if ($params['actif']) {
|
||||
$clients[$section] = $params;
|
||||
}
|
||||
}
|
||||
if (!array_key_exists($client, $clients)) {
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
// --- Service versions
|
||||
else {
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
// --- Check versions
|
||||
foreach( $configServiceVersions as $section => $params )
|
||||
{
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
// --- Check versions
|
||||
foreach ($configServiceVersions as $section => $params) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// --- Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) )
|
||||
{
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// --- Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] )
|
||||
{
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
// --- Version inexistante
|
||||
if (!array_key_exists($version, $serviceVersions)) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// --- Version désactivé
|
||||
if (!$serviceVersions[$version]['actif']) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// --- Charger les classes et les types pour le service suivant la version
|
||||
if ('clients' == $serviceName)
|
||||
{
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Service.php';
|
||||
// --- Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
|
||||
}
|
||||
// --- On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/'.$serviceClassName.'/v'.$version.'/Service.php';
|
||||
// --- Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
// --- Charger les classes et les types pour le service suivant la version
|
||||
if ('clients' == $serviceName) {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Service.php';
|
||||
// --- Gestion du mode de génération du wsdl
|
||||
if (APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$pathServiceUri = 'clients/'.$client.'/v'.$version;
|
||||
// --- On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/'.$serviceClassName.'/v'.$version.'/Service.php';
|
||||
// --- Gestion du mode de génération du wsdl
|
||||
if (APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$pathServiceUri = $serviceName.'/v'.$version;
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
}
|
||||
// --- Get map of WSDL type to PHP Classes
|
||||
$classmap = include $pathServiceClassIni;
|
||||
|
||||
// --- Get map of WSDL type to PHP Classes
|
||||
$classmap = include $pathServiceClassIni;
|
||||
// --- Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// --- Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// --- Get hostname - add compatibility with Reverse Proxy
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$fichierWsdl = $hostName . '-' . $fichierWsdl;
|
||||
// --- Get hostname - add compatibility with Reverse Proxy
|
||||
$hostName = $request->getHttpHost();
|
||||
$hostScheme = $request->getScheme();
|
||||
$http = new Zend_Controller_Request_Http();
|
||||
$proxyScheme = $http->getHeader('X-Forwarded-Proto');
|
||||
if ($proxyScheme == 'https') {
|
||||
$hostScheme = 'https';
|
||||
}
|
||||
$fichierWsdl = $hostName . '-' . $hostScheme . '-' . $fichierWsdl;
|
||||
$c = Zend_registry::get('config');
|
||||
$wsdlPath = $c->profil->path->shared . '/wsdl';
|
||||
|
||||
// --- Fourniture du wsdl
|
||||
if ( isset($_GET['wsdl']) && file_exists($wsdlPath . '/' . $fichierWsdl) )
|
||||
{
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
readfile($wsdlPath . '/' . $fichierWsdl);
|
||||
}
|
||||
elseif ( isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)
|
||||
|| isset($_GET['wsdl-generate'])
|
||||
|| isset($_GET['wsdl-auto']) )
|
||||
{
|
||||
// --- Définition du webservice
|
||||
$wsdl = new Zend_Soap_AutoDiscover();
|
||||
$wsdl->setComplexTypeStrategy('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence');
|
||||
$wsdl->setOperationBodyStyle( array('use' => 'literal') );
|
||||
$wsdl->setBindingStyle( array('style' => 'document') );
|
||||
$wsdl->setClass($serviceClassName);
|
||||
// --- Fourniture du wsdl
|
||||
if (isset($_GET['wsdl']) && file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
readfile($wsdlPath . '/' . $fichierWsdl);
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)
|
||||
|| isset($_GET['wsdl-generate'])
|
||||
|| isset($_GET['wsdl-auto'])) {
|
||||
// --- Définition du webservice
|
||||
$wsdl = new Zend_Soap_AutoDiscover();
|
||||
$wsdl->setComplexTypeStrategy('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence');
|
||||
$wsdl->setOperationBodyStyle(array('use' => 'literal'));
|
||||
$wsdl->setBindingStyle(array('style' => 'document'));
|
||||
$wsdl->setClass($serviceClassName);
|
||||
|
||||
// --- Enregistrement du WSDL dans un fichier
|
||||
if ( isset($_GET['wsdl-generate']) ) {
|
||||
if (file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
unlink($wsdlPath . '/' . $fichierWsdl);
|
||||
}
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
echo "Le fichier $fichierWsdl a été généré";
|
||||
if ($hostScheme == 'https') {
|
||||
$wsdl->setUri($hostScheme.'://'.$hostName.'/'.$pathServiceUri);
|
||||
}
|
||||
|
||||
// --- Génération/Fourniture du wsdl
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
if ( !headers_sent() ) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
readfile($wsdlPath . '/' . $fichierWsdl);
|
||||
// --- Enregistrement du WSDL dans un fichier
|
||||
if (isset($_GET['wsdl-generate'])) {
|
||||
if (file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
unlink($wsdlPath . '/' . $fichierWsdl);
|
||||
}
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
echo "Le fichier $fichierWsdl a été généré";
|
||||
// --- Génération/Fourniture du wsdl
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
$wsdl->dump($wsdlPath . '/' . $fichierWsdl);
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
readfile($wsdlPath . '/' . $fichierWsdl);
|
||||
}
|
||||
// --- Envoi sur la sortie standard le wsdl sans enregistrement dans un fichier
|
||||
elseif (isset($_GET['wsdl-auto'])) {
|
||||
$wsdl->handle();
|
||||
}
|
||||
}
|
||||
// --- Fourniture du service
|
||||
else {
|
||||
// --- Traitement
|
||||
if (in_array(APPLICATION_ENV, array('production', 'staging'))
|
||||
&& file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
$server = new Zend_Soap_Server($wsdlPath . '/' . $fichierWsdl);
|
||||
} else {
|
||||
$server = new Zend_Soap_Server($hostScheme.'://'.$hostName.'/'.$pathServiceUrl);
|
||||
}
|
||||
|
||||
// --- Envoi sur la sortie standard le wsdl sans enregistrement dans un fichier
|
||||
} elseif ( isset($_GET['wsdl-auto']) ){
|
||||
$wsdl->handle();
|
||||
}
|
||||
}
|
||||
// --- Fourniture du service
|
||||
else
|
||||
{
|
||||
// --- Traitement
|
||||
if (in_array(APPLICATION_ENV, array('production', 'staging')) && file_exists($wsdlPath . '/' . $fichierWsdl)) {
|
||||
$server = new Zend_Soap_Server($wsdlPath . '/' . $fichierWsdl);
|
||||
} else {
|
||||
$server = new Zend_Soap_Server('http://'.$hostName.'/'.$pathServiceUrl);
|
||||
}
|
||||
|
||||
// --- Sonde paramètres server
|
||||
$debug = false;
|
||||
$debugUser = '';
|
||||
if ($debug && $_SERVER['PHP_AUTH_USER'] == $debugUser)
|
||||
{
|
||||
// --- Sonde paramètres server
|
||||
$debug = false;
|
||||
$debugUser = '';
|
||||
if ($debug && $_SERVER['PHP_AUTH_USER'] == $debugUser) {
|
||||
file_put_contents(APPLICATION_PATH . '/../debugserver.log',
|
||||
"FichierWSDL : ".$fichierWsdl."\n".
|
||||
"Hostname : ".$hostName."\n"
|
||||
"FichierWSDL : ".$fichierWsdl."\n".
|
||||
"Hostname : ".$hostName."\n"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// --- Options et traitement de la requete
|
||||
$server->setSoapFeatures(SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$server->setClassmap($classmap);
|
||||
$server->setEncoding('UTF-8');
|
||||
$server->registerFaultException(array('Scores_Ws_Exception'));
|
||||
$server->setWsiCompliant(true);
|
||||
$server->setObject(new $serviceClassName());
|
||||
$server->handle();
|
||||
// --- Options et traitement de la requete
|
||||
$server->setSoapFeatures(SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$server->setClassmap($classmap);
|
||||
$server->setEncoding('UTF-8');
|
||||
$server->registerFaultException(array('Scores_Ws_Exception'));
|
||||
$server->setWsiCompliant(true);
|
||||
|
||||
// --- Pour débuggage ultime
|
||||
$debug = false;
|
||||
$debugUser = '';
|
||||
if ($debug && $_SERVER['PHP_AUTH_USER'] == $debugUser)
|
||||
{
|
||||
file_put_contents(APPLICATION_PATH . '/../debugcall.log',
|
||||
"FichierWSDL : ".$fichierWsdl."\n".
|
||||
"Hostname : ".$hostName."\n"
|
||||
);
|
||||
// --- Création du service
|
||||
$server->setObject(new $serviceClassName());
|
||||
$server->handle();
|
||||
|
||||
// --- Pour débuggage ultime
|
||||
$debug = false;
|
||||
$debugUser = '';
|
||||
if ($debug && $_SERVER['PHP_AUTH_USER'] == $debugUser) {
|
||||
file_put_contents(APPLICATION_PATH . '/../debugcall.log',
|
||||
"FichierWSDL : ".$fichierWsdl."\n"."Hostname : ".$hostName."\n");
|
||||
$request = $server->getLastRequest();
|
||||
file_put_contents(APPLICATION_PATH . '/../debugcall.log', $request . "\n", FILE_APPEND);
|
||||
$response = $server->getLastResponse();
|
||||
file_put_contents(APPLICATION_PATH . '/../debugcall.log', $response. "\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,56 +1,54 @@
|
||||
<?php
|
||||
class UserController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function loginAction()
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
}
|
||||
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/css/signin.css', 'all');
|
||||
public function loginAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Application_Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new Scores_Auth_Adapter_Db($login, $pass, true);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if ($result->isValid()) {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
$this->view->headLink()->appendStylesheet('/assets/themes/default/css/signin.css', 'all');
|
||||
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Application_Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new Scores_Auth_Adapter_Db($login, $pass, true);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if ($result->isValid()) {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
|
||||
$this->redirect('/');
|
||||
} else {
|
||||
$this->view->message = '';
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
}
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
|
||||
}
|
||||
}
|
||||
$this->redirect('/');
|
||||
} else {
|
||||
$this->view->message = '';
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function logoutAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
}
|
||||
|
||||
public function paramsAction()
|
||||
@ -63,9 +61,15 @@ class UserController extends Zend_Controller_Action
|
||||
$this->view->login = $login;
|
||||
$this->view->authorizationHeader = base64_encode($login.':'.$pass);
|
||||
|
||||
$userM = new Application_Model_Sdv1Utilisateurs();
|
||||
$sql = $userM->select()->where('id=?', $identity->id);
|
||||
$user = $userM->fetchRow($sql);
|
||||
/**
|
||||
* @var \Doctrine\DBAL\Connection $conn
|
||||
*/
|
||||
$conn = Zend_Registry::get('doctrine');
|
||||
$userSql = "SELECT * FROM sdv1.utilisateurs WHERE id=:id";
|
||||
$stmt = $conn->prepare($userSql);
|
||||
$stmt->bindValue('id', $identity->id);
|
||||
$stmt->execute();
|
||||
$user = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$this->view->IdFullName = $user->civilite . ' ' . $user->nom . ' ' . $user->prenom;
|
||||
$this->view->IdEmail = $user->email;
|
||||
@ -114,9 +118,9 @@ class UserController extends Zend_Controller_Action
|
||||
);
|
||||
|
||||
$display = array();
|
||||
foreach ( $listdroit as $droit ) {
|
||||
foreach ( $assoc as $l => $d ) {
|
||||
if ( in_array(strtoupper($droit), $d) ) {
|
||||
foreach ($listdroit as $droit) {
|
||||
foreach ($assoc as $l => $d) {
|
||||
if (in_array(strtoupper($droit), $d)) {
|
||||
$display[] = array(
|
||||
'label' => $l,
|
||||
'droit' => $droit,
|
||||
@ -125,7 +129,5 @@ class UserController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
$this->view->display = $display;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocComplement extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docComplement($method)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public function docComplement($method)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocDescription extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docDescription($method)
|
||||
{
|
||||
return $method['desc'];
|
||||
}
|
||||
}
|
||||
public function docDescription($method)
|
||||
{
|
||||
return $method['desc'];
|
||||
}
|
||||
}
|
||||
|
@ -1,31 +1,31 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docExemple($method)
|
||||
{
|
||||
$exemple = '';
|
||||
$langages = array(
|
||||
'php' => 'PHP',
|
||||
'java' => 'Java',
|
||||
'perl' => 'Perl',
|
||||
'python' => 'Python',
|
||||
'csharp' => 'C#'
|
||||
);
|
||||
public function docExemple($method)
|
||||
{
|
||||
$exemple = '';
|
||||
$langages = array(
|
||||
'php' => 'PHP',
|
||||
'java' => 'Java',
|
||||
'perl' => 'Perl',
|
||||
'python' => 'Python',
|
||||
'csharp' => 'C#'
|
||||
);
|
||||
|
||||
foreach ($langages as $langage => $lib){
|
||||
$fichier = 'assets/code/'.$method.'-'.$langage.'.txt';
|
||||
if (file_exists($fichier)){
|
||||
$url = $this->view->url(
|
||||
array(
|
||||
'controller' => 'documentation',
|
||||
'action' => 'code',
|
||||
'langage' => $langage,
|
||||
'element' => $method,
|
||||
), null, true);
|
||||
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
|
||||
$exemple.= ' ';
|
||||
}
|
||||
}
|
||||
return $exemple;
|
||||
}
|
||||
}
|
||||
foreach ($langages as $langage => $lib) {
|
||||
$fichier = 'assets/code/'.$method.'-'.$langage.'.txt';
|
||||
if (file_exists($fichier)) {
|
||||
$url = $this->view->url(
|
||||
array(
|
||||
'controller' => 'documentation',
|
||||
'action' => 'code',
|
||||
'langage' => $langage,
|
||||
'element' => $method,
|
||||
), null, true);
|
||||
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
|
||||
$exemple.= ' ';
|
||||
}
|
||||
}
|
||||
return $exemple;
|
||||
}
|
||||
}
|
||||
|
@ -1,61 +1,59 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocMethod extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
public function docMethod($method)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
public function docMethod($method)
|
||||
{
|
||||
$output = '';
|
||||
$returnType = $method['return'];
|
||||
$methodName = $method['name'];
|
||||
|
||||
$returnType = $method['return'];
|
||||
$methodName = $method['name'];
|
||||
$cptParameters = 0;
|
||||
$parameters = '';
|
||||
foreach ($method['params'] as $param) {
|
||||
if (isset($param['optional'])) {
|
||||
$parameters.= '[';
|
||||
}
|
||||
$parameters.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$parameters.= ' ';
|
||||
$parameters.= '<b>' . $param['name'] . '</b>';
|
||||
|
||||
$cptParameters = 0;
|
||||
$parameters = '';
|
||||
foreach ($method['params'] as $param) {
|
||||
if (isset($param['optional'])) {
|
||||
$parameters.= '[';
|
||||
}
|
||||
$parameters.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$parameters.= ' ';
|
||||
$parameters.= '<b>' . $param['name'] . '</b>';
|
||||
|
||||
if (isset($param['optional'])) {
|
||||
if (isset($param['defaultValue'])) {
|
||||
$parameters.= ' = ';
|
||||
if (is_bool($param['defaultValue'])){
|
||||
$parameters.= ($param['defaultValue'] === false) ? 'false' : 'true' ;
|
||||
} elseif (is_string($param['defaultValue']) && $param['defaultValue']==''){
|
||||
$parameters.= "''";
|
||||
} else {
|
||||
$parameters.= $param['defaultValue'];
|
||||
}
|
||||
}
|
||||
$parameters.= ']';
|
||||
}
|
||||
$cptParameters++;
|
||||
if ($cptParameters < count($method['params'])){
|
||||
$parameters.= ', ';
|
||||
}
|
||||
}
|
||||
$output = '<i>' . $this->transcodeType($returnType) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $methodName . '</b>' . ' <b>(</b> ' . $parameters . ' <b>)</b>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
if (isset($param['optional'])) {
|
||||
if (isset($param['defaultValue'])) {
|
||||
$parameters.= ' = ';
|
||||
if (is_bool($param['defaultValue'])) {
|
||||
$parameters.= ($param['defaultValue'] === false) ? 'false' : 'true' ;
|
||||
} elseif (is_string($param['defaultValue']) && $param['defaultValue']=='') {
|
||||
$parameters.= "''";
|
||||
} else {
|
||||
$parameters.= $param['defaultValue'];
|
||||
}
|
||||
}
|
||||
$parameters.= ']';
|
||||
}
|
||||
$cptParameters++;
|
||||
if ($cptParameters < count($method['params'])) {
|
||||
$parameters.= ', ';
|
||||
}
|
||||
}
|
||||
$output = '<i>' . $this->transcodeType($returnType) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $methodName . '</b>' . ' <b>(</b> ' . $parameters . ' <b>)</b>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if (array_key_exists($type, $this->_transcodeType)) {
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,81 +1,80 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'int', 'integer', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'int', 'integer', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docParameter($params, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
$output = '';
|
||||
if (count($params)>0) {
|
||||
$output.= '<ul>';
|
||||
foreach ($params as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
public function docParameter($params, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
$output = '';
|
||||
if (count($params)>0) {
|
||||
$output.= '<ul>';
|
||||
foreach ($params as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '';
|
||||
} elseif ($type == 'void') {
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
if (!in_array($param['type'], $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
if (!in_array($param['type'], $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if (array_key_exists($type, $this->_transcodeType)) {
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,74 +1,73 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocReturn extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'integer', 'int', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'integer', 'int', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docReturn($type, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
return $this->parseType($type);
|
||||
}
|
||||
public function docReturn($type, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
return $this->parseType($type);
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '<i>' . $type . '</i> ';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '<i>' . $type . '</i> ';
|
||||
} elseif ($type == 'void') {
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>'. $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
$type = str_replace('[]', '', $param['type']);
|
||||
if (!in_array($type, $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>'. $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
$type = str_replace('[]', '', $param['type']);
|
||||
if (!in_array($type, $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if (array_key_exists($type, $this->_transcodeType)) {
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function profileLink()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
public function profileLink()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->username;
|
||||
$logoutUrl = $this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'logout'
|
||||
'controller' => 'user',
|
||||
'action' => 'logout'
|
||||
), null, true);
|
||||
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,11 +25,11 @@
|
||||
<div class="panel-body">
|
||||
<ol>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@ -60,6 +60,7 @@
|
||||
|
||||
<h5>Retour</h5>
|
||||
<div class="bs-callout bs-callout-php">
|
||||
<?php if ($method['returnDesc'] != '') {?><?=$method['returnDesc']?><br/><br/><?php }?>
|
||||
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
|
||||
</div>
|
||||
|
||||
|
@ -1,28 +1,18 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Zend Framework Default Application</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?php echo $this->message ?></h2>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?php echo $this->message ?></h2>
|
||||
|
||||
<?php if (isset($this->exception)): ?>
|
||||
<?php if (isset($this->exception)): ?>
|
||||
|
||||
<h3>Exception information:</h3>
|
||||
<p>
|
||||
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
|
||||
</p>
|
||||
<h3>Exception information:</h3>
|
||||
<p>
|
||||
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
|
||||
</p>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
<pre><?php echo $this->exception->getTraceAsString() ?>
|
||||
</pre>
|
||||
<h3>Stack trace:</h3>
|
||||
<pre><?php echo $this->exception->getTraceAsString() ?>
|
||||
</pre>
|
||||
|
||||
<h3>Request Parameters:</h3>
|
||||
<pre><?php echo var_export($this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<?php endif ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<h3>Request Parameters:</h3>
|
||||
<pre><?php echo var_export($this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<?php endif ?>
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
<form class="form-signin" method="<?=$this->form->getMethod()?>" action="<?=$this->form->getAction()?>">
|
||||
<h2 class="form-signin-heading">Web Service API</h2>
|
||||
<div style="text-align:center;"><p class="text-danger"><span><?=$this->message?></span></p></div>
|
||||
<input name="login" value="<?=$this->form->getValue('login')?>" type="text" class="form-control" placeholder="Identifiant" autofocus>
|
||||
<input name="pass" value="<?=$this->form->getValue('pass')?>" type="password" class="form-control" placeholder="Mot de passe">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit">Connexion</button>
|
||||
|
50
bin/buildTypes.php
Normal file
50
bin/buildTypes.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => "Aide.",
|
||||
'path=s' => "{Service Name}/{version}",
|
||||
));
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Aide / Options
|
||||
if ($optionsNb == 0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo "\nType Service\n\n";
|
||||
echo $opts->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$wsPath = APPLICATION_PATH . '/../library/WsScore/';
|
||||
|
||||
require_once $wsPath . $opts->path . '/Types.php';
|
||||
$detect = new Zend_Reflection_File($wsPath . $opts->path . '/Types.php');
|
||||
$result = $detect->getClasses();
|
||||
|
||||
$outPath = dirname($wsPath . $opts->path . '/Types.php');
|
||||
$outFile = $outPath . '/Config.php';
|
||||
|
||||
if (count($result) > 0) {
|
||||
file_put_contents($outFile, "<?php\n");
|
||||
file_put_contents($outFile, "return array(\n", FILE_APPEND);
|
||||
foreach ($result as $c) {
|
||||
file_put_contents($outFile, "\t'". $c->name . "' => '" . $c->name ."',\n", FILE_APPEND);
|
||||
}
|
||||
file_put_contents($outFile, ");\n", FILE_APPEND);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
60
bin/cleanTemp.php
Normal file
60
bin/cleanTemp.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
|
||||
$typesFichier = array('csv', 'fichiers', 'clients', 'kbis');
|
||||
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => 'Displays usage information.',
|
||||
'all' => 'Execute toutes les actions (cron).',
|
||||
'type=w' => 'Supprime uniquement les fichiers indiqués.',
|
||||
));
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Aide / Options
|
||||
if ($optionsNb == 0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo $opts->getUsageMessage();
|
||||
?>
|
||||
|
||||
Types de fichier disponibles : <?php echo join(', ', $typesFichier)?>
|
||||
|
||||
<?php
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($opts->all || $opts->type)
|
||||
{
|
||||
foreach ($typesFichier as $dir)
|
||||
{
|
||||
if ($opts->all || $opts->type==$dir ){
|
||||
removeFileInDir(LOG_PATH.'/'.$dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function removeFileInDir($dir)
|
||||
{
|
||||
if (is_dir($dir)) {
|
||||
if ($dh = opendir($dir)) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
unlink($dir . $file);
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,39 +1,29 @@
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Affiche l'aide.",
|
||||
'list' => "Liste les actes en attente disponible sur le FTP et affiche les informations",
|
||||
'get-s' => "Recupère seulement les actes du FTP (un seul document si la référence est spécifier G<NNN> )",
|
||||
'send-s' => "Récupère les actes et envoi un mail à chaque client (un seul acte si la référence est spécifier G<NNN>)",
|
||||
'type-s' => "Type de document : bilan, acte",
|
||||
'control' => "Control",
|
||||
)
|
||||
);
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => "Affiche l'aide.",
|
||||
'list' => "Liste les actes en attente disponible sur le FTP et affiche les informations",
|
||||
'get-s' => "Recupère seulement les actes du FTP (un seul document si la référence est spécifier G<NNN> )",
|
||||
'send-s' => "Récupère les actes et envoi un mail à chaque client (un seul acte si la référence est spécifier G<NNN>)",
|
||||
'type-s' => "Type de document : bilan, acte",
|
||||
));
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
{
|
||||
// --- Aide / Options
|
||||
if ($optionsNb == 0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo "Vérifie les actes numérisés reçus en provenance des Greffes.";
|
||||
echo "\n\n";
|
||||
echo $opts->getUsageMessage();
|
||||
@ -41,9 +31,6 @@ if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $c);
|
||||
|
||||
$testMail = false;
|
||||
|
||||
$test = false;
|
||||
@ -53,13 +40,12 @@ if (isset($opts->list)){
|
||||
|
||||
$types = array('bi', 'ac');
|
||||
|
||||
//Configuration FTP
|
||||
define ('ACTES_IGNUM_FTP_URL', '192.168.3.202');
|
||||
// Configuration FTP
|
||||
define ('ACTES_IGNUM_FTP_URL', 'ftp.scores-decisions.com');
|
||||
define ('ACTES_IGNUM_FTP_USER', 'mpc2500');
|
||||
define ('ACTES_IGNUM_FTP_PASS', 'passmpc78');
|
||||
define ('ACTES_IGNUM_LOCAL_DIR', $c->profil->path->shared.'/files/');
|
||||
|
||||
define ('PATH_DATA', $c->profil->infogreffe->storage->path);
|
||||
$pathIn = $c->profil->path->shared.'/files';
|
||||
|
||||
$report_email = $c->profil->mail->email->support;
|
||||
$report_subject = 'Traitement des actes '.date('Y-m-d H:i:s');
|
||||
@ -129,8 +115,8 @@ function sendMail($commande, $type){
|
||||
$message.= "Save paper - think before you print";
|
||||
$message.= "\n";
|
||||
|
||||
$headers = 'From: infoslegales@scores-decisions.com' . "\r\n" .
|
||||
'Reply-To: infoslegales@scores-decisions.com';
|
||||
$headers = 'From: support@scores-decisions.com' . "\r\n" .
|
||||
'Reply-To: support@scores-decisions.com';
|
||||
|
||||
if ( mail(strtolower($commande->email), $subject, utf8_decode($message), $headers) ){
|
||||
echo date ('Y/m/d - H:i:s').' - Un email a été envoyé à '.$commande->email." pour la commande ".$commande->id.".\n";
|
||||
@ -141,103 +127,32 @@ function sendMail($commande, $type){
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connexion à la base de données
|
||||
*/
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table_Abstract::setDefaultAdapter($db);
|
||||
|
||||
/**
|
||||
* List actes files and check if an entry exist in the database
|
||||
* greffes/actes/AAAA/MM
|
||||
* preg_match('/^acte-([0-9]{9})-(ST)-([0-9]{8})-.*\.pdf/', $fichier, $matches)
|
||||
* preg_match('/^acte-([0-9]{9})-([0-9a-zA-Z]{1,})-([0-9]{8})-.*-([0-9]{2})\.pdf/', $fichier, $matches)
|
||||
*/
|
||||
if ($opts->control) {
|
||||
|
||||
$dir = PATH_DATA.'/greffes/actes';
|
||||
if (is_dir($dir)) {
|
||||
if ($dh = opendir($dir)) {
|
||||
//Annee
|
||||
while (($anneeDir = readdir($dh)) !== false) {
|
||||
if ($anneeDir != '.' || $anneeDir != '..') {
|
||||
echo "Dir ".$dir . DIRECTORY_SEPARATOR . $anneeDir."\n";
|
||||
if ($dhAnneeDir = opendir($dir . DIRECTORY_SEPARATOR . $anneeDir)) {
|
||||
//Mois
|
||||
while (($moisDir = readdir($dhAnneeDir)) !== false) {
|
||||
echo "Dir ".$dir . DIRECTORY_SEPARATOR . $anneeDir . DIRECTORY_SEPARATOR . $moisDir."\n";
|
||||
if ($moisDir != '.' || $moisDir != '..') {
|
||||
//Fichier
|
||||
if ($dhFile = opendir($dir . DIRECTORY_SEPARATOR . $anneeDir . DIRECTORY_SEPARATOR . $moisDir)) {
|
||||
while (($file = readdir($dhFile)) !== false) {
|
||||
if ($file != '.' || $file != '..') {
|
||||
|
||||
if (preg_match('/^acte-([0-9]{9})-([0-9a-zA-Z]{1,})-([0-9]{8})-.*-([0-9]{2})\.pdf/', $file, $matches)) {
|
||||
$siren = $matches[1];
|
||||
$type = $matches[2];
|
||||
$date = $matches[3];
|
||||
$num = $matches[4];
|
||||
$actesM = new Application_Model_ActesFiles();
|
||||
$sql = $actesM->select()
|
||||
->where('siren=?', $siren)
|
||||
->where('type=?', $type)
|
||||
->where('date=?', $date)
|
||||
->where('num=?', $num);
|
||||
$result = $actesM->fetchRow($sql);
|
||||
if ( null === $result ) {
|
||||
echo "Insert $file\n";
|
||||
$actesM->insert(array(
|
||||
'siren' => $siren,
|
||||
'type' => $type,
|
||||
'date' => $date,
|
||||
'num' => $num,
|
||||
'file' => $file,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
closedir($dhFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dhAnneeDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des commandes non traités depuis la base de données
|
||||
*/
|
||||
$acM = new Application_Model_Sdv1GreffeCommandesAc();
|
||||
$biM = new Application_Model_Sdv1GreffeCommandesBi();
|
||||
$tabCommandes = array();
|
||||
if (in_array('ac', $types)) {
|
||||
$sql = $acM->select()
|
||||
->where('mode=?','C')
|
||||
->where('dateCommande!=?', '0000-00-00 00:00:00')
|
||||
->where('dateEnvoi=?', '0000-00-00 00:00:00');
|
||||
$rows = $acM->fetchAll($sql);
|
||||
if (count($rows)>0) {
|
||||
foreach ($rows as $row) {
|
||||
$tabCommandes['G-AC-'.$row->id] = $row;
|
||||
}
|
||||
$sql = "SELECT * FROM sdv1.greffe_commandes_ac WHERE mode=:mode AND dateCommande!=:commande AND dateEnvoi=:envoi";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue('mode', 'C');
|
||||
$stmt->bindValue('commande', '0000-00-00 00:00:00');
|
||||
$stmt->bindValue('envoi', '0000-00-00 00:00:00');
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$tabCommandes['G-AC-'.$row->id] = $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (in_array('bi', $types)) {
|
||||
$sql = $biM->select()
|
||||
->where('mode=?','C')
|
||||
->where('dateCommande!=?', '0000-00-00 00:00:00')
|
||||
->where('dateEnvoi=?', '0000-00-00 00:00:00');
|
||||
$rows = $biM->fetchAll($sql);
|
||||
if (count($rows)>0) {
|
||||
foreach ($rows as $row) {
|
||||
$sql = "SELECT * FROM sdv1.greffe_commandes_bi WHERE mode=:mode AND dateCommande!=:commande AND dateEnvoi=:envoi";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue('mode', 'C');
|
||||
$stmt->bindValue('commande', '0000-00-00 00:00:00');
|
||||
$stmt->bindValue('envoi', '0000-00-00 00:00:00');
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() > 0) {
|
||||
while ($row = $stmt->fetch(\PDO::FETCH_OBJ)) {
|
||||
$tabCommandes['G-BI-'.$row->id] = $row;
|
||||
}
|
||||
}
|
||||
@ -258,7 +173,12 @@ if (!$login_result) {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de s'authentifier sur le serveur FTP (".ACTES_IGNUM_FTP_URL.")!\n";
|
||||
exit;
|
||||
}
|
||||
ftp_pasv($conn_id, true);
|
||||
$contents = ftp_nlist($conn_id, "*.pdf");
|
||||
if ($contents === false) {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de se connecter au serveur FTP (".ACTES_IGNUM_FTP_URL.") !\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste de tout les fichiers disponible dans le repertoire
|
||||
@ -269,8 +189,7 @@ foreach ($contents as $filename){
|
||||
$indice = 0;
|
||||
$f = strtolower($filename);
|
||||
if (preg_match('/g-(ac|bi)-[0-9]+\.pdf/', $f)
|
||||
|| preg_match('/g-(ac|bi)-[0-9]+-[0-9]{1,2}\.pdf/', $f)){
|
||||
|
||||
|| preg_match('/g-(ac|bi)-[0-9]+-[0-9]{1,2}\.pdf/', $f)) {
|
||||
$part = substr(str_replace('.pdf', '', $f), 5);
|
||||
$p = strpos($part, '-');
|
||||
if ( $p === false ) {
|
||||
@ -281,10 +200,10 @@ foreach ($contents as $filename){
|
||||
$indice = substr($part, $p+1);
|
||||
}
|
||||
$tabFichiersFtp[strtoupper($ref).'-'.$indice] = $filename;
|
||||
|
||||
}
|
||||
// Fichiers en anomalies
|
||||
} else {
|
||||
if ($test){
|
||||
else {
|
||||
if ($test) {
|
||||
echo "Erreur : Anomalie fichier numérisé $filename\n";
|
||||
} else {
|
||||
$subject = "Erreur : Anomalie fichier numérisé";
|
||||
@ -310,12 +229,10 @@ krsort($tabFichiersFtp);
|
||||
*/
|
||||
$lastRef = '';
|
||||
$tabFichiersTemp = array();
|
||||
foreach($tabFichiersFtp as $k => $val)
|
||||
{
|
||||
|
||||
foreach($tabFichiersFtp as $k => $val) {
|
||||
$part = substr($k, 5);
|
||||
$p = strpos($part, '-');
|
||||
if ( $p === false ) {
|
||||
if ($p === false) {
|
||||
$ref = substr($k, 0, 5) . $part;
|
||||
} else {
|
||||
$ref = substr($k, 0, 5) . substr($part, 0, $p);
|
||||
@ -334,84 +251,74 @@ unset($tabFichiersTemp);
|
||||
* Pour chaque commande, test de la présence d'un fichier associé
|
||||
* Si le fichier correspond téléchargement du fichier
|
||||
*/
|
||||
foreach ( $tabCommandes as $ref => $commande ) {
|
||||
foreach ( $tabFichiers as $refAssocie => $fichier ) {
|
||||
|
||||
if ( $ref == $refAssocie ) {
|
||||
foreach ($tabCommandes as $ref => $commande) {
|
||||
foreach ($tabFichiers as $refAssocie => $fichier) {
|
||||
|
||||
if ($ref == $refAssocie) {
|
||||
echo date ('Y/m/d - H:i:s')." - Traitement de la commande $ref\n";
|
||||
|
||||
if ( $test ) {
|
||||
|
||||
if ($test) {
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier $fichier \n";
|
||||
|
||||
} else {
|
||||
|
||||
//Récupération du fichier depuis le FTP (s'il n'existe pas déjà)
|
||||
if ( !file_exists(ACTES_IGNUM_LOCAL_DIR.$fichier) ) {
|
||||
if (ftp_get($conn_id, ACTES_IGNUM_LOCAL_DIR.$fichier, $fichier, FTP_BINARY, 0)) {
|
||||
// Récupération du fichier depuis le FTP (s'il n'existe pas déjà)
|
||||
if (!file_exists($pathIn.'/'.$fichier)) {
|
||||
if (ftp_get($conn_id, $pathIn.'/'.$fichier, $fichier, FTP_BINARY, 0)) {
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier $fichier téléchargé depuis le serveur FTP.\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." - ERREUR : Impossible de télécharger le fichier $fichier !\n";
|
||||
}
|
||||
}
|
||||
|
||||
switch ( substr($ref,2,2) ) {
|
||||
|
||||
switch (substr($ref,2,2)) {
|
||||
case 'BI':
|
||||
|
||||
$infogreffe = new SdMetier_Infogreffe_DocBI($commande->siren);
|
||||
$infogreffe = new Metier_Infogreffe_DocBI();
|
||||
$infogreffe->setSiren($commande->siren);
|
||||
//Format date cloture
|
||||
$dateCloture = substr($commande->bilanCloture,0,4) . '-' .
|
||||
substr($commande->bilanCloture,5,2) . '-' .
|
||||
substr($commande->bilanCloture,8,2);
|
||||
$path = $infogreffe->getFilePath($commande->bilanType, $dateCloture);
|
||||
$nomCible = $infogreffe->getFileName($commande->bilanType, $dateCloture);
|
||||
|
||||
$fileOut = PATH_DATA.'/'.$path.'/'.$nomCible;
|
||||
$fileOut = $c->profil->infogreffe->storage->path.'/'.$path.'/'.$nomCible;
|
||||
|
||||
$isFileOnStorage = false;
|
||||
|
||||
if ( file_exists($fileOut) ) {
|
||||
if (file_exists($fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
} else {
|
||||
if ( copy(ACTES_IGNUM_LOCAL_DIR.$fichier, $fileOut) ) {
|
||||
if (copy($pathIn.'/'.$fichier, $fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déplacé en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déplacé en ".$fileOut.".\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".ACTES_IGNUM_LOCAL_DIR.$fichier." en ".$fileOut." !\n";
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".$pathIn.'/'.$fichier." en ".$fileOut." !\n";
|
||||
}
|
||||
}
|
||||
|
||||
// --- Lecture présence référence bilan
|
||||
$bilanM = new Application_Model_JoGreffesBilans();
|
||||
$sql = $bilanM->select()
|
||||
->where('siren=?',$commande->siren)
|
||||
->where('date_cloture=?', $dateCloture);
|
||||
if ($commande->bilanType=='sociaux') {
|
||||
$sql->where('type_comptes="" OR type_comptes="sociaux"');
|
||||
$sql = "SELECT * FROM jo.greffes_bilans WHERE siren=:siren AND date_cloture=:cloture AND type_comptes='' OR type_comptes='sociaux'";
|
||||
} else {
|
||||
$sql->where('type_comptes="consolides"');
|
||||
$sql = "SELECT * FROM jo.greffes_bilans WHERE siren=:siren AND date_cloture=:cloture AND type_comptes='consolides'";
|
||||
}
|
||||
$item = $bilanM->fetchRow($sql);
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $commande->siren);
|
||||
$stmt->bindValue('cloture', $dateCloture);
|
||||
$stmt->execute();
|
||||
$item = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
// --- Enregistrement
|
||||
if ( $isFileOnStorage && $item->pdfDate == '0000-00-00' ) {
|
||||
if ($isFileOnStorage && $item->pdfDate == '0000-00-00') {
|
||||
$infos = $infogreffe->pdfInfos($fileOut);
|
||||
if (false !== $infos) {
|
||||
$data = array(
|
||||
'pdfLink' => $nomCible,
|
||||
'pdfSize' => $infos['size'],
|
||||
'pdfPage' => $infos['pages'],
|
||||
'pdfVer' => $infos['version'],
|
||||
'pdfDate' => date('Ymd'),
|
||||
'pdfPage' => $infos['pages'],
|
||||
'pdfVer' => $infos['version'],
|
||||
'pdfDate' => date('Ymd'),
|
||||
);
|
||||
try {
|
||||
$result = $bilanM->update($data, 'id='.$item->id);
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
echo $e->getMessage();
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
$conn->update('jo.greffes_bilans', $data, array('id' => $item->id));
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
@ -419,38 +326,23 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
break;
|
||||
|
||||
case 'AC':
|
||||
$sql = "SELECT id, siren, numRC, LPAD(numGreffe,4,0) AS numGreffe, pdfLink,
|
||||
pdfSize, pdfPage, pdfDate, num_depot, date_depot, date_acte,
|
||||
LPAD(num_acte,2,0) AS num_acte, type_acte, type_acte_libelle,
|
||||
nbpages_acte, decision_nature, decision_libelle FROM jo.greffes_actes
|
||||
WHERE siren=:siren AND num_depot=:depot AND num_acte=:acte AND type_acte=:type";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bindValue('siren', $commande->siren);
|
||||
$stmt->bindValue('depot', $commande->depotNum);
|
||||
$stmt->bindValue('acte', $commande->acteNum);
|
||||
$stmt->bindValue('type', $commande->acteType);
|
||||
$stmt->execute();
|
||||
$item = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$acteM = new Application_Model_JoGreffesActes();
|
||||
$sql = $acteM->select()
|
||||
->from($acteM, array(
|
||||
'id',
|
||||
'siren',
|
||||
'numRC',
|
||||
'LPAD(numGreffe,4,0) AS numGreffe',
|
||||
'pdfLink',
|
||||
'pdfSize',
|
||||
'pdfPage',
|
||||
'pdfDate',
|
||||
'num_depot',
|
||||
'date_depot',
|
||||
'date_acte',
|
||||
'LPAD(num_acte,2,0) AS num_acte',
|
||||
'type_acte',
|
||||
'type_acte_libelle',
|
||||
'nbpages_acte',
|
||||
'decision_nature',
|
||||
'decision_libelle',
|
||||
'mode_diffusion'
|
||||
))
|
||||
->where('siren=?', $commande->siren)
|
||||
->where('num_depot=?', $commande->depotNum)
|
||||
->where('num_acte=?', $commande->acteNum)
|
||||
->where('type_acte=?',$commande->acteType);
|
||||
$item = $acteM->fetchRow($sql);
|
||||
|
||||
$infogreffe = new SdMetier_Infogreffe_DocAC($commande->siren);
|
||||
$infogreffe = new Metier_Infogreffe_DocAC();
|
||||
$infogreffe->setSiren($commande->siren);
|
||||
$date = $commande->acteDate;
|
||||
if ( $date == '0000-00-00' ) {
|
||||
if ($date == '0000-00-00') {
|
||||
$date = $commande->depotDate;
|
||||
}
|
||||
|
||||
@ -459,23 +351,23 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
$options = $item->numGreffe . '-' . substr($item->numRC,0,2) . '-' . substr($item->numRC,2,1) . '-' . substr($item->numRC,3) . '-' . $item->num_depot;
|
||||
$nomCible = $infogreffe->getFileName($date, $commande->acteNum, $commande->acteType, $options);
|
||||
|
||||
$fileOut = PATH_DATA.'/'.$path.'/'.$nomCible;
|
||||
$fileOut = $c->profil->infogreffe->storage->path.'/'.$path.'/'.$nomCible;
|
||||
|
||||
$isFileOnStorage = false;
|
||||
|
||||
if ( file_exists($fileOut) ) {
|
||||
if (file_exists($fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déjà présent en ".$fileOut.".\n";
|
||||
} else {
|
||||
if ( copy(ACTES_IGNUM_LOCAL_DIR.$fichier, $fileOut) ) {
|
||||
if (copy($pathIn.'/'.$fichier, $fileOut)) {
|
||||
$isFileOnStorage = true;
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".ACTES_IGNUM_LOCAL_DIR.$fichier." déplacé en ".$fileOut.".\n";
|
||||
echo date ('Y/m/d - H:i:s')." - Fichier ".$pathIn.'/'.$fichier." déplacé en ".$fileOut.".\n";
|
||||
} else {
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".ACTES_IGNUM_LOCAL_DIR.$fichier." en ".$fileOut." !\n";
|
||||
echo date ('Y/m/d - H:i:s')." ERREUR - Impossible de déplacer ".$pathIn.'/'.$fichier." en ".$fileOut." !\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ( $isFileOnStorage && $item->pdfDate == '0000-00-00' ) {
|
||||
if ($isFileOnStorage && $item->pdfDate == '0000-00-00') {
|
||||
$infos = $infogreffe->pdfInfos($fileOut);
|
||||
if ( false !== $infos ) {
|
||||
$data = array(
|
||||
@ -486,11 +378,9 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
'pdfDate' => date('Ymd'),
|
||||
);
|
||||
try {
|
||||
$result = $acteM->update($data, 'id='.$item->id);
|
||||
$conn->update('jo.greffes_actes', $data, array('id' => $item->id));
|
||||
echo " = enregistrement.\n";
|
||||
} catch(Zend_Db_Adapter_Exception $e) {
|
||||
echo $e->getMessage();
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
} catch(\Doctrine\DBAL\DBALException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
@ -499,8 +389,8 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
break;
|
||||
}
|
||||
|
||||
//Envoi du mail et Mise à jour de la commande
|
||||
if ( file_exists($fileOut) ) {
|
||||
// Envoi du mail et Mise à jour de la commande
|
||||
if (file_exists($fileOut)) {
|
||||
if ( $testMail ) {
|
||||
echo "Envoi fichier $nomCible ($ref) à ".$commande->email;
|
||||
} else {
|
||||
@ -515,13 +405,12 @@ foreach ( $tabCommandes as $ref => $commande ) {
|
||||
$data = array( 'dateEnvoi' => date('YmdHis'));
|
||||
switch ( substr($ref,2,2) ) {
|
||||
case 'BI':
|
||||
$commandesM = new Application_Model_Sdv1GreffeCommandesBi();
|
||||
$conn->update('sdv1.greffe_commandes_bi', $data, array('id' => $commande->id));
|
||||
break;
|
||||
case 'AC':
|
||||
$commandesM = new Application_Model_Sdv1GreffeCommandesAc();
|
||||
$conn->update('sdv1.greffe_commandes_ac', $data, array('id' => $commande->id));
|
||||
break;
|
||||
}
|
||||
$commandesM->update($data, 'id='.$commande->id);
|
||||
echo date ('Y/m/d - H:i:s')." - Commande $ref mise à jour\n";
|
||||
$report_txt.= ' - Email envoyé à '.$commande->email;
|
||||
} else {
|
||||
@ -543,6 +432,7 @@ if (empty($report_txt)) {
|
||||
|
||||
//Envoi du mail de rapport
|
||||
if (!$test && !$testMail){
|
||||
$headers = 'From: supportdev@scores-decisions.com';
|
||||
if (mail($report_email, $report_subject, utf8_decode($report_txt))){
|
||||
echo date ('Y/m/d - H:i:s')." - Rapport envoyé.\n";
|
||||
} else {
|
@ -1,19 +1,9 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
@ -26,30 +16,31 @@ try {
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $c);
|
||||
|
||||
if ( isset($opts->debug) ) {
|
||||
define('DEBUG', true);
|
||||
} else {
|
||||
define('DEBUG', false);
|
||||
// --- Aide / Options
|
||||
if ($optionsNb == 0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
{
|
||||
echo "Telecharge le kbis chez infogreffe.";
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo "Telecharge le kbis chez infogreffe.";
|
||||
echo "\n\n";
|
||||
echo $opts->getUsageMessage();
|
||||
echo "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( isset($opts->debug) ) {
|
||||
define('DEBUG', true);
|
||||
} else {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
|
||||
function getPageHeader($start,$end,$header)
|
||||
{
|
||||
$pattern = '/'. $start .'(.*)'. $end .'/';
|
||||
@ -351,8 +342,6 @@ if ( $opts->commandes )
|
||||
echo "Téléchargement du kbis...\n";
|
||||
infogreffeKbis($opts->visu);
|
||||
|
||||
//Lancer WKHTMLTOPDF pour le PDF
|
||||
|
||||
} elseif ( !$opts->visu ) {
|
||||
|
||||
/**************************************************
|
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
/**
|
||||
* User-Agent
|
||||
* IE 11.0 : Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
|
||||
@ -7,20 +9,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
// --- Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(__DIR__ . '/../../application'));
|
||||
|
||||
// --- Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// --- Composer autoload
|
||||
require_once realpath(__DIR__ . '/../../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
@ -33,23 +21,19 @@ try {
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
$c = new Zend_Config($application->getOptions());
|
||||
Zend_Registry::set('config', $c);
|
||||
|
||||
if ( isset($opts->debug) ) {
|
||||
define('DEBUG', true);
|
||||
} else {
|
||||
define('DEBUG', false);
|
||||
// --- Aide / Options
|
||||
if ($optionsNb == 0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
{
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo "Telecharge le kbis chez infogreffe.";
|
||||
echo "\n\n";
|
||||
echo $opts->getUsageMessage();
|
||||
@ -57,6 +41,12 @@ if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( isset($opts->debug) ) {
|
||||
define('DEBUG', true);
|
||||
} else {
|
||||
define('DEBUG', false);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
338 437 189
|
56
bin/sql2csv.php
Normal file
56
bin/sql2csv.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/bin.bootstrap.php';
|
||||
|
||||
// --- Options
|
||||
$displayUsage = false;
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(array(
|
||||
'help|?' => "Displays usage information.",
|
||||
'sqlfile=s' => "",
|
||||
'csvfile=s' => "",
|
||||
));
|
||||
$opts->parse();
|
||||
$optionsNb = count($opts->getOptions());
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Aide / Options
|
||||
if (count($opts->getOptions())==0 || isset($opts->help)) {
|
||||
$displayUsage = true;
|
||||
}
|
||||
|
||||
// --- Usage
|
||||
if ($displayUsage) {
|
||||
echo "Génération d'un fichier CSV à partir d'un fichier SQL.\n";
|
||||
echo $opts->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
use League\Csv\Writer;
|
||||
|
||||
$sql = file_get_contents($opts->sqlfile);
|
||||
|
||||
//we fetch the info from a DB using a PDO object
|
||||
$stmt = $conn->executeQuery($sql);
|
||||
|
||||
if ($stmt->rowCount() == 0) {
|
||||
file_put_contents($opts->csvfile, "");
|
||||
}
|
||||
else {
|
||||
$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
// Create the CSV
|
||||
$csv = Writer::createFromPath($opts->csvfile.'.tmp', 'w');
|
||||
$csv->setNewline("\r\n");
|
||||
$csv->setOutputBOM(Writer::BOM_UTF8);
|
||||
|
||||
// Insert the CSV header
|
||||
$csv->insertOne(array_keys($rows[0]));
|
||||
|
||||
// Insert all data
|
||||
$csv->insertAll($rows);
|
||||
|
||||
// Set the real name of file
|
||||
rename($opts->csvfile.'.tmp', $opts->csvfile);
|
||||
}
|
33
composer-develop.json
Normal file
33
composer-develop.json
Normal file
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "scores/webservice",
|
||||
"description": "Webservice API",
|
||||
"require": {
|
||||
"zendframework/zendframework1": "^1.12",
|
||||
"geshi/geshi": "dev-master",
|
||||
"league/csv": "^8.1",
|
||||
"doctrine/dbal": "^2.5",
|
||||
"mikehaertl/phpwkhtmltopdf": "^2.2",
|
||||
"guzzlehttp/guzzle": "^6.2",
|
||||
"monolog/monolog": "^1.22",
|
||||
"scores/library": "dev-develop"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "git@gitlab.factory.insight.doubletrade.com:scores/library.git"
|
||||
}
|
||||
],
|
||||
"include-path": ["library/"],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"application/",
|
||||
"library/Application/"
|
||||
]
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Scores et Decisions",
|
||||
"email": "supportdev@scores-decisions.com"
|
||||
}
|
||||
]
|
||||
}
|
@ -2,15 +2,26 @@
|
||||
"name": "scores/webservice",
|
||||
"description": "Webservice API",
|
||||
"require": {
|
||||
"zendframework/zendframework1": "^1.12"
|
||||
"zendframework/zendframework1": "^1.12",
|
||||
"geshi/geshi": "dev-master",
|
||||
"league/csv": "^8.1",
|
||||
"doctrine/dbal": "^2.5",
|
||||
"mikehaertl/phpwkhtmltopdf": "^2.2",
|
||||
"guzzlehttp/guzzle": "^6.2",
|
||||
"monolog/monolog": "^1.22",
|
||||
"scores/library": "dev-master"
|
||||
},
|
||||
"repositories": [
|
||||
{
|
||||
"type": "git",
|
||||
"url": "git@gitlab.factory.insight.doubletrade.com:scores/library.git"
|
||||
}
|
||||
],
|
||||
"include-path": ["library/"],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"application/",
|
||||
"library/Application/",
|
||||
"library/Scores/",
|
||||
"library/SdMetier/"
|
||||
"library/Application/"
|
||||
]
|
||||
},
|
||||
"authors": [
|
||||
|
1105
composer.lock
generated
1105
composer.lock
generated
File diff suppressed because it is too large
Load Diff
163
docs/README
Normal file
163
docs/README
Normal file
@ -0,0 +1,163 @@
|
||||
WebService
|
||||
==========
|
||||
|
||||
- Créer le vhost, voir le fichier VHOST pour les exemples
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName webservice.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
<IfModule mod_xsendfile.c>
|
||||
XSendFile On
|
||||
XSendFilePath /home/vhosts/webservice/shared
|
||||
</IfModule>
|
||||
|
||||
DocumentRoot /home/vhosts/webservice/public
|
||||
<Directory /home/vhosts/webservice/public/>
|
||||
EnableSendfile Off
|
||||
AllowOverride none
|
||||
Require all granted
|
||||
<Files ~ "^\.user.ini">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/public/assets/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog ${APACHE_LOG_DIR}/webservice-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webservice-access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
- Installer les librairies avec composer
|
||||
|
||||
$ composer install
|
||||
|
||||
|
||||
- Configurer l'application
|
||||
|
||||
La config (fichier application.ini) est à placer dans "application/configs/"
|
||||
|
||||
Exemple de la config dans "docs/config/application.ini" (Modifier selon les besoins)
|
||||
|
||||
|
||||
- APPLICATION_ENV
|
||||
|
||||
Différent niveau peuvent être utilisé dans l'application pour gérer les erreurs et le comportement.
|
||||
|
||||
production
|
||||
staging
|
||||
development
|
||||
testing
|
||||
|
||||
Cette variable est accessible dans PHP.
|
||||
|
||||
. mod_php
|
||||
|
||||
Add in <VirtualHost/>
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
|
||||
. php-fpm
|
||||
|
||||
Add a file in document root path (public/) a file .user.ini
|
||||
env[APPLICATION_ENV] = "development"
|
||||
|
||||
See the .user.ini file
|
||||
|
||||
|
||||
- Créer les repertoires de données nécessaires
|
||||
|
||||
[WORKSPACE]/data/webservice/
|
||||
- cache
|
||||
- logs
|
||||
- sessions
|
||||
- wsdl
|
||||
- files
|
||||
- greffes
|
||||
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
Obtenir les WSDL
|
||||
Pour le service Entreprise
|
||||
|
||||
- En mode développement : http://hostname/entreprise/version?wsdl-auto
|
||||
- Générer le WSDL : http://hostname/entreprise/version?wsdl-generate
|
||||
- Utiliser le WSDL généré : http://hostname/entreprise/version?wsdl
|
||||
|
||||
Pour le service Interne
|
||||
|
||||
http://hostname/interne/version?wsdl
|
||||
|
||||
Pour les clients
|
||||
|
||||
http://hostname/clients/nom_du_client/version?wsdl
|
||||
|
||||
N.B : Le fichier WSDL est généré automatiquement en appelant
|
||||
http://hostname/service?wsdl afin de ne pas provoquer d'erreur
|
||||
après une mise en production
|
||||
|
||||
Pour définir le mode (vhost d'apache)
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
SetEnv APPLICATION_ENV "staging"
|
||||
|
||||
En appelant l'url http://hostname/service, le contoller de l'application,
|
||||
"service" est automatiquement utiliser.
|
||||
Tout ce qui est visible dans la class est utilisé par le controller et se
|
||||
retrouve visible dans le service (wsdl, requête)
|
||||
|
||||
Si des fonctions ne doivent pas être rendu visible il faut donc les séparer
|
||||
dans un autre controller utilisant une autre class.
|
||||
|
||||
|
||||
Documentation des méthodes et ajout spécial
|
||||
===========================================
|
||||
|
||||
La documentation est géneré en automatique.
|
||||
|
||||
Voici comment définir simplement la documentation d'une méthode
|
||||
|
||||
/**
|
||||
* Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
* @param string $key Siren de l'entreprise ou siret de l'établissement
|
||||
* @return Identite
|
||||
*/
|
||||
public function test($key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Attention ces informations servent aussi pour la structure du WSDL
|
||||
|
||||
Pour spécifier un lien vers un fichier ou pour générer un fichier depuis une
|
||||
requête SQL à partir de la documentation du service.
|
||||
Ajouter dans le docblock :
|
||||
- Pour un fichier
|
||||
@ref fichier:libellé:{nom_du_fichier.ext}
|
||||
- Pour une requête SQL
|
||||
@ref mysql:libellé:{nom_du_fichier.sql}
|
||||
|
||||
Les fichiers a télécharger sont à placer dans le répértoire public/fichier et
|
||||
les fichiers sql dans public/sql
|
||||
|
||||
Pour spécifier des éléments de taille (non pris en compte sur le WSDL)
|
||||
@xsd minLength=9
|
||||
@xsd maxLength=15
|
||||
|
||||
|
190
docs/README.txt
190
docs/README.txt
@ -1,190 +0,0 @@
|
||||
README
|
||||
======
|
||||
|
||||
Display the documentation of our services, manage the SOAP services
|
||||
Based on ZendFramework version 1.x
|
||||
|
||||
Génération des fichiers autoload
|
||||
================================
|
||||
php bin/classmap_generator.php -l ./application -w -o ./application/autoload_classmap.php
|
||||
php bin/classmap_generator.php -l ./library/Zend -w -o ./library/Zend/autoload_classmap.php
|
||||
php bin/classmap_generator.php -l ./library/Application -w -o ./library/Application/autoload_classmap.php
|
||||
php bin/classmap_generator.php -l ./library/Scores -w -o ./library/Scores/autoload_classmap.php
|
||||
php bin/classmap_generator.php -l ./library/SdMetier -w -o ./library/SdMetier/autoload_classmap.php
|
||||
|
||||
Fichier de configuration
|
||||
========================
|
||||
La configuration est décomposé en plusieurs fichiers,
|
||||
avec adaptation suivant la machine
|
||||
- mysql.php
|
||||
- smtp.php
|
||||
- sphinx.php
|
||||
- stockage.php
|
||||
|
||||
sans adaptation suivant la machine
|
||||
- partenaires.php
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
Obtenir les WSDL
|
||||
Pour le service Entreprise
|
||||
|
||||
- En mode développement : http://hostname/entreprise/version?wsdl-auto
|
||||
- Générer le WSDL : http://hostname/entreprise/version?wsdl-generate
|
||||
- Utiliser le WSDL généré : http://hostname/entreprise/version?wsdl
|
||||
|
||||
Pour le service Interne
|
||||
|
||||
http://hostname/interne/version?wsdl
|
||||
|
||||
Pour les clients
|
||||
|
||||
http://hostname/clients/nom_du_client/version?wsdl
|
||||
|
||||
N.B : Le fichier WSDL est généré automatiquement en appelant
|
||||
http://hostname/service?wsdl afin de ne pas provoquer d'erreur
|
||||
après une mise en production
|
||||
|
||||
Pour définir le mode (vhost d'apache)
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
SetEnv APPLICATION_ENV "staging"
|
||||
|
||||
En appelant l'url http://hostname/service, le contoller de l'application,
|
||||
"service" est automatiquement utiliser.
|
||||
Tout ce qui est visible dans la class est utilisé par le controller et se
|
||||
retrouve visible dans le service (wsdl, requête)
|
||||
|
||||
Si des fonctions ne doivent pas être rendu visible il faut donc les séparer
|
||||
dans un autre controller utilisant une autre class.
|
||||
|
||||
|
||||
Documentation des méthodes et ajout spécial
|
||||
===========================================
|
||||
|
||||
La documentation est géneré en automatique.
|
||||
|
||||
Voici comment définir simplement la documentation d'une méthode
|
||||
|
||||
/**
|
||||
* Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
* @param string $key Siren de l'entreprise ou siret de l'établissement
|
||||
* @return Identite
|
||||
*/
|
||||
public function test($key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Attention ces informations servent aussi pour la structure du WSDL
|
||||
|
||||
Pour spécifier un lien vers un fichier ou pour générer un fichier depuis une
|
||||
requête SQL à partir de la documentation du service.
|
||||
Ajouter dans le docblock :
|
||||
- Pour un fichier
|
||||
@ref fichier:libellé:{nom_du_fichier.ext}
|
||||
- Pour une requête SQL
|
||||
@ref mysql:libellé:{nom_du_fichier.sql}
|
||||
|
||||
Les fichiers a télécharger sont à placer dans le répértoire public/fichier et
|
||||
les fichiers sql dans public/sql
|
||||
|
||||
Pour spécifier des éléments de taille (non pris en compte sur le WSDL)
|
||||
@xsd minLength=9
|
||||
@xsd maxLength=15
|
||||
|
||||
Configuration PHP
|
||||
=================
|
||||
apt-get install php5-mysql
|
||||
apt-get install php-apc
|
||||
apt-get install php5-curl
|
||||
apt-get install php5-xmlrpc
|
||||
|
||||
WKHTMLTOPDF
|
||||
===========
|
||||
apt-get install libXrender1
|
||||
apt-get install libfontconfig
|
||||
|
||||
Configuration VHOST
|
||||
===================
|
||||
a2enmod rewrite
|
||||
|
||||
Exemple de vhost en mode développement
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName scoresws.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
DocumentRoot "D:/www/webservice/public"
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
<Directory "D:/www/webservice/public/">
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel debug
|
||||
ErrorLog "logs/scoresws.sd.dev-error.log"
|
||||
CustomLog "logs/scoresws.sd.dev-access.log" common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
Vhost réel
|
||||
|
||||
<VirtualHost *:8081>
|
||||
ServerName wse.scores-decisions.com
|
||||
ServerAlias wse1.scores-decisions.com
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
ServerSignature Off
|
||||
AddDefaultCharset utf-8
|
||||
DocumentRoot /home/vhosts/webservice/public
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
<Directory /home/vhosts/webservice/public/>
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog /var/log/apache2/webservice-error.log
|
||||
CustomLog /var/log/apache2/webservice-access.log common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
|
||||
$db->getProfiler()->setEnabled(true);
|
||||
$db->update( ... );
|
||||
$query = $db->getProfiler()->getLastQueryProfile()->getQuery();
|
||||
$queryParams = $db->getProfiler()->getLastQueryProfile()->getQueryParams();
|
||||
$logger->log('SQL: ' . $db->quoteInto($query, $queryParams), Zend_Log::DEBUG);
|
||||
$db->getProfiler()->setEnabled(false);
|
9
docs/config/.user.ini
Normal file
9
docs/config/.user.ini
Normal file
@ -0,0 +1,9 @@
|
||||
upload_max_filesize=513M
|
||||
post_max_size=513M
|
||||
memory_limit=512M
|
||||
mbstring.func_overload=0
|
||||
always_populate_raw_post_data=-1
|
||||
default_charset='UTF-8'
|
||||
date.timezone='Europe/Paris'
|
||||
soap.wsdl_cache_enabled=0
|
||||
env[APPLICATION_ENV] = "development"
|
@ -1,11 +1,12 @@
|
||||
[production]
|
||||
phpSettings.soap.wsdl_cache_dir = "PROJECT_DIR/shared/sessions/wsdl"
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.session.save_path = "/home/vhosts/data/webservice/sessions"
|
||||
resources.session.save_path = "PROJECT_DIR/shared/sessions"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Services = "Application_Controller_Plugin_Services"
|
||||
@ -24,28 +25,7 @@ profil.mail.email.supportdev = supportdev@scores-decisions.com
|
||||
profil.mail.email.contact = supportdev@scores-decisions.com
|
||||
profil.mail.email.production = supportdev@scores-decisions.com
|
||||
profil.wkhtmltopdf.path = "/usr/local/bin/wkhtmltopdf"
|
||||
profil.path.shared = "/home/vhosts/data/webservice"
|
||||
|
||||
profil.sphinx.ent.host = "192.168.78.242"
|
||||
profil.sphinx.ent.port = 3312
|
||||
profil.sphinx.ent.version = 2
|
||||
profil.sphinx.dir.host = "192.168.78.242"
|
||||
profil.sphinx.dir.port = 3312
|
||||
profil.sphinx.dir.version = 2
|
||||
profil.sphinx.act.host = "192.168.78.242"
|
||||
profil.sphinx.act.port = 3312
|
||||
profil.sphinx.act.version = 2
|
||||
profil.sphinx.histo.host = "192.168.78.242"
|
||||
profil.sphinx.histo.port = 3312
|
||||
profil.sphinx.histo.version = 2
|
||||
|
||||
; For old configuration - see Configure.php
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.78.249
|
||||
profil.db.metier.params.username=wsuser
|
||||
profil.db.metier.params.password=scores
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8"
|
||||
profil.path.shared = "PROJECT_DIR/shared"
|
||||
|
||||
; Metier - Infogreffe
|
||||
profil.infogreffe.wsdl = "infogreffe.wsdl"
|
||||
@ -53,15 +33,38 @@ profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/I
|
||||
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
|
||||
profil.infogreffe.user = 85000109
|
||||
profil.infogreffe.password = 166
|
||||
profil.infogreffe.cache.path = "/home/vhosts/data/webservice/cache"
|
||||
profil.infogreffe.cache.path = "PROJECT_DIR/shared/cache"
|
||||
profil.infogreffe.cache.time = 8
|
||||
profil.infogreffe.storage.path = "/home/vhosts/data/webservice/datafile/greffes"
|
||||
profil.infogreffe.storage.path = "PROJECT_DIR/shared/datafile/greffes"
|
||||
|
||||
; Sphinx configuration
|
||||
profil.sphinx.ent.host = "172.18.8.5"
|
||||
profil.sphinx.ent.port = 9312
|
||||
profil.sphinx.ent.version = "2.2.10"
|
||||
profil.sphinx.dir.host = "172.18.8.5"
|
||||
profil.sphinx.dir.port = 9312
|
||||
profil.sphinx.dir.version = "2.2.10"
|
||||
profil.sphinx.act.host = "172.18.8.5"
|
||||
profil.sphinx.act.port = 9312
|
||||
profil.sphinx.act.version = "2.2.10"
|
||||
profil.sphinx.histo.host = "172.18.8.5"
|
||||
profil.sphinx.histo.port = 9312
|
||||
profil.sphinx.histo.version = "2.2.10"
|
||||
|
||||
; For old configuration - see Configure.php
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=172.18.8.5
|
||||
profil.db.metier.params.username=wsuser
|
||||
profil.db.metier.params.password=scores
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8mb4"
|
||||
|
||||
[staging : production]
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
@ -47,19 +47,15 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
|
||||
// --- On vérifie le tout lors d'une connexion par url
|
||||
if ( !empty($login) && !empty($pass) ) {
|
||||
|
||||
$authAdapter = new Scores_Auth_Adapter_Db($login, $pass, $checkWs);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
|
||||
if ($result->isValid()) {
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$session = new Zend_Session_Namespace($storage->getNamespace());
|
||||
//$session->setExpirationSeconds(86400);
|
||||
$auth->setStorage($storage);
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else {
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ( !$layout->isEnabled() ){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
@ -68,29 +64,24 @@ class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
->setControllerName('user')
|
||||
->setActionName('logout');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Sinon on reste sur le standard
|
||||
} else {
|
||||
|
||||
//Pas authentifié
|
||||
}
|
||||
// Sinon on reste sur le standard
|
||||
else {
|
||||
// Pas authentifié
|
||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if (!$layout->isEnabled()){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$this->_response->setRedirect('/user/login')->sendResponse();
|
||||
}
|
||||
|
||||
//Authentifié => on met à jour la session
|
||||
} else {
|
||||
|
||||
}
|
||||
// Authentifié => on met à jour la session
|
||||
else {
|
||||
$identity = $auth->getIdentity();
|
||||
$identity->time = time() + $identity->timeout;
|
||||
$auth->getStorage()->write($identity);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,27 +23,6 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
$config = include APPLICATION_PATH . '/configs/menu.config.php';
|
||||
$container = new Zend_Navigation($config);
|
||||
|
||||
// --- Add services
|
||||
$pagesService = array();
|
||||
if ( count($view->WsServices)>0 ) {
|
||||
foreach ( $view->WsServices as $service => $params ) {
|
||||
$service = array(
|
||||
'label'=> $params['name'],
|
||||
'controller' => 'documentation',
|
||||
'action' => 'service',
|
||||
'params' => array(
|
||||
'name' => $service,
|
||||
'type' => $params['type'],
|
||||
),
|
||||
);
|
||||
|
||||
$pagesService[] = $service;
|
||||
}
|
||||
}
|
||||
|
||||
$found = $container->findOneByLabel("Documentation");
|
||||
$found->addPages($pagesService);
|
||||
|
||||
// --- Secure demo mode
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
@ -53,7 +32,7 @@ class Application_Controller_Plugin_Menu extends Zend_Controller_Plugin_Abstract
|
||||
$container->removePage($toSecure);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$view->navigation($container);
|
||||
}
|
||||
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Chiffre
|
||||
{
|
||||
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Date
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Debug
|
||||
{
|
||||
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Ftp
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Mail
|
||||
{
|
||||
/**
|
||||
* Envoi un email
|
||||
* @param unknown $from
|
||||
* @param unknown $to
|
||||
* @param unknown $subject
|
||||
* @param string $text
|
||||
* @param string $html
|
||||
* @param array $tabAttachedFiles
|
||||
*/
|
||||
public function send($from, $to, $subject, $text='', $html='', $tabAttachedFiles=array())
|
||||
{
|
||||
$to = preg_split("/[\s,;]+/", $to);
|
||||
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setFrom($from);
|
||||
if ( count($to) > 0 ) {
|
||||
foreach ( $to as $item ) {
|
||||
$mail->addTo($item);
|
||||
}
|
||||
}
|
||||
$mail->setSubject($subject);
|
||||
if ($text!='') {
|
||||
$mail->setBodyText($text);
|
||||
}
|
||||
|
||||
if ($html!='') {
|
||||
$mail->setBodyHtml($html);
|
||||
}
|
||||
|
||||
if ( count($tabAttachedFiles) > 0 ) {
|
||||
foreach ($tabAttachedFiles as $file) {
|
||||
$at = new Zend_Mime_Part( file_get_contents( $file ) );
|
||||
$mail->addAttachment($at);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$mail->execute();
|
||||
} catch (Zend_Mail_Transport_Exception $e) {
|
||||
file_put_contents(LOG_PATH.'/sendMailError.log', date('Y-m-d H:i:s')." - ".$e->getMessage()."\n", FILE_APPEND);
|
||||
} catch (Zend_Mail_Protocol_Exception $e) {
|
||||
file_put_contents(LOG_PATH.'/sendMailError.log', date('Y-m-d H:i:s')." - ".$e->getMessage()."\n", FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Mysql
|
||||
{
|
||||
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_String
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Metier_Common_Utils
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,276 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
"$" => "USD",
|
||||
"DOLLAR" => "USD",
|
||||
"DOLLARS" => "USD",
|
||||
"DOLLARS US" => "USD",
|
||||
"DOLLAR DES ETATS-UNIS" => "USD",
|
||||
"DOLLARS CANADIENS" => "CAD",
|
||||
"BRR" => "BRR",
|
||||
"BRL" => "BRL",
|
||||
"EURO" => "EUR",
|
||||
"RÉIS" => "BRL",
|
||||
"F" => "FRF",
|
||||
"FRANCS CFA" => "CFA",
|
||||
"CNY" => "CNY",
|
||||
"YUAN" => "CNY",
|
||||
"YUAN REN MIN BI" => "CNY",
|
||||
"COURONNES TCHÈQUES (RÉPUBLIQUE TCHÈQUE" => "CZK",
|
||||
"ARIARYS" => "MGA",
|
||||
"KMF" => "KMF",
|
||||
"MGA ARIARY" => "MGA",
|
||||
"MUR" => "MUR",
|
||||
"ROUPIES MAURICIENNES" => "MUR",
|
||||
"MURS" => "MUR",
|
||||
"ROL" => "ROL",
|
||||
"RON" => "RON",
|
||||
"FS" => "CHF",
|
||||
"CHF" => "CHF",
|
||||
"FRANC SUISSE" => "CHF",
|
||||
"FRANCS SUISSES" => "CHF",
|
||||
"YENS" => "JPY",
|
||||
"DKK" => "DKK",
|
||||
"COURONNES DANOISES" => "DKK",
|
||||
"COURONNES NORVÉGIENNES" => "NOK",
|
||||
"GBP" => "GBP",
|
||||
"LIVRE STERLING" => "GBP",
|
||||
"LIVRES STERLING" => "GBP",
|
||||
"LIVRES STERLINGS" => "GBP",
|
||||
"ROUBLES BIÉLORUSSES" => "RUB",
|
||||
"ROUBLES" => "RUB",
|
||||
"DOLLARS TAIWAN" => "TWD",
|
||||
"HKD" => "HKD",
|
||||
"DIRHAMS" => "MAD",
|
||||
"DINARS TUNISIENS" => "TND",
|
||||
"FCFA" => "CFA",
|
||||
"FRANCS BELGES" => "BEF",
|
||||
"ROUPIE INDIENNE" => "INR",
|
||||
"DOLLARS HONG KONG" => "HKD",
|
||||
"RIALS IRANIENS" => "IRR",
|
||||
"DOLLARS HONG-KONG" => "HKD",
|
||||
"ECU" => "EUR",
|
||||
"YUANS" => "CNY",
|
||||
"DM" => "DEM",
|
||||
"LEI" => "RON",
|
||||
"TND" => "TND",
|
||||
"WON" => "KRW",
|
||||
"DINAR TUNISIEN" => "TND",
|
||||
"WONS" => "KRW",
|
||||
"DIRHAMS MAROCAINS" => "MAD",
|
||||
"FB" => "BEF",
|
||||
"CRUZEIROS" => "BRL",
|
||||
"REALS" => "BRL",
|
||||
"COURONNES ISLANDAISES" => "ISK",
|
||||
"DOLLARS AUSTRALIENS" => "AUD",
|
||||
"DINARS" => "TND",
|
||||
"RIYAL SAOUDIEN" => "SAR",
|
||||
"LIVRES SYRIENNES" => "SYP",
|
||||
"YEN" => "JPY",
|
||||
"COURONNES SUÉDOISES" => "SEK",
|
||||
"LIVRES TURQUES" => "TRY",
|
||||
"SHEKELS" => "ILS",
|
||||
"FRANC BELGE" => "BEF",
|
||||
"DOLLAR HONG KONG" => "HKD",
|
||||
"DOLLARS SINGAPOUR" => "SGD",
|
||||
"ZLOTY" => "PLN",
|
||||
"LEVS" => "BGN",
|
||||
"OUGUIYA" => "MRO",
|
||||
"ROUPIES INDIENNES" => "INR",
|
||||
"RIEL" => "KHR",
|
||||
"COURONNES DANNOISES" => "DKK",
|
||||
"INR" => "INR",
|
||||
"ROUPIES DES SEYCHELLES" => "SCR",
|
||||
"$ CANADIENS" => "CAD",
|
||||
"LIVRE STERLI" => "GBP",
|
||||
"NOK" => "NOK",
|
||||
"LIVRES LIBANAISES" => "LBP",
|
||||
"RUR" => "RUB",
|
||||
"USD" => "USD",
|
||||
"CHS" => "CHE",
|
||||
"SKK" => "SKK",
|
||||
"DINAR TUNISI" => "TND",
|
||||
"PESOS COLOMBIENS" => "COP",
|
||||
"JIAS" => "CNY",
|
||||
"DINARS ALGÉRIENS" => "DZD",
|
||||
"RIELS" => "KHR",
|
||||
"CLP" => "CLP",
|
||||
"DINAR ALGÉRIEN" => "DZD",
|
||||
"RANDS" => "ZAR",
|
||||
"LEU" => "RON",
|
||||
"LIVRES CYPRIOTES" => "CYP",
|
||||
"MAD" => "MAD",
|
||||
"JPY" => "JPY",
|
||||
"PNL" => "PLN",
|
||||
"DOLLARS NÉO-ZÉLANDAIS" => "NZD",
|
||||
"DOLLAR US" => "USD",
|
||||
"CYP" => "CYP",
|
||||
"DIRHAM" => "MAD",
|
||||
"ZRN" => "ZRN",
|
||||
"RIYALS SAOUDIENS" => "SAR",
|
||||
"ZLOTYS" => "PLN",
|
||||
"FRANCS MALGACHE" => "MGF",
|
||||
"BAHTS" => "THB",
|
||||
"SHILLINGS KENYANS" => "KES",
|
||||
"FRANC COMORIEN" => "KMF",
|
||||
"KRW" => "KRW",
|
||||
"$ HONG-KONG" => "HKD",
|
||||
"COURONNES TCHÈQUES" => "CZK",
|
||||
"FRANCS CFA-BE" => "XAF",
|
||||
"DIRHAMS DES E A U" => "AED",
|
||||
"DOLLAR AUSTRALIEN" => "AUD",
|
||||
"F, SOIT" => "FRF",
|
||||
"F SOIT" => "FRF",
|
||||
"FRANC FRANÇAIS" => "FRF",
|
||||
"FRANCS GUINÉENS" => "GNF",
|
||||
"$ US" => "USD",
|
||||
"REAL" => "BRL",
|
||||
"LBP" => "LBP",
|
||||
"TRL" => "TRY",
|
||||
"RIYAL YÉMÉNITES" => "YER",
|
||||
"ARIARY" => "MGA",
|
||||
"PESOS PHILIPPINS" => "PHP",
|
||||
"KRD" => "DKK",
|
||||
"WONS CORÉE DU SUD" => "KRW",
|
||||
"DOLLAR HONG-KONG" => "HKD",
|
||||
"BAHT" => "THB",
|
||||
"PESOS CUBAINS" => "CUC",
|
||||
"DÔNGS" => "VND",
|
||||
"DINARS JORDANIENS" => "JOD",
|
||||
"LIVRES ÉGYPTIENNES" => "EGP",
|
||||
"MALTAISES" => "MTL",
|
||||
"NOUVEAUX DOLLARS TAÏWAN" => "TWD",
|
||||
"$ TAIWA" => "TWD",
|
||||
"F CFA" => "XAF",
|
||||
"SGD" => "SGD",
|
||||
"$ SINGAPOUR" => "SGD",
|
||||
"YUANS RENMINBI" => "CNY",
|
||||
"DIRHAMS DES EMIRATS ARABES UNIS" => "AED",
|
||||
"LIVRE TURQUE" => "TRY",
|
||||
"ERUOS" => "EUR",
|
||||
"DOLLARS DES ETATS-UNIS" => "USD",
|
||||
"SCHILLING" => "ATS",
|
||||
"BIRRS" => "ETB",
|
||||
"DOLLAR CANADIEN" => "CAD",
|
||||
"LIVRES CYPRIOBES" => "CYP",
|
||||
"EUROS (PLANCHER ET" => "EUR",
|
||||
"FRANCS MALGACHES" => "MGF",
|
||||
"LEVA" => "BGN",
|
||||
"DINARDS JORDANIENS" => "JOD",
|
||||
"PES" => "PHP",
|
||||
"PESETAS" => "ESP",
|
||||
"DINARDS" => "DZD",
|
||||
"NOUVEAUX DOLLARS TAÏWANAIS" => "TWD",
|
||||
"FRANC" => "FRF",
|
||||
"COURONNE DANOISE" => "DKK",
|
||||
"F SUISSES" => "CHF",
|
||||
"F (SOIT" => "FRF",
|
||||
"EUROS, COMPRENANT LA CLIENTÈLE ET L'ACHA" => "EUR",
|
||||
"EUROS, EN CE COMPRIS UN FONDS SIS RÉSIDE" => "EUR",
|
||||
"F SYMBOLIQUE" => "FRF",
|
||||
"RIALS" => "IRR",
|
||||
"EUROS, À L'EXCLUSION DU DROIT AU BAIL DE" => "EUR",
|
||||
"DH" => "MAD",
|
||||
"EUROS, CRÉATION L'AUTRE BRANCHE ACTIVITÉ" => "EUR",
|
||||
"LEI ROUMAIN" => "RON",
|
||||
"HGK" => "HKD",
|
||||
"EUROS, ÉTANT PRÉCISÉ QUE LE CÉDANT A CON" => "EUR",
|
||||
"DZD" => "DZD",
|
||||
"DON" => "VND",
|
||||
"EUROS, EN CE COMPRIS LA BRANCHE ACTIVITÉ" => "EUR",
|
||||
"LEV" => "RON",
|
||||
"EUROS, AVEC UN DEUXIÈME FONDS SIS À CHEF" => "EUR",
|
||||
"DÉCEMBRE" => "EUR",
|
||||
"CEDIS" => "GHS",
|
||||
"EUROS ; EN CE COMPRIS L'ÉTABLISSEMENT CO" => "EUR",
|
||||
"EUROS, À L'EXCEPTION LA BOUCHERIE" => "EUR",
|
||||
"Y" => "JPY",
|
||||
"EUROS DES ÉLÉMENTS LA BRANCHE ACTIVITÉ >" => "EUR",
|
||||
"ROUTE BISCHWILLER À SCHILTIGHEIM" => "EUR",
|
||||
"AVENUE COLMAR, STRASBOURG" => "EUR",
|
||||
"$ CAN" => "CAD",
|
||||
"EUUROS" => "EUR",
|
||||
"EUROS, À L'EXCLUSION L'ACTIVITÉ FABRICAT" => "EUR",
|
||||
"BRC" => "BRL",
|
||||
"EUROS ET CRÉATION LA BRANCHE ACTIVITÉ SN" => "EUR",
|
||||
"EUROS ET CRÉATION LA BRANCHE ACTIVITÉ GL" => "EUR",
|
||||
"EUROS, ET CRÉATION LA BRANCHE ACTIVITÉ I" => "EUR",
|
||||
"EGP" => "EGP",
|
||||
"COURONNE SUE" => "SEK",
|
||||
"LIVRES" => "GBP",
|
||||
"EUROS, À L'EXCLUSION LA BRANCHE VENTE AU" => "EUR",
|
||||
"SOLS" => "PEN",
|
||||
"EUROS, SOIT LA BRANCHE ACTIVITÉ GROS UV" => "EUR",
|
||||
"BATHS" => "THB",
|
||||
"MRO" => "MRO",
|
||||
"EUROS, À L'EXCLUSION TOUS LES ÉLÉMENTS L" => "EUR",
|
||||
"PESOS" => "ARS",
|
||||
"YANS" => "CNY",
|
||||
"MGF" => "MGF",
|
||||
"EUROS, CONJOINTEMENT AVEC MME CHERUBINI" => "EUR",
|
||||
"EUROS, CONSTITUANT UNE BRANCHE COMPLÈTE" => "EUR",
|
||||
"EUROS, À L'EXCLUSION LA BRANCHE ACTIVITÉ" => "EUR",
|
||||
"FRANCS SUISSE" => "CHF",
|
||||
"FL" => "LUF",
|
||||
"DOLLARS DES CARAÏBES" => "DOP",
|
||||
"DOLLARS HO" => "HKD",
|
||||
"EUROS, RÉSULTANT UN PROJET APPORT AUX TE" => "EUR",
|
||||
"HU" => "HUF",
|
||||
"EUROS, INCLUANT LES BRANCHES DES FONDS C" => "EUR",
|
||||
"EUROS, À L'EXCEPTION LA BRANCHE ACTIVITÉ" => "EUR",
|
||||
"EUROS. ACQUISITION ET ADJONCTION DES NOM" => "EUR",
|
||||
"BHD" => "TND",
|
||||
"EUOS" => "EUR",
|
||||
"TWD" => "TWD",
|
||||
"RL" => "IRR",
|
||||
"FRANCS" => "FRF",
|
||||
"FRF" => "FRF",
|
||||
"EUROS ; CRÉATION LA BRANCHE ACTIVITÉ VEN" => "EUR",
|
||||
"EUROS ET CRÉATION LA BRANCHE ACTIVITÉ CA" => "EUR",
|
||||
"FRANCS FRANCAIS" => "FRF",
|
||||
"EOROS" => "EUR",
|
||||
"UROS" => "EUR",
|
||||
"EUROS - LES OPPOSITIONS SERONT RECUES CH" => "EUR",
|
||||
"EUROS - JOURNAL PUBLICATEUR : PETITES AF" => "EUR",
|
||||
"EUROS, SAUF POUR LA BRANCHE JEUX GRATTAG" => "EUR",
|
||||
"EU" => "EUR",
|
||||
"EUROS - JOURNAL : LES PETITES AFFICHES D" => "EUR",
|
||||
"EUROS - JOURNAL ANNONCES LÉGALES : LES A" => "EUR",
|
||||
"EUORS" => "EUR",
|
||||
"FRANCS FRANÇAIS. RADIATION PERSONNE PHYS" => "FRF",
|
||||
"EUROS - JOURNAL PUBLICITE : LES AFFICHES" => "EUR",
|
||||
"EUROS - JOURNAL PUBLICATEUR LES PETITES" => "EUR",
|
||||
"EUROS, ANNONCE PARU DANS LES PETITES AFF" => "EUR",
|
||||
"EUROSO - JOURNAL ANNONCES LES PETITES AF" => "EUR",
|
||||
"EUROS. LE RECTIFICATIF PORTE SUR LE LIEU" => "EUR",
|
||||
"EUROS. L'ENTRÉE EN JOUISSANCE EST FIXÉE" => "EUR",
|
||||
"EUROS. LES OPPOSITIONS SERONT REÇUES POU" => "EUR",
|
||||
"EUROS ; ACQUIS PAR APPORT PARTIEL ACTIF" => "EUR",
|
||||
"EUROS JOURNAL ANNONCES LEGALES LES PETIT" => "EUR",
|
||||
" LIVRES STERLING - PASSIF TRANSMIS :" => "GBP",
|
||||
"EUROS, PARUTION DANS LES PETITES AFFICHE" => "EUR",
|
||||
"EUROS - JOURNAL ANNONCES LEGALES LES PET" => "EUR",
|
||||
"EUROS; LES OPPOSITIONS SERONT REÇU AU SI" => "EUR",
|
||||
"EUROS - JOURNAL ANNONCES LÉGALES : LES P" => "EUR",
|
||||
"FRF;F" => "FRF",
|
||||
"EUROS - PUBLICATION : LES AFFICHES PARIS" => "EUR",
|
||||
" " => "EUR",
|
||||
"E" => "EUR",
|
||||
"EUR (ACQUISITION UNE BRANCHE ACTIVI TÉ)" => "EUR",
|
||||
"EUROS. VENDEUR : SARL LE TAILLEUR CHEMIS" => "EUR",
|
||||
"EUROS, PRECEDENT PROPRIÉTAIRE ETURICHEPA" => "EUR",
|
||||
"£, PASSIF TRANSMIS" => "GBP",
|
||||
"EUROS LES OPPOSITIONS SERONT REÇUES CHEZ" => "EUR",
|
||||
"EUROS. ACTIVITÉ : BRANCHE ACTIVITÉ TRANS" => "EUR",
|
||||
"EUROS ; ACHAT LA CLIENTèLE RELATIVE à L'" => "EUR",
|
||||
"'" => "EUR",
|
||||
"EUROS. PUBLICATION : LES PETITES AFFICHE" => "EUR",
|
||||
"EUROS MADAME BUTON FRANCOIS RCS LA ROCHE" => "EUR",
|
||||
"EUROS (BRANCHE ACTIVITé)" => "EUR",
|
||||
"EUROS, LA SOCIéTé GF BATIMENTS A CéDé à" => "EUR",
|
||||
"USD (SOIT" => "USD",
|
||||
"EUROS (ACQUISITION UNE BRANCHE ACTIVITé" => "EUR",
|
||||
"EUROS CONCERNANT L'ACQUISITION UNE BRANC" => "EUR",
|
||||
"E POUR" => "EUR",
|
||||
"EUROS, FONDS ACQUIS SIS à LA RICHE (" => "EUR",
|
||||
"EUROS, OPPOSITIONS PAR ACTE EXTRA JUDICI" => "EUR",
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -1,313 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
'1' => "Directeur",
|
||||
'2' => "Directeur Contentieux",
|
||||
'3' => "Directeur Recouvrement",
|
||||
'4' => "Directeur Crédit",
|
||||
'5' => "Directeur Recherche et Développement",
|
||||
'6' => "Directeur de la Qualité",
|
||||
'7' => "Directeur d'Exploitation",
|
||||
'8' => "Directeur d'Agence/Etablissement",
|
||||
'9' => "Directeur de la Production",
|
||||
'10' => "Directeur Commercial",
|
||||
'11' => "Directeur Financier (DAF)",
|
||||
'12' => "Directeur Juridique",
|
||||
'13' => "Directeur des Ressources Humaines DRH",
|
||||
'14' => "Directeur Informatique",
|
||||
'15' => "Directeur Administratif",
|
||||
'16' => "Directeur des Achats",
|
||||
'17' => "Directeur Marketing",
|
||||
'18' => "Directeur de la communication",
|
||||
'19' => "Directeur Technique",
|
||||
'31' => "Responsable",
|
||||
'32' => "Responsable Contentieux",
|
||||
'33' => "Responsable Recouvrement",
|
||||
'34' => "Responsable Crédit",
|
||||
'35' => "Responsable Recherche et Développement",
|
||||
'36' => "Responsable de la Qualité",
|
||||
'37' => "Responsable d'Exploitation",
|
||||
'38' => "Responsable d'Agence/Etablissement",
|
||||
'39' => "Responsable de la Production",
|
||||
'40' => "Responsable Commercial",
|
||||
'41' => "Responsable Financier",
|
||||
'42' => "Responsable Juridique",
|
||||
'43' => "Responsable des Ressources Humaines RRH",
|
||||
'44' => "Responsable Informatique",
|
||||
'45' => "Responsable Administratif",
|
||||
'46' => "Responsable des Achats",
|
||||
'47' => "Responsable Marketing",
|
||||
'48' => "Responsable de la communication",
|
||||
'49' => "Responsable Technique",
|
||||
'50' => "Expert comptable",
|
||||
'55' => "Comptable",
|
||||
'60' => "Chargé d'affaires",
|
||||
'61' => "Conducteur de Travaux",
|
||||
'62' => "Chef de projets",
|
||||
'63' => "Consultant",
|
||||
'79' => "Assistant(e) de direction",
|
||||
'80' => "Avocat",
|
||||
'81' => "Commissaire-priseur",
|
||||
'85' => "Agent commercial",
|
||||
'90' => "Représentant du personnel",
|
||||
'91' => "Représentant du Comité d'Entreprise",
|
||||
'92' => "Scrutateur",
|
||||
'100' => "Administrateur",
|
||||
'101' => "Administrateur délégué",
|
||||
'102' => "administrateur de GIE",
|
||||
'103' => "Administrateur et membre",
|
||||
'104' => "Administrateur et membre du GIE",
|
||||
'105' => "Administrateur et président",
|
||||
'106' => "Administrateur membre engageant le GIE",
|
||||
'107' => "Administrateur unique",
|
||||
'108' => "Administrateur provisoire",
|
||||
'109' => "Administrateur et Directeur",
|
||||
'200' => "Associé",
|
||||
'201' => "Associé commandité gérant",
|
||||
'202' => "Associé commandité",
|
||||
'203' => "Associé de société civile",
|
||||
'205' => "Associé en nom",
|
||||
'206' => "Associé exploitant",
|
||||
'207' => "Associé non exploitant",
|
||||
'208' => "Associé non gérant",
|
||||
'209' => "Associé gérant",
|
||||
'210' => "Associé Indéfiniment et solidairement responsable",
|
||||
'211' => "Associé indéfiniment responsable",
|
||||
'212' => "Associé en nue propriété (avec usufruitier)",
|
||||
'213' => "Associé unique",
|
||||
'214' => "Co-Associé",
|
||||
'215' => "Associé Commanditaire",
|
||||
'250' => "Propriétaire",
|
||||
'300' => "Commissaire aux comptes titulaire",
|
||||
'301' => "Co-commissaire aux comptes suppléant",
|
||||
'302' => "Co-commissaire aux comptes titulaire",
|
||||
'303' => "Commissaire aux comptes suppléant",
|
||||
'304' => "Commissaire aux comptes",
|
||||
'305' => "Co-commissaire aux comptes",
|
||||
'400' => "Co-gérant",
|
||||
'401' => "Co-gérant associé Indéfiniment responsable",
|
||||
'402' => "Co-gérant associé",
|
||||
'403' => "Co-gérant non associé",
|
||||
'404' => "Co-gérant non statutaire",
|
||||
'405' => "Co-gérant pouvant engager la société",
|
||||
'406' => "Co-gérant statutaires",
|
||||
'500' => "Conjoint Collaborateur",
|
||||
'600' => "Contrôleur",
|
||||
'601' => "Contrôleur de gestion et des comptes",
|
||||
'602' => "Contrôleur de gestion du GIE",
|
||||
'603' => "Contrôleur de gestion",
|
||||
'604' => "Contrôleur des comptes titulaire",
|
||||
'605' => "Contrôleur des comptes du GIE",
|
||||
'606' => "Contrôleur des comptes et de gestion",
|
||||
'607' => "Contrôleur des comptes et membre du GIE",
|
||||
'608' => "Contrôleur des comptes",
|
||||
'700' => "Directeur",
|
||||
'701' => "Directeur général adjoint",
|
||||
'702' => "Directeur général délégué et administrateur",
|
||||
'703' => "Directeur général délégué et membre du comité de surveillance",
|
||||
'704' => "Directeur général délégué",
|
||||
'705' => "Directeur général et administrateur",
|
||||
'706' => "Directeur général et membre du directoire",
|
||||
'707' => "Directeur général unique du directoire",
|
||||
'708' => "Directeur général unique",
|
||||
'709' => "Directeur général",
|
||||
'710' => "Directeur gérant",
|
||||
'711' => "Directeur technique",
|
||||
'712' => "Directeur des transports",
|
||||
'713' => "Directeur général non administrateur",
|
||||
'800' => "Dirigeant",
|
||||
'801' => "Dirigeant à l'étranger et en France",
|
||||
'802' => "Dirigeant à l'étranger",
|
||||
'803' => "Dirigeant en France et à l'étranger",
|
||||
'804' => "Dirigeant en France",
|
||||
'805' => "Dirigeant",
|
||||
'900' => "Gérant",
|
||||
'901' => "Nouveau gérant",
|
||||
'902' => "Gérant et directeur technique",
|
||||
'903' => "Gérant associé en nom collectif",
|
||||
'904' => "Gérant associé en nom",
|
||||
'905' => "Gérant associé indéfiniment responsable",
|
||||
'906' => "Gérant associé unique",
|
||||
'907' => "Gérant associé",
|
||||
'908' => "Gérant associé majoritaire",
|
||||
'909' => "Gérant associé minoritaire",
|
||||
'910' => "Gérant associé tenu indéfiniment et solidairement des dettes sociales",
|
||||
'911' => "Gérant majoritaire",
|
||||
'912' => "Gérant non associé",
|
||||
'913' => "Gérant non statutaire",
|
||||
'914' => "Gérant pouvant engager la société",
|
||||
'915' => "Gérant salarié",
|
||||
'916' => "Gérant statutaire associé",
|
||||
'917' => "Gérant statutaire",
|
||||
'918' => "Gérant et administrateur",
|
||||
'919' => "Gérant technique",
|
||||
'920' => "Ancien gérant",
|
||||
'921' => "Gérante",
|
||||
'923' => "Gérant co-associé",
|
||||
'924' => "Gérant unique",
|
||||
'925' => "Premier Gérant",
|
||||
'926' => "Gérant de fait",
|
||||
'1000' => "Fondé de pouvoir",
|
||||
'1001' => "Personne ayant pouvoir d'engager à titre habituel la société vis-à-vis des tiers",
|
||||
'1002' => "Personne ayant pouvoir d'engager la société en France",
|
||||
'1003' => "Personne ayant pouvoir d'engager la société",
|
||||
'1004' => "Personne ayant pouvoir de diriger et gérer",
|
||||
'1005' => "Personne pouvant engager à titre habituel l'assujetti",
|
||||
'1006' => "Personne",
|
||||
'1050' => "Personne Physique",
|
||||
'1070' => "Exploitant",
|
||||
'1080' => "Fondateur",
|
||||
'1081' => "Co-fondateur",
|
||||
'1090' => "Gérant affaire personnelle",
|
||||
'1100' => "Mandataire",
|
||||
'1101' => "Mandataire ad hoc",
|
||||
'1102' => "Mandataire général",
|
||||
'1200' => "Membre",
|
||||
'1201' => "Membre du GIE",
|
||||
'1202' => "Membre du groupement",
|
||||
'1203' => "Membre et administrateur",
|
||||
'1204' => "Membre du comité de direction",
|
||||
'1205' => "Membre du comité de surveillance",
|
||||
'1206' => "Membre du conseil de direction",
|
||||
'1207' => "Membre du conseil de surveillance",
|
||||
'1208' => "Membre du directoire",
|
||||
'1209' => "Membre du conseil exécutif",
|
||||
'1210' => "Membre du conseil de gestion",
|
||||
'1211' => "Membre du conseil d'administration",
|
||||
'1230' => "Membre du Comité d'Orientation",
|
||||
'1232' => "Membre du conseil de famille",
|
||||
'1300' => "Président",
|
||||
'1301' => "Président directeur général",
|
||||
'1302' => "Président du conseil d'administration assumant la direction général",
|
||||
'1303' => "Président du conseil d'administration et administrateur",
|
||||
'1304' => "Président du conseil d'administration et directeur général",
|
||||
'1305' => "Président du conseil d'administration, directeur général et administrateur",
|
||||
'1306' => "Président du conseil d'administration",
|
||||
'1307' => "Président du conseil de surveillance",
|
||||
'1308' => "Président du directoire",
|
||||
'1309' => "Président du GIE",
|
||||
'1310' => "Président et membre du conseil de surveillance",
|
||||
'1311' => "Président et membre du directoire",
|
||||
'1312' => "Président et président du comité de direction",
|
||||
'1313' => "Président et président du comité de surveillance",
|
||||
'1314' => "Président et administrateur",
|
||||
'1315' => "Président et associé",
|
||||
'1316' => "Président et associé unique",
|
||||
'1317' => "Président directeur général et administrateur",
|
||||
'1318' => "Président non associé",
|
||||
'1320' => "Président d'honneur",
|
||||
'1330' => "Président du Comité d'Orientation",
|
||||
'1331' => "Président du comité de direction",
|
||||
'1332' => "Président du Conseil de famille",
|
||||
'1400' => "Représentant",
|
||||
'1401' => "Représentant de société étrangère",
|
||||
'1402' => "Représentant tant en France qu'à l'étranger",
|
||||
'1403' => "Représentant à l'étranger",
|
||||
'1404' => "Représentant légal en France",
|
||||
'1405' => "Représentant légal",
|
||||
'1406' => "Représentant permanent",
|
||||
'1500' => "Responsable",
|
||||
'1501' => "Co-responsable en France",
|
||||
'1502' => "Responsable pour la France",
|
||||
'1503' => "Responsable tant en France qu'à l'étranger",
|
||||
'1504' => "Responsable technique",
|
||||
'1505' => "Responsable à l'étranger",
|
||||
'1506' => "Responsable de la société en France",
|
||||
'1507' => "Responsable en France",
|
||||
'1508' => "Responsable légal en France",
|
||||
'1600' => "Secrétaire",
|
||||
'1601' => "Vice-secrétaire",
|
||||
'1602' => "Secrétaire du conseil d'administration",
|
||||
'1603' => "Secrétaire du conseil de surveillance",
|
||||
'1610' => "Secrétaire général",
|
||||
'1650' => "Gouverneur",
|
||||
'1651' => "Sous Gouverneur",
|
||||
'1700' => "Trésorier",
|
||||
'1701' => "Vice-trésorier",
|
||||
'1800' => "Vice-président",
|
||||
'1801' => "Vice-président du conseil d'administration",
|
||||
'1802' => "vice-président du conseil de surveillance",
|
||||
'1803' => "Vice-président et administrateur privé",
|
||||
'1804' => "Vice-président et administrateur",
|
||||
'1805' => "Vice-président et membre du conseil de surveillance",
|
||||
'1806' => "Vice-président du directoire",
|
||||
'1900' => "Liquidateur (amiable)",
|
||||
'1950' => "Greffier",
|
||||
'2000' => "Maire",
|
||||
'2001' => "Premier Adjoint",
|
||||
'2002' => "Adjoint 3eme Age/Handicapes",
|
||||
'2003' => "Adjoint Affaires Culturelles",
|
||||
'2004' => "Adjoint Affaires Economiques",
|
||||
'2005' => "Adjoint Affaires Générales",
|
||||
'2006' => "Adjoint Affaires Sociales",
|
||||
'2007' => "Adjoint Agriculture",
|
||||
'2008' => "Adjoint Commerce/Artisanat",
|
||||
'2009' => "Adjoint Communication",
|
||||
'2010' => "Adjoint Emploi/Insertion",
|
||||
'2011' => "Adjoint Environnement",
|
||||
'2012' => "Adjoint Finances/Budget",
|
||||
'2013' => "Adjoint Intercommunalité",
|
||||
'2014' => "Adjoint Jeunesse",
|
||||
'2015' => "Adjoint Logement",
|
||||
'2016' => "Adjoint Patrimoine",
|
||||
'2017' => "Adjoint Personnel",
|
||||
'2018' => "Adjoint Petite Enfance",
|
||||
'2019' => "Adjoint Politique de la Ville/Logement",
|
||||
'2020' => "Adjoint Relations Internationales",
|
||||
'2021' => "Adjoint Santé/Prévention",
|
||||
'2022' => "Adjoint ServicesTechniques",
|
||||
'2023' => "Adjoint Sport",
|
||||
'2024' => "Adjoint Spécial",
|
||||
'2025' => "Adjoint Sécurité/Prévention",
|
||||
'2026' => "Adjoint TIC",
|
||||
'2027' => "Adjoint Tourisme",
|
||||
'2028' => "Adjoint Transports/Mobilité Urbaine",
|
||||
'2029' => "Adjoint Urbanisme",
|
||||
'2030' => "Adjoint Vie Associative",
|
||||
'2031' => "Adjoint Vie des Quartiers",
|
||||
'2032' => "Adjoint Voirie",
|
||||
'2050' => "Secrétariat du Maire",
|
||||
'2051' => "Premier conseiller",
|
||||
'2052' => "Conseiller",
|
||||
'2053' => "Conseiller Communautaire Délégué",
|
||||
'2054' => "Conseiller Municipal",
|
||||
'2055' => "Conseiller Municipal Délégué",
|
||||
'2056' => "Directeur de Cabinet",
|
||||
'2060' => "Dir/Resp Affaires Juridiques",
|
||||
'2061' => "Dir/Resp Emploi/Insertion/Urbanisme",
|
||||
'2062' => "Dir/Resp Petite Enfance/Environnement",
|
||||
'2063' => "Dir/Resp Ressources Humaines",
|
||||
'2064' => "Dir/Resp Services Financiers",
|
||||
'2065' => "Dir/Resp Services Techniques/Transports",
|
||||
'2066' => "Dir/Resp Technique",
|
||||
'2067' => "Dir/Resp Urbanisme/Habitat/Voirie",
|
||||
'2068' => "Directeur 3e Age/Handicapés/Cadre Vie/Esp. Ver",
|
||||
'2069' => "Directeur Achats",
|
||||
'2070' => "Directeur Affaires Culturelles/Com. Interne",
|
||||
'2071' => "Directeur Affaires Economiques",
|
||||
'2072' => "Directeur Affaires Générales",
|
||||
'2073' => "Directeur Affaires Sociales/Tourisme",
|
||||
'2074' => "Directeur Architecture",
|
||||
'2075' => "Directeur Bibliothèque Municipale",
|
||||
'2076' => "Directeur Communication",
|
||||
'2077' => "Directeur Eaux et Services Concédés",
|
||||
'2078' => "Directeur Enseignement/Affaires Scolaires",
|
||||
'2079' => "Directeur Espaces Verts",
|
||||
'2080' => "Directeur Grands Projets",
|
||||
'2081' => "Directeur Général Adjoint des Services",
|
||||
'2082' => "Directeur Général des Services",
|
||||
'2083' => "Directeur Général et Administrateur",
|
||||
'2084' => "Directeur Informatique",
|
||||
'2085' => "Directeur Jeunesse/Enseignement",
|
||||
'2086' => "Directeur Nettoiement/Ordures Ménagères",
|
||||
'2087' => "Directeur Politique de la Ville",
|
||||
'2088' => "Directeur Prévention/Sécurité",
|
||||
'2089' => "Directeur Prévention/Sécurité/Environnement",
|
||||
'2090' => "Directeur Rel. Internationales",
|
||||
'2091' => "Directeur Rel. Internationales/Action Culturel",
|
||||
'2092' => "Directeur Santé",
|
||||
'2093' => "Directeur Sports/Emploi/Recrutement",
|
||||
'2094' => "Directeur Tourisme",
|
||||
'2095' => "Directeur Transports/Mobilité Urbaine",
|
||||
'2096' => "Directeur Voirie",
|
||||
'2100' => "Président de section",
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
class MBalo
|
||||
{
|
||||
public function getLibEven($strEven)
|
||||
{
|
||||
$even=9015;
|
||||
$strEven=trim($strEven);
|
||||
if (preg_match("/AUTRES OP.RATIONS . Décisions prises par des assemblées d'obligataires et homologation de résolutions/iu", $strEven)) $even=9001;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Désignation de teneurs? de comptes de titres nominatifs/iu", $strEven)) $even=9002;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Fusions et scissions/iu", $strEven)) $even=9003;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Liquidations/iu", $strEven)) $even=9004;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Offre de remboursement d'obligations/iu", $strEven)) $even=9005;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Réduction de capital/iu", $strEven)) $even=9006;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Regroupement d'actions/iu", $strEven)) $even=9007;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS/iu", $strEven)) $even=9000;
|
||||
elseif (preg_match("/BULLETIN OFFICIEL de l'AMF/iu", $strEven)) $even=9010;
|
||||
elseif (preg_match("/BULLETIN OFFICIEL du CMF/iu", $strEven)) $even=9011;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? d'actionnaires et de porteurs de parts/iu", $strEven)) $even=9020;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? d'obligataires ou de porteurs de titres d'emprunt/iu", $strEven)) $even=9021;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de certificats d'investissement/iu", $strEven)) $even=9022;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de parts de fondateur/iu", $strEven)) $even=9023;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de titres participatifs/iu", $strEven)) $even=9024;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS - Organismes internationaux - Bons, obligations et autres titres/iu", $strEven)) $even=9030;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Actions et parts/iu", $strEven)) $even=9031;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Bons d'options? sur titres et sur indices/iu", $strEven)) $even=9032;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Bons, obligations et autres titres/iu", $strEven)) $even=9033;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs européennes . Actions et parts/iu", $strEven)) $even=9034;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Actions et parts/iu", $strEven)) $even=9035;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Bons d'options? sur titres et sur indices/iu", $strEven)) $even=9036;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Bons, obligations et autres titres/iu", $strEven)) $even=9037;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Certificats d'investissement/iu", $strEven)) $even=9038;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Entreprises d'assurances et organismes de retraites/iu", $strEven)) $even=9040;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles/iu", $strEven)) $even=9041;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Chiffres d'affaires)/iu", $strEven)) $even=9042;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (comptes annuels)/iu", $strEven)) $even=9045;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Tableaux d'activités et résultats)/iu", $strEven)) $even=9044;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Chiffres d'affaires et situations trimestrielles)/iu", $strEven))$even=9043;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Comptes intermédiaires)/iu", $strEven)) $even=9046;
|
||||
//else/*if (preg_match("/AVIS DIVERS/i", $strEven))*/ $even=9015;
|
||||
|
||||
return $even;
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
class MBoamp
|
||||
{
|
||||
public function getCodEvenSd($codEvenBoamp, $strEvenBoamp='')
|
||||
{
|
||||
$codEvenBoamp=str_replace('R','',$codEvenBoamp)*1;
|
||||
switch ($codEvenBoamp) {
|
||||
case 10: $libEvenSd='Annulation'; break;
|
||||
case 11: $libEvenSd='Annulation - Rectificatif'; break;
|
||||
case 20: $libEvenSd='Rectificatif'; break;
|
||||
case 22: $libEvenSd='Procédures accélérées'; break;
|
||||
case 30: $libEvenSd='Avis d\'appel public à la concurrence - Délai d\'urgence'; break;
|
||||
case 33: $libEvenSd='Avis de mise en concurrence'; break;
|
||||
case 44: $libEvenSd='Concessions'; break;
|
||||
case 50: $libEvenSd='Avis d\'appel public à la concurrence'; break;
|
||||
case 51: $libEvenSd='Avis informatifs'; break;
|
||||
case 55: $libEvenSd='Avis d\'appel public à la concurrence'; break;
|
||||
case 6 : $libEvenSd='Avis d\'attribution'; break;
|
||||
case 8 : $libEvenSd='Avis d\'attribution'; break;
|
||||
case 81: $libEvenSd='Avis d\'attribution - Annulation'; break;
|
||||
case 82: $libEvenSd='Avis d\'attribution - Rectificatif'; break;
|
||||
case 83: $libEvenSd='Avis d\'attribution - Rectificatif'; break;
|
||||
case 84: $libEvenSd='Avis d\'attribution comportant des lots infructueux'; break;
|
||||
case 9 : $libEvenSd='Résultat de marché'; break;
|
||||
case 91: $libEvenSd='Résultat de marché - Annulation'; break;
|
||||
case 92: $libEvenSd='Résultat de marché - Rectificatif'; break;
|
||||
case 93: $libEvenSd='Résultat de marché Infructueux/Sans suite'; break;
|
||||
case 94: $libEvenSd='Résultat de marché comportant des lots infructueux'; break;
|
||||
case 96: $libEvenSd='Annulation/Rectificatif/Sans suite/Infructueux'; break;
|
||||
default: $libEvenSd=$strEvenBoamp; break;
|
||||
}
|
||||
if ($strEvenBoamp<>'') return $libEvenSd;
|
||||
|
||||
return substr('95'.$codEvenBoamp.'00',0,4)*1;
|
||||
}
|
||||
|
||||
public function getLibEvenBoamp($codEvenBoamp, $strEvenBoamp='')
|
||||
{
|
||||
return $this->getCodEvenSd($codEvenBoamp, $strEvenBoamp);
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,282 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
1000 => "Entrepreneur Individuel à Responsabilité Limité",
|
||||
1100 => "Artisan Commerçant",
|
||||
1200 => "Commerçant",
|
||||
1300 => "Artisan",
|
||||
1400 => "Officier public ou ministériel",
|
||||
1500 => "Profession libérale",
|
||||
1600 => "Exploitant agricole",
|
||||
1700 => "Agent commercial",
|
||||
1800 => "Associé Gérant de société",
|
||||
1900 => "(Autre) personne physique",
|
||||
2100 => "Indivision",
|
||||
2110 => "Indivision entre personnes physiques",
|
||||
2120 => "Indivision avec personne morale",
|
||||
2200 => "Société créée de fait",
|
||||
2210 => "Société créée de fait entre personnes physiques",
|
||||
2220 => "Société créée de fait avec personne morale",
|
||||
2300 => "Société en participation",
|
||||
2310 => "Société en participation entre personnes physiques",
|
||||
2320 => "Société en participation avec personne morale",
|
||||
2385 => "Société en participation de professions libérales",
|
||||
2400 => "Fiducie",
|
||||
2700 => "Paroisse hors zone concordataire",
|
||||
2900 => "Autre groupement de droit privé non doté de la personnalité morale",
|
||||
3110 => "Représentation ou agence commerciale d'état ou organisme public étranger immatriculé au RCS",
|
||||
3120 => "Société étrangère immatriculée au RCS",
|
||||
3205 => "Organisation internationale",
|
||||
3210 => "État collectivité ou établissement public étranger",
|
||||
3220 => "Société étrangère non immatriculée au RCS",
|
||||
3290 => "(Autre) personne morale de droit étranger",
|
||||
4110 => "Établissement public national à caractère industriel ou commercial doté d'un comptable public",
|
||||
4120 => "Établissement public national à caractère industriel ou commercial non doté d'un comptable public",
|
||||
4130 => "Exploitant public",
|
||||
4140 => "Établissement public local à caractère industriel ou commercial",
|
||||
4150 => "Régie d'une collectivité locale à caractère industriel ou commercial",
|
||||
4160 => "Institution Banque de France",
|
||||
5191 => "Société de caution mutuelle",
|
||||
5192 => "Société coopérative de banque populaire",
|
||||
5193 => "Caisse de crédit maritime mutuel",
|
||||
5194 => "Caisse (fédérale) de crédit mutuel",
|
||||
5195 => "Association coopérative inscrite (droit local Alsace Moselle)",
|
||||
5196 => "Caisse d'épargne et de prévoyance à forme coopérative",
|
||||
5202 => "Société en nom collectif",
|
||||
5203 => "Société en nom collectif coopérative",
|
||||
5306 => "Société en commandite simple",
|
||||
5307 => "Société en commandite simple coopérative",
|
||||
5308 => "Société en commandite par actions",
|
||||
5309 => "Société en commandite par actions coopérative",
|
||||
5370 => "Société de Participations Financières de Profession Libérale Société en commandite par actions",
|
||||
5385 => "Société d'exercice libéral en commandite par action",
|
||||
5410 => "SARL nationale",
|
||||
5415 => "SARL d'économie mixte",
|
||||
5422 => "SARL immobilière pour le commerce et l'industrie (SICOMI)",
|
||||
5426 => "Société immobilière de gestion",
|
||||
5430 => "Safer en SARL",
|
||||
5431 => "SARL mixte d'intérêt agricole",
|
||||
5432 => "SARL d'intérêt collectif agricole",
|
||||
5442 => "SARL d'attribution",
|
||||
5443 => "SARL coopérative de construction",
|
||||
5451 => "SARL coopérative de consommation",
|
||||
5453 => "SARL coopérative artisanale",
|
||||
5454 => "SARL coopérative d'intérêt maritime",
|
||||
5455 => "SARL coopérative de transports",
|
||||
5458 => "SARL coopérative ouvrière de production",
|
||||
5459 => "SARL union de sociétés coopératives",
|
||||
5460 => "Autre SARL coopérative",
|
||||
5470 => "Société de Participations Financières de Profession Libérale en SARL",
|
||||
5485 => "Société d'exercice libéral à responsabilité limitée",
|
||||
5488 => "Entreprise Unipersonnelle à Responsabilité Limitée",
|
||||
5498 => "SARL unipersonnelle",
|
||||
5499 => "Autre société à responsabilité limitée",
|
||||
5505 => "SA à participation ouvrière à conseil d'administration",
|
||||
5510 => "SA nationale à conseil d'administration",
|
||||
5515 => "SA d'économie mixte à conseil d'administration",
|
||||
5520 => "Société d'investissement à capital variable (SICAV) à conseil d'administration",
|
||||
5522 => "Société anonyme immobilière pour le commerce et l'industrie (SICOMI) à conseil d'administration",
|
||||
5525 => "Société anonyme immobilière d'investissement à conseil d'administration",
|
||||
5530 => "Safer anonyme à conseil d'administration",
|
||||
5531 => "Société anonyme mixte d'intérêt agricole (SMIA) à conseil d'administration",
|
||||
5532 => "Société anonyme mixte d'intérêt collectif agricole (SICA) à conseil d'administration",
|
||||
5542 => "Société anonyme d'attribution à conseil d'administration",
|
||||
5543 => "Société anonyme coopérative de construction à conseil d'administration",
|
||||
5546 => "SA de HLM à conseil d'administration",
|
||||
5547 => "SA coopérative de production de HLM à conseil d'administration",
|
||||
5548 => "SA de crédit immobilier à conseil d'administration",
|
||||
5551 => "SA coopérative de consommation à conseil d'administration",
|
||||
5552 => "SA coopérative de commerçants détaillants à conseil d'administration",
|
||||
5553 => "SA coopérative artisanale à conseil d'administration",
|
||||
5554 => "SA coopérative (d'intérêt) maritime à conseil d'administration",
|
||||
5555 => "SA coopérative de transports à conseil d'administration",
|
||||
5558 => "SA coopérative ouvrière de production (SCOP) à conseil d'administration",
|
||||
5559 => "SA union de sociétés coopératives à conseil d'administration",
|
||||
5560 => "Autre SA coopérative à conseil d'administration",
|
||||
5570 => "Société de Participations Financières de Profession Libérale en SA à conseil d'administration",
|
||||
5585 => "Société d'exercice libéral à forme anonyme à conseil d'administration",
|
||||
5599 => "Autre SA à conseil d'administration",
|
||||
5605 => "SA à participation ouvrière à directoire",
|
||||
5610 => "SA nationale à directoire",
|
||||
5615 => "SA d'économie mixte à directoire",
|
||||
5620 => "Société d'investissement à capital variable (SICAV) à directoire",
|
||||
5622 => "Société immobilière pour le commerce et l'industrie (SICOMI) anonyme à directoire",
|
||||
5625 => "Société immobilière d'investissement anonyme à directoire",
|
||||
5630 => "Safer anonyme à directoire",
|
||||
5631 => "Société anonyme mixte d'intérêt agricole",
|
||||
5632 => "Société anonyme d'intérêt collectif agricole",
|
||||
5642 => "Société anonyme d'attribution à directoire",
|
||||
5643 => "Société anonyme coopérative de construction à directoire",
|
||||
5646 => "Société anonyme de HLM à directoire",
|
||||
5647 => "Société coopérative de production de HLM anonyme à directoire",
|
||||
5648 => "SA de crédit immobilier à directoire",
|
||||
5651 => "SA coopérative de consommation à directoire",
|
||||
5652 => "SA coopérative de commerçants détaillants à directoire",
|
||||
5653 => "SA coopérative artisanale à directoire",
|
||||
5654 => "SA coopérative (d'intérêt) maritime à directoire",
|
||||
5655 => "SA coopérative de transport à directoire",
|
||||
5658 => "SA coopérative ouvrière de production (SCOP) à directoire",
|
||||
5659 => "SA union de sociétés coopératives à directoire",
|
||||
5660 => "(Autre) SA coopérative à directoire",
|
||||
5670 => "Société de Participations Financières de Profession Libérale en SA à Directoire",
|
||||
5685 => "Société d'exercice libéral à forme anonyme à directoire",
|
||||
5699 => "Autre SA à directoire",
|
||||
5710 => "Société par actions simplifiée",
|
||||
5720 => "Société par actions simplifiée à associé unique ou société par actions simplifiée unipersonnelle",
|
||||
5770 => "Société de Participations Financières de Profession Libérale en SAS",
|
||||
5785 => "Société d’exercice libéral par action simplifiée",
|
||||
5800 => "Société européenne",
|
||||
6100 => "Caisse d’épargne et de prévoyance",
|
||||
6200 => "Groupement d'intérêt économique",
|
||||
6210 => "Groupement européen d’intérêt économique",
|
||||
6220 => "Groupement d’intérêt économique",
|
||||
6316 => "Coopérative d’utilisation de matériel agricole en commun",
|
||||
6317 => "Société coopérative agricole",
|
||||
6318 => "Union de sociétés coopératives agricoles",
|
||||
6411 => "Société d’assurance mutuelle",
|
||||
6412 => "Société mutuelle d'assurance",
|
||||
6413 => "Union de sociétés mutuelles d'assurances",
|
||||
6414 => "Autre société non commerciale d'assurance",
|
||||
6511 => "Société Interprofessionnelle de Soins Ambulatoires",
|
||||
6521 => "Société civile de placement collectif immobilier",
|
||||
6532 => "Société civile d’intérêt collectif agricole",
|
||||
6533 => "Groupement agricole d’exploitation en commun",
|
||||
6534 => "Groupement foncier agricole",
|
||||
6535 => "Groupement agricole foncier",
|
||||
6536 => "Groupement forestier",
|
||||
6537 => "Groupement pastoral",
|
||||
6538 => "Groupement foncier rural",
|
||||
6539 => "Société civile foncière",
|
||||
6540 => "Société civile immobilière",
|
||||
6541 => "Société civile immobilière de construction vente",
|
||||
6542 => "Société civile d’attribution",
|
||||
6543 => "Société civile coopérative de construction",
|
||||
6544 => "Société immobilière d'accession progressive à la propriété",
|
||||
6551 => "Société civile coopérative de consommation",
|
||||
6554 => "Société civile coopérative (d’intérêt) maritime",
|
||||
6558 => "Société civile coopérative entre médecins",
|
||||
6560 => "Autre société civile coopérative",
|
||||
6561 => "SCP d’avocats",
|
||||
6562 => "SCP d’avocats aux conseil",
|
||||
6563 => "SCP d’avoués d’appel",
|
||||
6564 => "SCP d'huissiers",
|
||||
6565 => "SCP de notaires",
|
||||
6566 => "SCP de commissaires-priseurs",
|
||||
6567 => "SCP de greffiers de tribunal de commerce",
|
||||
6568 => "SCP de conseils juridiques",
|
||||
6569 => "SCP de commissaires aux comptes",
|
||||
6571 => "SCP de médecins",
|
||||
6572 => "SCP de dentistes",
|
||||
6573 => "SCP d’infirmiers",
|
||||
6574 => "SCP de masseurs kinésithérapeutes",
|
||||
6575 => "SCP de directeurs de laboratoire d’analyse médicale",
|
||||
6576 => "SCP de vétérinaires",
|
||||
6577 => "SCP de géomètres-experts",
|
||||
6578 => "SCP d’architectes",
|
||||
6585 => "(Autres) Société Civile professionnelle",
|
||||
6588 => "Société civile laitière",
|
||||
6589 => "Société civile de moyens",
|
||||
6595 => "Caisse (locale) de crédit mutuel",
|
||||
6596 => "Caisse de crédit agricole mutuel",
|
||||
6597 => "Société civile d’exploitation agricole",
|
||||
6598 => "Exploitation agricole à responsabilité limitée",
|
||||
6599 => "Autre société civile",
|
||||
6901 => "Autres personnes de droit privé inscrites au registre du commerce et des sociétés",
|
||||
7111 => "Autorité constitutionnelle",
|
||||
7112 => "Autorité administrative indépendante",
|
||||
7113 => "Ministère",
|
||||
7120 => "Service central d’un ministère",
|
||||
7130 => "Service du ministère des Postes et Télécommunications",
|
||||
7150 => "Service du ministère de la Défense",
|
||||
7160 => "Service déconcentré à compétence nation. D’un ministère (hors Défense)",
|
||||
7171 => "Service déconcentré de l’État à compétence (inter) régionale",
|
||||
7172 => "Service déconcentré de l’État à compétence (inter) départementale",
|
||||
7179 => "(Autre) Service déconcentré de l’État à compétence territoriale",
|
||||
7190 => "Ecole nationale non dotée de la personnalité morale",
|
||||
7210 => "Commune et commune nouvelle",
|
||||
7220 => "Département",
|
||||
7225 => "Collectivité et territoire d'Outre Mer",
|
||||
7229 => "(Autre) Collectivité territoriale",
|
||||
7230 => "Région",
|
||||
7312 => "Commune associée et commune déléguée",
|
||||
7313 => "Section de commune",
|
||||
7314 => "Ensemble urbain",
|
||||
7321 => "Association syndicale autorisée",
|
||||
7322 => "Association foncière urbaine",
|
||||
7323 => "Association foncière de remembrement",
|
||||
7331 => "Établissement public local d’enseignement",
|
||||
7340 => "Pôle métropolitain",
|
||||
7341 => "Secteur de commune",
|
||||
7342 => "District urbain",
|
||||
7343 => "Communauté urbaine",
|
||||
7344 => "Métropole",
|
||||
7345 => "Syndicat intercommunal à vocation multiple",
|
||||
7346 => "Communauté de communes",
|
||||
7347 => "Communauté de villes",
|
||||
7348 => "Communauté d'agglomération",
|
||||
7349 => "Autre établissement public local de coopération non spécialisé ou entente",
|
||||
7351 => "Institution interdépartemental ou entente",
|
||||
7352 => "Institution interrégionale ou entente",
|
||||
7353 => "Syndicat intercommunal à vocation unique",
|
||||
7354 => "Syndicat mixte communal",
|
||||
7355 => "Autre syndicat mixte",
|
||||
7356 => "Commission syndicale pour la gestion des biens indivis des communes",
|
||||
7361 => "Centre communal d'action sociale",
|
||||
7362 => "Caisse des écoles",
|
||||
7363 => "Caisse de crédit municipal",
|
||||
7364 => "Établissement d'hospitalisation",
|
||||
7365 => "Syndicat inter hospitalier",
|
||||
7366 => "Établissement public local social et médico-social",
|
||||
7371 => "Office public d'habitation à loyer modéré",
|
||||
7372 => "Service départemental d'incendie",
|
||||
7373 => "Établissement public local culturel",
|
||||
7378 => "Régie d'une collectivité locale à caractère administratif",
|
||||
7379 => "(Autre) Établissement public administratif local",
|
||||
7381 => "Organisme consulaire",
|
||||
7382 => "Établissement public national ayant fonction d'administration centrale",
|
||||
7383 => "Établissement public national à caractère scientifique culturel et professionnel",
|
||||
7384 => "Autre établissement public national d'enseignement",
|
||||
7385 => "Autre établissement public national administratif à compétence territoriale limitée",
|
||||
7389 => "Établissement public national à caractère administratif",
|
||||
7410 => "Groupement d'intérêt public",
|
||||
7430 => "Établissement public des cultes d'Alsace-Lorraine",
|
||||
7450 => "Etablissement public administratif, cercle et foyer dans les armées",
|
||||
7470 => "Groupement de coopération sanitaire à gestion publique",
|
||||
7490 => "Autre personne morale de droit administratif",
|
||||
7510 => "Service d'une collectivité locale à comptabilité distincte",
|
||||
7520 => "Régie d'une collectivité locale non dotée de la personnalité morale",
|
||||
8110 => "Régime général de la sécurité sociale",
|
||||
8120 => "Régime spécial de sécurité sociale",
|
||||
8130 => "Institution de retraite complémentaire",
|
||||
8140 => "Mutualité sociale agricole",
|
||||
8150 => "Régime maladie des non-salariés non agricoles",
|
||||
8160 => "Régime vieillesse ne dépendant pas du régime général de la sécurité sociale",
|
||||
8170 => "Régime d'assurance chômage",
|
||||
8190 => "Autre régime de prévoyance sociale",
|
||||
8210 => "Mutuelle",
|
||||
8250 => "Assurance mutuelle agricole",
|
||||
8290 => "Autre organisme mutualiste",
|
||||
8310 => "Comité central d'entreprise",
|
||||
8311 => "Comité d'établissement",
|
||||
8410 => "Syndicat de salariés",
|
||||
8420 => "Syndicat patronal",
|
||||
8450 => "Ordre professionnel ou assimilé",
|
||||
8470 => "Centre technique industriel ou comité professionnel du développement économique",
|
||||
8490 => "Autre organisme professionnel",
|
||||
8510 => "Institution de prévoyance",
|
||||
8520 => "Institution de retraite supplémentaire ",
|
||||
9110 => "Syndicat de copropriété",
|
||||
9150 => "Association syndicale libre",
|
||||
9210 => "Association non déclarée",
|
||||
9220 => "Association déclarée",
|
||||
9221 => "Association déclarée \"entreprises d'insertion par l'économique\"",
|
||||
9222 => "Association intermédiaire",
|
||||
9223 => "Groupement d'employeurs",
|
||||
9224 => "Association d'avocats à responsabilité professionnelle individuelle",
|
||||
9230 => "Association déclarée reconnue d'utilité publique",
|
||||
9240 => "Congrégation",
|
||||
9260 => "Association de droit local",
|
||||
9300 => "Fondation",
|
||||
9900 => "Autre personne morale de droit privé",
|
||||
9970 => "Groupement de coopération sanitaire à gestion privée",
|
||||
6500 => "",
|
||||
);
|
@ -1,747 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
'0111Z' => "A111",
|
||||
'0112Z' => "A112",
|
||||
'0113Z' => "A113",
|
||||
'0114Z' => "A114",
|
||||
'0115Z' => "A115",
|
||||
'0116Z' => "A116",
|
||||
'0119Z' => "A119",
|
||||
'0121Z' => "A121",
|
||||
'0122Z' => "A122",
|
||||
'0123Z' => "A123",
|
||||
'0124Z' => "A124",
|
||||
'0125Z' => "A125",
|
||||
'0126Z' => "A126",
|
||||
'0127Z' => "A127",
|
||||
'0128Z' => "A128",
|
||||
'0129Z' => "A129",
|
||||
'0130Z' => "A130",
|
||||
'0141Z' => "A141",
|
||||
'0142Z' => "A142",
|
||||
'0143Z' => "A143",
|
||||
'0144Z' => "A144",
|
||||
'0145Z' => "A145",
|
||||
'0146Z' => "A146",
|
||||
'0147Z' => "A147",
|
||||
'0149Z' => "A149",
|
||||
'0150Z' => "A150",
|
||||
'0161Z' => "A161",
|
||||
'0162Z' => "A162",
|
||||
'0163Z' => "A163",
|
||||
'0164Z' => "A164",
|
||||
'0170Z' => "A170",
|
||||
'0210Z' => "A210",
|
||||
'0220Z' => "A220",
|
||||
'0230Z' => "A230",
|
||||
'0240Z' => "A240",
|
||||
'0311Z' => "A311",
|
||||
'0312Z' => "A312",
|
||||
'0321Z' => "A321",
|
||||
'0322Z' => "A322",
|
||||
'0510Z' => "B510",
|
||||
'0520Z' => "B520",
|
||||
'0610Z' => "B610",
|
||||
'0620Z' => "B620",
|
||||
'0710Z' => "B710",
|
||||
'0721Z' => "B721",
|
||||
'0729Z' => "B729",
|
||||
'0811Z' => "B811",
|
||||
'0812Z' => "B812",
|
||||
'0891Z' => "B891",
|
||||
'0892Z' => "B892",
|
||||
'0893Z' => "B893",
|
||||
'0899Z' => "B899",
|
||||
'0910Z' => "B910",
|
||||
'0990Z' => "B990",
|
||||
'1011Z' => "C1011",
|
||||
'1012Z' => "C1012",
|
||||
'1013A' => "C1013",
|
||||
'1013B' => "C1013",
|
||||
'1020Z' => "C1020",
|
||||
'1031Z' => "C1031",
|
||||
'1032Z' => "C1032",
|
||||
'1039A' => "C1039",
|
||||
'1039B' => "C1039",
|
||||
'1041A' => "C1041",
|
||||
'1041B' => "C1041",
|
||||
'1042Z' => "C1042",
|
||||
'1051A' => "C1051",
|
||||
'1051B' => "C1051",
|
||||
'1051C' => "C1051",
|
||||
'1051D' => "C1051",
|
||||
'1052Z' => "C1052",
|
||||
'1061A' => "C1061",
|
||||
'1061B' => "C1061",
|
||||
'1062Z' => "C1062",
|
||||
'1071A' => "C1071",
|
||||
'1071B' => "C1071",
|
||||
'1071C' => "C1071",
|
||||
'1071D' => "C1071",
|
||||
'1072Z' => "C1072",
|
||||
'1073Z' => "C1073",
|
||||
'1081Z' => "C1081",
|
||||
'1082Z' => "C1082",
|
||||
'1083Z' => "C1083",
|
||||
'1084Z' => "C1084",
|
||||
'1085Z' => "C1085",
|
||||
'1086Z' => "C1086",
|
||||
'1089Z' => "C1089",
|
||||
'1091Z' => "C1091",
|
||||
'1092Z' => "C1092",
|
||||
'1101Z' => "C1101",
|
||||
'1102A' => "C1102",
|
||||
'1102B' => "C1102",
|
||||
'1103Z' => "C1103",
|
||||
'1104Z' => "C1104",
|
||||
'1105Z' => "C1105",
|
||||
'1106Z' => "C1106",
|
||||
'1107A' => "C1107",
|
||||
'1107B' => "C1107",
|
||||
'1200Z' => "C1200",
|
||||
'1310Z' => "C1310",
|
||||
'1320Z' => "C1320",
|
||||
'1330Z' => "C1330",
|
||||
'1391Z' => "C1391",
|
||||
'1392Z' => "C1392",
|
||||
'1393Z' => "C1393",
|
||||
'1394Z' => "C1394",
|
||||
'1395Z' => "C1395",
|
||||
'1396Z' => "C1396",
|
||||
'1399Z' => "C1399",
|
||||
'1411Z' => "C1411",
|
||||
'1412Z' => "C1412",
|
||||
'1413Z' => "C1413",
|
||||
'1414Z' => "C1414",
|
||||
'1419Z' => "C1419",
|
||||
'1420Z' => "C1420",
|
||||
'1431Z' => "C1431",
|
||||
'1439Z' => "C1439",
|
||||
'1511Z' => "C1511",
|
||||
'1512Z' => "C1512",
|
||||
'1520Z' => "C1520",
|
||||
'1610A' => "C1610",
|
||||
'1610B' => "C1610",
|
||||
'1621Z' => "C1621",
|
||||
'1622Z' => "C1622",
|
||||
'1623Z' => "C1623",
|
||||
'1624Z' => "C1624",
|
||||
'1629Z' => "C1629",
|
||||
'1711Z' => "C1711",
|
||||
'1712Z' => "C1712",
|
||||
'1721A' => "C1721",
|
||||
'1721B' => "C1721",
|
||||
'1721C' => "C1721",
|
||||
'1722Z' => "C1722",
|
||||
'1723Z' => "C1723",
|
||||
'1724Z' => "C1724",
|
||||
'1729Z' => "C1729",
|
||||
'1811Z' => "C1811",
|
||||
'1812Z' => "C1812",
|
||||
'1813Z' => "C1813",
|
||||
'1814Z' => "C1814",
|
||||
'1820Z' => "C1820",
|
||||
'1910Z' => "C1910",
|
||||
'1920Z' => "C1920",
|
||||
'2011Z' => "C2011",
|
||||
'2012Z' => "C2012",
|
||||
'2013A' => "C2013",
|
||||
'2013B' => "C2013",
|
||||
'2014Z' => "C2014",
|
||||
'2015Z' => "C2015",
|
||||
'2016Z' => "C2016",
|
||||
'2017Z' => "C2017",
|
||||
'2020Z' => "C2020",
|
||||
'2030Z' => "C2030",
|
||||
'2041Z' => "C2041",
|
||||
'2042Z' => "C2042",
|
||||
'2051Z' => "C2051",
|
||||
'2052Z' => "C2052",
|
||||
'2053Z' => "C2053",
|
||||
'2059Z' => "C2059",
|
||||
'2060Z' => "C2060",
|
||||
'2110Z' => "C2110",
|
||||
'2120Z' => "C2120",
|
||||
'2211Z' => "C2211",
|
||||
'2219Z' => "C2219",
|
||||
'2221Z' => "C2221",
|
||||
'2222Z' => "C2222",
|
||||
'2223Z' => "C2223",
|
||||
'2229A' => "C2229",
|
||||
'2229B' => "C2229",
|
||||
'2311Z' => "C2311",
|
||||
'2312Z' => "C2312",
|
||||
'2313Z' => "C2313",
|
||||
'2314Z' => "C2314",
|
||||
'2319Z' => "C2319",
|
||||
'2320Z' => "C2320",
|
||||
'2331Z' => "C2331",
|
||||
'2332Z' => "C2332",
|
||||
'2341Z' => "C2341",
|
||||
'2342Z' => "C2342",
|
||||
'2343Z' => "C2343",
|
||||
'2344Z' => "C2344",
|
||||
'2349Z' => "C2349",
|
||||
'2351Z' => "C2351",
|
||||
'2352Z' => "C2352",
|
||||
'2361Z' => "C2361",
|
||||
'2362Z' => "C2362",
|
||||
'2363Z' => "C2363",
|
||||
'2364Z' => "C2364",
|
||||
'2365Z' => "C2365",
|
||||
'2369Z' => "C2369",
|
||||
'2370Z' => "C2370",
|
||||
'2391Z' => "C2391",
|
||||
'2399Z' => "C2399",
|
||||
'2410Z' => "C2410",
|
||||
'2420Z' => "C2420",
|
||||
'2431Z' => "C2431",
|
||||
'2432Z' => "C2432",
|
||||
'2433Z' => "C2433",
|
||||
'2434Z' => "C2434",
|
||||
'2441Z' => "C2441",
|
||||
'2442Z' => "C2442",
|
||||
'2443Z' => "C2443",
|
||||
'2444Z' => "C2444",
|
||||
'2445Z' => "C2445",
|
||||
'2446Z' => "C2446",
|
||||
'2451Z' => "C2451",
|
||||
'2452Z' => "C2452",
|
||||
'2453Z' => "C2453",
|
||||
'2454Z' => "C2454",
|
||||
'2511Z' => "C2511",
|
||||
'2512Z' => "C2512",
|
||||
'2521Z' => "C2521",
|
||||
'2529Z' => "C2529",
|
||||
'2530Z' => "C2530",
|
||||
'2540Z' => "C2540",
|
||||
'2550A' => "C2550",
|
||||
'2550B' => "C2550",
|
||||
'2561Z' => "C2561",
|
||||
'2562A' => "C2562",
|
||||
'2562B' => "C2562",
|
||||
'2571Z' => "C2571",
|
||||
'2572Z' => "C2572",
|
||||
'2573A' => "C2573",
|
||||
'2573B' => "C2573",
|
||||
'2591Z' => "C2591",
|
||||
'2592Z' => "C2592",
|
||||
'2593Z' => "C2593",
|
||||
'2594Z' => "C2594",
|
||||
'2599A' => "C2599",
|
||||
'2599B' => "C2599",
|
||||
'2611Z' => "C2611",
|
||||
'2612Z' => "C2612",
|
||||
'2620Z' => "C2620",
|
||||
'2630Z' => "C2630",
|
||||
'2640Z' => "C2640",
|
||||
'2651A' => "C2651",
|
||||
'2651B' => "C2651",
|
||||
'2652Z' => "C2652",
|
||||
'2660Z' => "C2660",
|
||||
'2670Z' => "C2670",
|
||||
'2680Z' => "C2680",
|
||||
'2711Z' => "C2711",
|
||||
'2712Z' => "C2712",
|
||||
'2720Z' => "C2720",
|
||||
'2731Z' => "C2731",
|
||||
'2732Z' => "C2732",
|
||||
'2733Z' => "C2733",
|
||||
'2740Z' => "C2740",
|
||||
'2751Z' => "C2751",
|
||||
'2752Z' => "C2752",
|
||||
'2790Z' => "C2790",
|
||||
'2811Z' => "C2811",
|
||||
'2812Z' => "C2812",
|
||||
'2813Z' => "C2813",
|
||||
'2814Z' => "C2814",
|
||||
'2815Z' => "C2815",
|
||||
'2821Z' => "C2821",
|
||||
'2822Z' => "C2822",
|
||||
'2823Z' => "C2823",
|
||||
'2824Z' => "C2824",
|
||||
'2825Z' => "C2825",
|
||||
'2829A' => "C2829",
|
||||
'2829B' => "C2829",
|
||||
'2830Z' => "C2830",
|
||||
'2841Z' => "C2841",
|
||||
'2849Z' => "C2849",
|
||||
'2891Z' => "C2891",
|
||||
'2892Z' => "C2892",
|
||||
'2893Z' => "C2893",
|
||||
'2894Z' => "C2894",
|
||||
'2895Z' => "C2895",
|
||||
'2896Z' => "C2896",
|
||||
'2899A' => "C2899",
|
||||
'2899B' => "C2899",
|
||||
'2910Z' => "C2910",
|
||||
'2920Z' => "C2920",
|
||||
'2931Z' => "C2931",
|
||||
'2932Z' => "C2932",
|
||||
'3011Z' => "C3011",
|
||||
'3012Z' => "C3012",
|
||||
'3020Z' => "C3020",
|
||||
'3030Z' => "C3030",
|
||||
'3040Z' => "C3040",
|
||||
'3091Z' => "C3091",
|
||||
'3092Z' => "C3092",
|
||||
'3099Z' => "C3099",
|
||||
'3101Z' => "C3101",
|
||||
'3102Z' => "C3102",
|
||||
'3103Z' => "C3103",
|
||||
'3109A' => "C3109",
|
||||
'3109B' => "C3109",
|
||||
'3211Z' => "C3211",
|
||||
'3212Z' => "C3212",
|
||||
'3213Z' => "C3213",
|
||||
'3220Z' => "C3220",
|
||||
'3230Z' => "C3230",
|
||||
'3240Z' => "C3240",
|
||||
'3250A' => "C3250",
|
||||
'3250B' => "C3250",
|
||||
'3291Z' => "C3291",
|
||||
'3299Z' => "C3299",
|
||||
'3311Z' => "C3311",
|
||||
'3312Z' => "C3312",
|
||||
'3313Z' => "C3313",
|
||||
'3314Z' => "C3314",
|
||||
'3315Z' => "C3315",
|
||||
'3316Z' => "C3316",
|
||||
'3317Z' => "C3317",
|
||||
'3319Z' => "C3319",
|
||||
'3320A' => "C3320",
|
||||
'3320B' => "C3320",
|
||||
'3320C' => "C3320",
|
||||
'3320D' => "C3320",
|
||||
'3511Z' => "D3511",
|
||||
'3512Z' => "D3512",
|
||||
'3513Z' => "D3513",
|
||||
'3514Z' => "D3514",
|
||||
'3521Z' => "D3521",
|
||||
'3522Z' => "D3522",
|
||||
'3523Z' => "D3523",
|
||||
'3530Z' => "D3530",
|
||||
'3600Z' => "E3600",
|
||||
'3700Z' => "E3700",
|
||||
'3811Z' => "E3811",
|
||||
'3812Z' => "E3812",
|
||||
'3821Z' => "E3821",
|
||||
'3822Z' => "E3822",
|
||||
'3831Z' => "E3831",
|
||||
'3832Z' => "E3832",
|
||||
'3900Z' => "E3900",
|
||||
'4110A' => "F4110",
|
||||
'4110B' => "F4110",
|
||||
'4110C' => "F4110",
|
||||
'4110D' => "F4110",
|
||||
'4120A' => "F4120",
|
||||
'4120B' => "F4120",
|
||||
'4211Z' => "F4211",
|
||||
'4212Z' => "F4212",
|
||||
'4213A' => "F4213",
|
||||
'4213B' => "F4213",
|
||||
'4221Z' => "F4221",
|
||||
'4222Z' => "F4222",
|
||||
'4291Z' => "F4291",
|
||||
'4299Z' => "F4299",
|
||||
'4311Z' => "F4311",
|
||||
'4312A' => "F4312",
|
||||
'4312B' => "F4312",
|
||||
'4313Z' => "F4313",
|
||||
'4321A' => "F4321",
|
||||
'4321B' => "F4321",
|
||||
'4322A' => "F4322",
|
||||
'4322B' => "F4322",
|
||||
'4329A' => "F4329",
|
||||
'4329B' => "F4329",
|
||||
'4331Z' => "F4331",
|
||||
'4332A' => "F4332",
|
||||
'4332B' => "F4332",
|
||||
'4332C' => "F4332",
|
||||
'4333Z' => "F4333",
|
||||
'4334Z' => "F4334",
|
||||
'4339Z' => "F4339",
|
||||
'4391A' => "F4391",
|
||||
'4391B' => "F4391",
|
||||
'4399A' => "F4399",
|
||||
'4399B' => "F4399",
|
||||
'4399C' => "F4399",
|
||||
'4399D' => "F4399",
|
||||
'4399E' => "F4399",
|
||||
'4511Z' => "G4511",
|
||||
'4519Z' => "G4519",
|
||||
'4520A' => "G4520",
|
||||
'4520B' => "G4520",
|
||||
'4531Z' => "G4531",
|
||||
'4532Z' => "G4532",
|
||||
'4540Z' => "G4540",
|
||||
'4611Z' => "G4611",
|
||||
'4612A' => "G4612",
|
||||
'4612B' => "G4612",
|
||||
'4613Z' => "G4613",
|
||||
'4614Z' => "G4614",
|
||||
'4615Z' => "G4615",
|
||||
'4616Z' => "G4616",
|
||||
'4617A' => "G4617",
|
||||
'4617B' => "G4617",
|
||||
'4618Z' => "G4618",
|
||||
'4619A' => "G4619",
|
||||
'4619B' => "G4619",
|
||||
'4621Z' => "G4621",
|
||||
'4622Z' => "G4622",
|
||||
'4623Z' => "G4623",
|
||||
'4624Z' => "G4624",
|
||||
'4631Z' => "G4631",
|
||||
'4632A' => "G4632",
|
||||
'4632B' => "G4632",
|
||||
'4632C' => "G4632",
|
||||
'4633Z' => "G4633",
|
||||
'4634Z' => "G4634",
|
||||
'4635Z' => "G4635",
|
||||
'4636Z' => "G4636",
|
||||
'4637Z' => "G4637",
|
||||
'4638A' => "G4638",
|
||||
'4638B' => "G4638",
|
||||
'4639A' => "G4639",
|
||||
'4639B' => "G4639",
|
||||
'4641Z' => "G4641",
|
||||
'4642Z' => "G4642",
|
||||
'4643Z' => "G4643",
|
||||
'4644Z' => "G4644",
|
||||
'4645Z' => "G4645",
|
||||
'4646Z' => "G4646",
|
||||
'4647Z' => "G4647",
|
||||
'4648Z' => "G4648",
|
||||
'4649Z' => "G4649",
|
||||
'4651Z' => "G4651",
|
||||
'4652Z' => "G4652",
|
||||
'4661Z' => "G4661",
|
||||
'4662Z' => "G4662",
|
||||
'4663Z' => "G4663",
|
||||
'4664Z' => "G4664",
|
||||
'4665Z' => "G4665",
|
||||
'4666Z' => "G4666",
|
||||
'4669A' => "G4669",
|
||||
'4669B' => "G4669",
|
||||
'4669C' => "G4669",
|
||||
'4671Z' => "G4671",
|
||||
'4672Z' => "G4672",
|
||||
'4673A' => "G4673",
|
||||
'4673B' => "G4673",
|
||||
'4674A' => "G4674",
|
||||
'4674B' => "G4674",
|
||||
'4675Z' => "G4675",
|
||||
'4676Z' => "G4676",
|
||||
'4677Z' => "G4677",
|
||||
'4690Z' => "G4690",
|
||||
'4711A' => "G4711",
|
||||
'4711B' => "G4711",
|
||||
'4711C' => "G4711",
|
||||
'4711D' => "G4711",
|
||||
'4711E' => "G4711",
|
||||
'4711F' => "G4711",
|
||||
'4719A' => "G4719",
|
||||
'4719B' => "G4719",
|
||||
'4721Z' => "G4721",
|
||||
'4722Z' => "G4722",
|
||||
'4723Z' => "G4723",
|
||||
'4724Z' => "G4724",
|
||||
'4725Z' => "G4725",
|
||||
'4726Z' => "G4726",
|
||||
'4729Z' => "G4729",
|
||||
'4730Z' => "G4730",
|
||||
'4741Z' => "G4741",
|
||||
'4742Z' => "G4742",
|
||||
'4743Z' => "G4743",
|
||||
'4751Z' => "G4751",
|
||||
'4752A' => "G4752",
|
||||
'4752B' => "G4752",
|
||||
'4753Z' => "G4753",
|
||||
'4754Z' => "G4754",
|
||||
'4759A' => "G4759",
|
||||
'4759B' => "G4759",
|
||||
'4761Z' => "G4761",
|
||||
'4762Z' => "G4762",
|
||||
'4763Z' => "G4763",
|
||||
'4764Z' => "G4764",
|
||||
'4765Z' => "G4765",
|
||||
'4771Z' => "G4771",
|
||||
'4772A' => "G4772",
|
||||
'4772B' => "G4772",
|
||||
'4773Z' => "G4773",
|
||||
'4774Z' => "G4774",
|
||||
'4775Z' => "G4775",
|
||||
'4776Z' => "G4776",
|
||||
'4777Z' => "G4777",
|
||||
'4778A' => "G4778",
|
||||
'4778B' => "G4778",
|
||||
'4778C' => "G4778",
|
||||
'4779Z' => "G4779",
|
||||
'4781Z' => "G4781",
|
||||
'4782Z' => "G4782",
|
||||
'4789Z' => "G4789",
|
||||
'4791A' => "G4791",
|
||||
'4791B' => "G4791",
|
||||
'4799A' => "G4799",
|
||||
'4799B' => "G4799",
|
||||
'4910Z' => "H4910",
|
||||
'4920Z' => "H4920",
|
||||
'4931Z' => "H4931",
|
||||
'4932Z' => "H4932",
|
||||
'4939A' => "H4939",
|
||||
'4939B' => "H4939",
|
||||
'4939C' => "H4939",
|
||||
'4941A' => "H4941",
|
||||
'4941B' => "H4941",
|
||||
'4941C' => "H4941",
|
||||
'4942Z' => "H4942",
|
||||
'4950Z' => "H4950",
|
||||
'5010Z' => "H5010",
|
||||
'5020Z' => "H5020",
|
||||
'5030Z' => "H5030",
|
||||
'5040Z' => "H5040",
|
||||
'5110Z' => "H5110",
|
||||
'5121Z' => "H5121",
|
||||
'5122Z' => "H5122",
|
||||
'5210A' => "H5210",
|
||||
'5210B' => "H5210",
|
||||
'5221Z' => "H5221",
|
||||
'5222Z' => "H5222",
|
||||
'5223Z' => "H5223",
|
||||
'5224A' => "H5224",
|
||||
'5224B' => "H5224",
|
||||
'5229A' => "H5229",
|
||||
'5229B' => "H5229",
|
||||
'5310Z' => "H5310",
|
||||
'5320Z' => "H5320",
|
||||
'5510Z' => "I5510",
|
||||
'5520Z' => "I5520",
|
||||
'5530Z' => "I5530",
|
||||
'5590Z' => "I5590",
|
||||
'5610A' => "I5610",
|
||||
'5610B' => "I5610",
|
||||
'5610C' => "I5610",
|
||||
'5621Z' => "I5621",
|
||||
'5629A' => "I5629",
|
||||
'5629B' => "I5629",
|
||||
'5630Z' => "I5630",
|
||||
'5811Z' => "J5811",
|
||||
'5812Z' => "J5812",
|
||||
'5813Z' => "J5813",
|
||||
'5814Z' => "J5814",
|
||||
'5819Z' => "J5819",
|
||||
'5821Z' => "J5821",
|
||||
'5829A' => "J5829",
|
||||
'5829B' => "J5829",
|
||||
'5829C' => "J5829",
|
||||
'5911A' => "J5911",
|
||||
'5911B' => "J5911",
|
||||
'5911C' => "J5911",
|
||||
'5912Z' => "J5912",
|
||||
'5913A' => "J5913",
|
||||
'5913B' => "J5913",
|
||||
'5914Z' => "J5914",
|
||||
'5920Z' => "J5920",
|
||||
'6010Z' => "J6010",
|
||||
'6020A' => "J6020",
|
||||
'6020B' => "J6020",
|
||||
'6110Z' => "J6110",
|
||||
'6120Z' => "J6120",
|
||||
'6130Z' => "J6130",
|
||||
'6190Z' => "J6190",
|
||||
'6201Z' => "J6201",
|
||||
'6202A' => "J6202",
|
||||
'6202B' => "J6202",
|
||||
'6203Z' => "J6203",
|
||||
'6209Z' => "J6209",
|
||||
'6311Z' => "J6311",
|
||||
'6312Z' => "J6312",
|
||||
'6391Z' => "J6391",
|
||||
'6399Z' => "J6399",
|
||||
'6411Z' => "K6411",
|
||||
'6419Z' => "K6419",
|
||||
'6420Z' => "K6420",
|
||||
'6430Z' => "K6430",
|
||||
'6491Z' => "K6491",
|
||||
'6492Z' => "K6492",
|
||||
'6499Z' => "K6499",
|
||||
'6511Z' => "K6511",
|
||||
'6512Z' => "K6512",
|
||||
'6520Z' => "K6520",
|
||||
'6530Z' => "K6530",
|
||||
'6611Z' => "K6611",
|
||||
'6612Z' => "K6612",
|
||||
'6619A' => "K6619",
|
||||
'6619B' => "K6619",
|
||||
'6621Z' => "K6621",
|
||||
'6622Z' => "K6622",
|
||||
'6629Z' => "K6629",
|
||||
'6630Z' => "K6630",
|
||||
'6810Z' => "L6810",
|
||||
'6820A' => "L6820",
|
||||
'6820B' => "L6820",
|
||||
'6831Z' => "L6831",
|
||||
'6832A' => "L6832",
|
||||
'6832B' => "L6832",
|
||||
'6910Z' => "M6910",
|
||||
'6920Z' => "M6920",
|
||||
'7010Z' => "M7010",
|
||||
'7021Z' => "M7021",
|
||||
'7022Z' => "M7022",
|
||||
'7111Z' => "M7111",
|
||||
'7112A' => "M7112",
|
||||
'7112B' => "M7112",
|
||||
'7120A' => "M7120",
|
||||
'7120B' => "M7120",
|
||||
'7211Z' => "M7211",
|
||||
'7219Z' => "M7219",
|
||||
'7220Z' => "M7220",
|
||||
'7311Z' => "M7311",
|
||||
'7312Z' => "M7312",
|
||||
'7320Z' => "M7320",
|
||||
'7410Z' => "M7410",
|
||||
'7420Z' => "M7420",
|
||||
'7430Z' => "M7430",
|
||||
'7490A' => "M7490",
|
||||
'7490B' => "M7490",
|
||||
'7500Z' => "M7500",
|
||||
'7711A' => "N7711",
|
||||
'7711B' => "N7711",
|
||||
'7712Z' => "N7712",
|
||||
'7721Z' => "N7721",
|
||||
'7722Z' => "N7722",
|
||||
'7729Z' => "N7729",
|
||||
'7731Z' => "N7731",
|
||||
'7732Z' => "N7732",
|
||||
'7733Z' => "N7733",
|
||||
'7734Z' => "N7734",
|
||||
'7735Z' => "N7735",
|
||||
'7739Z' => "N7739",
|
||||
'7740Z' => "N7740",
|
||||
'7810Z' => "N7810",
|
||||
'7820Z' => "N7820",
|
||||
'7830Z' => "N7830",
|
||||
'7911Z' => "N7911",
|
||||
'7912Z' => "N7912",
|
||||
'7990Z' => "N7990",
|
||||
'8010Z' => "N8010",
|
||||
'8020Z' => "N8020",
|
||||
'8030Z' => "N8030",
|
||||
'8110Z' => "N8110",
|
||||
'8121Z' => "N8121",
|
||||
'8122Z' => "N8122",
|
||||
'8129A' => "N8129",
|
||||
'8129B' => "N8129",
|
||||
'8130Z' => "N8130",
|
||||
'8211Z' => "N8211",
|
||||
'8219Z' => "N8219",
|
||||
'8220Z' => "N8220",
|
||||
'8230Z' => "N8230",
|
||||
'8291Z' => "N8291",
|
||||
'8292Z' => "N8292",
|
||||
'8299Z' => "N8299",
|
||||
'8411Z' => "O8411",
|
||||
'8412Z' => "O8412",
|
||||
'8413Z' => "O8413",
|
||||
'8421Z' => "O8421",
|
||||
'8422Z' => "O8422",
|
||||
'8423Z' => "O8423",
|
||||
'8424Z' => "O8424",
|
||||
'8425Z' => "O8425",
|
||||
'8430A' => "O8430",
|
||||
'8430B' => "O8430",
|
||||
'8430C' => "O8430",
|
||||
'8510Z' => "P8510",
|
||||
'8520Z' => "P8520",
|
||||
'8531Z' => "P8531",
|
||||
'8532Z' => "P8532",
|
||||
'8541Z' => "P8541",
|
||||
'8542Z' => "P8542",
|
||||
'8551Z' => "P8551",
|
||||
'8552Z' => "P8552",
|
||||
'8553Z' => "P8553",
|
||||
'8559A' => "P8559",
|
||||
'8559B' => "P8559",
|
||||
'8560Z' => "P8560",
|
||||
'8610Z' => "Q8610",
|
||||
'8621Z' => "Q8621",
|
||||
'8622A' => "Q8622",
|
||||
'8622B' => "Q8622",
|
||||
'8622C' => "Q8622",
|
||||
'8623Z' => "Q8623",
|
||||
'8690A' => "Q8690",
|
||||
'8690B' => "Q8690",
|
||||
'8690C' => "Q8690",
|
||||
'8690D' => "Q8690",
|
||||
'8690E' => "Q8690",
|
||||
'8690F' => "Q8690",
|
||||
'8710A' => "Q8710",
|
||||
'8710B' => "Q8710",
|
||||
'8710C' => "Q8710",
|
||||
'8720A' => "Q8720",
|
||||
'8720B' => "Q8720",
|
||||
'8730A' => "Q8730",
|
||||
'8730B' => "Q8730",
|
||||
'8790A' => "Q8790",
|
||||
'8790B' => "Q8790",
|
||||
'8810A' => "Q8810",
|
||||
'8810B' => "Q8810",
|
||||
'8810C' => "Q8810",
|
||||
'8891A' => "Q8891",
|
||||
'8891B' => "Q8891",
|
||||
'8899A' => "Q8899",
|
||||
'8899B' => "Q8899",
|
||||
'9001Z' => "R9001",
|
||||
'9002Z' => "R9002",
|
||||
'9003A' => "R9003",
|
||||
'9003B' => "R9003",
|
||||
'9004Z' => "R9004",
|
||||
'9101Z' => "R9101",
|
||||
'9102Z' => "R9102",
|
||||
'9103Z' => "R9103",
|
||||
'9104Z' => "R9104",
|
||||
'9200Z' => "R9200",
|
||||
'9311Z' => "R9311",
|
||||
'9312Z' => "R9312",
|
||||
'9313Z' => "R9313",
|
||||
'9319Z' => "R9319",
|
||||
'9321Z' => "R9321",
|
||||
'9329Z' => "R9329",
|
||||
'9411Z' => "S9411",
|
||||
'9412Z' => "S9412",
|
||||
'9420Z' => "S9420",
|
||||
'9491Z' => "S9491",
|
||||
'9492Z' => "S9492",
|
||||
'9499Z' => "S9499",
|
||||
'9511Z' => "S9511",
|
||||
'9512Z' => "S9512",
|
||||
'9521Z' => "S9521",
|
||||
'9522Z' => "S9522",
|
||||
'9523Z' => "S9523",
|
||||
'9524Z' => "S9524",
|
||||
'9525Z' => "S9525",
|
||||
'9529Z' => "S9529",
|
||||
'9601A' => "S9601",
|
||||
'9601B' => "S9601",
|
||||
'9602A' => "S9602",
|
||||
'9602B' => "S9602",
|
||||
'9603Z' => "S9603",
|
||||
'9604Z' => "S9604",
|
||||
'9609Z' => "S9609",
|
||||
'9700Z' => "T9700",
|
||||
'9810Z' => "T9810",
|
||||
'9820Z' => "T9820",
|
||||
'9900Z' => "U9900",
|
||||
'0000Z' => "Z000",
|
||||
'742C' => "742C",
|
||||
'524C' => "524C",
|
||||
'8111' => "8111",
|
||||
'452A' => "452A",
|
||||
'000Z' => "00Z",
|
||||
'526D' => "526D",
|
||||
'8121' => "8121",
|
||||
'7904' => "7904",
|
||||
'745A' => "745A",
|
||||
'702A' => "702A",
|
||||
'702C' => "702C",
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -1,686 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
'1' => "CULTURE ET PRODUCTION ANIMALE, CHASSE ET SERVICES ANNEXES",
|
||||
'16' => "TRAVAIL DU BOIS ET FABRICATION D'ARTICLES EN BOIS ET EN LIÈGE, À L'EXCEPTION DES MEUBLES ; FABRICATION D'ARTICLES EN VANNERIE ET SPARTERIE",
|
||||
'0162ZP' => "Maréchalerie",
|
||||
'7' => "EXTRACTION DE MINERAIS MÉTALLIQUES",
|
||||
'72' => "EXTRACTION DE MINERAIS DE MÉTAUX NON FERREUX",
|
||||
'0729ZP' => "Orpaillage",
|
||||
'8' => "AUTRES INDUSTRIES EXTRACTIVES",
|
||||
'0811ZA' => "Extraction de pierres ornementales et de construction et d'ardoise",
|
||||
'0811ZB' => "Extraction de calcaire industriel, de gypse et de craie",
|
||||
'0812ZZ' => "Exploitation de gravières et sablières, extraction d'argiles et de kaolin",
|
||||
'0891ZZ' => "Extraction des minéraux chimiques et d'engrais minéraux",
|
||||
'0892ZZ' => "Extraction de tourbe",
|
||||
'0893ZZ' => "Production de sel",
|
||||
'0899ZZ' => "Autres activités extractives n.c.a",
|
||||
'9' => "SERVICES DE SOUTIEN AUX INDUSTRIES EXTRACTIVES",
|
||||
'99' => "ACTIVITÉS DE SOUTIEN AUX AUTRES INDUSTRIES EXTRACTIVES",
|
||||
'0990ZP' => "Activités de soutien aux autres industries extractives",
|
||||
'10' => "INDUSTRIES ALIMENTAIRES",
|
||||
'101' => "TRANSFORMATION ET CONSERVATION DE LA VIANDE ET PRÉPARATION DE PRODUITS À BASE DE VIANDE",
|
||||
'1011ZZ' => "Transformation et conservation de la viande de boucherie",
|
||||
'1012ZZ' => "Transformation et conservation de la viande de volaille",
|
||||
'1013AZ' => "Préparation industrielle de produits à base de viande",
|
||||
'1013BZ' => "Charcuterie",
|
||||
'102' => "PRÉPARATIONS ET CONSERVES À BASE DE POISSONS ET",
|
||||
'1020ZZ' => "Transformation et conservation de poisson, de crustacés et de mollusques",
|
||||
'103' => "TRANSFORMATION ET CONSERVATION DE FRUITS ET LÉGUMES",
|
||||
'1031ZZ' => "Transformation et conservation de pommes de terre",
|
||||
'1032ZZ' => "Préparation de jus de fruits et légumes",
|
||||
'1039AP' => "Autre transformation et conservation de longue durée de légumes",
|
||||
'1039BP' => "Transformation et conservation de fruits",
|
||||
'104' => "FABRICATION D'HUILES ET GRAISSES VÉGÉTALES ET ANIMALES",
|
||||
'1041AZ' => "Fabrication d'huiles et graisses brutes",
|
||||
'1041BZ' => "Fabrication d'huiles et graisses raffinées",
|
||||
'1042ZZ' => "Fabrication de margarine et graisses comestibles similaires",
|
||||
'105' => "FABRICATION DE PRODUITS LAITIERS",
|
||||
'1051AZ' => "Fabrication de lait liquide et de produits frais",
|
||||
'1051BZ' => "Fabrication de beurre",
|
||||
'1051CZ' => "Fabrication de fromage",
|
||||
'1051DZ' => "Fabrication d'autres produits laitiers",
|
||||
'1052ZZ' => "Fabrication de glaces et sorbets",
|
||||
'106' => "TRAVAIL DES GRAINS ; FABRICATION DE PRODUITS AMYLACÉS",
|
||||
'1061AZ' => "Meunerie",
|
||||
'1061BZ' => "Autres activités du travail des grains",
|
||||
'1062ZZ' => "Fabrication de produits amylacés",
|
||||
'107' => "FABRICATION DE PRODUITS DE BOULANGERIE-PÂTISSERIE ET DE PÂTES ALIMENTAIRES",
|
||||
'1071AA' => "Fabrication industrielle de pain",
|
||||
'1071AB' => "Fabrication industrielle de pâtisserie fraîche",
|
||||
'1071CA' => "Boulangerie",
|
||||
'1071CB' => "Boulangerie-pâtisserie",
|
||||
'1071DZ' => "Pâtisserie",
|
||||
'1072ZZ' => "Fabrication de biscuits, biscottes et pâtisseries de conservation",
|
||||
'1073ZZ' => "Fabrication de pâtes alimentaires",
|
||||
'108' => "FABRICATION D'AUTRES PRODUITS ALIMENTAIRES",
|
||||
'1081ZZ' => "Fabrication de sucre",
|
||||
'1082ZZ' => "Fabrication de cacao, chocolat et de produits de confiserie",
|
||||
'1083ZZ' => "Transformation du thé et du café",
|
||||
'1084ZZ' => "Fabrication de condiments et assaisonnements",
|
||||
'1085ZZ' => "Fabrication de plats préparés",
|
||||
'1086ZZ' => "Fabrication d'aliments homogénéisés et diététiques",
|
||||
'1089ZZ' => "Fabrication d'autres produits alimentaires n.c.a.",
|
||||
'109' => "FABRICATION D'ALIMENTS POUR ANIMAUX",
|
||||
'1091ZZ' => "Fabrication d'aliments pour animaux de ferme",
|
||||
'1092ZZ' => "Fabrication d'aliments pour animaux de compagnie",
|
||||
'11' => "FABRICATION DE BOISSONS",
|
||||
'110' => "FABRICATION DE BOISSONS",
|
||||
'1101ZQ' => "Production d'eaux de vie naturelles",
|
||||
'1101ZR' => "Fabrication de spiritueux",
|
||||
'1102AP' => "Fabrication de vins effervescents selon la méthode champenoise ou autres méthodes",
|
||||
'1103ZZ' => "Fabrication de cidre et de vins de fruits",
|
||||
'1104ZZ' => "Production d'autres boissons fermentées non distillées",
|
||||
'1105ZZ' => "Fabrication de bière",
|
||||
'1106ZZ' => "Fabrication de malt",
|
||||
'1107AZ' => "Industrie des eaux de table",
|
||||
'1107BZ' => "Production de boissons rafraîchissantes",
|
||||
'13' => "FABRICATION DE TEXTILES",
|
||||
'131' => "PRÉPARATION DE FIBRES TEXTILES ET FILATURE",
|
||||
'1310ZA' => "Filature et préparation de la laine",
|
||||
'1310ZB' => "Moulinage et texturation de la soie et des textiles artificiels ou synthétiques",
|
||||
'1310ZC' => "Préparation et filature d'autres fibres",
|
||||
'132' => "TISSAGE",
|
||||
'1320ZA' => "Tissage de l'industrie cotonnière",
|
||||
'1320ZB' => "Tissage de l'industrie lainière",
|
||||
'1320ZC' => "Tissage de soieries",
|
||||
'1320ZD' => "Tissage d'autres textiles",
|
||||
'133' => "ENNOBLISSEMENT TEXTILE",
|
||||
'1330ZZ' => "Ennoblissement textile",
|
||||
'139' => "FABRICATION D'AUTRES TEXTILES",
|
||||
'1391ZZ' => "Fabrication d'étoffes à mailles",
|
||||
'1392ZA' => "Fabrication de linge de maison et d'articles d'ameublement",
|
||||
'1392ZB' => "Fabrication de tapisserie à la main",
|
||||
'1392ZC' => "Fabrication de coussins et petits articles textiles divers",
|
||||
'1392ZD' => "Voilerie",
|
||||
'1392ZE' => "Fabrication d'articles de campement en textile",
|
||||
'1392ZF' => "Fabrication de bâches, lambrequins et autres articles en textile",
|
||||
'1393ZZ' => "Fabrication de tapis et moquettes",
|
||||
'1394ZZ' => "Fabrication de ficelles, cordes et filets",
|
||||
'1395ZZ' => "Fabrication de non-tissés, sauf habillement",
|
||||
'1396ZZ' => "Fabrication de textiles techniques et industriels",
|
||||
'1399ZA' => "Fabrication de feutres",
|
||||
'1399ZB' => "Fabrication de tulles, lacets et autres textiles n.c.a",
|
||||
'14' => "INDUSTRIE DE L'HABILLEMENT",
|
||||
'141' => "FABRICATION DE VÊTEMENTS, AUTRES QU'EN FOURRURE",
|
||||
'1411ZZ' => "Fabrication de vêtements en cuir",
|
||||
'1412ZZ' => "Fabrication de vêtements de travail",
|
||||
'1413ZA' => "Modéliste-styliste",
|
||||
'1413ZB' => "Fabrication de vêtements féminins sur mesure",
|
||||
'1413ZC' => "Fabrication de vêtements masculins sur mesure",
|
||||
'1413ZD' => "Chemiserie sur mesure",
|
||||
'1413ZE' => "Fabrication de gaines, corsets et autres vêtements sur mesure",
|
||||
'1413ZF' => "Fabrication de vêtements de dessus pour hommes et garçonnets",
|
||||
'1413ZG' => "Fabrication de vêtements de dessus pour femmes et fillettes",
|
||||
'1414ZZ' => "Fabrication de vêtements de dessous",
|
||||
'1419ZA' => "Fabrication de layette",
|
||||
'1419ZB' => "Fabrication de chapellerie",
|
||||
'1419ZC' => "Modiste",
|
||||
'1419ZD' => "Fabrication d'écharpes, cravates, foulards",
|
||||
'1419ZE' => "Fabrication d'autres vêtements et accessoires",
|
||||
'1419ZF' => "Fabrication d'accessoires en cuir",
|
||||
'142' => "FABRICATION D'ARTICLES EN FOURRURE",
|
||||
'1420ZZ' => "Fabrication d'articles en fourrure",
|
||||
'143' => "FABRICATION D'ARTICLES À MAILLES",
|
||||
'1431ZZ' => "Fabrication d'articles chaussants à mailles",
|
||||
'1439ZA' => "Fabrication de lainages à la main",
|
||||
'1439ZB' => "Fabrication de lainages à la machine",
|
||||
'15' => "INDUSTRIE DU CUIR ET DE LA CHAUSSURE",
|
||||
'151' => "APPRÊT ET TANNAGE DES CUIRS ; PRÉPARATION ET TEINTURE DES FOURRURES ;",
|
||||
'1511ZZ' => "Apprêt et tannage des cuirs ; préparation et teinture des fourrures",
|
||||
'1512ZA' => "Fabrication d'articles de maroquinerie",
|
||||
'1512ZB' => "Gainerie",
|
||||
'1512ZC' => "Sellerie",
|
||||
'1512ZD' => "Bourrellerie",
|
||||
'152' => "FABRICATION DE CHAUSSURES",
|
||||
'1520ZA' => "Fabrication de sabots",
|
||||
'1520ZB' => "Fabrication de chaussures et de bottes",
|
||||
'1520ZC' => "Fabrication de chaussures et de bottes sur mesure",
|
||||
'161' => "SCIAGE ET RABOTAGE DU BOIS",
|
||||
'1610AQ' => "Sciage et rabotage du bois",
|
||||
'1610AR' => "Fabrication de parquets, moulures et baguettes",
|
||||
'1610BZ' => "Imprégnation du bois",
|
||||
'162' => "FABRICATION D'ARTICLES EN BOIS, LIÈGE, VANNERIE ET SPARTERIE",
|
||||
'1621ZZ' => "Fabrication de placage et de panneaux de bois",
|
||||
'1622ZZ' => "Fabrication de parquets assemblés",
|
||||
'1623ZZ' => "Fabrication de charpentes et d'autres menuiseries",
|
||||
'1624ZA' => "Fabrication de caisses et de palettes en bois",
|
||||
'1624ZB' => "Tonnellerie",
|
||||
'1629ZA' => "Fabrication d'objets divers en bois",
|
||||
'1629ZB' => "Vannerie, sparterie, travail de la paille",
|
||||
'1629ZC' => "Fabrication d'objets en liège",
|
||||
'17' => "INDUSTRIE DU PAPIER ET DU CARTON",
|
||||
'171' => "FABRICATION DE PÂTE À PAPIER, DE PAPIER ET DE CARTON",
|
||||
'1711ZZ' => "Fabrication de pâte à papier",
|
||||
'1712ZZ' => "Fabrication de papier et de carton",
|
||||
'172' => "FABRICATION D'ARTICLES EN PAPIER OU EN CARTON",
|
||||
'1721AZ' => "Fabrication de carton ondulé",
|
||||
'1721BZ' => "Fabrication de cartonnages",
|
||||
'1721CZ' => "Fabrication d'emballages en papier",
|
||||
'1722ZZ' => "Fabrication d'articles en papier à usage sanitaire ou domestique",
|
||||
'1723ZZ' => "Fabrication d'articles de papeterie",
|
||||
'1724ZZ' => "Fabrication de papiers peints",
|
||||
'1729ZZ' => "Fabrication d'autres articles en papier ou en carton",
|
||||
'18' => "IMPRIMERIE ET REPRODUCTION D'ENREGISTREMENTS",
|
||||
'181' => "IMPRIMERIE ET SERVICES ANNEXES",
|
||||
'1812ZA' => "Imprimerie de labeur",
|
||||
'1812ZB' => "Sérigraphie de type imprimerie",
|
||||
'1813ZA' => "Travaux de préparation d'impression",
|
||||
'1813ZB' => "Graphisme-décoration",
|
||||
'1813ZC' => "Activités graphiques n.c.a.",
|
||||
'1814ZZ' => "Reliure et activités connexes",
|
||||
'182' => "REPRODUCTION D'ENREGISTREMENTS",
|
||||
'1820ZZ' => "Reproduction d'enregistrements",
|
||||
'19' => "COKÉFACTION ET RAFFINAGE",
|
||||
'191' => "COKÉFACTION",
|
||||
'1910ZP' => "Production de brai et de coke de brai",
|
||||
'1920ZP' => "Agglomération de la tourbe",
|
||||
'20' => "INDUSTRIE CHIMIQUE",
|
||||
'201' => "FABRICATION DE PRODUITS CHIMIQUES DE BASE, DE PRODUITS AZOTÉS ET D'ENGRAIS, DE",
|
||||
'2011ZZ' => "Fabrication de gaz industriels",
|
||||
'2012ZZ' => "Fabrication de colorants et de pigments",
|
||||
'2013AZ' => "Enrichissement et retraitement de matières nucléaires",
|
||||
'2013BZ' => "Fabrication d'autres produits chimiques inorganiques de base n.c.a",
|
||||
'2014ZA' => "Fabrication d'autres produits organiques de base",
|
||||
'2014ZB' => "Fabrication de produits de la distillation du bois",
|
||||
'2015ZZ' => "Fabrication de produits azotés et d'engrais",
|
||||
'2016ZZ' => "Fabrication de matières plastiques de base",
|
||||
'2017ZZ' => "Fabrication de caoutchouc synthétique",
|
||||
'202' => "FABRICATION DE PESTICIDES ET D'AUTRES PRODUITS AGROCHIMIQUES",
|
||||
'2020ZZ' => "Fabrication de pesticides et d'autres produits agrochimiques",
|
||||
'203' => "FABRICATION DE PEINTURES, VERNIS, ENCRES ET MASTICS",
|
||||
'2030ZZ' => "Fabrication de peintures, vernis, encres et mastics",
|
||||
'204' => "FABRICATION DE SAVONS, DE PRODUITS D'ENTRETIEN ET DE PARFUMS",
|
||||
'2041ZZ' => "Fabrication de savons, détergents et produits d'entretien",
|
||||
'2042ZZ' => "Fabrication de parfums et de produits pour la toilette",
|
||||
'205' => "FABRICATION D'AUTRES PRODUITS CHIMIQUES",
|
||||
'2051ZZ' => "Fabrication de produits explosifs",
|
||||
'2052ZZ' => "Fabrication de colles",
|
||||
'2053ZZ' => "Fabrication d'huiles essentielles",
|
||||
'2059ZZ' => "Fabrication d'autres produits chimiques n.c.a.",
|
||||
'206' => "FABRICATION DE FIBRES ARTIFICIELLES OU SYNTHÉTIQUES",
|
||||
'2060ZZ' => "Fabrication de fibres artificielles ou synthétiques",
|
||||
'21' => "INDUSTRIE PHARMACEUTIQUE",
|
||||
'211' => "FABRICATION DE PRODUITS PHARMACEUTIQUES DE BASE",
|
||||
'2110ZP' => "Fabrication d'édulcorants de synthèse",
|
||||
'212' => "FABRICATION DE PRÉPARATIONS PHARMACEUTIQUES",
|
||||
'2120ZP' => "Fabrication de substances radioactives de diagnostic et de pansements",
|
||||
'22' => "FABRICATION DE PRODUITS EN CAOUTCHOUC ET EN PLASTIQUE",
|
||||
'221' => "FABRICATION DE PRODUITS EN CAOUTCHOUC",
|
||||
'2211ZZ' => "Fabrication et rechapage de pneumatiques",
|
||||
'2219ZZ' => "Fabrication d'autres articles en caoutchouc",
|
||||
'222' => "FABRICATION DE PRODUITS EN PLASTIQUE",
|
||||
'2221ZZ' => "Fabrication de plaques, feuilles, tubes et profilés en matières plastiques",
|
||||
'2222ZZ' => "Fabrication d'emballages en matières plastiques",
|
||||
'2223ZZ' => "Fabrication d'éléments en matières plastiques pour la construction",
|
||||
'2229AZ' => "Fabrication de pièces techniques à base de matières plastiques",
|
||||
'2229BZ' => "Fabrication d'éléments divers en matières plastiques",
|
||||
'23' => "FABRICATION D'AUTRES PRODUITS MINÉRAUX NON MÉTALLIQUES",
|
||||
'231' => "FABRICATION DE VERRE ET D'ARTICLES EN VERRE",
|
||||
'2311ZZ' => "Fabrication de verre plat",
|
||||
'2312ZZ' => "Façonnage et transformation du verre plat",
|
||||
'2313ZA' => "Fabrication de verre creux ou autres verres",
|
||||
'2313ZB' => "Soufflage de verre",
|
||||
'2313ZC' => "Façonnage de verre et de cristal",
|
||||
'2314ZZ' => "Fabrication de fibres de verre",
|
||||
'2319ZA' => "Fabrication de vitraux",
|
||||
'2319ZB' => "Fabrication d'articles techniques en verre",
|
||||
'232' => "FABRICATION DE PRODUITS RÉFRACTAIRES",
|
||||
'2320ZZ' => "Fabrication de produits réfractaires",
|
||||
'233' => "FABRICATION DE MATÉRIAUX DE CONSTRUCTION EN TERRE CUITE",
|
||||
'2331ZZ' => "Fabrication de carreaux en céramique",
|
||||
'2332ZA' => "Fabrication de briques",
|
||||
'2332ZB' => "Fabrication de tuiles",
|
||||
'2332ZC' => "Fabrication de produits divers en terre cuite",
|
||||
'234' => "FABRICATION D'AUTRES PRODUITS EN CÉRAMIQUE ET EN PORCELAINE",
|
||||
'2341ZZ' => "Fabrication d'articles céramiques à usage domestique ou ornemental",
|
||||
'2342ZZ' => "Fabrication d'appareils sanitaires en céramique",
|
||||
'2343ZZ' => "Fabrication d'isolateurs et pièces isolantes en céramique",
|
||||
'2344ZZ' => "Fabrication d'autres produits céramiques à usage technique",
|
||||
'2349ZZ' => "Fabrication d'autres produits céramiques",
|
||||
'235' => "FABRICATION DE CIMENT, CHAUX ET PLÂTRE",
|
||||
'2351ZZ' => "Fabrication de ciment céramiques",
|
||||
'2352ZZ' => "Fabrication de chaux et plâtre.",
|
||||
'236' => "FABRICATION D'OUVRAGES EN BÉTON, EN CIMENT OU EN",
|
||||
'2361ZZ' => "Fabrication d'éléments en béton pour la construction",
|
||||
'2362ZZ' => "Fabrication d'éléments en plâtre pour la construction",
|
||||
'2363ZZ' => "Fabrication de béton prêt à l'emploi",
|
||||
'2364ZZ' => "Fabrication de mortiers et bétons secs",
|
||||
'2365ZZ' => "Fabrication d'ouvrages en fibre-ciment",
|
||||
'2369ZA' => "Fabrication de cheminées décoratives",
|
||||
'2369ZB' => "Fabrication d'éléments décoratifs en béton ou en plâtre",
|
||||
'237' => "TAILLE, FAÇONNAGE ET FINISSAGE DE PIERRES",
|
||||
'2370ZZ' => "Taille, façonnage et finissage de pierres",
|
||||
'239' => "FABRICATION DE PRODUITS ABRASIFS ET DE PRODUITS MINÉRAUX NON MÉTALLIQUES",
|
||||
'2391ZZ' => "Fabrication de produits abrasifs",
|
||||
'2399ZZ' => "Fabrication d'autres produits minéraux non métalliques n.c.a.",
|
||||
'24' => "MÉTALLURGIE",
|
||||
'241' => "SIDÉRURGIE",
|
||||
'2410ZZ' => "Sidérurgie",
|
||||
'242' => "FABRICATION DE TUBES, TUYAUX, PROFILÉS CREUX ET ACCESSOIRES CORRESPONDANTS EN",
|
||||
'2420ZZ' => "Fabrication de tubes, tuyaux, profilés creux et accessoires correspondants en acier",
|
||||
'243' => "FABRICATION D'AUTRES PRODUITS DE PREMIÈRE TRANSFORMATION DE L'ACIER",
|
||||
'2431ZZ' => "Etirage à froid de barres",
|
||||
'2432ZZ' => "Laminage à froid de feuillards",
|
||||
'2433ZZ' => "Profilage à froid par formage ou pliage",
|
||||
'2434ZZ' => "Tréfilage à froid",
|
||||
'244' => "PRODUCTION DE MÉTAUX PRÉCIEUX ET D'AUTRES MÉTAUX NON FERREUX",
|
||||
'2441ZZ' => "Production de métaux précieux",
|
||||
'2442ZA' => "Production d'aluminium",
|
||||
'2442ZB' => "Première transformation de l'aluminium",
|
||||
'2443ZZ' => "Métallurgie du plomb, du zinc ou de l'étain",
|
||||
'2444ZZ' => "Métallurgie du cuivre",
|
||||
'2445ZZ' => "Métallurgie des autres métaux non ferreux",
|
||||
'2446ZZ' => "Elaboration et transformation de matières nucléaires",
|
||||
'245' => "FONDERIE",
|
||||
'2451ZZ' => "Fonderie de fonte",
|
||||
'2452ZZ' => "Fonderie d'acier",
|
||||
'2453ZZ' => "Fonderie de métaux légers",
|
||||
'2454ZZ' => "Fonderie d'autres métaux non ferreux",
|
||||
'25' => "FABRICATION DE PRODUITS MÉTALLIQUES, À L'EXCEPTION DES MACHINES ET DES ÉQUIPEMENTS",
|
||||
'251' => "FABRICATION D'ÉLÉMENTS EN MÉTAL POUR LA CONSTRUCTION",
|
||||
'2511ZZ' => "Fabrication de structures métalliques et de parties de structures",
|
||||
'2512ZZ' => "Fabrication de portes et fenêtres en métal",
|
||||
'252' => "FABRICATION DE RÉSERVOIRS, CITERNES ET CONTENEURS MÉTALLIQUES",
|
||||
'2521ZZ' => "Fabrication de radiateurs et de chaudières pour le chauffage central",
|
||||
'2529ZZ' => "Fabrication d'autres réservoirs, citernes et conteneurs métalliques",
|
||||
'253' => "FABRICATION DE GÉNÉRATEURS DE VAPEUR, À L'EXCEPTION DES CHAUDIÈRES POUR LE",
|
||||
'2530ZA' => "Fabrication de générateurs de vapeur",
|
||||
'2530ZB' => "Chaudronnerie nucléaire",
|
||||
'254' => "FABRICATION D'ARMES ET DE MUNITIONS",
|
||||
'2540ZZ' => "Fabrication d'armes et de munitions",
|
||||
'255' => "FORGE, EMBOUTISSAGE, ESTAMPAGE ; MÉTALLURGIE DES POUDRES",
|
||||
'2550AZ' => "Forge, estampage, matriçage, métallurgie des poudres",
|
||||
'2550BZ' => "Découpage, emboutissage",
|
||||
'256' => "FORGE, EMBOUTISSAGE, ESTAMPAGE ; MÉTALLURGIE DES POUDRES TRAITEMENT ET",
|
||||
'2561ZA' => "Sérigraphie de type marquage",
|
||||
'2561ZB' => "Traitement et revêtement des métaux",
|
||||
'2562AZ' => "Décolletage",
|
||||
'2562BZ' => "Mécanique industrielle",
|
||||
'257' => "FABRICATION DE COUTELLERIE, D'OUTILLAGE ET DE QUINCAILLERIE",
|
||||
'2571ZZ' => "Fabrication de coutellerie",
|
||||
'2572ZZ' => "Fabrication de serrures et de ferrures",
|
||||
'2573AZ' => "Fabrication de moules et modèles",
|
||||
'2573BA' => "Fabrication d'outillage à main",
|
||||
'2573BB' => "Fabrication d'outillage mécanique",
|
||||
'259' => "FABRICATION D'AUTRES OUVRAGES EN MÉTAUX",
|
||||
'2591ZZ' => "Fabrication de fûts et emballages métalliques similaires",
|
||||
'2592ZZ' => "Fabrication d'emballages métalliques légers",
|
||||
'2593ZA' => "Fabrication d'articles en fils métalliques et de chaînes",
|
||||
'2593ZB' => "Fabrication de ressorts",
|
||||
'2594ZZ' => "Fabrication de vis et de boulons",
|
||||
'2599AA' => "Dinanderie",
|
||||
'2599AB' => "Autres fabrications d'articles de ménage",
|
||||
'2599BA' => "Fabrication de petits articles métalliques",
|
||||
'2599BB' => "Fabrication de coffres-forts",
|
||||
'2599BC' => "Fabrication d'autres articles métalliques n.c.a.",
|
||||
'26' => "FABRICATION DE PRODUITS INFORMATIQUES, ÉLECTRONIQUES ET OPTIQUES",
|
||||
'261' => "FABRICATION DE COMPOSANTS ET CARTES ÉLECTRONIQUES",
|
||||
'2611ZA' => "Fabrication de composants électroniques (hors capteurs solaires)",
|
||||
'2611ZB' => "Fabrication de capteurs solaires photovoltaïques",
|
||||
'2612ZZ' => "Fabrication de cartes électroniques assemblées",
|
||||
'262' => "FABRICATION D'ORDINATEURS ET D'ÉQUIPEMENTS PÉRIPHÉRIQUES",
|
||||
'2620ZZ' => "Fabrication d'ordinateurs et d'autres équipements informatiques",
|
||||
'263' => "FABRICATION D'ÉQUIPEMENTS DE COMMUNICATION",
|
||||
'2630ZZ' => "Fabrication d'équipements de communication",
|
||||
'264' => "FABRICATION DE PRODUITS ÉLECTRONIQUES GRAND PUBLIC",
|
||||
'2640ZZ' => "Fabrication de produits électroniques grand public",
|
||||
'265' => "FABRICATION D'INSTRUMENTS ET D'APPAREILS DE MESURE, D'ESSAI ET DE NAVIGATION ;",
|
||||
'2651AZ' => "Fabrication d'équipements d'aide à la navigation",
|
||||
'2651BZ' => "Fabrication d'instrumentation scientifique et technique",
|
||||
'2652ZZ' => "Horlogerie",
|
||||
'266' => "FABRICATION D'ÉQUIPEMENTS D'IRRADIATION MÉDICALE, D'ÉQUIPEMENTS",
|
||||
'2660ZZ' => "Fabrication d'équipements d'irradiation médicale, d'équipements électromédicaux et électrothérapeutiques",
|
||||
'267' => "FABRICATION DE MATÉRIELS OPTIQUE ET PHOTOGRAPHIQUE",
|
||||
'2670ZA' => "Fabrication de matériels photographiques et cinématographiques",
|
||||
'2670ZB' => "Fabrication d'instruments d'optique",
|
||||
'268' => "FABRICATION DE SUPPORTS MAGNÉTIQUES ET OPTIQUES",
|
||||
'2680ZZ' => "Fabrication de supports magnétiques et optiques",
|
||||
'27' => "FABRICATION D'ÉQUIPEMENTS ÉLECTRIQUES",
|
||||
'271' => "FABRICATION DE MOTEURS, GÉNÉRATRICES ET TRANSFORMATEURS ÉLECTRIQUES ET DE",
|
||||
'2711ZA' => "Fabrication de moteurs électriques",
|
||||
'2711ZB' => "Fabrication de transformateurs électriques",
|
||||
'2711ZC' => "Fabrication de groupes électrogènes",
|
||||
'2712ZZ' => "Fabrication de matériel de distribution et de commande électrique",
|
||||
'272' => "FABRICATION DE PILES ET D'ACCUMULATEURS ÉLECTRIQUES",
|
||||
'2720ZZ' => "Fabrication de piles et d'accumulateurs électriques",
|
||||
'273' => "FABRICATION DE FILS ET CÂBLES ET DE MATÉRIEL D'INSTALLATION ÉLECTRIQUE",
|
||||
'2731ZZ' => "Fabrication de câbles de fibres optiques",
|
||||
'2732ZZ' => "Fabrication d'autres fils et câbles électroniques ou électrique",
|
||||
'2733ZZ' => "Fabrication de matériel d'installation électrique",
|
||||
'274' => "FABRICATION D'APPAREILS D'ÉCLAIRAGE ÉLECTRIQUE",
|
||||
'2740ZA' => "Fabrication de lampes",
|
||||
'2740ZB' => "Fabrication de luminaires",
|
||||
'2740ZC' => "Fabrication d'abat-jour",
|
||||
'2740ZD' => "Fabrication d'autres appareils d'éclairage",
|
||||
'275' => "FABRICATION D'APPAREILS MÉNAGERS",
|
||||
'2751ZZ' => "Fabrication d'appareils électroménagers",
|
||||
'2752ZZ' => "Fabrication d'appareils ménagers non électriques",
|
||||
'279' => "FABRICATION D'AUTRES MATÉRIELS ÉLECTRIQUES",
|
||||
'2790ZZ' => "Fabrication d'autres matériels électriques",
|
||||
'28' => "FABRICATION DE MACHINES ET ÉQUIPEMENTS N.C.A",
|
||||
'281' => "FABRICATION DE MACHINES D'USAGE GÉNÉRAL",
|
||||
'2811ZA' => "Fabrication de moteurs et turbines, à l'exception des moteurs d'avion et de véhicules",
|
||||
'2811ZB' => "Fabrication de turbines éoliennes",
|
||||
'2812ZZ' => "Fabrication d'équipements hydrauliques et pneumatiques",
|
||||
'2813ZA' => "Fabrication de pompes",
|
||||
'2813ZB' => "Fabrication de compresseurs",
|
||||
'2814ZZ' => "Fabrication d'autres articles de robinetterie",
|
||||
'2815ZZ' => "Fabrication d'engrenages et d'organes mécaniques de transmission",
|
||||
'282' => "FABRICATION D'AUTRES MACHINES D'USAGE GÉNÉRAL",
|
||||
'2821ZA' => "Fabrication de fours et brûleurs non solaires",
|
||||
'2821ZB' => "Fabrication de chauffages solaires",
|
||||
'2822ZA' => "Fabrication d'ascenseurs, monte-charges et escaliers mécaniques",
|
||||
'2822ZB' => "Fabrication d'équipements de levage et de manutention",
|
||||
'2823ZZ' => "Fabrication de machines de bureau (à l'exception des ordinateurs et équipements périphériques)",
|
||||
'2824ZZ' => "Fabrication d'outillage portatif à moteur incorporé",
|
||||
'2825ZA' => "Fabrication de capteur solaire à effet de serre",
|
||||
'2825ZB' => "Fabrication d'équipements de réfrigération industrielle",
|
||||
'2825ZC' => "Fabrication d'équipements aérauliques",
|
||||
'2829AA' => "Fabrication d'équipements d'emballage et de conditionnement",
|
||||
'2829AB' => "Fabrication d'appareils de pesage",
|
||||
'2829BZ' => "Fabrication d'autres machines d'usage général",
|
||||
'283' => "FABRICATION DE MACHINES AGRICOLES ET FORESTIÈRES",
|
||||
'2830ZZ' => "Fabrication de machines agricoles et forestières",
|
||||
'284' => "FABRICATION DE MACHINES DE FORMAGE DES MÉTAUX ET DE MACHINES-OUTILS",
|
||||
'2841ZZ' => "Fabrication de machines-outils pour le travail des métaux",
|
||||
'2849ZZ' => "Fabrication d'autres machines-outils",
|
||||
'289' => "FABRICATION D'AUTRES MACHINES D'USAGE SPÉCIFIQUE",
|
||||
'2891ZZ' => "Fabrication de machines pour la métallurgie",
|
||||
'2892ZA' => "Fabrication de matériels de mines pour l'extraction",
|
||||
'2892ZB' => "Fabrication de matériels de travaux publics",
|
||||
'2893ZZ' => "Fabrication de machines pour l'industrie agro-alimentaire",
|
||||
'2894ZZ' => "Fabrication de machines pour les industries textiles",
|
||||
'2895ZZ' => "Fabrication de machines pour les industries du papier et du carton",
|
||||
'2896ZZ' => "Fabrication de machines pour le travail du caoutchouc ou des plastiques",
|
||||
'2899AZ' => "Fabrication de machines d'imprimerie",
|
||||
'2899BZ' => "Fabrication d'autres machines spécialisées",
|
||||
'29' => "INDUSTRIE AUTOMOBILE",
|
||||
'291' => "CONSTRUCTION DE VÉHICULES AUTOMOBILES",
|
||||
'2910ZA' => "Construction de voiturettes",
|
||||
'2910ZB' => "Construction d'autres véhicules automobiles",
|
||||
'292' => "FABRICATION DE CARROSSERIES ET REMORQUES",
|
||||
'2920ZA' => "Fabrication de carrosseries",
|
||||
'2920ZB' => "Aménagement de véhicules",
|
||||
'2920ZC' => "Fabrication de remorques et de semi-remorques",
|
||||
'293' => "FABRICATION D'ÉQUIPEMENTS AUTOMOBILES",
|
||||
'2931ZZ' => "Fabrication de matériels électriques et électroniques automobiles",
|
||||
'2932ZZ' => "Fabrication d'autres équipements automobiles",
|
||||
'30' => "FABRICATION D'AUTRES MATÉRIELS DE TRANSPORT",
|
||||
'301' => "CONSTRUCTION NAVALE",
|
||||
'3011ZA' => "Construction de navires",
|
||||
'3011ZB' => "Transformation et équipement des navires",
|
||||
'3012ZZ' => "Construction de bateaux de plaisance",
|
||||
'302' => "CONSTRUCTION DE LOCOMOTIVES ET D'AUTRE MATÉRIEL FERROVIAIRE ROULANT",
|
||||
'3020ZZ' => "Construction de locomotives et d'autre matériel ferroviaire roulant",
|
||||
'303' => "CONSTRUCTION AÉRONAUTIQUE ET SPATIALE",
|
||||
'3030ZA' => "Construction de moteurs pour aéronefs",
|
||||
'3030ZB' => "Construction de cellules d'aéronefs",
|
||||
'3030ZC' => "Construction de lanceurs et engins spatiaux",
|
||||
'304' => "CONSTRUCTION DE VÉHICULES MILITAIRES DE COMBAT",
|
||||
'3040ZZ' => "Construction de véhicules militaires de combat",
|
||||
'309' => "FABRICATION DE MATÉRIELS DE TRANSPORT N.C.A",
|
||||
'3091ZA' => "Construction de motocycles",
|
||||
'3091ZB' => "Fabrication d'équipements pour motocycles",
|
||||
'3092ZA' => "Construction de bicyclettes",
|
||||
'3092ZB' => "Fabrication d'équipements pour bicyclettes",
|
||||
'3092ZC' => "Fabrication de véhicules pour invalides et enfants",
|
||||
'3099ZZ' => "Fabrication d'autres équipements de transport n.c.a.",
|
||||
'31' => "FABRICATION DE MEUBLES",
|
||||
'310' => "FABRICATION DE MEUBLES",
|
||||
'3101ZZ' => "Fabrication de meubles de bureau et de magasin",
|
||||
'3102ZZ' => "Fabrication de meubles de cuisine",
|
||||
'3103ZZ' => "Fabrication de matelas",
|
||||
'3109AZ' => "Fabrication de sièges d'ameublement d'intérieur",
|
||||
'3109BA' => "Fabrication et finissage de meubles divers",
|
||||
'3109BB' => "Fabrication de meubles de jardin et d'extérieur",
|
||||
'3109BC' => "Fabrication de meubles en rotin",
|
||||
'32' => "AUTRES INDUSTRIES MANUFACTURIÈRES",
|
||||
'321' => "FABRICATION D'ARTICLES DE JOAILLERIE, BIJOUTERIE ET ARTICLES SIMILAIRES",
|
||||
'3211ZZ' => "Frappe de monnaies",
|
||||
'3212ZZ' => "Fabrication d'articles de joaillerie et de bijouterie",
|
||||
'3213ZZ' => "Fabrication d'articles de bijouterie fantaisie et articles similaires",
|
||||
'322' => "FABRICATION D'INSTRUMENTS DE MUSIQUE",
|
||||
'3220ZA' => "Lutherie",
|
||||
'3220ZB' => "Facteur d'orgues",
|
||||
'3220ZC' => "Fabrication d'autres instruments de musique",
|
||||
'323' => "FABRICATION D'ARTICLES DE SPORT",
|
||||
'3230ZZ' => "Fabrication d'articles de sport",
|
||||
'324' => "FABRICATION DE JEUX ET JOUETS",
|
||||
'3240ZZ' => "Fabrication de jeux et jouets",
|
||||
'325' => "FABRICATION D'INSTRUMENTS ET DE FOURNITURES À USAGE MÉDICAL ET DENTAIRE",
|
||||
'3250AA' => "Fabrication de prothèses dentaires",
|
||||
'3250AB' => "Fabrication de prothèses et orthèses podales",
|
||||
'3250AC' => "Fabrication de prothèses et orthèses diverses",
|
||||
'3250AD' => "Fabrication d'équipements médico-chirurgicaux",
|
||||
'3250BP' => "Fabrication de lunettes de protection",
|
||||
'329' => "ACTIVITÉS MANUFACTURIÈRES N.C.A",
|
||||
'3291ZZ' => "Fabrication d'articles de brosserie",
|
||||
'3299ZA' => "Fabrication de bougies",
|
||||
'3299ZB' => "Fabrication d'accessoires du vêtements",
|
||||
'3299ZC' => "Fabrication d'articles de Paris, d'arts ou religieux",
|
||||
'3299ZD' => "Fabrication d'articles de fumeurs",
|
||||
'3299ZE' => "Taxidermie",
|
||||
'3299ZF' => "Fabrication d'équipements de protection et de sécurité",
|
||||
'3299ZG' => "Fabrication de produits manufacturés non classés ailleurs",
|
||||
'33' => "RÉPARATION ET INSTALLATION DE MACHINES ET D'ÉQUIPEMENTS",
|
||||
'331' => "RÉPARATION D'OUVRAGES EN MÉTAUX, DE MACHINES ET D'ÉQUIPEMENTS",
|
||||
'3311ZZ' => "Réparation d'ouvrages en métaux",
|
||||
'3312ZA' => "Réparation de matériel agricole",
|
||||
'3312ZB' => "Réparation d'autres machines",
|
||||
'3313ZZ' => "Réparation de matériels électroniques et optiques",
|
||||
'3314ZZ' => "Réparation d'équipements électriques",
|
||||
'3315ZZ' => "Réparation et maintenance navale",
|
||||
'3316ZZ' => "Réparation et maintenance d'aéronefs et d'engins spatiaux",
|
||||
'3317ZZ' => "Réparation et maintenance d'autres équipements de transport",
|
||||
'3319ZZ' => "Réparation d'autres équipements",
|
||||
'332' => "INSTALLATION DE MACHINES ET D'ÉQUIPEMENTS INDUSTRIELS",
|
||||
'3320AZ' => "Installation de structures métalliques, chaudronnées et de tuyauterie",
|
||||
'3320BZ' => "Installation de machines et équipements mécaniques",
|
||||
'3320CZ' => "Conception d'ensemble et assemblage sur site industriel d'équipements de contrôle des processus industriels",
|
||||
'3320DZ' => "Installation d'équipements électriques, de matériels électroniques et optiques ou d'autres matériels",
|
||||
'37' => "COLLECTE ET TRAITEMENT DES EAUX USÉES",
|
||||
'370' => "COLLECTE ET TRAITEMENT DES EAUX USÉES",
|
||||
'3700ZP' => "Entretien de fosses septiques",
|
||||
'38' => "COLLECTE, TRAITEMENT ET ÉLIMINATION DES DÉCHETS ; RÉCUPÉRATION",
|
||||
'381' => "COLLECTE DES DÉCHETS",
|
||||
'3812ZP' => "Collecte des déchets nucléaires",
|
||||
'382' => "TRAITEMENT ET ÉLIMINATION DES DÉCHETS",
|
||||
'3821ZP' => "Incinération des déchets non dangereux et production de cendres et scories associée",
|
||||
'3822ZP' => "Traitement et élimination de déchets nucléaires radioactifs",
|
||||
'383' => "RÉCUPÉRATION",
|
||||
'3831ZA' => "Démantèlement d'épaves en vue de la récupération de matières métalliques",
|
||||
'3831ZB' => "Démantèlement d'épaves en vue de la récupération de matières non métalliques",
|
||||
'3832ZA' => "Traitement de matières métalliques recyclables",
|
||||
'3832ZB' => "Traitement de matières non métalliques recyclables",
|
||||
'39' => "DÉPOLLUTION ET AUTRES SERVICES DE GESTION DES DÉCHETS",
|
||||
'390' => "DÉPOLLUTION ET AUTRES SERVICES DE GESTION DES DÉCHETS",
|
||||
'3900ZP' => "Désamiantage",
|
||||
'41' => "CONSTRUCTION DE BÂTIMENTS",
|
||||
'412' => "CONSTRUCTION DE BÂTIMENTS RÉSIDENTIELS ET NON RÉSIDENTIELS",
|
||||
'4120AZ' => "Construction de maisons individuelles",
|
||||
'4120BA' => "Construction de bâtiments",
|
||||
'4120BB' => "Réhabilitation de bâtiments",
|
||||
'42' => "GÉNIE CIVIL",
|
||||
'421' => "CONSTRUCTION DE ROUTES ET DE VOIES FERRÉES",
|
||||
'4211ZA' => "Pose de signalisation routière verticale",
|
||||
'4211ZB' => "Aménagement de chaussées",
|
||||
'4212ZZ' => "Construction de voies ferrées de surface et souterraines",
|
||||
'4213AZ' => "Construction d'ouvrages d'art",
|
||||
'4213BZ' => "Construction et entretien de tunnels",
|
||||
'422' => "CONSTRUCTION DE RÉSEAUX ET DE LIGNES",
|
||||
'4221ZA' => "Construction d'installations de réseaux pour fluides",
|
||||
'4221ZB' => "Forage des puits d'eau",
|
||||
'4222ZA' => "Construction de centrales électriques",
|
||||
'4222ZB' => "Construction de lignes électriques et de télécommunication",
|
||||
'429' => "CONSTRUCTION D'AUTRES OUVRAGES DE GÉNIE CIVIL",
|
||||
'4291ZZ' => "Construction d'ouvrages maritimes et fluviaux",
|
||||
'4299ZP' => "Construction d'installations sportives et d'ouvrages industriels ou miniers",
|
||||
'43' => "TRAVAUX DE CONSTRUCTION SPÉCIALISÉS",
|
||||
'431' => "DÉMOLITION ET PRÉPARATION DES SITES",
|
||||
'4311ZZ' => "Travaux de démolition",
|
||||
'4312AZ' => "Travaux de terrassement courants et travaux préparatoires",
|
||||
'4312BA' => "Terrassements",
|
||||
'4312BB' => "Artificiers",
|
||||
'4313ZZ' => "Forages et sondages",
|
||||
'432' => "TRAVAUX D'INSTALLATION ÉLECTRIQUE, PLOMBERIE ET AUTRES TRAVAUX",
|
||||
'4321AA' => "Installation d'antennes",
|
||||
'4321AB' => "Installation électrique",
|
||||
'4321BZ' => "Travaux d'installation électrique sur la voie publique",
|
||||
'4322AZ' => "Travaux d'installation d'eau et de gaz en tous locaux",
|
||||
'4322BA' => "Installation et entretien de climatisation et chaufferie",
|
||||
'4322BB' => "Installation de chauffage individuel",
|
||||
'4322BC' => "Entretien de chaudières domestiques",
|
||||
'4329AZ' => "Travaux d'isolation",
|
||||
'4329BA' => "Installation d'ascenseurs",
|
||||
'4329BB' => "Montage de clôtures et de grilles",
|
||||
'4329BC' => "Installation de stores et bannes",
|
||||
'4329BD' => "Autres travaux d'installation divers",
|
||||
'433' => "TRAVAUX DE FINITION",
|
||||
'4331ZA' => "Travaux de plâtrerie d'extérieur",
|
||||
'4331ZB' => "Travaux de plâtrerie d'intérieur",
|
||||
'4332AA' => "Menuiserie bois",
|
||||
'4332AB' => "Menuiserie PVC",
|
||||
'4332BA' => "Installation de serres et de vérandas",
|
||||
'4332BB' => "Métallerie, serrurerie",
|
||||
'4332CZ' => "Agencement de lieux de vente",
|
||||
'4333ZZ' => "Travaux de revêtement des sols et des murs",
|
||||
'4334ZA' => "Travaux de miroiterie de bâtiment, vitrerie",
|
||||
'4334ZB' => "Travaux de peinture extérieure",
|
||||
'4334ZC' => "Travaux de peinture intérieure et peinture plâtrerie",
|
||||
'4334ZD' => "Travaux de peinture en lettres sur bâtiments",
|
||||
'4339ZZ' => "Autres travaux de finition",
|
||||
'439' => "AUTRES TRAVAUX DE CONSTRUCTION SPÉCIALISÉS",
|
||||
'4391AZ' => "Travaux de charpente",
|
||||
'4391BZ' => "Travaux de couverture par éléments",
|
||||
'4399AZ' => "Travaux d'étanchéification",
|
||||
'4399BZ' => "Travaux de montage de structures métalliques",
|
||||
'4399CZ' => "Travaux de maçonnerie générale et gros oeuvre de bâtiment",
|
||||
'4399DA' => "Installation de piscines de résidence et construction de piscines extérieures",
|
||||
'4399DB' => "Construction de cheminées et de fours industriels",
|
||||
'4399DC' => "Autres travaux spéciaux de construction",
|
||||
'4399EZ' => "Location avec opérateur de matériel de construction",
|
||||
'45' => "COMMERCE ET RÉPARATION D'AUTOMOBILES ET DE MOTOCYCLES",
|
||||
'452' => "ENTRETIEN ET RÉPARATION DE VÉHICULES AUTOMOBILES",
|
||||
'4520AA' => "Réparation automobile de véhicules automobiles légers : entretien courant",
|
||||
'4520AB' => "Réparation automobile de véhicules automobiles légers : mécanique",
|
||||
'4520AC' => "Réparation automobile de véhicules automobiles légers : carrosserie",
|
||||
'4520AD' => "Réparation automobile de véhicules automobiles légers : électricité, électronique",
|
||||
'4520BA' => "Réparation automobile d'autres véhicules automobiles : entretien courant",
|
||||
'4520BB' => "Réparation automobile d'autres véhicules automobiles : mécanique",
|
||||
'4520BC' => "Réparation automobile d'autres véhicules automobiles : diesel",
|
||||
'4520BD' => "Réparation automobile d'autres véhicules automobiles : carrosserie",
|
||||
'4520BE' => "Réparation automobile d'autres véhicules automobiles : électricité, électronique",
|
||||
'454' => "COMMERCE ET RÉPARATION DE MOTOCYCLES",
|
||||
'4540ZP' => "Réparation de motocycles",
|
||||
'47' => "COMMERCE DE DÉTAIL, À L'EXCEPTION DES AUTOMOBILES ET DES MOTOCYCLES",
|
||||
'472' => "COMMERCE DE DÉTAIL ALIMENTAIRE EN MAGASIN SPÉCIALISÉ",
|
||||
'4722ZA' => "Boucherie",
|
||||
'4722ZB' => "Boucherie charcuterie",
|
||||
'4722ZC' => "Boucherie chevaline",
|
||||
'4722ZD' => "Volailles, gibiers",
|
||||
'4722ZE' => "Triperie",
|
||||
'4723ZP' => "Préparation de poissons, crustacés et mollusques",
|
||||
'477' => "AUTRES COMMERCES DE DÉTAIL EN MAGASIN SPÉCIALISÉ",
|
||||
'4776ZP' => "Commerce de détail de fleurs",
|
||||
'478' => "COMMERCE DE DÉTAIL SUR ÉVENTAIRES ET MARCHÉS",
|
||||
'4781ZQ' => "Boucherie sur éventaires et marchés",
|
||||
'4781ZR' => "Boucherie charcuterie sur éventaires et marchés",
|
||||
'4781ZS' => "Boucherie chevaline sur éventaires et marchés",
|
||||
'4781ZT' => "Volailles, gibiers sur éventaires et marchés",
|
||||
'4781ZU' => "Triperie sur éventaires et marchés",
|
||||
'4781ZV' => "Préparation de poissons, crustacés, mollusques sur éventaires, marchés",
|
||||
'4789ZP' => "Commerce de détail de fleurs sur éventaires et marchés",
|
||||
'49' => "TRANSPORTS TERRESTRES ET TRANSPORT PAR CONDUITES",
|
||||
'493' => "AUTRES TRANSPORTS TERRESTRES DE VOYAGEURS",
|
||||
'4932ZA' => "Taxis",
|
||||
'4932ZB' => "Location de voitures avec chauffeur",
|
||||
'494' => "TRANSPORTS ROUTIERS DE FRET ET SERVICES DE DÉMÉNAGEMENT",
|
||||
'4942ZZ' => "Services de déménagement",
|
||||
'52' => "ENTREPOSAGE ET SERVICES AUXILIAIRES DES TRANSPORTS",
|
||||
'522' => "ENTREPOSAGE ET STOCKAGE SERVICES AUXILIAIRES DES TRANSPORTS",
|
||||
'5221ZP' => "Assistance et remorquage de véhicules automobiles",
|
||||
'56' => "RESTAURATION",
|
||||
'561' => "RESTAURANTS ET SERVICES DE RESTAURATION MOBILE",
|
||||
'5610CQ' => "Fabrication artisanale associée à la vente de plats pour consommation immédiate en magasins sédentaires ou sur",
|
||||
'5610CR' => "Fabrication artisanale associée à la vente de plats pour consommation immédiate en véhicules motorisés ou non",
|
||||
'58' => "ÉDITION",
|
||||
'581' => "ÉDITION DE LIVRES ET PÉRIODIQUES ET AUTRES ACTIVITÉS D'ÉDITION",
|
||||
'5819ZP' => "Edition d'imprimés fiduciaires, imprimés commerciaux, formulaires imprimés",
|
||||
'71' => "ACTIVITÉS D'ARCHITECTURE ET D'INGÉNIERIE ; ACTIVITÉS DE CONTRÔLE ET ANALYSES",
|
||||
'712' => "ACTIVITÉS DE CONTRÔLE ET ANALYSES TECHNIQUES",
|
||||
'7120AZ' => "Contrôle technique automobile",
|
||||
'73' => "PUBLICITÉ ET ÉTUDES DE MARCHÉ",
|
||||
'731' => "PUBLICITÉ",
|
||||
'7311ZP' => "Pose d'affiches",
|
||||
'74' => "AUTRES ACTIVITÉS SPÉCIALISÉES, SCIENTIFIQUES ET TECHNIQUES",
|
||||
'741' => "ACTIVITÉS SPÉCIALISÉES DE DESIGN",
|
||||
'7410ZP' => "Conception de modèles pour étalages et décoration",
|
||||
'742' => "ACTIVITÉS PHOTOGRAPHIQUES",
|
||||
'7420ZQ' => "Studio de photographie",
|
||||
'7420ZR' => "Portrait, reportage",
|
||||
'7420ZS' => "Photographie industrielle et publicitaire",
|
||||
'7420ZT' => "Laboratoires techniques de développement et de tirage",
|
||||
'80' => "ENQUÊTES ET SÉCURITÉ",
|
||||
'802' => "ACTIVITÉS LIÉES AUX SYSTÈMES DE SÉCURITÉ",
|
||||
'8020ZP' => "Activité de surveillance et installation de systèmes d'alarme non dissociées",
|
||||
'81' => "SERVICES RELATIFS AUX BÂTIMENTS ET AMÉNAGEMENT PAYSAGER",
|
||||
'812' => "ACTIVITÉS DE NETTOYAGE",
|
||||
'8121ZZ' => "Nettoyage courant des bâtiments",
|
||||
'8122ZZ' => "Autres activités de nettoyage des bâtiments et nettoyage industriel",
|
||||
'8129AZ' => "Désinfection, désinsectisation, dératisation",
|
||||
'8129BP' => "Autres services de nettoyage",
|
||||
'82' => "ACTIVITÉS ADMINISTRATIVES ET AUTRES ACTIVITÉS DE SOUTIEN AUX ENTREPRISES",
|
||||
'821' => "ACTIVITÉS ADMINISTRATIVES",
|
||||
'8211ZP' => "Services administratifs divers",
|
||||
'8219ZP' => "Travaux à façon divers",
|
||||
'829' => "ACTIVITÉS DE SOUTIEN AUX ENTREPRISES N.C.A",
|
||||
'8292ZZ' => "Activités de conditionnement",
|
||||
'86' => "ACTIVITÉS POUR LA SANTÉ HUMAINE",
|
||||
'8690AZ' => "Ambulances",
|
||||
'90' => "ACTIVITÉS CRÉATIVES, ARTISTIQUES ET DE SPECTACLE",
|
||||
'900' => "ACTIVITÉS CRÉATIVES, ARTISTIQUES ET DE SPECTACLE",
|
||||
'9001ZP' => "Spectacles de marionnettes",
|
||||
'9003AP' => "Restauration d'objets d'art",
|
||||
'95' => "RÉPARATION D'ORDINATEURS ET DE BIENS PERSONNELS ET DOMESTIQUES",
|
||||
'951' => "RÉPARATION D'ORDINATEURS ET D'ÉQUIPEMENTS DE COMMUNICATION",
|
||||
'9511ZZ' => "Réparation d'ordinateurs et d'équipements périphériques",
|
||||
'9512ZZ' => "Réparation d'équipements de communication",
|
||||
'952' => "RÉPARATION DE BIENS PERSONNELS ET DOMESTIQUES",
|
||||
'9521ZZ' => "Réparation de produits électroniques grand public",
|
||||
'9522ZA' => "Réparation de tondeuses à gazon",
|
||||
'9522ZB' => "Réparation d'appareils électroménagers",
|
||||
'9523ZZ' => "Réparation de chaussures et d'articles en cuir",
|
||||
'9524ZZ' => "Réparation de meubles et d'équipements du foyer",
|
||||
'9525ZZ' => "Réparation d'articles d'horlogerie et de bijouterie",
|
||||
'9529ZA' => "Aiguisage de coutellerie",
|
||||
'9529ZB' => "Réparation de cycles",
|
||||
'9529ZC' => "Atelier de retouches",
|
||||
'9529ZD' => "Réparation d'articles de sport et de campement",
|
||||
'9529ZE' => "Accordeurs de piano et restauration d'autres instruments de musique",
|
||||
'9529ZF' => "Réparation non classées ailleurs",
|
||||
'96' => "AUTRES SERVICES PERSONNELS",
|
||||
'960' => "AUTRES SERVICES PERSONNELS",
|
||||
'9601AZ' => "Blanchisserie-teinturerie de gros",
|
||||
'9601BQ' => "Laveries, blanchisseries et teintureries de détail",
|
||||
'9601BR' => "Pressings",
|
||||
'9602AA' => "Coiffure en salon",
|
||||
'9602AB' => "Coiffure hors salon",
|
||||
'9602BA' => "Soins de beauté en salon",
|
||||
'9602BB' => "Soins de beauté hors salon",
|
||||
'9603ZP' => "Embaumement, soins mortuaires",
|
||||
'9609ZP' => "Toilettage d'animaux de compagnie",
|
||||
'A' => "AGRICULTURE, SYLVICULTURE ET PÊCHE",
|
||||
'B' => "INDUSTRIES EXTRACTIVES",
|
||||
'C' => "INDUSTRIE MANUFACTURIÈRE",
|
||||
'E' => "PRODUCTION ET DISTRIBUTION D'EAU ; ASSAINISSEMENT, GESTION DES DÉCHETS ET",
|
||||
'F' => "CONSTRUCTION",
|
||||
'G' => "COMMERCE ; RÉPARATION D'AUTOMOBILES ET DE MOTOCYCLES",
|
||||
'H' => "TRANSPORTS ET ENTREPOSAGE",
|
||||
'I' => "HÉBERGEMENT ET RESTAURATION",
|
||||
'J' => "INFORMATION ET COMMUNICATION",
|
||||
'M' => "ACTIVITÉS SPÉCIALISÉES, SCIENTIFIQUES ET TECHNIQUES",
|
||||
'N' => "ACTIVITÉS DE SERVICES ADMINISTRATIFS ET DE SOUTIEN",
|
||||
'Q' => "SANTÉ HUMAINE ET ACTION SOCIALE",
|
||||
'R' => "ARTS, SPECTACLES ET ACTIVITÉS RÉCRÉATIVES",
|
||||
'S' => "AUTRES ACTIVITÉS DE SERVICES",
|
||||
);
|
File diff suppressed because it is too large
Load Diff
@ -1,456 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
define('HOST_INSEE', 'avis-situation-sirene.insee.fr');
|
||||
define('SITE_INSEE', 'http://'. HOST_INSEE .'/');
|
||||
|
||||
class MSirene {
|
||||
|
||||
private $response1;
|
||||
|
||||
function __construct() {
|
||||
|
||||
/** Etape de connexion au site de l'INSEE pour simuler correctement un utilisateur WEB
|
||||
**/
|
||||
$this->response1=getUrl(SITE_INSEE,'','','',false,HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'SIRENET_Script/Accueil/script_page_accueil.asp',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_haut.asp?grille=siren&action=nouvelle', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_bas.asp?grille=siren&action=nouvelle', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/frame_interrogation.asp?ACTION=nouvelle&Niveau=siren',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_haut.asp?grille=siren&action=nouvelle', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle',false, HOST_INSEE);
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_bas.asp?grille=siren&action=nouvelle', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle',false, HOST_INSEE);
|
||||
//sleep(1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère les informations relatives à un établissement et son entreprise (par défaut le siège si pas de NIC)
|
||||
*
|
||||
* @param unknown_type $sirenLu
|
||||
* @param unknown_type $nicLu
|
||||
*/
|
||||
function getInfoEtab($sirenLu, $nicLu='') //if ($argv[1]=='id' || $argv[1]=='pj')
|
||||
{
|
||||
$tabRet=array();
|
||||
|
||||
/** Paramètre de requête "option" à l'insee :
|
||||
** 1: Fiche du siège + Données entreprises
|
||||
** 2: Tous les établissements de l'entreprise
|
||||
** 3: Un établissement particulier
|
||||
** 4: Département
|
||||
**/
|
||||
if ($nicLu<>'') $option=3;
|
||||
else $option=1;
|
||||
|
||||
// Requête d'interrogation
|
||||
$postData=array('siren'=>$sirenLu,
|
||||
'option'=>$option,
|
||||
'nic'=>$nicLu,
|
||||
'dep'=>'',
|
||||
'listeDep'=>'');
|
||||
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', $this->response1["header"]["Set-Cookie"], $postData, SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle',false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action=nouveau', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false',false,HOST_INSEE);
|
||||
if ($responseQ['code']==302)
|
||||
{
|
||||
//$libelleErreur='Erreur INSEE inconnue 1';
|
||||
|
||||
// Siren Invalide ou autre erreur non répertoriée !
|
||||
$header=$responseQ['header'];
|
||||
if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur')
|
||||
{
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false',false,HOST_INSEE);
|
||||
$responseErreur=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Erreur_principal.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur',false,HOST_INSEE);
|
||||
$pos=strpos($responseErreur['body'], '<td valign=top bgcolor="#FFCC33"><font face=Arial size=2><b>');
|
||||
if ($pos>0){
|
||||
$posFin=strpos($responseErreur['body'], '</b></font></td>', $pos+60);
|
||||
$libelleErreur=trim(substr($responseErreur['body'], $pos+60, $posFin-($pos+60)));
|
||||
} else
|
||||
$tabRet['erreur']='Erreur INSEE inconnue';
|
||||
}
|
||||
else
|
||||
{ if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege')
|
||||
// L'établissement demandé est un siège !
|
||||
$option=1;
|
||||
|
||||
if ($option==3)
|
||||
{
|
||||
// On déroule les URLs d'appels établissement
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false',false,HOST_INSEE);
|
||||
//sleep(1);
|
||||
// Frames réponse niveau Etab
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement',false,HOST_INSEE);
|
||||
$responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=etablissement', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=etablissement', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement',false,HOST_INSEE);
|
||||
$responseEtab=$responseEtab['body'];
|
||||
// On recherche si on est bien sur un fiche établissement
|
||||
$pos=strpos($responseEtab, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche Etablissement</B>');
|
||||
if ($pos<1)
|
||||
$tabRet['erreur']='Erreur SCRIPT Fiche Etablissement non trouvée';
|
||||
$responseSiege=$responseEtab;
|
||||
}
|
||||
else
|
||||
{
|
||||
// On déroule les URLs d'appels Sièges
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false',false,HOST_INSEE);
|
||||
//sleep(1);
|
||||
// Frames réponse niveau sièges
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege',false,HOST_INSEE);
|
||||
$responseSiege=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=siege', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege',false,HOST_INSEE);
|
||||
$responseSiege=$responseSiege['body'];//strip_tags(html_entity_decode(), '<td>');
|
||||
// On recherche si on est bien sur un fiche siège
|
||||
$pos=strpos($responseSiege, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche siège</B>');
|
||||
if ($pos<1)
|
||||
$tabRet['erreur']='Erreur SCRIPT Fiche Siège non trouvée';
|
||||
}
|
||||
|
||||
// Niveau entreprise
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege',false,HOST_INSEE);
|
||||
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=entreprise',false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail',false,HOST_INSEE);
|
||||
$responseEntreprise=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=entreprise', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail', false,HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=entreprise', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail',false,HOST_INSEE);
|
||||
$responseEntreprise=$responseEntreprise['body'];
|
||||
$pos=strpos($responseEntreprise, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche Entreprise</B>');
|
||||
if ($pos<1) {
|
||||
$tabRet['erreur']='Erreur SCRIPT Fiche Entreprise non trouvée';
|
||||
}
|
||||
|
||||
/** Recherche des données établissement
|
||||
**/
|
||||
$tabRet['etablissement']=$this->getDataEtablissement($responseSiege);
|
||||
|
||||
/** Recherche des données entreprise
|
||||
**/
|
||||
$tabRet['entreprise']=$this->getDataEntreprise($responseEntreprise);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère la liste de tous les établissements d'une entreprise
|
||||
*
|
||||
* @param unknown_type $sirenLu
|
||||
*/
|
||||
function getListeEtabs($sirenLu)
|
||||
{
|
||||
// Requête d'interrogation
|
||||
$postData=array('siren'=>$sirenLu,
|
||||
'option'=>2,
|
||||
'nic'=>'',
|
||||
'dep'=>'',
|
||||
'listeDep'=>'');
|
||||
|
||||
$response=getUrl(SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', $this->response1["header"]["Set-Cookie"], $postData, SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?grille=siren&action=nouvelle', false, HOST_INSEE);
|
||||
$action='nouveau';
|
||||
$referer=SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false';
|
||||
$nbRepTot=$pageCour=$nbTotPage=$nbRepParPage=$numEtab=0;
|
||||
$tabInfoEtab=array();
|
||||
$tabRet=array();
|
||||
|
||||
while(true)
|
||||
{
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action='.$action, $this->response1["header"]["Set-Cookie"], '', $referer, false, HOST_INSEE);
|
||||
if ($responseQ['code']==302)
|
||||
{
|
||||
//$libelleErreur='Erreur INSEE inconnue 1';
|
||||
|
||||
// Siren Invalide ou autre erreur non répertoriée !
|
||||
$header=$responseQ['header'];
|
||||
if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur')
|
||||
{
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', false, HOST_INSEE);
|
||||
$responseErreur=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Erreur_principal.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=erreur', false, HOST_INSEE);
|
||||
$pos=strpos($responseErreur['body'], '<td valign=top bgcolor="#FFCC33"><font face=Arial size=2><b>');
|
||||
if ($pos>0){
|
||||
$posFin=strpos($responseErreur['body'], '</b></font></td>', $pos+60);
|
||||
$libelleErreur=trim(substr($responseErreur['body'], $pos+60, $posFin-($pos+60)));
|
||||
} else
|
||||
$libelleErreur='Erreur INSEE inconnue';
|
||||
}
|
||||
|
||||
// On déroule les URLs d'appels liste des établissements
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', false, HOST_INSEE);
|
||||
//sleep(1);
|
||||
// Frames réponse niveau Etab
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', false, HOST_INSEE);
|
||||
$responseListe=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Liste_bas.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=liste', false, HOST_INSEE);
|
||||
$responseListe=$responseListe['body'];
|
||||
|
||||
$pos=strpos($responseListe, 'Nombre total de réponses : '."\r\n\t\t\t".'<font face="Arial" size="2"><b>');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseListe, '</b></font>', $pos+73);
|
||||
$nbRepTot=trim(substr($responseListe, $pos+73, $posFin-($pos+73)));
|
||||
}
|
||||
$pos=strpos($responseListe, ' - Affichage de la page '."\r\n\t\t\t".'<font face="Arial" size="2"><b>');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseListe, ' - </b></font>', $pos+75);
|
||||
$strPages=trim(substr($responseListe, $pos+75, $posFin-($pos+75)));
|
||||
$tabPages=explode(' / ', $strPages);
|
||||
$pageCour=$tabPages[0];
|
||||
$nbTotPage=$tabPages[1];
|
||||
}
|
||||
$pos=strpos($responseListe, ' - </b></font>'."\r\n\t\t\t".'<font face="Arial" size="2"><b>');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseListe, '</b></font>', $pos+60);
|
||||
$nbRepParPage=trim(substr($responseListe, $pos+60, $posFin-($pos+60)));
|
||||
}
|
||||
|
||||
/* TODO = Récupérer les infos étab + entrep pour chaque ligne du tableau !!!*
|
||||
*/
|
||||
if ($libelleErreur=='Erreur SCRIPT Inconnue')
|
||||
$libelleErreur='';
|
||||
for ($i=1;$i<11; $i++)
|
||||
{
|
||||
if ($numEtab==$nbRepTot)
|
||||
break; // Il n'y a pas plus d'établissement à récupérer ! On sort...
|
||||
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/question.asp?action=detail&numtableau='.$i, $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp', false, HOST_INSEE);
|
||||
if ($responseQ['code']==302)
|
||||
{
|
||||
// Siren Invalide ou autre erreur non répertoriée !
|
||||
$header=$responseQ['header'];
|
||||
if (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i)
|
||||
{
|
||||
// On déroule les URLs d'appels fiche siège
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege&numtableau='.$i, $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', false, HOST_INSEE);
|
||||
//sleep(1);
|
||||
// Frames réponse niveau Etab
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=siege', false, HOST_INSEE);
|
||||
$responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=siege&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=siege&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseEtab=$responseEtab['body'];
|
||||
|
||||
// Récupération de la fiche entreprise INSEE
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=siege&numtableau='.$i.'&origine=liste', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/frame_reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseEntreprise=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=entreprise&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=entreprise&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/reponse/Frame_Reponse.asp?niveau=entreprise&dest=detail&origine=liste&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseEntreprise=$responseEntreprise['body'];
|
||||
}
|
||||
elseif (trim($header['Location'])=='/REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i)
|
||||
{
|
||||
// On déroule les URLs d'appels établissement
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement&numtableau='.$i, $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Interrogation/Interrogation_principal.asp?action=valider&grille=siren&waitframe=false', false, HOST_INSEE);
|
||||
//sleep(1);
|
||||
// Frames réponse niveau Etab
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_menu.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'SIRENET_Script/Interrogation/script_recherche_barre_haut.asp?niveau=siren', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Reponse_haut.asp', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?dest=detail&niveau=etablissement', false, HOST_INSEE);
|
||||
$responseEtab=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_principal.asp?niveau=etablissement&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseQ=getUrl(SITE_INSEE .'REPERTOIRE/Reponse/Detail_bas.asp?niveau=etablissement&numtableau='.$i.'&origine=liste', $this->response1["header"]["Set-Cookie"], '', SITE_INSEE .'REPERTOIRE/Reponse/Frame_Reponse.asp?origine=liste&dest=detail&niveau=etablissement&numtableau='.$i, false, HOST_INSEE);
|
||||
$responseEtab=$responseEtab['body'];
|
||||
}
|
||||
$tabRet['etablissements'][$numEtab]=$this->getDataEtablissement($responseEtab);
|
||||
$tabRet['entreprise']=$this->getDataEntreprise($responseEntreprise);
|
||||
|
||||
if ($libelleErreur<>'' && $tabInfoEtab['siret'] =='') $siret=$sirenLu . $nicLu;
|
||||
else $siret=$tabInfoEtab['siret'];
|
||||
|
||||
/*$str= date('d/m/Y à H:i:s') .';'.
|
||||
$libelleErreur .';'.
|
||||
// Siège
|
||||
$siret .';'.
|
||||
$tabInfoEtab['active'] .';'.
|
||||
$tabInfoEtab['dateAbsActivite'] .';'.
|
||||
$tabInfoEtab['typeEtablissement'] .';'.
|
||||
$tabInfoEtab['dateMAJ'] .';'.
|
||||
$tabInfoEtab['dateCreation'] .';'.
|
||||
$tabInfoEtab['raisonSociale'] .';'.
|
||||
$tabInfoEtab['Enseigne'] .';'.
|
||||
$tabInfoEtab['NafCode'] .';'.
|
||||
$tabInfoEtab['NafLib'] .';'.
|
||||
$tabInfoEtab['AdresseLigne1'] .';'.
|
||||
$tabInfoEtab['AdresseLigne2'] .';'.
|
||||
$tabInfoEtab['AdresseLigne3'] .';'.
|
||||
$tabInfoEtab['etatJuridique'] .';'.
|
||||
$tabInfoEtab['dateEtatJuridique'] .';'.
|
||||
// Entreprise
|
||||
$tabInfoEntrep['dateCreationEntrep'] .';'.
|
||||
$tabInfoEntrep['raisonSocialeEntrep'] .';'.
|
||||
$tabInfoEntrep['sigle'] .';'.
|
||||
$tabInfoEntrep['NafCodeEntrep'] .';'.
|
||||
$tabInfoEntrep['NafLibEntrep'] .';'.
|
||||
$tabInfoEntrep['FJCodeEntrep'] .';'.
|
||||
$tabInfoEntrep['FJLibEntrep'] .';'.
|
||||
$tabInfoEntrep['nbEtabActifs'] .';';
|
||||
*/
|
||||
//fwrite($fpOUT, $str."\r\n");
|
||||
$numEtab++;
|
||||
$num=$key+1;
|
||||
$typeEtablissement=$tabInfoEtab['typeEtablissement'];
|
||||
//echo "Question $num/$nbLignes : Demande=$sirenLu$nicLu Etablissement $numEtab/$nbRepTot $typeEtablissement=$siret $libelleErreur\r\n";
|
||||
flush();
|
||||
sleep(1);
|
||||
|
||||
}//end for
|
||||
}//end if
|
||||
if ($pageCour==$nbTotPage) {
|
||||
// On sort de la boucle de passage à la page de liste suivante car il n'y a plus d'autres pages
|
||||
break;
|
||||
} else {
|
||||
$action='listeplus';
|
||||
$referer=SITE_INSEE .'REPERTOIRE/Reponse/Liste_principal.asp';
|
||||
}
|
||||
}
|
||||
} //Fin While
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
private function getDataEtablissement($pageHtml)
|
||||
{
|
||||
global $libelleErreur;
|
||||
|
||||
$responseSiege=$pageHtml;
|
||||
$tabRet=array();
|
||||
|
||||
// On recherche si on est sur un établissement siège ou secondaire
|
||||
$pos=strpos($pageHtml, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche Etablissement</B>');
|
||||
if ($pos>0)
|
||||
$tabRet['typeEtablissement']='secondaire';
|
||||
|
||||
$pos=strpos($pageHtml, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche siège</B>');
|
||||
if ($pos>0)
|
||||
$tabRet['typeEtablissement']='siège';
|
||||
|
||||
// Recherche Dernière MAJ / Activité
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">(dernière mise à jour :');
|
||||
if ($pos>0) {
|
||||
$tabRet['dateMAJ']=substr($responseSiege, $pos+51, 10);
|
||||
$tabRet['dateAbsActivite']='';
|
||||
$tabRet['active']='O';
|
||||
} else {
|
||||
$tabRet['active']='N';
|
||||
$tabRet['dateMAJ']='';
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">Absence d\'activité notée le : ');
|
||||
if ($pos>0) $tabRet['dateAbsActivite']=substr($responseSiege, $pos+78, 10);
|
||||
else {
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">Absence d\'activité');
|
||||
if ($pos>0) $tabRet['dateAbsActivite']='';
|
||||
}
|
||||
}
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>n° SIRET :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
$tabRet['siret']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+97, 32)));
|
||||
|
||||
$pos=strpos($responseSiege, 'size="-1"> <B>Date de création :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+109);
|
||||
$tabRet['dateCreation']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+109, $posFin-($pos+109))));
|
||||
}
|
||||
else $tabRet['dateCreation']='';
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=127;
|
||||
if ($pos==0){
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=122;
|
||||
if ($pos==0){
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=126;
|
||||
$libelleErreur='Informations INSEE non diffusables';
|
||||
}
|
||||
}
|
||||
if ($libelleErreur=='') {
|
||||
//LARGE*DOMINIQUE MICHEL/ <BR>GERANT SARL BIMAGIQUE </font>
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+$len);
|
||||
$raisonSocialeStr=trim(substr($responseSiege, $pos+$len, $posFin-($pos+$len)));
|
||||
$raisonSocialeTabLigne=explode('<BR>', $raisonSocialeStr);
|
||||
$tabRet['raisonSociale']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0])));
|
||||
$tabRet['Enseigne']=trim(str_replace(' ', '', html_entity_decode(@$raisonSocialeTabLigne[1])));
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Activité principale :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['NafCode']=substr($responseSiege, $pos+120, 4);
|
||||
$tabRet['NafLib']=trim(substr($responseSiege, $pos+137, 70));
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Adresse :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+103);
|
||||
$AdresseStr=substr($responseSiege, $pos+103, $posFin-($pos+103));
|
||||
$AdresseTabLigne=explode('<BR>', $AdresseStr);//'
|
||||
$tabRet['AdresseLigne1']=str_replace(' ', '/', $AdresseTabLigne[0]);
|
||||
$tabRet['AdresseLigne2']=str_replace(' ', '/', $AdresseTabLigne[1]);
|
||||
$tabRet['AdresseLigne3']=str_replace(' ', '/', $AdresseTabLigne[2]);
|
||||
/*
|
||||
$AdresseNum=$AdresseTabLigne1[0];
|
||||
$AdresseVoi=$AdresseTabLigne1[1];
|
||||
$AdresseRue=$AdresseTabLigne1[2];
|
||||
$AdresseCP=$AdresseTabLigne2[0];
|
||||
$AdresseVille=$AdresseTabLigne2[1];
|
||||
*/
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="-1"><b>L\'entreprise est connue au répertoire comme ');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseSiege, '</b>', $pos+106);
|
||||
$tabRet['etatJuridique']=html_entity_decode(substr($responseSiege, $pos+106, $posFin-($pos+106)));
|
||||
$tabRet['dateEtatJuridique']='';
|
||||
} else {
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="-1"><b>L\'entreprise est cessée le : ');
|
||||
$tabRet['dateEtatJuridique']=substr($responseSiege, $pos+86, 10);
|
||||
$tabRet['etatJuridique']='cessée';
|
||||
}
|
||||
//echo 'GetDataEtab="'.$libelleErreur."\"\r\n";
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function getDataEntreprise($pageHtml)
|
||||
{
|
||||
global $libelleErreur;
|
||||
|
||||
$responseEntreprise=$pageHtml;
|
||||
$tabRet=array();
|
||||
|
||||
if ($libelleErreur=='') {
|
||||
|
||||
$pos=strpos($responseEntreprise, 'size="-1"> <B>Date de création :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
if ($pos>0)
|
||||
$tabRet['dateCreationEntrep']=substr($responseEntreprise, $pos+109, 10);
|
||||
else
|
||||
$tabRet['$dateCreationEntrep']='';
|
||||
|
||||
// Raison sociale et Sigle
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Raison sociale et Sigle :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$posFin=strpos($responseEntreprise, '</font>', $pos+123);
|
||||
$raisonSocialeStr=trim(substr($responseEntreprise, $pos+123, $posFin-($pos+123)));
|
||||
$raisonSocialeTabLigne=explode('<BR>', $raisonSocialeStr);
|
||||
$tabRet['raisonSocialeEntrep']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0])));
|
||||
$tabRet['sigle']=trim(str_replace(' ', '', html_entity_decode(@$raisonSocialeTabLigne[1])));
|
||||
|
||||
// Activité prinicpale Entrep
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Activité principale :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['NafCodeEntrep']=substr($responseEntreprise, $pos+120, 4);
|
||||
$tabRet['NafLibEntrep']=trim(substr($responseEntreprise, $pos+137, 70));
|
||||
|
||||
// Forme Juridique
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Forme juridique :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['FJCodeEntrep']=substr($responseEntreprise, $pos+116, 4);
|
||||
$tabRet['FJLibEntrep']=trim(substr($responseEntreprise, $pos+133, 70));
|
||||
|
||||
// Nb Etab Actifs
|
||||
$tabRet['nbEtabActifs']=trim(str_replace(' ', '', html_entity_decode(@getTextInHtml($responseEntreprise, '<B>Nb établissements actifs :</B>', '<font face="Arial" size="-1">', '</font>'))));
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,178 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
1 => "AFN",
|
||||
2 => "ZAR",
|
||||
3 => "ALL",
|
||||
4 => "DZD",
|
||||
5 => "DEM",
|
||||
7 => "AOA",
|
||||
8 => "ANG",
|
||||
9 => "SAR",
|
||||
10 => "ARS",
|
||||
11 => "AUD",
|
||||
12 => "ATS",
|
||||
13 => "BSD",
|
||||
14 => "BHD",
|
||||
15 => "BDT",
|
||||
16 => "BBD",
|
||||
17 => "BEF",
|
||||
18 => "BZD",
|
||||
19 => "BMD",
|
||||
20 => "MMK",
|
||||
21 => "BOB",
|
||||
22 => "BWP",
|
||||
23 => "BRL",
|
||||
24 => "BND",
|
||||
25 => "BGN",
|
||||
26 => "BIF",
|
||||
27 => "KHR",
|
||||
28 => "XAF",
|
||||
29 => "CAD",
|
||||
32 => "CLP",
|
||||
33 => "CNY",
|
||||
34 => "CYP",
|
||||
35 => "COP",
|
||||
36 => "KMF",
|
||||
37 => "ZRN",
|
||||
38 => "KPW",
|
||||
39 => "KRW",
|
||||
40 => "CRC",
|
||||
42 => "CUP",
|
||||
44 => "DKK",
|
||||
45 => "DJF",
|
||||
46 => "XCD",
|
||||
47 => "EGP",
|
||||
48 => "AED",
|
||||
50 => "ESP",
|
||||
51 => "USD",
|
||||
52 => "ETB",
|
||||
53 => "FKP",
|
||||
54 => "FJD",
|
||||
55 => "FIM",
|
||||
56 => "GMD",
|
||||
58 => "GHC",
|
||||
59 => "GBP",
|
||||
60 => "GRD",
|
||||
61 => "GTQ",
|
||||
62 => "GWP",
|
||||
63 => "GNF",
|
||||
65 => "GYD",
|
||||
66 => "HTG",
|
||||
68 => "HNL",
|
||||
69 => "HKD",
|
||||
70 => "HUF",
|
||||
71 => "INR",
|
||||
72 => "IDR",
|
||||
73 => "IQD",
|
||||
74 => "IRR",
|
||||
75 => "IEP",
|
||||
76 => "ISK",
|
||||
77 => "ILS",
|
||||
78 => "ITL",
|
||||
79 => "JMD",
|
||||
80 => "JPY",
|
||||
81 => "JOD",
|
||||
82 => "KES",
|
||||
83 => "KWD",
|
||||
84 => "LAK",
|
||||
85 => "LBP",
|
||||
86 => "LRD",
|
||||
87 => "LYD",
|
||||
89 => "LUF",
|
||||
90 => "MOP",
|
||||
91 => "MGF",
|
||||
92 => "MYR",
|
||||
93 => "MWK",
|
||||
94 => "MVR",
|
||||
96 => "MTL",
|
||||
97 => "MAD",
|
||||
98 => "MUR",
|
||||
99 => "MRO",
|
||||
100 => "MXN",
|
||||
101 => "MNT",
|
||||
102 => "MZM",
|
||||
103 => "NPR",
|
||||
104 => "NIO",
|
||||
106 => "NGN",
|
||||
107 => "NOK",
|
||||
110 => "NZD",
|
||||
111 => "OMR",
|
||||
112 => "UGX",
|
||||
113 => "PKR",
|
||||
114 => "PAB",
|
||||
115 => "PYG",
|
||||
116 => "NLG",
|
||||
117 => "PEN",
|
||||
118 => "PHP",
|
||||
119 => "PLN",
|
||||
120 => "XPF",
|
||||
121 => "PTE",
|
||||
122 => "QAR",
|
||||
123 => "RON",
|
||||
124 => "RWF",
|
||||
125 => "SVC",
|
||||
126 => "WST",
|
||||
127 => "STD",
|
||||
129 => "SCR",
|
||||
130 => "SLL",
|
||||
131 => "SGD",
|
||||
132 => "SBD",
|
||||
133 => "SOS",
|
||||
134 => "SDD",
|
||||
135 => "LKR",
|
||||
136 => "SRG",
|
||||
137 => "SEK",
|
||||
138 => "CHF",
|
||||
139 => "SYP",
|
||||
140 => "SZL",
|
||||
141 => "TWD",
|
||||
142 => "TZS",
|
||||
144 => "CZK",
|
||||
145 => "THB",
|
||||
147 => "TTD",
|
||||
148 => "TND",
|
||||
149 => "TRL",
|
||||
152 => "UYU",
|
||||
153 => "VUV",
|
||||
154 => "VEB",
|
||||
155 => "VND",
|
||||
157 => "YER",
|
||||
159 => "YUM",
|
||||
160 => "CDF",
|
||||
161 => "ZMK",
|
||||
162 => "ZWD",
|
||||
168 => "ADP",
|
||||
174 => "KYD",
|
||||
176 => "LVL",
|
||||
177 => "LTL",
|
||||
178 => "EEK",
|
||||
179 => "UAH",
|
||||
181 => "SIT",
|
||||
182 => "SKK",
|
||||
183 => "KZT",
|
||||
184 => "BYR",
|
||||
186 => "HRK",
|
||||
188 => "TMM",
|
||||
189 => "KGS",
|
||||
190 => "MDL",
|
||||
191 => "GIP",
|
||||
192 => "RUB",
|
||||
195 => "AMD",
|
||||
196 => "AZM",
|
||||
197 => "BAM",
|
||||
198 => "GEL",
|
||||
201 => "MKD",
|
||||
205 => "AWG",
|
||||
207 => "TOP",
|
||||
208 => "BTN",
|
||||
209 => "PGK",
|
||||
210 => "UZS",
|
||||
211 => "ILS",
|
||||
212 => "TJS",
|
||||
213 => "CVE",
|
||||
214 => "ERN",
|
||||
218 => "DOP",
|
||||
238 => "SHP",
|
||||
244 => "TPE",
|
||||
300 => "EUR",
|
||||
);
|
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
1 => 1520,
|
||||
2 => 1436,
|
||||
3 => 1460,
|
||||
4 => 1209,
|
||||
5 => 1445,
|
||||
6 => 1603,
|
||||
7 => 1506,
|
||||
8 => 1430,
|
||||
9 => 1600,
|
||||
10 => 1500,
|
||||
11 => 1200,
|
||||
12 => 1413,
|
||||
13 => 1305,
|
||||
14 => 1411,
|
||||
15 => 1412,
|
||||
16 => 1425,
|
||||
18 => 1502,
|
||||
19 => 1501,
|
||||
20 => 1525,
|
||||
21 => 1435,
|
||||
44 => 1100,
|
||||
45 => 1101,
|
||||
48 => 1201,
|
||||
49 => 1307,
|
||||
55 => 1306,
|
||||
56 => 1110,
|
||||
57 => 1119,
|
||||
58 => 1545,
|
||||
59 => 1506,
|
||||
60 => 1111,
|
||||
61 => 1116,
|
||||
62 => 1118,
|
||||
63 => 1115,
|
||||
64 => 1645,
|
||||
);
|
@ -1,240 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
1 => "AF",
|
||||
2 => "ZA",
|
||||
3 => "AL",
|
||||
4 => "DZ",
|
||||
5 => "DE",
|
||||
7 => "AO",
|
||||
8 => "AN",
|
||||
9 => "SA",
|
||||
10 => "AR",
|
||||
11 => "AU",
|
||||
12 => "AT",
|
||||
13 => "BS",
|
||||
14 => "BH",
|
||||
15 => "BD",
|
||||
16 => "BB",
|
||||
17 => "BE",
|
||||
18 => "BZ",
|
||||
19 => "BM",
|
||||
20 => "MM",
|
||||
21 => "BO",
|
||||
22 => "BW",
|
||||
23 => "BR",
|
||||
24 => "BN",
|
||||
25 => "BG",
|
||||
26 => "BI",
|
||||
27 => "KH",
|
||||
28 => "CM",
|
||||
29 => "CA",
|
||||
31 => "CF",
|
||||
32 => "CL",
|
||||
33 => "CN",
|
||||
34 => "CY",
|
||||
35 => "CO",
|
||||
36 => "KM",
|
||||
37 => "CG",
|
||||
38 => "KP",
|
||||
39 => "KR",
|
||||
40 => "CR",
|
||||
41 => "CI",
|
||||
42 => "CU",
|
||||
43 => "BJ",
|
||||
44 => "DK",
|
||||
45 => "DJ",
|
||||
46 => "DM",
|
||||
47 => "EG",
|
||||
48 => "AE",
|
||||
49 => "EC",
|
||||
50 => "ES",
|
||||
51 => "US",
|
||||
52 => "ET",
|
||||
53 => "FK",
|
||||
54 => "FJ",
|
||||
55 => "FI",
|
||||
56 => "GM",
|
||||
57 => "GA",
|
||||
58 => "GH",
|
||||
59 => "GB",
|
||||
60 => "GR",
|
||||
61 => "GT",
|
||||
62 => "GW",
|
||||
63 => "GN",
|
||||
64 => "GQ",
|
||||
65 => "GY",
|
||||
66 => "HT",
|
||||
67 => "BF",
|
||||
68 => "HN",
|
||||
69 => "HK",
|
||||
70 => "HU",
|
||||
71 => "IN",
|
||||
72 => "ID",
|
||||
73 => "IR",
|
||||
74 => "IQ",
|
||||
75 => "IE",
|
||||
76 => "IS",
|
||||
77 => "IL",
|
||||
78 => "IT",
|
||||
79 => "JM",
|
||||
80 => "JP",
|
||||
81 => "JO",
|
||||
82 => "KE",
|
||||
83 => "KW",
|
||||
84 => "LA",
|
||||
85 => "LB",
|
||||
86 => "LR",
|
||||
87 => "LY",
|
||||
88 => "LI",
|
||||
89 => "LU",
|
||||
90 => "MO",
|
||||
91 => "MG",
|
||||
92 => "MY",
|
||||
93 => "MW",
|
||||
94 => "MV",
|
||||
95 => "ML",
|
||||
96 => "MT",
|
||||
97 => "MA",
|
||||
98 => "MU",
|
||||
99 => "MR",
|
||||
100 => "MX",
|
||||
101 => "MN",
|
||||
102 => "MZ",
|
||||
103 => "NP",
|
||||
104 => "NI",
|
||||
105 => "NE",
|
||||
106 => "NG",
|
||||
107 => "NO",
|
||||
108 => "NC",
|
||||
110 => "NZ",
|
||||
111 => "OM",
|
||||
112 => "UG",
|
||||
113 => "PK",
|
||||
114 => "PA",
|
||||
115 => "PY",
|
||||
116 => "NL",
|
||||
117 => "PE",
|
||||
118 => "PH",
|
||||
119 => "PL",
|
||||
120 => "PF",
|
||||
121 => "PT",
|
||||
122 => "QA",
|
||||
123 => "RO",
|
||||
124 => "RW",
|
||||
125 => "SV",
|
||||
126 => "WS",
|
||||
127 => "ST",
|
||||
128 => "SN",
|
||||
129 => "SC",
|
||||
130 => "SL",
|
||||
131 => "SG",
|
||||
132 => "SB",
|
||||
133 => "SO",
|
||||
134 => "SD",
|
||||
135 => "LK",
|
||||
136 => "SR",
|
||||
137 => "SE",
|
||||
138 => "CH",
|
||||
139 => "SY",
|
||||
140 => "SZ",
|
||||
141 => "TW",
|
||||
142 => "TZ",
|
||||
143 => "TD",
|
||||
144 => "CZ",
|
||||
145 => "TH",
|
||||
146 => "TG",
|
||||
147 => "TT",
|
||||
148 => "TN",
|
||||
149 => "TR",
|
||||
150 => "TV",
|
||||
152 => "UY",
|
||||
153 => "VU",
|
||||
154 => "VE",
|
||||
155 => "VN",
|
||||
156 => "WF",
|
||||
157 => "YE",
|
||||
159 => "YU",
|
||||
160 => "CD",
|
||||
161 => "ZM",
|
||||
162 => "ZW",
|
||||
163 => "RE",
|
||||
164 => "GP",
|
||||
165 => "MC",
|
||||
167 => "MQ",
|
||||
168 => "AD",
|
||||
172 => "TF",
|
||||
173 => "PR",
|
||||
174 => "KY",
|
||||
175 => "MP",
|
||||
176 => "LV",
|
||||
177 => "LT",
|
||||
178 => "EE",
|
||||
179 => "UA",
|
||||
181 => "SI",
|
||||
182 => "SK",
|
||||
183 => "KZ",
|
||||
184 => "BY",
|
||||
185 => "YT",
|
||||
186 => "HR",
|
||||
188 => "TM",
|
||||
189 => "KG",
|
||||
190 => "MD",
|
||||
191 => "GI",
|
||||
192 => "RU",
|
||||
193 => "GL",
|
||||
194 => "PM",
|
||||
195 => "AM",
|
||||
196 => "AZ",
|
||||
197 => "BA",
|
||||
198 => "GE",
|
||||
201 => "MK",
|
||||
202 => "SM",
|
||||
203 => "AI",
|
||||
204 => "AG",
|
||||
205 => "AW",
|
||||
206 => "GD",
|
||||
207 => "TO",
|
||||
208 => "BT",
|
||||
209 => "PG",
|
||||
210 => "UZ",
|
||||
211 => "PS",
|
||||
212 => "TJ",
|
||||
213 => "CV",
|
||||
214 => "ER",
|
||||
215 => "LS",
|
||||
216 => "NA",
|
||||
217 => "EH",
|
||||
218 => "DO",
|
||||
219 => "BV",
|
||||
220 => "CX",
|
||||
221 => "CC",
|
||||
222 => "CK",
|
||||
223 => "FO",
|
||||
224 => "GU",
|
||||
225 => "HM",
|
||||
226 => "VG",
|
||||
227 => "VI",
|
||||
228 => "KI",
|
||||
229 => "MH",
|
||||
230 => "FM",
|
||||
231 => "MS",
|
||||
232 => "NR",
|
||||
233 => "NU",
|
||||
234 => "NF",
|
||||
235 => "IO",
|
||||
236 => "PW",
|
||||
237 => "PN",
|
||||
238 => "SH",
|
||||
239 => "KN",
|
||||
240 => "LC",
|
||||
241 => "VC",
|
||||
242 => "AS",
|
||||
243 => "SJ",
|
||||
244 => "TP",
|
||||
245 => "TK",
|
||||
246 => "TC",
|
||||
247 => "VA",
|
||||
248 => "AQ",
|
||||
249 => "GS",
|
||||
250 => "UM",
|
||||
);
|
@ -1,277 +0,0 @@
|
||||
<?php
|
||||
return array(
|
||||
0 => array('Id'=>"1812", 'Nom'=>"Tribunal Inconnu", 'Code'=>"INCONU"),
|
||||
101 => array('Id'=>"140", 'Nom'=>"TC BOURG EN BRESSE", 'Code'=>"BOURGC"),
|
||||
151 => array('Id'=>"103", 'Nom'=>"TGIcc BELLEY", 'Code'=>"BELLEG"),
|
||||
201 => array('Id'=>"215", 'Nom'=>"TC CHAUNY", 'Code'=>"CHAUNC"),
|
||||
202 => array('Id'=>"705", 'Nom'=>"TC SAINT QUENTIN", 'Code'=>"STQUEC"),
|
||||
203 => array('Id'=>"651", 'Nom'=>"TC SOISSONS", 'Code'=>"SOISSC"),
|
||||
204 => array('Id'=>"764", 'Nom'=>"TC VERVINS", 'Code'=>"VERVIC"),
|
||||
252 => array('Id'=>"366", 'Nom'=>"TGI LAON", 'Code'=>"LAONG"),
|
||||
301 => array('Id'=>"259", 'Nom'=>"TC CUSSET", 'Code'=>"CUSSEC"),
|
||||
302 => array('Id'=>"491", 'Nom'=>"TC MOULINS", 'Code'=>"MOULIC"),
|
||||
303 => array('Id'=>"467", 'Nom'=>"TC MONTLUCON", 'Code'=>"MONTLC"),
|
||||
401 => array('Id'=>"425", 'Nom'=>"TC MANOSQUE", 'Code'=>"MANOSC"),
|
||||
453 => array('Id'=>"270", 'Nom'=>"TGI DIGNE", 'Code'=>"DIGNEG"),
|
||||
501 => array('Id'=>"325", 'Nom'=>"TC GAP", 'Code'=>"GAPC"),
|
||||
601 => array('Id'=>"40", 'Nom'=>"TC ANTIBES", 'Code'=>"ANTIBC"),
|
||||
602 => array('Id'=>"173", 'Nom'=>"TC CANNES", 'Code'=>"CANNEC"),
|
||||
603 => array('Id'=>"332", 'Nom'=>"TC GRASSE", 'Code'=>"GRASSC"),
|
||||
604 => array('Id'=>"449", 'Nom'=>"TC MENTON", 'Code'=>"MENTOC"),
|
||||
605 => array('Id'=>"518", 'Nom'=>"TC NICE", 'Code'=>"NICEC"),
|
||||
701 => array('Id'=>"39", 'Nom'=>"TC ANNONAY", 'Code'=>"ANNONC"),
|
||||
702 => array('Id'=>"53", 'Nom'=>"TC AUBENAS", 'Code'=>"AUBENC"),
|
||||
801 => array('Id'=>"224", 'Nom'=>"TC CHARLEVILLE MEZIERES", 'Code'=>"CHMEZC"),
|
||||
802 => array('Id'=>"640", 'Nom'=>"TC SEDAN", 'Code'=>"SEDANC"),
|
||||
901 => array('Id'=>"312", 'Nom'=>"TC FOIX", 'Code'=>"FOIXC"),
|
||||
951 => array('Id'=>"313", 'Nom'=>"TGI FOIX", 'Code'=>"FOIXG"),
|
||||
1001 => array('Id'=>"742", 'Nom'=>"TC TROYES", 'Code'=>"TROYEC"),
|
||||
1101 => array('Id'=>"175", 'Nom'=>"TC CARCASSONNE", 'Code'=>"CARCAC"),
|
||||
1102 => array('Id'=>"179", 'Nom'=>"TC CASTELNAUDARY", 'Code'=>"CASTEC"),
|
||||
1103 => array('Id'=>"395", 'Nom'=>"TC LIMOUX", 'Code'=>"LIMOUC"),
|
||||
1104 => array('Id'=>"508", 'Nom'=>"TC NARBONNE", 'Code'=>"NARBOC"),
|
||||
1201 => array('Id'=>"296", 'Nom'=>"TC ESPALION", 'Code'=>"ESPALC"),
|
||||
1202 => array('Id'=>"455", 'Nom'=>"TC MILLAU", 'Code'=>"MILLAC"),
|
||||
1203 => array('Id'=>"612", 'Nom'=>"TC RODEZ", 'Code'=>"RODEZC"),
|
||||
1204 => array('Id'=>"655", 'Nom'=>"TC SAINT AFRIQUE", 'Code'=>"STAFFC"),
|
||||
1301 => array('Id'=>"8", 'Nom'=>"TC AIX EN PROVENCE", 'Code'=>"AIXC"),
|
||||
1302 => array('Id'=>"49", 'Nom'=>"TC ARLES", 'Code'=>"ARLESC"),
|
||||
1303 => array('Id'=>"435", 'Nom'=>"TC MARSEILLE", 'Code'=>"MARSEC"),
|
||||
1304 => array('Id'=>"626", 'Nom'=>"TC SALON DE PROVENCE", 'Code'=>"SALONC"),
|
||||
1305 => array('Id'=>"715", 'Nom'=>"TC TARASCON", 'Code'=>"TARASC"),
|
||||
1401 => array('Id'=>"89", 'Nom'=>"TC BAYEUX", 'Code'=>"BAYEUC"),
|
||||
1402 => array('Id'=>"162", 'Nom'=>"TC CAEN", 'Code'=>"CAENC"),
|
||||
1403 => array('Id'=>"245", 'Nom'=>"TC CONDE-SUR-NOIREAU", 'Code'=>"CONDEC"),
|
||||
1404 => array('Id'=>"306", 'Nom'=>"TC FALAISE", 'Code'=>"FALAIC"),
|
||||
1405 => array('Id'=>"348", 'Nom'=>"TC HONFLEUR", 'Code'=>"HONFLC"),
|
||||
1407 => array('Id'=>"397", 'Nom'=>"TC LISIEUX", 'Code'=>"LISIEC"),
|
||||
1408 => array('Id'=>"782", 'Nom'=>"TC VIRE", 'Code'=>"VIREC"),
|
||||
1501 => array('Id'=>"59", 'Nom'=>"TC AURILLAC", 'Code'=>"AURILC"),
|
||||
1502 => array('Id'=>"677", 'Nom'=>"TC SAINT FLOUR", 'Code'=>"STFLOC"),
|
||||
1601 => array('Id'=>"35", 'Nom'=>"TC ANGOULEME", 'Code'=>"ANGOUC"),
|
||||
1602 => array('Id'=>"237", 'Nom'=>"TC COGNAC", 'Code'=>"COGNAC"),
|
||||
1701 => array('Id'=>"357", 'Nom'=>"TC JONZAC", 'Code'=>"JONZAC"),
|
||||
1702 => array('Id'=>"430", 'Nom'=>"TC MARENNES", 'Code'=>"MARENC"),
|
||||
1703 => array('Id'=>"603", 'Nom'=>"TC ROCHEFORT", 'Code'=>"ROCHEC"),
|
||||
1704 => array('Id'=>"606", 'Nom'=>"TC LA ROCHELLE", 'Code'=>"ROCHLC"),
|
||||
1708 => array('Id'=>"623", 'Nom'=>"TC SAINTES", 'Code'=>"SAINTC"),
|
||||
1801 => array('Id'=>"148", 'Nom'=>"TC BOURGES", 'Code'=>"BRGESC"),
|
||||
1901 => array('Id'=>"159", 'Nom'=>"TC BRIVE", 'Code'=>"BRIVEC"),
|
||||
1902 => array('Id'=>"745", 'Nom'=>"TC TULLE", 'Code'=>"TULLEC"),
|
||||
2001 => array('Id'=>"11", 'Nom'=>"TC AJACCIO", 'Code'=>"AJACCC"),
|
||||
2002 => array('Id'=>"86", 'Nom'=>"TC BASTIA", 'Code'=>"BASTIC"),
|
||||
2003 => array('Id'=>"349", 'Nom'=>"TC L'ILE ROUSSE", 'Code'=>"ILEROC"),
|
||||
2101 => array('Id'=>"66", 'Nom'=>"TC AUXONNE", 'Code'=>"AUXONC"),
|
||||
2102 => array('Id'=>"94", 'Nom'=>"TC BEAUNE", 'Code'=>"BEAUNC"),
|
||||
2103 => array('Id'=>"208", 'Nom'=>"TC CHATILLON SUR SEINE", 'Code'=>"CHATIC"),
|
||||
2104 => array('Id'=>"272", 'Nom'=>"TC DIJON", 'Code'=>"DIJONC"),
|
||||
2105 => array('Id'=>"533", 'Nom'=>"TC NUITS ST GEORGES", 'Code'=>"NUITSC"),
|
||||
2201 => array('Id'=>"541", 'Nom'=>"TC PAIMPOL", 'Code'=>"PAIMPC"),
|
||||
2202 => array('Id'=>"660", 'Nom'=>"TC SAINT BRIEUC", 'Code'=>"STBRIC"),
|
||||
2251 => array('Id'=>"275", 'Nom'=>"TGIcc DINAN", 'Code'=>"DINANG"),
|
||||
2252 => array('Id'=>"342", 'Nom'=>"TGIcc GUINGAMP", 'Code'=>"GUINGG"),
|
||||
2301 => array('Id'=>"1813", 'Nom'=>"TC GUERET", 'Code'=>"GUEREC"),
|
||||
2353 => array('Id'=>"340", 'Nom'=>"TGIcc GUERET", 'Code'=>"GUEREG"),
|
||||
2401 => array('Id'=>"105", 'Nom'=>"TC BERGERAC", 'Code'=>"BERGEC"),
|
||||
2402 => array('Id'=>"554", 'Nom'=>"TC PERIGUEUX", 'Code'=>"PERIGC"),
|
||||
2403 => array('Id'=>"628", 'Nom'=>"TC SARLAT", 'Code'=>"SARLAC"),
|
||||
2501 => array('Id'=>"111", 'Nom'=>"TC BESANCON", 'Code'=>"BESANC"),
|
||||
2552 => array('Id'=>"461", 'Nom'=>"TGIcc MONTBELIARD", 'Code'=>"MONTBG"),
|
||||
2601 => array('Id'=>"265", 'Nom'=>"TC DIE", 'Code'=>"DIEC"),
|
||||
2602 => array('Id'=>"614", 'Nom'=>"TC ROMANS", 'Code'=>"ROMANC"),
|
||||
2653 => array('Id'=>"752", 'Nom'=>"TGIcc VALENCE", 'Code'=>"VALENG"),
|
||||
2701 => array('Id'=>"108", 'Nom'=>"TC BERNAY", 'Code'=>"BERNAC"),
|
||||
2702 => array('Id'=>"300", 'Nom'=>"TC EVREUX", 'Code'=>"EVREUC"),
|
||||
2703 => array('Id'=>"410", 'Nom'=>"TC LOUVIERS", 'Code'=>"LOUVIC"),
|
||||
2704 => array('Id'=>"569", 'Nom'=>"TC PONT AUDEMER", 'Code'=>"PONTAC"),
|
||||
2801 => array('Id'=>"199", 'Nom'=>"TC CHARTRES", 'Code'=>"CHARTC"),
|
||||
2802 => array('Id'=>"286", 'Nom'=>"TC DREUX", 'Code'=>"DREUXC"),
|
||||
2901 => array('Id'=>"145", 'Nom'=>"TC BREST", 'Code'=>"BRESTC"),
|
||||
2902 => array('Id'=>"487", 'Nom'=>"TC MORLAIX", 'Code'=>"MORLAC"),
|
||||
2903 => array('Id'=>"583", 'Nom'=>"TC QUIMPER", 'Code'=>"QUIMPC"),
|
||||
3001 => array('Id'=>"22", 'Nom'=>"TC ALES", 'Code'=>"ALESC"),
|
||||
3003 => array('Id'=>"522", 'Nom'=>"TC NIMES", 'Code'=>"NIMESC"),
|
||||
3101 => array('Id'=>"679", 'Nom'=>"TC SAINT GAUDENS", 'Code'=>"STGAUC"),
|
||||
3102 => array('Id'=>"733", 'Nom'=>"TC TOULOUSE", 'Code'=>"TOULSC"),
|
||||
3201 => array('Id'=>"56", 'Nom'=>"TC AUCH", 'Code'=>"AUCHC"),
|
||||
3301 => array('Id'=>"121", 'Nom'=>"TC BLAYE", 'Code'=>"BLAYEC"),
|
||||
3302 => array('Id'=>"132", 'Nom'=>"TC BORDEAUX", 'Code'=>"BORDEC"),
|
||||
3303 => array('Id'=>"386", 'Nom'=>"TC LIBOURNE", 'Code'=>"LIBOUC"),
|
||||
3402 => array('Id'=>"116", 'Nom'=>"TC BEZIERS", 'Code'=>"BEZIEC"),
|
||||
3403 => array('Id'=>"235", 'Nom'=>"TC CLERMONT L'HERAULT", 'Code'=>"CLHERC"),
|
||||
3404 => array('Id'=>"401", 'Nom'=>"TC LODEVE", 'Code'=>"LODEVC"),
|
||||
3405 => array('Id'=>"477", 'Nom'=>"TC MONTPELLIER", 'Code'=>"MONTPC"),
|
||||
3406 => array('Id'=>"561", 'Nom'=>"TC PEZENAS", 'Code'=>"PEZENC"),
|
||||
3407 => array('Id'=>"649", 'Nom'=>"TC SETE", 'Code'=>"SETEC"),
|
||||
3501 => array('Id'=>"591", 'Nom'=>"TC RENNES", 'Code'=>"RENNEC"),
|
||||
3502 => array('Id'=>"691", 'Nom'=>"TC SAINT MALO", 'Code'=>"STMALC"),
|
||||
3601 => array('Id'=>"205", 'Nom'=>"TC CHATEAUROUX", 'Code'=>"CHATEC"),
|
||||
3602 => array('Id'=>"353", 'Nom'=>"TC ISSOUDUN", 'Code'=>"ISSOUC"),
|
||||
3701 => array('Id'=>"739", 'Nom'=>"TC TOURS", 'Code'=>"TOURSC"),
|
||||
3801 => array('Id'=>"336", 'Nom'=>"TC GRENOBLE", 'Code'=>"GRENOC"),
|
||||
3802 => array('Id'=>"770", 'Nom'=>"TC VIENNE", 'Code'=>"VIENNC"),
|
||||
3851 => array('Id'=>"118", 'Nom'=>"TGIcc BOURGOIN JALLIEU", 'Code'=>"BGOING"),
|
||||
3901 => array('Id'=>"277", 'Nom'=>"TC DOLE", 'Code'=>"DOLEC"),
|
||||
3902 => array('Id'=>"403", 'Nom'=>"TC LONS LE SAUNIER", 'Code'=>"LONSC"),
|
||||
3903 => array('Id'=>"625", 'Nom'=>"TC SALINS LES BAINS", 'Code'=>"SALINC"),
|
||||
4001 => array('Id'=>"262", 'Nom'=>"TC DAX", 'Code'=>"DAXC"),
|
||||
4002 => array('Id'=>"470", 'Nom'=>"TC MONT DE MARSAN", 'Code'=>"MONTMC"),
|
||||
4101 => array('Id'=>"123", 'Nom'=>"TC BLOIS", 'Code'=>"BLOISC"),
|
||||
4102 => array('Id'=>"616", 'Nom'=>"TC ROMORANTIN", 'Code'=>"ROMORC"),
|
||||
4201 => array('Id'=>"599", 'Nom'=>"TC ROANNE", 'Code'=>"ROANNC"),
|
||||
4202 => array('Id'=>"674", 'Nom'=>"TC SAINT ETIENNE", 'Code'=>"STETIC"),
|
||||
4251 => array('Id'=>"480", 'Nom'=>"TGIcc MONTBRISON", 'Code'=>"MONTRG"),
|
||||
4301 => array('Id'=>"157", 'Nom'=>"TC BRIOUDE", 'Code'=>"BRIOUC"),
|
||||
4302 => array('Id'=>"377", 'Nom'=>"TC PUY EN VELAY", 'Code'=>"LEPUYC"),
|
||||
4401 => array('Id'=>"501", 'Nom'=>"TC NANTES", 'Code'=>"NANTEC"),
|
||||
4402 => array('Id'=>"695", 'Nom'=>"TC SAINT NAZAIRE", 'Code'=>"STNAZC"),
|
||||
4501 => array('Id'=>"482", 'Nom'=>"TC MONTARGIS", 'Code'=>"MONTSC"),
|
||||
4502 => array('Id'=>"539", 'Nom'=>"TC ORLEANS", 'Code'=>"ORLEAC"),
|
||||
4601 => array('Id'=>"165", 'Nom'=>"TC CAHORS", 'Code'=>"CAHORC"),
|
||||
4701 => array('Id'=>"5", 'Nom'=>"TC AGEN", 'Code'=>"AGENC"),
|
||||
4702 => array('Id'=>"432", 'Nom'=>"TC MARMANDE", 'Code'=>"MARMAC"),
|
||||
4703 => array('Id'=>"511", 'Nom'=>"TC NERAC", 'Code'=>"NERACC"),
|
||||
4704 => array('Id'=>"778", 'Nom'=>"TC VILLENEUVE SUR LOT", 'Code'=>"VILLNC"),
|
||||
4801 => array('Id'=>"447", 'Nom'=>"TC MENDE", 'Code'=>"MENDEC"),
|
||||
4853 => array('Id'=>"448", 'Nom'=>"TGIcc MENDE", 'Code'=>"MENDEG"),
|
||||
4901 => array('Id'=>"32", 'Nom'=>"TC ANGERS", 'Code'=>"ANGERC"),
|
||||
4902 => array('Id'=>"634", 'Nom'=>"TC SAUMUR", 'Code'=>"SAUMUC"),
|
||||
5001 => array('Id'=>"217", 'Nom'=>"TC CHERBOURG", 'Code'=>"CHERBC"),
|
||||
5002 => array('Id'=>"253", 'Nom'=>"TC COUTANCES", 'Code'=>"COUTAC"),
|
||||
5003 => array('Id'=>"330", 'Nom'=>"TC GRANVILLE", 'Code'=>"GRANVC"),
|
||||
5004 => array('Id'=>"689", 'Nom'=>"TC SAINT LO", 'Code'=>"STLOC"),
|
||||
5101 => array('Id'=>"221", 'Nom'=>"TC CHALONS EN CHAMPAGNE", 'Code'=>"CHLONC"),
|
||||
5102 => array('Id'=>"292", 'Nom'=>"TC EPERNAY", 'Code'=>"EPERNC"),
|
||||
5103 => array('Id'=>"588", 'Nom'=>"TC REIMS", 'Code'=>"REIMSC"),
|
||||
5201 => array('Id'=>"213", 'Nom'=>"TC CHAUMONT", 'Code'=>"CHAUMC"),
|
||||
5202 => array('Id'=>"363", 'Nom'=>"TC LANGRES", 'Code'=>"LANGRC"),
|
||||
5203 => array('Id'=>"671", 'Nom'=>"TC SAINT DIZIER", 'Code'=>"STDIZC"),
|
||||
5301 => array('Id'=>"371", 'Nom'=>"TC LAVAL", 'Code'=>"LAVALC"),
|
||||
5302 => array('Id'=>"439", 'Nom'=>"TC MAYENNE", 'Code'=>"MAYENC"),
|
||||
5401 => array('Id'=>"152", 'Nom'=>"TC BRIEY", 'Code'=>"BRIEYC"),
|
||||
5402 => array('Id'=>"498", 'Nom'=>"TC NANCY", 'Code'=>"NANCYC"),
|
||||
5501 => array('Id'=>"79", 'Nom'=>"TC BAR LE DUC", 'Code'=>"BARLDC"),
|
||||
5502 => array('Id'=>"758", 'Nom'=>"TC VERDUN", 'Code'=>"VERDUC"),
|
||||
5601 => array('Id'=>"406", 'Nom'=>"TC LORIENT", 'Code'=>"LORIEC"),
|
||||
5602 => array('Id'=>"754", 'Nom'=>"TC VANNES", 'Code'=>"VANNEC"),
|
||||
5751 => array('Id'=>"452", 'Nom'=>"TGIcc METZ", 'Code'=>"METZG"),
|
||||
5752 => array('Id'=>"630", 'Nom'=>"TGIcc SARREGUEMINES", 'Code'=>"SARREG"),
|
||||
5753 => array('Id'=>"724", 'Nom'=>"TGIcc THIONVILLE", 'Code'=>"THIONG"),
|
||||
5801 => array('Id'=>"230", 'Nom'=>"TC CLAMECY", 'Code'=>"CLAMEC"),
|
||||
5802 => array('Id'=>"515", 'Nom'=>"TC NEVERS", 'Code'=>"NEVERC"),
|
||||
5901 => array('Id'=>"171", 'Nom'=>"TC CAMBRAI", 'Code'=>"CAMBRC"),
|
||||
5902 => array('Id'=>"288", 'Nom'=>"TC DUNKERQUE", 'Code'=>"DUNKEC"),
|
||||
5903 => array('Id'=>"389", 'Nom'=>"TC LILLE", 'Code'=>"LILLEC"),
|
||||
5904 => array('Id'=>"617", 'Nom'=>"TC ROUBAIX TOURCOING", 'Code'=>"ROUBAC"),
|
||||
5905 => array('Id'=>"735", 'Nom'=>"TC ROUBAIX TOURCOING", 'Code'=>"TOURCC"),
|
||||
5906 => array('Id'=>"749", 'Nom'=>"TC VALENCIENNES", 'Code'=>"VALECC"),
|
||||
5910 => array('Id'=>"3340", 'Nom'=>"TC LILLE METROPOLE", 'Code'=>"LILLEM"),
|
||||
5951 => array('Id'=>"69", 'Nom'=>"TGIcc AVESNES SUR HELPE", 'Code'=>"AVESNG"),
|
||||
5952 => array('Id'=>"280", 'Nom'=>"TC DOUAI", 'Code'=>"DOUAIC"),
|
||||
5953 => array('Id'=>"347", 'Nom'=>"TGIcc HAZEBROUCK", 'Code'=>"HAZEBG"),
|
||||
6001 => array('Id'=>"96", 'Nom'=>"TC BEAUVAIS", 'Code'=>"BEAUVC"),
|
||||
6002 => array('Id'=>"243", 'Nom'=>"TC COMPIEGNE", 'Code'=>"COMPIC"),
|
||||
6003 => array('Id'=>"644", 'Nom'=>"TC SENLIS", 'Code'=>"SENLIC"),
|
||||
6101 => array('Id'=>"19", 'Nom'=>"TC ALENCON", 'Code'=>"ALENCC"),
|
||||
6102 => array('Id'=>"45", 'Nom'=>"TC ARGENTAN", 'Code'=>"ARGENC"),
|
||||
6103 => array('Id'=>"309", 'Nom'=>"TC FLERS", 'Code'=>"FLERSC"),
|
||||
6104 => array('Id'=>"360", 'Nom'=>"TC L'AIGLE", 'Code'=>"LAIGLC"),
|
||||
6105 => array('Id'=>"780", 'Nom'=>"TC VIMOUTIERS", 'Code'=>"VIMOUC"),
|
||||
6201 => array('Id'=>"51", 'Nom'=>"TC ARRAS", 'Code'=>"ARRASC"),
|
||||
6202 => array('Id'=>"137", 'Nom'=>"TC BOULOGNE SUR MER", 'Code'=>"BOULOC"),
|
||||
6203 => array('Id'=>"168", 'Nom'=>"TC CALAIS", 'Code'=>"CALAIC"),
|
||||
6204 => array('Id'=>"698", 'Nom'=>"TC SAINT OMER", 'Code'=>"STOMEC"),
|
||||
6251 => array('Id'=>"114", 'Nom'=>"TGIcc BETHUNE", 'Code'=>"BETHUG"),
|
||||
6301 => array('Id'=>"26", 'Nom'=>"TC AMBERT", 'Code'=>"AMBERC"),
|
||||
6302 => array('Id'=>"119", 'Nom'=>"TC BILLOM", 'Code'=>"BILLOC"),
|
||||
6303 => array('Id'=>"233", 'Nom'=>"TC CLERMONT FERRAND", 'Code'=>"CLFERC"),
|
||||
6304 => array('Id'=>"351", 'Nom'=>"TC ISSOIRE", 'Code'=>"ISSOIC"),
|
||||
6305 => array('Id'=>"596", 'Nom'=>"TC RIOM", 'Code'=>"RIOMC"),
|
||||
6306 => array('Id'=>"722", 'Nom'=>"TC THIERS", 'Code'=>"THIERC"),
|
||||
6401 => array('Id'=>"91", 'Nom'=>"TC BAYONNE", 'Code'=>"BAYONC"),
|
||||
6402 => array('Id'=>"536", 'Nom'=>"TC OLORON SAINTE MARIE", 'Code'=>"OLOROC"),
|
||||
6403 => array('Id'=>"551", 'Nom'=>"TC PAU", 'Code'=>"PAUC"),
|
||||
6501 => array('Id'=>"76", 'Nom'=>"TC BAGNERES DE BIGORRE", 'Code'=>"BAGNEC"),
|
||||
6502 => array('Id'=>"718", 'Nom'=>"TC TARBES", 'Code'=>"TARBEC"),
|
||||
6601 => array('Id'=>"559", 'Nom'=>"TC PERPIGNAN", 'Code'=>"PERPIC"),
|
||||
6751 => array('Id'=>"637", 'Nom'=>"TGIcc SAVERNE", 'Code'=>"SAVERG"),
|
||||
6752 => array('Id'=>"709", 'Nom'=>"TGIcc STRASBOURG", 'Code'=>"STRASG"),
|
||||
6851 => array('Id'=>"239", 'Nom'=>"TGIcc COLMAR", 'Code'=>"COLMAG"),
|
||||
6852 => array('Id'=>"494", 'Nom'=>"TGIcc MULHOUSE", 'Code'=>"MULHOG"),
|
||||
6901 => array('Id'=>"415", 'Nom'=>"TC LYON", 'Code'=>"LYONC"),
|
||||
6902 => array('Id'=>"775", 'Nom'=>"TC VILLEFRANCHE SUR SAONE", 'Code'=>"VILLFC"),
|
||||
6903 => array('Id'=>"779", 'Nom'=>"TC VILLEFRANCHE-TARARE", 'Code'=>"VILTAC"),
|
||||
7001 => array('Id'=>"334", 'Nom'=>"TC GRAY", 'Code'=>"GRAYC"),
|
||||
7051 => array('Id'=>"413", 'Nom'=>"TGIcc LURE", 'Code'=>"LUREG"),
|
||||
7052 => array('Id'=>"766", 'Nom'=>"TC VESOUL GRAY", 'Code'=>"VESOUC"),
|
||||
7101 => array('Id'=>"62", 'Nom'=>"TC AUTUN", 'Code'=>"AUTUNC"),
|
||||
7102 => array('Id'=>"191", 'Nom'=>"TC CHALON SUR SAONE", 'Code'=>"CHALOC"),
|
||||
7103 => array('Id'=>"197", 'Nom'=>"TC CHAROLLES", 'Code'=>"CHAROC"),
|
||||
7104 => array('Id'=>"258", 'Nom'=>"TC LE CREUSOT", 'Code'=>"CREUSC"),
|
||||
7105 => array('Id'=>"409", 'Nom'=>"TC LOUHANS", 'Code'=>"LOUHAC"),
|
||||
7106 => array('Id'=>"418", 'Nom'=>"TC MACON", 'Code'=>"MACONC"),
|
||||
7107 => array('Id'=>"737", 'Nom'=>"TC TOURNUS", 'Code'=>"TOURNC"),
|
||||
7201 => array('Id'=>"421", 'Nom'=>"TC MAMERS", 'Code'=>"MAMERC"),
|
||||
7202 => array('Id'=>"427", 'Nom'=>"TC LE MANS", 'Code'=>"MANSC"),
|
||||
7301 => array('Id'=>"194", 'Nom'=>"TC CHAMBERY", 'Code'=>"CHAMBC"),
|
||||
7351 => array('Id'=>"14", 'Nom'=>"TGIcc ALBERTVILLE", 'Code'=>"ALBERG"),
|
||||
7401 => array('Id'=>"1814", 'Nom'=>"TC ANNECY", 'Code'=>"ANNECC"),
|
||||
7402 => array('Id'=>"1815", 'Nom'=>"TC THONON LES BAINS", 'Code'=>"THONOC"),
|
||||
7451 => array('Id'=>"38", 'Nom'=>"TGIcc ANNECY", 'Code'=>"ANNECG"),
|
||||
7452 => array('Id'=>"129", 'Nom'=>"TGIcc BONNEVILLE", 'Code'=>"BONNEG"),
|
||||
7454 => array('Id'=>"727", 'Nom'=>"TGIcc THONON LES BAINS", 'Code'=>"THONOG"),
|
||||
7501 => array('Id'=>"547", 'Nom'=>"TC PARIS", 'Code'=>"PARISC"),
|
||||
7601 => array('Id'=>"267", 'Nom'=>"TC DIEPPE", 'Code'=>"DIEPPC"),
|
||||
7602 => array('Id'=>"290", 'Nom'=>"TC ELBEUF", 'Code'=>"ELBEUC"),
|
||||
7603 => array('Id'=>"298", 'Nom'=>"TC EULET", 'Code'=>"EULETC"),
|
||||
7604 => array('Id'=>"307", 'Nom'=>"TC FECAMP (de terre et de mer)", 'Code'=>"FECAMC"),
|
||||
7605 => array('Id'=>"329", 'Nom'=>"TC GOURNAY EN BRAY", 'Code'=>"GOURNC"),
|
||||
7606 => array('Id'=>"345", 'Nom'=>"TC LE HAVRE", 'Code'=>"HAVREC"),
|
||||
7607 => array('Id'=>"513", 'Nom'=>"TC NEUFCHATEL EN BRAY", 'Code'=>"NEUFCC"),
|
||||
7608 => array('Id'=>"619", 'Nom'=>"TC ROUEN", 'Code'=>"ROUENC"),
|
||||
7609 => array('Id'=>"712", 'Nom'=>"TC SAINT VALERY EN CAUX", 'Code'=>"STVACC"),
|
||||
7701 => array('Id'=>"441", 'Nom'=>"TC MEAUX", 'Code'=>"MEAUXC"),
|
||||
7702 => array('Id'=>"444", 'Nom'=>"TC MELUN", 'Code'=>"MELUNC"),
|
||||
7703 => array('Id'=>"463", 'Nom'=>"TC MONTEREAU", 'Code'=>"MONTEC"),
|
||||
7704 => array('Id'=>"581", 'Nom'=>"TC PROVINS", 'Code'=>"PROVIC"),
|
||||
7801 => array('Id'=>"304", 'Nom'=>"TC EVRY", 'Code'=>"EVRYC"),
|
||||
7802 => array('Id'=>"572", 'Nom'=>"TC PONTOISE", 'Code'=>"PONTOC"),
|
||||
7803 => array('Id'=>"761", 'Nom'=>"TC VERSAILLES", 'Code'=>"VERSAC"),
|
||||
7901 => array('Id'=>"525", 'Nom'=>"TC NIORT", 'Code'=>"NIORTC"),
|
||||
7951 => array('Id'=>"143", 'Nom'=>"TGIcc BRESSUIRE", 'Code'=>"BRESSG"),
|
||||
8001 => array('Id'=>"2", 'Nom'=>"TC ABBEVILLE", 'Code'=>"ABBEVC"),
|
||||
8002 => array('Id'=>"28", 'Nom'=>"TC AMIENS", 'Code'=>"AMIENC"),
|
||||
8003 => array('Id'=>"713", 'Nom'=>"TC SAINT VALERY S/ SOMME", 'Code'=>"STVASC"),
|
||||
8053 => array('Id'=>"557", 'Nom'=>"TGIcc PERONNE", 'Code'=>"PERONG"),
|
||||
8101 => array('Id'=>"16", 'Nom'=>"TC ALBI", 'Code'=>"ALBIC"),
|
||||
8102 => array('Id'=>"182", 'Nom'=>"TC CASTRES", 'Code'=>"CASTRC"),
|
||||
8201 => array('Id'=>"473", 'Nom'=>"TC MONTAUBAN", 'Code'=>"MONTNC"),
|
||||
8301 => array('Id'=>"155", 'Nom'=>"TC BRIGNOLES", 'Code'=>"BRIGNC"),
|
||||
8302 => array('Id'=>"283", 'Nom'=>"TC DRAGUIGNAN", 'Code'=>"DRAGUC"),
|
||||
8303 => array('Id'=>"323", 'Nom'=>"TC FREJUS", 'Code'=>"FREJUC"),
|
||||
8304 => array('Id'=>"711", 'Nom'=>"TC SAINT TROPEZ", 'Code'=>"STTROC"),
|
||||
8305 => array('Id'=>"730", 'Nom'=>"TC TOULON", 'Code'=>"TOULOC"),
|
||||
8401 => array('Id'=>"71", 'Nom'=>"TC AVIGNON", 'Code'=>"AVIGNC"),
|
||||
8452 => array('Id'=>"178", 'Nom'=>"TGIcc CARPENTRAS", 'Code'=>"CARPEG"),
|
||||
8501 => array('Id'=>"609", 'Nom'=>"TC LA ROCHE SUR YON", 'Code'=>"ROCHYC"),
|
||||
8601 => array('Id'=>"228", 'Nom'=>"TC CHATELLERAULT", 'Code'=>"CHTLTC"),
|
||||
8602 => array('Id'=>"567", 'Nom'=>"TC POITIERS", 'Code'=>"POITIC"),
|
||||
8701 => array('Id'=>"392", 'Nom'=>"TC LIMOGES", 'Code'=>"LIMOGC"),
|
||||
8801 => array('Id'=>"294", 'Nom'=>"TC EPINAL", 'Code'=>"EPINAC"),
|
||||
8802 => array('Id'=>"458", 'Nom'=>"TC MIRECOURT", 'Code'=>"MIRECC"),
|
||||
8803 => array('Id'=>"668", 'Nom'=>"TC SAINT DIE", 'Code'=>"STDIEC"),
|
||||
8901 => array('Id'=>"64", 'Nom'=>"TC AUXERRE", 'Code'=>"AUXERC"),
|
||||
8902 => array('Id'=>"355", 'Nom'=>"TC JOIGNY", 'Code'=>"JOIGNC"),
|
||||
8903 => array('Id'=>"647", 'Nom'=>"TC SENS", 'Code'=>"SENSC"),
|
||||
9001 => array('Id'=>"99", 'Nom'=>"TC BELFORT", 'Code'=>"BELFOC"),
|
||||
9101 => array('Id'=>"248", 'Nom'=>"TC CORBEIL ESSONNES", 'Code'=>"CORBEC"),
|
||||
9201 => array('Id'=>"504", 'Nom'=>"TC NANTERRE", 'Code'=>"NANTRC"),
|
||||
9301 => array('Id'=>"126", 'Nom'=>"TC BOBIGNY", 'Code'=>"BOBIGC"),
|
||||
9401 => array('Id'=>"256", 'Nom'=>"TC CRETEIL", 'Code'=>"CRETEC"),
|
||||
9711 => array('Id'=>"84", 'Nom'=>"TMX BASSE-TERRE", 'Code'=>"BASSEM"),
|
||||
9712 => array('Id'=>"565", 'Nom'=>"TMX POINTE-A-PITRE", 'Code'=>"POINTM"),
|
||||
9721 => array('Id'=>"321", 'Nom'=>"TMX FORT DE FRANCE", 'Code'=>"FORTFM"),
|
||||
9731 => array('Id'=>"187", 'Nom'=>"TMX CAYENNE", 'Code'=>"CAYENM"),
|
||||
9741 => array('Id'=>"666", 'Nom'=>"TMX SAINT DENIS DE LA REUNION", 'Code'=>"STDENM"),
|
||||
9742 => array('Id'=>"1816", 'Nom'=>"TMX SAINT PIERRE DE LA REUNION", 'Code'=>"STPIEM"),
|
||||
);
|
@ -1,300 +0,0 @@
|
||||
<?php
|
||||
ini_set('soap.wsdl_cache_enabled', 0);
|
||||
ini_set('default_socket_timeout', 30);
|
||||
|
||||
class MAmabis
|
||||
{
|
||||
protected $client;
|
||||
protected $iDb;
|
||||
|
||||
public function __construct($db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
|
||||
$this->client = new SoapClient(null, array(
|
||||
'location' => 'http://sw2.amabis.com:5100/',
|
||||
'uri' => 'http://www.amabis.com/ns.xsd',
|
||||
'connection_timeout' => 2,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'trace' => 1,
|
||||
'style' => SOAP_RPC,
|
||||
'use' => SOAP_ENCODED,
|
||||
));
|
||||
}
|
||||
|
||||
public function getZonage($adrNum, $adrIndRep, $adrTypeVoie, $adrLibVoie, $cp, $ville='', $codeRivoli='', $rnvp=false, $raisonSociale='TEST', $debug=false)
|
||||
{
|
||||
$tabRep=array();
|
||||
if (!$rnvp) {
|
||||
if ($cp<10000) $cp='0'.$cp;
|
||||
$dep2=substr($cp,0,2)*1;
|
||||
$dep3=substr($cp,0,3)*1;
|
||||
switch ($dep2) {
|
||||
case 0:
|
||||
/*case 5:
|
||||
case 9:
|
||||
case 15:
|
||||
case 19:
|
||||
case 23:
|
||||
case 32:
|
||||
case 46:
|
||||
case 48:
|
||||
case 82:*/
|
||||
case 97: // DOM
|
||||
case 98: // TOM
|
||||
case 99: // Etranger
|
||||
return $tabRep;
|
||||
break;
|
||||
default:
|
||||
//if ($dep3==975) return $tabRep;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$adresse=addslashes(trim(preg_replace('/ +/',' ', "$adrNum $adrIndRep $adrTypeVoie $adrLibVoie")));
|
||||
$ville=addslashes($ville);
|
||||
$majForcee=false;
|
||||
|
||||
$ret = $this->iDb->select('jo.zonage', 'zus, zru, zfu, cucs, rnvpStatut, rnvpCorr, rnvpTrt, adr3, adr4, adr5, adr6, adr7, numVoieA, indRepA,
|
||||
typeVoieAlong, typeVoieAcourt, corpVoie, motDir, motDirD, libVoieSec, adr4n32, adr4n38, clePostaleVoie,
|
||||
secteur, cleRoutage, cpx, cleAd, codPaysIso2, codPaysIso3, libPays, codeInsee',
|
||||
"address='$adresse' AND adr_cp='$cp' AND adr_ville='$ville'",false, MYSQL_ASSOC);
|
||||
$zones=@$ret[0];
|
||||
if (count($ret)>0) {
|
||||
|
||||
if ($zones['rnvpStatut']===null && $rnvp) $majForcee=true;
|
||||
$tabRep['ZUS']=$tabRep['ZFU']=$tabRep['ZRU']=$tabRep['CUCS']='NON';
|
||||
//$tabRep['NZUS']=$tabRep['NZFU']=$tabRep['NZRU']=$tabRep['NCUCS']='';
|
||||
|
||||
if (trim($zones['zus'])<>'') {
|
||||
if (trim($zones['zus'])=='NSP') $tabRep['ZUS']='NSP';
|
||||
else $tabRep['ZUS']='OUI';
|
||||
$tabRep['NZUS']=$zones['zus'];
|
||||
}
|
||||
if (trim($zones['zru'])<>'') {
|
||||
if (trim($zones['zru'])=='NSP') $tabRep['ZRU']='NSP';
|
||||
else $tabRep['ZRU']='OUI';
|
||||
$tabRep['NZRU']=$zones['zru'];
|
||||
}
|
||||
if (trim($zones['zfu'])<>'') {
|
||||
if (trim($zones['zfu'])=='NSP') $tabRep['ZFU']='NSP';
|
||||
else $tabRep['ZFU']='OUI';
|
||||
$tabRep['NZFU']=$zones['zfu'];
|
||||
}
|
||||
if (trim($zones['cucs'])<>'') {
|
||||
if (trim($zones['cucs'])=='NSP') $tabRep['CUCS']='NSP';
|
||||
else $tabRep['CUCS']='OUI';
|
||||
$tabRep['NCUCS']=$zones['cucs'];
|
||||
}
|
||||
|
||||
/** Autres Informations de la RNVP **/
|
||||
if ($rnvp) {
|
||||
//$tabRep['ADR1']=@trim($tabZones['ADR1']);
|
||||
//$tabRep['ADR2']=@trim($tabZones['ADR2']);
|
||||
if (strtoupper(@trim($zones['adr7']))=='FRANCE') $zones['adr7']='';
|
||||
$tabRep['ADR3']=@trim($zones['adr3']);
|
||||
$tabRep['ADR4']=@trim($zones['adr4']);
|
||||
$tabRep['ADR5']=@trim($zones['adr5']);
|
||||
$tabRep['ADR6']=@trim($zones['adr6']);
|
||||
$tabRep['ADR7']=trim($zones['adr7']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (count($ret)==0 || $majForcee) {
|
||||
|
||||
try {
|
||||
if (trim($raisonSociale)=='') $raisonSociale='TEST'; // Le RNVP ne fonctionne pas sans la Raison Sociale qui est la 1ère ligne d'adresse
|
||||
$rep=$this->client->zonage( new SoapParam(strtr("$raisonSociale:$adresse:$cp:$ville",
|
||||
'¿°ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ??',
|
||||
' aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr'),'adresse'),
|
||||
new SoapParam(':','separateur'),
|
||||
new SoapParam('type=M','options')
|
||||
);
|
||||
/*$rep=$this->client->zonage( "<adresse></adresse>".
|
||||
"<separateur>:</separateur>".
|
||||
"<options>type=M</options>");*/
|
||||
|
||||
/** Découpage des ZFU, CUCS etcs...
|
||||
**/
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s').' - '.implode("\n", $rep)."\n============================================================================\n");
|
||||
fclose($fp);
|
||||
|
||||
$tabZones=explode(',',$rep['zonage']); // ZUS=OUI,NZUS=1127020,ZFU=OUI,NZFU=11270ZF,CUCS=OUI,NCUCS=1127020
|
||||
foreach ($tabZones as $zone) {
|
||||
$tabTmp=explode('=',$zone);
|
||||
if (trim($tabTmp[0])<>'')
|
||||
$tabRep[$tabTmp[0]]=$tabTmp[1];
|
||||
}
|
||||
if (@$tabRep['ZUS']=='NSP') $tabRep['NZUS']='NSP';
|
||||
if (@$tabRep['ZRU']=='NSP') $tabRep['NZRU']='NSP';
|
||||
if (@$tabRep['ZFU']=='NSP') $tabRep['NZFU']='NSP';
|
||||
if (@$tabRep['CUCS']=='NSP') $tabRep['NCUCS']='NSP';
|
||||
$adresse=stripslashes(trim(preg_replace('/ +/',' ', "$adrNum $adrIndRep $adrTypeVoie $adrLibVoie")));
|
||||
$ville=stripslashes($ville);
|
||||
$tabRepTmp=array();
|
||||
$tabTmp=explode('=',utf8_decode($rep['objdesc']));
|
||||
//print_r($tabTmp);
|
||||
//die();
|
||||
$tabZones=array();
|
||||
foreach ($tabTmp as $iZone=>$zone) {
|
||||
$pos=strrpos($zone,',');
|
||||
if ($iZone==0) {
|
||||
$nomZoneSuiv=$zone;
|
||||
continue;
|
||||
}
|
||||
$tabZones[$nomZoneSuiv]=substr($zone,0,$pos);
|
||||
$nomZoneSuiv=substr($zone,$pos+1);
|
||||
}
|
||||
if (strtoupper(@trim($tabZones['ADR7']))=='FRANCE') $tabZones['ADR7']='';
|
||||
$tabTmp=explode('|', $tabZones['VOIEA']);
|
||||
$typeVoieAcourt=@trim($tabTmp[1]);
|
||||
$tabInsert=array(
|
||||
'address'=>$adresse,
|
||||
'adr_cp'=>$cp,
|
||||
'adr_ville'=>$ville,
|
||||
'zus'=>@$tabRep['NZUS'],
|
||||
'zru'=>@$tabRep['NZRU'],
|
||||
'zfu'=>@$tabRep['NZFU'],
|
||||
'cucs'=>@$tabRep['NCUCS'],
|
||||
);
|
||||
$tabUpdate=array(
|
||||
'adrNum'=>$adrNum,
|
||||
'adrIndRep'=>$adrIndRep,
|
||||
'adrTypeVoie'=>$adrTypeVoie,
|
||||
'adrLibVoie'=>$adrLibVoie,
|
||||
'rivoli'=>$codeRivoli,
|
||||
// Ajouté le 16/12/2013
|
||||
'rnvpStatut' => substr($tabZones['STATUTC'],0,2),
|
||||
'rnvpCorr' => substr($tabZones['STATUTC'],2,1),
|
||||
'rnvpTrt' => trim(substr($tabZones['STATUTC'],3,2)),
|
||||
'adr3' => @trim($tabZones['ADR3']),
|
||||
'adr4' => @trim($tabZones['ADR4']),
|
||||
'adr5' => @trim($tabZones['ADR5']),
|
||||
'adr6' => @trim($tabZones['ADR6']),
|
||||
'adr7' => trim($tabZones['ADR7']),
|
||||
'numVoieA' => @trim($tabZones['NUM1']),
|
||||
'indRepA' => @trim($tabZones['BTQC1']),
|
||||
'typeVoieAlong' => @trim($tabZones['TYPVOIEL']),
|
||||
'typeVoieAcourt' => $typeVoieAcourt,
|
||||
'corpVoie' => @trim($tabZones['CORPSVOIE']),
|
||||
'motDir' => @trim($tabZones['MOTDIR']),
|
||||
'motDirD' => @trim($tabZones['MOTDIRD']),
|
||||
'libVoieSec' => @trim($tabZones['VOIREFLIBS']),
|
||||
'adr4n32' => @trim($tabZones['VOIREFLIBPOS']),
|
||||
'adr4n38' => @trim($tabZones['VOIREFLIBPOS2']),
|
||||
'clePostaleVoie' => @trim($tabZones['VOIREFCLEPOST']),
|
||||
'secteur' => @trim($tabZones['SECTEUR']),
|
||||
'cleRoutage' => @trim($tabZones['CLER']),
|
||||
'cpx' => @trim($tabZones['CPX']),
|
||||
'cleAd' => @trim($tabZones['CLEAD']),
|
||||
'codPaysIso2' => @trim($tabZones['NATREFISO2']),
|
||||
'codPaysIso3' => @trim($tabZones['NATREFISO3']),
|
||||
'libPays' => @trim($tabZones['NATREFLIB']),
|
||||
'codeInsee' => @trim($tabZones['LOCREFCLEO']),
|
||||
'source' => 'Amabis',
|
||||
);
|
||||
$dateInsert=0;
|
||||
if ($majForcee) {
|
||||
$adresseL=addslashes($adresse);
|
||||
$villeL=addslashes($ville);
|
||||
|
||||
$ret = $this->iDb->select('jo.zonage', 'dateInsert*1 as dateInsert', "address='$adresseL' AND adr_cp='$cp' AND adr_ville='$villeL'", false);
|
||||
$dateInsert=@$ret[0]['dateInsert']*1;
|
||||
$this->iDb->update('jo.zonage', array_merge($tabUpdate,array('dateInsert'=>$dateInsert)), "address='$adresseL' AND adr_cp='$cp' AND adr_ville='$villeL'", false);
|
||||
//echo "Mise à jour de l'adresse du $dateInsert pour address='$adresseL' AND adr_cp='$cp' AND adr_ville='$villeL'".EOL;
|
||||
}
|
||||
|
||||
if ($dateInsert==0) {
|
||||
$this->iDb->insert('jo.zonage', array_merge($tabInsert,$tabUpdate), false);
|
||||
//echo "Insertion de l'adresse (".$zones['rnvpStatut'].")!".EOL;
|
||||
}
|
||||
|
||||
$tabTmp[0]=explode(',', $tabZones['LOCREFCLEP']);
|
||||
$tabTmp[1]=explode(',', $tabZones['LOCREFCP']);
|
||||
$tabTmp[2]=explode(',', $tabZones['LOCREFTYPP']);
|
||||
$tabTmp[3]=explode(',', $tabZones['LOCREFLIBD']);
|
||||
$tabTmp[4]=explode(',', $tabZones['LOCREFLIBD2']);
|
||||
foreach($tabTmp[0] as $iCleP=>$cleP) {
|
||||
$tabInsert=array(
|
||||
'codeInsee' => @trim($tabZones['LOCREFCLEO']),
|
||||
'villeLib' => @trim($tabZones['LOCREFLIBP']),
|
||||
'villePopu' => @trim($tabZones['LOCREFPOP']),
|
||||
'cleAchPost'=> $cleP,
|
||||
'codePostal'=> $tabTmp[1][$iCleP],
|
||||
'typePostal'=> $tabTmp[2][$iCleP],
|
||||
'libAchP32' => @preg_replace('/^\//','',$tabTmp[3][$iCleP]),
|
||||
'libAchP38' => @preg_replace('/^\//','',$tabTmp[4][$iCleP]),
|
||||
'source' => 'Amabis',
|
||||
'dateInsert'=> date('YmdHis'),
|
||||
);
|
||||
$this->iDb->insert('jo.villesCP', $tabInsert, false);
|
||||
//echo mysql_error().EOL;
|
||||
}
|
||||
|
||||
/** Autres Informations de la RNVP
|
||||
**/
|
||||
if ($rnvp) {
|
||||
//$tabRep['ADR1']=@trim($tabZones['ADR1']);
|
||||
//$tabRep['ADR2']=@trim($tabZones['ADR2']);
|
||||
$tabRep['ADR3']=@trim($tabZones['ADR3']);
|
||||
$tabRep['ADR4']=@trim($tabZones['ADR4']);
|
||||
$tabRep['ADR5']=@trim($tabZones['ADR5']);
|
||||
$tabRep['ADR6']=@trim($tabZones['ADR6']);
|
||||
$tabRep['ADR7']=trim($tabZones['ADR7']);
|
||||
}
|
||||
} catch (SoapFault $fault) {
|
||||
//echo 'ERREUR SOAP :'.EOL;
|
||||
//print_r($fault);
|
||||
//echo $this->client->__getLastRequest()."\n";
|
||||
//echo $this->client->__getLastResponse()."\n";
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s').' - ERREUR SOAP : Requete = '.$this->client->__getLastRequest()."\n Reponse = ".$this->client->__getLastResponse()."\n============================================================================\n");
|
||||
fclose($fp);
|
||||
}
|
||||
//return $tabRep;
|
||||
}
|
||||
|
||||
/** Zonages AFR et ZRR
|
||||
**/
|
||||
$codeInsee=substr($codeRivoli,0,5);
|
||||
$ret = $this->iDb->select('jo.zonageInsee', 'typeZone, arreteDate, decretDate, decretNum, decretModifieDate, decretModifieNum, dateDebut, dateFin', "codeInsee='$codeInsee'",false, MYSQL_ASSOC);
|
||||
$tabRep['ZRR']=$tabRep['AFR']='NON';
|
||||
foreach ($ret as $zones)
|
||||
switch ($zones['typeZone']) {
|
||||
case 'ZRR': $tabRep['ZRR']='OUI'; $tabRep['NZRR']=$codeInsee; break;
|
||||
case 'ZAFR': $tabRep['AFR']='OUI'; $tabRep['NAFR']=$codeInsee; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return $tabRep;
|
||||
}
|
||||
|
||||
function searchByTelFax($tel) {
|
||||
return $this->getTelFax('','','','',$tel);
|
||||
}
|
||||
|
||||
function getTelFax($nom, $cp, $ville='', $prenom='', $tel='') {
|
||||
if (trim($tel)<>'')
|
||||
$query="<telep>$tel</telep><scoremini>10</scoremini><distinction>30</distinction>";
|
||||
elseif (trim($prenom)=='')
|
||||
$query="<rs>$nom</rs><cpville>$cp $ville</cpville><scoremini>90</scoremini><distinction>30</distinction>";
|
||||
else
|
||||
$query="<nom>$nom</nom><prenom>$prenom</prenom><cpville>$cp $ville</cpville><scoremini>90</scoremini><distinction>30</distinction>";
|
||||
|
||||
$rep=$this->client->rechtel($query);
|
||||
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s')." - $query - ".implode("\n", $rep)."\n============================================================================\n");
|
||||
fwrite($fp, "Requête : ".$this->client->__getLastRequest()."\n");
|
||||
fwrite($fp, "Réponse : ".$this->client->__getLastResponse()."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,308 +0,0 @@
|
||||
<?php
|
||||
define ('ARTISANAT_DISPO_WEB', 1);
|
||||
include_once(FWK_PATH.'common/curl.php');
|
||||
|
||||
class MArtisanat {
|
||||
|
||||
public $body = '';
|
||||
public $header = '';
|
||||
public $codeRetour = 0;
|
||||
public $referer='';
|
||||
public $libErreur='';
|
||||
public $cookie='';
|
||||
public $iDb;
|
||||
public $enCache=false;
|
||||
|
||||
function __construct() {
|
||||
$this->iDb=new WDB();
|
||||
}
|
||||
|
||||
function getIdentite($siren, $refresh=false) {
|
||||
$siren=$siren*1;
|
||||
$res=$this->iDb->select('jo.artisanat', 'id, siren, actif, numRM, denomination, sigle, nomCommercial, enseigne, fj, effectif, aprm, debutActivite, activite, adresse, cp, ville, cessation, radiation, nbInscriptions, nom, prenom, nomUsage, dateNaiss, lieuNaiss, natio, qualite, qualif, dateQualif, dateFctDeb, dateFctFin, IF(dateInsert>dateUpdate,dateInsert,dateUpdate) AS dateUpdate', "siren=$siren", false, MYSQL_ASSOC);
|
||||
if (count($res)>0 && !$refresh) {
|
||||
$this->enCache=true;
|
||||
$tabInsert=$res[0];
|
||||
} elseif (ARTISANAT_DISPO_WEB) {
|
||||
$this->enCache=false;
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=recherche';
|
||||
$page=getUrl($url, '', '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200a !';
|
||||
return false;
|
||||
}
|
||||
$this->cookie=$page['header']['Set-Cookie'];
|
||||
$this->referer=$url;
|
||||
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData=array( 'siren_op'=>'%3D',
|
||||
'siren'=>$siren,
|
||||
'den_rent_op'=>'%25',
|
||||
'den_rent'=>'',
|
||||
'adresse_op'=>'contient',
|
||||
'adresse'=>'',
|
||||
'bde_rent_op'=>'%25',
|
||||
'bde_rent'=>'',
|
||||
'nom_rdir_op'=>'%25',
|
||||
'nom_rdir'=>'',
|
||||
'pren_rdir_op'=>'%25',
|
||||
'pren_rdir'=>'',
|
||||
'table'=>'rentreprise',//'rentrad',
|
||||
'x'=>56,
|
||||
'y'=>14,
|
||||
);
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200b !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
|
||||
if (preg_match('/<span.class="rouge">aucune.entreprise.ne.correspond(?:.*)vos.crit(?:.*)de.recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$url='http://www.cma-paris.fr/CMP/rm_recherche.php?dom=Gerer&fonction=cherche';
|
||||
$postData=array( 'siren_op'=>'%3D',
|
||||
'siren'=>$siren,
|
||||
'den_rent_op'=>'%25',
|
||||
'den_rent'=>'',
|
||||
'adresse_op'=>'contient',
|
||||
'adresse'=>'',
|
||||
'bde_rent_op'=>'%25',
|
||||
'bde_rent'=>'',
|
||||
'nom_rdir_op'=>'%25',
|
||||
'nom_rdir'=>'',
|
||||
'pren_rdir_op'=>'%25',
|
||||
'pren_rdir'=>'',
|
||||
'table'=>'rentrad',
|
||||
'x'=>56,
|
||||
'y'=>14,
|
||||
);
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200c !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
}
|
||||
|
||||
/** Gestion des multi-inscriptions au RM **/
|
||||
if (preg_match('/<b class="gris">(.*)entreprises.correspondent(?:.*)vos.crit(?:.*)de.recherche<\/span>/Uis', $this->body, $matches))
|
||||
{
|
||||
$nbRep=trim($matches[1])*1;
|
||||
$iRadMax=-1;
|
||||
if (preg_match_all('/<a class="turquoise" href="(rm\.php\?dom=Gerer&fonction=dossier&(.*))">/Uis', $this->body, $matches)) {
|
||||
$tabUrls=array_unique($matches[1]);
|
||||
$anRadMax=0;
|
||||
// Recherche de la dernière inscription
|
||||
foreach ($tabUrls as $iUrl=>$url) {
|
||||
// On prend la dernière inscription
|
||||
$tabTmp=explode('&',$url);
|
||||
if (substr($tabTmp[3],0,8)=='an_rera=') {
|
||||
$anRad=substr($tabTmp[3],8);
|
||||
if ($anRad>$anRadMax) {
|
||||
$anRadMax=$anRad;
|
||||
$iRadMax=$iUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($iRadMax==-1) die('$iRadMax==-1 Cas impossible !'.EOL.print_r($tabUrls,true).EOL.print_r($matches,true));
|
||||
// Accès à la dernière fiche
|
||||
$url='http://www.cma-paris.fr/CMP/'.strtr(trim($tabUrls[$iRadMax]),array('&'=>'&'));
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200c !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
}
|
||||
|
||||
$tabInsert=array();
|
||||
|
||||
if (preg_match('/n° d\'identification \(SIREN\)<\/span><\/td>(?:.*)<td align="left" nowrap>(.*) <\/td>((?:.*)n° de gestion rm<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>)?/Uis', $this->body, $matches)) {
|
||||
$sirenLu=$matches[1]*1;
|
||||
if ($siren==$sirenLu) {
|
||||
$tabInsert['siren']=$matches[1];
|
||||
$tabInsert['numRM']=@$matches[2];
|
||||
} else {
|
||||
$this->libErreur='Erreur Siren $sirenLu<>$siren !';
|
||||
return false;
|
||||
}
|
||||
} elseif (preg_match('/<span class="rouge">aucune entreprise ne correspond à vos critères de recherche<\/span>/Uis', $this->body, $matches)) {
|
||||
$this->libErreur='Erreur Artisan absent de la base Artisanat !';
|
||||
// die($this->body);
|
||||
return false;
|
||||
} else {
|
||||
$this->libErreur='Erreur Siren absent dans la page !';
|
||||
return false;
|
||||
}
|
||||
|
||||
$actif=null;
|
||||
if (preg_match("/Renseignements.relatif(?:.*)entreprise(.*)<\/b>/Uis", $this->body, $matches)) {
|
||||
switch (trim(strtr($matches[1],array(chr(160)=>'')))) {
|
||||
case 'en activité': $actif=1; break;
|
||||
case 'radiée': $actif=0; break;
|
||||
default: print_r($matches);die(); break;
|
||||
}
|
||||
//die(EOL.'$actif='.$actif.EOL.print_r($matches));
|
||||
}
|
||||
$tabInsert['actif']=$actif;
|
||||
if ($actif===null) {
|
||||
//die("siren=$siren".EOL."sirenLu=$sirenLu".EOL.$this->body);
|
||||
$this->libErreur='Erreur Actif/Radié non trouvé !';
|
||||
return false;
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">dénomination<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches)) {
|
||||
$tabInsert['denomination']=$matches[1];
|
||||
}
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">dénomination<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['denomination']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">sigle<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['sigle']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> nom commercial<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['nomCommercial']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">enseigne<\/span><\/td>(?:.*)<td align="left" colspan="4">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['enseigne']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">forme juridique<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['fj']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">effectif<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['effectif']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code APRM<\/span><\/td>(?:.*)<td align="left">(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['aprm']=$matches[1];
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">début d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['debutActivite']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> activité\(s\) exercée\(s\) donnant lieu à immatriculation<\/span>(?:.*)<td colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['activite']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">adresse de l\'entreprise<\/span><\/td>(?:.*)<td align="left" colspan="5">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['adresse']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">code postal<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['cp']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">ville<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['ville']=trim($matches[1]);
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">cessation d\'activité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['cessation']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">radiation du RM<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['radiation']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
$tabEtabs=array();
|
||||
if (preg_match('/<!--deb Etablissements secondaires-->(?:.*)<b class="gris">Aucune inscription complémentaire<\/b>(?:.*)<!--fin Etablissements secondaires-->/Uis', $this->body, $matches))
|
||||
$tabInsert['nbInscriptions']=0;
|
||||
elseif (preg_match('/<!--deb Etablissements secondaires-->(?:.*)<b class="gris">Inscription complémentaire<\/b>(.*)<!--fin Etablissements secondaires-->/Uis', $this->body, $matches)) {
|
||||
$tabInsert['nbInscriptions']=0;
|
||||
if (preg_match_all('/<tr>(?:.*)<td><img alt="" src="inter\/pixtrans\.gif" width="30" height="1"><\/td>(?:.*)<td nowrap>(?:.*)<!-- adresse -->(.*)<\/td>(?:.*)<td nowrap>(?:.*)<!-- code postal et ville -->(.*)<\/td>(?:.*)<td nowrap>(?:.*)<!-- enseigne -->(.*)<\/td>(?:.*)<td>(?:.*)<!-- debut activite -->(.*)<\/td>(?:.*)<td>(?:.*)<!-- fin activite -->(.*)<\/td>(?:.*)<\/tr>/Uis', $matches[1], $matches2)) {
|
||||
foreach ($matches2[1] as $i=>$adresse) {
|
||||
$tabEtabs[$i]['siren'] =$siren;
|
||||
$tabEtabs[$i]['num'] =$i;
|
||||
$tabEtabs[$i]['adresse'] =trim(strtr(html_entity_decode($adresse),chr(160),' '));
|
||||
$tabEtabs[$i]['cpVille'] =trim(strtr(html_entity_decode($matches2[2][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['enseigne']=trim(strtr(html_entity_decode($matches2[3][$i]),chr(160),' '));
|
||||
$tabEtabs[$i]['actDeb'] =WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[4][$i]),chr(160),' ')));
|
||||
$tabEtabs[$i]['actFin'] =WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches2[5][$i]),chr(160),' ')));
|
||||
$tabInsert['nbInscriptions']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Informations sur la Personne Physique **/
|
||||
if (preg_match('/<a class="turquoise" href="(rm\.php\?dom=Gerer&fonction=dirigeant&dept_re(.*))" onclick="window\.open\(this\.href/Uis', $this->body, $matches)) {
|
||||
$urlDir='http://www.cma-paris.fr/CMP/'.strtr(trim($matches[1]),array('&'=>'&'));
|
||||
//die($urlDir);
|
||||
randsleep(1,2);
|
||||
$page=getUrl($urlDir, $this->cookie, '', $this->referer, false, 'www.cma-paris.fr', false, '', '', 21);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Artisanat 200d !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['nom']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prénom<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['prenom']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nom d\'usage<\/span><\/td>(?:.*)<td align="left" nowrap>(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['nomUsage']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"(?:.*)<span class="turquoise"> date de naissance<\/span><\/td>(?:.*)-->(?:.*)<td(?: +)align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['dateNaiss']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
// if (preg_match('/date de naissance(.*)<td background="inter\/pix3_turquoise\.gif" align="right"/Uis', $this->body, $matches))
|
||||
// die(print_r($matches));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise"> lieu de naissance<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['lieuNaiss']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">nationalité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['natio']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">qualité<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['qualite']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right" nowrap><span class="turquoise">qualification artisanale<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['qualif']=trim(strtr(html_entity_decode($matches[1]),chr(160),' '));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">date d\'obtention<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['datequalif']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">prise de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['dateFctDeb']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
if (preg_match('/<td background="inter\/pix3_turquoise\.gif" align="right"><span class="turquoise">fin de fonction<\/span><\/td>(?:.*)<td align="left">(.*)<\/td>/Uis', $this->body, $matches))
|
||||
$tabInsert['dateFctFin']=WDate::dateT('d/m/Y', 'Y-m-d', trim(strtr(html_entity_decode($matches[1]),chr(160),' ')));
|
||||
|
||||
}
|
||||
|
||||
// Insertion en base de données
|
||||
$tabInsert['dateInsert']=date('Y-m-d H:i:s');
|
||||
$id=$this->iDb->insert('jo.artisanat', $tabInsert, true);
|
||||
$tabInsert['id']=$id;
|
||||
foreach ($tabEtabs as $tabInsert2) {
|
||||
$tabInsert2['dateInsert']=$tabInsert['dateInsert'];
|
||||
$id2=$this->iDb->insert('jo.artisanat_etab', $tabInsert2, true);
|
||||
}
|
||||
|
||||
$tabInsert['dateUpdate']=substr($tabInsert['dateInsert'],0,10);
|
||||
unset($tabInsert['dateInsert']);
|
||||
|
||||
/*
|
||||
$tabRet=array( 'id' => $id,// A calculer après insert
|
||||
'Pertinence' => 100,
|
||||
'Siret' => $siren.'00000',
|
||||
'Siege' => $siege,
|
||||
'Nom' => $nom,
|
||||
'Nom2' => $nomCom,
|
||||
'Sigle' => '',//prepareString($etab['Sigle']),
|
||||
'Enseigne' => $ens,
|
||||
'Adresse' => $adr,
|
||||
'Adresse2' => $adr2,//prepareString($etab['Adresse2']),
|
||||
'CP' => $cp,
|
||||
'Ville' => $ville,
|
||||
'Tel' => '',//$etab['Tel'],
|
||||
'Fax' => '',//$etab['Fax'],
|
||||
'FJ' => $cj,
|
||||
'FJLib' => $cjLib,
|
||||
'Siren' => $siren,
|
||||
'Nic' => '00000',
|
||||
'Actif' => 0,
|
||||
'NafEtab' => $naf,
|
||||
'NafEtabLib' => $nafLib,
|
||||
'NafEnt' => $naf,
|
||||
'NafEntLib' => $nafLib,
|
||||
'NumRC' => $numRC,
|
||||
'NumRC2' => $numRC2,
|
||||
'NumGreffe' => $greffe_num,
|
||||
'DateCreation' => $dateCre,
|
||||
'DateRadiation' => $dateRad,
|
||||
'DateCloture' => $dateCloture,
|
||||
'DateUpdate' => substr($dateInsert,0,10),
|
||||
);
|
||||
return $tabRet;
|
||||
*/
|
||||
}
|
||||
return $tabInsert;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,151 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/common/dates.php';
|
||||
|
||||
class MBanques
|
||||
{
|
||||
public $tabActivite = array(
|
||||
0=>'établissements et services autorisés à effectuer des opérations de banque',
|
||||
1=>'banques',
|
||||
2=>'banques mutualistes ou coopératives',
|
||||
4=>'caisses de crédit municipal',
|
||||
5=>'sociétés financières 5', // la distinction entre les codes 5 et 6 ne concerne que les
|
||||
6=>'sociétés financières 6', // applications internes à la Banque de France
|
||||
7=>'institutions financières spécialisées',
|
||||
9=>'entreprises d\'investissement'
|
||||
);
|
||||
|
||||
public $tabNatureGuichet = array(
|
||||
1=>'Guichet permanent de plein exercice domiciliataire (ouvert au public)',
|
||||
2=>'Identifiant de domiciliation (adresse active 5 jours par semaine)',
|
||||
3=>'Guichet permanent non domiciliataire (ouvert au public)',
|
||||
4=>'Libre Prestation de services (LPS)',
|
||||
'A'=>'Guichet fictif',
|
||||
'P'=>'Guichet fictif'
|
||||
);
|
||||
|
||||
public $tabOrgane = array(
|
||||
0=>'Association française des établissements de crédit et des entreprises d\'investissement',
|
||||
11=>'Association française des sociétés financières',
|
||||
12=>'Groupement des institutions financières spécialisées',
|
||||
13=>'Conférence permanente des caisses de crédit municipal',
|
||||
14=>'Association française des entreprises d\'investissement',
|
||||
15=>'Association française des entreprises d\'investissement-courtiers',
|
||||
16=>'Association française des fonds et sociétés d\'investissements et de gestion d\'actifs financiers',
|
||||
17=>'Association française des intermédiaires transmetteurs d\'ordres ',
|
||||
18=>'Fédération bancaire française',
|
||||
19=>'Ass Franc Marchés Financiers',
|
||||
20=>'Caisse nationale de crédit agricole',
|
||||
21=>'Chambre syndicale des banques populaires',
|
||||
22=>'Confédération nationale du crédit mutuel',
|
||||
23=>'Caisse centrale de crédit coopératif',
|
||||
25=>'Caisse nationale des caisses d\'épargne et de prévoyance',
|
||||
27=>'Chambre syndicale des SACI',
|
||||
28=>'Double affiliation CNCE-BFBP',
|
||||
29=>'Crédit Immobilier France Développement',
|
||||
30=>'BPCE',
|
||||
98=>'non concerné',
|
||||
99=>'en instance d\'adhésion'
|
||||
);
|
||||
|
||||
protected $iDb;
|
||||
|
||||
function __construct($db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
function getInfoBanque($codeBanque)
|
||||
{
|
||||
$ret = $this->iDb->select(
|
||||
'insee.BDF_Etabs',
|
||||
'bdfFibCodeEtab, bdfFibCodeSituation, bdfFibDenom40, bdfFibDenom10, bdfFibCodeActivite, bdfFibCodeOrganeRepr, bdfFibDateAgrement, bdfFibDateRetraitAgr, bdfFibDateFinDiffus, bdfFibAdresse1, bdfFibAdresse2, bdfFibAdresse3, CP, Ville, bdfFibCodeEtabAbsorb, bdfFibOptionIdInvar, bdfFibDateOptIdInvar',
|
||||
"bdfFibCodeEtab=$codeBanque",false, MYSQL_ASSOC);
|
||||
//echo mysql_error();
|
||||
$tabRet=$ret[0];
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getInfoGuichet($codeBanque, $codeGuichet)
|
||||
{
|
||||
$tabBanque=$this->getInfoBanque($codeBanque);
|
||||
$tabTel=$this->getTelGuichet($codeBanque,$codeGuichet);
|
||||
$ret = $this->iDb->select(
|
||||
'insee.BDF_Guichets',
|
||||
'bdfFibCodeEtab, bdfFibCodeGuichet, bdfFibCodeSituation AS guichetCodeSituation, bdfFibDenom40 AS guichetDenom40, bdfFibDenom20 AS guichetDenom20, bdfFibCodeEtabCible, bdfFibCodeGuichetRepr, bdfFibCodeGeoInsee, bdfFibCodeLocalite1, bdfFibCodeLocalite2, bdfFibComptoirBDF, bdfFibAdresse1 AS guichetAdresse1, bdfFibAdresse2 AS guichetAdresse2, bdfFibAdresse3 AS guichetAdresse3, CP AS guichetCP, Ville AS guichetVille, bdfFibAdresseSWIFT, bdfFibDateOuverture, bdfFibDateFermeture, bdfFibDateFinDiffus, bdfFibCodeRoutage, bdfFibLibelleRIB, bdfFibNatureGuichet, bdfFibCodeAchOperBDF, bdfFibNomComptoirBDF',
|
||||
"bdfFibCodeEtab=$codeBanque AND bdfFibCodeGuichet=$codeGuichet",false, MYSQL_ASSOC);
|
||||
//echo mysql_error();
|
||||
if (isset($ret[0]))
|
||||
$tabRet=@$ret[0];
|
||||
else
|
||||
$tabRet=array();
|
||||
|
||||
return array_merge($tabRet, $tabBanque, $tabTel);
|
||||
}
|
||||
|
||||
function getTelGuichet($codeBanque, $codeGuichet)
|
||||
{
|
||||
$ret = $this->iDb->select(
|
||||
'insee.Mandel_banques',
|
||||
'Tel, Fax',
|
||||
"CodeB=$codeBanque AND CodeG=$codeGuichet",false, MYSQL_ASSOC);
|
||||
if (isset($ret[0]))
|
||||
return $ret[0];
|
||||
else
|
||||
return array();
|
||||
}
|
||||
|
||||
function getListeBanques($siren)
|
||||
{
|
||||
$tabRet = array();
|
||||
if ($siren*1>1000) {
|
||||
$res=$this->iDb->select('insee.banques', 'codeBanque, codeGuichet, libBanqueGuichet, precis, dateSource*1 AS dateSource', "siren=$siren", false, MYSQL_ASSOC);
|
||||
$tmp=$this->iDb->select('insee.fedRib', "codeBanque, codeGuichet, CONCAT(libBanque,' ',libGuichet) AS libBanqueGuichet, 0 AS precis, IF (dateInfo='0000-00-00', dateDispo*1, dateInfo*1) AS dateSource", "siren=$siren", false, MYSQL_ASSOC);
|
||||
$res=array_merge($res, $tmp);
|
||||
foreach ($res as $tabBanque) {
|
||||
$dateSource=$tabBanque['dateSource'];
|
||||
$codBanque=$tabBanque['codeBanque'];
|
||||
$codGuichet=$tabBanque['codeGuichet'];
|
||||
$libBanque=trim($tabBanque['libBanqueGuichet']);
|
||||
$found=false;
|
||||
$adrBanque1=$adrBanque2=$adrBanqueCP=$adrBanqueVille='';
|
||||
|
||||
if ($codBanque>0 && $codGuichet>0 && $dateSource>(date('Y')-4)*10000+101 && $dateSource<date('Ymd')) {
|
||||
$tmp=$this->iDb->select('insee.BDF_Etabs b, insee.BDF_Guichets g', 'g.bdfFibCodeEtab AS banque, g.bdfFibCodeGuichet AS guichet, b.bdfFibDenom40 AS nomBanque, b.bdfFibDenom10 AS sigleBanque, g.bdfFibDenom20 AS nomGuichet, g.bdfFibAdresse1 AS adresse1, g.bdfFibAdresse2 AS adresse2, g.bdfFibAdresse3 AS adresse3, g.CP, g.Ville', "g.bdfFibCodeEtab=$codBanque AND g.bdfFibCodeGuichet=$codGuichet AND b.bdfFibCodeEtab=g.bdfFibCodeEtab", false, MYSQL_ASSOC);
|
||||
if (isset($tmp[0])) {
|
||||
$libBanque=trim($tmp[0]['nomBanque'].' '.$tmp[0]['nomGuichet']);
|
||||
$adrBanque1=$tmp[0]['adresse1'];
|
||||
$adrBanque2=trim($tmp[0]['adresse2'].' '.$tmp[0]['adresse3']);
|
||||
$adrBanqueCP=$tmp[0]['CP'];
|
||||
$adrBanqueVille=$tmp[0]['Ville'];
|
||||
$found=true;
|
||||
};
|
||||
}
|
||||
if (!$found && $codBanque>0 && $dateSource>(date('Y')-4)*10000+101 && $dateSource<date('Ymd')) {
|
||||
$tmp=$this->iDb->select('insee.BDF_Etabs', "bdfFibCodeEtab AS banque, '' AS guichet, bdfFibDenom40 AS nomBanque, '' AS nomGuichet, '' AS adresse1, '' AS adresse2, '' AS adresse3, '' AS CP, '' AS Ville", "bdfFibCodeEtab=$codBanque", false, MYSQL_ASSOC);
|
||||
if (isset($tmp[0])) {
|
||||
$libBanque=trim($tmp[0]['nomBanque'].' '.$tmp[0]['nomGuichet']);
|
||||
$adrBanque1=$tmp[0]['adresse1'];
|
||||
$adrBanque2=trim($tmp[0]['adresse2'].' '.$tmp[0]['adresse3']);
|
||||
$adrBanqueCP=$tmp[0]['CP'];
|
||||
$adrBanqueVille=$tmp[0]['Ville'];
|
||||
} else continue;
|
||||
} else continue;
|
||||
|
||||
$tabRet[] = array(
|
||||
'codeBanque' => $codBanque,
|
||||
'codeGuichet' => $codGuichet,
|
||||
'libBanque' => $libBanque,
|
||||
'adresse1' => $adrBanque1,
|
||||
'adresse2' => $adrBanque2,
|
||||
'cp' => $adrBanqueCP,
|
||||
'ville' => $adrBanqueVille,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,286 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
class MBilans
|
||||
{
|
||||
private $body = '';
|
||||
private $header = '';
|
||||
private $codeRetour = 0;
|
||||
private $cookie='';
|
||||
private $reference = 0;
|
||||
private $timeOut=0;
|
||||
private $url='';
|
||||
private $referer='';
|
||||
private $curPage='';
|
||||
|
||||
public $siren;
|
||||
public $dernierExerciceDepose=0;
|
||||
public $dernierExerciceDeposeLe=0;
|
||||
|
||||
function __construct($siren) {
|
||||
$this->partGetSession();
|
||||
$this->siren=$siren;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
$this->partSaveSession();
|
||||
}
|
||||
|
||||
|
||||
function listeBilans($uniquementEnBase=true) {
|
||||
//if ($siren<>0) $this->siren=$siren;
|
||||
$iDb=new WDB();
|
||||
$ret=$iDb->select( 'jo.bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaieOrigine',
|
||||
"siren='$this->siren' ORDER BY dateExercice DESC");
|
||||
// if (count($ret)==0) return array(); // Pas de bilan disponible !
|
||||
// else {
|
||||
$tabRet=array();
|
||||
if (!$uniquementEnBase) {
|
||||
$ret2=$iDb->select( 'jo.bodacc_detail', 'Bodacc_Date_Parution, dateEffet, Bodacc_Num, Bodacc_Date_Parution, Num_Annonce, RC, raisonSociale, FJ, adrSiegeNum, adrSiegeIndRep, adrSiegeTypVoie, adrSiegeLibVoie, adrSiegeComp1, adrSiegeComp2, codePostalSiege, villeSiege', "siren='$this->siren' AND Rubrique='comptes' ORDER BY dateEffet DESC");
|
||||
$dateDerDepot=WDate::dateT('Y-m-d','Ymd',@$ret2[0]['dateEffet'])*1;
|
||||
$dateDerExercice=$ret[0]['dateExercice']*1;
|
||||
if ($dateDerDepot<>0) {
|
||||
$this->dernierExerciceDepose = WDate::dateT('Y-m-d','d/m/Y',@$ret2[0]['dateEffet']);
|
||||
$this->dernierExerciceDeposeLe = WDate::dateT('Y-m-d','d/m/Y',@$ret2[0]['Bodacc_Date_Parution']);
|
||||
}
|
||||
echo date('Y/m/d - H:i:s') ." - Dernier depot le ". $ret2[0]['Bodacc_Date_Parution'] .", dernier en base = $dateDerExercice !<br/>\n";
|
||||
if ( $dateDerDepot>$dateDerExercice ||
|
||||
( $dateDerDepot==0 && $dateDerExercice<date('Ymd', mktime(0,0,0, date('m')-16, date('d'), date('Y'))) ) ) {
|
||||
$tabRet=$this->partListeBilans();
|
||||
}
|
||||
}
|
||||
foreach ($ret as $i=>$bil) {
|
||||
$tabRet[$bil['dateExercice']]=array('dateProvPartenaire'=>$bil['dateProvPartenaire'],
|
||||
'dureeExercice' =>$bil['dureeExercice'],
|
||||
'dateExercicePre' =>$bil['dateExercicePre'],
|
||||
'dureeExercicePre' =>$bil['dureeExercicePre'],
|
||||
'monnaie' =>$bil['monnaieOrigine'],
|
||||
'source' =>1,
|
||||
);
|
||||
}
|
||||
return $tabRet;
|
||||
// }
|
||||
}
|
||||
|
||||
function getBilan($millesime='', $source=1) {
|
||||
|
||||
$iDb2=new WDB();
|
||||
$ret=$iDb2->select('jo.bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes', "siren='$this->siren' AND dateExercice='$millesime'", true);
|
||||
/*echo $this->siren.'<br/>';
|
||||
echo $millesime.'<br/>';
|
||||
print_r($ret[0]);die();*/
|
||||
$bilan=$ret[0];
|
||||
if (count($ret)==0) {
|
||||
$tabBilan=$this->partGetBilan(WDate::dateT('Ymd','d/m/Y',$millesime));
|
||||
if ($tabBilan) {
|
||||
$tabInsert=array( 'siren' =>$this->siren,
|
||||
'dateProvPartenaire'=>$tabBilan['DATE_FRAICHE_BILAN'],
|
||||
'dateExercice' =>$tabBilan['DATE_CLOTURE'],
|
||||
'dateExercicePre' =>$tabBilan['DATE_CLOTURE_PRE'],
|
||||
'dureeExercice' =>$tabBilan['DUREE_MOIS'],
|
||||
'dureeExercicePre' =>$tabBilan['DUREE_MOIS_PRE'],
|
||||
'monnaie' =>$tabBilan['MONNAIE'],
|
||||
'typeBilan' =>$tabBilan['CONSOLIDE'],
|
||||
'monnaieOrigine' =>$tabBilan['MONNAIE_ORI'],
|
||||
'unite' =>$tabBilan['MONNAIE_LIV_UNITE'],
|
||||
'postes' =>$tabBilan['POSTES'],
|
||||
'partenaire' =>1,
|
||||
);
|
||||
$iDb2->insert('jo.bilans', $tabInsert);
|
||||
$ret=$iDb2->select('jo.bilans', 'dateProvPartenaire, dateExercice, dateExercicePre, dureeExercice, dureeExercicePre, monnaie, typeBilan, monnaieOrigine, unite, postes', "siren='$this->siren' AND dateExercice='$millesime'");
|
||||
$bilan=$ret[0];
|
||||
}
|
||||
}
|
||||
$tabBilan=array();
|
||||
$tabBilan['SIREN'] = $this->siren;
|
||||
$tabBilan['DATE_FRAICHE_BILAN'] = $bilan['dateProvPartenaire']; // SSAAMMJJ
|
||||
$tabBilan['DATE_CLOTURE'] = $bilan['dateExercice']; // SSAAMMJJ
|
||||
$tabBilan['DATE_CLOTURE_PRE'] = $bilan['dateExercicePre']; // SSAAMMJJ
|
||||
$tabBilan['DUREE_MOIS'] = $bilan['dureeExercice'];
|
||||
$tabBilan['DUREE_MOIS_PRE'] = $bilan['dureeExercicePre'];
|
||||
$tabBilan['MONNAIE'] = $bilan['monnaie'];
|
||||
$tabBilan['CONSOLIDE'] = $bilan['typeBilan']; // C = Bilan consolidé
|
||||
$tabBilan['MONNAIE_ORI'] = $bilan['monnaieOrigine'];
|
||||
$tabBilan['MONNAIE_LIV_UNITE'] = $bilan['unite'];
|
||||
if ($bilan['monnaie']=='EUR') $monnaie='€'; else $monnaie=$bilan['monnaie'];
|
||||
switch (strtoupper($bilan['unite'])) {
|
||||
case 'K': $unite='K'; break;
|
||||
case 'U':
|
||||
case ' ':
|
||||
case '' : $unite=''; break;
|
||||
case 'M': $unite='M'; break;
|
||||
default: die('Unite Bilan ('. $bilan['unite'] .') non prise en charge !'); break;
|
||||
}
|
||||
$tabBilan['devise'] = /*$unite.*/$monnaie;
|
||||
|
||||
$tabTmp=explode(';', $bilan['postes']);
|
||||
foreach ($tabTmp as $i=>$strTmp) {
|
||||
$tabTmp2=explode('=', $strTmp);
|
||||
if (isset($tabTmp2[1]))
|
||||
if ($unite=='K' && $tabTmp2[0]<>'YP') $tabBilan[$tabTmp2[0]]=$tabTmp2[1]*1000;
|
||||
elseif ($unite=='M' && $tabTmp2[0]<>'YP') $tabBilan[$tabTmp2[0]]=$tabTmp2[1]*1000000;
|
||||
else $tabBilan[$tabTmp2[0]]=$tabTmp2[1];
|
||||
}
|
||||
return $tabBilan;
|
||||
}
|
||||
|
||||
private function partConnection() {
|
||||
if (!$this->cookie || time()>$this->timeOut) {
|
||||
$this->timeOut=time()+600;
|
||||
/** Recherche de machine dispo **/
|
||||
$this->referer='http://hyperbil.bil.fr/';
|
||||
$page=getUrl($this->referer, '', '', '', false, 'hyperbil.bil.fr');
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
|
||||
/** Redirection sur la bonne machine**/
|
||||
$this->url=trim(str_replace('https://', 'http://', $this->header['Location']));
|
||||
if (substr($this->url,-1)=='/') $this->url=substr($this->url, 0, strlen($this->url)-1);
|
||||
|
||||
$this->domaine=str_replace('/', '', str_replace('http:/', '', $this->url));
|
||||
//echo "Redirection sur $this->url<br/>Domaine = $this->domaine<br/>Referer = $this->referer<br/>";
|
||||
$page=getUrl($this->url, '', '', $this->referer, false, $this->domaine);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
|
||||
/** Connexion LOGIN PASSWORD **/
|
||||
//print_r($this->header);
|
||||
$this->cookie=$this->header['Set-Cookie'];
|
||||
$postData=array('rq'=>'hbilabon', 'QPABO'=>'101001002', 'QPPAS'=>'otY66');
|
||||
$urlConn=$this->url.'/cgi-bin/h2r';
|
||||
//echo "Connexion à $urlConn<br/>";
|
||||
$page=getUrl($urlConn, $this->cookie, $postData, $this->url, false, $this->domaine);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->cookie=$this->header['Set-Cookie'];
|
||||
|
||||
/** Base entreprise **/
|
||||
// print_r($this->header);
|
||||
$urlEntrep=$this->url.'/cgi-bin/h2r?rq=hbilcrit&QPABO=101001002';///cgi-bin/h2r?rq=hbilcrit"
|
||||
sleep(1);
|
||||
$page=getUrl($urlEntrep, $this->cookie, '', $this->url, false, $this->domaine);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
}
|
||||
}
|
||||
|
||||
private function partVitrine() {
|
||||
//echo "Recherche du siren $this->siren<br/>\n";
|
||||
$this->partConnection();
|
||||
|
||||
/** Liste des établissements **/
|
||||
$urlEntrep=$this->url .'/cgi-bin/h2r?rq=hbilentl&QEREC=B&QESIR='.$this->siren
|
||||
.'&QENOM=&QEPRN=&QENAIA=&QENAIM=&QECP=&QESIEG=A&QEVIL=&QENRU=&QERUE=&QEAPE=&QETEL=&QENAOB&wi=1';
|
||||
/* QESIEG :
|
||||
"" = Tous les étab
|
||||
"A" = Dernier Siège Actif connu
|
||||
"S" = Historique des Sièges
|
||||
"E" = Historique des établissements secondaires
|
||||
*/
|
||||
//sleep(1);
|
||||
$page=getUrl($urlEntrep, $this->cookie, '', $this->url, false, $this->domaine);
|
||||
$bil=$page['body'];
|
||||
preg_match_all('/"\/cgi-bin\/h2r\?rq=hbiliden&QINUME=(\d*)&QISIR=(\d*)&(.*)"/', $bil, $matches);
|
||||
//print_r($matches);
|
||||
/** Fiche d'identité du siège **/
|
||||
$urlEntrep=$url. str_replace('"', '', $matches[0][0]);
|
||||
sleep(1);
|
||||
$page=getUrl($urlEntrep, $this->cookie, '', $this->url, false, $this->domaine);
|
||||
$bil=$page['body'];
|
||||
$this->reference=$matches[1][0];
|
||||
//echo "QINUME = $this->reference<br/>\n";
|
||||
}
|
||||
|
||||
private function partListeBilans() {
|
||||
$this->partVitrine();
|
||||
$urlEntrep=$this->url."/cgi-bin/h2r?rq=hbilbill&QINUME=$this->reference&QISIR=$this->siren&wi=1&wc=N";
|
||||
$page=getUrl($urlEntrep, $this->cookie, '', $this->url, false, $this->domaine);
|
||||
echo date('Y/m/d - H:i:s') ." - Liste des bilans de notre partenaire : $urlEntrep<br/>\n";
|
||||
$tabRet=array();
|
||||
if (preg_match_all("/NAME=\"QBDTCN\" VALUE=\"(.*)\"><B>(?:.*)Durée : <B>(.*) mois/i", $page['body'], $matches)) {
|
||||
foreach ($matches[1] as $num=>$millesime) {
|
||||
$millesime=WDate::dateT('d/m/Y','Ymd',$millesime);
|
||||
$tabRet[$millesime]=array( 'dateProvPartenaire'=>date('Ymd'),
|
||||
'dureeExercice' =>$matches[2][$num],
|
||||
'dateExercicePre' =>WDate::dateT('d/m/Y','Ymd',$matches[1][$num+1]),
|
||||
'dureeExercicePre' =>$matches[2][$num+1],
|
||||
'monnaie' =>'EUR',
|
||||
'source' =>0,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
private function partGetBilan($millesime) {
|
||||
$this->partConnection();
|
||||
|
||||
$urlEntrep=$this->url."/cgi-bin/h2r?rq=hbilsobi&QINUME=$this->reference&QISIR=$this->siren&wi=1&wc=N&QIMONN=EU&QIDLIM=".urlencode($millesime);
|
||||
|
||||
$page=getUrl($urlEntrep, $this->cookie, '', $this->url, false, $this->domaine);
|
||||
echo date('Y/m/d - H:i:s') ." - Bilan $millesime de notre partenaire : $urlEntrep<br/>\n";
|
||||
|
||||
$bil=strip_tags($page['body']);
|
||||
$fcontents=explode("\n",$bil);
|
||||
$tabBilan=array();
|
||||
$i=1;
|
||||
$tabBilan['SIRET'] =substr($fcontents[1], 36, 14);
|
||||
$tabBilan['DATE_FRAICHE_BILAN'] =trim(substr($fcontents[1], 57, 8)); // SSAAMMJJ
|
||||
if ($tabBilan['DATE_FRAICHE_BILAN']=='') return false;
|
||||
$tabBilan['DATE_CLOTURE'] =trim(substr($fcontents[1], 101, 8)); // SSAAMMJJ
|
||||
$tabBilan['DATE_CLOTURE_PRE'] =trim(substr($fcontents[1], 109, 8)); // SSAAMMJJ
|
||||
$tabBilan['DUREE_MOIS'] =trim(substr($fcontents[1], 117, 2));
|
||||
$tabBilan['DUREE_MOIS_PRE'] =trim(substr($fcontents[1], 119, 2));
|
||||
$type =trim(substr($fcontents[1], 123, 1)); // C = Bilan consolidé
|
||||
if ($type=='') $tabBilan['CONSOLIDE']='N';
|
||||
elseif ($type=='C') $tabBilan['CONSOLIDE']='C';
|
||||
else { $tabBilan['CONSOLIDE']=$type;
|
||||
echo ("Type de bilan inconnu en provenance de notre partenaire B='$type' !");
|
||||
}
|
||||
$tabBilan['MONNAIE_ORI'] =trim(substr($fcontents[1], 793, 3));
|
||||
$tabBilan['MONNAIE_UNITE'] =trim(substr($fcontents[1], 796, 1));
|
||||
$tabBilan['MONNAIE'] =trim(substr($fcontents[1], 797, 3));
|
||||
$tabBilan['POSTES'] ='';
|
||||
|
||||
while (substr($fcontents[$i], 65, 1)=='7') {
|
||||
for ($j=0; $j<30; $j++)
|
||||
{
|
||||
$code =rtrim(substr($fcontents[$i], 124+$j*20, 4));
|
||||
if ($code!='')
|
||||
{
|
||||
$colonneLiasse=(int)substr($code,2,1);
|
||||
$signe =substr($fcontents[$i], 128+$j*20, 1);
|
||||
$valeur =(double)substr($fcontents[$i], 129+$j*20, 15);
|
||||
if ($signe=='-')
|
||||
$valeur*=-1;
|
||||
$tabBilan['POSTES'].="$code=$valeur;";
|
||||
//$tabBilan['POSTES'][$code]=$valeur;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
return $tabBilan;
|
||||
}
|
||||
|
||||
private function partSaveSession() {
|
||||
$fp=fopen('/tmp/php_bil_session.id', 'w');
|
||||
fwrite($fp,$this->cookie.'^'.$this->timeOut.'^'.$this->url.'^'.$this->siren.'^'.$this->reference);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
private function partGetSession() {
|
||||
$strTmp=file_get_contents('/tmp/php_bil_session.id');
|
||||
$tabTmp=explode('^', $strTmp);
|
||||
$this->cookie=$tabTmp[0];
|
||||
$this->timeOut=$tabTmp[1];
|
||||
$this->url=$tabTmp[2];
|
||||
$this->siren=$tabTmp[3];
|
||||
$this->reference=$tabTmp[4];
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -1,255 +0,0 @@
|
||||
<?php
|
||||
class MBilansInput
|
||||
{
|
||||
public $CtrlEcartMax = 10;
|
||||
|
||||
public $Ctrl = array (
|
||||
// --- Bilan Simplifié
|
||||
'S' => array(
|
||||
// Actif Simplifié
|
||||
'010-012=013'=>'Fonds commercial (Brut,Amor/Prov et Net incohérents)',
|
||||
'014-016=017'=>'Immos incorpo. autres (Brut,Amor/Prov et Net incohérents)',
|
||||
'028-030=031'=>'Immos corpo. (Brut,Amor/Prov et Net incohérents)',
|
||||
'040-042=043'=>'Immos finan. (Brut,Amor/Prov et Net incohérents)',
|
||||
'044-048=049'=>'Total (I) Actif Immos (Brut,Amor/Prov et Net incohérents)',
|
||||
'010+014+028+040=044'=>'Total Actif immobilisé Brut',
|
||||
'012+016+030+042=048'=>'Total Actif immobilisé Amor/Prov',
|
||||
'013+017+031+043=049'=>'Total Actif immobilisé Net',
|
||||
'050-052=053'=>'Stocks MP (Brut,Amor/Prov et Net incohérents)',
|
||||
'060-062=063'=>'Stocks Marchandises (Brut,Amor/Prov et Net incohérents)',
|
||||
'064-066=067'=>'Avances et acomptes/cmds (Brut,Amor/Prov et Net incohérents)',
|
||||
'068-070=071'=>'Créances clients et CR (Brut,Amor/Prov et Net incohérents)',
|
||||
'072-074=075'=>'Autres créances (Brut,Amor/Prov et Net incohérents)',
|
||||
'080-082=083'=>'VMP (Brut,Amor/Prov et Net incohérents)',
|
||||
'084-086=087'=>'Disponibilités (Brut,Amor/Prov et Net incohérents)',
|
||||
'088-090=091'=>' (Brut,Amor/Prov et Net incohérents)',
|
||||
'092-094=095'=>'Ch. constatées d\'avance (Brut,Amor/Prov et Net incohérents)',
|
||||
'096-098=099'=>'Total (II) Actif Circulant (Brut,Amor/Prov et Net incohérents)',
|
||||
'110-112=113'=>'Total ACTIF (Brut,Amor/Prov et Net incohérents)',
|
||||
'050+060+064+068+072+080+084+088+092=096'=>'Total Actif circulant Brut',
|
||||
'052+062+066+070+074+082+086+090+094=098'=>'Total Actif circulant Amor/Prov',
|
||||
'053+063+067+071+075+083+087+091+092=099'=>'Total Actif circulant Net',
|
||||
'044+096=110'=>'Total ACTIF Brut',
|
||||
'048+098=112'=>'Total ACTIF Amor/Prov',
|
||||
'049+099=113'=>'Total ACTIF Net',
|
||||
// Passif Simplifié
|
||||
'120+124+126+130+132+134+136+140=142'=>'Total Capitaux Propres',
|
||||
'156+164+166+172+174=176'=>'Total Dettes',
|
||||
'142+154+176=180'=>'Total Passif',
|
||||
'113=180'=>'Actif=Passif',
|
||||
// CDR Simplifié
|
||||
'210+214+218+222+224+226+230=232'=>'Total des produits d\'exploitation',
|
||||
'234+236+238+240+242+244+250+252+254+256+262=264'=>'Total des charges d\'exploitation',
|
||||
'210+214+218+222+224+226+230=232'=>'Total des produits d\'exploitation',
|
||||
'232-264=270'=>'Résultat d\'exploitation',
|
||||
'232+280+290-264-294-300-306=310'=>'Résultat d\'exploitation',
|
||||
),
|
||||
// --- Bilan Réel Normal
|
||||
'N' => array(
|
||||
// Actif immobilisé
|
||||
'AA=AA2'=>'Capital souscrit non appelé',
|
||||
'AB-AC=AC1'=>'Frais d\'étab. (Brut,Amor/Prov et Net incohérents)',
|
||||
'AD-AE=AE1'=>'Frais de R&D (Brut,Amor/Prov et Net incohérents)',
|
||||
'AF-AG=AG1'=>'Brevets (Brut,Amor/Prov et Net incohérents)',
|
||||
'AH-AI=AI1'=>'Fonds commercial (Brut,Amor/Prov et Net incohérents)',
|
||||
'AJ-AK=AK1'=>'Autres immo inc. (Brut,Amor/Prov et Net incohérents)',
|
||||
'AL-AM=AM1'=>'Acomptes immo inc. (Brut,Amor/Prov et Net incohérents)',
|
||||
'AN-AO=AO1'=>'Terrains (Brut,Amor/Prov et Net incohérents)',
|
||||
'AP-AQ=AQ1'=>'Constructions (Brut,Amor/Prov et Net incohérents)',
|
||||
'AR-AS=AS1'=>'Installations (Brut,Amor/Prov et Net incohérents)',
|
||||
'AT-AU=AU1'=>'Autres immo corp. (Brut,Amor/Prov et Net incohérents)',
|
||||
'AV-AW=AW1'=>'Immos en cours (Brut,Amor/Prov et Net incohérents)',
|
||||
'AX-AY=AY1'=>'Acomptes immo corp. (Brut,Amor/Prov et Net incohérents)',
|
||||
'CS-CT=CT1'=>'Immo Fi participations/équiv. (Brut,Amor/Prov et Net incohérents)',
|
||||
'CU-CV=CV1'=>'Autres participations (Brut,Amor/Prov et Net incohérents)',
|
||||
'BB-BC=BC1'=>'Créances rattachées à des particip. (Brut,Amor/Prov et Net incohérents)',
|
||||
'BD-BE=BE1'=>'Autres titres immo. (Brut,Amor/Prov et Net incohérents)',
|
||||
'BF-BG=BG1'=>'Prêts (Brut,Amor/Prov et Net incohérents)',
|
||||
'BH-BI=BI1'=>'Autres Immo Financières (Brut,Amor/Prov et Net incohérents)',
|
||||
'BJ-BK=BK1'=>'Total de l\'Actif Immobilisé (Brut,Amor/Prov et Net incohérents)',
|
||||
'AB+AD+AF+AH+AJ+AL+AN+AP+AR+AT+AV+AX+CS+CU+BB+BD+BF+BH=BJ'=>'Total des Immobilisations (Brut)',
|
||||
'AC+AE+AG+AI+AK+AM+AO+AQ+AS+AU+AW+AY+CT+CV+BC+BE+BG+BI=BK'=>'Total des Immobilisations (Amor.)',
|
||||
'AC1+AE1+AG1+AI1+AK1+AM1+AO1+AQ1+AS1+AU1+AW1+AY1+CT1+CV1+BC1+BE1+BG1+BI1=BK1'=>'Total des Immobilisations (Net)',
|
||||
// Actif circulant
|
||||
'BL-BM=BM1'=>'Stocks de MP (Brut,Amor/Prov et Net incohérents)',
|
||||
'BN-BO=BO1'=>'Stocks en cours de prod. biens (Brut,Amor/Prov et Net incohérents)',
|
||||
'BP-BQ=BQ1'=>'Stocks en cours de prod. services (Brut,Amor/Prov et Net incohérents)',
|
||||
'BR-BS=BS1'=>'Stocks produits finis (Brut,Amor/Prov et Net incohérents)',
|
||||
'BT-BU=BU1'=>'Stocks de marchandises (Brut,Amor/Prov et Net incohérents)',
|
||||
'BV-BW=BW1'=>'Avances et acomptes/cmds (Brut,Amor/Prov et Net incohérents)',
|
||||
'BX-BY=BY1'=>'Créances clients (Brut,Amor/Prov et Net incohérents)',
|
||||
'BZ-CA=CA1'=>'Autres créances (Brut,Amor/Prov et Net incohérents)',
|
||||
'CB-CC=CC1'=>'Capital souscrit appelé non versé (Brut,Amor/Prov et Net incohérents)',
|
||||
'CD-CE=CE1'=>'VMP (Brut,Amor/Prov et Net incohérents)',
|
||||
'CF-CG=CG1'=>'Disponibilités (Brut,Amor/Prov et Net incohérents)',
|
||||
'CH-CI=CI1'=>'Charges Const. d\'avance(Brut,Amor/Prov et Net incohérents)',
|
||||
'CJ-CK=CK1'=>'Total de l\'Actif Circulant (Brut,Amor/Prov et Net incohérents)',
|
||||
'BL+BN+BP+BR+BT+BV+BX+BZ+CB+CD+CF+CH=CJ'=>'Total l\'Actif Circulant (Brut)',
|
||||
'BM+BO+BQ+BS+BU+BW+BY+CA+CC+CE+CG+CI=CK'=>'Total l\'Actif Circulant (Amor.)',
|
||||
'BM1+BO1+BQ1+BS1+BU1+BW1+BY1+CA1+CC1+CE1+CG1+CI1=CK1'=>'Total l\'Actif Circulant (Net)',
|
||||
'CL=CL2'=>'Charges / plus. ex. (Brut<>Net)',
|
||||
'CM=CM2'=>'Primes de Rbt obligations (Brut<>Net)',
|
||||
'CN=CN2'=>'Ecarts de conversion d\'actif (Brut<>Net)',
|
||||
'CO-1A=1A1'=>'Total Actif (Brut,Amor/Prov et Net incohérents)',
|
||||
'AA+BJ+CJ+CL+CM+CN=CO'=>'Total Actif Brut',
|
||||
'BK+CK=1A'=>'Total Actif (Amor.)',
|
||||
'AA2+BK1+CK1+CL2+CM2+CN2=1A1'=>'Total Actif Net',
|
||||
// PASSIF
|
||||
'DA+DB+DC+DD+DE+DF+DG+DH+DI+DJ+DK=DL'=>'Passif : s/total I (Capitaux Propres)',
|
||||
'DM+DN=DO'=>'Passif : s/total II (Autres fonds propres)',
|
||||
'DP+DQ=DR'=>'Passif : s/total III (Provisions)',
|
||||
'DS+DT+DU+DV+DW+DX+DY+DZ+EA+EB=EC'=>'Passif : s/total IV (Dettes+Cpt régul. PCA)',
|
||||
'DL+DO+DR+EC+ED=EE'=>'Total Passif',
|
||||
'EE=1A1'=>'Total Actif=Total Passif',
|
||||
// CDR
|
||||
'FA+FB=FC'=>'Total Ventes de marchandises',
|
||||
'FD+FE=FF'=>'Total Production vendue de biens',
|
||||
'FG+FH=FI'=>'Total Production vendue de services',
|
||||
'FJ+FK=FL'=>'Total Chiffe d\'Affaires France+Export',
|
||||
'FA+FD+FG=FJ'=>'Total C.A. France',
|
||||
'FB+FE+FH=FK'=>'Total C.A. Export',
|
||||
'FC+FF+FI=FL'=>'Total C.A. Total (Vtes+Biens+Services)',
|
||||
'FL+FM+FN+FO+FP+FQ=FR'=>'Total I : Produits d\'Exploitation',
|
||||
'FS+FT+FU+FV+FW+FX+FY+FZ+GA+GB+GC+GD+GE=GF'=>'Total II :Charges d\'Exploitation',
|
||||
'FR-GF=GG'=>'1 - Résultat d\'Exploitation',
|
||||
'GJ+GK+GL+GM+GN+GO=GP'=>'Total V : Produits Financiers',
|
||||
'GQ+GR+GS+GT=GU'=>'Total VI : Charges Financières',
|
||||
'GP-GU=GV'=>'2 - Résultat Financier',
|
||||
'GG+GH-GI+GV=GW'=>'3 - R.C.A.I.',
|
||||
'HA+HB+HC=HD'=>'Total VII : Produits Exceptionnels',
|
||||
'HE+HF+HG=HH'=>'Total VIII : Charges Exceptionnels',
|
||||
'HD-HH=HI'=>'4 - Résultat Exceptionnel',
|
||||
'FR+GH+GP+HD=HL'=>'CDR : Total des Produits',
|
||||
'GF+GI+GU+HH+HJ+HK=HM'=>'CDR : Total des Charges',
|
||||
'HL-HM=HN'=>'5 - Résultat de l\'exercice',
|
||||
),
|
||||
);
|
||||
|
||||
public $LibCodeCtrl = array(
|
||||
'_0' => '-',
|
||||
'_1' => 'Corrigé',
|
||||
'_3' => 'Capital',
|
||||
'_5' => 'Calculs', // Anciennement 2 mais maintenant >=5 correspond à une erreur grave
|
||||
'_7' => 'Effectif',
|
||||
'_9' => 'Unité',
|
||||
);
|
||||
|
||||
public $LibCodeSaisie = array(
|
||||
// Code Saisie Bilans par Infogreffe
|
||||
'_00' => 'Bilan saisi sans anomalie',
|
||||
'_01' => 'Bilan saisi avec des incohérences comptables à la source du document (issues du remettant)',
|
||||
'_02' => 'Bilan avec Actif, Passif ou Compte de Résultat nul',
|
||||
'_03' => 'Bilan incomplet (des pages manquent)',
|
||||
'_04' => 'Bilan complet non détaillé (seuls les totaux et sous totaux sont renseignés)',
|
||||
'_05' => 'Bilan reçu en double exemplaire',
|
||||
'_06' => 'Bilan intermédiaire - Situation provisoire',
|
||||
'_07' => 'Bilan illisible',
|
||||
'_A7' => 'Bilan illisible, présentant un cadre gris très foncés (dans lesquels sont inscrits en général les totaux)',
|
||||
'_B7' => 'Bilan manuscrits',
|
||||
'_C7' => 'Bilan illisible, présentant des caractères trop gras',
|
||||
'_D7' => 'Bilan scanné en biais ou qui présentent des pages rognées',
|
||||
'_E7' => 'Bilan numérisés trop clairement (comme une imprimante dont la cartouche est presque vide)',
|
||||
'_F7' => 'Bilan illisible',
|
||||
'_08' => 'Bilan consolidé',
|
||||
'_09' => 'Déclaration d\'impôts',
|
||||
'_10' => 'Document autre que bilan',
|
||||
'_11' => 'Bilan de clôture de liquidation',
|
||||
'_12' => 'Bilan de Société financière',
|
||||
'_13' => 'Bilan de Société d\'assurance',
|
||||
'_14' => 'Bilan de Société immobilière',
|
||||
'_15' => 'Bilan de Société étrangère',
|
||||
// Codes saisie de Bilans spécifique às S&D
|
||||
'_70' => 'Document relatif à une autre société',
|
||||
);
|
||||
|
||||
/**
|
||||
* Décompose le tableau de controle
|
||||
* @param string $type (S | N)
|
||||
* Type du bilan
|
||||
* @return array
|
||||
* Retourne un tableau
|
||||
* [
|
||||
* operation => Chaine de caractère contenant l'operation à effectuer sur les postes
|
||||
* total => Code du poste résultant de l'operation pour comparaison
|
||||
* ]
|
||||
*/
|
||||
protected function formules($type)
|
||||
{
|
||||
$formules = array();
|
||||
if ( array_key_exists($type, $this->Ctrl) ) {
|
||||
foreach ( $this->Ctrl[$type] as $formule => $lib ) {
|
||||
$posEgal = strpos($formule, '=');
|
||||
$partLeft = substr($formule, 0, $posEgal);
|
||||
preg_match_all('/([A-Z0-9]+|(\+|\-))/', $partLeft, $matches);
|
||||
$total = substr($formule, $posEgal+1);
|
||||
$formules[] = array(
|
||||
'operation' => $matches[0],
|
||||
'total' => $total,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $formules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Control les postes
|
||||
* @param string $type (S | N)
|
||||
* Type du bilan
|
||||
* @param array $postes
|
||||
* Tableau des postes d'un bilan Code => Valeur
|
||||
* @throws Exception
|
||||
* @return boolean
|
||||
*/
|
||||
public function control($type, $postes = array() )
|
||||
{
|
||||
$formules = $this->formules($type);
|
||||
|
||||
if ( count($formules) > 0 ) {
|
||||
foreach ( $formules as $formule ) {
|
||||
$checkPostes = array();
|
||||
|
||||
// --- Réaliser le calcul
|
||||
$calc = 0;
|
||||
$signe = null;
|
||||
foreach ( $formule['operation'] as $operation ) {
|
||||
if ( $operation == '-' ) {
|
||||
$signe = '-';
|
||||
} elseif ( $operation == '+' ) {
|
||||
$signe = '+';
|
||||
} else {
|
||||
$checkPostes[] = $operation;
|
||||
// --- Vérification valeur poste
|
||||
if ( !array_key_exists($operation, $postes) ) {
|
||||
$postes[$operation] = 0;
|
||||
}
|
||||
// --- Calcul
|
||||
if ( empty($signe) ) {
|
||||
$calc = $postes[$operation];
|
||||
} elseif ( $signe == '+' ) {
|
||||
$calc+= $postes[$operation];
|
||||
} elseif ( $signe == '-' ) {
|
||||
$calc-= $postes[$operation];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$checkPostes[] = $formule['total'];
|
||||
// --- Effecteur la vérification avec le total
|
||||
if ( !array_key_exists($formule['total'], $postes) ) {
|
||||
$total = 0;
|
||||
} else {
|
||||
$total = $postes[$formule['total']];
|
||||
}
|
||||
if ($calc != $total && !( ($calc - $this->CtrlEcartMax < $total) && ($calc + $this->CtrlEcartMax > $total) ) ) {
|
||||
throw new Exception(join(';',$checkPostes));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1,180 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
class MBourse
|
||||
{
|
||||
protected $siren = false;
|
||||
protected $iDb;
|
||||
|
||||
public function __construct($siren=0, $db = null)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
public function getLibSource($source)
|
||||
{
|
||||
switch ($source) {
|
||||
case 'B': return 'Business Wire'; break;
|
||||
case 'H': return 'Hugin'; break;
|
||||
case 'A': return 'ActusNews'; break;
|
||||
case 'D': return 'DiRelease'; break;
|
||||
case 'E': return 'Les Echos'; break;
|
||||
default: return 'N/C'; break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Vérifie la validité de la structure d'un code ISIN
|
||||
**
|
||||
** @param string $isin
|
||||
** @return bool
|
||||
**/
|
||||
function isIsin($isin)
|
||||
{
|
||||
if (strlen(trim($isin))) {
|
||||
$cle = substr($isin, -1);
|
||||
$isinLeft = substr($isin, 0, strlen($isin)-1);
|
||||
$letter2number = array('A'=>10, 'B'=>11, 'C'=>12, 'D'=>13, 'E'=>14, 'F'=>15, 'G'=>16, 'H'=>17, 'I'=>18, 'J'=>19, 'K'=>20, 'L'=>21, 'M'=>22, 'N'=>23, 'O'=>24, 'P'=>25, 'Q'=>26, 'R'=>27, 'S'=>28, 'T'=>29, 'U'=>30, 'V'=>31, 'W'=>32, 'X'=>33, 'Y'=>34, 'Z'=>35);
|
||||
$isinConvertion = strtr($isinLeft, $letter2number);
|
||||
$sum = '';
|
||||
$sumFinal = 0;
|
||||
for($i=0; $i<strlen($isinConvertion); ++$i) $sum .= (($i % 2) ? 1 : 2)*$isinConvertion[$i];
|
||||
for($i=0; $i<strlen($sum); ++$i) $sumFinal += $sum[$i];
|
||||
if ($sumFinal % 10){
|
||||
$cleVerif = ((int)($sumFinal/10) + 1)*10-$sumFinal;
|
||||
} else {
|
||||
$cleVerif = 0;
|
||||
}
|
||||
if ($cle == $cleVerif) {
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
/** Obtenir le code ISIN à partir d'un siren
|
||||
**
|
||||
** @param integer $siren
|
||||
** @return string
|
||||
**/
|
||||
function getCodeIsin($siren=false)
|
||||
{
|
||||
if (!$siren)
|
||||
$siren=$this->siren;
|
||||
|
||||
$tabTmp = $this->iDb->select('jo.infos_entrep', 'isin', "siren=$siren AND isin<>''", false, MYSQL_ASSOC);
|
||||
return trim(@$tabTmp[0]['isin']);
|
||||
}
|
||||
|
||||
/** Obtenir le SIREN à partir d'un code ISIN
|
||||
**
|
||||
** @param string $isin Code ISIN
|
||||
** @return integer
|
||||
**/
|
||||
function getCodeSiren($isin)
|
||||
{
|
||||
$tabTmp = $this->iDb->select('jo.infos_entrep', 'siren', "isin='$isin' AND siren<>0", false, MYSQL_ASSOC);
|
||||
return trim($tabTmp[0]['siren']);
|
||||
}
|
||||
|
||||
/** A partir d'un siren, récupère les informations règlementés
|
||||
**
|
||||
** @param integer $siren
|
||||
** @param integer $id
|
||||
** @return unknown
|
||||
**/
|
||||
function getInfosReg($siren=false, $id=null)
|
||||
{
|
||||
if (!$siren) $siren = $this->siren;
|
||||
|
||||
$isin = $this->getCodeIsin($siren);
|
||||
$tabRet=array();
|
||||
if ($isin!='') {
|
||||
|
||||
$sqlID = '';
|
||||
if (null !== $id) {
|
||||
$sqlID=" AND id=$id ";
|
||||
}
|
||||
|
||||
$bodacc = $this->iDb->select(
|
||||
'presse.articles',
|
||||
'id, companyName, companyIsin, companySiren, companyWebSite, pressReleaseDate, pressReleaseTitle, '.
|
||||
'pressReleaseText, pressReleaseHtml, pressReleaseAttachments, pressReleaseUrl, source, dateInsert',
|
||||
"companyIsin='$isin' $sqlID ORDER BY pressReleaseDate DESC", true, MYSQL_ASSOC);
|
||||
if (count($bodacc)>0) {
|
||||
foreach ($bodacc as $k=>$ann) {
|
||||
if ($id)
|
||||
$tabRet[$k]=array(
|
||||
'id'=>$ann['id'],
|
||||
'source'=>$this->getLibSource($ann['source']),
|
||||
'DateParution'=>$ann['pressReleaseDate'],
|
||||
'raisonSociale'=>$ann['companyName'],
|
||||
'titre'=>$ann['pressReleaseTitle'],
|
||||
'communique'=>$ann['pressReleaseText'],
|
||||
'communiqueHtml'=>$ann['pressReleaseHtml'],
|
||||
'pj'=>$ann['pressReleaseAttachments'],
|
||||
'url'=>$ann['pressReleaseUrl'],
|
||||
'dateInsertionSD'=>$ann['dateInsert'],
|
||||
);
|
||||
else
|
||||
$tabRet[$k]=array(
|
||||
'id'=>$ann['id'],
|
||||
'source'=>$this->getLibSource($ann['source']),
|
||||
'DateParution'=>$ann['pressReleaseDate'],
|
||||
'raisonSociale'=>$ann['companyName'],
|
||||
'titre'=>$ann['pressReleaseTitle'],
|
||||
'pj'=>$ann['pressReleaseAttachments'],
|
||||
'url'=>$ann['pressReleaseUrl'],
|
||||
'dateInsertionSD'=>$ann['dateInsert'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
/** A partir d'un siren, récupère les informations boursières
|
||||
**
|
||||
** @param integer $siren
|
||||
** @return unknown
|
||||
**/
|
||||
function getInfosBourse($siren=false)
|
||||
{
|
||||
global $timer;
|
||||
|
||||
if (!$siren)
|
||||
$siren=$this->siren;
|
||||
|
||||
$isin=$this->getCodeIsin($siren);
|
||||
$timer['infosBoursieres-getCodeIsin']=microtime(true);
|
||||
$tabRet=array();
|
||||
if ($isin<>'') {
|
||||
$tabRes = $this->iDb->select(
|
||||
'sdv1.bourse_isin b, sdv1.bourse_cours c',
|
||||
'siren, raisonSociale, adresse, effectif, code_sicovam, code_mnemo, code_bloomberg, code_datastream, code_isin, logo, code_ric, '.
|
||||
'dateIntroduction, dateDerAG, dateRadiation, autre_isin, eligibleSRD, eligiblePEA, nombreTitres, tel1, tel2, fax1, fax2, web, mail, '.
|
||||
'marche, placeCotation, description, secteur, activite, activiteDet, dirigeants, actionnaires, chiffresTrim, '.
|
||||
'c.autre, c.`date`, c.`heure`, c.`open` , c.`high` , c.`low` , c.`close` , c.`volume`',
|
||||
"code_isin='$isin' /*OR siren=$siren)*/ AND b.code_isin=c.isin AND c.autre IN('','e','f','g','m','s','u') ORDER BY c.`date` DESC, c.`heure` DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
|
||||
$tabRet=$tabRes[0];
|
||||
$timer['infosBoursieres-infosIsin']=microtime(true);
|
||||
|
||||
$tabRes = $this->iDb->select('sdv1.bourse_cours',
|
||||
'min(close) AS coursMin, avg(close) AS coursMoy, max(close) AS coursMax',
|
||||
"isin='$isin' GROUP BY isin", false, MYSQL_ASSOC);
|
||||
$tabTmp=$tabRes[0];
|
||||
$tabRet['coursMin']=$tabTmp['coursMin'];
|
||||
$tabRet['coursMoy']=$tabTmp['coursMoy'];
|
||||
$tabRet['coursMax']=$tabTmp['coursMax'];
|
||||
$timer['infosBoursieres-derniersCours']=microtime(true);
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
@ -1,280 +0,0 @@
|
||||
<?php
|
||||
class MCadastre
|
||||
{
|
||||
protected $siren = false;
|
||||
protected $iDb;
|
||||
|
||||
/** Droits des locaux **/
|
||||
private static $tabCodeDroit=array(
|
||||
'P'=>'Propriétaire',
|
||||
'U'=>'Usufruitier', // (associé avec N)
|
||||
'N'=>'Nu-propriétaire', // (associé avec U)
|
||||
'B'=>'Bailleur à construction', // (associé avec R)
|
||||
'R'=>'Preneur à construction', // (associé avec B)
|
||||
'F'=>'Foncier', // (associé avec D ou T)
|
||||
'T'=>'Tenuyer', // (associé avec F)
|
||||
'D'=>'Domanier', // (associé avec F)
|
||||
'V'=>'Bailleur d\'un bail à réhabilitation', // (associé avec W)
|
||||
'W'=>'Preneur d\'un bail à réhabilitation', // (associé avec V)
|
||||
'A'=>'Locataire-Attributaire', // (associé avec P)
|
||||
'E'=>'Emphytéote', // (associé avec P)
|
||||
'K'=>'Antichrésiste', // (associé avec P)
|
||||
'L'=>'Fonctionnaire logé',
|
||||
'G'=>'Gérant, mandataire, gestionnaire',
|
||||
'S'=>'Syndic de copropriété',
|
||||
'H'=>'Associé dans une société en transparence fiscale',// (associé avec P)
|
||||
'O'=>'Autorisation d\'occupation temporaire (70 ans)',
|
||||
'J'=>'Jeune agriculteur',
|
||||
'Q'=>'Gestionnaire taxe sur les bureaux (Ile-de-France)',
|
||||
'X'=>'La Poste Occupant et propriétaire',
|
||||
'Y'=>'La Poste Occupant et non propriétaire',
|
||||
'C'=>'Fiduciaire',
|
||||
);
|
||||
|
||||
/** Nature des locaux **/
|
||||
private static $tabNatureLoc=array(
|
||||
'AP'=>'Appartement',
|
||||
'AT'=>'Antenne téléphone',
|
||||
'AU'=>'Autoroute',
|
||||
'CA'=>'Commerce sans boutique',
|
||||
'CB'=>'Local divers',
|
||||
'CD'=>'Dépendance commerciale',
|
||||
'CH'=>'Chantier',
|
||||
'CM'=>'Commerce avec boutique',
|
||||
'DC'=>'Dépendance lieux communs',
|
||||
'DE'=>'Dépendance bâtie isolée',
|
||||
'LC'=>'Local commun',
|
||||
'MA'=>'Maison',
|
||||
'ME'=>'Maison exceptionnelle',
|
||||
'MP'=>'Maison partagée par une limite territoriale',
|
||||
'SM'=>'Sol de maison',
|
||||
'U' =>'Etablissement industriel',
|
||||
'U1'=>'Gare',
|
||||
'U2'=>'Gare - Triage',
|
||||
'U3'=>'Gare - Atelier matériel',
|
||||
'U4'=>'Gare - Atelier magasin',
|
||||
'U5'=>'Gare - Dépôt Titulaire',
|
||||
'U6'=>'Gare - Dépôt Réel',
|
||||
'U7'=>'Gare - Matériel transport',
|
||||
'U8'=>'Gare - Entretien matériel roulant',
|
||||
'U9'=>'Gare - Station usine',
|
||||
'UE'=>'Transformateur électrique',
|
||||
'UG'=>'Appareil à gaz',
|
||||
'UN'=>'Usine nucléaire',
|
||||
'US'=>'Etablissement industriel',
|
||||
);
|
||||
|
||||
/** Code Affectation des PEV (Partie d'EValuation) **/
|
||||
private static $tabCodePEV=array(
|
||||
'B'=>'Bâtiment industriel',
|
||||
'C'=>'Commerce',
|
||||
'H'=>'Habitation',
|
||||
'K'=>'Locaux administratifs non passibles de la Taxe d\'Habitation',
|
||||
'L'=>'Hôtel',
|
||||
'P'=>'Professionnel',
|
||||
'S'=>'Biens divers passibles de la Taxe d\'Habitation',
|
||||
'T'=>'Terrain industriel',
|
||||
);
|
||||
|
||||
/** Code Groupes Personnes Morales **/
|
||||
private static $tabGrpPerMor=array(
|
||||
0=>'Personne morale', // non remarquable
|
||||
1=>'Etat',
|
||||
2=>'Région',
|
||||
3=>'Département',
|
||||
4=>'Commune',
|
||||
5=>'Office HLM',
|
||||
6=>'Personne morale représentant des sociétés',
|
||||
7=>'Copropriétaire',
|
||||
8=>'Associé',
|
||||
9=>'Etablissement public ou organismes assimilés',
|
||||
|
||||
);
|
||||
|
||||
/** Nature des parcelles (cultures) **/
|
||||
private static $tabNaturePar=array(
|
||||
'AB'=>'Terrains à batir',
|
||||
'AG'=>'Terrains d\'agrément',
|
||||
'B' =>'Bois',
|
||||
'BF'=>'Futaies feuillues',
|
||||
'BM'=>'Futaies mixtes',
|
||||
'BO'=>'Oseraies',
|
||||
'BP'=>'Peupleraies',
|
||||
'BR'=>'Futaies résineuses',
|
||||
'BS'=>'Taillies sous futaies',
|
||||
'BT'=>'Taillies simples',
|
||||
'CA'=>'Carrières',
|
||||
'CH'=>'Chemins de fer, Canaux de Navigation',
|
||||
'E' =>'Eaux',
|
||||
'J' =>'Jardins',
|
||||
'L' =>'Landes',
|
||||
'LB'=>'Landes Boisées',
|
||||
'P' =>'Prés',
|
||||
'PA'=>'Pâtures ou Pâturages',
|
||||
'PC'=>'Pacages ou Pâtis',
|
||||
'PE'=>'Prés d\'embouche',
|
||||
'PH'=>'Herbages',
|
||||
'PP'=>'Prés, Pâtures ou Herbages plantes',
|
||||
'S' =>'Sols',
|
||||
'T' =>'Terre',
|
||||
'TP'=>'Terres plantées',
|
||||
'VE'=>'Vergers',
|
||||
'VI'=>'Vignes',
|
||||
);
|
||||
|
||||
public function __construct($siren=0, $db = null)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $siren
|
||||
* @return array
|
||||
*/
|
||||
function getLocaux($siren=false)
|
||||
{
|
||||
if (!$siren) $siren=$this->siren;
|
||||
|
||||
$tabTmp=$this->iDb->select(
|
||||
'sdv1.cad_perloc l, sdv1.cad_permor e',
|
||||
'e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.FILLER, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM,
|
||||
l.CCODRO, l.CCOCOM, l.CCOPRF, l.CCOSEC, l.DNUPLA, l.DNUBAT, l.DESC, l.DNIV, l.DPOR, l.CCONLC, l.CCOAFF0, l.DSUPOD0, l.CCOAFF1, l.DSUPOD1, l.CCOAFF2, l.DSUPOD2, l.CCOAFF3, l.DSUPOD3, l.CCOAFF4, l.DSUPOD4, l.CCOAFF5, l.DSUPOD5, l.CCOAFF6, l.DSUPOD6, l.CCOAFF7, l.DSUPOD7, l.CCOAFF8, l.DSUPOD8, l.CCOAFF9, l.DSUPOD9, l.CCODEP, l.DLICOM, l.CCORIV, l.CNAVOI, l.DLIVOI, l.DNUVOI, l.DLTNUV',
|
||||
"e.DSIREN=$siren AND e.INTCIF=l.INTCIF AND e.DNUPER=l.DNUPER", false, MYSQL_ASSOC);
|
||||
$tabRet=array();
|
||||
if (count($tabTmp)>0 ) {
|
||||
foreach ($tabTmp as $i=>$loc) {
|
||||
$tabLoc = array(
|
||||
'idCentre'=>$loc['INTCIF'],
|
||||
'idPmMajic'=>$loc['DNUPER'],
|
||||
'pmGroupe'=>trim($loc['CCOGRM']),
|
||||
'pmGroupeLib'=>self::$tabGrpPerMor[trim($loc['CCOGRM'])],
|
||||
'pmNom'=>trim($loc['DDENPM']),
|
||||
'pmSigle'=>trim($loc['DSIPMO']),
|
||||
'pmFJ'=>$loc['DFORME'], // $loc['FILLER'],
|
||||
'siren'=>trim($loc['DSIREN']),
|
||||
'pmAdrL3'=>trim($loc['DLIGN3']),
|
||||
'pmAdrL4'=>trim($loc['DLIGN4']),
|
||||
'pmAdrL5'=>trim($loc['DLIGN5']),
|
||||
'pmAdrL6'=>trim($loc['DLIGN6']),
|
||||
'pmAdrDep'=>trim($loc['CCODEP']),
|
||||
'pmAdrCom'=>trim($loc['CCOCOM']),
|
||||
'localDroit'=>trim($loc['CCODRO']),
|
||||
'localDroitLib'=>self::$tabCodeDroit[trim($loc['CCODRO'])],
|
||||
'localDep'=>trim($loc['CCODEP']),
|
||||
'localCom'=>trim($loc['CCOCOM']),
|
||||
'localComLib'=>trim($loc['DLICOM']),
|
||||
'localComAbs'=>trim($loc['CCOPRF']),
|
||||
'localRivoli'=>trim($loc['CCORIV']),
|
||||
'localNumVoie'=>trim($loc['DNUVOI']),
|
||||
'localIndVoie'=>trim($loc['DLTNUV']),
|
||||
'localTypVoie'=>trim($loc['CNAVOI']),
|
||||
'localLibVoie'=>trim($loc['DLIVOI']),
|
||||
'localSection'=>trim($loc['CCOSEC']),
|
||||
'localNumPlan'=>trim($loc['DNUPLA']),
|
||||
'localNumBat'=>trim($loc['DNUBAT']),
|
||||
'localEntEsc'=>trim($loc['DESC']),
|
||||
'localNumPlan'=>trim($loc['DNIV']),
|
||||
'localNumBat'=>trim($loc['DPOR']),
|
||||
'localEntEsc'=>trim($loc['CCONLC']),
|
||||
'localPEV'=>array(),
|
||||
);
|
||||
$surface=0;
|
||||
for($j=0;$j<10;$j++) {
|
||||
$pevCode=trim($loc['CCOAFF'.$j]);
|
||||
$pevSurf=trim($loc['DSUPOD'.$j])*1;
|
||||
if ($pevCode<>'' && $pevSurf>0) {
|
||||
$tabLoc['localPEV'][$j]=array(
|
||||
'pevCode'=>$pevCode,
|
||||
'pevType'=>self::$tabCodePEV[$pevCode],
|
||||
'pevSurface'=>$pevSurf,
|
||||
);
|
||||
$surface+=$pevSurf;
|
||||
}
|
||||
}
|
||||
$tabLoc['localSurface']=$surface;
|
||||
$tabRet[]=$tabLoc;
|
||||
/**
|
||||
* CADBAT_NB_TOT nombre Cadastre nombre de postes BATIMENT du SIREN toutes addresses
|
||||
* CADTER_NB_TOT nombre Cadastre nombre de postes TERRAIN du SIREN toutes addresses
|
||||
* CADBAT_NB_PROP nombre Cadastre nombre de postes BATIMENT à l'adresse dont elle est propriétaire
|
||||
* CADTER_NB_PROP nombre Cadastre nombre de postes TERRAIN à l'adresse dont elle est propriétaire
|
||||
* CADBAT_NB_NONPROP nombre Cadastre nombre de postes BATIMENT à l'adresse dont elle n'est pas propriétaire
|
||||
* CADTER_NB_NONPROP nombre Cadastre nombre de postes TERRAINS à l'adresse dont elle n'est pas propriétaire
|
||||
* CADBAT_SURF_CUM nombre Cadastre Cumul Surfaces des batiments à l'addresse
|
||||
* CADBAT_SURF_TOT nombre Cadastre Surface totale des batiments du SIREN
|
||||
* CADTER_SURF_CUM nombre Cadastre Cumul Surfaces des terrains à l'addresse
|
||||
* CADTER_SURF_TOT nombre Cadastre Surface totale des terrains du SIREN
|
||||
*/
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getParcelles($siren=false) {
|
||||
if (!$siren)
|
||||
$siren=$this->siren;
|
||||
|
||||
$tabTmp=$this->iDb->select(
|
||||
'sdv1.cad_perpar p, sdv1.cad_permor e',
|
||||
'e.INTCIF, e.DNUPER, e.CCOGRM, e.DDENPM, e.DSIPMO, e.DFORME, e.FILLER, e.DSIREN, e.DLIGN3, e.DLIGN4, e.DLIGN5, e.DLIGN6, e.CCODEP, e.CCOCOM,
|
||||
p.CCODRO, p.CCOCOM, p.CCOPRF, p.CCOSEC, p.DNUPLA, p.DCNPAR, p.DSGRPF0, p.DCNSUF0, p.DSGRPF1, p.DCNSUF1, p.DSGRPF2, p.DCNSUF2, p.DSGRPF3, p.DCNSUF3, p.DSGRPF4, p.DCNSUF4, p.DSGRPF5, p.DCNSUF5, p.DSGRPF6, p.DCNSUF6, p.DSGRPF7, p.DCNSUF7, p.DSGRPF8, p.DCNSUF8, p.DSGRPF9, p.DCNSUF9, p.CCODEP, p.DLICOM, p.CCORIV, p.CNAVOI, p.DLIVOI, p.DNUVOI, p.DLTNUV',
|
||||
"e.DSIREN=$siren AND e.INTCIF=p.INTCIF AND e.DNUPER=p.DNUPER", false, MYSQL_ASSOC);
|
||||
$tabRet=array();
|
||||
foreach ($tabTmp as $i=>$loc) {
|
||||
$tabLoc=array( 'idCentre'=>$loc['INTCIF'],
|
||||
'idPmMajic'=>$loc['DNUPER'],
|
||||
'pmGroupe'=>trim($loc['CCOGRM']),
|
||||
'pmGroupeLib'=>self::$tabGrpPerMor[trim($loc['CCOGRM'])],
|
||||
'pmNom'=>trim($loc['DDENPM']),
|
||||
'pmSigle'=>trim($loc['DSIPMO']),
|
||||
'pmFJ'=>$loc['DFORME'], // $loc['FILLER'],
|
||||
'siren'=>trim($loc['DSIREN']),
|
||||
'pmAdrL3'=>trim($loc['DLIGN3']),
|
||||
'pmAdrL4'=>trim($loc['DLIGN4']),
|
||||
'pmAdrL5'=>trim($loc['DLIGN5']),
|
||||
'pmAdrL6'=>trim($loc['DLIGN6']),
|
||||
'pmAdrDep'=>trim($loc['CCODEP']),
|
||||
'pmAdrCom'=>trim($loc['CCOCOM']),
|
||||
'parcelDroit'=>trim($loc['CCODRO']),
|
||||
'parcelDroitLib'=>self::$tabCodeDroit[trim($loc['CCODRO'])],
|
||||
'parcelDep'=>trim($loc['CCODEP']),
|
||||
'parcelCom'=>trim($loc['CCOCOM']),
|
||||
'parcelComLib'=>trim($loc['DLICOM']),
|
||||
'parcelComAbs'=>trim($loc['CCOPRF']),
|
||||
'parcelRivoli'=>trim($loc['CCORIV']),
|
||||
'parcellNumVoie'=>trim($loc['DNUVOI']),
|
||||
'parcelIndVoie'=>trim($loc['DLTNUV']),
|
||||
'parcelTypVoie'=>trim($loc['CNAVOI']),
|
||||
'parcelLibVoie'=>trim($loc['DLIVOI']),
|
||||
'parcelSection'=>trim($loc['CCOSEC']),
|
||||
'parcelNumPlan'=>trim($loc['DNUPLA']),
|
||||
'parcelSurface'=>trim($loc['DCNPAR'])*1,
|
||||
'parcelTer'=>array(),
|
||||
);
|
||||
$surface=0;
|
||||
for($j=0;$j<10;$j++) {
|
||||
$pevCode=trim($loc['DSGRPF'.$j]);
|
||||
$pevSurf=trim($loc['DCNSUF'.$j])*1;
|
||||
if ($pevCode<>'' && $pevSurf>0) {
|
||||
$tabLoc['parcelTer'][$j]=array( 'terCode'=>$pevCode,
|
||||
'terType'=>self::$tabCodePEV[$pevCode],
|
||||
'terSurface'=>$pevSurf,
|
||||
);
|
||||
$surface+=$pevSurf;
|
||||
}
|
||||
}
|
||||
$tabLoc['parcelSurfaceCalc']=$surface;
|
||||
$tabRet[]=$tabLoc;
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,389 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
class MCoface {
|
||||
|
||||
public $body = '';
|
||||
public $header = '';
|
||||
public $codeRetour = 0;
|
||||
|
||||
public $nscrl = 0; // Numéro interne SCRL
|
||||
public $rcsVille='';
|
||||
public $rcsType='';
|
||||
|
||||
public $rSocAdrCPVille=''; // RaisonSocialeAdresseVille (utile pour le débug)
|
||||
public $raisonSociale=''; // Raison Sociale
|
||||
public $adresse=''; // Adresse complète (avec CP et Cille)
|
||||
|
||||
public $sigle='';
|
||||
public $enseigne='';
|
||||
public $nbEtab='';
|
||||
|
||||
public $adrNumVoie;
|
||||
public $adrIndRep;
|
||||
public $adrTypeVoie;
|
||||
public $adrLibVoie;
|
||||
public $adrCP;
|
||||
public $adrVille;
|
||||
|
||||
public $tel='';
|
||||
public $fax='';
|
||||
public $web='';
|
||||
public $mail='';
|
||||
public $activite=''; // Activité Déclarée au bodacc
|
||||
public $naf=''; // NAF
|
||||
public $nafLib='';
|
||||
|
||||
public $bourseIsin='';
|
||||
public $bourseMarche='';
|
||||
public $bourseVille='';
|
||||
|
||||
public $tabInfos=array();
|
||||
public $tabBilans=array();
|
||||
|
||||
public $infoEco=false;
|
||||
public $capitalType='';
|
||||
public $capitalMontant='';
|
||||
public $capitalDevise ='';
|
||||
public $steInactive = '';
|
||||
public $dateCreation=''; // Notion INSEE
|
||||
public $dateImmatriculation=''; // Notion Greffe et RNCS uniquement
|
||||
public $fj='';
|
||||
public $nationalite='';
|
||||
public $enBourse='';
|
||||
public $effectif='';
|
||||
public $tabDirigeants=array();
|
||||
public $strLiensFi='';
|
||||
public $strElemsFi='';
|
||||
|
||||
public $derExerciceAnnee='';
|
||||
public $derExerciceDuree='';
|
||||
public $derExerciceDClot='';
|
||||
public $derExerciceCA='';
|
||||
public $derExerciceResultat='';
|
||||
public $derExerciceDevise='';
|
||||
|
||||
public $dateFermeture='';
|
||||
public $score_pouey='';
|
||||
public $score_conan='';
|
||||
public $score_afdcc='';
|
||||
public $vigilance='';
|
||||
public $tabJug=array();
|
||||
public $tabAct=array();
|
||||
public $tabFil=array();
|
||||
public $tabEtab=array();
|
||||
|
||||
function __construct($siren)
|
||||
{
|
||||
$referer='';
|
||||
$url='http://www.cofacerating.fr/portail/entreprise_identite/identite.asp?ip=pagespro&lg=fr&nsiren='.$siren;
|
||||
$page=getUrl($url, '', '', $referer, false, 'www.cofacerating.fr', '', 10);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->nscrl=@getTextInHtml($this->body, '&nscrl=', '=','&');
|
||||
$this->rSocAdrCPVille=trim(str_replace(chr(160), ' ', html_entity_decode(utf8_encode(@getTextInHtml($this->body, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne"> <b> Raison sociale<br>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval"><b>','</tr>')))));
|
||||
$tmp=explode('<br>', $this->rSocAdrCPVille);
|
||||
$this->raisonSociale=trim($tmp[0]);
|
||||
unset($tmp[0]);
|
||||
$this->adresse=trim(strip_tags(implode(',', $tmp)));
|
||||
$this->tel=trim(@getTextInHtml($this->body, '<td bgcolor="#F3E5CC" class="tabligne"><b>Téléphone<br>', '<td bgcolor="#FFF3DE" class="tabval" valign="top">', '<br>'));
|
||||
$this->fax=trim(@getTextInHtml($this->body, 'Télécopie</b></td>', '<br>', '</td>'));
|
||||
$this->web=trim(@getTextInHtml($this->body, '<td bgcolor="#F3E5CC" class="tabligne"><b>Adresse internet <br>', ' class="tabval"><a class="tabval" HREF="', '" target="_new">'));
|
||||
$this->mail=trim(@getTextInHtml($this->body, '<a class="tabval" href="mailto:', ':', '">'));
|
||||
|
||||
$bourse=trim(@getTextInHtml($this->body, 'Ville Bourse</b></td>', 'class="tabval">', '</td>'));
|
||||
$tmp=explode('<br>', $bourse);
|
||||
$this->bourseIsin=trim($tmp[0]);
|
||||
$this->bourseMarche=trim($tmp[1]);
|
||||
$this->bourseVille=trim($tmp[2]);
|
||||
|
||||
$infosDispo=trim(@getTextInHtml($this->body, '<b>Liste Produits</b><br></td>', '<br></td><td class="menu3"><img src="../images/vide.gif" border="0"><br></td><td colspan="2" class="menu3">', 'Un secteur ou une région en France</a><br></td>'));
|
||||
$tabTmp=explode('<a href="', $infosDispo);
|
||||
foreach ($tabTmp as $k=>$lien) {
|
||||
preg_match('/^(.*)">(.*)<\/a>/i', $lien, $matches);
|
||||
if ($matches[2]<>'') $this->tabInfos[$matches[2]]=$matches[1];
|
||||
if (substr($matches[2], 0, 12)=='rapport éco.') $this->infoEco='http://www.cofacerating.fr/portail/entreprise_identite/'.$matches[1];//ip=pagespro&
|
||||
elseif (substr($matches[2], 0, 6)=='bilan ') $this->tabBilans[]=substr($matches[2], 6,strlen($matches[2])-6);
|
||||
}
|
||||
$this->activite=trim(str_replace(chr(160), ' ', html_entity_decode(utf8_encode(@getTextInHtml($this->body, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne" valign="top"><b>Libellé code activité </b></td>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval">', '</td>')))));
|
||||
$this->naf=trim(@getTextInHtml($this->body, '<a href="../chaineeco_dynaeco/DynaEco.asp?cnaf=', 'cnaf=', '&'));
|
||||
|
||||
/**
|
||||
** Recherche du NIC sur Société .com
|
||||
**/
|
||||
|
||||
/*
|
||||
$refererS='http://www.societe.com/';
|
||||
$urlS='http://www.societe.com/cgi-bin/recherche?rncs='.$siren.'&vu=1';
|
||||
$page=getUrl($urlS, '', '', $refererS, false, 'www.societe.com');
|
||||
$ste=$page['body'];
|
||||
$this->nic=trim(@getTextInHtml($ste, 'SIRET</div><div class="ficheAltCol2 size11">', $siren, '</div>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<b><span class="size10">RCS', 'RCS ', ' '.substr($siren,0,3)));
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->rcsVille=$tabTmp[0];//<td class="txtBlanc" align="left"><b><span class="size10">RCS Paris B 552 144 503<br></span></b></td>
|
||||
$this->rcsType=$tabTmp[1];
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Code activité</div>', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$tabTmp=explode(' - ', $strTmp);
|
||||
$this->naf=$tabTmp[0];
|
||||
$this->nafLib=$tabTmp[1];
|
||||
|
||||
// <div class="ficheAltCol1 size11">Siège social</div><div class="ficheAltCol2 size11">75 Avenue la Grande Armee - 75116 PARIS 16</div>
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Capital social', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$this->capitalType='social';
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->capitalMontant=str_replace(',', '.', str_replace('.', '', $tabTmp[0]));
|
||||
$this->capitalDevise =$tabTmp[1];
|
||||
|
||||
$this->fj=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Forme juridique', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$this->nationalite=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Nationalité</div>', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, ' DIRIGEANT(S) </span></span></div>', '<div class="ficheCadre" style="min-height:85px;">', '<div class="spacer"></div>'));
|
||||
$tabTmp=explode('<div class="h1bleu2"></div>', $strTmp);
|
||||
foreach ($tabTmp as $k=>$dir) {
|
||||
if (trim($dir)=='') break;
|
||||
$tabTmp1=explode('</div><div class="ficheAltCol2 size11">', $dir);
|
||||
$tabTmp2=explode('représenté par', $tabTmp1[1]);
|
||||
if (isset($tabTmp2[1]) && $tabTmp2[1]<>'') {
|
||||
$soc=trim($tabTmp2[0]);
|
||||
$diri=trim($tabTmp2[1]);
|
||||
} else {
|
||||
$soc='';
|
||||
$diri=trim($tabTmp1[1]);
|
||||
}
|
||||
preg_match("/^(Mme|M\.|Mlle|Mle|M) ([A-Z\s]*) ([A-Z][a-z\s]*)/", $diri, $matches);
|
||||
//print_r($matches);
|
||||
$this->tabDirigeants[]=array('FONCTION'=>trim(strip_tags($tabTmp1[0])), 'SOCIETE'=>$soc, 'GENRE'=>$matches[1], 'PRENOM'=>trim($matches[3]), 'NOM'=>trim($matches[2]));
|
||||
}
|
||||
|
||||
$this->dateImmatriculation=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11"> Immatriculation', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
//06-03-2007</div>
|
||||
/* Date Creation = ""
|
||||
En bourse = ""
|
||||
Effectif societe = ""
|
||||
Dirigeants :
|
||||
**/
|
||||
$urlRacine='http://infobilan.decideur.com/';
|
||||
$tabPost=array( 'choix'=>'1',
|
||||
'pagePrecedente'=>'recherche_entreprise.html',
|
||||
'nomsocRech'=>'',
|
||||
'cpRech'=>'',
|
||||
'villeRech'=>'',
|
||||
'nomdirRech'=>'',
|
||||
'predirRech'=>'',
|
||||
'sirenRech'=>$siren,
|
||||
'telRech'=>'',);
|
||||
// 'Rechercher'=>'',
|
||||
$url=$urlRacine.'liste_result.html';
|
||||
$referer=$urlRacine.'recherche_entreprise.html';
|
||||
$page=getUrl($url,'', $tabPost, $referer, false, 'infobilan.decideur.com');
|
||||
$this->body=$page['body'];
|
||||
$strCookie=$page['header']['Set-Cookie'];
|
||||
$refererInfoD=$url;
|
||||
|
||||
if(preg_match_all('/<a href="choix_pdt\.html\?(.*)" class="tt1">(.*)<\/a><\/span><br>/i', $page['body'], $matches))
|
||||
$urlInfoD=$urlRacine.'choix_pdt.html?'.$matches[1][0];
|
||||
else
|
||||
$urlInfoD='';
|
||||
|
||||
$page=getUrl($this->infoEco, '', '', $url, false, 'www.cofacerating.fr');
|
||||
if (strpos($page['body'], '<b>Choix du mode de paiement</b>')===false) { // Le rapport éco. est cadeau !!!
|
||||
$this->infoEco=true;
|
||||
$eco=$page['body'];
|
||||
//die ($eco);
|
||||
$strTmp=strip_tags(@getTextInHtml($eco, ' class="tabligne" > Capital   (', '(', '</tr><tr>'));
|
||||
$tabTmp=explode(')', $strTmp);
|
||||
$this->capitalType=$tabTmp[0];
|
||||
$tabTmp=explode(' ', $tabTmp[1]);
|
||||
$this->capitalMontant=trim(str_replace(chr(160), '', $tabTmp[0]));
|
||||
$this->capitalDevise =trim(str_replace(chr(160), '', $tabTmp[1]));
|
||||
|
||||
$this->steInactive=trim(@getTextInHtml($eco, ' class="tabligne" > Société inactive</td>', 'class="tabval" >', '</td>'));
|
||||
|
||||
$this->dateCreation=trim(@getTextInHtml($eco, ' class="tabligne" > Date de création</td>', 'class="tabval" >', '</td>'));
|
||||
$this->fj=trim(@getTextInHtml($eco, ' class="tabligne" > Forme juridique</td>', 'class="tabval" >', '</td>'));
|
||||
$this->effectif=trim(@getTextInHtml($eco, ' class="tabligne" > Effectif', 'class="tabval" >', '</td>'));
|
||||
|
||||
if (count($this->tabDirigeants)==0) { // Si il y a déjà des dirigeants on garde ceux de Société.com !!!
|
||||
$strTmp=trim(@getTextInHtml($eco, ' class="tabligne" > Cotation en bourse</td>', '<td bgcolor="#F3E5CC" class="tabligne" >', '<td bgcolor="#F3E5CC" class="tabligne" > Effectif'));
|
||||
$tabTmp=explode('<td bgcolor="#F3E5CC" class="tabligne" >', $strTmp);
|
||||
foreach ($tabTmp as $k=>$dir) {
|
||||
$tabTmp1=explode('<td bgcolor="#FFF3DE" class="tabval" >', $dir);
|
||||
$tabTmp2=explode(' ', trim(strip_tags($tabTmp1[1])));
|
||||
$this->tabDirigeants[]=array('FONCTION'=>trim(strip_tags($tabTmp1[0])), 'GENRE'=>trim($tabTmp2[0]), 'PRENOM'=>trim($tabTmp2[1]), 'NOM'=>trim($tabTmp2[2]));
|
||||
}
|
||||
}
|
||||
|
||||
$this->strLiensFi=trim(strip_tags(@getTextInHtml($eco, '<td class="tabtot">LIENS FINANCIERS</td>', '<tr>', '</td></tr>')));
|
||||
$this->strElemsFi=trim(strip_tags(@getTextInHtml($eco, '<td class="tabtot">ELEMENTS FINANCIERS</td>', '<tr>', '</td></tr>')));
|
||||
}
|
||||
|
||||
$refererP='http://www.score3.fr/';
|
||||
$urlP='http://www.score3.fr/entreprise.shtml?siren='.$siren;
|
||||
$page=getUrl($urlP, '', '', $refererP, false, 'www.score3.fr');
|
||||
$pou=$page['body'];
|
||||
$fp=fopen('./pouet.html', 'w');
|
||||
fwrite($fp, $pou);
|
||||
fclose($fp);
|
||||
|
||||
if ($urlInfoD<>'') {
|
||||
$page=getUrl($urlInfoD,$strCookie,'', $refererInfoD, false, 'infobilan.decideur.com');
|
||||
$referer=$urlInfoD;
|
||||
if ($this->nscrl==0) $this->nscrl=@getTextInHtml($url, 'nscrlP=', '=','&');
|
||||
|
||||
$url=$urlRacine.'fiche_ident.html';
|
||||
$page=getUrl($url,$strCookie,'', $referer, false, 'infobilan.decideur.com');
|
||||
$this->body=$page['body'];
|
||||
|
||||
if ($this->raisonSociale=='')
|
||||
$this->raisonSociale=trim(@getTextInHtml($this->body, '<span class="libelle2">Société', ' :', '</span>'));
|
||||
|
||||
if ($this->adresse=='')
|
||||
$this->adresse=trim(@getTextInHtml($this->body, '<span class="libelle2">Adresse</span> <strong>:', '</strong>', '</td>'));
|
||||
|
||||
if ($this->tel=='')
|
||||
$this->tel=trim(@getTextInHtml($this->body, '<td valign="top"><span class="libelle2">Tél', '</span>', '<br>'));
|
||||
if ($this->fax=='')
|
||||
$this->fax=trim(@getTextInHtml($this->body, '<span class="libelle2">Fax</span>', ' :', '<br>'));
|
||||
if ($this->web=='')
|
||||
$this->web=trim(@getTextInHtml($this->body, '<span class="libelle2">Site Web</span>', '<a href="', '" target="_blank">'));
|
||||
if ($this->mail=='')
|
||||
$this->mail=trim(@getTextInHtml($this->body, '<span class="libelle2">E-mail</span>', '<a href="mailto:', '">'));
|
||||
if ($this->naf=='')
|
||||
$this->naf=trim(@getTextInHtml($this->body, '<span class="libelle2">Code NAF</span>', ' :', '</td>'));
|
||||
|
||||
if(preg_match('/<td valign="top"><span class="libelle2">Capital social<\/span> : (\d*)(.*)<br>/isU', $this->body, $matches)
|
||||
&& ($this->capitalMontant=='' || $this->capitalDevise=='')) {
|
||||
$this->capitalMontant=trim($matches[1]);
|
||||
$this->capitalDevise=trim($matches[2]);
|
||||
}
|
||||
|
||||
if ($this->fj=='')
|
||||
$this->fj=trim(@getTextInHtml($this->body, '<span class="libelle2">Forme juridique</span>', ' :', '<br>'));
|
||||
if ($this->nationalite=='')
|
||||
$this->nationalite=trim(@getTextInHtml($this->body, '<span class="libelle2">Nationalité</span>', ' :', '</td>'));
|
||||
if ($this->effectif=='')
|
||||
$this->effectif=trim(@getTextInHtml($this->body, '<td valign="top"><span class="libelle2">Effectif</span>', ' :', '<br>'));
|
||||
if ($this->activite=='')
|
||||
$this->activite=trim(@getTextInHtml($this->body, '<span class="libelle2">Activité</span>', ' :', '<br>'));
|
||||
|
||||
/** Actionnaires **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, 'ACTIONNAIRES<br>', '</div></h1>', '<h1>'));
|
||||
if(preg_match_all('/<p><span class="libelle2">(.*)<\/span> - <span class="libelle2">Participation<\/span> : (.*) %<br>(.*)<\/p>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nom) {
|
||||
$this->tabAct[$i]['nom']=trim($nom);
|
||||
$this->tabAct[$i]['pct']=trim($matches[2][$i]);
|
||||
$this->tabAct[$i]['rcs']=trim(str_replace('RCS : ','',strip_tags($matches[3][$i])));
|
||||
}
|
||||
}
|
||||
|
||||
/** Filiales **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, 'FILIALES<br>', '</div></h1>', '<h1>'));
|
||||
if(preg_match_all('/<p><span class="libelle2">(.*)<\/span> - <span class="libelle2">Participation<\/span> :(.*)%<br>(.*)<\/p>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nom) {
|
||||
$this->tabFil[$i]['nom']=trim($nom);
|
||||
$this->tabFil[$i]['pct']=trim($matches[2][$i]);
|
||||
$this->tabFil[$i]['rcs']=trim(str_replace('RCS :','',strip_tags($matches[3][$i])));
|
||||
}
|
||||
}
|
||||
|
||||
/** CA et Résultat **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, '<h1>PRINCIPAUX ELEMENTS FINANCIERS<br>', '</div></h1>', '</p>'));
|
||||
if(preg_match('/<p><span class="libelle2">CA (.*)<\/span>(.*)<br>/isU', $strTmp, $matches)) {
|
||||
$this->derExerciceAnnee=trim($matches[1]);
|
||||
$this->derExerciceCA=trim(str_replace(':',' ', $matches[2]));
|
||||
}
|
||||
if(preg_match('/<span class="libelle2">Résultat(.*)<\/span>(.*)$/isU', $strTmp, $matches)) {
|
||||
$this->derExerciceResultat=trim(str_replace(':',' ', $matches[2]));
|
||||
}
|
||||
|
||||
$infoBilan=print_r($page, true);
|
||||
$fp=fopen('./infobilan.html', 'w');
|
||||
fwrite($fp, $infoBilan);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($this->nbEtab=='' || $this->nbEtab=='0') {
|
||||
$this->nbEtab=trim(strip_tags(str_replace('afficher la liste...', '', @getTextInHtml($pou, '<tr><td class="ligne1_2">Etablissements </td>', '<td class="ligne2_2">', '</td></tr>'))));
|
||||
$urlPEtab='http://www.score3.fr/etablissements.shtml?page=1&siren='.$siren;
|
||||
$refererPEtab=$urlP;
|
||||
$page=getUrl($urlPEtab, '', '', $refererPEtab, false, 'www.score3.fr');
|
||||
$pou2=$page['body'];
|
||||
if(preg_match_all('/<tr bgcolor="(?:\S*)"><td class="ligne1b" align="center" width="10%">(\d*)<\/td><td class="ligne2" height="50"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="infos">(.*)<\/td><\/tr><\/table>/isU', $pou2, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nic) {
|
||||
$strEtab=$matches[2][$i];
|
||||
$this->tabEtab[$i]['siren']=$siren;
|
||||
$this->tabEtab[$i]['nic']=$nic;
|
||||
$this->tabEtab[$i]['siret']=$siren.$nic;
|
||||
|
||||
$this->tabEtab[$i]['enseigne']=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="titre3">', '">', '</span>')))));
|
||||
$this->tabEtab[$i]['adresse']=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="infos">', '">', '<br>')))));
|
||||
$strTmp=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="infos">', '<br>', '</span>')))));
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->tabEtab[$i]['cp']=$tabTmp[0];
|
||||
unset($tabTmp[0]);
|
||||
$this->tabEtab[$i]['ville']=implode(' ',$tabTmp);
|
||||
$strTmp=trim(strip_tags(@getTextInHtml($strEtab, '<td class="infos" align="right" valign="top">', '">', ')')));
|
||||
$tabTmp=explode('(', $strTmp);
|
||||
$this->tabEtab[$i]['naf_code']=$tabTmp[1];
|
||||
$this->tabEtab[$i]['naf_lib']=trim(str_replace(chr(160),' ',utf8_decode($tabTmp[0])));
|
||||
if (preg_match('/<br>T.l\.(.*)$/i',$strEtab,$matches2))
|
||||
$this->tabEtab[$i]['tel']=trim(str_replace(chr(160),' ',utf8_decode($matches2[1])));
|
||||
else $this->tabEtab[$i]['tel']='';
|
||||
}
|
||||
}
|
||||
$this->nbEtab=count($this->tabEtab);
|
||||
$fp=fopen('./pouet_etab.html', 'w');
|
||||
fwrite($fp, $pou2);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($this->effectif=='' || $this->effectif=='0' || $this->effectif=='NC')
|
||||
$this->effectif=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Effectifs</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->dateImmatriculation=='' || $this->dateImmatriculation=='0')
|
||||
$this->dateImmatriculation=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Date d\'immatriculation</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
if ($this->dateFermeture=='' || $this->dateFermeture=='0')
|
||||
$this->dateFermeture=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Date de fin d\'exploitation</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->tel=='' || $this->tel=='0')
|
||||
$this->tel=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Téléphone</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->fax=='' || $this->fax=='0')
|
||||
$this->fax=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Fax</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($pou, 'Procédures collectives</td></tr>', '</table></td>', '</td><td background'));
|
||||
if(preg_match_all('/<tr><td class="ligne1_2">(.*)<\/td><td class="ligne2_2">(.*)<\/td><\/tr>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$jug) {
|
||||
$this->tabJug[$i]['date']=$matches[1][$i];
|
||||
$this->tabJug[$i]['juge']=$matches[2][$i];
|
||||
}
|
||||
}
|
||||
|
||||
$this->score_pouey=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=pouey&valeur=', '">'));
|
||||
$this->score_conan=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=ch&valeur=', '">'));
|
||||
$this->score_afdcc=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=afdcc&valeur=', '">'));
|
||||
$this->vigilance =trim(@getTextInHtml($pou, '<param name="movie" value="vigilance.swf', 'degre=', '">'));
|
||||
|
||||
if(preg_match('/Date de l\'exercice<\/td><td class="ligne2_2">(.*) sur (\d*) mois<\/td><\/tr>/isU', $pou, $matches)) {
|
||||
$this->derExerciceDClot=trim($matches[1]);
|
||||
$this->derExerciceDuree=trim($matches[2]);
|
||||
}
|
||||
|
||||
/* Siret SIEGE
|
||||
2 Fonction, Nom Prénoù ET Date NAissance du PP
|
||||
5 Liste des actes
|
||||
*/
|
||||
if ($this->codeRetour==200)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,282 +0,0 @@
|
||||
<?php
|
||||
|
||||
define('CREDITSAFE_WS_URL', 'https://www.creditsafe.fr/getdata/service/CSFRServices.asmx');
|
||||
define('CREDITSAFE_WS_URI', 'https://www.creditsafe.fr/getdata/service/');
|
||||
|
||||
define('CREDITSAFE_WS_USER', 'scores_decisions');
|
||||
define('CREDITSAFE_WS_PASS', 'yoann1306');
|
||||
|
||||
define('CREDITSAFE_WS_REF', 'ref');
|
||||
|
||||
|
||||
if (!$_SESSION['connected']) die();
|
||||
|
||||
function formatPct($pct) {
|
||||
$pct=round($pct/10,0)*10;
|
||||
if ($pct==0) $pct=10;
|
||||
return $pct;
|
||||
}
|
||||
|
||||
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
|
||||
if (strlen($siret)<>9 && strlen($siret)<>14) die('Paramètres incorrects !');
|
||||
if (strlen($siret)==9) $siret=$tabInfo['entrep']['siret'];
|
||||
|
||||
$id=trim(preg_replace('/[^0-9]/', '', $_REQUEST['id']))*1; // Si id=0 alors non communiqué
|
||||
if (($siret*1)==0 && $id==0) die('Paramètres incorrects !');
|
||||
$siren=substr($siret,0,9);
|
||||
|
||||
$action=$_REQUEST['action'];
|
||||
if ($action<>'' && $action<>'commande') die('Paramètres incorrects !');
|
||||
|
||||
$raisonSociale=$tabInfo['entrep']['raisonSociale'];
|
||||
|
||||
require_once 'Metier/partenaires/classMTva.php';
|
||||
require_once 'Metier/partenaires/classMMap.php';
|
||||
require_once 'Metier/partenaires/classMCoface.php';
|
||||
require_once 'framework/common/dates.php';
|
||||
|
||||
/** Utilisation du WS **/
|
||||
|
||||
$client = new SoapClient(null, array( 'trace' => 1,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'location' => WEBSERVICE_URL,
|
||||
'uri' => WEBSERVICE_URI,
|
||||
'login' => $_SESSION['tabInfo']['login'],
|
||||
'password' => $_SESSION['tabInfo']['password']));
|
||||
|
||||
/*$client = new SoapClient('https://www.creditsafe.fr/getdata/service/CSFRServices.asmx?WSDL',
|
||||
array( 'location' => CREDITSAFE_WS_URL,
|
||||
'uri' => CREDITSAFE_WS_URI,
|
||||
'soap_version' => SOAP_1_1,
|
||||
'trace' => 1,
|
||||
//'style' => SOAP_RPC,
|
||||
//'use' => SOAP_ENCODED,
|
||||
));
|
||||
*/
|
||||
|
||||
$req='<xmlrequest>'.
|
||||
'<header>'.
|
||||
'<username>'.CREDITSAFE_WS_USER.'</username>'.
|
||||
'<password>'.CREDITSAFE_WS_PASS.'</password>'.
|
||||
//'<operation>getcompanyinformation</operation>'.
|
||||
'<operation>getratinglimit</operation>'.
|
||||
'<country>FR</country>'.
|
||||
'<language>FR</language>'.
|
||||
'<chargereference>'.CREDITSAFE_WS_REF.'</chargereference>'.
|
||||
'</header>'.
|
||||
'<body>'.
|
||||
//'<package>standard</package>'.
|
||||
'<package>ratinglimit</package>'.
|
||||
"<companynumber>$siret</companynumber>".
|
||||
'</body>'.
|
||||
'</xmlrequest>';
|
||||
|
||||
$success=true;
|
||||
$date=date('Ymd');
|
||||
$fichier="$siret-$date.xml";
|
||||
|
||||
if (!file_exists('/var/www/site_extranet/www/creditsafe/xml/'.$fichier)) {
|
||||
/* try {
|
||||
$O=$client->GetData('<RequestXmlString><xmlrequest>'.
|
||||
'<header>'.
|
||||
'<username>'.CREDITSAFE_WS_USER.'</username>'.
|
||||
'<password>'.CREDITSAFE_WS_PASS.'</password>'.
|
||||
'<operation>getcompanyinformation</operation>'.
|
||||
'<country>FR</country>'.
|
||||
'<language>FR</language>'.
|
||||
'<chargereference>'.CREDITSAFE_WS_REF.'</chargereference>'.
|
||||
'</header>'.
|
||||
'<body>'.
|
||||
'<package>standard</package>'.
|
||||
"<companynumber>$siret</companynumber>".
|
||||
'</body>'.
|
||||
'</xmlrequest></RequestXmlString>');
|
||||
//die(print_r($O));
|
||||
$xml=implode('', (array)$O);
|
||||
}
|
||||
catch (SoapFault $soapFault) {// echo "ERROR :\n", var_dump($soapFault), "\n"; echo "Request :\n", $client->__getLastRequest(), "\n";
|
||||
$success=false;
|
||||
$response=$client->__getLastResponse();
|
||||
$response=str_replace("<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><SOAP-ENV:Body><ns0:getProduitsWebServicesXMLResponse xmlns:ns0='urn:local' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><return xsi:type='xsd:string'>",'', $response);
|
||||
$xml=str_replace('</return></ns0:getProduitsWebServicesXMLResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>','', $response);
|
||||
}*/
|
||||
//https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData
|
||||
//$url='https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlString='.$req;
|
||||
$url='https://www.creditsafe.fr/getdata/service/CSFRServices.asmx/GetData?RequestXmlStr='.$req;//.'&RequestXmlString='.$req;
|
||||
//requestXmlStr.
|
||||
$referer=$cookie='';
|
||||
$page=getUrl($url, $cookie, '', $referer, false, '', '');
|
||||
$referer=$url;
|
||||
$xml=html_entity_decode($page['body'], ENT_QUOTES, 'UTF-8');
|
||||
|
||||
/** Enregistrement du fichier XML en provenance des greffes
|
||||
**/
|
||||
$fp=@fopen('/var/www/site_extranet/www/creditsafe/xml/'.$fichier, 'w');
|
||||
@fwrite($fp, $xml);
|
||||
@fclose($fp);
|
||||
|
||||
$O = $client->setLog('scorecsf', $siret);
|
||||
|
||||
} else {
|
||||
/** Lecture du fichier XML en provenance des greffes
|
||||
**/
|
||||
$xml=file_get_contents('/var/www/site_extranet/www/creditsafe/xml/'.$fichier);
|
||||
$O = $client->setLog('scorecsf', $siret, 0, 'local');
|
||||
}
|
||||
/*<>100</rating>
|
||||
2000000</creditlimit>*/
|
||||
|
||||
$dom_object = new DomDocument2();
|
||||
$dom_object->load('/var/www/site_extranet/www/creditsafe/xml/'.$fichier);
|
||||
/* create DOMXPath object with our DOMObject
|
||||
$xpath = new Domxpath($dom_object);
|
||||
$result = $xpath->query("//liste_depot_acte/depot_acte/.");
|
||||
foreach ($result as $annonce) {
|
||||
// N° Gestion
|
||||
$title = $xpath->query ("num_gest/greffe", $annonce);
|
||||
$num_gest_greffe=$title->item(0)->nodeValue;
|
||||
*/
|
||||
$companyname=$dom_object->getValueFromTag('companyname');
|
||||
$rating=$dom_object->getValueFromTag('rating');
|
||||
$ratingdesc1=str_replace('?',"'",$dom_object->getValueFromTag('ratingdesc1'));
|
||||
$ratingdesc2=str_replace('?',"'",$dom_object->getValueFromTag('ratingdesc2'));
|
||||
$creditlimit=$dom_object->getValueFromTag('creditlimit');
|
||||
$libelle='';
|
||||
if (strtoupper($creditlimit)<>strtolower($creditlimit) || $creditlimit=='')
|
||||
$strCreditlimit=$creditlimit;
|
||||
else
|
||||
$strCreditlimit=number_format($creditlimit,null,null,' '). ' €';
|
||||
|
||||
if ($rating>=40) {
|
||||
$fontColor='green';
|
||||
$imgFeux='<img src="/creditsafe/img/feux_vert.png"/>';
|
||||
if ($rating>=71) $libelle='Très bonne cote de crédit/solvabilité';
|
||||
elseif ($rating>=51) $libelle='Bonne cote de crédit/solvabilité';
|
||||
else $libelle='Solvable';
|
||||
|
||||
} elseif ($rating>=20) {
|
||||
$fontColor='yellow';//#f2be2c';
|
||||
$imgFeux='<img src="/creditsafe/img/feux_orange.png"/>';
|
||||
$libelle='Précautions recommandées';
|
||||
} elseif (strtoupper($rating)<>strtolower($rating)) {
|
||||
$fontColor='black';
|
||||
$imgFeux=' ';
|
||||
}
|
||||
elseif ($rating=='') {
|
||||
$fontColor='black';
|
||||
$imgFeux=' ';
|
||||
}
|
||||
else {
|
||||
$fontColor='red';
|
||||
$imgFeux='<img src="/creditsafe/img/feux_rouge.png"/>';
|
||||
if ($rating==0) $libelle='Entreprise en situation de défaillance et ayant un très fort risque de radiation';
|
||||
else $libelle='Avertissement - Crédit à votre discrétion';
|
||||
}
|
||||
|
||||
?><table width="580" border="0" align="left" bgcolor="#FFFFFF">
|
||||
<tr>
|
||||
<td colspan="3"><img src="./img/rub_evaluation.png" width="577" height="36"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="200" class="StyleInfoLib">Numéro identifiant Siren</td>
|
||||
<td width="350" class="StyleInfoData"><?=substr($siret,0,3).' '.substr($siret,3,3).' '.substr($siret,6,3)?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
||||
<td width="350" class="StyleInfoData"><?if ($companyname<>'') echo $companyname;
|
||||
else echo $raisonSociale;
|
||||
?></td>
|
||||
</tr>
|
||||
<? if ($etab['NumRC']*1<>0) { ?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="200" class="StyleInfoLib">Numéro R.C.</td>
|
||||
<td width="350" class="StyleInfoData"><?=$etab['NumRC']?></td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><img src="./img/srub_scorescf.png" width="576" height="27"></td>
|
||||
</tr>
|
||||
|
||||
<!--#a5a5a5; }
|
||||
.grey_gradiant .v20 { background: #bcbcbc; }
|
||||
.grey_gradiant .v10 { background: #c8c8c8;-->
|
||||
<tr><td colspan="3">
|
||||
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<td width="20"> </td>
|
||||
<td width="10" bgcolor="#bebebe"> </td>
|
||||
<td width="200" bgcolor="#bebebe"><font size="2"><b>Note à ce jour [0 - 100]</b></font></td>
|
||||
<td width="250" bgcolor="#bebebe"><font color="<?=$fontColor?>" size="2"><?=$rating;?></font></td>
|
||||
<td width="100" bgcolor="#bebebe"><?=$imgFeux?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20"> </td>
|
||||
<td width="10" bgcolor="#e7e7e7"> </td>
|
||||
<td width="200" bgcolor="#e7e7e7"><font size="2"><b>Limite à ce jour [€]</b></font></td>
|
||||
<td width="350" colspan="2" bgcolor="#e7e7e7"><font size="2"><?=$strCreditlimit?></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="20"> </td>
|
||||
<td width="10" bgcolor="#bebebe"> </td>
|
||||
<td width="200" bgcolor="#bebebe"><font size="2"><b>Informations complémentaires</b></font></td>
|
||||
<td width="350" colspan="2" bgcolor="#bebebe"><font color="<?=$fontColor?>" size="2"><?=$libelle.'<br/>'.$ratingdesc1; if (trim($ratingdesc2)<>'') echo '<br/>'.$ratingdesc2;?></font></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td colspan="5" align="right"><img src="/creditsafe/img/logo_creditsafe.png"/></td>
|
||||
</tr>-->
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($action<>'commande') {
|
||||
?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="550" colspan="2" class="StyleInfoData"><br/><br/><form action="./?page=scorescf&action=commande&siret=<?=$siret?>&id=<?=$id?>" method="POST"><input type="checkbox"/> Mettre cette entreprise sous surveillance scoring partenaire<br/><br/>Adresse email du destinataire <input name="email" type="text" value="<? if ($_SESSION['tabInfo']['login']<>'testreunica' && $_SESSION['tabInfo']['login']<>'reunicacsf') echo $tabInfo['email']?>" size="20"/> <input class="imgButton" type="image" src="./img/boutton_valider_off.gif" name="submit" onmouseover="this.src='./img/boutton_valider_on.gif'" onmouseout="this.src='./img/boutton_valider_off.gif'" title="Surveiller le score partenaire de cette entreprise..."></form></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
} else {
|
||||
if (preg_match('#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#',$_REQUEST['email'])) {
|
||||
$message='Entreprise mise sous surveillance scoring partenaire !';
|
||||
mail( 'contact@scores-decisions.com',"Demande de surveillance score CreditSafe pour $siren à ".$_REQUEST['email'],
|
||||
'REQUEST='.EOL.print_r($_REQUEST,true).'EOL'.
|
||||
'SERVER='.EOL.print_r($_SERVER,true).'EOL'.
|
||||
'SESSION='.EOL.print_r($_SESSION,true).'EOL'.
|
||||
'ENV='.EOL.print_r($_ENV,true).'EOL'.
|
||||
'tabInfo='.print_r($tabInfo,true));
|
||||
$fp=fopen(PATH_LOGS.'surveillance_scf.csv', 'a');
|
||||
fwrite($fp, date('Y/m/d H:i:s').";$siren;".$_REQUEST['email'].';'.$tabInfo['login'].';'.$tabInfo['email'].';'.$tabInfo['ip']."\n");
|
||||
fclose($fp);
|
||||
} else {
|
||||
$message="ERREUR : Veuillez saisir une adresse email valide pour la mise sous surveillance";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td width="550" colspan="2" class="StyleInfoData"><br/><br/><h3><?=$message;?></h3></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
class DomDocument2 extends DOMDocument {
|
||||
|
||||
function getValueFromTag($tagName) {
|
||||
$items=$this->getElementsByTagName($tagName);
|
||||
foreach ($items as $item) {
|
||||
|
||||
return utf8_decode($item->nodeValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -1,407 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
2. Concernant la date de fin de CS, devons nous comprendre les cas suivants de la sorte :
|
||||
A. 026 820 043 I 2009-10-31 La CS était valide jusq'au 31/10/2009... L'entreprise n'a plus de CS ? ou la CS est encore à prendre en compte ?
|
||||
Lorsqu'une cs manuelle arrive à échéance, elle est soumise à l'examen de l'analyste chaque mois. Si l'analyste n'intervient pas l'acheteur reste en cs.
|
||||
B. 077 250 025 I 0000-00-00 La CS I n'est plus à prendre en compte ou au contraire, elle n'a pas de date de fin ?
|
||||
L'acheteur a été sorti de cs entre le traitement de fin de mois et l'extraction ( qui a été déclenchée tardivement à la main ). L'acheteur n'est donc plus en cs.
|
||||
C. 067 103 598 I 2999-12-31 La CS I n'a pas de date de fin sauf changement ultérieur de CS
|
||||
Ce cas fait partie des nettoyages à faire par le Crédit ( échéance illimitée sur une cs qui ne le justifie pas ).
|
||||
D. 067 200 329 I 2010-06-30 La CS est valide jusq'au 30/06/2010... Quid après ?
|
||||
Cette cs ayant été positionnée par l'analyste, elle sera de nouveau soumise à son examen.
|
||||
|
||||
3. Globalement, j'ai l'impression que la CS "Paiements" à une durée de 6-12 mois et la CS "Privilèges" de 12-24 mois ?
|
||||
La cs paiement a une durée de 6 ou 12 mois pour les cas graves.
|
||||
La cs privilège a une durée de 27 mois ( sauf bien sur les cs manuelles qui sont à la convenance de l'analyste, en général 12 mois ).
|
||||
*/
|
||||
class MFacto
|
||||
{
|
||||
public $risqueImpaye=false; // Y a t'il un risque d'impayé ?
|
||||
public $risqueImpayeMois=0;
|
||||
public $profilPayeur=0; // 0:N/D, 1:Excellent, 2=Bon, 3=Normal, 4=Lent, 5=Mauvais ou Défaut
|
||||
|
||||
private $typeFlux = 0; // Type de flux en chargement 0:Acheteur, 1=CS, 2=Paiements
|
||||
private $iDb;
|
||||
|
||||
public $DELAIPAY=0;
|
||||
public $DELAIPAYp='';
|
||||
public $DELAIPAY_MMAA='';
|
||||
|
||||
private $tabInfoCS = array(
|
||||
'_00' => array('risque'=>0,'type'=>'OK', 'libInt'=>'Néant', 'libExt'=>'Aucune difficulté significative ne nous a été signalée'),
|
||||
'_10' => array('risque'=>3,'type'=>'IP', 'libInt'=>'Impayé BDF', 'libExt'=>"A surveiller. Présence d'impayé(s)"),
|
||||
'_11' => array('risque'=>3,'type'=>'IP', 'libInt'=>'Retard de paiement - Prorogation', 'libExt'=>'A suivre. Retard(s) de paiement(s) signalé(s)'),
|
||||
'_12' => array('risque'=>3,'type'=>'IP', 'libInt'=>'Impayé Groupe Facto', 'libExt'=>"A surveiller. Présence d'impayé(s)"),
|
||||
'_13' => array('risque'=>3,'type'=>'IP', 'libInt'=>'Impayé BDF (sup. à limite)', 'libExt'=>"A surveiller. Présence d'impayé(s)"),
|
||||
'_15' => array('risque'=>3,'type'=>'PR', 'libInt'=>'PRIVILEGES URSSAF', 'libExt'=>'A surveiller. Présence de privilèges'),
|
||||
'_16' => array('risque'=>3,'type'=>'PR', 'libInt'=>'AUTRES PRIVILEGES', 'libExt'=>'A surveiller. Présence de Privilèges'),
|
||||
'_20' => array('risque'=>4,'type'=>'BL', 'libInt'=>'LIQUIDATION JUDICIAIRE', 'libExt'=>'Liquidation Judiciaire'),
|
||||
'_21' => array('risque'=>1,'type'=>'BC', 'libInt'=>'CESSATION D\'ACTIVITE', 'libExt'=>'A suivre. Informations terrain. Risque de fermeture'),
|
||||
'_22' => array('risque'=>1,'type'=>'BD', 'libInt'=>'RADIATION RCS', 'libExt'=>'Radiation du RCS'),
|
||||
'_23' => array('risque'=>1,'type'=>'BG', 'libInt'=>'LOCATION GERANCE', 'libExt'=>'Prise en location Gérance'),
|
||||
'_24' => array('risque'=>2,'type'=>'RG', 'libInt'=>'GROUPE EN DIFFICULTE', 'libExt'=>'A suivre. Entreprise(s) du groupe à suivre'),
|
||||
'_25' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'INFORMATIONS NEGATIVES', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_26' => array('risque'=>4,'type'=>'BP', 'libInt'=>'PLAN DE CESSION / DE REDRESSEMENT ', 'libExt'=>'Plan de cession/redressement'),
|
||||
'_27' => array('risque'=>4,'type'=>'BR', 'libInt'=>'REDRESSEMENT JUDICIAIRE', 'libExt'=>'Redressement Judiciaire'),
|
||||
'_28' => array('risque'=>4,'type'=>'BH', 'libInt'=>'HOMOLOGATION CONCILIATION / REG.AMIABLE', 'libExt'=>'Conciliation, Homologation ou règlement amiable'),
|
||||
'_29' => array('risque'=>1,'type'=>'BF', 'libInt'=>'FUSION - ABSORPTION', 'libExt'=>'Fusion/Absorption'),
|
||||
'_30' => array('risque'=>3,'type'=>'IP', 'libInt'=>'MAUVAISE COTE BDF : .8 ou .9', 'libExt'=>"Présence d'impayé(s)"),
|
||||
'_31' => array('risque'=>1,'type'=>'TC', 'libInt'=>'CESSATION ANNONCEE', 'libExt'=>'Fin d\'activité programmée'),
|
||||
'_33' => array('risque'=>4,'type'=>'BS', 'libInt'=>'PROCEDURE DE SAUVEGARDE JUGEMENT', 'libExt'=>'Procédure de Sauvegarde'),
|
||||
'_34' => array('risque'=>4,'type'=>'BV', 'libInt'=>'PLAN DE SAUVEGARDE', 'libExt'=>'Plan de sauvegarde'),
|
||||
'_35' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'ANALYSE FINANCIERE NEGATIVE', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_36' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'BILAN NEGATIF', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_37' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'TRESORERIE SERREE', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_39' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'PREVISIONS NEGATIVES', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_43' => array('risque'=>2,'type'=>'LC', 'libInt'=>'LC SFAC', 'libExt'=>"A suivre. Garantie d'assurance crédit limitée"),
|
||||
'_45' => array('risque'=>2,'type'=>'LC', 'libInt'=>'REFUS SFAC DOM-TOM', 'libExt'=>"A suivre. Garantie d'assurance crédit limitée"),
|
||||
//'_47' =>array('risque'=>2,'type'=>'LC', 'libInt'=>'LISTE CONFIDENTIELLE LEASER', 'libExt'=>"A suivre. Garantie d'assurance crédit limitée"),
|
||||
'_50' => array('risque'=>2,'type'=>'KO', 'libInt'=>'LIENS AVEC UNE ORGANISATION TERRORISTE', 'libExt'=>'Attention, liens internationaux très risqués'),
|
||||
//Nouveaux regroupements GE
|
||||
'_I' => array('risque'=>3,'type'=>'IP', 'libInt'=>'Impayés', 'libExt'=>"A surveiller. Présence d'impayé(s) dans les 12 derniers mois"),
|
||||
'_P' => array('risque'=>3,'type'=>'PR', 'libInt'=>'PRIVILEGES', 'libExt'=>'A surveiller. Présence de privilèges dans les 24 derniers mois'),
|
||||
'_D' => array('risque'=>2,'type'=>'DEF', 'libInt'=>'PREVISIONS NEGATIVES', 'libExt'=>'A suivre. Informations terrain récentes négatives'),
|
||||
'_T' => array('risque'=>2,'type'=>'LC', 'libInt'=>'LC Quelconque', 'libExt'=>"Nombreuses demandes d'avis de crédit"),
|
||||
);
|
||||
|
||||
private $tabTranches = array(
|
||||
0=>6,
|
||||
30=>36,
|
||||
60=>66,
|
||||
90=>96,
|
||||
120=>126,
|
||||
150=>156,
|
||||
180=>999,
|
||||
);
|
||||
|
||||
private $tabMontants = array(
|
||||
1=>500,
|
||||
2=>2000,
|
||||
10=>10000,
|
||||
20=>20000,
|
||||
50=>50000,
|
||||
100=>100000,
|
||||
200=>200000,
|
||||
999=>999999
|
||||
);
|
||||
|
||||
public function __construct($db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
public function setTypeFic($typeFic)
|
||||
{
|
||||
$this->typeFlux = $typeFic;
|
||||
}
|
||||
|
||||
public function readFic($a)
|
||||
{
|
||||
switch ($this->typeFlux)
|
||||
{
|
||||
case 0: // Acheteur GESCDCLT - Line length (120 + CRLF = 122)
|
||||
$tab = array(
|
||||
'NUMACH'=> trim(substr($a, 0, 7)), // 0-7 | 7
|
||||
'SIRENE'=> trim(substr($a, 7, 9)), // 7-16 | 9
|
||||
'RAISOC'=> trim(substr($a, 16, 35)), // 16-51 | 35
|
||||
'NUMVOI'=> trim(substr($a, 51, 4)), // 51-55 | 4
|
||||
'TYPVOI'=> trim(substr($a, 55, 3)), // 55-58 | 3
|
||||
'LIBVOI'=> trim(substr($a, 58, 30)), // 58-88 | 30
|
||||
'VILLE'=> trim(substr($a, 88, 26)), // 88-114 | 26
|
||||
'CODPOS'=> trim(substr($a,114, 5)), // 114-119 | 5
|
||||
'FILLER'=> trim(substr($a,119, 2)), // 119-120 | 1
|
||||
);
|
||||
break;
|
||||
case 1: // CS - GESDACH - Line Length (19 + CRLF = 21)
|
||||
$tab = array(
|
||||
'siren' => trim(substr($a, 0, 9)), // 0-9 | 9
|
||||
'cs' => trim(substr($a, 9, 2)), // 9-11 | 2
|
||||
'dateFin'=> trim(substr($a, 11, 8)), // 11-9 | 8
|
||||
);
|
||||
break;
|
||||
case 2: // Paiements - GESCDMVT - Line length (73 + CRLF = 75)
|
||||
$tab = array(
|
||||
'NUMACH'=> trim(substr($a, 0, 7)), // 0-7 | 7
|
||||
'DATPIE'=> substr($a, 7, 8), // 7-15 | 8
|
||||
'DATECH'=> substr($a, 15, 8), // 15-23 | 8
|
||||
'DATPAI'=> substr($a, 23, 8), // 23-31 | 8
|
||||
'MNTPIE'=> trim(substr($a, 31, 13)), // 31-44 | 13
|
||||
'MNTFRF'=> trim(substr($a, 44, 13)), // 44-57 | 13
|
||||
'MNTLIT'=> trim(substr($a, 57, 13)), // 57-70 | 13
|
||||
'CODDEV'=> trim(substr($a, 70, 3)), // 70-73 | 3
|
||||
);
|
||||
break;
|
||||
}
|
||||
return $tab;
|
||||
}
|
||||
|
||||
|
||||
public function getCoteSpeciale($siren)
|
||||
{
|
||||
$ret=$this->iDb->select(
|
||||
'sdv1.ge_cs2',
|
||||
'siren, cs, dateFin, dateInsert, dateConf',
|
||||
"siren=$siren AND (dateSuppr=0 OR dateConf>dateSuppr) AND (dateFin=0 OR dateFin>NOW()) AND cs NOT IN (20,22,27,33,34) ORDER BY dateConf DESC, dateInsert DESC", false, MYSQL_ASSOC);
|
||||
$tabRet=array();
|
||||
foreach ($ret as $i=>$tabCS)
|
||||
{
|
||||
$dateEven=$tabCS['dateConf'];
|
||||
if ($dateEven=='0000-00-00') {
|
||||
$dateEven=$tabCS['dateInsert'];
|
||||
}
|
||||
$tabRet[]=array(
|
||||
'DateEven' => $dateEven,
|
||||
'DateFin' => $tabCS['dateFin'],
|
||||
'CoteCS' => $tabCS['cs'],
|
||||
//'CoteCSpre' => $tabCS['CSAVAN'],
|
||||
'LibCS' => $this->tabInfoCS['_'.$tabCS['cs']]['libExt'],
|
||||
//'LibCSpre' => $this->tabInfoCS[$tabCS['CSAVAN']*1]['libExt'],
|
||||
'NivRisque' => $this->tabInfoCS['_'.$tabCS['cs']]['risque'],
|
||||
//'NivRisquePre' => $this->tabInfoCS[$tabCS['CSAVAN']*1]['risque'],
|
||||
'CodeRisque' => $this->tabInfoCS['_'.$tabCS['cs']]['type'],
|
||||
);
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
public function getCoteSpecialeOld($siren)
|
||||
{
|
||||
$ret=$this->iDb->select( 'sdv1.ge_cs c LEFT JOIN sdv1.ge_acheteurs a ON a.NUMACH=c.NUMGFH',
|
||||
'DATMAJ1, NUMGFH, CSAVAN, CSAPRE, SIRENE',
|
||||
"a.SIRENE=$siren ORDER BY a.SIRENE ASC, c.DATMAJ1 DESC", false, MYSQL_ASSOC);
|
||||
$tabRet=array();
|
||||
foreach ($ret as $i=>$tabCS) {
|
||||
$tabRet[]=array(
|
||||
'DateEven' => $tabCS['DATMAJ1'],
|
||||
'CoteCS' => $tabCS['CSAPRE'],
|
||||
'CoteCSpre' => $tabCS['CSAVAN'],
|
||||
'LibCS' => $this->tabInfoCS[$tabCS['CSAPRE']*1]['libExt'],
|
||||
'LibCSpre' => $this->tabInfoCS[$tabCS['CSAVAN']*1]['libExt'],
|
||||
'NivRisque' => $this->tabInfoCS[$tabCS['CSAPRE']*1]['risque'],
|
||||
'NivRisquePre' => $this->tabInfoCS[$tabCS['CSAVAN']*1]['risque'],
|
||||
'CodeRisque' => $this->tabInfoCS[$tabCS['CSAPRE']*1]['type'],
|
||||
);
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
public function getPaiements($siren, $echelle='mois')
|
||||
{
|
||||
if ($echelle=='jour')
|
||||
$strGroupBy="GROUP BY p.DATPIE ";
|
||||
elseif ($echelle=='' || $echelle=='mois')
|
||||
$strGroupBy="GROUP BY mois HAVING nbPieces>2 ";
|
||||
elseif ($echelle=='trim')
|
||||
$strGroupBy="GROUP BY trimestre HAVING nbPieces>2 ";
|
||||
else // En mois par défaut
|
||||
$strGroupBy="GROUP BY mois HAVING nbPieces>2 ";
|
||||
|
||||
$ret=$this->iDb->select( 'sdv1.ge_paiements p LEFT JOIN sdv1.ge_acheteurs a ON a.NUMACH=p.NUMACH',
|
||||
"p.NUMACH, DATE_FORMAT(p.DATPIE, '%Y-%m') AS mois,
|
||||
CONCAT(DATE_FORMAT(p.DATPIE,'%Y'),'-',IF(DATE_FORMAT(p.DATPIE,'%m')<4,1,IF(DATE_FORMAT(p.DATPIE,'%m')<7,2,IF(DATE_FORMAT(p.DATPIE,'%m')<10,3,4)))) AS trimestre,
|
||||
count(*) AS nbPieces,
|
||||
AVG(DATEDIFF(NOW(), p.DATECH)) AS nbJourRetard, AVG(DATEDIFF(p.DATPAI, p.DATECH)) AS nbJourPaiement,
|
||||
ROUND(AVG(DATEDIFF(NOW(), p.DATECH) - DATEDIFF(p.DATPAI, p.DATECH))) AS nbJourMoyens,
|
||||
IF(AVG(DATEDIFF(NOW(), p.DATECH) - DATEDIFF( p.DATPAI, p.DATECH ) ) <6, 0, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <36, 30, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <66, 60, if( AVG( DATEDIFF( NOW( ) , p.DATECH ) - DATEDIFF( p.DATPAI, p.DATECH ) ) <96, 90, 120 ) ) ) ) AS nbJours,
|
||||
SUM(p.MNTPIE) AS mtPieces, SUM(p.MNTFRF) AS mtPaiements, SUM(p.MNTLIT) AS mtLitiges,
|
||||
p.CODDEV, a.SIRENE, a.RAISOC, a.CODPOS, a.VILLE",
|
||||
"a.SIRENE=$siren AND DATEDIFF(NOW(),p.DATECH)<736 AND p.DATECH<NOW() $strGroupBy ORDER BY p.DATPIE DESC", false, MYSQL_ASSOC);
|
||||
$tabRet=array();
|
||||
foreach ($ret as $i=>$tabPai)
|
||||
{
|
||||
$nbJoursMoyen=$tabPai['nbJourRetard']-$tabPai['nbJourPaiement'];
|
||||
if ($nbJoursMoyen<6) $tranche=0;
|
||||
elseif ($nbJoursMoyen<36) $tranche=30;
|
||||
elseif ($nbJoursMoyen<66) $tranche=60;
|
||||
elseif ($nbJoursMoyen<96) $tranche=90;
|
||||
elseif ($nbJoursMoyen<126) $tranche=120;
|
||||
elseif ($nbJoursMoyen<156) $tranche=150;
|
||||
else $tranche=180;
|
||||
|
||||
$tabRet[]=array(
|
||||
'trimestre' => $tabPai['trimestre'],
|
||||
'mois' => $tabPai['mois'],
|
||||
'nbPieces' => $tabPai['nbPieces'],
|
||||
'nbJourRetard' => $tabPai['nbJourRetard'],
|
||||
'nbJourPaiement'=> $tabPai['nbJourPaiement'],
|
||||
'nbJourMoyen' => $nbJoursMoyen,
|
||||
'nbJourMoyen2' => $tabPai['nbJourMoyens'],
|
||||
'tranchePaiement'=>$tranche,
|
||||
'tranchePaie90' =>$tabPai['nbJours'],
|
||||
'mtPieces' => $tabPai['mtPieces'],
|
||||
'mtPaiements' => $tabPai['mtPaiements'],
|
||||
'mtLitiges' => $tabPai['mtLitiges'],
|
||||
'devise' => $tabPai['CODDEV'],
|
||||
);
|
||||
}
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
public function getProfilPayeur($siren)
|
||||
{
|
||||
if ($siren<1000) return '';
|
||||
$libProfil='';
|
||||
/*if ($this->siren==$siren)
|
||||
$tabPaie=$this->tabPaiements;
|
||||
else*/
|
||||
$tabPaie=$this->getPaiements($siren);
|
||||
if (count($tabPaie)>=3) {
|
||||
$tabProfil=array();
|
||||
$paie_min=180;
|
||||
$paie_max=$totFactures=$totPaiements=$totLitiges=0;
|
||||
foreach ($tabPaie as $i=>$tabPai) {
|
||||
if ($i==0) { $this->risqueImpayeMois=$tabPai['mois'];
|
||||
// Dernier délai de paiement en jour
|
||||
$this->DELAIPAY=$tabPai['tranchePaiement'];
|
||||
} elseif ($this->DELAIPAYp=='' && $tabPai['tranchePaiement']<>$this->DELAIPAY ) {
|
||||
$this->DELAIPAYp=$tabPai['tranchePaiement'];
|
||||
$this->DELAIPAY_MMAA=$tabPai['mois'];
|
||||
}
|
||||
$tabProfil[$i]=$tabPai['tranchePaiement'];
|
||||
$totFactures+=$tabPai['mtPieces'];
|
||||
$totPaiements+=$tabPai['mtPaiements'];
|
||||
$totLitiges+=$tabPai['mtLitiges'];
|
||||
if ($tabPai['tranchePaiement']<$paie_min) $paie_min=$tabPai['tranchePaiement'];
|
||||
if ($tabPai['tranchePaiement']>$paie_max) $paie_max=$tabPai['tranchePaiement'];
|
||||
}
|
||||
$tauxLitige=$totLitiges/$totFactures;
|
||||
|
||||
if ($tauxLitige>=0.5) $libProfil.='Litiges très importants. ';
|
||||
elseif ($tauxLitige>0.25) $libProfil.='Litiges importants. ';
|
||||
elseif ($tauxLitige>0.05) $libProfil.='Présence de litiges. ';
|
||||
|
||||
if ($tabProfil[0]==$tabProfil[1] && $tabProfil[1]==$tabProfil[2]) {
|
||||
if ($tranche=0) { $libProfil.='Paiements à échéance'; $this->profilPayeur=1; }
|
||||
elseif ($tranche<=30) { $libProfil.='Paiements à 30 jours maximum'; $this->profilPayeur=2; }
|
||||
elseif ($tranche<=60) { $libProfil.='Paiements à 60 jours maximum'; $this->profilPayeur=3; }
|
||||
elseif ($tranche<=90) { $libProfil.='Paiements à 90 jours maximum'; $this->profilPayeur=4; $this->risqueImpaye=true;}
|
||||
else { $libProfil.='Paiements à plus de 90 jours'; $this->profilPayeur=4; $this->risqueImpaye=true;}
|
||||
} elseif ( ($tabProfil[0]<>$tabProfil[1] && $tabProfil[1]==$tabProfil[2]) ||
|
||||
($tabProfil[0]==$tabProfil[1] && $tabProfil[1]<>$tabProfil[2]) ) {
|
||||
// Récent changement de profil payeur
|
||||
$tranche=$tabProfil[0];
|
||||
$tr_prec=$tabProfil[1];
|
||||
$tr_prec2=$tabProfil[2];
|
||||
if ($tranche<$tr_prec) $libProfil.='Amélioration des délais. ';
|
||||
elseif ($tranche==$tr_prec && $tr_prec<$tr_prec2) $libProfil.='Amélioration des délais. ';
|
||||
else { $this->risqueImpaye=true; $libProfil.='Allongement des délais. '; }
|
||||
|
||||
if ($tranche=0) { $libProfil.='Paiements à échéance'; $this->profilPayeur=1; }
|
||||
elseif ($tranche<=30) { $libProfil.='Paiements à 30 jours maximum'; $this->profilPayeur=2; }
|
||||
elseif ($tranche<=60) { $libProfil.='Paiements à 60 jours maximum'; $this->profilPayeur=3; }
|
||||
elseif ($tranche<=90) { $libProfil.='Paiements à 90 jours maximum'; $this->profilPayeur=4; $this->risqueImpaye=true;}
|
||||
else { $libProfil.='Paiements à plus de 90 jours'; $this->profilPayeur=4; $this->risqueImpaye=true;}
|
||||
} else {
|
||||
if ($paie_max<=30) $this->profilPayeur=1;
|
||||
elseif ($paie_max<=60) $this->profilPayeur=2;
|
||||
elseif ($paie_max<=90) $this->profilPayeur=3;
|
||||
elseif ($paie_max>90) $this->profilPayeur=4;
|
||||
$libProfil.="Paiements entre $paie_min et $paie_max jour(s)";
|
||||
}
|
||||
}
|
||||
|
||||
if (trim($libProfil)=='' && $siren<>552100554 && $siren<>552144503 && $siren<>479974115
|
||||
&& $siren<>0 && $siren<>494967938 ) {
|
||||
$ret=$this->iDb->select('jo.surveillances_listes',
|
||||
'ref, dateAjout, dateConf, dateSuppr, dateDerEnvoi',
|
||||
"idClient='SURBODPRDFTSRECOCASH' AND siren=$siren AND dateSuppr=0
|
||||
AND ABS(DATEDIFF(dateAjout, NOW()))<365
|
||||
ORDER BY dateConf DESC, dateAjout DESC", false, MYSQL_ASSOC);
|
||||
foreach ($ret as $i=>$tabCS) {
|
||||
$classWDate = new WDate();
|
||||
$dateMAJ = $classWDate->dateT('Y-m-d', 'M Y', $tabCS['dateAjout']);
|
||||
$libProfil="En date du $dateMAJ : Contentieux importants.";
|
||||
$this->risqueImpaye=true;
|
||||
$this->risqueImpayeMois=$classWDate->dateT('Y-m', 'Ym', $tabCS['dateAjout']);
|
||||
$this->profilPayeur=4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $libProfil;
|
||||
}
|
||||
|
||||
public function getTabPaiements($siren)
|
||||
{
|
||||
if ($siren<1000) return false;
|
||||
|
||||
$tabNbr=array(); // Tableau de travail du nombre de factures par trimestre et par tranches de délais de paiements
|
||||
$tabMtAn=array(); // Tableau de travail du nombre de factures par montant et par tranches de délais de paiements
|
||||
|
||||
$tabNbr2=array(); // Tableau retour du nombre de factures par trimestre et par tranches de délais de paiements
|
||||
$tabMtAn2=array(); // Tableau retour du nombre de factures par montant et par tranches de délais de paiements
|
||||
|
||||
$tabPaie=$this->getPaiements($siren, 'jour');
|
||||
foreach ($tabPaie as $i=>$tabPai)
|
||||
{
|
||||
@$tabNbr[$tabPai['trimestre']]['d='.$tabPai['tranchePaiement']]+=$tabPai['nbPieces'];
|
||||
@$tabNbr[$tabPai['trimestre']]['all']+=$tabPai['nbPieces'];
|
||||
$mt=$tabPai['mtPieces']/$tabPai['nbPieces'];
|
||||
//echo "$i\t".$tabPai['trimestre']." (".$tabPai['tranchePaiement']." j)\t$mt=".$tabPai['mtPieces'].'/'.$tabPai['nbPieces'].EOL;
|
||||
if ($mt<500) { @$tabMtAn[1]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[1]['all']++; }
|
||||
elseif ($mt<2000) { @$tabMtAn[2]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[2]['all']++; }
|
||||
elseif ($mt<10000) { @$tabMtAn[10]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[10]['all']++; }
|
||||
elseif ($mt<20000) { @$tabMtAn[20]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[20]['all']++; }
|
||||
elseif ($mt<50000) { @$tabMtAn[50]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[50]['all']++; }
|
||||
elseif ($mt<100000) { @$tabMtAn[100]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[100]['all']++; }
|
||||
elseif ($mt<200000) { @$tabMtAn[200]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[200]['all']++; }
|
||||
else { @$tabMtAn[999]['d='.$tabPai['tranchePaiement']]++; @$tabMtAn[999]['all']++; }
|
||||
//@$tabMtAn['all'][$tabPai['tranchePaiement']]++;
|
||||
}
|
||||
|
||||
// Recalcul des délais par Trimestre
|
||||
foreach ($tabNbr as $trim=>$tabTranche)
|
||||
{
|
||||
ksort($tabTranche);
|
||||
// Initialisation des tranches à 0
|
||||
foreach ($this->tabTranches as $tranche=>$vide)
|
||||
$tabNbr2[$trim]['nb']=$tabNbr2[$trim]['d='.$tranche]=0;
|
||||
foreach ($tabTranche as $tranche=>$mt3)
|
||||
{
|
||||
$tranche=str_replace('d=','',$tranche);
|
||||
if ($tranche=='all') $tabNbr2[$trim]['nb']=$mt3;
|
||||
else $tabNbr2[$trim]['d='.$tranche]=round(($mt3/$tabNbr2[$trim]['nb'])*100,1);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialisation des tranches à 0 par Montants
|
||||
foreach ($this->tabMontants as $mt=>$vide)
|
||||
{
|
||||
$tabMtAn2['_'.$mt]['nb']=0;
|
||||
foreach ($this->tabTranches as $tranche=>$vide)
|
||||
$tabMtAn2['_'.$mt]['d='.$tranche]=0;
|
||||
}
|
||||
// Recalcul des délais par Montants
|
||||
ksort($tabMtAn);
|
||||
foreach ($tabMtAn as $mt=>$tabTranche)
|
||||
{
|
||||
ksort($tabTranche);
|
||||
foreach ($tabTranche as $tranche=>$mt2)
|
||||
{
|
||||
$tranche=str_replace('d=','',$tranche);
|
||||
if ($tranche=='all') $tabMtAn2['_'.$mt]['nb']=$mt2;
|
||||
else $tabMtAn2['_'.$mt]['d='.$tranche]=round(($mt2/$tabMtAn2['_'.$mt]['nb'])*100,1);
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'parMont'=>$tabMtAn2,
|
||||
'parTrim'=>$tabNbr2
|
||||
);
|
||||
}
|
||||
|
||||
public function getLibInfoCS($cs)
|
||||
{
|
||||
return array(
|
||||
'CoteCS' => $cs,
|
||||
'LibCS' => $this->tabInfoCS["_$cs"]['libExt'],
|
||||
'NivRisque' => $this->tabInfoCS["_$cs"]['risque'],
|
||||
'CodeRisque' => $this->tabInfoCS["_$cs"]['type'],
|
||||
);
|
||||
}
|
||||
}
|
@ -1,244 +0,0 @@
|
||||
<?php
|
||||
class MFedaso {
|
||||
|
||||
private $tabCodeRetour=array(0 => 'Traitement OK',
|
||||
100 => 'Document illisible',
|
||||
101 => 'Document partiellement lisible',
|
||||
102 => 'Document inattendu',
|
||||
103 => 'Page blanche',
|
||||
104 => 'Fichier absent',
|
||||
105 => 'page partiellement scannée',
|
||||
106 => 'Document complémentaire concernant une autre société',
|
||||
107 => 'Page(s) manquante(s)',//NEW
|
||||
108 => 'Document(s) non Francophone',
|
||||
200 => 'Aucune information dirigeants',
|
||||
210 => 'Aucune information actionnaire',
|
||||
211 => 'Aucune information capitalistique',
|
||||
220 => 'Aucune information RIB',
|
||||
221 => 'Code guichet inconnu',
|
||||
250 => 'Raison Sociale absente',//NEW
|
||||
251 => 'Raison Sociale en double : entête retenue',//NEW
|
||||
252 => 'Raison Sociale en double : entête non retenue',//NEW
|
||||
300 => 'Code pays absent du réferentiel',
|
||||
301 => 'Code devise absent du référentiel',
|
||||
201 => 'Code fonction inexistant',
|
||||
);
|
||||
|
||||
public function getRefCodeRetour($sep=',', $eol=EOL) {
|
||||
$str='codRetour'.$sep.'libRetour'.$eol;
|
||||
foreach ($this->tabCodeRetour as $key=>$value)
|
||||
$str.=$key.$sep.$value.$eol;
|
||||
return $str;
|
||||
}
|
||||
|
||||
public function getRefCodeVoie($sep=',', $eol=EOL) {
|
||||
$tabCodeVoie = array(
|
||||
'ABE' => "Abbaye",
|
||||
'AGL' => "Agglomération",
|
||||
'AIRE' => "Aire",
|
||||
'ALL' => "Allée",
|
||||
'ALL' => "Allee",
|
||||
'ACH' => "Ancien chemin",
|
||||
'ART' => "Ancienne route",
|
||||
'ANSE' => "Anse",
|
||||
'ARC' => "Arcade",
|
||||
'AUT' => "Autoroute",
|
||||
'AV' => "Avenue",
|
||||
'BRE' => "Barrière",
|
||||
'BCH' => "Bas chemin",
|
||||
'BSTD' => "Bastide",
|
||||
'BAST' => "Baston",
|
||||
'BEGI' => "Beguinage",
|
||||
'BER' => "Berge",
|
||||
'BOIS' => "Bois",
|
||||
'BCLE' => "Boucle",
|
||||
'BD' => "Boulevard",
|
||||
'BRG' => "Bourg",
|
||||
'BUT' => "Butte",
|
||||
'CALE' => "Cale",
|
||||
'CAMP' => "Camp",
|
||||
'CGNE' => "Campagne",
|
||||
'CPG' => "Camping",
|
||||
'CARR' => "Carré",
|
||||
'CAU' => "Carreau",
|
||||
'CAR' => "Carrefour",
|
||||
'CARE' => "Carrière",
|
||||
'CST' => "Castel",
|
||||
'CAV' => "Cavée",
|
||||
'CTRE' => "Central",
|
||||
'CTRE' => "Centre",
|
||||
'CHL' => "Chalet",
|
||||
'CHP' => "Chapelle",
|
||||
'CHI' => "Charmille",
|
||||
'CHT' => "Château",
|
||||
'CHS' => "Chaussée",
|
||||
'CHE' => "Chemin",
|
||||
'CHV' => "Chemin vicinaux",
|
||||
'CHV' => "Chemin vicinal",
|
||||
'CHEM' => "Cheminement",
|
||||
'CITE' => "Cîte",
|
||||
'CLOI' => "Cloître",
|
||||
'CLOS' => "Clos",
|
||||
'COL' => "Col",
|
||||
'COLI' => "Colline",
|
||||
'CTR' => "Contour",
|
||||
'COR' => "Corniche",
|
||||
'COTE' => "Côte",
|
||||
'COTT' => "Cottage",
|
||||
'COUR' => "Cour",
|
||||
'CRS' => "Cours",
|
||||
'DARS' => "Darse",
|
||||
'DEG' => "Degré",
|
||||
'DSG' => "Descente",
|
||||
'DSC' => "Descente",
|
||||
'DIG' => "Digue",
|
||||
'DOM' => "Domaine",
|
||||
'ECA' => "Ecart",
|
||||
'ECL' => "Ecluse",
|
||||
'EGL' => "Eglise",
|
||||
'EN' => "Enceinte",
|
||||
'ENV' => "Enclave",
|
||||
'ENC' => "Enclos",
|
||||
'ESC' => "Escalier",
|
||||
'ESPA' => "Espace",
|
||||
'ESP' => "Esplanade",
|
||||
'ETING' => "Etang",
|
||||
'FG' => "Faubourg",
|
||||
'FRM' => "Ferme",
|
||||
'FON' => "Fontaine",
|
||||
'FORT' => "Fort",
|
||||
'FORM' => "Forum",
|
||||
'FOS' => "Fosse",
|
||||
'FOYR' => "Foyer",
|
||||
'GAL' => "Galerie",
|
||||
'GARE' => "Gare",
|
||||
'GARN' => "Garenne",
|
||||
'GBD' => "Grand boulevard",
|
||||
'GDEN' => "Grande ensemble",
|
||||
'GR' => "Grande rue",
|
||||
'GRI' => "Grille",
|
||||
'GRIM' => "Grimpette",
|
||||
'GPE' => "Groupe",
|
||||
'GPT' => "Groupement",
|
||||
'HLE' => "Halle",
|
||||
'HAM' => "Hameau",
|
||||
'HCH' => "Haut chemin",
|
||||
'HIP' => "Hippodrome",
|
||||
'HLM' => "HLM",
|
||||
'ILE' => "Ile",
|
||||
'IMM' => "Immeuble",
|
||||
'IMP' => "Impasse",
|
||||
'JARD' => "Jardin",
|
||||
'JTE' => "Jetée",
|
||||
'LEVE' => "Levée",
|
||||
'LD' => "Lieu dit",
|
||||
'LD' => "Lieudit",
|
||||
'LOT' => "Lotissement",
|
||||
'MAIL' => "Mail",
|
||||
'MF' => "Maison forestière",
|
||||
'MAN' => "Manoir",
|
||||
'MAR' => "Marche",
|
||||
'MAS' => "Mas",
|
||||
'MET' => "Métro",
|
||||
'MTE' => "Montée",
|
||||
'MLN' => "Moulin",
|
||||
'MUS' => "Musée",
|
||||
'NTE' => "Nouvelle route",
|
||||
'PAL' => "Palais",
|
||||
'PARC' => "Parc",
|
||||
'PKG' => "Parking",
|
||||
'PRV' => "Parvis",
|
||||
'PAS' => "Passage",
|
||||
'PN' => "Passage à niveau",
|
||||
'PASS' => "Passe",
|
||||
'PLE' => "Passerelle",
|
||||
'PAT' => "Patio",
|
||||
'PAV' => "Pavillon",
|
||||
'PERI' => "Périphérique",
|
||||
'PSTY' => "Péristyle",
|
||||
'PTA' => "Petites allée",
|
||||
'PCH' => "Petit chemin",
|
||||
'PAE' => "Petite avenue",
|
||||
'PIM' => "Petite impasse",
|
||||
'PRT' => "Petite route",
|
||||
'PTR' => "Petite rue",
|
||||
'PL' => "Place",
|
||||
'PLCI' => "Placis",
|
||||
'PLAG' => "Plage",
|
||||
'PLN' => "Plaine",
|
||||
'PLAN' => "Plan",
|
||||
'PLT' => "Plateau",
|
||||
'PNT' => "Pointe",
|
||||
'PONT' => "Pont",
|
||||
'PCH' => "Porche",
|
||||
'PORT' => "Port",
|
||||
'PTE' => "Porte",
|
||||
'PORQ' => "Portique",
|
||||
'POT' => "Poterne",
|
||||
'POUR' => "Pourtour",
|
||||
'PRE' => "Pré",
|
||||
'PRQ' => "Presqu'île",
|
||||
'PROM' => "Promenade",
|
||||
'QU' => "Quai",
|
||||
'QUAI' => "Quai",
|
||||
'QUA' => "Quartier",
|
||||
'RAC' => "Raccourci",
|
||||
'RAID' => "Raidillon",
|
||||
'RPE' => "Rampe",
|
||||
'REM' => "Rempart",
|
||||
'RES' => "Résidence",
|
||||
'ROC' => "Roc",
|
||||
'ROC' => "Rocade",
|
||||
'RPT' => "Rond point",
|
||||
'ROQT' => "Roquet",
|
||||
'RTD' => "Rotonde",
|
||||
'RTE' => "Route",
|
||||
'R' => "Rue",
|
||||
'RUE' => "Rue",
|
||||
'RLE' => "Ruelle",
|
||||
'SEN' => "Sente",
|
||||
'SEN' => "Sentier",
|
||||
'SQ' => "Square",
|
||||
'STDE' => "Stade",
|
||||
'STA' => "Station",
|
||||
'TPL' => "Terre plein",
|
||||
'TRN' => "Terrain",
|
||||
'TSSE' => "Terrasse",
|
||||
'TRT' => "Tertre",
|
||||
'TOUR' => "Tour",
|
||||
'TRA' => "Traverse",
|
||||
'VAL' => "Vallon",
|
||||
'VAL' => "Vallée",
|
||||
'VEN' => "Venelle",
|
||||
'VIA' => "Via",
|
||||
'VTE' => "Vieille route",
|
||||
'VCHE' => "Vieux chemin",
|
||||
'VLA' => "Villa",
|
||||
'VGE' => "Village",
|
||||
'VLGE' => "Village",
|
||||
'VOI' => "Voie",
|
||||
'VOIE' => "Voie",
|
||||
'ZONE' => "Zone",
|
||||
'ZAC' => "Zone d'aménagement concerté",
|
||||
'Z A C' => "Zone d'aménagement concerté",
|
||||
'ZAD' => "Zone d'aménagement différé",
|
||||
'Z A D' => "Zone d'aménagement différé",
|
||||
'ZA' => "Zone artisanale",
|
||||
'Z A' => "Zone artisanale",
|
||||
'ZI' => "Zone industrielle",
|
||||
'Z I' => "Zone industrielle",
|
||||
'ZUP' => "Zone à urbaniser en priorité",
|
||||
'Z U P' => "Zone à urbaniser en priorité",
|
||||
);
|
||||
|
||||
$str='codVoie'.$sep.'libVoie'.$eol;
|
||||
foreach ($tabCodeVoie as $k => $v) {
|
||||
$str.=$k.$sep.$v.$eol;
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,354 +0,0 @@
|
||||
<?php
|
||||
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
class MGlobal {
|
||||
|
||||
function __construct($siren) {
|
||||
|
||||
$timeout=5;
|
||||
|
||||
$c_cof = curl_init();
|
||||
$c_soc = curl_init();
|
||||
$c_pou = curl_init();
|
||||
|
||||
// Définit l'URL ainsi que d'autres options
|
||||
curl_setopt($c_cof, CURLOPT_URL, 'http://www.cofacerating.fr/portail/entreprise_identite/identite.asp?ip=pagespro&lg=fr&nsiren='.$siren);
|
||||
curl_setopt($c_cof, CURLOPT_HEADER, 0);
|
||||
curl_setopt($c_cof, CURLOPT_TIMEOUT, $timeout);
|
||||
curl_setopt($c_cof, CURLOPT_REFERER, '');
|
||||
|
||||
curl_setopt($ch2, CURLOPT_URL, "http://www.php.net/");
|
||||
curl_setopt($ch2, CURLOPT_HEADER, 0);
|
||||
|
||||
// Création du gestionnaire multiple
|
||||
$mh = curl_multi_init();
|
||||
|
||||
// Ajoute les deux gestionnaires
|
||||
curl_multi_add_handle($mh,$ch1);
|
||||
curl_multi_add_handle($mh,$ch2);
|
||||
|
||||
$running=null;
|
||||
// Exécute le gestionnaire
|
||||
do {
|
||||
curl_multi_exec($mh,$running);
|
||||
} while($running > 0);
|
||||
|
||||
// Ferme tous les gestionnaires
|
||||
curl_multi_remove_handle($ch1);
|
||||
curl_multi_remove_handle($ch2);
|
||||
curl_multi_close($mh);
|
||||
|
||||
|
||||
$referer='';
|
||||
$url='http://www.cofacerating.fr/portail/entreprise_identite/identite.asp?ip=pagespro&lg=fr&nsiren='.$siren;
|
||||
$page=getUrl($url, '', '', $referer, false, 'www.cofacerating.fr', '', 10);
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->nscrl=@getTextInHtml($this->body, '&nscrl=', '=','&');
|
||||
$this->rSocAdrCPVille=trim(str_replace(chr(160), ' ', html_entity_decode(utf8_encode(@getTextInHtml($this->body, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne"> <b> Raison sociale<br>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval"><b>','</tr>')))));
|
||||
$tmp=explode('<br>', $this->rSocAdrCPVille);
|
||||
$this->raisonSociale=trim($tmp[0]);
|
||||
unset($tmp[0]);
|
||||
$this->adresse=trim(strip_tags(implode(',', $tmp)));
|
||||
$this->tel=trim(@getTextInHtml($this->body, '<td bgcolor="#F3E5CC" class="tabligne"><b>Téléphone<br>', '<td bgcolor="#FFF3DE" class="tabval" valign="top">', '<br>'));
|
||||
$this->fax=trim(@getTextInHtml($this->body, 'Télécopie</b></td>', '<br>', '</td>'));
|
||||
$this->web=trim(@getTextInHtml($this->body, '<td bgcolor="#F3E5CC" class="tabligne"><b>Adresse internet <br>', ' class="tabval"><a class="tabval" HREF="', '" target="_new">'));
|
||||
$this->mail=trim(@getTextInHtml($this->body, '<a class="tabval" href="mailto:', ':', '">'));
|
||||
|
||||
$bourse=trim(@getTextInHtml($this->body, 'Ville Bourse</b></td>', 'class="tabval">', '</td>'));
|
||||
$tmp=explode('<br>', $bourse);
|
||||
$this->bourseIsin=trim($tmp[0]);
|
||||
$this->bourseMarche=trim($tmp[1]);
|
||||
$this->bourseVille=trim($tmp[2]);
|
||||
|
||||
$infosDispo=trim(@getTextInHtml($this->body, '<b>Liste Produits</b><br></td>', '<br></td><td class="menu3"><img src="../images/vide.gif" border="0"><br></td><td colspan="2" class="menu3">', 'Un secteur ou une région en France</a><br></td>'));
|
||||
$tabTmp=explode('<a href="', $infosDispo);
|
||||
foreach ($tabTmp as $k=>$lien) {
|
||||
preg_match('/^(.*)">(.*)<\/a>/i', $lien, $matches);
|
||||
if ($matches[2]<>'') $this->tabInfos[$matches[2]]=$matches[1];
|
||||
if (substr($matches[2], 0, 12)=='rapport éco.') $this->infoEco='http://www.cofacerating.fr/portail/entreprise_identite/'.$matches[1];//ip=pagespro&
|
||||
elseif (substr($matches[2], 0, 6)=='bilan ') $this->tabBilans[]=substr($matches[2], 6,strlen($matches[2])-6);
|
||||
}
|
||||
$this->activite=trim(str_replace(chr(160), ' ', html_entity_decode(utf8_encode(@getTextInHtml($this->body, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne" valign="top"><b>Libellé code activité </b></td>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval">', '</td>')))));
|
||||
$this->naf=trim(@getTextInHtml($this->body, '<a href="../chaineeco_dynaeco/DynaEco.asp?cnaf=', 'cnaf=', '&'));
|
||||
|
||||
/**
|
||||
** Recherche du NIC sur Société .com
|
||||
**/
|
||||
|
||||
/*
|
||||
$refererS='http://www.societe.com/';
|
||||
$urlS='http://www.societe.com/cgi-bin/recherche?rncs='.$siren.'&vu=1';
|
||||
$page=getUrl($urlS, '', '', $refererS, false, 'www.societe.com');
|
||||
$ste=$page['body'];
|
||||
$this->nic=trim(@getTextInHtml($ste, 'SIRET</div><div class="ficheAltCol2 size11">', $siren, '</div>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<b><span class="size10">RCS', 'RCS ', ' '.substr($siren,0,3)));
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->rcsVille=$tabTmp[0];//<td class="txtBlanc" align="left"><b><span class="size10">RCS Paris B 552 144 503<br></span></b></td>
|
||||
$this->rcsType=$tabTmp[1];
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Code activité</div>', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$tabTmp=explode(' - ', $strTmp);
|
||||
$this->naf=$tabTmp[0];
|
||||
$this->nafLib=$tabTmp[1];
|
||||
|
||||
// <div class="ficheAltCol1 size11">Siège social</div><div class="ficheAltCol2 size11">75 Avenue la Grande Armee - 75116 PARIS 16</div>
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Capital social', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$this->capitalType='social';
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->capitalMontant=str_replace(',', '.', str_replace('.', '', $tabTmp[0]));
|
||||
$this->capitalDevise =$tabTmp[1];
|
||||
|
||||
$this->fj=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Forme juridique', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
$this->nationalite=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11">Nationalité</div>', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($ste, ' DIRIGEANT(S) </span></span></div>', '<div class="ficheCadre" style="min-height:85px;">', '<div class="spacer"></div>'));
|
||||
$tabTmp=explode('<div class="h1bleu2"></div>', $strTmp);
|
||||
foreach ($tabTmp as $k=>$dir) {
|
||||
if (trim($dir)=='') break;
|
||||
$tabTmp1=explode('</div><div class="ficheAltCol2 size11">', $dir);
|
||||
$tabTmp2=explode('représenté par', $tabTmp1[1]);
|
||||
if (isset($tabTmp2[1]) && $tabTmp2[1]<>'') {
|
||||
$soc=trim($tabTmp2[0]);
|
||||
$diri=trim($tabTmp2[1]);
|
||||
} else {
|
||||
$soc='';
|
||||
$diri=trim($tabTmp1[1]);
|
||||
}
|
||||
preg_match("/^(Mme|M\.|Mlle|Mle|M) ([A-Z\s]*) ([A-Z][a-z\s]*)/", $diri, $matches);
|
||||
//print_r($matches);
|
||||
$this->tabDirigeants[]=array('FONCTION'=>trim(strip_tags($tabTmp1[0])), 'SOCIETE'=>$soc, 'GENRE'=>$matches[1], 'PRENOM'=>trim($matches[3]), 'NOM'=>trim($matches[2]));
|
||||
}
|
||||
|
||||
$this->dateImmatriculation=trim(@getTextInHtml($ste, '<div class="ficheAltCol1 size11"> Immatriculation', '<div class="ficheAltCol2 size11">', '</div>'));
|
||||
//06-03-2007</div>
|
||||
/* Date Creation = ""
|
||||
En bourse = ""
|
||||
Effectif societe = ""
|
||||
Dirigeants :
|
||||
**/
|
||||
$urlRacine='http://infobilan.decideur.com/';
|
||||
$tabPost=array( 'choix'=>'1',
|
||||
'pagePrecedente'=>'recherche_entreprise.html',
|
||||
'nomsocRech'=>'',
|
||||
'cpRech'=>'',
|
||||
'villeRech'=>'',
|
||||
'nomdirRech'=>'',
|
||||
'predirRech'=>'',
|
||||
'sirenRech'=>$siren,
|
||||
'telRech'=>'',
|
||||
'Rechercher.x'=>round(79),
|
||||
'Rechercher.y'=>round(19),);
|
||||
$url=$urlRacine.'liste_result.html';
|
||||
$referer=$urlRacine.'recherche_entreprise.html';
|
||||
$page=getUrl($url,'', $tabPost, $referer, false, 'infobilan.decideur.com');
|
||||
$this->body=$page['body'];
|
||||
$strCookie=$page['header']['Set-Cookie'];
|
||||
$refererInfoD=$url;
|
||||
|
||||
if(preg_match_all('/<a href="choix_pdt\.html\?(.*)" class="tt1">(.*)<\/a><\/span><br>/i', $page['body'], $matches))
|
||||
$urlInfoD=$urlRacine.'choix_pdt.html?'.$matches[1][0];
|
||||
else
|
||||
$urlInfoD='';
|
||||
|
||||
$page=getUrl($this->infoEco, '', '', $url, false, 'www.cofacerating.fr');
|
||||
if (strpos($page['body'], '<b>Choix du mode de paiement</b>')===false) { // Le rapport éco. est cadeau !!!
|
||||
$this->infoEco=true;
|
||||
$eco=$page['body'];
|
||||
//die ($eco);
|
||||
$strTmp=strip_tags(@getTextInHtml($eco, ' class="tabligne" > Capital   (', '(', '</tr><tr>'));
|
||||
$tabTmp=explode(')', $strTmp);
|
||||
$this->capitalType=$tabTmp[0];
|
||||
$tabTmp=explode(' ', $tabTmp[1]);
|
||||
$this->capitalMontant=trim(str_replace(chr(160), '', $tabTmp[0]));
|
||||
$this->capitalDevise =trim(str_replace(chr(160), '', $tabTmp[1]));
|
||||
|
||||
$this->steInactive=trim(@getTextInHtml($eco, ' class="tabligne" > Société inactive</td>', 'class="tabval" >', '</td>'));
|
||||
|
||||
$this->dateCreation=trim(@getTextInHtml($eco, ' class="tabligne" > Date de création</td>', 'class="tabval" >', '</td>'));
|
||||
$this->fj=trim(@getTextInHtml($eco, ' class="tabligne" > Forme juridique</td>', 'class="tabval" >', '</td>'));
|
||||
$this->effectif=trim(@getTextInHtml($eco, ' class="tabligne" > Effectif', 'class="tabval" >', '</td>'));
|
||||
|
||||
if (count($this->tabDirigeants)==0) { // Si il y a déjà des dirigeants on garde ceux de Société.com !!!
|
||||
$strTmp=trim(@getTextInHtml($eco, ' class="tabligne" > Cotation en bourse</td>', '<td bgcolor="#F3E5CC" class="tabligne" >', '<td bgcolor="#F3E5CC" class="tabligne" > Effectif'));
|
||||
$tabTmp=explode('<td bgcolor="#F3E5CC" class="tabligne" >', $strTmp);
|
||||
foreach ($tabTmp as $k=>$dir) {
|
||||
$tabTmp1=explode('<td bgcolor="#FFF3DE" class="tabval" >', $dir);
|
||||
$tabTmp2=explode(' ', trim(strip_tags($tabTmp1[1])));
|
||||
$this->tabDirigeants[]=array('FONCTION'=>trim(strip_tags($tabTmp1[0])), 'GENRE'=>trim($tabTmp2[0]), 'PRENOM'=>trim($tabTmp2[1]), 'NOM'=>trim($tabTmp2[2]));
|
||||
}
|
||||
}
|
||||
|
||||
$this->strLiensFi=trim(strip_tags(@getTextInHtml($eco, '<td class="tabtot">LIENS FINANCIERS</td>', '<tr>', '</td></tr>')));
|
||||
$this->strElemsFi=trim(strip_tags(@getTextInHtml($eco, '<td class="tabtot">ELEMENTS FINANCIERS</td>', '<tr>', '</td></tr>')));
|
||||
}
|
||||
|
||||
$refererP='http://www.score3.fr/';
|
||||
$urlP='http://www.score3.fr/entreprise.shtml?siren='.$siren;
|
||||
$page=getUrl($urlP, '', '', $refererP, false, 'www.score3.fr');
|
||||
$pou=$page['body'];
|
||||
$fp=fopen('./pouet.html', 'w');
|
||||
fwrite($fp, $pou);
|
||||
fclose($fp);
|
||||
|
||||
if ($urlInfoD<>'') {
|
||||
$page=getUrl($urlInfoD,$strCookie,'', $refererInfoD, false, 'infobilan.decideur.com');
|
||||
$referer=$urlInfoD;
|
||||
if ($this->nscrl==0) $this->nscrl=@getTextInHtml($url, 'nscrlP=', '=','&');
|
||||
|
||||
$url=$urlRacine.'fiche_ident.html';
|
||||
$page=getUrl($url,$strCookie,'', $referer, false, 'infobilan.decideur.com');
|
||||
$this->body=$page['body'];
|
||||
|
||||
if ($this->raisonSociale=='')
|
||||
$this->raisonSociale=trim(@getTextInHtml($this->body, '<span class="libelle2">Société', ' :', '</span>'));
|
||||
|
||||
if ($this->adresse=='')
|
||||
$this->adresse=trim(@getTextInHtml($this->body, '<span class="libelle2">Adresse</span> <strong>:', '</strong>', '</td>'));
|
||||
|
||||
if ($this->tel=='')
|
||||
$this->tel=trim(@getTextInHtml($this->body, '<td valign="top"><span class="libelle2">Tél', '</span>', '<br>'));
|
||||
if ($this->fax=='')
|
||||
$this->fax=trim(@getTextInHtml($this->body, '<span class="libelle2">Fax</span>', ' :', '<br>'));
|
||||
if ($this->web=='')
|
||||
$this->web=trim(@getTextInHtml($this->body, '<span class="libelle2">Site Web</span>', '<a href="', '" target="_blank">'));
|
||||
if ($this->mail=='')
|
||||
$this->mail=trim(@getTextInHtml($this->body, '<span class="libelle2">E-mail</span>', '<a href="mailto:', '">'));
|
||||
if ($this->naf=='')
|
||||
$this->naf=trim(@getTextInHtml($this->body, '<span class="libelle2">Code NAF</span>', ' :', '</td>'));
|
||||
|
||||
if(preg_match('/<td valign="top"><span class="libelle2">Capital social<\/span> : (\d*)(.*)<br>/isU', $this->body, $matches)
|
||||
&& ($this->capitalMontant=='' || $this->capitalDevise=='')) {
|
||||
$this->capitalMontant=trim($matches[1]);
|
||||
$this->capitalDevise=trim($matches[2]);
|
||||
}
|
||||
|
||||
if ($this->fj=='')
|
||||
$this->fj=trim(@getTextInHtml($this->body, '<span class="libelle2">Forme juridique</span>', ' :', '<br>'));
|
||||
if ($this->nationalite=='')
|
||||
$this->nationalite=trim(@getTextInHtml($this->body, '<span class="libelle2">Nationalité</span>', ' :', '</td>'));
|
||||
if ($this->effectif=='')
|
||||
$this->effectif=trim(@getTextInHtml($this->body, '<td valign="top"><span class="libelle2">Effectif</span>', ' :', '<br>'));
|
||||
if ($this->activite=='')
|
||||
$this->activite=trim(@getTextInHtml($this->body, '<span class="libelle2">Activité</span>', ' :', '<br>'));
|
||||
|
||||
/** Actionnaires **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, 'ACTIONNAIRES<br>', '</div></h1>', '<h1>'));
|
||||
if(preg_match_all('/<p><span class="libelle2">(.*)<\/span> - <span class="libelle2">Participation<\/span> : (.*) %<br>(.*)<\/p>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nom) {
|
||||
$this->tabAct[$i]['nom']=trim($nom);
|
||||
$this->tabAct[$i]['pct']=trim($matches[2][$i]);
|
||||
$this->tabAct[$i]['rcs']=trim(str_replace('RCS : ','',strip_tags($matches[3][$i])));
|
||||
}
|
||||
}
|
||||
|
||||
/** Filiales **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, 'FILIALES<br>', '</div></h1>', '<h1>'));
|
||||
if(preg_match_all('/<p><span class="libelle2">(.*)<\/span> - <span class="libelle2">Participation<\/span> :(.*)%<br>(.*)<\/p>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nom) {
|
||||
$this->tabFil[$i]['nom']=trim($nom);
|
||||
$this->tabFil[$i]['pct']=trim($matches[2][$i]);
|
||||
$this->tabFil[$i]['rcs']=trim(str_replace('RCS :','',strip_tags($matches[3][$i])));
|
||||
}
|
||||
}
|
||||
|
||||
/** CA et Résultat **/
|
||||
$strTmp=trim(@getTextInHtml($this->body, '<h1>PRINCIPAUX ELEMENTS FINANCIERS<br>', '</div></h1>', '</p>'));
|
||||
if(preg_match('/<p><span class="libelle2">CA (.*)<\/span>(.*)<br>/isU', $strTmp, $matches)) {
|
||||
$this->derExerciceAnnee=trim($matches[1]);
|
||||
$this->derExerciceCA=trim(str_replace(':',' ', $matches[2]));
|
||||
}
|
||||
if(preg_match('/<span class="libelle2">Résultat(.*)<\/span>(.*)$/isU', $strTmp, $matches)) {
|
||||
$this->derExerciceResultat=trim(str_replace(':',' ', $matches[2]));
|
||||
}
|
||||
|
||||
$infoBilan=print_r($page, true);
|
||||
$fp=fopen('./infobilan.html', 'w');
|
||||
fwrite($fp, $infoBilan);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($this->nbEtab=='' || $this->nbEtab=='0') {
|
||||
$this->nbEtab=trim(strip_tags(str_replace('afficher la liste...', '', @getTextInHtml($pou, '<tr><td class="ligne1_2">Etablissements </td>', '<td class="ligne2_2">', '</td></tr>'))));
|
||||
$urlPEtab='http://www.score3.fr/etablissements.shtml?page=1&siren='.$siren;
|
||||
$refererPEtab=$urlP;
|
||||
$page=getUrl($urlPEtab, '', '', $refererPEtab, false, 'www.score3.fr');
|
||||
$pou2=$page['body'];
|
||||
if(preg_match_all('/<tr bgcolor="(?:\S*)"><td class="ligne1b" align="center" width="10%">(\d*)<\/td><td class="ligne2" height="50"><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td class="infos">(.*)<\/td><\/tr><\/table>/isU', $pou2, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nic) {
|
||||
$strEtab=$matches[2][$i];
|
||||
$this->tabEtab[$i]['siren']=$siren;
|
||||
$this->tabEtab[$i]['nic']=$nic;
|
||||
$this->tabEtab[$i]['siret']=$siren.$nic;
|
||||
|
||||
$this->tabEtab[$i]['enseigne']=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="titre3">', '">', '</span>')))));
|
||||
$this->tabEtab[$i]['adresse']=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="infos">', '">', '<br>')))));
|
||||
$strTmp=trim(str_replace(chr(160),' ',utf8_decode(strip_tags(@getTextInHtml($strEtab, '<span class="infos">', '<br>', '</span>')))));
|
||||
$tabTmp=explode(' ', $strTmp);
|
||||
$this->tabEtab[$i]['cp']=$tabTmp[0];
|
||||
unset($tabTmp[0]);
|
||||
$this->tabEtab[$i]['ville']=implode(' ',$tabTmp);
|
||||
$strTmp=trim(strip_tags(@getTextInHtml($strEtab, '<td class="infos" align="right" valign="top">', '">', ')')));
|
||||
$tabTmp=explode('(', $strTmp);
|
||||
$this->tabEtab[$i]['naf_code']=$tabTmp[1];
|
||||
$this->tabEtab[$i]['naf_lib']=trim(str_replace(chr(160),' ',utf8_decode($tabTmp[0])));
|
||||
if (preg_match('/<br>T.l\.(.*)$/i',$strEtab,$matches2))
|
||||
$this->tabEtab[$i]['tel']=trim(str_replace(chr(160),' ',utf8_decode($matches2[1])));
|
||||
else $this->tabEtab[$i]['tel']='';
|
||||
}
|
||||
}
|
||||
$this->nbEtab=count($this->tabEtab);
|
||||
$fp=fopen('./pouet_etab.html', 'w');
|
||||
fwrite($fp, $pou2);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
if ($this->effectif=='' || $this->effectif=='0' || $this->effectif=='NC')
|
||||
$this->effectif=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Effectifs</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->dateImmatriculation=='' || $this->dateImmatriculation=='0')
|
||||
$this->dateImmatriculation=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Date d\'immatriculation</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
if ($this->dateFermeture=='' || $this->dateFermeture=='0')
|
||||
$this->dateFermeture=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Date de fin d\'exploitation</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->tel=='' || $this->tel=='0')
|
||||
$this->tel=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Téléphone</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
if ($this->fax=='' || $this->fax=='0')
|
||||
$this->fax=trim(@getTextInHtml($pou, '<tr><td class="ligne1_2">Fax</td>', '<td class="ligne2_2">', '</td></tr>'));
|
||||
|
||||
$strTmp=trim(@getTextInHtml($pou, 'Procédures collectives</td></tr>', '</table></td>', '</td><td background'));
|
||||
if(preg_match_all('/<tr><td class="ligne1_2">(.*)<\/td><td class="ligne2_2">(.*)<\/td><\/tr>/isU', $strTmp, $matches)) {
|
||||
foreach ($matches[1] as $i=>$jug) {
|
||||
$this->tabJug[$i]['date']=$matches[1][$i];
|
||||
$this->tabJug[$i]['juge']=$matches[2][$i];
|
||||
}
|
||||
}
|
||||
|
||||
$this->score_pouey=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=pouey&valeur=', '">'));
|
||||
$this->score_conan=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=ch&valeur=', '">'));
|
||||
$this->score_afdcc=trim(@getTextInHtml($pou, '<param name="movie" value="cadran.swf?rotation=', '&type=afdcc&valeur=', '">'));
|
||||
$this->vigilance =trim(@getTextInHtml($pou, '<param name="movie" value="vigilance.swf', 'degre=', '">'));
|
||||
|
||||
if(preg_match('/Date de l\'exercice<\/td><td class="ligne2_2">(.*) sur (\d*) mois<\/td><\/tr>/isU', $pou, $matches)) {
|
||||
$this->derExerciceDClot=trim($matches[1]);
|
||||
$this->derExerciceDuree=trim($matches[2]);
|
||||
}
|
||||
|
||||
/* Siret SIEGE
|
||||
2 Fonction, Nom Prénoù ET Date NAissance du PP
|
||||
5 Liste des actes
|
||||
*/
|
||||
if ($this->codeRetour==200)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -1,365 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/common/curl.php';
|
||||
/** @todo A faire et sortir du coup la méthode de commande d'enquêtes du WS **/
|
||||
class MIntersud {
|
||||
|
||||
private $body = '';
|
||||
private $header = '';
|
||||
private $codeRetour = 0;
|
||||
private $cookie=false;
|
||||
private $reference = 0;
|
||||
private $timeOut=0;
|
||||
private $url='';
|
||||
private $urlRacine='http://www.intersud.fr';
|
||||
private $referer='';
|
||||
private $curPage='';
|
||||
public $siren;
|
||||
|
||||
function __construct() {
|
||||
$this->partGetSession();
|
||||
$this->partConnection();
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
$this->partSaveSession();
|
||||
}
|
||||
|
||||
function getInfosDisponbiles($siren) {
|
||||
$this->siren=$siren;
|
||||
$this->partConnection();
|
||||
return $this->partVitrine(true);
|
||||
}
|
||||
|
||||
private function partConnection() {
|
||||
if (!$this->wrncsrv2 || time()>$this->timeOut) {
|
||||
$this->timeOut=time()+900;
|
||||
|
||||
$this->url=$this->urlRacine.'/index.ow';
|
||||
$page=getUrl($this->url, '', '', $this->urlRacine, false, 'www.euridile.com');
|
||||
$this->referer=$this->url;
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
//echo date('Y/m/d - H:i:s') ." - Initialisation URL = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||||
$fp=fopen('./euridile_connexion1.log', 'w');
|
||||
fwrite($fp,print_r($page,true));
|
||||
fclose($fp);
|
||||
if (preg_match('/<META HTTP-EQUIV="Refresh" CONTENT="0; URL=(.*)">/i', $this->body, $matches))
|
||||
$this->url=$this->urlRacine.'/'.$matches[1];
|
||||
else debugLog('E',"Erreur de communication - Redirection impossible sur ".$this->url,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
debugLog('I','Redirection trouv<75>e sur la page '.$this->url,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
|
||||
if (preg_match('/\.ow\?WRNCSRV2=(.*)$/i', $matches[1], $matches)) {
|
||||
$this->wrncsrv2=$matches[1];
|
||||
debugLog('I','Session partenaire WRNCSRV2='.$this->wrncsrv2,__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
}
|
||||
else debugLog('E','Impossible d\'identifier le num<75>ro de session partenaire',__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
|
||||
$page=getUrl($this->url, '', '',$this->referer, false, 'www.euridile.com');
|
||||
$this->referer=$this->url;
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
debugLog('D',"Page d'accueil URL = $this->url (Code retour = $this->codeRetour)",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
$fp=fopen('./euridile_connexion2.log', 'w');
|
||||
fwrite($fp,print_r($page,true));
|
||||
fclose($fp);
|
||||
|
||||
if (preg_match('/<form method="POST" name="abonnement" ACTION="(.*)" /i', $this->body, $matches)) {
|
||||
$postData=array('IDENT'=>'OK',
|
||||
'MDP'=>'3180',
|
||||
'cliref'=>'K5K3X5',
|
||||
'PASS'=>'3180',
|
||||
'WRNCSRV2'=>$this->wrncsrv2);
|
||||
/** @todo Fair une fonction qui g<EFBFBD>re les URL commen<EFBFBD>ant par ./ ou ../ ou / afin de pouvoir les concatener
|
||||
**/
|
||||
$this->url=$this->urlRacine.str_replace('..','',$matches[1]);
|
||||
debugLog('D',"Authentification possible vers $this->url",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
}
|
||||
else debugLog('E',"Authentification impossible car formulaire indisponible",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
|
||||
sleep(1);
|
||||
$page=getUrl($this->url,'', $postData, $this->referer, false, 'www.euridile.com');
|
||||
$this->referer=$this->url;
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
//echo date('Y/m/d - H:i:s') ." - Apr<70>s authentification = $this->url (Code retour = $this->codeRetour)<br/>".EOL;
|
||||
$fp=fopen('./euridile_connexion3.log', 'w');
|
||||
fwrite($fp,print_r($page,true));
|
||||
fclose($fp);
|
||||
|
||||
if(preg_match('/\/'.$this->weur.'\/iden_evaluation_type_(.*)/i', $this->body, $matches))
|
||||
{ $tabTmp=explode('"', $matches[0]);
|
||||
$this->url=$this->urlRacine.$tabTmp[0];
|
||||
debugLog('D',"Page de recherche recherche trouv<75>e = $this->url>",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
} else debugLog('E',"Erreur de communication - Recherche introuvable !",__LINE__,__FILE__,__FUNCTION__,__CLASS__);
|
||||
|
||||
$this->curPage='recherche';
|
||||
} //else echo date('Y/m/d - H:i:s') ." - Deja connecte !<br/>".EOL;
|
||||
return true;
|
||||
}
|
||||
|
||||
private function partIdentite() {
|
||||
if ($this->curPage<>'vitrine')
|
||||
$this->partVitrine();
|
||||
|
||||
$iDb=new WDB();
|
||||
$ret=$iDb->select( 'jo.rncs_entrep',
|
||||
'siren, rcs, nom, adresse1, adresse2, adresse3, cp, ville, naiss_date, naiss_lieu, sexe, enseigne, sigle, '.
|
||||
'fj_lib, naf_code, naf_lib, date_crea, date_imma, greffe, num_gestion, capital_mnt, capital_dev, nationalite, '.
|
||||
'nb_etab, indRadiation, date_radiation, indProcol, dateUpdate, procedures, dirigeants, etablissements',
|
||||
"siren=$this->siren ORDER BY dateUpdate DESC LIMIT 0,1", false, MYSQL_ASSOC);
|
||||
if (count($ret)) {
|
||||
/** On v<EFBFBD>rifie qu'aucune annonce n'a <EFBFBD>t<EFBFBD> publi<EFBFBD> depuis au bodacc
|
||||
**/
|
||||
$tabRet=$ret[0];
|
||||
$ret=$iDb->select( 'jo.bodacc_detail', 'count(*)',
|
||||
"siren=$this->siren AND Bodacc_Date_Parution>='".$tabRet['dateUpdate']."'");
|
||||
if ($ret[0][0]==0) {
|
||||
$tabRet['procedures']=unserialize($tabRet['procedures']);
|
||||
$tabRet['dirigeants']=unserialize($tabRet['dirigeants']);
|
||||
$tabRet['etablissements']=unserialize($tabRet['etablissements']);
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
$url=$this->urlRacine.'/'.$this->weur.'/paie_abonnes_livraison_directe_informations.ow?flag_type_acces_direct_infos=FIC&WRNCSRV2='.$this->wrncsrv2;
|
||||
$page=getUrl($url, '', '', $this->referer, false, 'www.euridile.com');
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
//echo date('Y/m/d - H:i:s') ." - Fiche d'identit<69> = $url (Code retour = $this->codeRetour)<br/>".EOL;
|
||||
//$this->curPage='vitrine';
|
||||
$tabRet=array();
|
||||
|
||||
/**@todo Traiter le cas donn<EFBFBD>es provisoires :
|
||||
<TR><TD bgcolor='#fff0d0'><FONT COLOR=#100070 FACE=ARIAL SIZE=2><B><!-- Donn<6E>es provisoires --> En cours d'immatriculation, donn<6E>es provisoires</B></FONT></TD></TR><TR><TD bgcolor=#fff0d0><FONT COLOR=#100070 FACE=ARIAL SIZE=2>Nombre d'<27>tablissements : <FONT COLOR=#100070 FACE=ARIAL SIZE=2><B></B></TD></TR>
|
||||
</TABLE>
|
||||
*/
|
||||
// Identit<69>
|
||||
$tabRet['siren']=$this->siren;
|
||||
$tabRet['codeRetour']=$this->codeRetour;
|
||||
$tabRet['rcs']=@getTextInHtml($this->body, 'FACE="ARIAL,HELVETICA" SIZE=2>RCS : ', '<b>','</b>');
|
||||
$strTmp=@getTextInHtml($this->body, 'FACE="ARIAL,HELVETICA" SIZE=2>RCS : <b>', 'FACE="ARIAL,HELVETICA" SIZE=2><b>', '<img src=\'images/rouge.gif\'');
|
||||
$tabTmp=explode('</TD>', $strTmp);
|
||||
$tabRet['nom']=strip_tags($tabTmp[0]);
|
||||
// ... adresse
|
||||
for ($i=1; $i<5; $i++) {
|
||||
if (strpos($tabTmp[$i], 'Nom commercial - Enseigne :')===false &&
|
||||
strpos($tabTmp[$i], 'Sigle :')===false ) {
|
||||
$ligne=trim(strip_tags($tabTmp[$i]));
|
||||
if (preg_match("/^([0-9]{5,5})([\D]*)/i", $ligne, $matches)) {
|
||||
$tabRet['cp']=trim($matches[1]);
|
||||
$tabRet['ville']=trim($matches[2]);
|
||||
break;
|
||||
} else $tabRet['adresse'.$i]=$ligne;
|
||||
}
|
||||
}
|
||||
|
||||
$pp_nais=trim(strip_tags(@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Date et lieu de naissance :', '<B>','</B>')));
|
||||
$tabTmp=explode(' <20> ', $pp_nais);
|
||||
$tabRet['naiss_date']=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp[0])));
|
||||
$tabRet['naiss_lieu']=trim(strip_tags($tabTmp[1]));
|
||||
$tabRet['sexe']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Sexe :', '<B>','</B>')));
|
||||
|
||||
$tabRet['enseigne']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nom commercial - Enseigne :', '<B>','</B>')));
|
||||
$tabRet['sigle']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Sigle :', '<B>','</B>')));
|
||||
$tabRet['fj_lib']=@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Forme juridique :', '<B>','</B>');
|
||||
$strTmp=@getTextInHtml($this->body, 'FACE=\'ARIAL,HELVETICA\' SIZE=2>Activité :', '<B>','</B>');
|
||||
$tabTmp=explode(' - ', $strTmp);
|
||||
$tabRet['naf_code']=$tabTmp[0];
|
||||
$tabRet['naf_lib']=$tabTmp[1];
|
||||
$tabRet['date_crea']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Date de création :', '<B>','</B>')));
|
||||
$tabRet['date_imma']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Date d\'immatriculation :', '<B>','</B>')));
|
||||
$tabRet['greffe']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Greffe :', '<B>','</B>')));
|
||||
$tabRet['num_gestion']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>N<>de gestion :', '<B>','</B>')));
|
||||
$strTmp=@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Capital :', '<B>','</B>');
|
||||
if (preg_match('/([0-9\.,\s]*)([\D]*)/i', $strTmp, $matches)) {
|
||||
$tabRet['capital_mnt']=trim(str_replace(' ','',str_replace(',','.',$matches[1])));
|
||||
$tabRet['capital_dev']=$matches[2];
|
||||
}
|
||||
else {
|
||||
$tabRet['capital_mnt']=0;
|
||||
$tabRet['capital_dev']='';
|
||||
}
|
||||
$tabRet['nationalite']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nationalité :', '<B>','</B>')));
|
||||
$tabRet['nb_etab']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Nombre d\'<27>tablissements :', '<B>','</B>')));
|
||||
if (strpos($this->body,'FACE=ARIAL SIZE=2><B>Radiation</B>')>0) {
|
||||
$tabRet['indRadiation']=true;
|
||||
$tabRet['date_radiation']=trim(strip_tags(@getTextInHtml($this->body, 'FACE=ARIAL SIZE=2>Entreprise radi<64>e le :', '<B>','</B>')));
|
||||
} else
|
||||
$tabRet['indRadiation']=false;
|
||||
|
||||
// Proc<6F>dures collectives
|
||||
if (strpos($this->body,'FACE=ARIAL SIZE=2><B>Les proc<6F>dures collectives</B>')>0) {
|
||||
$tabRet['indProcol']=true;
|
||||
$strTmp=@getTextInHtml($this->body, '<B>Les proc<6F>dures collectives</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",
|
||||
'</TABLE>');
|
||||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||||
foreach ($tabTmp as $nproc=>$proc) {
|
||||
$tabTmp2=explode('</TD></TR>', $proc);
|
||||
$tabTmp3=explode(' du ', $tabTmp2[0]);
|
||||
$tabTmp2=explode('<TD WIDTH=99% ALIGN=LEFT BGCOLOR=#fff0d0 colspan=2><FONT COLOR=#100070 FACE=ARIAL SIZE=2>', $proc);
|
||||
$tabInter=array();
|
||||
for($nInter=1; isset($tabTmp2[$nInter]); $nInter++) {
|
||||
$tabTmp4=explode('</TD></TR>', $tabTmp2[$nInter]);
|
||||
$tabInter[]=array( 'type'=>trim(strip_tags($tabTmp4[0])),
|
||||
'nom'=>trim(str_replace(' ','',strip_tags($tabTmp4[1]))),
|
||||
'adresse'=>trim(str_replace(' ','',strip_tags($tabTmp4[2]))),
|
||||
'cpVille'=>trim(str_replace(' ','',strip_tags($tabTmp4[3]))));
|
||||
}
|
||||
$tabRet['procedures'][$nproc]=array('type'=>trim(strip_tags($tabTmp3[0])),
|
||||
'date'=>trim(strip_tags($tabTmp3[1])),
|
||||
'intervenant'=>$tabInter);
|
||||
}
|
||||
}
|
||||
else $tabRet['indProcol']=false;
|
||||
|
||||
// Dirigeants
|
||||
$strTmp=@getTextInHtml($this->body, '<B>Les dirigeants</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>');
|
||||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||||
foreach ($tabTmp as $ndir=>$dir) {
|
||||
$tabTmp2=explode('</TD>', $dir);
|
||||
$tabTmp3=explode('</B> ', $tabTmp2[1]);
|
||||
$nom=trim(strip_tags($tabTmp3[0]));
|
||||
$prenom=trim(strip_tags($tabTmp3[1]));
|
||||
$naiss=trim(strip_tags($tabTmp2[3]));
|
||||
if (strpos($naiss, 'N<>(e) le')===false) {
|
||||
$fonction=$naiss;
|
||||
} else {
|
||||
$tabTmp3=explode(' <20> ', $naiss);
|
||||
$naiss_date=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp3[0])));
|
||||
$naiss=trim(strip_tags($tabTmp3[1]));
|
||||
$tabTmp3=explode('(', $naiss);
|
||||
$naiss_ville=trim(strip_tags($tabTmp3[0]));
|
||||
$naiss_depPays=trim(str_replace(')','', strip_tags($tabTmp3[1])));
|
||||
$fonction=trim(strip_tags($tabTmp2[5]));
|
||||
}
|
||||
$tabTmp=explode(' n<>e ', $prenom);
|
||||
$prenom=$tabTmp[0];
|
||||
$naiss_nom=$tabTmp[1];
|
||||
$tabRet['dirigeants'][$ndir]=array( 'nom'=>$nom,
|
||||
'prenom'=>$prenom,
|
||||
'naiss_nom'=>$naiss_nom,
|
||||
'naiss_date'=>$naiss_date,
|
||||
'naiss_ville'=>$naiss_ville,
|
||||
'naiss_depPays'=>$naiss_depPays,
|
||||
'fonction'=>$fonction);
|
||||
}
|
||||
|
||||
// Dirigeants - Administrateurs
|
||||
$strTmp=trim(@getTextInHtml($this->body, '<B>Les administrateurs</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>'));
|
||||
if ($strTmp<>'') {
|
||||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||||
foreach ($tabTmp as $nadm=>$dir) {
|
||||
$tabTmp2=explode('</TD>', $dir);
|
||||
$tabTmp3=explode('</B> ', $tabTmp2[1]);
|
||||
$nom=trim(strip_tags($tabTmp3[0]));
|
||||
$prenom=trim(strip_tags($tabTmp3[1]));
|
||||
$naiss=trim(strip_tags($tabTmp2[3]));
|
||||
if (strpos($naiss, 'N<>(e) le')===false) {
|
||||
$naiss_date=$naiss_ville=$naiss_depPays='';
|
||||
$fonction=$naiss;
|
||||
} else {
|
||||
$tabTmp3=explode(' <20> ', $naiss);
|
||||
$naiss_date=trim(str_replace('N<>(e) le ', '', strip_tags($tabTmp3[0])));
|
||||
$naiss=trim(strip_tags($tabTmp3[1]));
|
||||
$tabTmp3=explode('(', $naiss);
|
||||
$naiss_ville=trim(strip_tags($tabTmp3[0]));
|
||||
$naiss_depPays=trim(str_replace(')','', strip_tags($tabTmp3[1])));
|
||||
$fonction=trim(strip_tags($tabTmp2[5]));
|
||||
}
|
||||
$tabTmp=explode(' n<>e ', $prenom);
|
||||
$prenom=$tabTmp[0];
|
||||
$naiss_nom=$tabTmp[1];
|
||||
$tabRet['dirigeants'][$nadm+$ndir+1]=array( 'nom'=>$nom,
|
||||
'prenom'=>$prenom,
|
||||
'naiss_nom'=>$naiss_nom,
|
||||
'naiss_date'=>$naiss_date,
|
||||
'naiss_ville'=>$naiss_ville,
|
||||
'naiss_depPays'=>$naiss_depPays,
|
||||
'fonction'=>$fonction);
|
||||
}
|
||||
}
|
||||
|
||||
// Etablissements
|
||||
$strTmp=@getTextInHtml($this->body, '<B>Les <20>tablissements</B></FONT>', "<img src='./images/rouge.gif' width=4 height=4 border='0'>",'</TABLE>');
|
||||
$tabTmp=explode("<img src='./images/rouge.gif' width=4 height=4 border='0'>", $strTmp);
|
||||
foreach ($tabTmp as $netab=>$dir) {
|
||||
$cp=$ville=$ensEtab=''; $j=0;
|
||||
$tabTmp2=explode('</TD>', $dir);
|
||||
for($i=1; $i<=9; $i=$i+2) {
|
||||
$next=$i+2;
|
||||
$strTmp=trim(strip_tags($tabTmp2[$i]));
|
||||
if (preg_match("/^([0-9]{5,5})([\D]*)/i", $strTmp, $matches)) {
|
||||
$adresse[$j]='';
|
||||
$cp=trim($matches[1]);
|
||||
$ville=trim($matches[2]);
|
||||
break;
|
||||
} else
|
||||
$adresse[$j]=$strTmp;
|
||||
|
||||
$j++;
|
||||
}
|
||||
/** Gestion des cas o<> la 1<>re ligne d'adresse contient l'enseigne de l'<27>tablissement */
|
||||
if (strtoupper($adresse[0])==strtoupper($tabRet['enseigne'])) {
|
||||
$ensEtab=$adresse[0];
|
||||
array_shift($adresse);
|
||||
}
|
||||
$strTmp=trim(strip_tags($tabTmp2[$next]));
|
||||
$tabTmp3=explode(' - ', $strTmp);
|
||||
$tabRet['etablissements'][$netab]=array( 'enseigne'=>$ensEtab,
|
||||
'adresse1'=>$adresse[0],
|
||||
'adresse2'=>$adresse[1],
|
||||
'adresse3'=>$adresse[2],
|
||||
'cp'=>$cp,
|
||||
'ville'=>$ville,
|
||||
'naf_code'=>$tabTmp3[0],
|
||||
'naf_lib'=>$tabTmp3[1]);
|
||||
}
|
||||
|
||||
$fp=fopen('./euridile_identite.log', 'w');
|
||||
fwrite($fp,print_r($page,true));
|
||||
fclose($fp);
|
||||
|
||||
$tabInsert=$tabRet;
|
||||
$tabInsert['procedures']=serialize($tabRet['procedures']);
|
||||
$tabInsert['dirigeants']=serialize($tabRet['dirigeants']);
|
||||
$tabInsert['etablissements']=serialize($tabRet['etablissements']);
|
||||
|
||||
$iDb->insert( 'jo.rncs_entrep', $tabInsert);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
private function partSaveSession() {
|
||||
$fp=fopen('/tmp/php_rncs_session.id', 'w');
|
||||
fwrite($fp,$this->wrncsrv2.'^'.$this->timeOut.'^'.$this->curPage.'^'.$this->siren.'^'.$this->url.'^'.$this->referer);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
private function partGetSession() {
|
||||
$strTmp=@file_get_contents('/tmp/php_rncs_session.id');
|
||||
if ($strTmp) {
|
||||
$tabTmp=explode('^', $strTmp);
|
||||
$this->wrncsrv2=$tabTmp[0];
|
||||
$this->timeOut=$tabTmp[1];
|
||||
$this->curPage=$tabTmp[2];
|
||||
$this->siren=$tabTmp[3];
|
||||
$this->url=$tabTmp[4];
|
||||
$this->referer=$tabTmp[5];
|
||||
} else $this->timeOut=0;
|
||||
}
|
||||
|
||||
private function logEuridileError($message) {
|
||||
$fp=fopen('./euridile_error.log', 'w');
|
||||
fwrite($fp,date('Y/m/d H:i:s')." - Erreur : $message (".$this->wrncsrv2.'^'.$this->timeOut.'^'.$this->curPage.'^'.$this->siren.'^'.$this->url.'^'.$this->referer.')'.EOL);
|
||||
fwrite($fp,$this->body.EOL.'-------------------------------------------------------------------------------------'.EOL);
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,289 +0,0 @@
|
||||
<?php
|
||||
class MOrias
|
||||
{
|
||||
private $referer ='';
|
||||
private $body = '';
|
||||
private $header = '';
|
||||
private $cookie = '';
|
||||
private $codeRetour = 0;
|
||||
private $accesDist=true;
|
||||
private $iDb;
|
||||
|
||||
public $enCache=false;
|
||||
public $force=false;
|
||||
public $annee=0;
|
||||
public $erreur='';
|
||||
|
||||
function __construct($accesDist = true, $db = null)
|
||||
{
|
||||
$this->accesDist = $accesDist;
|
||||
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
public function getMaxOrias($annee=0)
|
||||
{
|
||||
if ($annee*1>0 && $annee*1<100) {
|
||||
$this->annee='20'.$annee;
|
||||
$annee++;
|
||||
$strWhere="(numOrias/1000000)<=$annee";
|
||||
} elseif ($annee*1>1900 && $annee*1<9999) {
|
||||
$this->annee=$annee;
|
||||
$annee=substr(''.$annee,2,2)*1+1;
|
||||
$strWhere="(numOrias/1000000)<=$annee";
|
||||
} else {
|
||||
$strWhere='1';
|
||||
$this->annee=date('Y')*1;
|
||||
}
|
||||
|
||||
$ret=$this->iDb->select('sdv1.orias','MAX(numOrias) AS numOrias', $strWhere, false, MYSQL_ASSOC);
|
||||
//die($strWhere);
|
||||
return sprintf('%08d',$ret[0]['numOrias']);
|
||||
}
|
||||
|
||||
public function getInfosOrias($siren, $numOrias=0)
|
||||
{
|
||||
//die('numOrias 1:"'.$numOrias.'"');
|
||||
if ($siren*1>1000)
|
||||
$strWhere="siren=$siren";
|
||||
elseif ($numOrias*1>0) {
|
||||
// $numOrias=preg_replace('/[^0-9]/','',$numOrias);
|
||||
// $numOrias=substr($numOrias,0,2).' '.substr($numOrias,2,3).' '.substr($numOrias,5,3);
|
||||
$strWhere="numOrias=$numOrias";
|
||||
// die($strWhere);
|
||||
//die('numOrias 2:"'.$numOrias.'"');
|
||||
} else return false;
|
||||
|
||||
/* echo "=================================================================================================".EOL;
|
||||
echo "==== SELECT siren, id, nom, cp, ville, adresse, numOrias FROM orias WHERE $strWhere;".EOL;
|
||||
echo "=================================================================================================".EOL;
|
||||
*/
|
||||
$ret=$this->iDb->select('sdv1.orias','siren, id, nom, cp, ville, adresse, numOrias, numOriasAttribue', $strWhere, false, MYSQL_ASSOC);
|
||||
if (!$this->force && count($ret)>0) {
|
||||
$this->enCache=true;
|
||||
$tabRet=$ret[0];//array();
|
||||
$ret=$this->iDb->select('sdv1.orias','categorie, cat, dateInscription, typeStatut, rcsVille, rcsCode, rcsSiren, contact, encaissement, nature, paysPresta, paysEtab',$strWhere, false, MYSQL_ASSOC);
|
||||
foreach ($ret as $i=>$tabTmp)
|
||||
$tabRet['categories'][]=$tabTmp;
|
||||
//die('numOrias 3:"'.$numOrias.'"');
|
||||
} elseif ($this->accesDist==true) {
|
||||
$this->enCache=false;
|
||||
|
||||
// Initialisation Cookies
|
||||
if ($numOrias>0) $this->referer='http://www.orias.fr/orias/public/index.jsp';
|
||||
else $this->referer='http://www.orias.fr/orias/public/rechercheavance.html';
|
||||
$page=getUrl($this->referer, '', '', '', false, '', '', 15);
|
||||
//print_r($page);
|
||||
if ($page['code']==200) {
|
||||
$this->cookie=str_replace(' Path=/orias', '',$page['header']['Set-Cookie']);
|
||||
if(preg_match('/id="javax\.faces\.ViewState" value="(.*)"/Ui', $page['body'], $matches))
|
||||
$this->codeRetour=$matches[1];
|
||||
else {
|
||||
echo 'Erreur Url='.$this->referer.EOL;
|
||||
print_r($page['body']);
|
||||
return false;
|
||||
}
|
||||
} else return false;
|
||||
|
||||
if ($numOrias>0) {
|
||||
$url='http://www.orias.fr/orias/public/index.html';
|
||||
$post=array('menu%3AiasSearchForm'=>'menu%3AiasSearchForm',
|
||||
'menu%3AiasSearchForm%3AiasInputText'=>sprintf('%08s',$numOrias),
|
||||
'javax.faces.ViewState'=>$this->codeRetour,
|
||||
'menu%3AiasSearchForm%3AiasSearch'=>'menu%3AiasSearchForm%3AiasSearch',
|
||||
);
|
||||
} else {
|
||||
// Recherche avec Siren
|
||||
$url='http://www.orias.fr/orias/public/rechercheavance.html';
|
||||
$post=array('j_id_id45'=>'j_id_id45',
|
||||
'j_id_id45%3Aj_id_id52'=>'',
|
||||
'j_id_id45%3AtagRCS'=>'',
|
||||
'j_id_id45%3AtagSIREN'=>$siren,//441921574,
|
||||
'j_id_id45%3Aj_id_id160'=>'',
|
||||
'j_id_id45%3Aj_id_id167'=>'',
|
||||
'j_id_id45%3Aj_id_id175'=>'',
|
||||
'javax.faces.ViewState'=>$this->codeRetour,
|
||||
'j_id_id45%3Aj_id_id203'=>'j_id_id45%3Aj_id_id203');
|
||||
$this->referer='http://www.orias.fr/orias/public/list.html';
|
||||
}
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, $post, $this->referer, false, '', '', 15);
|
||||
$this->referer=$url;
|
||||
if ($page['code']==302) $url=$page['header']['Location'];
|
||||
else {
|
||||
if (preg_match("/Le numéro d'immatriculation n'existe pas/", $page['body'])) {
|
||||
$tabInsert=array( 'actif'=>0,
|
||||
'numOrias'=>$numOrias,
|
||||
'numOriasAttribue'=>0,
|
||||
'dateInsert'=>date('YmdHis'));
|
||||
$this->erreur='Numéro Orias inexistant';
|
||||
// On enregistre ce numéro comme non attribué si < au dernier numéro attribué
|
||||
if ($numOrias<$this->getMaxOrias())
|
||||
$this->iDb->insert('sdv1.orias', $tabInsert);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($url=='http://www.orias.fr/orias/public/intermediaire.html') {
|
||||
$page=getUrl($url, $this->cookie, '', $this->referer, false, '', '', 24);
|
||||
$this->referer=$url;
|
||||
$this->body=$page['body'];
|
||||
echo "Recherche par Orias : url=$url".EOL;
|
||||
die(print_r($page));
|
||||
} /* else { */
|
||||
|
||||
// Liste contenant l'entreprise
|
||||
$url='http://www.orias.fr/orias/public/list.html';
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, '', $this->referer, false, '', '', 24);
|
||||
$this->referer=$url;
|
||||
$this->body=$page['body'];
|
||||
|
||||
if (preg_match('/<td>R\é\;sultat\(s\) de votre recherche \:(?:.*)<strong>(.*)<(?:.*)Interm\é\;diaire\(s\)/Uis',$this->body, $matches)) {
|
||||
$nbInter=trim($matches[1])*1;
|
||||
if ($nbInter==0) return false;
|
||||
if ($nbInter>1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Initalisation du tableau retour
|
||||
$tabRet=array('siren'=>$siren);
|
||||
|
||||
//id="formResult:intermediariesList:13910
|
||||
|
||||
if (preg_match('/<td class="dr-table-cell rich-table-cell haut " id="formResult\:intermediariesList\:(.*)\:j_id_id117">(?:.*)<center>(.*)<\/center>/Uis',$this->body, $matches)) {
|
||||
$tabRet['id']=trim($matches[1]);
|
||||
$tabRet['nom']=html_entity_decode(trim($matches[2]));
|
||||
}
|
||||
if (preg_match('/<td class="dr-table-cell rich-table-cell r.cp_ville " id="formResult\:intermediariesList\:(?:.*)\:j_id_id124">(?:.*)<center>(.*)<\/center>/Uis',$this->body, $matches)) {
|
||||
$tabTmp=explode(' ',$matches[1]);
|
||||
$tabRet['cp']=trim($tabTmp[0]);
|
||||
$tabRet['ville']=html_entity_decode(trim($tabTmp[1]));
|
||||
//$tabRet['cpVille']=explotrim(str_replace(' ',' ',$matches[1]));
|
||||
}
|
||||
if (preg_match('/<td class="dr-table-cell rich-table-cell r.adresse " id="formResult\:intermediariesList\:(?:.*)\:j_id_id133">(.*)<\/td>/Uis',$this->body, $matches))
|
||||
$tabRet['adresse']=html_entity_decode(trim($matches[1]));
|
||||
|
||||
$tabRet['actif']=1;
|
||||
$tabRet['numOriasAttribue']=1;
|
||||
if (preg_match('/<td class="dr-table-cell rich-table-cell r.immat " id="formResult\:intermediariesList\:(?:.*)\:j_id_id138">(?:.*|)(<span style="white-space\: no-wrap;">|Radi\é\; le \:)(.*)(?:<\/span>|<\/td>)/Uis',$this->body, $matches)) {
|
||||
$str=trim(strtr($matches[2],array(' '=>'',' '=>'')));
|
||||
if (html_entity_decode(trim(str_replace(':','', $matches[1])))=='Radié le') {
|
||||
$tabRet['actif']=0;
|
||||
$tabRet['numOrias']=$numOrias;
|
||||
$tabRet['dateRadiation']=$str;
|
||||
}
|
||||
else
|
||||
$tabRet['numOrias']=$str;
|
||||
}
|
||||
|
||||
if (preg_match('/ id="javax\.faces\.ViewState" value="(.*)" /Uis',$this->body, $matches))
|
||||
$this->codeRetour=$matches[1];
|
||||
|
||||
$tabTmp=explode("<a href=\"#\" onclick=\"if(typeof jsfcljs == 'function'){jsfcljs(document.getElementById('formResult'),{'", $this->body);
|
||||
// die($this->body);
|
||||
|
||||
foreach ($tabTmp as $i=>$strCat) {
|
||||
if ($i==0) {
|
||||
if (count($tabTmp)==1) {
|
||||
$tabInsert=array_merge($tabRet, array('dateInsert'=>date('YmdHis')));
|
||||
//print_r($tabInsert);
|
||||
$this->iDb->insert('sdv1.orias', $tabInsert);
|
||||
}
|
||||
$tabRet['categories']=array();
|
||||
continue;
|
||||
}
|
||||
$tabCat=array();
|
||||
//echo "$i:$strCat";
|
||||
//die();
|
||||
//:formResult:intermediariesList:107501:j_id_id159:0:j_id_id166':'formResult:intermediariesList:107501:j_id_id159:0:j_id_id166','intermediaryIdParam':'107501','intermediaryRoleIdParam':'Mia'},'');}return false">
|
||||
|
||||
if (preg_match('/<span style="text-align\: left">(.*)<\/span>/Ui',$strCat, $matches))
|
||||
$tabCat['categorie']=html_entity_decode(trim($matches[1]));
|
||||
if (preg_match('/intermediaryRoleIdParam\'\:\'(.*)\'/Uis',$strCat, $matches))
|
||||
$tabCat['cat']=$matches[1];
|
||||
//print_r($tabCat);
|
||||
|
||||
if ($i==1) { // Tout est dans la même page Html
|
||||
// Construction du lien vers la fiche d'identité de l'entreprise
|
||||
$url='http://www.orias.fr/orias/public/list.html';
|
||||
$post=array('formResult'=>'formResult',
|
||||
'formResult%3AajaxLoadingModalBoxOpenedState'=>'',
|
||||
'javax.faces.ViewState'=>$this->codeRetour,
|
||||
'intermediaryIdParam'=>$tabRet['id'],
|
||||
'intermediaryRoleIdParam'=>$tabCat['cat'],
|
||||
);
|
||||
if (preg_match('/(formResult\:intermediariesList\:(?:.*)),intermediaryIdParam,/Ui',$strCat, $matches)) {
|
||||
$tabTmp2=explode(',', $matches[1]);
|
||||
$post[urlencode($tabTmp2[0])]=urlencode($tabTmp2[1]);
|
||||
/* echo "$i";
|
||||
print_r($tabCat);
|
||||
print_r($matches);*/
|
||||
}
|
||||
randsleep(1,2);
|
||||
$page=getUrl($url, $this->cookie, $post, $this->referer, false, '', '', 24);
|
||||
//$this->referer=$url;
|
||||
$tmpCat=explode('class="dr-tbpnl-cntnt-pstn rich-tabpanel-content-position"', $page['body']);
|
||||
//die(print_r($page,1));
|
||||
}
|
||||
|
||||
if (preg_match('/<dd class="col3">Date d\'inscription \: <strong>(.*)<\/strong><\/dd>/Uis',$tmpCat[$i], $matches))
|
||||
$tabCat['dateInscription']=/*Wdate::dateT('d/m/y', 'Y-m-d', */trim($matches[1]);//);
|
||||
if (preg_match('/<td align="right"(?: |)>Statut \:<\/td>(.*)<\/strong>/Uis',$tmpCat[$i], $matches))
|
||||
$tabCat['typeStatut']=trim(strip_tags($matches[1]));
|
||||
if (preg_match('/<td align="right">RCS \:<\/td>(?:.*)<td width="5%"><\/td>(?:.*)<td width="70%"><strong>(.*)<\/strong>(.*)SIREN \:(?:.*)<strong>(.*)<\/strong>/Uis',$tmpCat[$i], $matches)) {
|
||||
$tabCat['rcsVille']=trim($matches[1]);
|
||||
$tabCat['rcsCode']=trim(strtr(strip_tags($matches[2]), array(' '=>'',' '=>'',chr(160)=>'',"\r"=>'',"\n"=>'')));
|
||||
$tabCat['rcsSiren']=trim($matches[3]);
|
||||
if ($siren==0) $tabRet['siren']=$tabCat['rcsSiren'];
|
||||
}
|
||||
/*<td align="right">Contact</td>
|
||||
<td></td>
|
||||
<td><strong> François Meunier
|
||||
</strong></td>
|
||||
*/
|
||||
if (preg_match('/<td align="right">Contact<\/td>(.*)<\/tr>/Uis',$tmpCat[$i], $matches)) {
|
||||
$tabCat['contact']=html_entity_decode(trim(strip_tags($matches[1])));
|
||||
/* <td></td>
|
||||
<td>
|
||||
<strong>
|
||||
JEAN-PIERRE CHAUSSAT
|
||||
</strong>
|
||||
</td>
|
||||
</table>*/
|
||||
}
|
||||
//print_r($tmpCat[$i]);
|
||||
if (preg_match("/<strong>(.*)Cet intermédiaire n'est pas autorisé à encaisser les primes ou cotisations d'assurances(.*)<\/strong>/Uis", $tmpCat[$i]))
|
||||
$tabCat['encaissement']=0;
|
||||
else
|
||||
$tabCat['encaissement']=1;
|
||||
|
||||
if (preg_match('/<span class="txt_ssTitre">(?:.*)Nature de l\'activit\é\; d\'interm\é\;diation(.*)<\/dd>/Uis',$tmpCat[$i], $matches))
|
||||
$tabCat['nature']=html_entity_decode(trim(strip_tags($matches[1])));
|
||||
|
||||
if (preg_match('/<td width="50%" valign="top" align="left">\- Etats dans lesquels cet interm\é\;diaire exerce en libre prestation de service(.*)<\/table>(.*)<\/tr>/Uis',$tmpCat[$i], $matches))
|
||||
$tabCat['paysPresta']=trim(strip_tags($matches[1]));
|
||||
|
||||
if (preg_match('/<td width="222" align="left">\- Etats dans lesquels cet interm\é\;diaire exerce en libert\é\; d\'\é\;tablissement(.*)<\/table>(.*)<\/tr>/Uis',$tmpCat[$i], $matches))
|
||||
$tabCat['paysEtab']=trim(strip_tags($matches[1]));
|
||||
|
||||
$tabRet['categories'][]=$tabCat;
|
||||
|
||||
$tabInsert=$tabRet;
|
||||
unset($tabInsert['categories']);
|
||||
$tabInsert=array_merge($tabInsert, $tabCat, array('dateInsert'=>date('YmdHis')));
|
||||
//print_r($tabInsert);
|
||||
$this->iDb->insert('sdv1.orias', $tabInsert);
|
||||
//echo $tmpCat[$i];
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,155 +0,0 @@
|
||||
<?php
|
||||
class MPrivileges
|
||||
{
|
||||
protected $iDb;
|
||||
public $tabCodeAR = array(
|
||||
'00'=>"Surveillance RCS posée/Demande de suppression acceptée/Surveillance PRIV posée : pas d'inscription existante sur le dossier",
|
||||
'01'=>"Surveillance PRIV posée : inscription existante sur le dossier",
|
||||
'02'=>"GAGI,GREFTEL,INTERGREFFE-code 1-surveillance acceptée mais qui n'a pas encore fait l'objet d'un AR",
|
||||
'03'=>"GAGI,GREFTEL,INTERGREFFE-code 2 - surveillance acceptée avec CREATION d'une fiche débiteur, qui n'a pas fait l'objet d'un AR",
|
||||
'04'=>"GAGI-surveillance en attente envoyée au GAGI",
|
||||
'05'=>"Surveillance en attente de validation au greffe",
|
||||
'06'=>"Erreur de chargement",
|
||||
'10'=>"Surveillance impossible car société radiée",
|
||||
'11'=>"Surveillance impossible car société transférée dans un autre greffe",
|
||||
'12'=>"SIREN inconnu",
|
||||
'13'=>"Raison sociale erronée",
|
||||
'14'=>"Adresse erronée",
|
||||
'15'=>"Surveillance impossible sur un établissement secondaire",
|
||||
'16'=>"Demande incomplète ou incorrecte",
|
||||
'17'=>"Surveillance Privilège impossible",
|
||||
'18'=>"Surveillance impossible par le greffe",
|
||||
'19'=>"Surveillance RCS impossible",
|
||||
'20'=>"Cette surveillance concerne un autre Greffe",
|
||||
'21'=>"Surveillance BILAN impossible car la ste n'est pas tenue de déposer ses Comptes Annuels (ste de droit étranger)",
|
||||
'22'=>"Plusieurs Bottins (débiteurs) (GAGI)",
|
||||
'23'=>"Société de fait (GAGI) : Société non enregistrée au Registre du Commerce",
|
||||
'24'=>"Surveillance impossible car société en liquidation judiciaire",
|
||||
'25'=>"Greffe inconnu",
|
||||
'26'=>"Millésime bilan à surveiller incorrect",
|
||||
'27'=>"Références EXTELIA erronées ou incomplètes (ces reférences sont obligatoires en cas de demande de suppression)",
|
||||
'28'=>"Surveillance impossible sur un dossier non informatisé (dossier dit non repris ou figé)",
|
||||
'30'=>"Siren absent (ne concerne que les surveillances de type WebService)",
|
||||
'31'=>"Surveillance BILAN impossible sur une société non commerciale (statut <> B)",
|
||||
'50'=>"Ce greffe ne traite pas les surveillances car le groupement de ce greffe n'est pas surveillé",
|
||||
'51'=>"Etablissement non trouvé",
|
||||
'52'=>"Code catalogue de la surveillance non renseigné ou incorrect",
|
||||
'53'=>"le siren est déjà sous surveillance",
|
||||
'54'=>"DOSSIER AGORA : votre prestation ne comprend pas la couverture de ce groupement",
|
||||
'55'=>"DOSSIER INTERGREFFE : votre prestation ne comprend pas la couverture de ce groupement de greffes",
|
||||
'56'=>"Le siren est déjà en attente de validation par le greffe",
|
||||
'57'=>"Surveillance impossible sur un dossier dit non inscrit au RCS (statut F:artisan)",
|
||||
'58'=>"Surveillance impossible sur un agent commercial (statut P ou M)",
|
||||
'59'=>'Surveillance impossible sur une société non RCS ?',
|
||||
'88'=>"Rejet temporaire : surveillance sur un greffe absorbé rejetée pendant la phase de rechargement",
|
||||
'99'=>"Surveillance impossible pour raisons à examiner",
|
||||
);
|
||||
|
||||
public $tabTypePriv = array(
|
||||
'01'=>"NANTISSEMENTS DU FONDS DE COMMERCE",
|
||||
'02'=>"PRIVILEGES DE VENDEUR ET ACTION RESOLUTOIRE",
|
||||
'03'=>"PRIVILEGES DE LA SECURITE SOCIALE ET DES REGIMES COMPLEMENTAIRES",
|
||||
'04'=>"PRIVILEGES DU TRESOR PUBLIC",
|
||||
'05'=>"OPERATIONS DE CREDIT-BAIL EN MATIERE MOBILIERE",
|
||||
'06'=>"PROTETS",
|
||||
'07'=>"NANTISSEMENTS DE L'OUTILLAGE, MATERIEL ET EQUIPEMENT",
|
||||
'08'=>"WARRANTS (HOTELIER, PETROLIER, INDUSTRIEL OU AGRICOLE)",
|
||||
'10'=>"NANTISSEMENTS DE PARTS DE SOCIETE CIVILE",
|
||||
'17'=>"PUBLICITES DE CONTRATS DE LOCATION",
|
||||
'18'=>"PUBLICITES DE CLAUSES DE RESERVE DE PROPRIETE",
|
||||
'19'=>"PRETS ET DELAIS",
|
||||
'20'=>"DECLARATIONS DE CREANCES",
|
||||
'21'=>"NANTISSEMENTS JUDICIAIRES",
|
||||
'23'=>"BIENS INALIENABLES",
|
||||
'24'=>"HYPOTHEQUES FLUVIALES",
|
||||
'25'=>"NANTISSEMENTS DU FONDS ARTISANAL",
|
||||
'27'=>"GAGE SANS DEPOSSESSION",
|
||||
'28'=>"GAGE DES STOCKS",
|
||||
);
|
||||
|
||||
public function __construct($db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
}
|
||||
|
||||
public function getPrivilegesDetail($siren, $tabTypes=array('03','04'))
|
||||
{
|
||||
$strTypes=implode("','", $tabTypes);
|
||||
if ($strTypes<>'') $strTypes=" AND i.insType IN ('$strTypes') ";
|
||||
$fields = "i.id, i.dateEven, i.greffe , i.numDebiteur, i.sirenage, i.typeEven, i.dateFraiche, i.codeRev , i.debRaisonSociale , i.debSigle , i.debCiv , i.debNom , i.debPrenom , i.debConjoint , i.debUsage , i.debEnseigne , i.debActivite , i.debFj , i.debFjLib , i.debResidence , i.debNumVoie , i.debTypVoie , i.debLibVoie , i.debAdrComp , i.debCP , i.debVille , i.debPays , i.insType , i.insLib , i.insNum , i.insDate , i.insObjet , i.insMontant , i.insDev , i.insDateEch , i.insDateFin , i.insNanTx , i.insNanTitre , i.insNanOppo , i.insProNat , i.insProHui , i.insProRep , i.insNSCA , i.insNSCParts , i.insNSCSigni , i.creNom , i.creNumVoi, i.creTypVoi, i.creLibVoi, i.creAdrComp1, i.creAdrComp2, i.creCP, i.creVille, i.crePays, i.creAutres, i.radDate, i.radMention, i.radPartiel, i.radPartMt, i.radDev, i.radDiv, i.idFichier, i.dateInsert";
|
||||
$where = "i.siren=$siren $strTypes AND ( (i.insType='03' AND DATEDIFF(NOW(),i.insDate)<=900) /** Durée de vie PRIV Sécu **/ OR (i.insType='04' AND DATEDIFF(NOW(),i.insDate)<=1460) /** Durée de vie PRIV Trésor **/ )";
|
||||
$where.= " ORDER BY i.dateFraiche DESC, i.insType ASC, i.insDate ASC;";
|
||||
$tables = "jo.greffes_privileges i";
|
||||
|
||||
$iRncs = new MRncs($this->iDb);
|
||||
$tabRet = array();
|
||||
$tabPriv = $this->iDb->select($tables, $fields, $where, true, MYSQL_ASSOC);
|
||||
foreach ($tabPriv as $i=>$priv) {
|
||||
if ($i>0 && $priv['dateFraiche']<>$dateFraiche) break;
|
||||
$tabRet[] = array(
|
||||
'numDebiteur' => $priv['numDebiteur'],
|
||||
'greffe' => $priv['greffe'],
|
||||
'greffeLib' => $iRncs->getLibTribunal($priv['greffe']),
|
||||
'dateEven' => $priv['dateEven'],
|
||||
'dateFraiche' => $priv['dateFraiche'],
|
||||
'dateSD' => $priv['dateInsert'],
|
||||
'insType' => $priv['insType'],
|
||||
'insTypeLib' => prepareString($this->tabTypePriv[$priv['insType']]),
|
||||
'insNum' => $priv['insNum'],
|
||||
'insDate' => $priv['insDate'],
|
||||
'insDateEch' => $priv['insDateEch'],
|
||||
'insObjet' => prepareString($priv['insObjet']),
|
||||
'insMontant' => $priv['insMontant'],
|
||||
'insDev' => $priv['insDev'],
|
||||
'insDateFin' => $priv['insDateFin'],
|
||||
'radDate' => $priv['radDate'],
|
||||
'radMention' => $priv['radMention'],
|
||||
'radPartiel' => prepareString($priv['radPartiel']),
|
||||
'radPartMt' => $priv['radPartMt'],
|
||||
'radDev' => $priv['radDev'],
|
||||
'creNom' => prepareString($priv['creNom']),
|
||||
'creAdresse1' => prepareString(trim(preg_replace('/ +/', ' ', $priv['creNumVoi'].' '.$priv['creTypVoi'].' '.$priv['creLibVoi']))),
|
||||
'creAdresse2' => prepareString($priv['creAdrComp1']),
|
||||
'creAdresse3' => prepareString($priv['creAdrComp2']),
|
||||
'creCP' => $priv['creCP'],
|
||||
'creVille' => prepareString($priv['creVille']),
|
||||
'crePays' => prepareString($priv['crePays']),
|
||||
'creAutres' => prepareString($priv['creAutres']),
|
||||
);
|
||||
/* debRaisonSociale , debSigle, debEnseigne
|
||||
debCiv, debNom, debPrenom , debConjoint, debUsage,
|
||||
debActivite , debFj, debFjLib
|
||||
debResidence, debNumVoie, debTypVoie, debLibVoie
|
||||
debAdrComp , debCP, debVille, debPays
|
||||
|
||||
insNanTx, insNanTitre, insNanOppo,
|
||||
insProNat, insProHui, insProRep , insNSCA, insNSCParts, insNSCSigni
|
||||
*/
|
||||
$dateFraiche=$priv['dateFraiche'];
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
public function getPrivilegesCumul($siren, $tabTypes=array('03','04'))
|
||||
{
|
||||
$iRncs = new MRncs($this->iDb);
|
||||
$tabRet = array();
|
||||
$tabTmp = $this->getPrivilegesDetail($siren, $tabTypes);
|
||||
foreach($tabTmp as $i=>$priv) {
|
||||
@$tabRet[$priv['insType']]['nb']++;
|
||||
$tabRet[$priv['insType']]['insTypeLib'] = $priv['insTypeLib'];
|
||||
$tabRet[$priv['insType']]['dateFraiche'] = $priv['dateFraiche'];
|
||||
$tabRet[$priv['insType']]['dateDerInsc'] = $priv['insDate'];
|
||||
$tabRet[$priv['insType']]['nomDerCre'] = $priv['creNom'];
|
||||
$tabRet[$priv['insType']]['numDebiteur'] = $priv['numDebiteur'];
|
||||
$tabRet[$priv['insType']]['greffeLib'] = $iRncs->getLibTribunal($priv['greffe']);
|
||||
$tabRet[$priv['insType']]['dateMajSD'] = $priv['dateSD'];
|
||||
@$tabRet[$priv['insType']]['insCumul'] += $priv['insMontant'];
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
@ -1,343 +0,0 @@
|
||||
<?php
|
||||
|
||||
class MQualibat {
|
||||
|
||||
private $referer ='';
|
||||
private $body = '';
|
||||
private $header = '';
|
||||
private $cookie = '';
|
||||
private $codeRetour = 0;
|
||||
private $accesDist=true;
|
||||
private $iDb;
|
||||
private $iBodacc;
|
||||
private $iInsee;
|
||||
|
||||
public $enCache=false;
|
||||
public $force=false;
|
||||
public $annee=0;
|
||||
|
||||
function __construct($accesDist=true) {// $adresse, $cp, $ville, $pays='France') {
|
||||
$this->accesDist=$accesDist;
|
||||
$this->iDb=new WDB();
|
||||
$this->iBodacc=new MBodacc();
|
||||
$this->$iInsee=new MInsee();
|
||||
}
|
||||
|
||||
private function getCodeFctDirigeant($strLibDirigeant, $siren=0) {
|
||||
$tabTmp=$this->iBodacc->getDirigeants($strLibDirigeant);
|
||||
if (isset($tabTmp[0]['fonction']) && $tabTmp[0]['fonction']>0)
|
||||
return $tabTmp[0]['fonction'];
|
||||
else {
|
||||
if (preg_match("/directeur.{1,6}agence/iu")) return 8;
|
||||
elseif (preg_match("/directeur.{1,6}ETABLISSEMENT/iu")) return 8;
|
||||
elseif (preg_match("/directeur.{1,6}technique/iu")) return 19;
|
||||
elseif (preg_match("/chef.{1,8}agence/iu")) return 38;
|
||||
elseif (preg_match("/cadre.{1,8}Comptable/iu")) return 55;
|
||||
elseif (preg_match("/Charg.{1,6}affair/iu")) return 60;
|
||||
elseif (preg_match("/chef.{1,8}Atelier/iu")) return 60;
|
||||
elseif (preg_match("/(conducteur|chef).{1,9}travaux/iu")) return 61;
|
||||
elseif (preg_match("/directeur.{1,6}technique/iu")) return 19;
|
||||
elseif (preg_match("/resp.{1,16}technique/iu")) return 49;
|
||||
elseif (preg_match("/resp.{1,16}Expl/iu")) return 37;
|
||||
elseif (preg_match("/di.{1,16}Expl/iu")) return 7;
|
||||
elseif (preg_match("/Chef.{1,6}Ent/iu")) {
|
||||
$tabTmp=$this->iInsee->getIdentiteLight($siren);
|
||||
if ($tabTmp['FJ']>=1000 && $tabTmp['FJ']<2000) return 1050;
|
||||
else die($tabTmp);
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
/*
|
||||
"1","- DIRECTEUR GENERAL"
|
||||
"1","- P.d.g."
|
||||
"1","- PRESIDENT CONSEIL D''ADMINISTRATION"
|
||||
"2","-co-gerant"
|
||||
"1","Administrateur"
|
||||
"2","Artisan"
|
||||
"1","AssociÉ"
|
||||
"1","Associes"
|
||||
"24","Co Gerant"
|
||||
"1","Co Gerante"
|
||||
"1","CO GERANTS"
|
||||
"109","Co-gérant"
|
||||
"12","Co-gérante"
|
||||
"1","Dg Delegue"
|
||||
"1","Dir. General Delegue"
|
||||
"32","Directeur"
|
||||
"1","Directeur Adjoint"
|
||||
"1","Directeur Administratif et Financier"
|
||||
"1","Directeur Gal DÉlÉguÉ"
|
||||
"61","Directeur Général"
|
||||
"11","DIRECTEUR GENERAL DELEGUE"
|
||||
"1","Directeur Général Unique"
|
||||
"1","Directrice"
|
||||
"2","DIRIG."
|
||||
"4","Dirigeant"
|
||||
"38","Gér"
|
||||
"857","Gerant"
|
||||
"3","Gerant -"
|
||||
"13","Gérant Associé"
|
||||
"1","Gérant Associé En Non Collectif"
|
||||
"1","GERANT MAJORITAIRE"
|
||||
"2","Gérant Non Associé"
|
||||
"56","Gérante"
|
||||
"4","P D G"
|
||||
"1","P.d.g"
|
||||
"1","PCA"
|
||||
"168","PRESIDENT"
|
||||
"1","President Conseil De Surveillance"
|
||||
"1","PRESIDENT CONSEIL SURVEILLANCE"
|
||||
"63","Président Directeur Général"
|
||||
"1","PRESIDENT DIRECTOIRE"
|
||||
"16","Président du conseil d'administration"
|
||||
"1","Président Du Conseil De Surveillance"
|
||||
"5","President Du Directoire"
|
||||
"10","Presidente"
|
||||
"1","ReprÉsentant SociÉtÉ PrÉsidente"
|
||||
"1","Vice-président"
|
||||
|
||||
Gérer en fonction du code CJ
|
||||
"128","Chef D'entreprise"
|
||||
"2","Chef Ent."
|
||||
"3","Chef Entr."
|
||||
|
||||
"1","Conjoint Collaborateur"=>0500
|
||||
|
||||
|
||||
|
||||
"1","Metreur"
|
||||
"1","Président De Commission"
|
||||
*/
|
||||
}
|
||||
|
||||
public function getMaxQualibat() {
|
||||
$ret=$this->iDb->select('sdv1.qualibat','MAX(id) AS id', '1', false, MYSQL_ASSOC);
|
||||
return $ret[0]['id'];
|
||||
}
|
||||
|
||||
public function getTabQualibatManquants() {
|
||||
$tabRet=$tabQualibatCalc=$tabQualibatBase=array();
|
||||
// Liste des Qualibat Calculés
|
||||
$maxQualibat=$this->getMaxQualibat();
|
||||
for($i=1; $i<=$maxQualibat; $i++)
|
||||
$tabQualibatCalc[]=$i;
|
||||
|
||||
// Liste des Qualibat en base
|
||||
$ret=$this->iDb->select('sdv1.qualibat','id', '1 ORDER BY id ASC', false, MYSQL_ASSOC);
|
||||
foreach ($ret as $i=>$res)
|
||||
$tabQualibatBase[]=$res['id'];
|
||||
|
||||
return array_diff($tabQualibatCalc, $tabQualibatBase);
|
||||
}
|
||||
|
||||
public function getInfosQualibat($siren, $idQualibat=0) {
|
||||
if ($siren*1>1000)
|
||||
$strWhere="siren=$siren";
|
||||
elseif ($idQualibat*1>0) {
|
||||
$strWhere="id=$idQualibat";
|
||||
} else return false;
|
||||
|
||||
$ret=$this->iDb->select('sdv1.qualibat','siren, actif, id, nom, adresse, cp, ville, tel, fax, email, web,
|
||||
eff, teff, ca, tca, libFJ, nace, dateFondation, dateDeb, dateFin, dateInsert', $strWhere, false, MYSQL_ASSOC);
|
||||
if (!$this->force && count($ret)>0) {
|
||||
$this->enCache=true;
|
||||
$tabRet=$ret[0];//array();
|
||||
|
||||
// Ajout des qualifications
|
||||
$ret=$this->iDb->select('sdv1.qualibatqualif','code, periodQualif, niveauQualif, mentions, nomQualif, dateAttrib, dateEch', $strWhere, false, MYSQL_ASSOC);
|
||||
foreach ($ret as $i=>$tabTmp)
|
||||
$tabRet['qualifications'][]=$tabTmp;
|
||||
|
||||
// Ajout des dirigeants
|
||||
$ret=$this->iDb->select('sdv1.qualibatdir','civNomPrenom, civilite, nom, prenom, fonction', $strWhere, false, MYSQL_ASSOC);
|
||||
foreach ($ret as $i=>$tabTmp)
|
||||
$tabRet['dirigeants'][]=$tabTmp;
|
||||
} elseif ($this->accesDist==true) {
|
||||
$this->enCache=false;
|
||||
|
||||
// Initialisation Cookies
|
||||
$this->referer='http://www.qualibat.com/Views/EntreprisesRechercheDetail.aspx?id='.$idQualibat;
|
||||
$page=getUrl($this->referer, '', '', '', false, '', '', 3);
|
||||
if ($page['code']<>200) {
|
||||
if ($page['code']==500) {
|
||||
$tabInsert=array( 'actif'=>0,
|
||||
'id'=>$idQualibat,
|
||||
'idQualibatAttribue'=>0,
|
||||
'dateInsert'=>date('YmdHis'));
|
||||
$this->erreur='Numéro Qualibat inexistant';
|
||||
// On enregistre ce numéro comme non attribué si < au dernier numéro attribué
|
||||
if ($idQualibat<$this->getMaxQualibat())
|
||||
$this->iDb->insert('sdv1.qualibat', $tabInsert);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
$body=$page['body'];
|
||||
//die($body);
|
||||
$tabRet['id']=$idQualibat;
|
||||
|
||||
if (preg_match('/<th>(?:.*)Raison sociale(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['nom']=utf8_decode(trim(strip_tags($matches[1])));
|
||||
|
||||
if (preg_match('/<th>(?:.*)Adresse(?:.*)<\/th>(?:.*)<td>(.*)<br \/>(.*)<\/td>/Uis',$body, $matches)) {
|
||||
$tabRet['adresse']=strtoupper(utf8_decode(trim($matches[1])));
|
||||
$adresse2=trim(preg_replace('/ +/',' ',strtr(strip_tags($matches[2]),"\r\n\t".chr(160),' ')));
|
||||
$tabRet['cp']=substr($adresse2,0,5);
|
||||
$tabRet['ville']=utf8_decode(trim(substr($adresse2,5)));
|
||||
}
|
||||
|
||||
if (preg_match('/<th>(?:.*)Téléphone(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uisu',$body, $matches))
|
||||
$tabRet['tel']=trim(str_replace(' ','',$matches[1]));
|
||||
|
||||
if (preg_match('/<th>(?:.*)Fax(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['fax']=trim(str_replace(' ','',$matches[1]));
|
||||
|
||||
if (preg_match('/<th>E-mail<\/th><td>(?:.*)<a href= "mailto\:(.*)">/Uis',$body, $matches))
|
||||
$tabRet['email']=utf8_decode(trim($matches[1]));
|
||||
|
||||
if (preg_match('/<th>(?:.*)SIREN(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['siren']=$siren=trim(str_replace(' ','',$matches[1]));
|
||||
|
||||
if (preg_match('/<th>(?:.*)Effectif total(?:.*)<\/th>(?:.*)<td>(.*)\(Classification - (.*)\)(?:.*)<\/td>/Uis',$body, $matches)) {
|
||||
$tabRet['eff']=trim(str_replace(' ','',$matches[1]));
|
||||
$tabRet['teff']=trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<th>(?:.*)CA total(?:.*)<\/th>(?:.*)<td >(.*)\(Classification - (.*)\)(?:.*)<\/td>/Uis',$body, $matches)) {
|
||||
$tabRet['ca']=trim(str_replace(' ','',$matches[1]));
|
||||
if ($tabRet['ca']=='') $tabRet['ca']=NULL;
|
||||
$tabRet['tca']=trim($matches[2]);
|
||||
if ($tabRet['tca']=='') $tabRet['tca']=NULL;
|
||||
}
|
||||
|
||||
if (preg_match('/<th>(?:.*)Forme Juridique(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['libFJ']=utf8_decode(trim($matches[1]));
|
||||
|
||||
if (preg_match('/<th>(?:.*)NACE(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['nace']=trim($matches[1]);
|
||||
|
||||
if (preg_match('/<th>(?:.*)Fondation(?:.*)<\/th>(?:.*)<td>(.*)<\/td>/Uis',$body, $matches))
|
||||
$tabRet['dateFondation']=Wdate::dateT('d/m/Y', 'Y-m-d', trim($matches[1]));
|
||||
|
||||
if (preg_match('/<tr><td align="center"><img src="(?:.*)internet_contact\.gif(?:.*)<\/td><td> <a href= "(.*)" target="_blank">/Uis',$body, $matches))
|
||||
$tabRet['web']=utf8_decode(trim($matches[1]));
|
||||
|
||||
/** Qualifications ? **/
|
||||
$qualifs='';
|
||||
if (preg_match('/<table class="recherche_entreprise_detail">(?:.*)<th colspan="4">(?:.*)(Qualifications professionnelles|Certifications m..tier)(?:.*)<tbody>(.*)<\/table>/Uisu',$body, $matches)) {
|
||||
$typeQualifs=trim(utf8_decode($matches[1]));
|
||||
$qualifs=trim($matches[2]);
|
||||
}
|
||||
|
||||
if (preg_match('/<th>(?:.*)Fondation(?:.*)<\/th>(?:.*)<td>(.*)<\/td>(.*)<div class="buttons">/Uis',$body, $matches)) {
|
||||
$tabRet['tmpDirQualif']=trim($matches[2]);
|
||||
$tabRet['tmpLenDirQualif']=strlen(trim($matches[2]));
|
||||
}
|
||||
|
||||
$tabDateAttrib=$tabDateFin=array();
|
||||
if (preg_match_all('/<tr>(?:.*)<td>(.*)<\/td>(?:.*)<td>(.*)<\/td>(?:.*)<td>(.*)<\/td>(?:.*)<td>(.*)<\/td>(?:.*)<\/tr>/Uis',$qualifs, $matches)) {
|
||||
foreach ($matches[1] as $i=>$code) {
|
||||
$tabTmp=explode(' ',trim($code));
|
||||
$nomQualif=utf8_decode(trim($matches[2][$i]));
|
||||
if (preg_match("/\(Tech?nicit. (.*)\)/Uiu", $nomQualif, $matches2))
|
||||
$niveau=trim($matches2[1]);
|
||||
else $niveau='';
|
||||
$tabMentions=array();
|
||||
if (preg_match_all('/Mention (.*)(?:,|$)/Uis',$nomQualif, $matches2)) {
|
||||
foreach ($matches2[1] as $i2=>$mention)
|
||||
$tabMentions[]=$mention;
|
||||
}
|
||||
$tabRet['qualifications'][$i]=array(
|
||||
'code'=>trim($tabTmp[0]),
|
||||
'periodQualif'=>trim($tabTmp[1]),
|
||||
'nomQualif'=>$nomQualif,
|
||||
'niveauQualif'=>$niveau,
|
||||
'typeQualif'=>$typeQualifs,
|
||||
'mentions'=>implode(', ', $tabMentions),
|
||||
'dateAttrib'=>Wdate::dateT('d/m/Y', 'Y-m-d', trim($matches[3][$i])),
|
||||
'dateEch'=>Wdate::dateT('d/m/Y', 'Y-m-d', trim($matches[4][$i])));
|
||||
$tabDateAttrib[]=Wdate::dateT('d/m/Y', 'Ymd', trim($matches[3][$i]))*1;
|
||||
$tabDateFin[]=Wdate::dateT('d/m/Y', 'Ymd', trim($matches[4][$i]))*1;
|
||||
}
|
||||
}
|
||||
sort($tabDateAttrib);
|
||||
rsort($tabDateFin);
|
||||
|
||||
/** Dirigeants ? **/
|
||||
$dirs='';
|
||||
if (preg_match('/<table class="recherche_entreprise_detail">(?:.*)<th colspan="2">(?:.*)Dirigeants(?:.*)<tbody>(.*)<\/table>/Uis',$body, $matches))
|
||||
$dirs=trim($matches[1]);
|
||||
/* <tr>
|
||||
<td>
|
||||
Monsieur EPP Olivier
|
||||
</td>
|
||||
<td>
|
||||
Gérant
|
||||
</td>
|
||||
</tr>*/
|
||||
if (preg_match_all('/<tr>(?:.*)<td>(.*)<\/td>(?:.*)<td>(.*)<\/td>(?:.*)<\/tr>/Uis',$dirs, $matches)) {
|
||||
foreach ($matches[1] as $i=>$nom) {
|
||||
$strNom=utf8_decode(trim($nom));
|
||||
switch(strtoupper(substr($strNom,0,6))) {
|
||||
case 'MONSIE': $civ='M'; $pDeb=8; break;
|
||||
case 'MADAME': $civ='MME'; $pDeb=6; break;
|
||||
case 'MADEMO': $civ='MLLE';$pDeb=12; break;
|
||||
default: $civ=''; $pDeb=0; break;
|
||||
}
|
||||
$libFonction=ucwords(strtolower(utf8_decode(trim($matches[2][$i]))));
|
||||
$tabRet['dirigeants'][$i]=array(
|
||||
'civNomPrenom'=>$strNom,
|
||||
'civilite'=>$civ,
|
||||
'nom'=>strtoupper(trim(substr($strNom,$pDeb,65))),
|
||||
'prenom'=>ucwords(strtolower(trim(substr($strNom,$pDeb+66)))),
|
||||
'fonction'=>$libFonction,
|
||||
'fonctionCode'=>$this->getCodeFctDirigeant($libFonction, $siren),
|
||||
);
|
||||
}
|
||||
//print_r($tabRet['dirigeants']);
|
||||
//die();
|
||||
}
|
||||
|
||||
/** Insertion de l'entreprise
|
||||
**/
|
||||
$tabInsert=array_merge($tabRet,
|
||||
array( 'idQualibatAttribue'=>1,
|
||||
'dateInsert'=>date('YmdHis'),
|
||||
'dateDeb'=>@$tabDateAttrib[0],
|
||||
'dateFin'=>@$tabDateFin[0]));
|
||||
unset($tabInsert['qualifications']);
|
||||
if (!$this->iDb->insert('sdv1.qualibat', $tabInsert)) {
|
||||
$this->iDb->update('sdv1.qualibat', $tabInsert, "id=$idQualibat");
|
||||
}
|
||||
|
||||
|
||||
/** Insertion des qualifications
|
||||
**/
|
||||
if (isset($tabRet['qualifications']) && count($tabRet['qualifications'])>0)
|
||||
foreach ($tabRet['qualifications'] as $i=>$tabInsert) {
|
||||
$tabInsert['id']=$idQualibat;
|
||||
$tabInsert['siren']=$siren;
|
||||
$tabInsert['dateInsert']=date('YmdHis');
|
||||
if (!$this->iDb->insert('sdv1.qualibatqualif', $tabInsert)) {
|
||||
$this->iDb->update('sdv1.qualibatqualif', $tabInsert, "id=$idQualibat AND code='".$tabInsert['code']."' AND periodQualif='".$tabInsert['periodQualif']."'");
|
||||
}
|
||||
}
|
||||
|
||||
/** Insertion des dirigeants
|
||||
**/
|
||||
if (isset($tabRet['dirigeants']) && count($tabRet['dirigeants'])>0)
|
||||
foreach ($tabRet['dirigeants'] as $i=>$tabInsert) {
|
||||
$tabInsert['id']=$idQualibat;
|
||||
$tabInsert['siren']=$siren;
|
||||
$tabInsert['dateInsert']=date('YmdHis');
|
||||
if (!$this->iDb->insert('sdv1.qualibatdir', $tabInsert)) {
|
||||
$this->iDb->update('sdv1.qualibatdir', $tabInsert, "id=$idQualibat AND civNomPrenom='".addslashes($tabInsert['civNomPrenom'])."' AND fonction='".addslashes($tabInsert['fonction'])."'");
|
||||
}
|
||||
unset($tabRet['dirigeants'][$i]['civNomPrenom']);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,959 +0,0 @@
|
||||
<?php
|
||||
|
||||
class MRncs
|
||||
{
|
||||
public $tabFctDir=array(
|
||||
100 =>array('codeSd'=>'1300', 'lib'=>'Président'),
|
||||
110 =>array('codeSd'=>'1306', 'lib'=>'Président du conseil d\'administration'),
|
||||
120 =>array('codeSd'=>'1301', 'lib'=>'Président directeur Général'),
|
||||
140 =>array('codeSd'=>'1650', 'lib'=>'Gouverneur'),
|
||||
150 =>array('codeSd'=>'1651', 'lib'=>'Sous-gouverneur'),
|
||||
200 =>array('codeSd'=>'0900', 'lib'=>'Gérant'),
|
||||
210 =>array('codeSd'=>'0912', 'lib'=>'Gérant non associé'),
|
||||
300 =>array('codeSd'=>'0400', 'lib'=>'Co-gérant'),
|
||||
400 =>array('codeSd'=>'0709', 'lib'=>'Directeur général'),
|
||||
410 =>array('codeSd'=>'0713', 'lib'=>'Directeur général non administrateur'),
|
||||
420 =>array('codeSd'=>'0708', 'lib'=>'Directeur général unique'),
|
||||
430 =>array('codeSd'=>'0704', 'lib'=>'Directeur général délégué'),
|
||||
500 =>array('codeSd'=>'1800', 'lib'=>'Vice-président'),
|
||||
600 =>array('codeSd'=>'0100', 'lib'=>'Administrateur'),
|
||||
610 =>array('codeSd'=>'0101', 'lib'=>'Administrateur délégué'),
|
||||
700 =>array('codeSd'=>'1308', 'lib'=>'Président du directoire'),
|
||||
900 =>array('codeSd'=>'1307', 'lib'=>'Président du conseil de surveillance'),
|
||||
1200=>array('codeSd'=>'0209', 'lib'=>'Associé-gérant'),
|
||||
1300=>array('codeSd'=>'0603', 'lib'=>'Contrôleur de gestion'),
|
||||
4000=>array('codeSd'=>'A', 'lib'=>'Administrateur judiciaire'),
|
||||
4100=>array('codeSd'=>'1900', 'lib'=>'Liquidateur'),
|
||||
4300=>array('codeSd'=>'0108', 'lib'=>'Administrateur provisoire'),
|
||||
4400=>array('codeSd'=>'1401', 'lib'=>'Représentant en France d\'une société étrangère'),
|
||||
7000=>array('codeSd'=>'U', 'lib'=>'Curateur'),
|
||||
7100=>array('codeSd'=>'C', 'lib'=>'Commissaire au plan'),
|
||||
7200=>array('codeSd'=>'S', 'lib'=>'Syndic'),
|
||||
7300=>array('codeSd'=>'D', 'lib'=>'Commissaire au concordat'),
|
||||
7500=>array('codeSd'=>'R', 'lib'=>'Représentant des créanciers'),
|
||||
7600=>array('codeSd'=>'M', 'lib'=>'Mandataire judiciaire'),
|
||||
7800=>array('codeSd'=>'M', 'lib'=>'Mandataire judiciaire'),
|
||||
9100=>array('codeSd'=>'T', 'lib'=>'Conciliateur'),
|
||||
);
|
||||
|
||||
public $tabDevises=array();
|
||||
public $tabPays=array();
|
||||
public $tabTribunaux=array();
|
||||
public $tabMandataires=array();
|
||||
public $tabJugements=array();
|
||||
private $iDb;
|
||||
|
||||
/** Partie Extranet IMR Infogreffe **/
|
||||
public $body='';
|
||||
public $referer='';
|
||||
public $codeRetour='';
|
||||
public $libErreur='';
|
||||
public $cookie='';
|
||||
public $infoIMR=array();
|
||||
public $maxDemJour=10;
|
||||
public $matching=NULL;
|
||||
|
||||
public function __construct($db = null)
|
||||
{
|
||||
if ( $db === null ) {
|
||||
$this->iDb = new WDB();
|
||||
} else {
|
||||
$this->iDb = $db;
|
||||
}
|
||||
$this->tabDevises = $this->getTabDevisesInpi();
|
||||
$this->tabPays = $this->getTabPaysInpi();
|
||||
$this->tabTribunaux = $this->getTabTribunaux();
|
||||
$this->tabMandataires = $this->getTabMandataires();
|
||||
$this->tabJugements = $this->getTabJugements();
|
||||
}
|
||||
|
||||
public function getLibFctDir($codeFonctionDirectionRncs)
|
||||
{
|
||||
$codeFonctionDirectionRncs=$codeFonctionDirectionRncs*1;
|
||||
return $this->tabFctDir[$codeFonctionDirectionRncs]['lib'];
|
||||
}
|
||||
|
||||
public function getCodFctBodaccFctDir($codeFonctionDirectionRncs)
|
||||
{
|
||||
$codeFonctionDirectionRncs=$codeFonctionDirectionRncs*1;
|
||||
return $this->tabFctDir[$codeFonctionDirectionRncs]['codeSd'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisation du tableau privé des devises Inpi <=> ISO
|
||||
* @return array
|
||||
*/
|
||||
private function getTabDevisesInpi()
|
||||
{
|
||||
$cache = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . 'DevisesInpi.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.tabDevises', 'devInpi, devIso', 'devInpi>0', false, MYSQL_ASSOC);
|
||||
$tabDevises=array();
|
||||
foreach($rep as $k=>$dev)
|
||||
$tabDevises[$dev['devInpi']*1]=$dev['devIso'];
|
||||
|
||||
return $tabDevises;
|
||||
}
|
||||
}
|
||||
|
||||
/** Récupération du code ISO de la devise numérique de l'Inpi
|
||||
**
|
||||
** @param integer $devise
|
||||
** @return string Devise ISO
|
||||
**/
|
||||
public function getDeviseInpi($numDeviseInpi) {
|
||||
if ($numDeviseInpi*1>0 && isset($this->tabDevises[$numDeviseInpi*1]))
|
||||
return $this->tabDevises[$numDeviseInpi*1];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTabJugements()
|
||||
{
|
||||
$cache = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . 'Jugements.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.tabJugeRncs', 'codJugement, codEven', '1', false, MYSQL_ASSOC);
|
||||
$tabJug=array();
|
||||
foreach($rep as $k=>$dev)
|
||||
$tabJug[$dev['codJugement']*1]=$dev['codEven'];
|
||||
|
||||
return $tabJug;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCodeEvenJugementInpi($codJugementInpi) {
|
||||
if ($codJugementInpi*1>0 && isset($this->tabJugements[$codJugementInpi*1]))
|
||||
return $this->tabJugements[$codJugementInpi*1];
|
||||
else
|
||||
return $codJugementInpi;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisation du tableau privé des pays Inpi <=> ISO
|
||||
* @return array
|
||||
*/
|
||||
private function getTabPaysInpi()
|
||||
{
|
||||
$cache = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . 'PaysInpi.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.tabPays', 'codePaysInpi, codPays', 'codePaysInpi>0', false, MYSQL_ASSOC);
|
||||
$tabPays=array();
|
||||
foreach($rep as $k=>$dev)
|
||||
$tabPays[$dev['codePaysInpi']*1]=$dev['codPays'];
|
||||
|
||||
return $tabPays;
|
||||
}
|
||||
}
|
||||
|
||||
/** Tableau des mandataires suceptibles d'être tranmis par l'INPI
|
||||
**/
|
||||
private function getTabMandataires() {
|
||||
$tabTmp=$this->iDb->select('jo.tabMandataires', "UPPER(CONCAT(SUBSTRING(Nom,1,4),'-',SUBSTRING(Prenom,1,3))) AS NomPre, SUBSTRING(cp,1,2) AS dep, COUNT(*) AS Nb, sirenMand, id, sirenGrp, Nom, Prenom, type, coursAppel, tribunal, Statut, adresse, adresseComp, cp, ville, tel, fax, email, web, contact", "TYPE IN ('A', 'M') GROUP BY NomPre, dep, sirenMand ORDER BY NomPre ASC", true, MYSQL_ASSOC);
|
||||
$tabMandSD=array();
|
||||
foreach ($tabTmp as $mand) {
|
||||
$tabMandSD[]=array( 'id' => $mand['id'],
|
||||
'siren' => $mand['sirenMand'],
|
||||
'nom' => $mand['Nom'],
|
||||
'prenom'=> $mand['Prenom'],
|
||||
'type' => $mand['type'],
|
||||
'adr1' => $mand['adresse'],
|
||||
'adr2' => $mand['adresseComp'],
|
||||
'cp' => $mand['cp'],
|
||||
'ville' => $mand['ville'],
|
||||
'tel' => $mand['tel'],
|
||||
'fax' => $mand['fax'],
|
||||
'email' => $mand['email'],
|
||||
);
|
||||
}
|
||||
return $tabMandSD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne l'id du mandataire en fonction de son libellé INPI
|
||||
* @param unknown $strNomPrenom
|
||||
* @param string $adresse
|
||||
* @param string $cp
|
||||
* @param string $ville
|
||||
* @param string $debug
|
||||
* @return boolean|Ambigous <multitype:>
|
||||
*/
|
||||
public function getIdMandataireInpi($strNomPrenom, $adresse='', $cp='', $ville='', $debug=false)
|
||||
{
|
||||
$id=false;
|
||||
$cp2=substr($cp,0,2);
|
||||
$this->matching=NULL;
|
||||
if (trim($strNomPrenom)=='') return false;
|
||||
|
||||
//echo "Recherche de '$strNomPrenom, $adresse, $cp $ville' dans les mandataires S&D :".EOL;
|
||||
|
||||
$tabTmp=$this->iDb->select( 'jo.tabMandataires',
|
||||
"id, Nom, Prenom, adresse, adresseComp, cp, ville, MATCH (Nom, Prenom, adresse, adresseComp, ville) AGAINST ('$strNomPrenom $adresse $ville' IN NATURAL LANGUAGE MODE) AS score",
|
||||
"TYPE IN ('A', 'M') AND (Nom<>'' OR Prenom <>'') AND MATCH (Nom, Prenom, adresse, adresseComp, ville) AGAINST ('$strNomPrenom $adresse $ville' IN NATURAL LANGUAGE MODE) ORDER BY score DESC LIMIT 0,10",false, MYSQL_ASSOC);
|
||||
$nbRet=count($tabTmp);
|
||||
if ($nbRet==0) {
|
||||
return false;
|
||||
} elseif($nbRet==1) {
|
||||
//print_r($tabTmp);
|
||||
$this->matching=$tabTmp[0]['score'];
|
||||
return $tabTmp[0]['id'];
|
||||
} else {
|
||||
foreach($tabTmp as $i=>$iRet) {
|
||||
// echo "Recherche de '$strNomPrenom, $adresse, $cp $ville' dans les mandataires S&D :".EOL;
|
||||
if ($debug) echo "je compare '$cp' avec '".$iRet['cp']."' et '$ville' avec '".$iRet["ville"]."' (score=".$iRet['score'].")".EOL;
|
||||
if ((($iRet['cp']==$cp || substr($iRet['cp'],0,2)==$cp2) && ($iRet["ville"]==$ville || preg_replace('/ 0/', ' ',$iRet["ville"])==$ville) || (strpos($iRet["ville"],$ville)>0 && $nbRet==1) || $iRet["score"]>17 ) ||
|
||||
($cp=='' && $ville=='' && $iRet["score"]>6.88 )) {
|
||||
//print_r($iRet);
|
||||
$this->matching=$iRet['score'];
|
||||
return $iRet['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
|
||||
/** Récupération du code ISO du code pays numérique de l'Inpi
|
||||
**
|
||||
** @param integer $pays
|
||||
** @return string Devise ISO
|
||||
**/
|
||||
public function getPaysInpi($numPays) {
|
||||
if ($numPays*1>0)
|
||||
return $this->tabPays[$numPays*1];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisation du tableau privé des codes tribunaux Greffes/Inpi avec le libellé Bodacc
|
||||
* @return array
|
||||
*/
|
||||
private function getTabTribunaux()
|
||||
{
|
||||
$cache = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Cache' . DIRECTORY_SEPARATOR . 'Tribunaux.php';
|
||||
if ( file_exists($cache) ) {
|
||||
return include $cache;
|
||||
} else {
|
||||
$rep=$this->iDb->select('jo.tribunaux', 'triNumGreffe, triNom, triId, triCode', 'triNumGreffe IS NOT NULL', false, MYSQL_ASSOC);
|
||||
$tabTribunaux=array();
|
||||
foreach($rep as $k=>$dev) {
|
||||
$tabTribunaux[$dev['triNumGreffe']*1]['Id']=$dev['triId'];
|
||||
$tabTribunaux[$dev['triNumGreffe']*1]['Nom']=$dev['triNom'];
|
||||
$tabTribunaux[$dev['triNumGreffe']*1]['Code']=$dev['triCode'];
|
||||
}
|
||||
return $tabTribunaux;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Libellé des FJ
|
||||
* @param unknown $code_forme_juridique
|
||||
* @return string
|
||||
*/
|
||||
private function getLibelleFJ($code_forme_juridique)
|
||||
{
|
||||
$fj=$code_forme_juridique*1;
|
||||
if ($fj>0 && $fj<10000) {
|
||||
$tmp=$this->iDb->select('jo.tabFJur', 'libelle AS LibFJ', "code=$fj");
|
||||
return @$tmp[0][0];
|
||||
} else
|
||||
return 'En instance de chiffrement';
|
||||
}
|
||||
|
||||
/**
|
||||
* Libellé des NAF
|
||||
* @param unknown $codeNaf
|
||||
* @return Ambigous <>
|
||||
*/
|
||||
private function getLibelleNaf($codeNaf)
|
||||
{
|
||||
$ret = $this->iDb->query("SELECT libNaf700 AS LibNaf FROM jo.tabNaf4 WHERE codNaf700='$codeNaf'
|
||||
UNION SELECT libNaf5 AS LibNaf FROM jo.tabNaf5 WHERE codNaf5='$codeNaf'");
|
||||
$res = $this->iDb->fetch(MYSQL_ASSOC);
|
||||
return $res['LibNaf'];
|
||||
}
|
||||
|
||||
/** Récupération du libellé du code numérique du tribunal Greffe ou Inpi
|
||||
**
|
||||
** @param integer $numTribunal
|
||||
** @return string Nom du tribunal
|
||||
**/
|
||||
public function getLibTribunal($numTribunal) {
|
||||
if ($numTribunal*1>0)
|
||||
return $this->tabTribunaux[$numTribunal*1]['Nom'];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Récupération du code Bodacc du code numérique du tribunal Greffe ou Inpi
|
||||
**
|
||||
** @param integer $numTribunal
|
||||
** @return string Code Bodacc du tribunal
|
||||
**/
|
||||
public function getCodeBodaccTribunal($numTribunal) {
|
||||
if ($numTribunal*1>0)
|
||||
return $this->tabTribunaux[$numTribunal*1]['Code'];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Récupération de l'identifiant S&D du code numérique du tribunal Greffe ou Inpi
|
||||
**
|
||||
** @param integer $numTribunal
|
||||
** @return string Numéro interne de tribunal S&D
|
||||
**/
|
||||
public function getIdTribunal($numTribunal) {
|
||||
if ($numTribunal*1>0)
|
||||
return $this->tabTribunaux[$numTribunal*1]['Id'];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/** Retourne les informations de l'établissements demandé ou du siège actif ou dernier siège inactif
|
||||
*
|
||||
* @param integer $siren Siren de l'entreprise
|
||||
* @param integer $nic Nic de l'établissement. Si absent, renvoi les informations du siège actif ou du dernier siège actif
|
||||
* @return array
|
||||
*/
|
||||
public function getIdentiteEtab($siren, $nic=0)
|
||||
{
|
||||
$siren=$siren*1;
|
||||
$nic=$nic*1;
|
||||
if ($nic>0) $strSql=" AND nic=$nic";
|
||||
else $strSql=" AND siege=1 ORDER BY actif DESC, nic DESC";
|
||||
|
||||
$rep=$this->iDb->select('jo.rncs_etab', 'siren, nic, siege, actif, enseigne, nomCommercial, adrNumVoie, adrIndRep, adrLibVoie, adrTypeVoie, adrVoie, cp, commune, adrComp, adresse1, adresse2, adresse3, naf, dateFermeture, flux, DATE(dateUpdate) AS jourUpdate', "siren=$siren $strSql", false, MYSQL_ASSOC);
|
||||
if ( count($rep)==0 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$entrep = $rep[0];
|
||||
|
||||
if ($entrep['jourUpdate']<>'0000-00-00') $dateMaj=$entrep['jourUpdate'];
|
||||
else $dateMaj=$entrep['flux'];
|
||||
|
||||
if (trim($entrep['adresse1'])=='') $adresse1=trim(preg_replace('/ +/',' ', $entrep['adrNumVoie'].' '.strtoupper($entrep['adrIndRep']).' '. strtoupper($entrep['adrLibVoie'])));
|
||||
else $adresse1=trim(strtoupper($entrep['adresse1']));
|
||||
if (trim($entrep['adresse2'])=='') $adresse2=trim(strtoupper($entrep['adrComp']));
|
||||
else $adresse2=trim(strtoupper($entrep['adresse2']));
|
||||
if (trim($entrep['adresse3'])=='') $adresse3='';
|
||||
else $adresse3=trim(strtoupper($entrep['adresse3']));
|
||||
$tabIdentite=array(
|
||||
'siren' => $entrep['siren'],
|
||||
'nic' => $entrep['nic'],
|
||||
'siret' => $entrep['siren'].$entrep['nic'],
|
||||
'actif' => $entrep['actif'],
|
||||
'actifEt' => $entrep['actif'],
|
||||
'siege' => $entrep['siege'],
|
||||
'enseigne' => strtoupper($entrep['enseigne']),
|
||||
'nomCommercial' => strtoupper($entrep['nomCommercial']),
|
||||
'adrNumVoie' => $entrep['adrNumVoie'],
|
||||
'adrIndRep' => strtoupper($entrep['adrIndRep']),
|
||||
'adrLibVoie' => strtoupper($entrep['adrLibVoie']),
|
||||
'adrTypeVoie' => strtoupper($entrep['adrTypeVoie']),
|
||||
'adrVoie' => strtoupper($entrep['adrVoie']),
|
||||
'adrComp' => strtoupper($entrep['adrComp']),
|
||||
'cp' => strtoupper($entrep['cp']),
|
||||
'commune' => strtoupper($entrep['commune']),
|
||||
'adresse1' => $adresse1,
|
||||
'adresse2' => $adresse2,
|
||||
'adresse3' => $adresse3,
|
||||
'nafEtab' => $entrep['naf'],
|
||||
'nafEtabLib' => $this->getLibelleNaf($entrep['naf']),
|
||||
'dateFerEtab' => $entrep['dateFermeture'],
|
||||
'dateMajEtab' => $dateMaj,
|
||||
);
|
||||
return array_merge($tabIdentite, $this->getInfosEntrep($siren));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $siren
|
||||
* @return multitype:number unknown mixed string Ambigous Ambigous <>
|
||||
*/
|
||||
public function getInfosEntrep($siren)
|
||||
{
|
||||
$siren=$siren*1;
|
||||
$rep = $this->iDb->select('jo.rncs_entrep', 'siren, sirenValide, actif, numGreffe, triCode, triId, numRC, numRC2, raisonSociale, nom, prenom, nomUsage, sigle, dateNaiss, lieuNaiss, sexe, nationalite, pays, naf, cj, capitalMontant, capitalDevise, capitalDevIso, dateImma, dateRad, capitalType, capitalCent, provisoires, flux, DATE(dateUpdate) AS jourUpdate', "siren=$siren", false, MYSQL_ASSOC);
|
||||
|
||||
if (count($rep)>0) {
|
||||
$entrep=$rep[0];
|
||||
|
||||
if ($entrep['jourUpdate']<>'0000-00-00') $dateMaj=$entrep['jourUpdate'];
|
||||
else $dateMaj=$entrep['flux'];
|
||||
|
||||
$tabIdentite = array(
|
||||
'siren' => $entrep['siren'],
|
||||
'sirenValide' => $entrep['sirenValide'],
|
||||
'actif' => $entrep['actif'],
|
||||
'actifEn' => $entrep['actif'],
|
||||
'numGreffe' => $entrep['numGreffe'],
|
||||
'triCode' => $entrep['triCode'],
|
||||
'triId' => $entrep['triId'],
|
||||
'libGreffe' => preg_replace('/^(TC |TGI |TGIcc |TMX |Tribunal Inconnu)/Ui','', $this->getLibTribunal($entrep['numGreffe']*1)),
|
||||
'numRC' => $entrep['numRC2'],
|
||||
'raisonSociale' => strtoupper($entrep['raisonSociale']),
|
||||
'nom' => strtoupper($entrep['nom']),
|
||||
'prenom' => strtoupper($entrep['prenom']),
|
||||
'nomUsage' => strtoupper($entrep['nomUsage']),
|
||||
'sigle' => strtoupper($entrep['sigle']),
|
||||
'dateNaiss' => $entrep['dateNaiss'],
|
||||
'lieuNaiss' => strtoupper($entrep['lieuNaiss']),
|
||||
'sexe' => $entrep['sexe'],
|
||||
'pays' => $entrep['pays'],
|
||||
'cj' => $entrep['cj'],
|
||||
'cjLib' => $this->getLibelleFJ($entrep['cj']),
|
||||
'nafEnt' => $entrep['naf'],
|
||||
'nafEntLib' => $this->getLibelleNaf($entrep['naf']),
|
||||
'capital' => $entrep['capitalMontant']+($entrep['capitalCent']/100),
|
||||
'capitalDev' => $entrep['capitalDevIso'],
|
||||
'capitalType' => $entrep['capitalType'],
|
||||
'dateImma' => $entrep['dateImma'],
|
||||
'dateRad' => $entrep['dateRad'],
|
||||
'provisoires' => $entrep['provisoires'],
|
||||
'dateMajEnt' => $dateMaj,
|
||||
);
|
||||
|
||||
return $tabIdentite;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $siren
|
||||
* @param string $dateDepot AAAA-MM-JJ
|
||||
* @return array
|
||||
*/
|
||||
public function getListeDepots($siren, $dateDepot = null)
|
||||
{
|
||||
$where = "e.siren=$siren ORDER BY e.dateDepot DESC, e.codeInterne ASC";
|
||||
if (null != $dateDepot) {
|
||||
$where = "e.siren=$siren AND e.dateDepot='$dateDepot'";
|
||||
}
|
||||
|
||||
$rep=$this->iDb->select(
|
||||
'jo.rncs_even e LEFT JOIN jo.tabEvenRncs l ON e.codeEven=l.codeEven',
|
||||
'e.siren, e.codeInterne, e.dateDepot, e.codeEven, l.libEven, e.flux, DATE(e.dateInsert) AS dateInsert',
|
||||
$where, false, MYSQL_ASSOC);
|
||||
|
||||
$tabDepots=array();
|
||||
if (count($rep)>0) {
|
||||
foreach ($rep as $iDepot=>$depot) {
|
||||
$tabDepots[] = array(
|
||||
'codDepot' => $depot['codeEven'],
|
||||
'libDepot' => $depot['libEven'],
|
||||
'datDepot' => $depot['dateDepot'],
|
||||
'refDepot' => $depot['codeInterne'],
|
||||
'datRncs' => $depot['flux'],
|
||||
'datSed' => $depot['dateInsert'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabDepots;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $siren
|
||||
* @return multitype:multitype:NULL unknown Ambigous <multitype:>
|
||||
*/
|
||||
public function getListeJugements($siren)
|
||||
{
|
||||
$siren=$siren*1;
|
||||
$rep=$this->iDb->select(
|
||||
'jo.rncs_jugements j, jo.tabJugeRncs l, jo.tabEvenements e',
|
||||
'siren, j.dateEffet, j.codeJugement, j.flux, l.libJugement, e.codEven, e.libEven,
|
||||
adm1id, adm1codeFct, adm1type, adm1nom, adm1adrNum, adm1adrInd, adm1adrType, adm1adrLibVoie, adm1adrVoie, adm1adr1, adm1adr2, adm1adr3, adm1adrCP, adm1adrVille,
|
||||
adm2id, adm2codeFct, adm2type, adm2nom, adm2adrNum, adm2adrInd, adm2adrType, adm2adrLibVoie, adm2adrVoie, adm2adr1, adm2adr2, adm2adr3, adm2adrCP, adm2adrVille',
|
||||
"j.siren=$siren AND j.codeJugement=l.codJugement AND l.codEven=e.codEven ORDER BY j.dateEffet DESC", false, MYSQL_ASSOC);
|
||||
$tabDepots=array();
|
||||
foreach ($rep as $iDepot=>$depot) {
|
||||
$tabDepots[]=array(
|
||||
'codEven' => $depot['codEven'],
|
||||
'libEven' => $depot['libEven'],
|
||||
'dateEffet' => $depot['dateEffet'],
|
||||
'adm1id' => $depot['adm1id'],
|
||||
'adm1code' => $depot['adm1codeFct'],
|
||||
'adm1type' => $depot['adm1type'],
|
||||
'adm1fonction' => @$this->getLibFctDir($depot['adm1codeFct']),
|
||||
'adm1nom' => $depot['adm1nom'],
|
||||
'adm1adrNum' => $depot['adm1adrNum'],
|
||||
'adm1adrInd' => $depot['adm1adrInd'],
|
||||
'adm1adrType' => $depot['adm1adrType'],
|
||||
'adm1adrVoie' => $depot['adm1adrLibVoie'], // @todo : adm1adr1, , adm1adr3,
|
||||
'adm1adr2' => $depot['adm1adr2'],
|
||||
'adm1adrCP' => $depot['adm1adrCP'],
|
||||
'adm1adrVille' => $depot['adm1adrVille'],
|
||||
'adm2id' => $depot['adm2id'],
|
||||
'adm2code' => $depot['adm2codeFct'],
|
||||
'adm2type' => $depot['adm2type'],
|
||||
'adm2fonction' => @$this->getLibFctDir($depot['adm2codeFct']),
|
||||
'adm2nom' => $depot['adm2nom'],
|
||||
'adm2adrNum' => $depot['adm2adrNum'],
|
||||
'adm2adrInd' => $depot['adm2adrInd'],
|
||||
'adm2adrType' => $depot['adm2adrType'],
|
||||
'adm2adrVoie' => $depot['adm2adrLibVoie'], // @todo : adm1adr1, adm1adr2, adm1adr3,
|
||||
'adm2adr2' => $depot['adm2adr2'],
|
||||
'adm2adrCP' => $depot['adm2adrCP'],
|
||||
'adm2adrVille' => $depot['adm2adrVille'],
|
||||
);
|
||||
}
|
||||
return $tabDepots;
|
||||
}
|
||||
|
||||
public function getEvenements($siren, $nic=0, $type='', $dateDeb='', $dateFin='')
|
||||
{
|
||||
$tabEven=array(
|
||||
'p120'=>'Réactivation de l\'entreprise',
|
||||
'p410'=>'Cessation juridique de l\'entreprise',
|
||||
'pCAP'=>'Modification du capital social',
|
||||
'pCAT'=>'Modification du type de capital',
|
||||
'pCJ' =>'Modification de la forme juridique',
|
||||
'pIMM'=>'Modification de la date d\'immatriculation',
|
||||
'pRAD'=>'Modification de la date de radiation',
|
||||
'pNTR'=>'Modification du greffe d\'enregistrement',
|
||||
'pNRC'=>'Modification du numéro du RC',
|
||||
'pNOM'=>'Modification de la dénomination',
|
||||
);
|
||||
$tabRet=array();
|
||||
$siren=$siren*1;
|
||||
if ($nic>0) $strNic =" AND nic=$nic ";
|
||||
if ($type<>'') $strType=" AND champs='$type' ";
|
||||
if ($dateDeb<>'') $strDateDeb=" AND flux>='$dateDeb' ";
|
||||
if ($dateFin<>'') $strDateFin=" AND flux<='$dateFin' ";
|
||||
|
||||
$rep=$this->iDb->select(
|
||||
'jo.rncs_modifs',
|
||||
'siren, nic, `table`, champs, valeur, flux, dateInsert',
|
||||
"siren=$siren $strNic $strType $strDateDeb $strDateFin AND `table`='rncs_entrep' ORDER BY flux DESC", false, MYSQL_ASSOC);
|
||||
foreach ($rep as $iModif=>$modif) {
|
||||
$codEve=array();
|
||||
switch($modif['champs']) {
|
||||
case 'actif':
|
||||
if ($modif['valeur']*1==0) $codEve[]='410'; // Cessation
|
||||
elseif ($modif['valeur']*1==1) $codEve[]='120'; // Réactivation
|
||||
break;
|
||||
case 'raisonSociale': $codEve[]='NOM'; break;
|
||||
case 'capitalMontant': $codEve[]='CAP'; break;
|
||||
case 'capitalType': $codEve[]='CAT'; break;
|
||||
case 'cj': $codEve[]='CJ'; break;
|
||||
case 'dateImma': $codEve[]='IMM'; break;
|
||||
case 'dateRad': $codEve[]='RAD'; break;
|
||||
case 'numGreffe': $codEve[]='NTR'; break;
|
||||
case 'numRC2': $codEve[]='NRC'; break;
|
||||
}
|
||||
foreach ($codEve as $even) {
|
||||
$tabRet[]=array(
|
||||
'codeEven' => 'P'.$even,
|
||||
'nic' => 0,
|
||||
'siretAssocie'=>0,
|
||||
'typeSiretAss'=>0,
|
||||
'siege' => 1,
|
||||
'libEven' => $tabEven['p'.trim($even)],
|
||||
'libEvenDet'=> '',
|
||||
'dateMAJ' => $modif['dateInsert'],
|
||||
'dateEven' => $modif['flux'],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getIntervenants($siren)
|
||||
{
|
||||
$tabJuge=$this->getListeJugements($siren);
|
||||
$tabDepots=$tabDeja=array();
|
||||
$tabAdm=array( 'A'=>'Administrateur judiciaire',
|
||||
'C'=>'Commissaire au plan',
|
||||
'D'=>'Commissaire au concordat',
|
||||
'H'=>'Huissier',
|
||||
'J'=>'Juge Commissaire',
|
||||
'K'=>'Juge Commissaire suppléant',
|
||||
'L'=>'Liquidateur',
|
||||
'M'=>'Mandataire judiciaire',
|
||||
'N'=>'Notaire',
|
||||
'O'=>'Opposition',
|
||||
'R'=>'Représentant des créanciers',
|
||||
'S'=>'Syndic',
|
||||
'T'=>'Conciliateur',
|
||||
'U'=>'Curateur',
|
||||
'V'=>'Avocat',
|
||||
);
|
||||
foreach ($tabJuge as $iDepot=>$depot) {
|
||||
if ($depot['adm1code']>0 && !in_array($depot['adm1code'], $tabDeja)) {
|
||||
$tabDepots[]=array( 'codEven' => $depot['codEven'],
|
||||
'libEven' => $depot['libEven'],
|
||||
'dateEffet' => $depot['dateEffet'],
|
||||
'admid' => $depot['adm1id'],
|
||||
'admcode' => $depot['adm1code'],
|
||||
'admtype' => $depot['adm1type'],
|
||||
'admfonction' => $depot['adm1fonction'],
|
||||
'admnom' => $depot['adm1nom'],
|
||||
'admadrNum' => $depot['adm1adrNum'],
|
||||
'admadrInd' => $depot['adm1adrInd'],
|
||||
'admadrType' => $depot['adm1adrType'],
|
||||
'admadrVoie' => $depot['adm1adrVoie'], // @todo : adm1adr1, adm1adr2, adm1adr3,
|
||||
'admadr2' => $depot['adm1adr2'],
|
||||
'admadrCP' => $depot['adm1adrCP'],
|
||||
'admadrVille' => $depot['adm1adrVille'],
|
||||
);
|
||||
$tabDeja[]=$depot['adm1code'];
|
||||
}
|
||||
if ($depot['adm2code']>0 && !in_array($depot['adm2code'], $tabDeja)) {
|
||||
$tabDepots[]=array( 'codEven' => $depot['codEven'],
|
||||
'libEven' => $depot['libEven'],
|
||||
'dateEffet' => $depot['dateEffet'],
|
||||
'admid' => $depot['adm2id'],
|
||||
'admcode' => $depot['adm2code'],
|
||||
'admtype' => $depot['adm2type'],
|
||||
'admfonction' => $depot['adm2fonction'],
|
||||
'admnom' => $depot['adm2nom'],
|
||||
'admadrNum' => $depot['adm2adrNum'],
|
||||
'admadrInd' => $depot['adm2adrInd'],
|
||||
'admadrType' => $depot['adm2adrType'],
|
||||
'admadrVoie' => $depot['adm2adrVoie'], // @todo : adm1adr1, adm1adr2, adm1adr3,
|
||||
'admadr2' => $depot['adm2adr2'],
|
||||
'admadrCP' => $depot['adm2adrCP'],
|
||||
'admadrVille' => $depot['adm2adrVille'],
|
||||
);
|
||||
$tabDeja[]=$depot['adm2code'];
|
||||
}
|
||||
}
|
||||
if (count($tabDepots)>0) {
|
||||
$strTypes="IN ('J','K','H','V','N')";
|
||||
$forceRecherche=false;
|
||||
$strDates="AND ABS(DATEDIFF(dateJugement, '".$depot['dateEffet']."'))<60 ";
|
||||
} else {
|
||||
$strTypes="<>''";
|
||||
$forceRecherche=true;
|
||||
$strDates='';
|
||||
}
|
||||
|
||||
$tabTmp=$this->iDb->select('jo.annonces', 'id, siren, typeEven, dateJugement, dateCessationPaiement, inter1type, inter1id, inter1nom, inter2type, inter2id, inter2nom, inter3type, inter3id, inter3nom, inter4type, inter4id, inter4nom,
|
||||
dateSource, dateInsert, source, tribunal, raisonSociale',"siren=$siren $strDates AND ( inter1type $strTypes OR inter2type $strTypes OR inter3type $strTypes OR inter4type $strTypes ) AND typeEven BETWEEN 1000 AND 2000 ORDER BY dateJugement DESC", false, MYSQL_ASSOC);
|
||||
if (isset($tabTmp[0])) {
|
||||
$depot=$tabTmp[0];
|
||||
$tabRet['dateCessationPaiement']=$depot['dateCessationPaiement'];
|
||||
for($i=1; $i<4; $i++) {
|
||||
if ( ($forceRecherche && !in_array($tabTmp['inter'.$i.'type'], $tabDeja)) ||
|
||||
( $tabTmp['inter'.$i.'type']=='J' || $tabTmp['inter'.$i.'type']=='K' ||
|
||||
$tabTmp['inter'.$i.'type']=='H' || $tabTmp['inter'.$i.'type']=='V' ||
|
||||
$tabTmp['inter'.$i.'type']=='N') ) {
|
||||
$tabDepots[]=array( 'codEven' => $depot['typeEven'],
|
||||
'libEven' => $depot['typeEven'],
|
||||
'dateEffet' => $depot['dateJugement'],
|
||||
'admid' => $depot['inter'.$i.'id'],
|
||||
'admcode' => $depot['inter'.$i.'id'],
|
||||
'admtype' => $depot['inter'.$i.'type'],
|
||||
'admfonction' => $tabAdm[$depot['inter'.$i.'type']],
|
||||
'admnom' => $depot['inter'.$i.'nom'],
|
||||
'admadrNum' => '',
|
||||
'admadrInd' => '',
|
||||
'admadrType' => '',
|
||||
'admadrVoie' => '',
|
||||
'admadr2' => '',
|
||||
'admadrCP' => '',
|
||||
'admadrVille' => '',
|
||||
);
|
||||
$tabDeja[]=$tabTmp['inter'.$i.'type'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tabDepots;
|
||||
}
|
||||
|
||||
/** Mettre à jour un dossier IMR dans le prochain Flux
|
||||
* @param $siren Siren de l'entreprise à mettre à jour dans les IMR
|
||||
* @param $origineDemande Origine de la demande ('client', 'interne', 'privileges', 'ancienort')
|
||||
* @param $focerMAJ Forcer la mise à jour même si dossier déjà transmit
|
||||
*/
|
||||
public function majDossierIMR($siren, $origineDemande='', $focerMAJ=false) {
|
||||
|
||||
$this->infoIMR=array();
|
||||
if ($siren*1==0) {
|
||||
$this->libErreur='Siren invalide !';
|
||||
return false;
|
||||
}
|
||||
$query_timeout=5;
|
||||
$query_proxy='221.130.13.39';
|
||||
$query_proxy='61.35.191.250:8080';
|
||||
$query_proxy='198.7.242.41:3128';
|
||||
$query_proxy='';
|
||||
if (INFOGREFFE_DISPO_WEB) {
|
||||
/** Accueil **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/accueil.do';
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 1. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, '', '', $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
$this->codeRetour=$page['code'];
|
||||
//echo date('YmdHis')." - 1. FIN $url ".$this->codeRetour.EOL;
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
print_r($page);
|
||||
$this->libErreur='Erreur Infogreffe 200a !';
|
||||
return false;
|
||||
}
|
||||
$this->cookie=$page['header']['Set-Cookie'];
|
||||
$this->referer=$url;
|
||||
sleep(1);
|
||||
|
||||
/** Formulaire de login **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/connexion.do';
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 2. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, '', '', $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
//echo date('YmdHis')." - 2. FIN $url ".$this->codeRetour.EOL;
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
print_r($page);
|
||||
$this->libErreur='Erreur Infogreffe 200b !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
sleep(1);
|
||||
|
||||
/** Etape de logon **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/login.do';
|
||||
$postData=array('codeClient'=>'0034',
|
||||
'codeAbonne'=>'0002',
|
||||
'password'=>'369852',
|
||||
);
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 3. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
$this->codeRetour=$page['code'];
|
||||
//echo date('YmdHis')." - 3. FIN $url ".$this->codeRetour.EOL;
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
print_r($page);
|
||||
$this->libErreur='Erreur Infogreffe 200c !';
|
||||
return false;
|
||||
}
|
||||
if (!preg_match('/Bienvenue SCORES ET DECISIONS/', $this->body)) {
|
||||
$this->libErreur='Erreur Infogreffe Extranet : Connexion incorrecte !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
sleep(1);
|
||||
|
||||
/** Page de formulaire de demande de réémission de dossier IMR **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/demandeReemissions.do';
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 4. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, $this->cookie, '', $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
$this->codeRetour=$page['code'];
|
||||
//echo date('YmdHis')." - 4. FIN $url ".$this->codeRetour.EOL;
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
print_r($page);
|
||||
$this->libErreur='Erreur Infogreffe 200d !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
sleep(1);
|
||||
|
||||
/** Saisie du siren à contrôler dans le formulaire AJAX adéquat **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/rechercheReemissions.do';
|
||||
$postData=array('siren'=>$siren);
|
||||
//$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.infogreffe.fr', false, '', '', 5);
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 5. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
$this->codeRetour=$page['code'];
|
||||
//echo date('YmdHis')." - 5. FIN $url ".$this->codeRetour.EOL;
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
print_r($page);
|
||||
$this->libErreur='Erreur Infogreffe 200e !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
|
||||
// Le retour AJAX est il positif ?
|
||||
if (preg_match('/<div class="message-erreur">(.*)<\/div>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['message-erreur']=trim(preg_replace('/ +/',' ',strip_tags($matches[1])));
|
||||
|
||||
if (preg_match('/<div class="titreEntreprise">(?:.*)<b>(.*)<\/b>(?:.*)<\/div>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['titreEntreprise']=trim(preg_replace('/ +/',' ',strip_tags($matches[1])));
|
||||
|
||||
if (preg_match('/<div id="adresse">(.*)<\/div>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['adresse']=trim(preg_replace('/ +/',' ',strip_tags($matches[1])));
|
||||
|
||||
if (preg_match('/<div class="struct-erreur">(?:.*)<b>(.*)<\/b>(?:.*)<\/div>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['struct-erreur']=trim(preg_replace('/ +/',' ',strtr(strip_tags($matches[1]),"\r\n\t".chr(160),' ')));
|
||||
|
||||
if (preg_match('/Cliquez sur le bouton VALIDER pour confirmer votre demande de/', $this->body, $matches))
|
||||
$this->infoIMR['validation']=true;
|
||||
else {
|
||||
$this->infoIMR['validation']=false;
|
||||
if (preg_match('/Aucune entreprise trouv.e pour ce num.ro SIREN/u', $this->body)) {
|
||||
$tabInsert=$this->infoIMR;
|
||||
$tabInsert['siren']=$siren;
|
||||
$tabInsert['dateDemande']=date('Ymd');
|
||||
if ($origineDemande<>'')
|
||||
$tabInsert['origineDemande']=$origineDemande;
|
||||
$this->iDb->insert('jo.rncs_demandes', $tabInsert, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match('/atteint le nombre maximal de(.*)Veuillez renouveler votre demande demain/',
|
||||
$this->infoIMR['message-erreur']))
|
||||
return false;
|
||||
|
||||
if ($this->infoIMR['validation'] && $this->infoIMR['message-erreur']=='') {
|
||||
/** Doit on forcer la maj si l'entreprise a été transmise récemment ? **/
|
||||
if ($this->infoIMR['struct-erreur']<>'' && !$focerMAJ)
|
||||
return true;
|
||||
|
||||
sleep(1);
|
||||
/** Validation du siren à réémettre en IMR **/
|
||||
$url='http://www.infogreffe.fr/ged-extranet/validerDemandeReemission.do';
|
||||
$postData=array('numIdentification'=>$siren);
|
||||
//$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.infogreffe.fr', false, '', '', 5);
|
||||
while (1) {
|
||||
//echo date('YmdHis')." - 6. Deb $url ".$this->codeRetour.EOL;
|
||||
$page=getUrl($url, $this->cookie, $postData, $this->referer, false, 'www.infogreffe.fr', false, '', $query_proxy, $query_timeout);
|
||||
$this->codeRetour=$page['code'];
|
||||
//echo date('YmdHis')." - 6. FIN $url ".$this->codeRetour.EOL;
|
||||
if ($this->codeRetour<>'400') break;
|
||||
sleep(1);
|
||||
}
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
if ($this->codeRetour<>'200') {
|
||||
$this->libErreur='Erreur Infogreffe 200f !';
|
||||
return false;
|
||||
}
|
||||
$this->referer=$url;
|
||||
// Lecture du retour
|
||||
if (preg_match('/<div class="message-erreur">(.*)<\/div>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['validation-erreur']=trim(preg_replace('/ +/',' ',strip_tags($matches[1])));
|
||||
if (preg_match('/<b class="texte-bleu">(.*)<\/b>/Uis', $this->body, $matches))
|
||||
$this->infoIMR['validation-ok']=trim(preg_replace('/ +/',' ',strip_tags($matches[1])));
|
||||
|
||||
$tabInsert=$this->infoIMR;
|
||||
$tabInsert['siren']=$siren;
|
||||
$tabInsert['dateDemande']=date('Ymd');
|
||||
if ($origineDemande<>'')
|
||||
$tabInsert['origineDemande']=$origineDemande;
|
||||
$this->iDb->insert('jo.rncs_demandes', $tabInsert, false);
|
||||
|
||||
// Une erreur ?
|
||||
if ($this->infoIMR['validation-erreur']<>'')
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
} else
|
||||
$this->libErreur='Infogreffe indisponible !';
|
||||
return false;
|
||||
}
|
||||
|
||||
function getDirigeantsPrin($siren, $nbDirs=2) {
|
||||
$siren=$siren*1;
|
||||
$tabRet=array();
|
||||
$dirs=$this->iDb->select(
|
||||
'jo.rncs_dirigeants',
|
||||
'siren, raisonSociale, dirRS, civilite, nom, prenom, naissance_nom, naissance_date, naissance_lieu, fonction_code, fonction_lib, cinf, dateFin, flux, dateInsert',
|
||||
"siren=$siren AND actif%10=1 ORDER BY fonction_code DESC", true, MYSQL_ASSOC);
|
||||
$numDir=0;
|
||||
foreach ($dirs as $k=>$dir) {
|
||||
$numDir++;
|
||||
if ($dir['naissance_date']<>'0000-00-00')
|
||||
$dateNaiss=Wdate::dateT('Y-m-d','d/m/Y', $dir['naissance_date']);
|
||||
else
|
||||
$dateNaiss='';
|
||||
if ($dir['flux']<>'0000-00-00')
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['flux']);
|
||||
else
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['dateInsert']);
|
||||
$nom=trim($dir['nom']);
|
||||
$nomUsage='';
|
||||
if (trim($dir['naissance_nom'])<>'') {
|
||||
$nom=trim($dir['naissance_nom']);
|
||||
$nomUsage=trim($dir['nom']);
|
||||
}
|
||||
$tabRet[]=array( 'Fonction' =>$dir['fonction_code'],
|
||||
'Titre' =>$dir['fonction_lib'],
|
||||
'Societe' =>$dir['dirRS'],
|
||||
'Civilite' =>$dir['civilite'],
|
||||
'Nom' =>$nom,
|
||||
'Prenom' =>$dir['prenom'],
|
||||
'NomUsage' =>$nomUsage,
|
||||
'NaissDate' =>$dateNaiss,
|
||||
'NaissVille' =>$dir['naissance_lieu'],
|
||||
'NaissDepPays' =>'', // 25
|
||||
'Ancien' =>0,
|
||||
'DateFct' =>$dateModif,
|
||||
'Cinf' =>$dir['cinf'],
|
||||
);
|
||||
if ($numDir>=$nbDirs) break;
|
||||
}
|
||||
if ($numDir==0) {
|
||||
$dirs=$this->iDb->select(
|
||||
'jo.rncs_entrep',
|
||||
"siren, raisonSociale, '' AS dirRS, IF(sexe='M', 'M', IF(sexe='F', 'MME', '')) AS civilite, nom, prenom, nomUsage AS naissance_nom, dateNaiss AS naissance_date, lieuNaiss AS naissance_lieu, 1050 AS fonction_code, 'Personne Physique' AS fonction_lib, 0 AS cinf, dateFer AS dateFin, flux, dateInsert",
|
||||
"siren=$siren", true, MYSQL_ASSOC);
|
||||
$numDir=0;
|
||||
foreach ($dirs as $k=>$dir) {
|
||||
$numDir++;
|
||||
if ($dir['naissance_date']<>'0000-00-00')
|
||||
$dateNaiss=Wdate::dateT('Y-m-d','d/m/Y', $dir['naissance_date']);
|
||||
else
|
||||
$dateNaiss='';
|
||||
if ($dir['flux']<>'0000-00-00')
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['flux']);
|
||||
else
|
||||
$dateModif=Wdate::dateT('Y-m-d','d/m/Y', $dir['dateInsert']);
|
||||
$nom=trim($dir['nom']);
|
||||
$nomUsage='';
|
||||
if (trim($dir['naissance_nom'])<>'') {
|
||||
$nom=trim($dir['naissance_nom']);
|
||||
$nomUsage=trim($dir['nom']);
|
||||
}
|
||||
$tabRet[]=array( 'Fonction' =>$dir['fonction_code'],
|
||||
'Titre' =>$dir['fonction_lib'],
|
||||
'Societe' =>$dir['dirRS'],
|
||||
'Civilite' =>$dir['civilite'],
|
||||
'Nom' =>$nom,
|
||||
'Prenom' =>$dir['prenom'],
|
||||
'NomUsage' =>$nomUsage,
|
||||
'NaissDate' =>$dateNaiss,
|
||||
'NaissVille' =>$dir['naissance_lieu'],
|
||||
'NaissDepPays' =>'', // 25
|
||||
'Ancien' =>0,
|
||||
'DateFct' =>$dateModif,
|
||||
'Cinf' =>$dir['cinf'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@ -1,922 +0,0 @@
|
||||
<?php
|
||||
global $tabOrt2Sd;
|
||||
$tabOrt2Sd=array( '_130000001'=>'SIREN',
|
||||
'_103000040'=>'CONSOLIDE',
|
||||
'_103000033'=>'DATE_CLOTURE',
|
||||
'_103000023'=>'DUREE_MOIS',
|
||||
'_103000202'=>'MONNAIE_ORI',
|
||||
'_103000205'=>'MONNAIE_ORI_UNITE',
|
||||
'_103000211'=>'MONNAIE',
|
||||
'_103000214'=>'MONNAIE_LIV_UNITE',
|
||||
'_103000029'=>'AVIS_CAC',
|
||||
'_130000009'=>'CODE_NAF',
|
||||
'_103101001'=>'AA',
|
||||
'_103101002'=>'AB',
|
||||
'_103101003'=>'AC',
|
||||
'_103101004'=>'AC1',
|
||||
'_103101005'=>'AD',
|
||||
'_103101006'=>'AE',
|
||||
'_103101007'=>'AE1',
|
||||
'_103101008'=>'AF',
|
||||
'_103101009'=>'AG',
|
||||
'_103101010'=>'AG1',
|
||||
'_103101011'=>'AH',
|
||||
'_103101012'=>'AI',
|
||||
'_103101013'=>'AI1',
|
||||
'_103101014'=>'AJ',
|
||||
'_103101015'=>'AK',
|
||||
'_103101016'=>'AK1',
|
||||
'_103101017'=>'AL',
|
||||
'_103101018'=>'AM',
|
||||
'_103101019'=>'AM1',
|
||||
'_103101020'=>'AN',
|
||||
'_103101021'=>'AO',
|
||||
'_103101022'=>'AO1',
|
||||
'_103101023'=>'AP',
|
||||
'_103101024'=>'AQ',
|
||||
'_103101025'=>'AQ1',
|
||||
'_103101026'=>'AR',
|
||||
'_103101027'=>'AS',
|
||||
'_103101028'=>'AS1',
|
||||
'_103101029'=>'AT',
|
||||
'_103101030'=>'AU',
|
||||
'_103101031'=>'AU1',
|
||||
'_103101032'=>'AV',
|
||||
'_103101033'=>'AW',
|
||||
'_103101034'=>'AW1',
|
||||
'_103101035'=>'AX',
|
||||
'_103101036'=>'AY',
|
||||
'_103101037'=>'AY1',
|
||||
'_103101038'=>'CS',
|
||||
'_103101039'=>'CT',
|
||||
'_103101040'=>'CT1',
|
||||
'_103101041'=>'CU',
|
||||
'_103101042'=>'CV',
|
||||
'_103101043'=>'CV1',
|
||||
'_103101044'=>'BB',
|
||||
'_103101045'=>'BC',
|
||||
'_103101046'=>'BC1',
|
||||
'_103101047'=>'BD',
|
||||
'_103101048'=>'BE',
|
||||
'_103101049'=>'BE1',
|
||||
'_103101050'=>'BF',
|
||||
'_103101051'=>'BG',
|
||||
'_103101052'=>'BG1',
|
||||
'_103101053'=>'BH',
|
||||
'_103101054'=>'BI',
|
||||
'_103101055'=>'BI1',
|
||||
'_103101056'=>'BJ',
|
||||
'_103101057'=>'BK',
|
||||
'_103101058'=>'BK1',
|
||||
'_103101059'=>'BL',
|
||||
'_103101060'=>'BM',
|
||||
'_103101061'=>'BM1',
|
||||
'_103101062'=>'BN',
|
||||
'_103101063'=>'BO',
|
||||
'_103101064'=>'BO1',
|
||||
'_103101065'=>'BP',
|
||||
'_103101066'=>'BQ',
|
||||
'_103101067'=>'BQ1',
|
||||
'_103101068'=>'BR',
|
||||
'_103101069'=>'BS',
|
||||
'_103101070'=>'BS1',
|
||||
'_103101071'=>'BT',
|
||||
'_103101072'=>'BU',
|
||||
'_103101073'=>'BU1',
|
||||
'_103101074'=>'BV',
|
||||
'_103101075'=>'BW',
|
||||
'_103101076'=>'BW1',
|
||||
'_103101077'=>'BX',
|
||||
'_103101078'=>'BY',
|
||||
'_103101079'=>'BY1',
|
||||
'_103101080'=>'BZ',
|
||||
'_103101081'=>'CA',
|
||||
'_103101082'=>'CA1',
|
||||
'_103101083'=>'CB',
|
||||
'_103101084'=>'CC',
|
||||
'_103101085'=>'CC1',
|
||||
'_103101086'=>'CD',
|
||||
'_103101087'=>'CE',
|
||||
'_103101088'=>'CE1',
|
||||
'_103101089'=>'CF',
|
||||
'_103101090'=>'CG',
|
||||
'_103101091'=>'CG1',
|
||||
'_103101092'=>'CH',
|
||||
'_103101093'=>'CI',
|
||||
'_103101094'=>'CI1',
|
||||
'_103101095'=>'CJ',
|
||||
'_103101096'=>'CK',
|
||||
'_103101097'=>'CK1',
|
||||
'_103101098'=>'CL',
|
||||
'_103101099'=>'CM',
|
||||
'_103101100'=>'CN',
|
||||
'_103101101'=>'CO',
|
||||
'_103101102'=>'1A',
|
||||
'_103101103'=>'1A1',
|
||||
'_103101104'=>'CP',
|
||||
'_103101105'=>'CR',
|
||||
'_103102001'=>'DA',
|
||||
'_103102002'=>'DB',
|
||||
'_103102003'=>'EK',
|
||||
'_103102004'=>'DC',
|
||||
'_103102005'=>'DD',
|
||||
'_103102006'=>'DE',
|
||||
'_103102007'=>'DF',
|
||||
'_103102008'=>'DG',
|
||||
'_103102009'=>'DH',
|
||||
'_103102010'=>'DI',
|
||||
'_103102011'=>'DJ',
|
||||
'_103102012'=>'DK',
|
||||
'_103102013'=>'DL',
|
||||
'_103102014'=>'DM',
|
||||
'_103102015'=>'DN',
|
||||
'_103102016'=>'DO',
|
||||
'_103102017'=>'DP',
|
||||
'_103102018'=>'DQ',
|
||||
'_103102019'=>'DR',
|
||||
'_103102020'=>'DS',
|
||||
'_103102021'=>'DT',
|
||||
'_103102022'=>'DU',
|
||||
'_103102023'=>'DV',
|
||||
'_103102024'=>'DW',
|
||||
'_103102025'=>'DX',
|
||||
'_103102026'=>'DY',
|
||||
'_103102027'=>'DZ',
|
||||
'_103102028'=>'EA',
|
||||
'_103102029'=>'EB',
|
||||
'_103102030'=>'EC',
|
||||
'_103102031'=>'ED',
|
||||
'_103102032'=>'EE',
|
||||
'_103102033'=>'EF',
|
||||
'_103102034'=>'EG',
|
||||
'_103102035'=>'EH',
|
||||
'_103102036'=>'EI',
|
||||
'_103103001'=>'FA',
|
||||
'_103103002'=>'FB',
|
||||
'_103103003'=>'FC',
|
||||
'_103103004'=>'FD',
|
||||
'_103103005'=>'FE',
|
||||
'_103103006'=>'FF',
|
||||
'_103103007'=>'FG',
|
||||
'_103103008'=>'FH',
|
||||
'_103103009'=>'FI',
|
||||
'_103103010'=>'FJ',
|
||||
'_103103011'=>'FK',
|
||||
'_103103012'=>'FL',
|
||||
'_103103013'=>'FM',
|
||||
'_103103014'=>'FN',
|
||||
'_103103015'=>'FO',
|
||||
'_103103016'=>'FP',
|
||||
'_103103017'=>'FQ',
|
||||
'_103103018'=>'FR',
|
||||
'_103103019'=>'FS',
|
||||
'_103103020'=>'FT',
|
||||
'_103103021'=>'FU',
|
||||
'_103103022'=>'FV',
|
||||
'_103103023'=>'FW',
|
||||
'_103103024'=>'FX',
|
||||
'_103103025'=>'FY',
|
||||
'_103103026'=>'FZ',
|
||||
'_103103027'=>'GA',
|
||||
'_103103028'=>'GB',
|
||||
'_103103029'=>'GC',
|
||||
'_103103030'=>'GD',
|
||||
'_103103031'=>'GE',
|
||||
'_103103032'=>'GF',
|
||||
'_103103033'=>'GG',
|
||||
'_103103034'=>'GH',
|
||||
'_103103035'=>'GI',
|
||||
'_103103036'=>'GJ',
|
||||
'_103103037'=>'GK',
|
||||
'_103103038'=>'GL',
|
||||
'_103103039'=>'GM',
|
||||
'_103103040'=>'GN',
|
||||
'_103103041'=>'GO',
|
||||
'_103103042'=>'GP',
|
||||
'_103103043'=>'GQ',
|
||||
'_103103044'=>'GR',
|
||||
'_103103045'=>'GS',
|
||||
'_103103046'=>'GT',
|
||||
'_103103047'=>'GU',
|
||||
'_103103048'=>'GV',
|
||||
'_103103049'=>'GW',
|
||||
'_103103050'=>'HA',
|
||||
'_103103051'=>'HB',
|
||||
'_103103052'=>'HC',
|
||||
'_103103053'=>'HD',
|
||||
'_103103054'=>'HE',
|
||||
'_103103055'=>'HF',
|
||||
'_103103056'=>'HG',
|
||||
'_103103057'=>'HH',
|
||||
'_103103058'=>'HI',
|
||||
'_103103059'=>'HJ',
|
||||
'_103103060'=>'HK',
|
||||
'_103103061'=>'HL',
|
||||
'_103103062'=>'HM',
|
||||
'_103103063'=>'HN',
|
||||
'_103103064'=>'HP',
|
||||
'_103103065'=>'HQ',
|
||||
'_103104077'=>'A1',
|
||||
'_103104078'=>'A2',
|
||||
'_103104079'=>'A3',
|
||||
'_103104080'=>'A4',
|
||||
'_103104001'=>'KF',
|
||||
'_103104002'=>'LP',
|
||||
'_103104003'=>'0J',
|
||||
'_103104004'=>'MY',
|
||||
'_103104005'=>'NC',
|
||||
'_103104006'=>'2E',
|
||||
'_103104007'=>'0K',
|
||||
'_103104008'=>'PD',
|
||||
'_103104009'=>'PH',
|
||||
'_103104010'=>'QX',
|
||||
'_103104011'=>'ON',
|
||||
'_103104012'=>'OP',
|
||||
'_103104013'=>'OQ',
|
||||
'_103104014'=>'OR',
|
||||
'_103104015'=>'SM',
|
||||
'_103104016'=>'SP',
|
||||
'_103104017'=>'5R',
|
||||
'_103104018'=>'5S',
|
||||
'_103104019'=>'5T',
|
||||
'_103104020'=>'5U',
|
||||
'_103104021'=>'7B',
|
||||
'_103104022'=>'TY',
|
||||
'_103104023'=>'TZ',
|
||||
'_103104024'=>'UA',
|
||||
'_103104025'=>'UF',
|
||||
'_103104026'=>'UH',
|
||||
'_103104027'=>'UK',
|
||||
'_103104028'=>'UM',
|
||||
'_103104029'=>'UR',
|
||||
'_103104030'=>'UV',
|
||||
'_103104031'=>'VA',
|
||||
'_103104032'=>'UY',
|
||||
'_103104033'=>'UZ',
|
||||
'_103104034'=>'VB',
|
||||
'_103104035'=>'VN',
|
||||
'_103104036'=>'VT',
|
||||
'_103104037'=>'VU',
|
||||
'_103104038'=>'VV',
|
||||
'_103104039'=>'7Y1',
|
||||
'_103104040'=>'7Z1',
|
||||
'_103104041'=>'VG',
|
||||
'_103104042'=>'VG1',
|
||||
'_103104043'=>'VH',
|
||||
'_103104044'=>'VH1',
|
||||
'_103104045'=>'8A1',
|
||||
'_103104046'=>'8B1',
|
||||
'_103104047'=>'8C',
|
||||
'_103104048'=>'8C1',
|
||||
'_103104049'=>'8D',
|
||||
'_103104050'=>'8D1',
|
||||
'_103104051'=>'8E1',
|
||||
'_103104052'=>'VW',
|
||||
'_103104053'=>'VW1',
|
||||
'_103104054'=>'VX',
|
||||
'_103104055'=>'VX1',
|
||||
'_103104056'=>'VQ',
|
||||
'_103104057'=>'VQ1',
|
||||
'_103104058'=>'8J1',
|
||||
'_103104059'=>'VI',
|
||||
'_103104060'=>'VI1',
|
||||
'_103104061'=>'8K1',
|
||||
'_103104062'=>'SZ1',
|
||||
'_103104063'=>'8L1',
|
||||
'_103104064'=>'VY',
|
||||
'_103104065'=>'VZ',
|
||||
'_103104066'=>'VZ1',
|
||||
'_103104067'=>'VZ2',
|
||||
'_103104068'=>'YQ',
|
||||
'_103104069'=>'YR',
|
||||
'_103104070'=>'YS',
|
||||
'_103104071'=>'YT',
|
||||
'_103104072'=>'YU',
|
||||
'_103104073'=>'YV',
|
||||
'_103104074'=>'YY',
|
||||
'_103104075'=>'YZ',
|
||||
'_103104076'=>'YP',
|
||||
'_103104081'=>'CZ',
|
||||
'_103104082'=>'KB',
|
||||
'_103104083'=>'KC',
|
||||
'_103104084'=>'KD',
|
||||
'_103104085'=>'KE',
|
||||
'_103104086'=>'LN',
|
||||
'_103104087'=>'LO',
|
||||
'_103104088'=>'LQ',
|
||||
'_103104089'=>'LR',
|
||||
'_103104090'=>'LS',
|
||||
'_103104091'=>'0G',
|
||||
'_103104092'=>'0H',
|
||||
'_103104093'=>'NL',
|
||||
'_103104094'=>'LT',
|
||||
'_103104095'=>'LU',
|
||||
'_103104096'=>'NO',
|
||||
'_103104097'=>'LV',
|
||||
'_103104098'=>'LW',
|
||||
'_103104099'=>'NN',
|
||||
'_103104100'=>'NG',
|
||||
'_103104101'=>'NH',
|
||||
'_103104102'=>'NM',
|
||||
'_103104103'=>'NJ',
|
||||
'_103104104'=>'NK',
|
||||
'_103104105'=>'NP',
|
||||
'_103104106'=>'0L',
|
||||
'_103104107'=>'PA',
|
||||
'_103104108'=>'PB',
|
||||
'_103104109'=>'PC',
|
||||
'_103104110'=>'PE',
|
||||
'_103104111'=>'PF',
|
||||
'_103104112'=>'PG',
|
||||
'_103104113'=>'QU',
|
||||
'_103104114'=>'QV',
|
||||
'_103104115'=>'QW',
|
||||
'_103104116'=>'Z91',
|
||||
'_103104117'=>'Z92',
|
||||
'_103104118'=>'SN',
|
||||
'_103104119'=>'SP_1',
|
||||
'_103104120'=>'SP_2',
|
||||
'_103104121'=>'SR',
|
||||
'_103104122'=>'TO',
|
||||
'_103104123'=>'3Z',
|
||||
'_103104124'=>'TS',
|
||||
'_103104125'=>'TT',
|
||||
'_103104126'=>'TU',
|
||||
'_103104127'=>'4D',
|
||||
'_103104128'=>'4H',
|
||||
'_103104129'=>'4M',
|
||||
'_103104130'=>'4S',
|
||||
'_103104131'=>'4W',
|
||||
'_103104132'=>'5A',
|
||||
'_103104133'=>'5E',
|
||||
'_103104134'=>'5K',
|
||||
'_103104135'=>'5P',
|
||||
'_103104136'=>'5Y',
|
||||
'_103104137'=>'5Z',
|
||||
'_103104138'=>'TV',
|
||||
'_103104139'=>'TW',
|
||||
'_103104140'=>'TX',
|
||||
'_103104141'=>'6A',
|
||||
'_103104142'=>'6B',
|
||||
'_103104143'=>'6C',
|
||||
'_103104144'=>'6D',
|
||||
'_103104145'=>'6E',
|
||||
'_103104146'=>'6F',
|
||||
'_103104147'=>'6G',
|
||||
'_103104148'=>'6H',
|
||||
'_103104149'=>'02',
|
||||
'_103104150'=>'03',
|
||||
'_103104151'=>'04',
|
||||
'_103104152'=>'05',
|
||||
'_103104153'=>'06',
|
||||
'_103104154'=>'07',
|
||||
'_103104155'=>'08',
|
||||
'_103104156'=>'09',
|
||||
'_103104157'=>'6N',
|
||||
'_103104158'=>'6P',
|
||||
'_103104159'=>'6R',
|
||||
'_103104160'=>'6S',
|
||||
'_103104161'=>'6T',
|
||||
'_103104162'=>'6U',
|
||||
'_103104163'=>'6V',
|
||||
'_103104164'=>'6W',
|
||||
'_103104165'=>'6X',
|
||||
'_103104166'=>'6Y',
|
||||
'_103104167'=>'6Z',
|
||||
'_103104168'=>'7A',
|
||||
'_103104169'=>'7C',
|
||||
'_103104170'=>'UB',
|
||||
'_103104171'=>'UC',
|
||||
'_103104172'=>'UD',
|
||||
'_103104173'=>'UE',
|
||||
'_103104174'=>'UG',
|
||||
'_103104175'=>'UJ',
|
||||
'_103104176'=>'UL',
|
||||
'_103104177'=>'UP',
|
||||
'_103104178'=>'UT',
|
||||
'_103104179'=>'UX',
|
||||
'_103104180'=>'UQ',
|
||||
'_103104181'=>'UU',
|
||||
'_103104182'=>'VM',
|
||||
'_103104183'=>'VP',
|
||||
'_103104184'=>'VC',
|
||||
'_103104185'=>'VR',
|
||||
'_103104186'=>'VS',
|
||||
'_103104187'=>'7Y',
|
||||
'_103104188'=>'7Y2',
|
||||
'_103104189'=>'7Z',
|
||||
'_103104190'=>'7Z2',
|
||||
'_103104191'=>'VG2',
|
||||
'_103104192'=>'VH2',
|
||||
'_103104193'=>'8A',
|
||||
'_103104194'=>'8A2',
|
||||
'_103104195'=>'8B',
|
||||
'_103104196'=>'8B2',
|
||||
'_103104197'=>'8C2',
|
||||
'_103104198'=>'8D2',
|
||||
'_103104199'=>'8E',
|
||||
'_103104200'=>'8E2',
|
||||
'_103104201'=>'VW2',
|
||||
'_103104202'=>'VX2',
|
||||
'_103104203'=>'VQ2',
|
||||
'_103104204'=>'8J',
|
||||
'_103104205'=>'8J2',
|
||||
'_103104206'=>'8J3',
|
||||
'_103104207'=>'VI2',
|
||||
'_103104208'=>'VI3',
|
||||
'_103104209'=>'8K',
|
||||
'_103104210'=>'8K2',
|
||||
'_103104211'=>'SZ',
|
||||
'_103104212'=>'SZ2',
|
||||
'_103104213'=>'8L',
|
||||
'_103104214'=>'8L2',
|
||||
'_103104215'=>'VJ',
|
||||
'_103104216'=>'VK',
|
||||
'_103104217'=>'ZE',
|
||||
'_103104218'=>'XQ',
|
||||
'_103104219'=>'SS',
|
||||
'_103104220'=>'ST',
|
||||
'_103104221'=>'ZJ',
|
||||
'_103104222'=>'YW',
|
||||
'_103104223'=>'9Z',
|
||||
'_103104224'=>'YX',
|
||||
'_103104225'=>'9X',
|
||||
'_103102037'=>'B1',
|
||||
'_103102038'=>'EJ',
|
||||
);
|
||||
|
||||
require_once 'framework/common/curl.php';
|
||||
|
||||
define('RNCS_WS_URL', 'http://www.services.ort.fr/ProtocoleRNCS/access');
|
||||
define('RNCS_WS_USER', '167260');
|
||||
define('RNCS_WS_PASS', '100356');
|
||||
|
||||
class MRncsFlux {
|
||||
|
||||
public $body = '';
|
||||
public $header = '';
|
||||
public $codeRetour = 0;
|
||||
public $errMsgInpi='';
|
||||
public $errNumInpi='';
|
||||
public $cookie='';
|
||||
public $iDb;
|
||||
public $tabVitrine=array();
|
||||
|
||||
|
||||
public $tabErreurInpi=array(0=>"Aucune erreur",
|
||||
10=>"Erreur de protocole avec système distant",
|
||||
11=>"Système distant inaccessible",
|
||||
101=>"Type de requête invalide",
|
||||
102=>"Code d'erreur appelant invalide",
|
||||
103=>"Identification non reconnue",
|
||||
107=>"Date invalide",
|
||||
108=>"Heure invalide",
|
||||
110=>"Code produit inconnu",
|
||||
115=>"Numéro de champ invalide",
|
||||
116=>"Longueur de champ invalide",
|
||||
121=>"Code de protocole invalide",
|
||||
122=>"Code base de données invalide",
|
||||
900=>"Erreur applicative",
|
||||
990100=>"+ de 50 entreprises trouvées",
|
||||
990101=>"Recherche complexe",
|
||||
990102=>"Critères saisis insuffisants",
|
||||
990103=>"Requête trop imprécise",
|
||||
990104=>"Dénomination non significative",
|
||||
990105=>"Critère commune non générall",
|
||||
990106=>"Critère voie trop général",
|
||||
990107=>"Commune obligatoire avec rue",
|
||||
990108=>"Commune non identifiée",
|
||||
990109=>"Entreprise non identifiée",
|
||||
990110=>"Erreur système",
|
||||
990111=>"Devise incorrecte",
|
||||
990112=>"Autre erreur",
|
||||
990113=>"Donnée incorrecte",
|
||||
990114=>"Valeur incohérente",
|
||||
990115=>"Surveillance impossible",
|
||||
990116=>"Entreprise non surveillée",
|
||||
990117=>"Entreprise déjà surveillée",
|
||||
990118=>"Produit indisponible",
|
||||
990119=>"Erreur base de données",
|
||||
990120=>"Erreur facturation",
|
||||
);
|
||||
|
||||
function __construct() {
|
||||
$this->iDb=new WDB();
|
||||
}
|
||||
|
||||
function getVitrine($siren) {
|
||||
$this->tabVitrine=$this->query($siren, array('Type'=>'QVIT'));
|
||||
return $this->tabVitrine;
|
||||
}
|
||||
|
||||
/*
|
||||
$cmdPages=$cmdNom='';
|
||||
|
||||
if (isset($_REQUEST['pages'])) $cmdPages=$_REQUEST['pages'];
|
||||
if (isset($_REQUEST['nom'])) $cmdNom=$_REQUEST['nom'];
|
||||
if (isset($_REQUEST['vue'])) $vue=$_REQUEST['vue'];
|
||||
|
||||
if ($vue=='bilans') $presta='12004';
|
||||
else $presta='12003';
|
||||
|
||||
if ($cmdNom && $cmdPages) $type='QDOC';
|
||||
else $type='QVIT';
|
||||
$prod=array('Type'=>$type,
|
||||
'Presta'=>$presta,
|
||||
'Num'=>'2',//2,
|
||||
'Ver'=>'2',//2,
|
||||
'Siren'=>$siren,
|
||||
'CmdNom'=>$cmdNom,
|
||||
'CmdPages'=>$cmdPages,
|
||||
'CmdBilan'=>'',
|
||||
);
|
||||
|
||||
$ref='';
|
||||
*/
|
||||
|
||||
public function query($siren, $prod=array()) {
|
||||
/*$prod=array('Type'=>$type,
|
||||
'Presta'=>$presta,
|
||||
'Siren'=>$siren,
|
||||
'CmdNom'=>$cmdNom,
|
||||
'CmdPages'=>$cmdPages,
|
||||
'CmdBilan'=>'',
|
||||
'Ref'=>'',
|
||||
);
|
||||
*/
|
||||
$option='';
|
||||
if ( ($prod['Type']=='QDOC' || $prod['Presta']==12004 || $prod['Presta']==12003) && !isset($prod['Num'])) {
|
||||
$prod['Num']=2;
|
||||
$prod['Ver']=2;
|
||||
} elseif (!isset($prod['Num'])) {
|
||||
$prod['Num']=1;
|
||||
$prod['Ver']=3;
|
||||
}
|
||||
|
||||
$req= '<?xml version="1.0" ?>'. "\n".
|
||||
'<ort:message xmlns:ort="http://www.ort.fr/NEWPORT/V2">'. "\n".
|
||||
' <ort:_1 type="110">'. "\n".
|
||||
' <ort:_7 type="010">NPORT</ort:_7>'. "\n".
|
||||
' <ort:_8 type="010">2</ort:_8>'. "\n". // Version du protocole
|
||||
' <ort:_9 type="010">1</ort:_9>'. "\n". // Version du dictionnaire
|
||||
' <ort:_10 type="010">1</ort:_10>'. "\n". // Code protocole/version application
|
||||
' <ort:_11 type="010">PROTORNCS</ort:_11>'. "\n".
|
||||
' <ort:_12 type="010">'.$prod['Type'].'</ort:_12>'. "\n". // Prestation souhaitée QVIT / QDOC
|
||||
' <ort:_13 type="010">0</ort:_13>'. "\n". // Code retour/erreur
|
||||
' <ort:_14 type="010">'.RNCS_WS_USER.RNCS_WS_PASS.'</ort:_14>'."\n". // User Password concaténés
|
||||
' <ort:_15 type="010">'.$prod['Ref'].'</ort:_15>'. "\n". // Réf.
|
||||
' <ort:_16 type="010">'.date('Ymd').'</ort:_16>'. "\n". // Date SSAAMMJJ
|
||||
' <ort:_17 type="010">'.date('His').'</ort:_17>'. "\n". // Heure HHMMSS
|
||||
' <ort:_19 type="010">ORT</ort:_19>'. "\n".
|
||||
' </ort:_1>'. "\n".
|
||||
' <ort:_2 type="110">'. "\n".
|
||||
' <ort:_1 type="110">'. "\n".
|
||||
' <ort:_26 type="010">'.$prod['Prod'].'</ort:_26>'. "\n". // Type de produit (vide pour QVIT)
|
||||
' <ort:_27 type="010">'.$prod['Num'].'</ort:_27>'. "\n". // Numéro de produit souhaité 1 2
|
||||
' <ort:_28 type="010">'.$prod['Ver'].'</ort:_28>'. "\n". // Version du produit 3 2
|
||||
' <ort:_31 type="010">'.$prod['Presta'].'</ort:_31>'. "\n". // Code prestation (vide pour QVIT)
|
||||
' </ort:_1>'. "\n";
|
||||
if ($prod['Presta']==12004 || $prod['Presta']==12003) {
|
||||
$req.='
|
||||
<ort:_2 type="110">
|
||||
<ort:_100 type="111">
|
||||
<ort:_101 type="110">
|
||||
<ort:_120000031 type="010">'.$prod['Presta'].'</ort:_120000031>
|
||||
<ort:_100700010 type="010">FTP</ort:_100700010>
|
||||
<ort:_100701000 type="010">NTIF</ort:_100701000>
|
||||
<ort:_120000015 type="010" />
|
||||
</ort:_101>
|
||||
</ort:_100>
|
||||
<ort:_200 type="111">
|
||||
<ort:_210 type="110">
|
||||
<ort:_130000001 type="010">'.$siren.'</ort:_130000001>
|
||||
<ort:_103000402 type="010">'.$prod['CmdNom'].'</ort:_103000402>
|
||||
<ort:_103000403 type="010">'.$prod['CmdPages'].'</ort:_103000403>
|
||||
<ort:_190000025 type="010">'.$prod['CmdBilan'].'</ort:_190000025>
|
||||
</ort:_210>
|
||||
</ort:_200>
|
||||
</ort:_2>'; //
|
||||
$option=$prod['CmdNom'].'-'.$prod['CmdPages'].'-'.$prod['CmdBilan'];
|
||||
} elseif ($prod['Type']=='QINF') {
|
||||
$req.=' <ort:_2 type="110">'."\n".'<ort:_130000001 type="010">'.$siren.'</ort:_130000001>';
|
||||
if ($prod['Presta']=='2000' || $prod['Presta']=='2001' || $prod['Presta']=='2002' || $prod['Presta']=='2003') {
|
||||
// Liste années bilans
|
||||
$req.='<ort:_190000025 type="010">'.$prod['Millesime'].'</ort:_190000025>'."\n";
|
||||
$option=$prod['Millesime'];
|
||||
}
|
||||
elseif ($prod['Presta']=='12001')
|
||||
// Flag limitation du nombre détablissement
|
||||
$req.='<ort:_109105002 type="010">N</ort:_109105002>'."\n";
|
||||
$req.='</ort:_2>';
|
||||
} else {
|
||||
$req.=' <ort:_2 type="110">
|
||||
<ort:_130000001 type="010">'.$siren.'</ort:_130000001>
|
||||
<ort:_120000031 type="010">'.$prod['Presta'].'</ort:_120000031>
|
||||
</ort:_2>';// 12003 Actes et statuts 12004 Bilans
|
||||
}
|
||||
$req.=' </ort:_2>
|
||||
</ort:message>';
|
||||
echo $req.'<hr/>';
|
||||
$postData=array(''=>$req);
|
||||
$cookie=$referer='';
|
||||
$enCache=false;
|
||||
$params=md5(serialize($prod));
|
||||
//die($params);
|
||||
/*if ($prod['CmdNom']<>'' || $prod['CmdPages']<>'' || $prod['CmdBilan']<>'' || $prod['Millesime']<>'')
|
||||
$strOption=*/
|
||||
//AND params='$params'
|
||||
$res=$this->iDb->select('rncs_requetes', 'dateRequete, strXml, codeErreur, libErreur', "siren=$siren AND params='$params' ORDER BY dateRequete DESC");
|
||||
//type='".$prod['Type']."' AND presta ='".$prod['Presta']."' $strOption ORDER BY dateRequete DESC");
|
||||
if (count($res)>0) {
|
||||
$tabRes=$res[0];
|
||||
$dateReq=$tabRes['dateRequete'];
|
||||
$this->body=$tabRes['strXml'];
|
||||
$this->errNumInpi=$tabRes['codeErreur'];
|
||||
$this->errMsgInpi=$tabRes['libErreur'];
|
||||
$enCache=true;
|
||||
echo 'Une requête dans le cache <br/>';
|
||||
//die();
|
||||
} else {
|
||||
echo 'Pas de requête dans le cache <br/>';
|
||||
//die();
|
||||
$page=getUrl(RNCS_WS_URL, $cookie, $postData, $referer, false, 'www.services.ort.fr');
|
||||
$this->body=$page['body'];
|
||||
/**
|
||||
** ERREUR PROTOCOL
|
||||
**/
|
||||
preg_match('/<ort:_13 type="020">(.*)<\/ort:_13>/Uis',$this->body, $matches);
|
||||
if ($matches[1]*1<>0) {
|
||||
$this->errNumInpi=$matches[1];
|
||||
$this->errMsgInpi=$tabErreurInpi[$this->errNumInpi];
|
||||
//echo "<!-- ERREUR INPI 13 n°$errNumInpi = $errMsgInpi !!! -->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
** ERREUR APPLICATIVES NUMERIQUES
|
||||
**/
|
||||
preg_match('/<ort:_96 type="020">(.*)<\/ort:_96>/Uis',$this->body, $matches);
|
||||
if ($matches[1]*1<>0) {
|
||||
$this->errNumInpi=$matches[1];
|
||||
$this->errMsgInpi=$tabErreurInpi[$this->errNumInpi];
|
||||
//echo "<!-- ERREUR INPI 96 n°$errNumInpi = $errMsgInpi !!! -->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
** ERREUR APPLICATIVES TEXTE
|
||||
**/
|
||||
preg_match('/<ort:_97 type="010">(.*)<\/ort:_97>/Uis',$this->body, $matches);
|
||||
if ($matches[1]*1<>0) {
|
||||
$this->errMsgInpi=$matches[1];
|
||||
//echo "<!-- ERREUR INPI 97 : $errMsgInpi !!! -->\n";
|
||||
}
|
||||
|
||||
$tabInsert=array( 'siren' => $siren,
|
||||
'dateRequete' => date('YmdHis'),
|
||||
'strXml' => $this->body,
|
||||
'params' => md5(serialize($prod)),
|
||||
'type' => $prod['Type'],
|
||||
'presta' => $prod['Presta'],
|
||||
'option' => $option,
|
||||
'codeErreur' => $this->errNumInpi,
|
||||
'libErreur' => $this->errMsgInpi,
|
||||
);
|
||||
$this->iDb->insert('jo.rncs_requetes', $tabInsert, true);
|
||||
}
|
||||
|
||||
if ($prod['Presta']==12004)
|
||||
// bilans image
|
||||
$pregmatch=preg_match_all('/<ort\:_201 type="110">(?:.*)<ort\:_103000040 type="010">(.*)<\/ort:_103000040>(?:.*)<ort\:_103000452 type="010">(.*)<\/ort:_103000452>(?:.*)<ort\:_103000402 type="010">(.*)<\/ort:_103000402>(?:.*)<ort\:_103000403 type="010">(.*)<\/ort:_103000403>(?:.*)<ort\:_103000404 type="010">(.*)<\/ort:_103000404>(?:.*)<\/ort:_201>/Uis',$this->body, $matches);
|
||||
elseif ($prod['Presta']==12003)
|
||||
// actes image
|
||||
$pregmatch=preg_match_all('/<ort\:_201 type="110">(?:.*)<ort\:_103000452 type="010">(.*)<\/ort:_103000452>(?:.*)<ort\:_103000402 type="010">(.*)<\/ort:_103000402>(?:.*)<ort\:_103000403 type="010">(.*)<\/ort:_103000403>(?:.*)<ort\:_103000404 type="010">(.*)<\/ort:_103000404>(?:.*)<\/ort:_201>/Uis',$this->body, $matches);
|
||||
elseif ($prod['Presta']==2000)
|
||||
// bilan simplifiés ou normaux saisi
|
||||
$pregmatch=preg_match('/<ort\:_2 type="110">(?:.*)<ort\:_2 type="110">(.*)<\/ort\:_2>(?:.*)<\/ort\:_2>/Uis',$this->body, $matches);
|
||||
elseif ($prod['Presta']==12001)
|
||||
// Fiche Identite
|
||||
$pregmatch=preg_match('/<ort\:_2 type="110">(?:.*)<ort\:_2 type="110">(.*)<\/ort\:_2>(?:.*)<\/ort\:_2>/Uis',$this->body, $matches);
|
||||
else {
|
||||
// Prestation Vitrine
|
||||
$tabVitrine=array();
|
||||
|
||||
// Bilans dispos
|
||||
$tabBilans=array();
|
||||
// Type de Bilans saisis disponible
|
||||
for ($typeBilan=2000; $typeBilan<2004; $typeBilan++) {
|
||||
$pregmatch=preg_match('/<ort:_'.$typeBilan.' type="110">(?:.*)<ort\:_120000026 type="010">(.*)<\/ort\:_120000026>(?:.*)<ort\:_120000027 type="010">(.*)<\/ort\:_120000027>(?:.*)<ort\:_120000028 type="010">(.*)<\/ort\:_120000028>(?:.*)<ort\:_120000029 type="010">(.*)<\/ort:_120000029>(?:.*)<ort\:_120000031 type="010">(.*)<\/ort\:_120000031>(?:.*)<ort\:_109104002 type="010">(.*)<\/ort\:_109104002>(?:.*)<ort\:_109104003 type="010">(.*)<\/ort\:_109104003>(.*)<\/ort:_'.$typeBilan.'>/Uis',$this->body, $matches);
|
||||
$numProduit=$matches[1]; // 52
|
||||
$numProduit=$matches[2]; // 52
|
||||
$verProduit=$matches[3]; // 1
|
||||
$libProduit=$matches[4]; // Comptes sociaux
|
||||
$typProduit=$matches[5]; // 2000 : Bilans sociaux
|
||||
// 2001 : Bilans consolidés (70)
|
||||
// 2002 : Bilans de banques (71)
|
||||
// 2003 : Bilans d'assurances (72)
|
||||
$synProduit=$matches[6]; // 109104002 : Disponibilité synchrone
|
||||
$asyProduit=$matches[7]; // 109104003 : Disponibilité asynchrone
|
||||
$pregmatch=preg_match_all('/<ort\:_103000038 type="010">(.*)<\/ort:_103000038>/Uis',$matches[8], $matches);
|
||||
if ($typeBilan==2000) $tabBilans['N']=$matches[1]; // Réel normal SC
|
||||
elseif ($typeBilan==2001) $tabBilans['C']=$matches[1]; // Consolidé CC
|
||||
elseif ($typeBilan==2002) $tabBilans['B']=$matches[1]; // Banque SB
|
||||
elseif ($typeBilan==2003) $tabBilans['A']=$matches[1]; // Assurance SA
|
||||
else $tabBilans['S']=$matches[1]; // Réel Simplifié SS
|
||||
}
|
||||
$tabVitrine['bilans']=$tabBilans;
|
||||
|
||||
// Fiche d'identité
|
||||
$pregmatch=preg_match('/<ort:_12001 type="110">(?:.*)<ort\:_120000027 type="010">(.*)<\/ort\:_120000027>(?:.*)<ort\:_120000028 type="010">(.*)<\/ort\:_120000028>(?:.*)<ort\:_120000029 type="010">(.*)<\/ort:_120000029>(?:.*)<ort\:_120000031 type="010">(.*)<\/ort\:_120000031>(?:.*)<ort\:_109104002 type="010">(.*)<\/ort\:_109104002>(?:.*)<ort\:_109104003 type="010">(.*)<\/ort\:_109104003>(?:.*)<ort\:_130000401 type="010">(.*)<\/ort\:_130000401>(?:.*)<\/ort:_12001>/Uis',$this->body, $matches);
|
||||
$numProduit=$matches[1]; // 52
|
||||
$verProduit=$matches[2]; // 1
|
||||
$libProduit=$matches[3]; // Comptes sociaux
|
||||
$typProduit=$matches[4]; // 2000 : Bilans sociaux
|
||||
$synProduit=$matches[5]; // 109104002 : Disponibilité synchrone
|
||||
$asyProduit=$matches[6]; // 109104003 : Disponibilité asynchrone
|
||||
$nbEtab=$matches[7]; // Nombre d'établissements recensés
|
||||
$tabVitrine['identite']=array( 'numProduit'=>$numProduit,
|
||||
'verProduit'=>$verProduit,
|
||||
'libProduit'=>$libProduit,
|
||||
'typProduit'=>$typProduit,
|
||||
'synProduit'=>$synProduit,
|
||||
'asyProduit'=>$asyProduit,
|
||||
'nbEtab' =>$nbEtab);
|
||||
|
||||
return $tabVitrine;
|
||||
}
|
||||
|
||||
echo $this->body;
|
||||
|
||||
//print_r($tabBilans);
|
||||
return $matches;
|
||||
}
|
||||
|
||||
function getListeBilans($siren, $type='*') {
|
||||
$tabVitrine=$this->getVitrine($siren);
|
||||
foreach ($tabVitrine['bilans'] as $type => $tabMillesime) {
|
||||
foreach ($tabMillesime as $num=>$millesime) {
|
||||
$delta1=round((Wdate::dateT('d/m/Y','Y',$millesime)-Wdate::dateT('d/m/Y','Y',$tabMillesime[$num+1]))*12)
|
||||
+round(Wdate::dateT('d/m/Y','m',$millesime)-Wdate::dateT('d/m/Y','m',$tabMillesime[$num+1]));
|
||||
if ($delta1>23) $delta1=0;
|
||||
$delta2=round((Wdate::dateT('d/m/Y','Y',$tabMillesime[$num+1])-Wdate::dateT('d/m/Y','Y',$tabMillesime[$num+2]))*12)
|
||||
+round(Wdate::dateT('d/m/Y','m',$tabMillesime[$num+1])-Wdate::dateT('d/m/Y','m',$tabMillesime[$num+2]));
|
||||
if ($delta2>23) $delta2=0;
|
||||
$tabRet[$type.$millesime]=array( 'dateProvPartenaire'=>date('Ymd'),
|
||||
'dureeExercice' =>$delta1,
|
||||
'dateExercicePre' =>Wdate::dateT('d/m/Y','Ymd',$tabMillesime[$num+1]),
|
||||
'dureeExercicePre' =>$delta2,
|
||||
'monnaie' =>'EUR',
|
||||
'source' =>100,
|
||||
'ref' =>'',
|
||||
);
|
||||
}
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getBilan($siren, $millesime, $type='N') {
|
||||
global $tabOrt2Sd;
|
||||
$tabRet=$tabPostes=array();
|
||||
if ($type=='N') $presta=2000;
|
||||
elseif ($type=='C') $presta=2001;
|
||||
elseif ($type=='B') $presta=2002;
|
||||
elseif ($type=='A') $presta=2003;
|
||||
$prod=array( 'Prod'=>'RNCS',
|
||||
'Num'=>'52',
|
||||
'Ver'=>'1',
|
||||
'Presta'=>$presta,
|
||||
'Millesime'=>Wdate::dateT('d/m/Y','mY',$millesime),
|
||||
'Type'=>'QINF');
|
||||
$ret=$this->query($siren, $prod);
|
||||
|
||||
/* $fp=fopen(LOG_PATH.'/debugBilansRncs.log','a');
|
||||
fwrite($fp, print_r($ret,true));
|
||||
fclose($fp);*/
|
||||
|
||||
$pregmatch=preg_match_all('/<ort\:_(.*) type="010">(.*)<\/ort\:_(.*)>/Uis', $ret[1], $matches);
|
||||
foreach ($matches[1] as $i=>$poste) {
|
||||
//echo "$i : $poste<br/>";
|
||||
if ('_'.$poste=='_103000040') { // CONSOLIDE
|
||||
switch ($matches[2][$i]) {
|
||||
case 'SC': $tabRet[$tabOrt2Sd['_'.$poste]]='N'; break;
|
||||
case 'CC': $tabRet[$tabOrt2Sd['_'.$poste]]='C'; break;
|
||||
case 'SB': $tabRet[$tabOrt2Sd['_'.$poste]]='B'; break;
|
||||
case 'SA': $tabRet[$tabOrt2Sd['_'.$poste]]='A'; break;
|
||||
case 'SS': $tabRet[$tabOrt2Sd['_'.$poste]]='S'; break;
|
||||
default: break;
|
||||
}
|
||||
} elseif ('_'.$poste=='_103000214') { // MONNAIE_LIV_UNITE
|
||||
switch ($matches[2][$i]*1) {
|
||||
case 0: $tabRet[$tabOrt2Sd['_'.$poste]]=''; break;
|
||||
case 3: $tabRet[$tabOrt2Sd['_'.$poste]]='k'; break;
|
||||
case 6: $tabRet[$tabOrt2Sd['_'.$poste]]='m'; break;
|
||||
default: break;
|
||||
}
|
||||
} elseif ('_'.$poste=='_130000001' || // SIREN
|
||||
'_'.$poste=='_103000033' || // DATE_CLOTURE
|
||||
'_'.$poste=='_103000023' || // DUREE_MOIS
|
||||
'_'.$poste=='_103000202' || // MONNAIE_ORI
|
||||
'_'.$poste=='_103000205' || // MONNAIE_ORI_UNITE
|
||||
'_'.$poste=='_103000211' || // MONNAIE
|
||||
'_'.$poste=='_103000029' || // AVIS_CAC
|
||||
'_'.$poste=='_130000009') { // CODE_NAF
|
||||
$tabRet[$tabOrt2Sd['_'.$poste]]=$matches[2][$i];
|
||||
} else
|
||||
$tabPostes[$tabOrt2Sd['_'.$poste]]=$matches[2][$i];
|
||||
}
|
||||
$tabRet['POSTES']=$tabPostes;
|
||||
$tabRet['DATE_FRAICHE_BILAN']=date('Ymd');
|
||||
$tabRet['TYPE_BILAN']=$tabRet['CONSOLIDE'];
|
||||
//$tabRet['DATE_CLOTURE_PRE']
|
||||
//$tabRet['DUREE_MOIS_PRE']
|
||||
$fp=fopen(LOG_PATH.'/debugBilansRncs.log','a');
|
||||
fwrite($fp, print_r($tabRet,true));
|
||||
fclose($fp);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getIdentite($siren) {
|
||||
$tabVitrine=$this->getVitrine($siren);
|
||||
|
||||
$fp=fopen(LOG_PATH.'/debugVitrineRncs.log','a');
|
||||
fwrite($fp, print_r($tabVitrine,true));
|
||||
fclose($fp);
|
||||
|
||||
$prod=array( 'Prod'=>'RNCS',
|
||||
'Num'=>$tabVitrine['identite']['numProduit'],
|
||||
'Ver'=>$tabVitrine['identite']['verProduit'],
|
||||
'Presta'=>12001,
|
||||
'Type'=>'QINF');
|
||||
$ret=$this->query($siren, $prod);
|
||||
if ($this->errNumInpi>0 && $this->errMsgInpi<>'') {
|
||||
return false;
|
||||
} else {
|
||||
$pregmatch=preg_match_all('/<ort\:_((?:1300|13011|13016|130100403).*) type="010">(.*)<\/ort\:_((?:1300|13011|13016|130100403).*)>/Uis', $ret[1], $matchesIden);
|
||||
foreach ($matchesIden[1] as $i=>$rubrique) {
|
||||
if ($rubrique==130000300) $tabIdentite['Nom']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000008) $tabIdentite['FJ']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000303) $tabIdentite['Sigle']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130100015) $tabIdentite['Enseigne']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000500) $tabIdentite['CapitalMont']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000501) $tabIdentite['CapitalType']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000508) $tabIdentite['CapitalDev']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000509) $tabIdentite['CapitalUnite']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000513) $tabIdentite['CapitalMontCts']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000102) $tabIdentite['DateCrea']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130001002) $tabIdentite['DateImma']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000013) $tabIdentite['CodeGreffe']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000014) $tabIdentite['NumRC']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130001102) $tabIdentite['DateRad']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000025) $tabIdentite['Provisoire']=$matchesIden[2][$i];
|
||||
elseif ($rubrique==130000401) $tabIdentite['NbEtab']=$matchesIden[2][$i];
|
||||
}
|
||||
|
||||
/** DIRIGEANTS **/
|
||||
$tabDir=array();
|
||||
if (preg_match('/<ort\:_130300015 type="010">(.*)<\/ort:_130300015>(?:.*)<ort:_200 type="111">(.*)<\/ort\:_200>/Uis', $ret[1], $matchesDirs)) {
|
||||
$nbDirs=$matchesDirs[1];
|
||||
$strDir=$matchesDirs[2];
|
||||
$strMatch= '<ort\:_210 type="110">(?:.*)'.
|
||||
'<ort\:_130300005 type="010">(.*)<\/ort\:_130300005>(?:.*)'.
|
||||
'<ort\:_130301003 type="010">(.*)<\/ort\:_130301003>(?:.*)'.
|
||||
'<ort\:_130300016 type="010">(.*)<\/ort\:_130300016>(?:.*)'.
|
||||
'<ort\:_130301006 type="010">(.*)<\/ort\:_130301006>(?:.*)'.
|
||||
'<ort\:_130301007 type="010">(.*)<\/ort\:_130301007>(?:.*)'.
|
||||
'<ort\:_130301009 type="010">(.*)<\/ort\:_130301009>(?:.*)'.
|
||||
'<ort\:_130301004 type="010">(.*)<\/ort\:_130301004>(?:.*)'.
|
||||
'<ort\:_130301008 type="010">(.*)<\/ort\:_130301008>(?:.*)'.
|
||||
'<ort\:_130301012 type="010">(.*)<\/ort\:_130301012>(?:.*)'.
|
||||
'<ort\:_130301100 type="010">(.*)<\/ort\:_130301100>(?:.*)'.
|
||||
'<ort\:_130301102 type="010">(.*)<\/ort\:_130301102>(?:.*)'.
|
||||
'<ort\:_130302002 type="010">(.*)<\/ort\:_130302002>(?:.*)'.
|
||||
'<ort\:_130302003 type="010">(.*)<\/ort\:_130302003>(?:.*)'.
|
||||
'<ort\:_130302004 type="010">(.*)<\/ort\:_130302004>(?:.*)<\/ort\:_210>';
|
||||
$pregmatch=preg_match_all("/$strMatches/Uis", $strDir, $matchesDirs);
|
||||
foreach ($matchesDirs[1] as $i=>$dir) {
|
||||
$tabDir[$i]=array( 'Fonc'=>$dir[1],
|
||||
'Sexe'=>$dir[2],
|
||||
'Nom'=>$dir[3],
|
||||
'Prenom'=>$dir[4],
|
||||
'Prenom2'=>$dir[5],
|
||||
'NomJF'=>$dir[6],
|
||||
'NaissDept'=>$dir[7],
|
||||
'NaissLieu'=>$dir[8],
|
||||
'NaissNati'=>$dir[9],
|
||||
'NaissDate'=>$dir[10],
|
||||
'ReprNom'=>$dir[11],
|
||||
'ReprPrenom'=>$dir[12],
|
||||
'ReprPrenom2'=>$dir[13],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$fp=fopen(LOG_PATH.'/debugIdentiteRncs.log','a');
|
||||
fwrite($fp, print_r($matchesIden,true).EOL.print_r($matchesEtab,true).EOL.print_r($matchesDirs,true));
|
||||
fclose($fp);
|
||||
|
||||
return $tabIdentite;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -1,715 +0,0 @@
|
||||
<?php
|
||||
class MRnvp
|
||||
{
|
||||
protected $iDb;
|
||||
protected $iInsee;
|
||||
|
||||
public $tabDevises=array();
|
||||
public $nomTronque=0;
|
||||
|
||||
protected $tabAdrCQ=array(
|
||||
10=>'Adresse correcte',
|
||||
20=>'Adresse correcte (Voie non reconue dans un CEDEX ou BP)',
|
||||
21=>'Adresse correcte mais numéro de facade hors borne (petite ville)',
|
||||
22=>'Adresse correcte mais numéro de facade absent (petite ville)',
|
||||
23=>'Adresse correcte mais numéro de facade hors borne (grande ville)',
|
||||
24=>'Adresse correcte mais numéro de facade absent (grande ville)',
|
||||
30=>'Voie non reconnue (petite ville)',
|
||||
31=>'Voie non reconnue (petite ville, quartier reconnu)',
|
||||
40=>'Voie absente (petite ville, quartier reconnu)',
|
||||
41=>'Voie absente (petite ville)',
|
||||
50=>'Voie non reconnue (grande ville)',
|
||||
51=>'Voie non reconnue (grande ville, quartier reconnu)',
|
||||
60=>'Voie absente (grande ville, quartier reconnu)',
|
||||
61=>'Voie absente (grande ville)',
|
||||
70=>'Voie présente mais Cp/Ville non corrigeable',
|
||||
80=>'Voie absente et Cp/Ville non corrigeable',
|
||||
90=>'Adresse à l\'étranger',
|
||||
);
|
||||
|
||||
function __construct() {
|
||||
$this->iDb = new WDB();
|
||||
$this->iInsee = new MInsee($this->iDb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisation du tableau privé des devises Inpi <=> ISO
|
||||
* @return multitype:Ambigous <multitype:>
|
||||
*/
|
||||
protected function getTabDevisesInpi()
|
||||
{
|
||||
$rep=$this->iDb->select('jo.tabDevises', 'devInpi, devIso', 'devInpi>0', false, MYSQL_ASSOC);
|
||||
$tabDevises=array();
|
||||
foreach($rep as $k=>$dev)
|
||||
$tabDevises[$dev['devInpi']*1]=$dev['devIso'];
|
||||
|
||||
return $tabDevises;
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupération du code ISO de la devise numérique de l'Inpi
|
||||
* @param integer $numDeviseInpi
|
||||
* @return multitype:|string
|
||||
*/
|
||||
public function getDeviseInpi($numDeviseInpi)
|
||||
{
|
||||
if ($numDeviseInpi*1>0 && isset($this->tabDevises[$numDeviseInpi*1]))
|
||||
return $this->tabDevises[$numDeviseInpi*1];
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Corriger les adresses présentes dans CEDEXA (toutes les lignes)
|
||||
* @todo Ligne 3, acheter HEXALIGNE3
|
||||
* @param unknown $adrL1
|
||||
* @param unknown $adrL2
|
||||
* @param unknown $adrL3
|
||||
* @param unknown $adrL4
|
||||
* @param unknown $adrL5
|
||||
* @param unknown $adrL6
|
||||
* @param string $adrL7
|
||||
* @param number $norme
|
||||
* @param string $debug
|
||||
* @return multitype:string number |string|unknown
|
||||
*/
|
||||
public function normaliseAdresse($adrL1, $adrL2, $adrL3, $adrL4, $adrL5, $adrL6, $adrL7='', $norme=38, $debug=false)
|
||||
{
|
||||
$tDeb=microtime(1);
|
||||
$erreur=false;
|
||||
if ($norme<>32 && $norme<>38) {
|
||||
return array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'I8',
|
||||
'errRNVPlib'=>'La norme doit être 32 ou 38 caractères (38 par défaut)'
|
||||
);
|
||||
}
|
||||
|
||||
$adrL=$tabRetI=$tabRetV=$tabRetR=$tabRetE=array();
|
||||
$L1tr=$L2tr=$L3tr=0; // Par défaut, les lignes ne sont pas indiquées comme tronquées
|
||||
$adrL[1]=$adrL1=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL1)))));
|
||||
$adrL[2]=$adrL2=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL2)))));
|
||||
$adrL[3]=$adrL3=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL3)))));
|
||||
$adrL[4]=$adrL4=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL4)))));
|
||||
$adrL[5]=$adrL5=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL5)))));
|
||||
$adrL[6]=$adrL6=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL6)))));
|
||||
$adrL[7]=$adrL7=trim(preg_replace('/\s+/',' ',preg_replace('/[^a-z\d ]/i', ' ', strtoupper(trimAccent($adrL7)))));
|
||||
$dureeM=round(microtime(1)-$tDeb,3);
|
||||
if ($adrL7<>'' || $adrL7<>'FRANCE' || $adrL7<>'MONACO')
|
||||
|
||||
$L1=$adrL1;
|
||||
$L2=$adrL2;
|
||||
|
||||
// Ligne 3, acheter HEXALIGNE3
|
||||
$L3=$adrL3;
|
||||
|
||||
// Ligne 5 et 7 par défaut
|
||||
$L7=$adrL7;
|
||||
$L5=$adrL5;
|
||||
|
||||
// Ligne 6 : CP + Localité
|
||||
$idAdr56=false;
|
||||
$tabAdr56k=$tabAdr56L=array();
|
||||
$cp=substr(trim($adrL6),0,5);
|
||||
if ($cp*1>0) {
|
||||
$cp2=substr($cp,0,2);
|
||||
$ville=trim(strtr(substr($adrL6,5),array(' SAINT '=>' ST ',' SAINTE '=>' STE ')));
|
||||
} else {
|
||||
$cp=$cp2='';
|
||||
$ville=trim(strtr($adrL6,array(' SAINT '=>' ST ',' SAINTE '=>' STE ')));
|
||||
}
|
||||
|
||||
$ville=preg_replace('/ CEDEX\s?.*$/ui','',$ville);
|
||||
$tabRetI=array(
|
||||
'operateurRnvp'=>'SED',
|
||||
'in_cp'=>$cp,
|
||||
'in_dep'=>$cp2,
|
||||
'in_ville'=>$ville,
|
||||
'in_L1'=>$adrL1,
|
||||
'in_L2'=>$adrL2,
|
||||
'in_L3'=>$adrL3,
|
||||
'in_L4'=>$adrL4,
|
||||
'in_L5'=>$adrL5,
|
||||
'in_L6'=>$adrL6,
|
||||
'in_L7'=>$adrL7);
|
||||
//$dureeM=round(microtime(1)-$tDeb,3);
|
||||
|
||||
$tD=microtime(1);
|
||||
$ret=$this->iDb->select('villes.hexaviaVilles',
|
||||
"idAdr56, codeInseeCom, libCom$norme, codeInseeGlobal, indPluridis, libLigne5n$norme, indRoudis, codePostal, libLigne6n$norme, codeInseePre, codeMaj$norme, dateMaj$norme, MATCH (codePostal, libCom38) AGAINST ('$cp $ville' IN NATURAL LANGUAGE MODE) AS score",
|
||||
"(MATCH (codePostal, libCom38) AGAINST ('$cp $ville' IN NATURAL LANGUAGE MODE) OR MATCH (codePostal, libCom38) AGAINST ('$cp2 $ville' IN NATURAL LANGUAGE MODE)) ORDER BY score DESC /*OR codePostal='$cp' AND libCom$norme='$ville'*/",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0) {
|
||||
$tabRetE=array(
|
||||
'dureeV'=> round(microtime(1)-$tD,3),
|
||||
'errRNVPcode'=>'V0',
|
||||
'errRNVPlib'=> "Aucune correspondance CP VILLE (cp=$cp, ville=$ville)");
|
||||
$erreur=true;
|
||||
} else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
if ($debug) echo "je compare '$cp' avec '".$iRet['codePostal']."' et '$ville' avec '".$iRet["libCom$norme"]."' (".$iRet['idAdr56'].", score=".$iRet['score'].")".EOL;
|
||||
if (($iRet['codePostal']==$cp || substr($iRet['codePostal'],0,2)==$cp2) && ($iRet["libCom$norme"]==$ville || preg_replace('/ 0/', ' ',$iRet["libCom$norme"])==$ville) || (strpos($iRet["libCom$norme"],$ville)>0 && $nbRet==1)) {
|
||||
$idAdr56=$iRet['idAdr56'];
|
||||
$dateMajHexavia=$iRet["dateMaj$norme"];
|
||||
$codeMajHexaviaVille=$iRet["codeMaj$norme"];
|
||||
$hexaViaComCod=$iRet['codeInseeCom'];
|
||||
$hexaViaComLib=$iRet["libCom$norme"];
|
||||
$hexaViaCP=$iRet['codePostal'];
|
||||
$L5=$iRet["libLigne5n$norme"];
|
||||
$L6=$iRet['codePostal'].' '.$iRet["libLigne6n$norme"];
|
||||
$L7='';
|
||||
$tabAdr56k[]=$idAdr56;
|
||||
$tabAdr56L['_'.$idAdr56]=array('L5'=>$L5,'L6'=>$L6,'L7'=>$L7,);
|
||||
$tabRetV=array(
|
||||
'HexaviaDateRef'=> $dateMajHexavia,
|
||||
'HexaviaCMAJVille'=>$codeMajHexaviaVille,
|
||||
'HexaviaComCod'=> $hexaViaComCod,
|
||||
'HexaviaComLib'=> $hexaViaComLib,
|
||||
'HexaviaCP'=> $hexaViaCP,
|
||||
'codeInseeGlobal'=> $iRet['codeInseeGlobal'],
|
||||
'codeInseePre'=> $iRet['codeInseePre'],
|
||||
'indPluridis'=> $iRet['indPluridis'],
|
||||
'indRoudis'=> $iRet['indRoudis'],
|
||||
'libLigne5'=> $iRet["libLigne5n$norme"],
|
||||
'libLigne6'=> $iRet["libLigne6n$norme"],
|
||||
'dureeV'=> round(microtime(1)-$tD,3),
|
||||
);
|
||||
// if ($iRet['score']>17) break;
|
||||
}
|
||||
}
|
||||
if (!$idAdr56) {
|
||||
$iRet=$ret[0];
|
||||
if ($debug) echo "On prend le score le + élevé s'il est > à 15 : je compare '$cp' avec '".$iRet['codePostal']."' et '$ville' avec '".$iRet["libCom$norme"]."' (".$iRet['idAdr56'].")".EOL;
|
||||
//echo '['.trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$iRet["libCom$norme"])) .'-v/s-'.trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$ville)).']'.EOL;
|
||||
if (($iRet['codePostal']==$cp || substr($iRet['codePostal'],0,2)==$cp2) && ($iRet["libCom$norme"]==$ville || (substr(trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$iRet["libCom$norme"])),0,26)==trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$ville)) && $iRet['score']>15) || (strpos($iRet["libCom$norme"],$ville)>0 && $nbRet==1))) {
|
||||
$idAdr56=$iRet['idAdr56'];
|
||||
$dateMajHexavia=$iRet["dateMaj$norme"];
|
||||
$hexaViaComCod=$iRet['codeInseeCom'];
|
||||
$hexaViaComLib=$iRet["libCom$norme"];
|
||||
$hexaViaCP=$iRet['codePostal'];
|
||||
$L5=$iRet["libLigne5n$norme"];
|
||||
$L6=$iRet['codePostal'].' '.$iRet["libLigne6n$norme"];
|
||||
$L7='';
|
||||
$tabAdr56k[]=$idAdr56;
|
||||
$tabAdr56L['_'.$idAdr56]=array('L5'=>$L5,'L6'=>$L6,'L7'=>$L7,);
|
||||
$tabRetV=array(
|
||||
'HexaviaDateRef'=> $dateMajHexavia,
|
||||
'HexaviaCMAJVille'=>$codeMajHexaviaVille,
|
||||
'HexaviaComCod'=> $hexaViaComCod,
|
||||
'HexaviaComLib'=> $hexaViaComLib,
|
||||
'HexaviaCP'=> $hexaViaCP,
|
||||
'codeInseeGlobal'=> $iRet['codeInseeGlobal'],
|
||||
'codeInseePre'=> $iRet['codeInseePre'],
|
||||
'indPluridis'=> $iRet['indPluridis'],
|
||||
'indRoudis'=> $iRet['indRoudis'],
|
||||
'libLigne5'=> $iRet["libLigne5n$norme"],
|
||||
'libLigne6'=> $iRet["libLigne6n$norme"],
|
||||
'dureeV'=> round(microtime(1)-$tD,3),
|
||||
);
|
||||
} else {
|
||||
if ($debug) print_r($ret);
|
||||
$erreur = true;
|
||||
$tabRetE = array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'V2',
|
||||
'errRNVPlib'=>"Plusieurs correspondances CP VILLE pour $cp $ville"
|
||||
);
|
||||
//return 'Plusieurs correspondances CP VILLE'.EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($erreur) return array_merge($tabRetI,$tabRetE);
|
||||
|
||||
// Ligne 4 : Découpage N° Répétition TypeVoie et LibelléVoie
|
||||
$tD=microtime(1);
|
||||
$matriculeHexavia=false;
|
||||
$tabAdr=$this->iInsee->structureVoie($adrL4);
|
||||
$numVoie=@$tabAdr['num'];
|
||||
$indRep=@$tabAdr['indRep'];
|
||||
$typeVoie=@$tabAdr['typeVoie'];
|
||||
$libVoie=@$tabAdr['libVoie'];
|
||||
$libVoie5=trim(substr($libVoie,0,5));
|
||||
$derMot='';
|
||||
if (preg_match('/([a-z\d]{1,20})$/i', $libVoie, $matches2))
|
||||
$derMot=trim($matches2[1]);
|
||||
$derMot5=trim(substr($derMot,0,5));
|
||||
|
||||
$strAdr56=implode("','", $tabAdr56k);
|
||||
$ret=$this->iDb->select(
|
||||
'villes.hexaviaVoies',
|
||||
"idAdr56, codeVoie, derElemVoie, libVoie$norme, typeVoie, descLibVoie, indStand$norme, indScind, indHomo, codePostal, codeRoudis, codeMaj$norme, dateMaj$norme,
|
||||
numImpMin, numImpMinExt, numImpMax, numImpMaxExt, numPairMin, numPairMinExt, numPairMax, numPairMaxExt, MATCH (codeInseeCom, libVoie38) AGAINST ('$hexaViaComCod $typeVoie $libVoie' IN NATURAL LANGUAGE MODE) AS score",
|
||||
"idAdr56 IN ('$strAdr56') AND (MATCH (codeInseeCom, libVoie38) AGAINST ('$hexaViaComCod $typeVoie $libVoie' IN NATURAL LANGUAGE MODE) OR derElemVoie LIKE '$derMot5%') ORDER BY score DESC LIMIT 0,20
|
||||
/*AND typeVoie='$typeVoie' AND derElemVoie='$derMot'*/",false, MYSQL_ASSOC
|
||||
);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0) {
|
||||
// Vérifier si la commune à des voies normées 98816
|
||||
$ret=$this->iDb->select( 'villes.hexaviaVoies', "codeVoie", "idAdr56 IN('$strAdr56')",false, MYSQL_ASSOC);
|
||||
$nbVoiesCom=count($ret);
|
||||
if ($nbVoiesCom==0) {
|
||||
$erreur=true;
|
||||
if ($debug) echo "Aucune Voie recensée dans cette commune ('$strAdr56') !".EOL;
|
||||
$tabRetE=array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'R0',
|
||||
'errRNVPlib'=>"Aucune Voie recensée dans cette commune ('$strAdr56')"
|
||||
);
|
||||
} else {
|
||||
$tabRetE=array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'R1',
|
||||
'errRNVPlib'=>"Aucune correspondance Voie pour '$adrL4', '$libVoie' ($nbVoiesCom voies dans la commune #$idAdr56)"
|
||||
);
|
||||
}
|
||||
return array_merge($tabRetI,$tabRetV,$tabRetE);
|
||||
} else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
$libVoieRet=preg_replace('/^[A-Z]{1,4}\s+/','', $iRet["libVoie$norme"]);
|
||||
if ($debug) echo "je compare '$typeVoie $libVoie' avec '".$iRet["typeVoie"]." $libVoieRet' ainsi que '$derMot' avec '". $iRet['derElemVoie']."'";
|
||||
if ($iRet['typeVoie']==$typeVoie && ($iRet["libVoie$norme"]==$libVoie || $iRet['derElemVoie']==$derMot || substr($iRet['derElemVoie'],0,5)==$derMot5)) {
|
||||
// echo ' OK';
|
||||
$idAdr56=$iRet['idAdr56'];
|
||||
$L4=preg_replace('/\s+/', ' ', trim($numVoie.' '.$indRep.' '.$iRet["libVoie$norme"]));
|
||||
$L4=preg_replace('/^0+/','',$L4);
|
||||
$hexaViaVoie=$iRet["libVoie$norme"];
|
||||
if (strlen($L4)>$norme) return "Taille de la ligne 4 générée en sortie plus longue que $norme !".EOL;
|
||||
$matriculeHexavia=$iRet['codeVoie'];
|
||||
$codeRoudis=$iRet['codeRoudis'];
|
||||
$L5=$tabAdr56L['_'.$idAdr56]['L5'];
|
||||
$L6=$tabAdr56L['_'.$idAdr56]['L6'];
|
||||
$L7=$tabAdr56L['_'.$idAdr56]['L7'];
|
||||
// Si c'est le meilleur score trouvé on sort
|
||||
if ($iRet['score']>17 && isset($ret[$i+1]) && $iRet['score']>$ret[$i+1]['score']) break;
|
||||
}
|
||||
}
|
||||
|
||||
$dureeR=round(microtime(1)-$tD,3);
|
||||
|
||||
if (!$matriculeHexavia) {
|
||||
if ($debug) print_r($ret);
|
||||
if ($debug) echo ("Plusieurs correspondances Voies pour $adrL4 $adrL6 dans cette commune ('$strAdr56') !".EOL);
|
||||
//die("Plusieurs correspondances Voies pour $adrL4 $adrL6 dans cette commune ('$strAdr56') !".EOL);
|
||||
$tabRetE=array( 'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'R2',
|
||||
'errRNVPlib'=>"Plusieurs correspondances Voies pour $adrL4 $adrL6 dans cette commune ('$strAdr56')");
|
||||
|
||||
return array_merge($tabRetI,$tabRetV,$tabRetE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$matriculeHexavia && @strlen($L4)==0) $L4=$adrL4;
|
||||
|
||||
$tD=microtime(1);
|
||||
$tabLen=$tabMaxLen=array();
|
||||
$tabLen[1]=strlen($L1);
|
||||
if ($tabLen[1]>$norme) {
|
||||
$L1=$this->normaliseRS($L1, $norme);
|
||||
if ($this->nomTronque==1) $L1tr=1;
|
||||
$tabLen[1]=strlen($L1); if ($tabLen[1]>$norme) $tabMaxLen[]=1;
|
||||
}
|
||||
$tabLen[2]=strlen($L2);
|
||||
if ($tabLen[2]>$norme) {
|
||||
$L2=$this->normaliseRS($L2, $norme);
|
||||
if ($this->nomTronque==1) $L2tr=1;
|
||||
$tabLen[2]=strlen($L2); if ($tabLen[2]>$norme) $tabMaxLen[]=2;
|
||||
}
|
||||
$tabLen[3]=strlen($L3);
|
||||
if ($tabLen[3]>$norme) {
|
||||
$L3=$this->normaliseRS($L3, $norme);
|
||||
if ($this->nomTronque==1) $L3tr=1;
|
||||
$tabLen[3]=strlen($L3); if ($tabLen[3]>$norme) $tabMaxLen[]=3;
|
||||
}
|
||||
$tabLen[4]=strlen($L4); if ($tabLen[4]>$norme) $tabMaxLen[]=4;
|
||||
$tabLen[5]=strlen($L5); if ($tabLen[5]>$norme) $tabMaxLen[]=5;
|
||||
$tabLen[6]=strlen($L6); if ($tabLen[6]>$norme) $tabMaxLen[]=6;
|
||||
$tabLen[7]=strlen($L7); if ($tabLen[7]>$norme) $tabMaxLen[]=7;
|
||||
$tabRetE=array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'00',
|
||||
'errRNVPlib'=>"Normalisation OK"
|
||||
);
|
||||
if (count($tabMaxLen)>0) {
|
||||
/*foreach($tabMaxLen as $j) {
|
||||
echo "La ligne n°$j fait ".$tabLen[$j]." caractères : '".$adrL[$j]."'".EOL;
|
||||
}*/
|
||||
if ($j>1) {
|
||||
$tabRetE = array(
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'O0',
|
||||
'errRNVPlib'=>"Une des lignes fait plus de $norme caractères !"
|
||||
);
|
||||
}
|
||||
}
|
||||
$dureeN=round(microtime(1)-$tD,3);
|
||||
|
||||
$tabRetR = array(
|
||||
'L1'=>$L1,
|
||||
'L2'=>$L2,
|
||||
'L3'=>$L3,
|
||||
'L4'=>$L4,
|
||||
'L5'=>$L5,
|
||||
'L6'=>$L6,
|
||||
'L7'=>$L7,
|
||||
'L1_tr'=>$L1tr,
|
||||
'L2_tr'=>$L2tr,
|
||||
'L3_tr'=>$L3tr,
|
||||
'HexaVia56'=>$idAdr56,
|
||||
'HexaViaVoie'=>$hexaViaVoie,
|
||||
'HexaViaMat'=>$matriculeHexavia,
|
||||
'RoudisId'=>$codeRoudis,
|
||||
'dureeR'=>$dureeR,
|
||||
'dureeN'=>$dureeN,
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'dureeM'=>$dureeM*1.0,
|
||||
);
|
||||
|
||||
$tabRet = array_merge($tabRetI,$tabRetV,$tabRetR,$tabRetE);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
/** Retourne le tableau des abbréviations existantes par type d'abréviation
|
||||
*/
|
||||
function getAbreviations($typeAbrev)
|
||||
{
|
||||
$tabRet=array();
|
||||
if ($typeAbrev=='P') {
|
||||
$ret=$this->iDb->select('villes.tabPrenoms',
|
||||
"prenom",
|
||||
"LENGTH(prenom)>3 AND nbTot>0 ORDER BY LENGTH(prenom) DESC",false, MYSQL_ASSOC);
|
||||
foreach($ret as $iRet) {
|
||||
$tabTmp=explode('-',$iRet['prenom']);
|
||||
$tabTmp2=array();
|
||||
foreach($tabTmp as $subPrenom)
|
||||
$tabTmp2[]=substr($subPrenom,0,1);
|
||||
$tabRet[$iRet['prenom']]=implode('-', $tabTmp2);
|
||||
}
|
||||
} else {
|
||||
$ret=$this->iDb->select('villes.tabAbreviations',
|
||||
"abrCode, abrLib",
|
||||
"abrType='$typeAbrev' AND dateSuppr=0 AND idSuppr=0 ORDER BY LENGTH(abrLib) DESC, LENGTH(abrCode) ASC",false, MYSQL_ASSOC);
|
||||
foreach($ret as $iRet) {
|
||||
$tabTmp=explode('/', $iRet['abrLib']);
|
||||
foreach($tabTmp as $abrLib) {
|
||||
if ($typeAbrev=='A')
|
||||
$tabRet[$abrLib]='';
|
||||
else
|
||||
$tabRet[$abrLib]=$iRet['abrCode'];
|
||||
}
|
||||
}
|
||||
}
|
||||
//print_r($tabRet);die();
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
/** Normalise une raison sociale ou un nom
|
||||
**/
|
||||
function normaliseRS($nomLong, $taille=38, $debug=false)
|
||||
{
|
||||
$nomCourt=preg_replace('/[^A-Z0-9%@&\'\(\)\"\-\*\/\s\+]/','',trim(strtoupper($nomLong)));
|
||||
$tabMots=split("[^[:alpha:]]+", $nomCourt);
|
||||
$passage=0;
|
||||
$this->nomTronque=0;
|
||||
echo $nomCourt.EOL;
|
||||
while (strlen($nomCourt)>$taille) {
|
||||
// 1. Remplacement des Libellés de Voies par leurs code Voie
|
||||
$tabTmp=$this->getAbreviations('V');
|
||||
foreach ($tabTmp as $lib=>$abr) {
|
||||
$nomCourt=trim(str_replace(" $lib".'ES ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'E ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'S ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib ", ' '.$abr.' ', " $nomCourt "));
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
}
|
||||
if ($debug) echo "1-Voies=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
//print_r($tabMots);
|
||||
// 2. Remplacement des Titres par leurs abréviation
|
||||
$tabTmp=$this->getAbreviations('T');
|
||||
foreach ($tabTmp as $lib=>$abr) {
|
||||
$nomCourt=trim(str_replace(" $lib".'ES ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'E ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'S ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib ", ' '.$abr.' ', " $nomCourt "));
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
}
|
||||
if ($debug) echo "2a-Titres=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
// 2. Remplacement des Formes Juridiques
|
||||
$tabTmp=$this->getAbreviations('J');
|
||||
foreach ($tabTmp as $lib=>$abr)
|
||||
$nomCourt=trim(str_replace(" $lib ", ' '.$abr.' ', " $nomCourt "));
|
||||
if ($debug) echo "2b-FJ=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
// 4. Suppression des articles
|
||||
$tabTmp=$this->getAbreviations('A');
|
||||
foreach ($tabTmp as $lib=>$abr) {
|
||||
if (strpos($lib,"'")>0)
|
||||
$nomCourt=trim(str_replace(' '.$lib, ' ', " $nomCourt "));
|
||||
else
|
||||
$nomCourt=trim(str_replace(" $lib ", ' ', " $nomCourt "));
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
}
|
||||
if ($debug) echo "4-Articles=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
// 3. Remplacement des Prénoms par leurs initiales
|
||||
$tabTmp=$this->getAbreviations('P');
|
||||
foreach ($tabTmp as $lib=>$abr) {
|
||||
$nomCourt=trim(str_replace(" $lib ", ' '.$abr.' ', " $nomCourt "));
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
}
|
||||
if ($debug) echo "3-Prenoms=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
$tabTmp=$this->getAbreviations('N');
|
||||
foreach ($tabTmp as $lib=>$abr) {
|
||||
$nomCourt=trim(str_replace(" $lib".'ES ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'E ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib".'S ', ' '.$abr.' ', " $nomCourt "));
|
||||
$nomCourt=trim(str_replace(" $lib ", ' '.$abr.' ', " $nomCourt "));
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
}
|
||||
if ($debug) echo "5-Autres Noms=$nomCourt".EOL;
|
||||
if (strlen($nomCourt)<=$taille) break;
|
||||
|
||||
$nomCourt=substr($nomCourt,0,$taille);
|
||||
$this->nomTronque=1;
|
||||
|
||||
//die($nomCourt);
|
||||
/** @todo A finir
|
||||
Tronquer ou abréger dans cette ordre
|
||||
- type de voie
|
||||
- titres
|
||||
- initiale du prénom
|
||||
- supprimez les articles (mais pas les particules dans un nom propre)
|
||||
- tronquer à 4 caractères les types de voie non normalisés
|
||||
- tronquer les extensions de voie
|
||||
- réduire le nom de la voie en supprimant les mots de la gauche vers la droite
|
||||
|
||||
Gérer les pluriels pour les voies, nom, titres, et formes juridiques
|
||||
**/
|
||||
$passage++;
|
||||
}
|
||||
return $nomCourt;
|
||||
}
|
||||
|
||||
|
||||
// Code Insee de la commune libCom32 Libellé de la commune (Ancienne norme 32) libCom38 Libellé
|
||||
function getLibCommune($codeInsee, $norme=38) {
|
||||
if ($norme<>32 && $norme<>38) {
|
||||
return 'La norme doit être 32 ou 38 caractères (38 par défaut)'.EOL;
|
||||
}
|
||||
|
||||
$ret=$this->iDb->select('villes.hexaviaVilles',
|
||||
"libCom32 , libCom38",
|
||||
"codeInseeCom='$codeInsee' LIMIT 0,1",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0 && $codeInsee>99000) {
|
||||
$codePaysInsee=substr($codeInsee,2,3);
|
||||
$ret=$this->iDb->select('jo.tabPays',
|
||||
"SUBSTRING(libPays,1,32) AS libCom32, SUBSTRING(libPays,1,38) AS libCom38",
|
||||
"codePaysInsee='$codeInsee' ORDER BY dependance ASC LIMIT 0,1",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
}
|
||||
if ($nbRet==0) return 'Aucune correspondance VILLE';
|
||||
elseif ($norme==32) return $ret[0]['libCom32'];
|
||||
else return $ret[0]['libCom38'];
|
||||
}
|
||||
|
||||
function getCPCommune($codeInsee)
|
||||
{
|
||||
$ret=$this->iDb->select('villes.hexaviaVilles',
|
||||
"codePostal",
|
||||
"codeInseeCom='$codeInsee' GROUP BY codePostal",false, MYSQL_ASSOC);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==1) return $ret[0]['codePostal'];
|
||||
return false;
|
||||
}
|
||||
|
||||
function getCodCommune($libelleCommune, $depOuCp='', $debug=false)
|
||||
{
|
||||
$norme=38;
|
||||
$codeCommune=false;
|
||||
$cp=$depOuCp;
|
||||
$cp2=substr($cp,0,2);
|
||||
$ret=$this->iDb->select('villes.hexaviaVilles',
|
||||
"idAdr56, codeInseeCom, libCom$norme, codeInseeGlobal, indPluridis, libLigne5n$norme, indRoudis, codePostal, libLigne6n$norme, codeInseePre, codeMaj$norme, dateMaj$norme, MATCH (codePostal, libCom38) AGAINST ('$depOuCp $libelleCommune' IN NATURAL LANGUAGE MODE) AS score",
|
||||
"MATCH (codePostal, libCom38) AGAINST ('$depOuCp $libelleCommune' IN NATURAL LANGUAGE MODE) ORDER BY score DESC",false, MYSQL_ASSOC);
|
||||
// print_r($ret);
|
||||
$nbRet=count($ret);
|
||||
if ($nbRet==0)
|
||||
return false;
|
||||
else {
|
||||
foreach($ret as $i=>$iRet) {
|
||||
if ($debug) echo "je compare '$depOuCp' avec '".$iRet['codePostal']."' et '$libelleCommune' avec '".$iRet["libCom$norme"]."' (".$iRet['idAdr56'].", score=".$iRet['score'].")".EOL;
|
||||
if (($depOuCp<>'' && ($iRet['codePostal']==$cp || substr($iRet['codePostal'],0,2)==$cp2)) && ($iRet["libCom$norme"]==$libelleCommune || preg_replace('/ 0/', ' ',$iRet["libCom$norme"])==$libelleCommune) || (strpos($iRet["libCom$norme"],$libelleCommune)>0 && $nbRet==1)) {
|
||||
$codeCommune=$iRet['codeInseeCom'];
|
||||
if ($iRet['score']>17) break;
|
||||
}
|
||||
}
|
||||
if (!$codeCommune) {
|
||||
$iRet=$ret[0];
|
||||
if ($debug) echo "On prend le score le + élevé s'il est > à 15 : je compare '$cp' avec '".$iRet['codePostal']."' et '$libelleCommune' avec '".$iRet["libCom$norme"]."' (".$iRet['idAdr56'].")".EOL;
|
||||
if ($debug) echo '['.trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$iRet["libCom$norme"])) .'-v/s-'.trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$libelleCommune)).']'.EOL;
|
||||
if (($depOuCp<>'' && ($iRet['codePostal']==$cp || substr($iRet['codePostal'],0,2)==$cp2)) && ($iRet["libCom$norme"]==$libelleCommune || (substr(trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$iRet["libCom$norme"])),0,26)==trim(preg_replace('/ (1ER|2EME|3EME|\d+)/', ' ',$libelleCommune)) && $iRet['score']>15) || (strpos($iRet["libCom$norme"],$libelleCommune)>0 && $nbRet==1))) {
|
||||
$codeCommune=$iRet['codeInseeCom'];
|
||||
}
|
||||
}
|
||||
//die("Code commune de $libelleCommune ($depOuCp) = $codeCommune".EOL);
|
||||
}
|
||||
return $codeCommune;
|
||||
}
|
||||
|
||||
function normaliseAdresse76310($L1,$L2,$L3,$L4,$L5,$L6,$L7='')
|
||||
{
|
||||
$tDeb=microtime(1);
|
||||
$tabRetR=$tabRetE=array();
|
||||
|
||||
$cp=substr(trim($L6),0,5);
|
||||
$cp2=substr($cp,0,2);
|
||||
$ville=trim(strtr(substr($L6,5),array(' SAINT '=>' ST ',' SAINTE '=>' STE ')));
|
||||
$ville=preg_replace('/ CEDEX\s?.*$/ui','',$ville);
|
||||
$tabRetI=array( 'operateurRnvp'=>'76310WEB',
|
||||
'in_cp'=>$cp,
|
||||
'in_dep'=>$cp2,
|
||||
'in_ville'=>$ville,
|
||||
'in_L1'=>trim($L1),
|
||||
'in_L2'=>trim($L2),
|
||||
'in_L3'=>trim($L3),
|
||||
'in_L4'=>trim($L4),
|
||||
'in_L5'=>trim($L5),
|
||||
'in_L6'=>trim($L6),
|
||||
'in_L7'=>trim($L7));
|
||||
|
||||
//$client = new SoapClient('http://www.rnvp-en-ligne.com/service.asmx?wsdl');
|
||||
$client = new SoapClient('http://www.rnvp-en-ligne.com/service_v5.asmx?wsdl');
|
||||
$nbEssais=1;
|
||||
|
||||
$array = array (
|
||||
'pi_session' => '-1',
|
||||
'pi_user' => 'SDPROD',
|
||||
'pi_password' => '7631014530',
|
||||
'pi_codedossier' => '0001',
|
||||
'pi_numfichier' => '1',
|
||||
'pi_rsoc' => utf8_encode($L1),
|
||||
//'pio_civ' => '',
|
||||
//'pio_nom' => '',
|
||||
//'pio_prenom' => '',
|
||||
'pio_cnom' => utf8_encode($L2), // Ligne 2
|
||||
'pio_cadrs' => utf8_encode($L3), // Ligne 3
|
||||
'pio_adresse' => utf8_encode($L4), // Ligne 4
|
||||
'pio_lieudit' => utf8_encode($L5), // Ligne 5
|
||||
'pio_cpville' => utf8_encode($L6), // Ligne 6
|
||||
'pio_pays' => utf8_encode($L7), // Ligne 7
|
||||
/* 'po_tnp' => '',
|
||||
'po_sex' => '',
|
||||
'po_civlong' => '',
|
||||
'po_cp' => '',
|
||||
'po_ville' => '',
|
||||
'po_insee' => '',
|
||||
'po_cqtnp' => '',
|
||||
'po_cqadrs' => '',
|
||||
'po_risquerestru' => '',
|
||||
'po_poidsmodif' => '',
|
||||
'po_rejet' => '',
|
||||
'po_etranger' => ''*/
|
||||
);
|
||||
while(1) {
|
||||
try {
|
||||
//$result = $client->Elfyweb_RNVP_Standard($array);
|
||||
$result = $client->Elfyweb_RNVP_Expert_V50($array);
|
||||
//print_r($result);
|
||||
$tabRetR=array( 'L1'=>$L1,
|
||||
'L2'=>$L2,
|
||||
'L3'=>strtoupper(utf8_decode($result->pio_cadrs)),
|
||||
'L4'=>strtoupper(utf8_decode($result->pio_adresse)),
|
||||
'L5'=>strtoupper(utf8_decode($result->pio_lieudit)),
|
||||
'L6'=>strtoupper(utf8_decode($result->pio_cpville)),
|
||||
/* [po_risquerestru] => 0
|
||||
[po_poidsmodif] => 0
|
||||
[po_rejet] =>
|
||||
[po_etranger] =>*/
|
||||
'Cp'=>$result->po_cp,
|
||||
'Ville'=>$result->po_ville,
|
||||
'Insee'=>$result->po_insee,
|
||||
/*'CQadrs'=>$result->po_cqadrs,
|
||||
'CQadrsLib'=>$this->tabAdrCQ[$result->po_cqadrs],
|
||||
'CQAdrRnvp'=>$this->getLibQualiteAdresse76310($result->po_cqadrs, $result->rejet),*/
|
||||
'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
);
|
||||
if (@$result->pio_pays<>'FRA') $tabRet['L7']=$result->pio_pays;
|
||||
break;
|
||||
} catch (SoapFault $fault) {
|
||||
$nbEssais++;
|
||||
if ($nbEssai<5) continue;
|
||||
$tabRetE=array( 'dureeRnvp'=>round(microtime(1)-$tDeb,3),
|
||||
'errRNVPcode'=>'S0',
|
||||
'errRNVPlib'=>"Erreur SOAP : ".print_r($fault,1));
|
||||
}
|
||||
}
|
||||
$tabRet=array_merge($tabRetI,$tabRetR,$tabRetE);
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getLibQualiteAdresse76310($cqadrs, $correctionDouteuse)
|
||||
{
|
||||
switch ($cqadrs*1) {
|
||||
case 10: // Adresse correcte
|
||||
case 20: // Adresse correcte (Voie non reconue dans un CEDEX ou BP)
|
||||
case 21: // Adresse correcte mais numéro de facade hors borne (petite ville)
|
||||
case 22: // Adresse correcte mais numéro de facade absent (petite ville)
|
||||
case 23: // Adresse correcte mais numéro de facade hors borne (grande ville)
|
||||
case 24: // Adresse correcte mais numéro de facade absent (grande ville)
|
||||
$cqRnvpSed=1;
|
||||
break;
|
||||
case 31: // Voie non reconnue (petite ville, quartier reconnu)
|
||||
case 51: // Voie non reconnue (grande ville, quartier reconnu)
|
||||
$cqRnvpSed=2;
|
||||
break;
|
||||
case 30: // Voie non reconnue (petite ville)
|
||||
case 50: // Voie non reconnue (grande ville)
|
||||
$cqRnvpSed=3;
|
||||
break;
|
||||
case 40: // Voie absente (petite ville, quartier reconnu)
|
||||
case 41: // Voie absente (petite ville)
|
||||
case 60: // Voie absente (grande ville, quartier reconnu)
|
||||
case 61: // Voie absente (grande ville)
|
||||
$cqRnvpSed=4;
|
||||
break;
|
||||
case 70: // Voie présente mais Cp/Ville non corrigeable
|
||||
case 80: // Voie absente et Cp/Ville non corrigeable
|
||||
$cqRnvpSed=5;
|
||||
break;
|
||||
default:
|
||||
$cqRnvpSed=0;
|
||||
break;
|
||||
}
|
||||
|
||||
if ($correctionDouteuse=='D') $cqRnvpSed=0;
|
||||
return $cqRnvpSed;
|
||||
}
|
||||
|
||||
function getAdresseRnvpSource($source, $source_id, $num=0)
|
||||
{
|
||||
$ret=$this->iDb->select(
|
||||
'villes.rnvpSources',
|
||||
'id, source, source_id, num, L1rnvp, L2rnvp, L3rnvp, L4rnvp, L5rnvp, L6rnvp, L7rnvp, Pays, dateInsert,
|
||||
operateurRnvp, dateEnvoiRnvp, dateRetourRnvp, codeRetour, NumVoie, BisTer, TypeVoieCourt, TypeVoieLong, LibVoie,
|
||||
Cp, Ville, Insee, CQadrs, CorrectionImportante, CorrectionDouteuse, HexaCle, CQL3, InseeGlobal, OldInsee,
|
||||
IsInseeReconstitue, NumDept, IdHexavia, IdHexaposte, Iris_Rivoli, Iris_Ilot99, Iris_CodeIris, Iris_Canton,
|
||||
Iris_Zus, Iris_Zfu, CqIris, dateUpdate',
|
||||
"source=$source AND source_id=$source_id AND num=$num LIMIT 0,1",false, MYSQL_ASSOC);
|
||||
$tabRet=$ret[0];
|
||||
$tabRet['CQadrsLib']=$this->tabAdrCQ[$tabRet['CQadrs']];
|
||||
|
||||
$tabRet['CQAdrRnvp']=$this->getLibQualiteAdresse76310($tabRet['CQadrs'], $tabRet['CorrectionDouteuse']);
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,225 +0,0 @@
|
||||
<?php
|
||||
class classMSigVille
|
||||
{
|
||||
private $client;
|
||||
|
||||
private $url='http://sig.ville.gouv.fr/recherche-adresses-zus-zfu-quartiers-des-cucs';
|
||||
private $referer='';
|
||||
private $codeRetour;
|
||||
private $page;
|
||||
private $body;
|
||||
private $cookie='';
|
||||
private $timeout=5;
|
||||
private $duree=false;
|
||||
|
||||
function __construct() {
|
||||
if ($this->cookie=='') {
|
||||
$tdeb=microtime(1);
|
||||
$this->page=getUrl($this->url, $this->cookie, '', $this->referer, false, 'sig.ville.gouv.fr', '', $this->timeout);
|
||||
$this->duree=round(microtime(1)-$tdeb,3);
|
||||
$this->referer=$this->url;
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->cookie=$this->header['Cookie'];
|
||||
if ($this->codeRetour<>200) return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getZonage($adrNum, $adrIndRep, $adrTypeVoie, $adrLibVoie, $cp, $ville='', $codeRivoli='', $rnvp=false, $raisonSociale='TEST', $debug=false) {
|
||||
if ($this->cookie<>'') {
|
||||
$tdeb=microtime(1);
|
||||
$post=array('insee_com'=>'01053',
|
||||
'code_postal'=>'01000',
|
||||
'nom_commune'=>'Bourg-en-Bresse',
|
||||
'num_adresse'=>'8',
|
||||
'id_voie'=>28,
|
||||
'nom_voie'=>'RUE+DES+BLANCHISSERIES',
|
||||
'x'=>33,
|
||||
'y'=>19,
|
||||
);
|
||||
$this->page=getUrl($this->url, $this->cookie, $post, $this->referer, false, 'sig.ville.gouv.fr', '', $this->timeout);
|
||||
$this->duree=round(microtime(1)-$tdeb,3);
|
||||
$this->referer=$this->url;
|
||||
$this->body=$page['body'];
|
||||
$this->codeRetour=$page['code'];
|
||||
$this->header=$page['header'];
|
||||
$this->cookie=$this->header['Cookie'];
|
||||
if ($this->codeRetour<>200) return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$tabRep=array();
|
||||
if (!$rnvp) {
|
||||
if ($cp<10000) $cp='0'.$cp;
|
||||
$dep2=substr($cp,0,2)*1;
|
||||
$dep3=substr($cp,0,3)*1;
|
||||
switch ($dep2) {
|
||||
case 0:
|
||||
case 5:
|
||||
case 9:
|
||||
case 15:
|
||||
case 19:
|
||||
case 23:
|
||||
case 32:
|
||||
case 46:
|
||||
case 48:
|
||||
case 82:
|
||||
case 97: // DOM
|
||||
case 98: // TOM
|
||||
case 99: // Etranger
|
||||
return $tabRep;
|
||||
break;
|
||||
default:
|
||||
//if ($dep3==975) return $tabRep;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$iDb=new WDB();
|
||||
$adresse=addslashes(trim(preg_replace('/ +/',' ', "$adrNum $adrIndRep $adrTypeVoie $adrLibVoie")));
|
||||
$ville=addslashes($ville);
|
||||
$ret=$iDb->select( 'jo.zonage', 'zus, zru, zfu, cucs', "address='$adresse' AND adr_cp='$cp' AND adr_ville='$ville'",false, MYSQL_ASSOC);
|
||||
if (count($ret)>0) {
|
||||
$zones=$ret[0];
|
||||
$tabRep['ZUS']=$tabRep['ZFU']=$tabRep['ZRU']=$tabRep['CUCS']='NON';
|
||||
if (trim($zones['zus'])<>'') {
|
||||
if (trim($zones['zus'])=='NSP') $tabRep['ZUS']='NSP';
|
||||
else $tabRep['ZUS']='OUI';
|
||||
$tabRep['NZUS']=$zones['zus'];
|
||||
}
|
||||
if (trim($zones['zru'])<>'') {
|
||||
if (trim($zones['zru'])=='NSP') $tabRep['ZRU']='NSP';
|
||||
else $tabRep['ZRU']='OUI';
|
||||
$tabRep['NZRU']=$zones['zru'];
|
||||
}
|
||||
if (trim($zones['zfu'])<>'') {
|
||||
if (trim($zones['zfu'])=='NSP') $tabRep['ZFU']='NSP';
|
||||
else $tabRep['ZFU']='OUI';
|
||||
$tabRep['NZFU']=$zones['zfu'];
|
||||
}
|
||||
if (trim($zones['cucs'])<>'') {
|
||||
if (trim($zones['cucs'])=='NSP') $tabRep['CUCS']='NSP';
|
||||
else $tabRep['CUCS']='OUI';
|
||||
$tabRep['NCUCS']=$zones['cucs'];
|
||||
}
|
||||
//return $tabRep;
|
||||
} else {
|
||||
|
||||
try {
|
||||
if (trim($raisonSociale)=='') $raisonSociale='TEST'; // Le RNVP ne fonctionne pas sans la Raison Sociale qui est la 1ère ligne d'adresse
|
||||
$rep=$this->client->zonage( new SoapParam(strtr("$raisonSociale:$adresse:$cp:$ville",
|
||||
'¿°ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿ??',
|
||||
' aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr'),'adresse'),
|
||||
new SoapParam(':','separateur'),
|
||||
new SoapParam('type=M','options')
|
||||
);
|
||||
/*$rep=$this->client->zonage( "<adresse></adresse>".
|
||||
"<separateur>:</separateur>".
|
||||
"<options>type=M</options>");*/
|
||||
|
||||
/** Découpage des ZFU, CUCS etcs...
|
||||
**/
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s').' - '.implode("\n", $rep)."\n============================================================================\n");
|
||||
fclose($fp);
|
||||
|
||||
$tabZones=explode(',',$rep['zonage']); // ZUS=OUI,NZUS=1127020,ZFU=OUI,NZFU=11270ZF,CUCS=OUI,NCUCS=1127020
|
||||
foreach ($tabZones as $zone) {
|
||||
$tabTmp=explode('=',$zone);
|
||||
if (trim($tabTmp[0])<>'')
|
||||
$tabRep[$tabTmp[0]]=$tabTmp[1];
|
||||
}
|
||||
if ($tabRep['ZUS']=='NSP') $tabRep['NZUS']='NSP';
|
||||
if ($tabRep['ZRU']=='NSP') $tabRep['NZRU']='NSP';
|
||||
if ($tabRep['ZFU']=='NSP') $tabRep['NZFU']='NSP';
|
||||
if ($tabRep['CUCS']=='NSP') $tabRep['NCUCS']='NSP';
|
||||
$adresse=stripslashes(trim(preg_replace('/ +/',' ', "$adrNum $adrIndRep $adrTypeVoie $adrLibVoie")));
|
||||
$ville=stripslashes($ville);
|
||||
$tabInsert=array( 'address'=>$adresse,
|
||||
'adr_cp'=>$cp,
|
||||
'adr_ville'=>$ville,
|
||||
'zus'=>$tabRep['NZUS'],
|
||||
'zru'=>$tabRep['NZRU'],
|
||||
'zfu'=>$tabRep['NZFU'],
|
||||
'cucs'=>$tabRep['NCUCS'],
|
||||
'adrNum'=>$adrNum,
|
||||
'adrIndRep'=>$adrIndRep,
|
||||
'adrTypeVoie'=>$adrTypeVoie,
|
||||
'adrLibVoie'=>$adrLibVoie,
|
||||
'rivoli'=>$codeRivoli,
|
||||
);
|
||||
$iDb->insert('jo.zonage', $tabInsert);
|
||||
|
||||
/** Autres Informations de la RNVP
|
||||
**/
|
||||
if ($rnvp || $debug) {
|
||||
$tabRepTmp=array();
|
||||
$tabZones=explode(',',$rep['objdesc']);
|
||||
foreach ($tabZones as $zone) {
|
||||
$tabTmp=explode('=',$zone);
|
||||
if (trim($tabTmp[0])<>'')
|
||||
$tabRepTmp[$tabTmp[0]]=$tabTmp[1];
|
||||
}
|
||||
if (!$debug) {
|
||||
$tabRep['ADR1']=@$tabRepTmp['ADR1'];
|
||||
$tabRep['ADR2']=@$tabRepTmp['ADR2'];
|
||||
$tabRep['ADR3']=@$tabRepTmp['ADR3'];
|
||||
$tabRep['ADR4']=@$tabRepTmp['ADR4'];
|
||||
$tabRep['ADR5']=@$tabRepTmp['ADR5'];
|
||||
$tabRep['ADR6']=@$tabRepTmp['ADR6'];
|
||||
$tabRep['ADR7']=@$tabRepTmp['ADR7'];
|
||||
} else {
|
||||
$tabRep=array_merge($tabRep, $tabRepTmp);
|
||||
}
|
||||
}
|
||||
} catch (SoapFault $fault) {
|
||||
echo 'ERREUR SOAP :'.EOL;
|
||||
print_r($fault);
|
||||
echo $this->client->__getLastRequest()."\n";
|
||||
echo $this->client->__getLastResponse()."\n";
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s').' - ERREUR SOAP : Requete = '.$this->client->__getLastRequest()."\n Reponse = ".$this->client->__getLastResponse()."\n============================================================================\n");
|
||||
fclose($fp);
|
||||
}
|
||||
//return $tabRep;
|
||||
}
|
||||
$codeInsee=substr($codeRivoli,0,5);
|
||||
$ret=$iDb->select( 'jo.zonageInsee', 'typeZone, arreteDate, decretDate, decretNum, decretModifieDate, decretModifieNum, dateDebut, dateFin', "codeInsee='$codeInsee'",false, MYSQL_ASSOC);
|
||||
$tabRep['ZRR']=$tabRep['AFR']='NON';
|
||||
foreach ($ret as $zones)
|
||||
switch ($zones['typeZone']) {
|
||||
case 'ZRR': $tabRep['ZRR']='OUI'; $tabRep['NZRR']=$codeInsee; break;
|
||||
case 'ZAFR': $tabRep['AFR']='OUI'; $tabRep['NAFR']=$codeInsee; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return $tabRep;
|
||||
}
|
||||
|
||||
function searchByTelFax($tel) {
|
||||
return $this->getTelFax('','','','',$tel);
|
||||
}
|
||||
|
||||
function getTelFax($nom, $cp, $ville='', $prenom='', $tel='') {
|
||||
if (trim($tel)<>'')
|
||||
$query="<telep>$tel</telep><scoremini>10</scoremini><distinction>30</distinction>";
|
||||
elseif (trim($prenom)=='')
|
||||
$query="<rs>$nom</rs><cpville>$cp $ville</cpville><scoremini>90</scoremini><distinction>30</distinction>";
|
||||
else
|
||||
$query="<nom>$nom</nom><prenom>$prenom</prenom><cpville>$cp $ville</cpville><scoremini>90</scoremini><distinction>30</distinction>";
|
||||
|
||||
$rep=$this->client->rechtel($query);
|
||||
|
||||
$fp=fopen(LOG_PATH.'/amabis.log', 'a');
|
||||
fwrite($fp, date('d-m-Y H:i:s')." - $query - ".implode("\n", $rep)."\n============================================================================\n");
|
||||
fwrite($fp, "Requête : ".$this->client->__getLastRequest()."\n");
|
||||
fwrite($fp, "Réponse : ".$this->client->__getLastResponse()."\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user