Compare commits
810 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
86e6e59831 | ||
|
886f480754 | ||
|
1ec1072353 | ||
|
1a59c9894c | ||
|
bb499fe727 | ||
|
6121809f84 | ||
|
3030715fe0 | ||
|
151e54a422 | ||
|
4ddee67405 | ||
|
8267cdad14 | ||
|
33927fc6dc | ||
|
43990a22fc | ||
|
5e415fcdc6 | ||
|
8990c52d81 | ||
|
eaf4d1c699 | ||
|
996db51afc | ||
|
853fc50aa1 | ||
|
d4f49253d1 | ||
|
d361a0feb0 | ||
|
3eabd646fc | ||
|
0e976bdb08 | ||
|
1fefbb8fb8 | ||
|
f1ea90fb00 | ||
|
2247249b35 | ||
|
6553dd8d78 | ||
|
8e424d754c | ||
|
a6a16e8e7d | ||
|
89ba5d9020 | ||
|
ed28602d9a | ||
|
0ed40c5af9 | ||
|
c3534fade4 | ||
|
e212655a5d | ||
|
448dc88f47 | ||
|
fdc888632e | ||
|
13bb1773c5 | ||
|
a738f80c86 | ||
|
711efe226c | ||
|
af4cca3338 | ||
|
a9433de92d | ||
|
26cdeae7af | ||
|
0e22d68c6c | ||
|
b814c02ff9 | ||
|
f1caee808b | ||
|
049d4b8885 | ||
|
968c09ef33 | ||
|
195496bad6 | ||
|
4c1e01ef15 | ||
|
c8afc3902a | ||
|
0eb0240d27 | ||
|
e4cb72d7c0 | ||
|
f0a051e7cc | ||
|
2931e94d70 | ||
|
ef3c5889a7 | ||
|
605c11cde3 | ||
|
a1b9e2bb73 | ||
|
16a517780c | ||
|
d1f342dd3d | ||
|
ce3928354b | ||
|
46af8f554e | ||
|
a5f7aa754d | ||
|
6079a4823b | ||
|
5ae065d5c8 | ||
|
ead00f25db | ||
|
cfb7a758a3 | ||
|
011a21702b | ||
|
204abd0abe | ||
|
19d8112e5f | ||
|
f9d26de37e | ||
|
4e3f3b6a52 | ||
|
be0c4cea80 | ||
|
1f2e47ba42 | ||
|
b189137b3f | ||
|
1e01aa0b1e | ||
|
c93d8cbb07 | ||
|
0c9872351d | ||
|
e69aa50ab3 | ||
|
b5473a80f4 | ||
|
36d02b458f | ||
|
286c6ca6cc | ||
|
73e61508fa | ||
|
26aa3717dc | ||
|
341bba5697 | ||
|
3f0fb552dd | ||
|
52eacea29b | ||
|
4601809b27 | ||
|
80ef4457b5 | ||
|
e4c1351290 | ||
|
99f808fa12 | ||
|
2c1064b425 | ||
|
1b6df19364 | ||
|
3bcf15e2d7 | ||
|
210701a2c9 | ||
|
b627553f6b | ||
|
36854cbec0 | ||
|
891ccb5d19 | ||
|
6252fb763e | ||
|
c7f6359b87 | ||
|
5a14343455 | ||
|
fd50f7ce6c | ||
|
c0a378c276 | ||
|
ab7e869ca8 | ||
|
2ac4689721 | ||
|
c8b263041f | ||
|
8fddb8367e | ||
|
0ca2432493 | ||
|
7a6e3663e5 | ||
|
9cc95bcd91 | ||
|
c627a137f2 | ||
|
a16ddf86a6 | ||
|
cbddecf560 | ||
|
2c4ea6b7ac | ||
|
959e2e6e8a | ||
|
4beb98723a | ||
|
bf6f48f690 | ||
|
1f1e217a45 | ||
|
4c30dae316 | ||
|
85aa5af7fe | ||
|
1c029fafe4 | ||
|
ba6dbbb0d7 | ||
|
51b87be068 | ||
|
cff8ac348b | ||
|
4d982b0973 | ||
|
b92494953b | ||
|
0592db8067 | ||
|
05c54cbf47 | ||
|
0b1512f9b1 | ||
|
e930a8bbeb | ||
|
7e439446d4 | ||
|
82b21d631d | ||
|
9e3545391f | ||
|
2eb5440573 | ||
|
cd8e318b1d | ||
|
f53575a435 | ||
|
4d32d30a14 | ||
|
f95a5f0927 | ||
|
a12873e7eb | ||
|
5a703145f6 | ||
|
81a4e690fa | ||
|
4ba0a041bb | ||
|
d3650ca8fc | ||
|
fc5cdc796e | ||
|
6f39ab82ae | ||
|
36c6545a7b | ||
|
e14e96610a | ||
|
27c1e6964b | ||
|
af98ca2d07 | ||
|
c9f5ceb2c9 | ||
|
86bc121292 | ||
|
83d545c0c8 | ||
|
42865deac9 | ||
|
1bd005020a | ||
|
44e9dd0278 | ||
|
4b6eed1957 | ||
|
58495b61df | ||
|
75a1362e58 | ||
|
0383b4d1f8 | ||
|
472529df5f | ||
|
5383139da4 | ||
|
f0f8abfc9f | ||
|
dbfaad4eea | ||
|
4de758ca38 | ||
|
15cdb9a46d | ||
|
6900b9a18b | ||
|
e1fdcf662e | ||
|
3f256dba7e | ||
|
75e191cbf0 | ||
|
e1305a5365 | ||
|
92e7788117 | ||
|
b5ff0b4654 | ||
|
caccc9d9fd | ||
|
9716e52619 | ||
|
07168bcb82 | ||
|
c7988a3953 | ||
|
09a3134052 | ||
|
e986fc30f1 | ||
|
fbaa25862e | ||
|
c16c885780 | ||
|
30c312b067 | ||
|
afcd6f0b4d | ||
|
acb2313b99 | ||
|
250e5c9819 | ||
|
180bf90e89 | ||
|
e1951a6468 | ||
|
2b2d72452c | ||
|
c1b1def04d | ||
|
e2683dcda6 | ||
|
d3c20a0a8a | ||
|
dc48803555 | ||
|
39320764dc | ||
|
a648fff7e5 | ||
|
297acc9fcd | ||
|
99d1117f80 | ||
|
5ebf98e79d | ||
|
3e78aad0c4 | ||
|
332d1826f8 | ||
|
27df43931e | ||
|
7b2eb49921 | ||
|
1d827af35a | ||
|
d28ba0de01 | ||
|
05a7a3df36 | ||
|
f237db692b | ||
|
b92f2b1019 | ||
|
2301e706fb | ||
|
0dd41a8c11 | ||
|
eae1265e37 | ||
|
5a0e66d59f | ||
|
e2c371e251 | ||
|
1897655908 | ||
|
5ab102b6cf | ||
|
9de2875931 | ||
|
6eb2ed367b | ||
|
501533fc8f | ||
|
d622977dac | ||
|
08700967e2 | ||
|
1cfc57905b | ||
|
33214f44dd | ||
|
d013580b01 | ||
|
74785d8b28 | ||
|
010bc0fd87 | ||
|
ce75d6509e | ||
|
4ae685d76d | ||
|
e91eed0e1a | ||
|
e5897edb25 | ||
|
337ff7750a | ||
|
4f37e8be76 | ||
|
d14474c20e | ||
|
dfb1be9d65 | ||
|
528f544e33 | ||
|
43d776b866 | ||
|
a773fb2860 | ||
|
2509368825 | ||
|
b0e6e4ca4d | ||
|
8acb962cb6 | ||
|
13dc936b6c | ||
|
8c66f28b90 | ||
|
4c2db4ef20 | ||
|
b703307f7c | ||
|
5239c18102 | ||
|
9b22b4ca3d | ||
|
64a68e1cc7 | ||
|
c335f30312 | ||
|
61e457e56b | ||
|
d866b5d840 | ||
|
40b91ad9c0 | ||
|
02d4a8ae5f | ||
|
18f059d82f | ||
|
4e71d73328 | ||
|
35df1838e8 | ||
|
0874dee8df | ||
|
1771bd0554 | ||
|
ffdaecb9ac | ||
|
d809739961 | ||
|
ca6488677b | ||
|
7046c7a453 | ||
|
ab8d3415b8 | ||
|
9284a04ec1 | ||
|
954dca6944 | ||
|
5d26f823fd | ||
|
aa0db85f31 | ||
|
ad1a877ef4 | ||
|
f66ea54a81 | ||
|
f804e4710a | ||
|
117dec028d | ||
|
f0bd4fc3dc | ||
|
3583fdd333 | ||
|
a785f81f33 | ||
|
e5fcc48b05 | ||
|
e2608152a2 | ||
|
f7d5ef8060 | ||
|
206c19e3e2 | ||
|
b53665953f | ||
|
7c574d164e | ||
|
b4ddca623b | ||
|
9affb31118 | ||
|
ffd7eb8c80 | ||
|
b9cad4af3f | ||
|
136f9623be | ||
|
67eb3dd084 | ||
|
a929f17e50 | ||
|
f22c5b06af | ||
|
06569d15f0 | ||
|
a1dd0324bf | ||
|
6a399901ad | ||
|
56babddc4b | ||
|
8e813e7918 | ||
|
749fdffcc7 | ||
|
f710381f5d | ||
|
fe37b17fac | ||
|
e249753b24 | ||
|
8e04267928 | ||
|
f74ecd6ad1 | ||
|
c6c53f90b5 | ||
|
070894f087 | ||
|
e59403cf84 | ||
|
a1ba1ac947 | ||
|
d6ad8fde55 | ||
|
c2bd5bd412 | ||
|
bf0d109eaa | ||
|
3cf10adb90 | ||
|
e03047ee7d | ||
|
c0149839e0 | ||
|
346d4ce860 | ||
|
e17b72819b | ||
|
bf893a2cbb | ||
|
029566c346 | ||
|
b12e852e68 | ||
|
923671261b | ||
|
88478b95f9 | ||
|
dc8246438f | ||
|
71011bd775 | ||
|
771dd362be | ||
|
fc74474639 | ||
|
141dc9264c | ||
|
c7535df8c5 | ||
|
a398a06edf | ||
|
ef9584e5e4 | ||
|
c4698d9a6e | ||
|
6f0d1af9f6 | ||
|
cdb35ba4c9 | ||
|
10d03aa74c | ||
|
9d904e3876 | ||
|
c6725dd0af | ||
|
ae2178ec7a | ||
|
eb08f6dcdc | ||
|
2590f8d1ab | ||
|
61ea754b45 | ||
|
656e8a12b2 | ||
|
a3651c6ad7 | ||
|
4c17580749 | ||
|
1ffa5eebf1 | ||
|
3c696c0443 | ||
|
e6cbf1a006 | ||
|
2d0eba0bde | ||
|
da50e8f4ce | ||
|
5dd639878c | ||
|
520f167aaa | ||
|
fced0a8da7 | ||
|
ef22877b66 | ||
|
1aeecef0c5 | ||
|
5ee9bee799 | ||
|
13b785873e | ||
|
5edaa7e031 | ||
|
45eba61cd9 | ||
|
df1a2e8f38 | ||
|
967b1dd9d2 | ||
|
4d9951d9d4 | ||
|
4ffb8f00a3 | ||
|
27d8212a18 | ||
|
cdd951fd11 | ||
|
9d7c856846 | ||
|
65447d43b8 | ||
|
2e6ef7b72f | ||
|
43dfab2b12 | ||
|
46a3115524 | ||
|
cd18a049e7 | ||
|
d567502e7d | ||
|
ef51dd969e | ||
|
14966da858 | ||
|
e716181a4d | ||
|
3e247f1321 | ||
|
e130cf3881 | ||
|
5eeea93401 | ||
|
53421fba5c | ||
|
951ab7efd4 | ||
|
6de0dc1a0c | ||
|
a03520736a | ||
|
1f7158d2b1 | ||
|
2254b415cf | ||
|
5e7a3e04a5 | ||
|
da3a701f47 | ||
|
da715c8465 | ||
|
81fd108a54 | ||
|
6f4ed6d185 | ||
|
4961e1ee7f | ||
|
993dc60000 | ||
|
a523b6d772 | ||
|
49b174cc27 | ||
|
1cd65fb0ab | ||
|
5ab91eb8c7 | ||
|
b1ab4180f1 | ||
|
cb5fb9c434 | ||
|
439262b28a | ||
|
94c051b362 | ||
|
788c2210b1 | ||
|
87e1a3faac | ||
|
28baec0921 | ||
|
9a2175ed4a | ||
|
e079513039 | ||
|
934f1e621f | ||
|
0bee1619ab | ||
|
1791817fcf | ||
|
37151eb6c5 | ||
|
78c7fb02e2 | ||
|
a6f07c411e | ||
|
cb2c082d04 | ||
|
ec0110389c | ||
|
0141276b90 | ||
|
89428b43cf | ||
|
5e00bdf6d5 | ||
|
5c74b398f5 | ||
|
5f412b2315 | ||
|
42cf983eb5 | ||
|
a6f17922bd | ||
|
c343c5197a | ||
|
2911697d75 | ||
|
0f922f7d02 | ||
|
991423a077 | ||
|
389509d700 | ||
|
fc9e1fdfd4 | ||
|
6e6647c4d8 | ||
|
a11b00afd5 | ||
|
220641782d | ||
|
53e751a9f3 | ||
|
8ad1bbf357 | ||
|
99493051cf | ||
|
505a8a5802 | ||
|
1d60e3a51a | ||
|
34624d7bbb | ||
|
1d75b3a650 | ||
|
7eaa286977 | ||
|
3b3df7a964 | ||
|
996f785440 | ||
|
b09c5dfd97 | ||
|
37fe20d668 | ||
|
b557b7e757 | ||
|
d139dc886f | ||
|
ff681eaa64 | ||
|
23bcadcf02 | ||
|
fc600f3be2 | ||
|
95f1d2054d | ||
|
053d4d0b89 | ||
|
1444bd6283 | ||
|
49aded2279 | ||
|
5fb0a6c8a0 | ||
|
c0c6df3346 | ||
|
c188a96f09 | ||
|
12a1930b1c | ||
|
b939e9604e | ||
|
92d20339f7 | ||
|
8bfa2f6f2b | ||
|
81f4059371 | ||
|
cf528a531a | ||
|
5196da2329 | ||
|
be87fb8352 | ||
|
a4ac98b4e6 | ||
|
41f9ce83e3 | ||
|
66d8069d91 | ||
|
1d261f6c7f | ||
|
2c9d24dfb1 | ||
|
df5ebbdb7f | ||
|
2697e8933d | ||
|
daabfd826a | ||
|
075b6e9918 | ||
|
c69ebd101e | ||
|
e06561b438 | ||
|
557235c760 | ||
|
fd1e1edc19 | ||
|
fae32b348d | ||
|
ec615a6e80 | ||
|
b6893999e3 | ||
|
51ba06b275 | ||
|
0a046d046f | ||
|
ccd2641ab3 | ||
|
fb3ecd7321 | ||
|
639b476294 | ||
|
c9bba47a74 | ||
|
944d26d7b5 | ||
|
77174d28c0 | ||
|
69d2803b08 | ||
|
abfc928ee7 | ||
|
599380552d | ||
|
b403056e93 | ||
|
cec606ae72 | ||
|
10d5a73b4f | ||
|
c52157ea20 | ||
|
1d87d5af73 | ||
|
b80891b53d | ||
|
06c1bab20a | ||
|
4afd6106e6 | ||
|
bc400c658c | ||
|
26e2c2ee69 | ||
|
4bf2ca7a4b | ||
|
8c4fb83566 | ||
|
6889d5294a | ||
|
57aa0bc875 | ||
|
77368058b1 | ||
|
286ad446cf | ||
|
676e15833e | ||
|
d9ac13d453 | ||
|
2d6c9545c8 | ||
|
4adddfb061 | ||
|
b0c5b83115 | ||
|
8bc286bdab | ||
|
5a47a6a24a | ||
|
4fd7614f58 | ||
|
85ed70bdb0 | ||
|
fcafbe31f8 | ||
|
70e6ac262a | ||
|
1f29e9f4d8 | ||
|
5f86ae58b6 | ||
|
0f81a66b90 | ||
|
f0285eb499 | ||
|
0eab5291e9 | ||
|
511e2af345 | ||
|
2180eb9f3a | ||
|
adaaa66dd1 | ||
|
0db3c8907c | ||
|
95a57d9446 | ||
|
fdd3dddbe1 | ||
|
8932eb138a | ||
|
619da73aae | ||
|
3a78d2bb5c | ||
|
d8d52662f4 | ||
|
605e963695 | ||
|
a153844832 | ||
|
51cab1e5d2 | ||
|
42710f7528 | ||
|
0610903073 | ||
|
b62d3189e9 | ||
|
4526fe80f0 | ||
|
a65a9fc2a2 | ||
|
75c0391a19 | ||
|
d2cd06d96b | ||
|
2931f21cc4 | ||
|
d99f974c7c | ||
|
046db3272d | ||
|
d68cf89d21 | ||
|
e097a2074d | ||
|
d4a3ca4360 | ||
|
f7fd60c9a0 | ||
|
5399c57010 | ||
|
d0a0857987 | ||
|
35e837af81 | ||
|
fbb019c7d4 | ||
|
7ca32d69e4 | ||
|
088dd975a6 | ||
|
6487cb4532 | ||
|
83d3cb5f4a | ||
|
e96ce7127b | ||
|
b06cd50d82 | ||
|
6a22104b36 | ||
|
3e48103956 | ||
|
4ad4c24221 | ||
|
62fc0c17d5 | ||
|
401dfa0cf3 | ||
|
d2996c69f7 | ||
|
2ab8d3e583 | ||
|
55e05fbe63 | ||
|
512abb9d38 | ||
|
e6e169fbe7 | ||
|
349dde60de | ||
|
f6a9e222c1 | ||
|
1bdce6771c | ||
|
4197ad76cb | ||
|
da28d19390 | ||
|
38922b0fd0 | ||
|
9fc24e0ab1 | ||
|
697c7ebb5d | ||
|
82a99a4efa | ||
|
bb82175e59 | ||
|
b0207bf239 | ||
|
9510505afd | ||
|
a346cf5505 | ||
|
7c18e4a4b1 | ||
|
17e152ce0b | ||
|
0233d4b34f | ||
|
b0962b753c | ||
|
5ad2717112 | ||
|
2f26c2409d | ||
|
42c9f843e3 | ||
|
7cf0b68865 | ||
|
0d1a39b237 | ||
|
e18f1b3b40 | ||
|
3d867a8c7f | ||
|
9db6f449a1 | ||
|
7f3954d470 | ||
|
e2bc5393a7 | ||
|
b3bc52e460 | ||
|
57c1766c60 | ||
|
003681a91d | ||
|
f83053458e | ||
|
cbe5f56cc4 | ||
|
26fdd036c4 | ||
|
e2c64172fb | ||
|
a638ebf87f | ||
|
bbd9d47187 | ||
|
572eaf92c9 | ||
|
875025e507 | ||
|
4686cbc8d5 | ||
|
838c0aeb4a | ||
|
26d4ad4ae0 | ||
|
18bd65b991 | ||
|
3993257e59 | ||
|
27438be586 | ||
|
b0ba3c25ba | ||
|
82fd8a3fae | ||
|
943eb22c7c | ||
|
ee95e69664 | ||
|
bfe9a89091 | ||
|
8cd4fe17d0 | ||
|
fe9747f9e4 | ||
|
10668fd3f6 | ||
|
976e10b434 | ||
|
6025314471 | ||
|
9983e9c1eb | ||
|
d6bcd86464 | ||
|
b9cec9515b | ||
|
af1730d2e6 | ||
|
fa03081e67 | ||
|
d9253f962e | ||
|
ff7707563e | ||
|
a2568e417b | ||
|
21ddf64775 | ||
|
7135be80d3 | ||
|
d668dbc2d1 | ||
|
9581c825db | ||
|
1da719624c | ||
|
791e5c14ad | ||
|
80e214a19b | ||
|
ecc492c1ce | ||
|
189a519597 | ||
|
58b1e456f7 | ||
|
eb58f69819 | ||
|
23166356d4 | ||
|
28f7d52e43 | ||
|
75e6913ccf | ||
|
78c4d98eee | ||
|
7397619660 | ||
|
4b4608f306 | ||
|
edf7b7e028 | ||
|
0e43da9d1c | ||
|
3c89575003 | ||
|
e5929d53c4 | ||
|
d6b00d4063 | ||
|
a4391f3886 | ||
|
c1c8449c72 | ||
|
d3684f6835 | ||
|
05b829d0d7 | ||
|
2bb37b2e11 | ||
|
71b6864bcc | ||
|
90031051ee | ||
|
d6532f955a | ||
|
efa137c644 | ||
|
2c816731ed | ||
|
ffc27e0766 | ||
|
59df244e79 | ||
|
85dd71c9fa | ||
|
4a3f20b578 | ||
|
74187e5e35 | ||
|
ad3c39fcfc | ||
|
9c860a1f1f | ||
|
8dd8af6fa4 | ||
|
630f45adce | ||
|
112081aba9 | ||
|
493cf24376 | ||
|
99ebc365fd | ||
|
b7185d60c3 | ||
|
18869a8e31 | ||
|
5a50253960 | ||
|
7612d0e17c | ||
|
90eb13188e | ||
|
a97b6a01d6 | ||
|
42c7be5e22 | ||
|
ebd7fae292 | ||
|
fe9a39bd82 | ||
|
9a0853c2ea | ||
|
e579d3a90a | ||
|
06c50d0d36 | ||
|
aaf95f0b35 | ||
|
3d8bdbba8b | ||
|
cee2fe1bd3 | ||
|
a76be3aae3 | ||
|
aade0196ae | ||
|
b8933aa09a | ||
|
d8d87f04f2 | ||
|
23fae60167 | ||
|
398171e813 | ||
|
1b7965fbd2 | ||
|
4b99c809fc | ||
|
b790b950f1 | ||
|
878b621a08 | ||
|
24eb5def51 | ||
|
bb5b0b707a | ||
|
26869a2fd8 | ||
|
41a7d74bfd | ||
|
db04d8c77e | ||
|
6ec41300d2 | ||
|
79dd70b755 | ||
|
0ea33fb71b | ||
|
87e98e8848 | ||
|
3038e83be4 | ||
|
504d74b63e | ||
|
eb097d1535 | ||
|
b530470273 | ||
|
ba61d4c817 | ||
|
f4f050dadd | ||
|
a79970de29 | ||
|
b33b364f32 | ||
|
843bb1fb5b | ||
|
c1c655d84b | ||
|
537340d274 | ||
|
54c828c7ff | ||
|
219f23f227 | ||
|
cc1f7de75c | ||
|
1568c4ad72 | ||
|
21f4d8824c | ||
|
f5f3711cbf | ||
|
2966e158cd | ||
|
d2ff25fc12 | ||
|
f6e540eb64 | ||
|
626795a877 | ||
|
6bdf5bfa6e | ||
|
1e678a2311 | ||
|
f3805d0982 | ||
|
eb6586aaac | ||
|
a66664c166 | ||
|
9a97455d5b | ||
|
94503708a4 | ||
|
b28cf0c144 | ||
|
a7d3ac6158 | ||
|
c88eb0c2fb | ||
|
9a8d4b6967 | ||
|
8cb021d031 | ||
|
6e6d0e7eae | ||
|
d9bb3e8a74 | ||
|
d10344ae41 | ||
|
faf22f9755 | ||
|
5bcee45652 | ||
|
915d54a719 | ||
|
57c6565b86 | ||
|
2155ccfc3d | ||
|
bc1a47cc5c | ||
|
ef01f0d618 | ||
|
32d7023345 | ||
|
c81c3a6b29 | ||
|
8881b8f576 | ||
|
57c2bfa9a1 | ||
|
9fb82f87a1 | ||
|
9a70310c6a | ||
|
af568d45d2 | ||
|
38bb1176ee | ||
|
395f1ed792 | ||
|
e235c8545b | ||
|
fb2d7b2c4e | ||
|
c5cdaa3e8c | ||
|
52aecfd2e2 | ||
|
792c243f3a | ||
|
80e12eda14 | ||
|
fe2e2dfb74 | ||
|
71f591e16a | ||
|
2100693b79 | ||
|
a3fe0d3af0 | ||
|
abe6ad158e | ||
|
04c7bb6f02 | ||
|
3d54b21d08 | ||
|
a48e8eeaaf | ||
|
d2a574d49e | ||
|
63250c48f1 | ||
|
9312fee50b | ||
|
919b6b584d | ||
|
2bf6e1bb6d | ||
|
c49a520bf5 | ||
|
f600df4cd6 | ||
|
e3e2587a08 | ||
|
55845ab56e | ||
|
df51ce2355 | ||
|
25147d0665 | ||
|
fed721dff2 | ||
|
833dd45596 | ||
|
9592b189b5 | ||
|
cceb47deaf | ||
|
31667cac6c | ||
|
8677f04e5a | ||
|
8d7fb98111 | ||
|
6762b15a00 | ||
|
60b733b8b6 | ||
|
e12080b214 | ||
|
5fdd0a9e0a | ||
|
bed36082ae | ||
|
2677c972bf | ||
|
6baa4f4edd | ||
|
8f72a9e539 | ||
|
68126b1576 | ||
|
f7f2574321 | ||
|
6c3fa57080 | ||
|
3f7061b48d | ||
|
99ba700276 | ||
|
c106a20371 | ||
|
6adc157fc9 | ||
|
07dd375992 | ||
|
b906fc56ea | ||
|
e6f1065c19 | ||
|
8e6c107fe2 | ||
|
65cc5b272b | ||
|
dee2273c53 | ||
|
f7a0c0d33a | ||
|
7aa5734a70 | ||
|
b888f2b128 | ||
|
d521ca2f05 | ||
|
15cfb485eb | ||
|
eb1a313f70 | ||
|
920470b1c2 | ||
|
d0b4043cd0 | ||
|
d0cac19a26 | ||
|
3f4e689a90 | ||
|
9619043e94 | ||
|
cbbc35290c | ||
|
ccfc6ac497 | ||
|
f9175c5e8b | ||
|
a72755c3a1 |
50
README
Normal file
50
README
Normal file
@ -0,0 +1,50 @@
|
||||
Ajouter Format des fichier csv, xslx
|
||||
Profil =>
|
||||
fileformat->type csv | xslx
|
||||
fileformat->separator , | ; | tab
|
||||
fileformat->encoding utf-8 | iso-8859-15
|
||||
ALTER TABLE `customer_params` ADD `params` TEXT NOT NULL COMMENT 'Paramètres pour le fichier en sortie' AFTER `criteres`;
|
||||
ALTER TABLE `customer_params` CHANGE `params` `params` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'Paramètres pour le fichier en sortie';
|
||||
|
||||
Dans la table enrichissement_identifiants
|
||||
Nouvelle colonne params = text
|
||||
ALTER TABLE `enrichissement_identifiants` ADD `fichierParams` TEXT NOT NULL COMMENT 'Paramètres pour le fichier en sortie' AFTER `dateStart`;
|
||||
ALTER TABLE `enrichissement_identifiants` CHANGE `fichierParams` `fichierParams` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'Paramètres pour le fichier en sortie';
|
||||
|
||||
- Enregistrement dans tout les cas des paramètres du fichier
|
||||
- Possibilités de modification des paramètres du fichier lors de la commande
|
||||
|
||||
|
||||
Ajouter indicateur TEST pour les clients
|
||||
|
||||
|
||||
|
||||
Revoir l'ordre des champs pour l'export
|
||||
Revoir les catégories pour limiter l'affichage des critères
|
||||
Revoir la nomination des boutons, opérations
|
||||
|
||||
Dans le détail du ciblage
|
||||
Calcul avec uniquement ce critères de la liste (NAF, FJ, ... ) Tout ce qui est une liste
|
||||
|
||||
|
||||
|
||||
Pre-Calcul base de données total
|
||||
Pre-Calcul sur chaque indicateur
|
||||
|
||||
|
||||
Préfiltrer des critères suivant le profil
|
||||
Créer interface pour fixer les champs
|
||||
Intégrer cette caractéristique dans l'affichage + dans le moteur
|
||||
|
||||
Masquer des ciblages
|
||||
|
||||
Ajouter dans l'aide la définition du markétable.....
|
||||
|
||||
Ajouter export element financier + ratios + formule ratios
|
||||
|
||||
|
||||
Ciblage
|
||||
- Basic (uniquement les sociétés markétable)
|
||||
- Base france entière
|
||||
Ajouter toutes les entités (2 prestations Markétable + base france entière)
|
||||
|
@ -1,65 +1,99 @@
|
||||
<?php
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
//Initialisation global des paramètres de vue
|
||||
protected function _initViewSettings()
|
||||
protected function _initConfig()
|
||||
{
|
||||
$config = new Zend_Config($this->getOptions());
|
||||
Zend_Registry::set('config', $config);
|
||||
return $config;
|
||||
}
|
||||
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
|
||||
$view = $this->getResource('view');
|
||||
/*
|
||||
* Si on détecte un périphérique mobile alors on charge
|
||||
* les bons scripts
|
||||
$theme = 'mobile';
|
||||
$path = realpath(APPLICATION_PATH.'/views/'.$theme);
|
||||
$view = new Zend_View();
|
||||
$view->addBasePath($path);
|
||||
*/
|
||||
$theme = 'default';
|
||||
$pathStyle = '/themes/'.$theme.'/styles';
|
||||
$pathScript = '/themes/'.$theme.'/scripts';
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('XHTML1_STRICT');
|
||||
$view->doctype('HTML5');
|
||||
$pathStyle = '/themes/default/styles';
|
||||
$pathScript = '/themes/default/scripts';
|
||||
|
||||
$view->headMeta()
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
->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');
|
||||
|
||||
$view->headLink()
|
||||
->appendStylesheet($pathStyle.'/reset.css', 'all')
|
||||
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
|
||||
->appendStylesheet('/themes/jstree/default/style.css')
|
||||
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
|
||||
->appendStylesheet('/libs/bootstrap-3.3.4/css/bootstrap.min.css', 'all')
|
||||
->appendStylesheet('/libs/ui-1.11.3/themes/smoothness/jquery-ui.min.css', 'all')
|
||||
->appendStylesheet($pathStyle.'/main.css', 'all');
|
||||
|
||||
|
||||
$view->headScript()
|
||||
->appendFile($pathScript.'/jquery.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.bgiframe.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.cookie.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/scripts.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Odea');
|
||||
->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-2.1.3.min.js', 'text/javascript')
|
||||
->appendFile('/libs/bootstrap-3.3.4/js/bootstrap.min.js', 'text/javascript')
|
||||
->appendFile('/libs/ui-1.11.3/jquery-ui.min.js', 'text/javascript');
|
||||
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('Odea');
|
||||
}
|
||||
|
||||
protected function _initLogging()
|
||||
{
|
||||
//Logger de développement
|
||||
//Firebug
|
||||
$writer = new Zend_Log_Writer_Firebug();
|
||||
if(APPLICATION_ENV=='production') $writer->setEnabled(false);
|
||||
if(APPLICATION_ENV=='production') {
|
||||
$writer->setEnabled(false);
|
||||
}
|
||||
$logger = new Zend_Log($writer);
|
||||
Zend_Registry::set('firebug', $logger);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected function _initDb()
|
||||
{
|
||||
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
|
||||
try {
|
||||
$db = Zend_Db::factory($dbConfig->db);
|
||||
$c = new Zend_Config($this->getOptions());
|
||||
try {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
Zend_Db_Table::setDefaultAdapter ($db);
|
||||
} catch ( Exception $e ) {
|
||||
exit ( $e->getMessage() );
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
print_r($e);
|
||||
} else {
|
||||
echo "Le service est actuellement indisponible.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default adapter to use with all model
|
||||
*/
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
|
||||
/**
|
||||
* Set Firebug Database profiler
|
||||
*/
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
$profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
|
||||
$profiler->setEnabled(true);
|
||||
$db->setProfiler($profiler);
|
||||
}
|
||||
Zend_Registry::set('db', $db);
|
||||
}
|
||||
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
//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);
|
||||
|
||||
//Cache pour les données de la base à stocker
|
||||
}
|
||||
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
- Critères
|
||||
Etablissements : Tous / Seulement les actifs / Seulement les inactifs
|
||||
Type Etablissements : Tous / Uniquement les sièges / Uniquement les secondaires
|
||||
Entreprises appartenant à un groupe français
|
||||
Entreprise appartenant à un groupe étranger
|
||||
Téléphone renseigné / non renseigné
|
||||
|
||||
- Secteur Géographique
|
||||
Régions (insee.regions)
|
||||
Départements (insee.departements)
|
||||
Code Postal - Communes (insee.codepostaux)
|
||||
+ Recherche textuel sur ville (code postal, commune) pour affichage liste code postal
|
||||
Codes Communes Insee (insee.codepostaux)
|
||||
|
||||
- Forme juridique (insee.tabFJ)
|
||||
Arbre de selection avec déploiement des groupes
|
||||
|
||||
- Activité (naf) - Entreprise, Etablissements (insee.tabNAF)
|
||||
Arbre de sélection avec déploiement des groupes
|
||||
|
||||
- Chiffre clés
|
||||
Date de création - Ancienneté (Moins d'un an, de 1 à 2, 3 à 5, 6 à 9, 10 et plus )
|
||||
Nombre d'établissements (inférieur, égal, supérieur, intervalle)
|
||||
Intervalle Effectif (Tranches ou Réel) - Entreprise, Etablissement
|
||||
|
||||
- Critères bilantiel
|
||||
Date de clôture de l'exercice
|
||||
Intervalle CA - Selection (Moins de 15000 euros, de 15000 à 30000, de 30000 à 75000, de 75000 à 150000, de 150000 à 750000, Plus de 750000)
|
||||
Intervalle Résultat net
|
||||
Intervalle CA à l'export
|
||||
ACTIF - PASSIF - COMPTE DE RESULTAT - ANNEXES
|
||||
Ratios
|
||||
Scores (Risques de défaillance)
|
||||
|
@ -1,84 +0,0 @@
|
||||
Placer les critères en session
|
||||
Enregistrer régulièrement en session (SessionCriteres)
|
||||
On sauvegarde, seulement si le client à mis une référence, et cliquer sur le bouton sauvegarder
|
||||
Exploser les critères pour des sous comptage
|
||||
Enregistrement d'un fichier login-idDefinition-timestamp
|
||||
|
||||
Définir la structure d'envoi des critères
|
||||
Formulaire
|
||||
Voir avec API Ciblage Sphinx
|
||||
|
||||
Voir pour l'enrichissement
|
||||
Pour simplifer, l'enrichissement devra se faire à partir de la table etablissements_act
|
||||
+ quelques autres tables pour des données supplémentaires
|
||||
|
||||
Générer un fichier avec la liste des SIREN+NIC ou SIRET + les entêtes nécessaires à l'enrichissement
|
||||
Voir si le fichier doit être généré sur la plateforme de ciblage, ou par le webservice
|
||||
|
||||
Réplication des tables sur la plateforme ciblage
|
||||
|
||||
Gestion d'une queue, voir todo dans webservice
|
||||
|
||||
Table naf
|
||||
Table régions
|
||||
Table departements
|
||||
Table codepostaux
|
||||
Table formejuridique (tabFJ)
|
||||
|
||||
|
||||
- Table pour la sauvegarde des critères (criteres)
|
||||
id int primary key autoincrement
|
||||
idClient int
|
||||
login varchar
|
||||
reference varchar obligatoire ?
|
||||
criteres text
|
||||
parent int identifiant comptage parent pour les explode default 0
|
||||
dateAjout
|
||||
|
||||
- Table pour la sauvegarde des comptages (comptages)
|
||||
id
|
||||
idDefinition
|
||||
resultat
|
||||
uniteInsee
|
||||
tarif
|
||||
dateComptage
|
||||
|
||||
- Tables pour la sauvegarde des exports de siren (refexport)
|
||||
id
|
||||
idDefinition
|
||||
fichier
|
||||
dateExport
|
||||
|
||||
- profilExtraction
|
||||
id
|
||||
idClient
|
||||
reference
|
||||
criteres
|
||||
tarifLigne
|
||||
dateAjout
|
||||
dateModif
|
||||
dateSuppr
|
||||
actif
|
||||
|
||||
|
||||
- tarifsInsee
|
||||
id
|
||||
tarifLigne
|
||||
montantMax
|
||||
dateEffet
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
[production]
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
includePaths.library = APPLICATION_PATH "/../library"
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
autoloaderNamespaces[] = "Application_"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
|
||||
resources.layout.layout = "main"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views/default"
|
||||
resources.view.basePath = APPLICATION_PATH "/views/default"
|
||||
|
||||
[staging : production]
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
|
||||
[development : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
107
application/configs/menu.config.php
Normal file
107
application/configs/menu.config.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
return array(
|
||||
array(
|
||||
'label'=> "Ciblage",
|
||||
'title' => "Ciblage",
|
||||
'controller' => 'index',
|
||||
'action' => 'index',
|
||||
),
|
||||
array(
|
||||
'label' => "Tableau de bord",
|
||||
'title' => "Tableau de bord",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'index',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label'=> "Résumé",
|
||||
'title' => "Résumé",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'index',
|
||||
),
|
||||
array(
|
||||
'label'=> "Ciblages",
|
||||
'title' => "Liste des vos ciblages",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'ciblages',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label'=> "Détails",
|
||||
'title' => "Détails",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'ciblage',
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'label'=> "Enrichissements",
|
||||
'title' => "Liste de vos enrichissements",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'enrichissements',
|
||||
),
|
||||
array(
|
||||
'label'=> "Préférences",
|
||||
'title' => "Préférences de l'application",
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'configuration',
|
||||
),
|
||||
)
|
||||
),
|
||||
/*array(
|
||||
'label'=> "Aide",
|
||||
'title' => "Aide",
|
||||
'controller' => 'aide',
|
||||
'action' => 'index',
|
||||
'pages' => array()
|
||||
),*/
|
||||
array(
|
||||
'label'=> "A propos",
|
||||
'title' => "A propos",
|
||||
'controller' => 'aide',
|
||||
'action' => 'apropos',
|
||||
'pages' => array()
|
||||
),
|
||||
array(
|
||||
'label'=> "Gestion",
|
||||
'title' => "Gestion",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'index',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label'=> "Menu",
|
||||
'title' => "Menu",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'index',
|
||||
),
|
||||
array(
|
||||
'label'=> "Liste des commandes",
|
||||
'title' => "Liste des commandes",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'commandes',
|
||||
),
|
||||
array(
|
||||
'label'=> "Liste des enrichissements",
|
||||
'title' => "Liste des enrichissements",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'enrichissements',
|
||||
),
|
||||
array(
|
||||
'label'=> "Liste des ciblages",
|
||||
'title' => "Liste des ciblages",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'ciblages',
|
||||
),
|
||||
array(
|
||||
'label'=> "Gestion des paramètres clients",
|
||||
'title' => "Gestion des paramètres clients",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'customerparams',
|
||||
),
|
||||
array(
|
||||
'label'=> "Extraction des logs",
|
||||
'title' => "Extraction des logs",
|
||||
'controller' => 'gestion',
|
||||
'action' => 'index',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@ -1,9 +1,20 @@
|
||||
<?php
|
||||
class AideController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/aide.css');
|
||||
}
|
||||
|
||||
|
||||
public function indexAction(){}
|
||||
|
||||
public function aproposdeAction(){}
|
||||
|
||||
|
||||
public function aproposAction(){}
|
||||
|
||||
public function messageAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$this->view->assign('typeMsg', $request->getParam('typeMsg'));
|
||||
}
|
||||
|
||||
}
|
@ -1,331 +1,424 @@
|
||||
<?php
|
||||
class ArborescenceController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Affiche l'arborescence des NAFs de premier niveau
|
||||
*/
|
||||
public function nafAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$this->view->assign('key', $key);
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
|
||||
}
|
||||
}
|
||||
|
||||
/* Nafs */
|
||||
public function nafAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$niveau = $request->getParam('niveau', 1);
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()->where('niveau = ?', $niveau)->order('code ASC');
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item)
|
||||
{
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
'state' => 'closed',
|
||||
'children' => array(),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
$this->view->assign('naf', json_encode($tabNaf));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne l'arborecence des NAFs de niveau supérieur à 1
|
||||
*/
|
||||
public function nafajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$sessionCiblage = new SessionCiblage();
|
||||
$val = $sessionCiblage->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
|
||||
$valuesUndetermined = array();
|
||||
if ($val != null){
|
||||
$valuesChecked = explode(',',$val);
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value));
|
||||
}
|
||||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
$niveau = $request->getParam('niveau', 1);
|
||||
$niveau++;
|
||||
$parent = $request->getParam('parent', '');
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select();
|
||||
if (!empty($parent) && $niveau==2) {
|
||||
$sql->where('parent = ?', $parent);
|
||||
} elseif (!empty($parent) && $niveau>2) {
|
||||
$sql->where("code LIKE '".$parent."%'");
|
||||
}
|
||||
$sql->where('niveau = ?', $niveau)->order('code ASC');
|
||||
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item){
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
if ($niveau<5){
|
||||
$structure['state'] = 'closed';
|
||||
$structure['children'] = array();
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
echo json_encode($tabNaf);
|
||||
}
|
||||
|
||||
protected function getNafParent($value, $niveau1 = false)
|
||||
{
|
||||
$out = array();
|
||||
if (strlen($value)>2) {
|
||||
$niveau = strlen($value)-1;
|
||||
$new = substr($value,0,$niveau);
|
||||
$out = array_merge($out, array($new), $this->getNafParent($new, $niveau1));
|
||||
} elseif (strlen($value)==2 && $niveau1 === true) {
|
||||
$nafM = new Application_Model_Naf();
|
||||
$sql = $nafM->select()
|
||||
->from($nafM, array('parent'))
|
||||
->where('code = ?', $value);
|
||||
$result = $nafM->fetchRow($sql);
|
||||
$out[] = $result->parent;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function geographiqueAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->view->inlineScript()->appendFile('/themes/default/scripts/jquery.jstree.js');
|
||||
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$val = $session->getCritere('adr_cp');
|
||||
|
||||
$valuesCheckeds = explode(',', $val);
|
||||
if(count($valuesCheckeds) > 0) {
|
||||
for($i=0;count($valuesCheckeds) > $i;$i++) {
|
||||
$valuesCheckeds[$i] = substr($valuesCheckeds[$i], 1);
|
||||
}
|
||||
}
|
||||
$valuesUndetermined = array();
|
||||
if($val != null)
|
||||
{
|
||||
$values = explode(',', $val);
|
||||
foreach($values as $valuesChecked) {
|
||||
if(strlen($valuesChecked) == 5) {
|
||||
$dept = substr($valuesChecked, 0, 2);
|
||||
$table = new Application_Model_Departements();
|
||||
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?',$dept);
|
||||
$results = $table->fetchAll($sql)->toArray();
|
||||
foreach($results as $result) {
|
||||
$valuesUndetermined[] = $result['codeRegionInsee'];
|
||||
}
|
||||
}
|
||||
if(substr($valuesChecked, 0, 1) == 'R') {
|
||||
$valuesCheckeds[] = substr($valuesChecked, 1);
|
||||
} else if (substr($valuesChecked, 0, 1) == 'D') {
|
||||
$table = new Application_Model_Departements();
|
||||
$sql = $table->select()->from('departements', array('codeRegionInsee'))->where('numdep = ?', substr($valuesChecked, 1));
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
foreach($result as $item) {
|
||||
$valuesUndetermined[] = $item['codeRegionInsee'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$key = $this->getRequest()->getParam('key');
|
||||
$this->view->assign('key', $key);
|
||||
|
||||
$regionsM = new Application_Model_Regions();
|
||||
$sql = $regionsM->select()->from('regions');
|
||||
$regions = $regionsM->fetchAll()->toArray();
|
||||
|
||||
$structure = array();
|
||||
foreach($regions as $region) {
|
||||
$structure = array(
|
||||
'data' => $region['NCCENR'],
|
||||
'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 0),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
if(in_array($region['REGION'], $valuesCheckeds)) {
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if(in_array($region['REGION'], $valuesUndetermined)) {
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabAdrDep[] = $structure;
|
||||
}
|
||||
$this->view->regions = json_encode($tabAdrDep);
|
||||
}
|
||||
|
||||
public function geographiqueajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$nafM = new Application_Model_CiblageNaf();
|
||||
$sql = $nafM->select()->where('niveau = ?', $niveau)->order('code ASC');
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabNaf = array();
|
||||
foreach($result as $item)
|
||||
{
|
||||
if ( $item['niveau']==1 ) {
|
||||
$data = $item['lib'];
|
||||
} else {
|
||||
$data = $item['lib'].' ('.$item['code'].')';
|
||||
}
|
||||
|
||||
$structure = array(
|
||||
'data' => $data,
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
'state' => 'closed',
|
||||
'children' => array(),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
$this->view->key = $key;
|
||||
$this->view->naf = json_encode($tabNaf);
|
||||
}
|
||||
|
||||
public function nafajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$id = $request->getParam('id');
|
||||
|
||||
if($id[0] == 'R') {
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$val = $session->getCritere('adr_cp');
|
||||
$valuesCheckeds = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if($val != null)
|
||||
{
|
||||
$values = explode(',', $val);
|
||||
foreach($values as $valuesChecked) {
|
||||
if(strlen($valuesChecked) == 5) {
|
||||
$valuesUndetermined[] = substr($valuesChecked, 0, 2);
|
||||
}
|
||||
if(substr($valuesChecked, 0, 1) == 'D') {
|
||||
$valuesCheckeds[] = substr($valuesChecked, 1);
|
||||
} else if (substr($valuesChecked, 0, 1) == 'R') {
|
||||
$table = new Application_Model_Departements();
|
||||
$sql = $table->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
|
||||
$result = $table->fetchAll($sql)->toArray();
|
||||
foreach($result as $item) {
|
||||
$valuesCheckeds[] = $item['numdep'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$region = substr($request->getParam('id'), 1);
|
||||
$deps = new Application_Model_Departements();
|
||||
$sql = $deps->select()
|
||||
->from('departements')
|
||||
->where('codeRegionInsee = ?', $region);
|
||||
$departements = $deps->fetchAll($sql)->toArray();
|
||||
foreach($departements as $departement) {
|
||||
$structure = array(
|
||||
'data' => $departement['libdep'],
|
||||
'attr' => array('id' => 'D'.$departement['numdep'], 'niveau' => 1),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
if(in_array($departement['numdep'], $valuesCheckeds)) {
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if(in_array($departement['numdep'], $valuesUndetermined)) {
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$departementTab[] = $structure;
|
||||
}
|
||||
echo json_encode($departementTab);
|
||||
} else if ($id[0] == 'D')
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$val = $session->getCritere('adr_cp');
|
||||
$valuesCheckeds = array();
|
||||
if($val != null)
|
||||
{
|
||||
$values = explode(',', $val);
|
||||
foreach($values as $valuesChecked) {
|
||||
if(strlen($valuesChecked) == 5) {
|
||||
$valuesCheckeds[] = $valuesChecked;
|
||||
}
|
||||
else if(substr($valuesChecked, 0, 1) == 'D') {
|
||||
$table = new Application_Model_Codepostaux();
|
||||
$sql = $table->select()->from('codepostaux', array('Codepos'))->where('Codepos LIKE "'.substr($valuesChecked, 1).'%"');
|
||||
$results = $table->fetchAll($sql)->toArray();
|
||||
foreach($results as $result) {
|
||||
if(!in_array($result['Codepos'], $values))
|
||||
$valuesCheckeds[] = $result['Codepos'];
|
||||
}
|
||||
} else if (substr($valuesChecked, 0, 1) == 'R') {
|
||||
$Departements = new Application_Model_Departements();
|
||||
$sql = $Departements->select()->from('departements', array('numdep'))->where('codeRegionInsee = ?', substr($valuesChecked, 1));
|
||||
$results = $Departements->fetchAll($sql)->toArray();
|
||||
foreach($results as $result) {
|
||||
$table = new Application_Model_Codepostaux();
|
||||
$sql = $table->select()->from('codepostaux', array('Codepos'))->where('Codepos LIKE "'.$result['numdep'].'%"');
|
||||
$codes = $table->fetchAll($sql)->toArray();
|
||||
foreach($codes as $code) {
|
||||
if(!in_array($result['Codepos'], $values))
|
||||
$valuesCheckeds[] = $code['Codepos'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$numdep = substr($request->getParam('id'), 1);
|
||||
$code = new Application_Model_Codepostaux();
|
||||
$sql = $code->select()
|
||||
->from('codepostaux')
|
||||
->where('Codepos LIKE "'.$numdep.'%"');
|
||||
$codePostaux = $code->fetchAll($sql)->toArray();
|
||||
|
||||
foreach($codePostaux as $codePostau) {
|
||||
$structure = array(
|
||||
'data' => '[ '.$codePostau['Codepos'].' ]'.ucfirst(strtolower($codePostau['Commune'])),
|
||||
'attr' => array('id' => $codePostau['Codepos'], 'niveau' => 2)
|
||||
);
|
||||
if(in_array($codePostau['Codepos'], $valuesCheckeds)) {
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
$CodePostauxTab[] = $structure;
|
||||
}
|
||||
echo json_encode($CodePostauxTab);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function juridqueAction()
|
||||
{
|
||||
$valeurs = $this>getRequest()->getParam('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$parent = $request->getParam('parent');
|
||||
$niveau = $request->getParam('niveau', 1);
|
||||
$niveau = $niveau + 1;
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getNafParent($value, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$nafM = new Application_Model_CiblageNaf();
|
||||
$sql = $nafM->select();
|
||||
|
||||
if (!empty($parent) && $niveau==2) {
|
||||
$sql->where('parent = ?', $parent);
|
||||
} elseif (!empty($parent) && $niveau>2) {
|
||||
$sql->where("code LIKE '".$parent."%'");
|
||||
}
|
||||
$sql->where('niveau = ?', $niveau)->order('code ASC');
|
||||
|
||||
$result = $nafM->fetchAll($sql)->toArray();
|
||||
$tabNaf = array();
|
||||
foreach($result as $item){
|
||||
$structure = array(
|
||||
'data' => $item['code'].' - '.$item['lib'],
|
||||
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
||||
);
|
||||
if (in_array($item['code'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($item['code'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
if ($niveau<5){
|
||||
$structure['state'] = 'closed';
|
||||
$structure['children'] = array();
|
||||
}
|
||||
$tabNaf[] = $structure;
|
||||
}
|
||||
echo json_encode($tabNaf);
|
||||
}
|
||||
|
||||
protected function getNafParent($value, $niveau1 = false)
|
||||
{
|
||||
$out = array();
|
||||
if (strlen($value)>2) {
|
||||
$niveau = strlen($value)-1;
|
||||
$new = substr($value,0,$niveau);
|
||||
$out = array_merge($out, array($new), $this->getNafParent($new, $niveau1));
|
||||
} elseif (strlen($value)==2 && $niveau1 === true) {
|
||||
$nafM = new Application_Model_CiblageNaf();
|
||||
$sql = $nafM->select()
|
||||
->from($nafM, array('parent'))
|
||||
->where('code = ?', $value);
|
||||
$result = $nafM->fetchRow($sql);
|
||||
$out[] = $result->parent;
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/* Geographiques */
|
||||
public function geographiqueAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$key = $this->getRequest()->getParam('key');
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere($key);
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value) {
|
||||
if ( substr($value,0,1)!='R' ) {
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getGeoParent($value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$regionsM = new Application_Model_CiblageRegions();
|
||||
$sql = $regionsM->select()->order('NCCENR ASC');
|
||||
$regions = $regionsM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabRegions = array();
|
||||
foreach($regions as $item) {
|
||||
$structure = array(
|
||||
'data' => $item['NCCENR'],
|
||||
'attr' => array(
|
||||
'id' => 'R'.$item['REGION'],
|
||||
'niveau' => 0,
|
||||
),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
if (in_array('R'.$item['REGION'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array('R'.$item['REGION'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabRegions[] = $structure;
|
||||
}
|
||||
|
||||
$this->view->key = $key;
|
||||
$this->view->regions = json_encode($tabRegions);
|
||||
}
|
||||
|
||||
public function geographiqueajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
$niveau = $request->getParam('niveau');
|
||||
|
||||
//Récupération des valeurs enregistrées en session
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere('geo');
|
||||
$valuesChecked = array();
|
||||
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value){
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, $this->getGeoParent($value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// R[code] => Régions => recherche département
|
||||
if ( substr($id,0,1)=='R' ) {
|
||||
|
||||
$region = substr($id,1);
|
||||
|
||||
$departementsM = new Application_Model_CiblageDepartements();
|
||||
$sql = $departementsM->select()->where('codeRegionInsee = ?', $region);
|
||||
$departements = $departementsM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabDepartements = array();
|
||||
foreach($departements as $item) {
|
||||
$structure = array(
|
||||
'data' => $item['libdep'].' ('.$item['numdep'].')',
|
||||
'attr' => array(
|
||||
'id' => 'D'.$item['numdep'],
|
||||
'niveau' => 1,
|
||||
),
|
||||
'state' => 'closed',
|
||||
'children' => array()
|
||||
);
|
||||
if (in_array('D'.$item['numdep'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array('D'.$item['numdep'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabDepartements[] = $structure;
|
||||
}
|
||||
echo json_encode($tabDepartements);
|
||||
}
|
||||
// D[code] => Départements => recherche commune
|
||||
else if ( substr($id,0,1)=='D' ) {
|
||||
|
||||
$departement = substr($id,1);
|
||||
|
||||
$codePostauxM = new Application_Model_CiblageCodePostaux();
|
||||
$sql = $codePostauxM->select()
|
||||
->where('Codepos LIKE ?', $departement.'%')
|
||||
->order('Commune ASC');
|
||||
Zend_Registry::get('firebug')->info($sql->__toString());
|
||||
$communes = $codePostauxM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabCommunes = array();
|
||||
foreach($communes as $item) {
|
||||
$structure = array(
|
||||
'data' => $item['Commune'],
|
||||
'attr' => array(
|
||||
'id' => 'C'.$item['INSEE'],
|
||||
'niveau' => 1,
|
||||
)
|
||||
);
|
||||
if (in_array('C'.$item['INSEE'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
$tabCommunes[] = $structure;
|
||||
}
|
||||
echo json_encode($tabCommunes);
|
||||
}
|
||||
}
|
||||
|
||||
protected function getGeoParent($code)
|
||||
{
|
||||
if (substr($code,0,1)=='D') {
|
||||
|
||||
$departementsM = new Application_Model_CiblageDepartements();
|
||||
$sql = $departementsM->select()
|
||||
->from($departementsM, array('codeRegionInsee'))
|
||||
->where('numdep = ?', substr($code,1));
|
||||
$departement = $departementsM->fetchRow($sql);
|
||||
|
||||
return array('R'.$departement->codeRegionInsee);
|
||||
|
||||
} elseif ( substr($code,0,1)=='C' ) {
|
||||
|
||||
$codePostauxM = new Application_Model_CiblageCodePostaux();
|
||||
$sql = $codePostauxM->select()
|
||||
->from($codePostauxM, array('Codepos'))
|
||||
->where('INSEE = ?', substr($code,1));
|
||||
$commune = $codePostauxM->fetchRow($sql);
|
||||
|
||||
$departement = 'D'.substr($commune->Codepos,0,2);
|
||||
$region = $this->getGeoParent($departement);
|
||||
|
||||
return array_merge(array($departement), $region);
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
/* Forme Juridique */
|
||||
public function juridiqueAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere('cj');
|
||||
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value){
|
||||
if (strlen($value)>1) {
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, array(substr($value,0,1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$FormeJuridiqueM = new Application_Model_CiblageFormeJuridique();
|
||||
$sql = $FormeJuridiqueM->select()
|
||||
->where('LENGTH(fjCode) = 1')
|
||||
->order('fjLibelle ASC');
|
||||
$formes = $FormeJuridiqueM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabFJ = array();
|
||||
foreach($formes as $forme) {
|
||||
$structure = array(
|
||||
'data' => $forme['fjLibelle'],
|
||||
'attr' => array( 'id' => $forme['fjCode'] ),
|
||||
'state' => 'closed',
|
||||
'children' => array(),
|
||||
);
|
||||
if (in_array($forme['fjCode'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($forme['fjCode'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
$tabFJ[] = $structure;
|
||||
}
|
||||
|
||||
$key = $this->getRequest()->getParam('key');
|
||||
|
||||
$this->view->key = $key;
|
||||
$this->view->formejuridiques = json_encode($tabFJ);
|
||||
}
|
||||
|
||||
public function juridiqueajaxAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
|
||||
$length = strlen($id);
|
||||
|
||||
$followingLevel = 5;
|
||||
if ( $length==1 ) {
|
||||
$followingLevel = 2;
|
||||
} elseif ( $length==2 ) {
|
||||
$followingLevel = 4;
|
||||
}
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$val = $fields->getCritere('cj');
|
||||
|
||||
$valuesChecked = array();
|
||||
$valuesUndetermined = array();
|
||||
|
||||
if ($val != null){
|
||||
$valuesChecked = $val['in'];
|
||||
if (count($valuesChecked)>0) {
|
||||
foreach($valuesChecked as $value){
|
||||
if (strlen($value)>$followingLevel) {
|
||||
$valuesUndetermined = array_merge($valuesUndetermined, substr($value,0,$followingLevel));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($valuesChecked);
|
||||
|
||||
|
||||
if ($length<4) {
|
||||
$FormeJuridiqueM = new Application_Model_CiblageFormeJuridique();
|
||||
$sql = $FormeJuridiqueM->select()
|
||||
->where('fjCode LIKE "'.$id.'%"')
|
||||
->where('LENGTH(fjCode)=?', $followingLevel);
|
||||
$formes = $FormeJuridiqueM->fetchAll($sql)->toArray();
|
||||
|
||||
$tabFJ = array();
|
||||
foreach($formes as $forme) {
|
||||
|
||||
$data = $forme['fjLibelle'];
|
||||
if ( $followingLevel==4 ) {
|
||||
$data = $forme['fjLibelle'].' ('.$forme['fjCode'].')';
|
||||
}
|
||||
|
||||
$structure = array(
|
||||
'data' => $data,
|
||||
'attr' => array( 'id' => $forme['fjCode'] ),
|
||||
);
|
||||
|
||||
if ( $length<2 ) {
|
||||
$structure['state'] = 'closed';
|
||||
$structure['children'] = array();
|
||||
}
|
||||
|
||||
if (in_array($forme['fjCode'], $valuesChecked)){
|
||||
$structure['attr']['class'] = 'jstree-checked';
|
||||
}
|
||||
if (in_array($forme['fjCode'], $valuesUndetermined)){
|
||||
$structure['attr']['class'] = 'jstree-undetermined';
|
||||
}
|
||||
|
||||
$tabFJ[] = $structure;
|
||||
}
|
||||
echo json_encode($tabFJ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,132 +1,384 @@
|
||||
<?php
|
||||
class ComptageController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('cle');
|
||||
$valeur = $request->getParam('valeur');
|
||||
|
||||
$sessionValeur = $session->getCritere($key);
|
||||
if($sessionValeur == "" && empty($valeur)) {
|
||||
$session->unsetCritere($key);
|
||||
} else {
|
||||
$session->setCritere($key, $valeur);
|
||||
$request = $this->getRequest();
|
||||
|
||||
$cle = $request->getParam('cle');
|
||||
$valeur = $request->getParam('valeur');
|
||||
|
||||
// --- Values sent, must always be an array
|
||||
if ( is_array($valeur) ) {
|
||||
$values = $valeur;
|
||||
} elseif ( $valeur === '' ) {
|
||||
$values = array();
|
||||
} elseif ( is_string($valeur) ) {
|
||||
// --- Remove all spaces
|
||||
$valeur = preg_replace('/\s+/', '', $valeur);
|
||||
$valeur = str_replace(';', ',', $valeur);
|
||||
// --- Split valeur
|
||||
$values = explode(',', $valeur);
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('COMPTAGE');
|
||||
Zend_Registry::get('firebug')->info($values);
|
||||
|
||||
/**
|
||||
* Error code
|
||||
* 0 : OK
|
||||
* 1 : Error from sphinx
|
||||
* 2 : Error when insert critere
|
||||
* @var int
|
||||
*/
|
||||
$error = 0;
|
||||
|
||||
//Set the flag for exclusion
|
||||
$exclude = $request->getParam('exclude');
|
||||
$ex = false;
|
||||
if ( intval($exclude) == 1 ) {
|
||||
$ex = true;
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
require_once 'Scores/Field.php';
|
||||
$field = new Fields($user->username);
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
$total = $ciblage->execute();
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
|
||||
$session->setNb('total', $total);
|
||||
$session->setNb('insee', $insee);
|
||||
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => number_format($total, 0, '', ' '),
|
||||
'insee' => number_format($insee, 0, '', ' ')
|
||||
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
|
||||
if (count($values) == 0) {
|
||||
$insert = $sessionValue->unsetSelected($cle);
|
||||
} else {
|
||||
$insert = $sessionValue->setSelected($cle, $values, $ex);
|
||||
}
|
||||
|
||||
if ($insert) {
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
$ciblage = new Scores_Ciblage_Engine($sessionValue->getSelectedValues(), $user->globalRNCS);
|
||||
$total = $ciblage->execute();
|
||||
|
||||
//Define value return after counting
|
||||
$sessionValue->setCountTotal($total);
|
||||
if ( $user->preferences['interface']['insee'] == 1 ) {
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
} else {
|
||||
$insee = null;
|
||||
}
|
||||
$sessionValue->setCountInsee($insee);
|
||||
|
||||
if ( $total !== false ) {
|
||||
//All is ok, save criteres and result to session
|
||||
$sessionValue->setCritereSession();
|
||||
} else {
|
||||
$error = 1;
|
||||
}
|
||||
} else {
|
||||
$error = 2;
|
||||
}
|
||||
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => $total,
|
||||
'insee' => $insee,
|
||||
'error' => $error,
|
||||
);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage formulaire de sauvegarde
|
||||
*/
|
||||
|
||||
$this->view->assign('result', $result);
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
$erreurs = new Zend_Session_Namespace('erreurs');
|
||||
|
||||
$sessionValue = new Scores_Ciblage_Session();
|
||||
$sessionValue->clearCiblage();
|
||||
|
||||
unset($erreurs->erreurs);
|
||||
$this->_redirect('/');
|
||||
}
|
||||
|
||||
public function savedialogAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
//Récupération de la session pour le profil et les valeurs du comptage
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$this->view->assign('criteres', $criteres);
|
||||
if (count($criteres)==0) {
|
||||
$this->view->assign('noSelection', true);
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//No contrat define
|
||||
if ( empty($user->dateContrat) || $user->dateContrat=='0000-00-00 00:00:00' ) {
|
||||
//If no params are detected, display a message to contact support
|
||||
$this->view->typeMsg = 'support';
|
||||
}
|
||||
//Check dateContrat and calculate end of contrat
|
||||
else {
|
||||
$hour = intval(substr($user->dateContrat,11,2));
|
||||
$min = intval(substr($user->dateContrat,14,2));
|
||||
$sec = intval(substr($user->dateContrat,17,2));
|
||||
$month = intval(substr($user->dateContrat,5,2)) + $user->periodContrat;
|
||||
$day = intval(substr($user->dateContrat,8,2));
|
||||
$year = intval(substr($user->dateContrat,0,4));
|
||||
$dateFinContrat = mktime($hour,$min,$sec,$month,$day,$year);
|
||||
|
||||
if ( time() > $dateFinContrat ) {
|
||||
$this->view->typeMsg = 'contrat';
|
||||
}
|
||||
}
|
||||
|
||||
//Récupération de la session pour le profil et les valeurs du comptage
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$criteres = $sessionValue->getSelectedValues();
|
||||
|
||||
if (count($criteres) == 0) {
|
||||
$this->view->noSelection = true;
|
||||
}
|
||||
$this->view->reference = $user->username.'-'.date('YmdHis');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde du profil de ciblage et de son comptage
|
||||
*/
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
|
||||
$request = $this->getRequest();
|
||||
$ref = $request->getParam('ref', '');
|
||||
|
||||
if (empty($ref)) {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Référence non définie !"));
|
||||
} else {
|
||||
|
||||
/**
|
||||
* Take care of "ref", remove all special char, accent and replace space by _
|
||||
*/
|
||||
require_once 'i18n/cleanchar.php';
|
||||
$ref = str_replace(' ', '_', $ref);
|
||||
$ref = cleanutf8($ref);
|
||||
$pattern = '/[^a-zA-Z0-9_-]+/';
|
||||
$ref = preg_replace($pattern, '', $ref);
|
||||
|
||||
if (empty($ref)) {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Référence non définie !"));
|
||||
} else {
|
||||
//Session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$criteres = $session->getCriteres();
|
||||
$resultat = $session->getNb('total');
|
||||
$nbInsee = $session->getNb('insee');
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
//Enregistrement des critères
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$data = array(
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$id = $criteresM->insert($data);
|
||||
|
||||
if ($id){
|
||||
//Enregistrement des valeurs du comptage
|
||||
$comptageM = new Application_Model_Comptages($db);
|
||||
$data = array(
|
||||
'idDefinition' => $id,
|
||||
'resultat' => $resultat,
|
||||
'uniteInsee' => $nbInsee,
|
||||
'tarif' => '',
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
if ($comptageM->insert($data)) {
|
||||
echo json_encode(array(
|
||||
'error'=>0,
|
||||
'msg'=> "Vos critères ont été sauvegardés sous la référence $ref"));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$criteres = $sessionValue->getSelectedValues();
|
||||
$resultat = $sessionValue->getCountTotal();
|
||||
$nbInsee = $sessionValue->getCountInsee();
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Enregistrement des critères
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$data = array(
|
||||
'idClient' => $user->idClient,
|
||||
'login' => $user->username,
|
||||
'reference' => $ref,
|
||||
'criteres' => json_encode($criteres),
|
||||
'parent' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
$id = $criteresM->insert($data);
|
||||
|
||||
if ($id) {
|
||||
//If nbInsee == null, need to count again
|
||||
if ($nbInsee===null) {
|
||||
$ciblage = new Scores_Ciblage_Engine($criteres, $user->globalRNCS);
|
||||
$nbInsee = $ciblage->calculRedevanceInsee();
|
||||
}
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
|
||||
//Enregistrement des valeurs du comptage
|
||||
$comptageM = new Application_Model_CiblageComptages();
|
||||
$data = array(
|
||||
'idDefinition' => $id,
|
||||
'resultat' => $resultat,
|
||||
'uniteInsee' => $nbInsee,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
if ($comptageM->insert($data)) {
|
||||
echo json_encode(array(
|
||||
'error'=>0,
|
||||
'msg'=> "Vos critères ont été sauvegardés sous la référence $ref",
|
||||
'href' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblage', 'id'=>$id))
|
||||
));
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(array(
|
||||
'error'=>1,
|
||||
'msg'=> "Erreur lors de l'enregistrement"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function updateAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$idCriteres = $request->getParam('id');
|
||||
|
||||
//Récupération des critères du ciblage
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$criteresRow = $criteresM->find($idCriteres);
|
||||
$criteres = $criteresRow->current();
|
||||
$structure = json_decode($criteres->criteres, true);
|
||||
|
||||
//Utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
$ciblage = new Scores_Ciblage_Engine($structure, $user->globalRNCS);
|
||||
|
||||
$data = array(
|
||||
'idDefinition' => $idCriteres,
|
||||
'resultat' => $ciblage->execute(),
|
||||
'uniteInsee' => $ciblage->calculRedevanceInsee(),
|
||||
'dateAjout' => date('YmdHis'),
|
||||
);
|
||||
//Enregistrement
|
||||
$comptageM = new Application_Model_CiblageComptages();
|
||||
$comptageM->insert($data);
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'resultat' => number_format($data['resultat'], 0, '', ' '),
|
||||
'uniteInsee' => number_format($data['uniteInsee'], 0, '', ' '),
|
||||
'dateAjout' => substr($data['dateAjout'],6,2).'/'.substr($data['dateAjout'],4,2).'/'.substr($data['dateAjout'],0,4)
|
||||
.' '.substr($data['dateAjout'],8,2).':'.substr($data['dateAjout'],10,2).':'.substr($data['dateAjout'],12,2),
|
||||
);
|
||||
$this->view->result = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a preview of data to extract
|
||||
*/
|
||||
public function previsualisationAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$sessionValue = new Scores_Ciblage_Session(null);
|
||||
$valueSelected = $sessionValue->getSelectedValues();
|
||||
|
||||
//Comptage
|
||||
$ciblage = new Scores_Ciblage_Engine($values, $user->globalRNCS);
|
||||
$sirets = $ciblage->execute(true, 10);
|
||||
|
||||
/**
|
||||
* Make SQL request with the client profil for columns
|
||||
*/
|
||||
$profilsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('criteres'))
|
||||
->where('reference=?','default')
|
||||
->where('login = ?', $user->username);
|
||||
$result = $profilsM->fetchRow($sql);
|
||||
|
||||
$profil = json_decode($result['criteres'], true);
|
||||
|
||||
//No profil, define it
|
||||
if (count($profil)==0) {
|
||||
$profil = array('raisonSociale');
|
||||
}
|
||||
|
||||
$tabEntete = $tabEnteteLabel = array();
|
||||
$enrichissement = new Scores_Ciblage_Extract();
|
||||
$fields = $enrichissement->getFields();
|
||||
|
||||
$columns = array();
|
||||
$joins = array();
|
||||
foreach ( $profil as $item ) {
|
||||
|
||||
//Get item
|
||||
if ( array_key_exists($item, $fields) ) {
|
||||
$field = $fields[$item];
|
||||
|
||||
//Définition de l'entete
|
||||
$tabEnteteLabel[] = $field['label'];
|
||||
$tabEntete[] = $item;
|
||||
|
||||
//Construction de la requete SQL
|
||||
if ( array_key_exists('sql', $field) ) {
|
||||
$columns[] = $field['sql'];
|
||||
} else {
|
||||
$columns[] = $field['column'].' AS '.$item;
|
||||
}
|
||||
|
||||
//Pour les champs de type "code", ajouter le libellé
|
||||
if ( array_key_exists('join', $field) ) {
|
||||
$tabEnteteLabel[] = $field['join']['label'];
|
||||
$joinColumn = $item.'Lib';
|
||||
$tabEntete[] = $joinColumn;
|
||||
|
||||
//Sql
|
||||
$tableAlias = $item.'L';
|
||||
$join['name'] = $field['join']['table'].' AS '.$tableAlias;
|
||||
$join['col'] = $field['join']['column'].' AS '.$joinColumn;
|
||||
$join['cond'] = $field['join']['cond'];
|
||||
|
||||
$joins[] = $join;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$db = Zend_Db_Table::getDefaultAdapter();
|
||||
$sql = $db->select()->from('jo.etablissements_act', $columns);
|
||||
|
||||
$i = 0;
|
||||
foreach ( $sirets as $siret ) {
|
||||
if ( $i>0 ) {
|
||||
$sql->orWhere("siren='".substr($siret,0,9)."' AND nic='".substr($siret,9,5)."'");
|
||||
} else {
|
||||
$sql->where("siren='".substr($siret,0,9)."' AND nic='".substr($siret,9,5)."'");
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (count($joins)) {
|
||||
foreach ( $joins as $join ) {
|
||||
$sql->joinLeft($join['name'], $join['cond'], $join['col']);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$result = $db->fetchAll($sql);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
echo $e->getMessage();
|
||||
echo "<br/>";
|
||||
echo $sql->__toString();
|
||||
}
|
||||
|
||||
$liste = array();
|
||||
if ( count($result)>0 ) {
|
||||
foreach ( $result as $l => $line ) {
|
||||
$tmp = array();
|
||||
foreach ( $tabEntete as $item ) {
|
||||
$data = '';
|
||||
if ( array_key_exists($item, $line) ) {
|
||||
$data = $line[$item];
|
||||
}
|
||||
$valuesPredefine = $enrichissement->getColumnValue($item);
|
||||
if ($valuesPredefine!==false) {
|
||||
$tmp[] = $valuesPredefine[$data];
|
||||
} else {
|
||||
$tmp[] = $data;
|
||||
}
|
||||
}
|
||||
$liste[] = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('label', $tabEnteteLabel);
|
||||
$this->view->assign('liste', $liste);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
<?php
|
||||
class CriteresController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$field = new Fields($user->username);
|
||||
$this->view->fields = $field;
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
if ($user->customisation) {
|
||||
$this->view->assign('preferences', $user->customisation);
|
||||
}
|
||||
}
|
||||
|
||||
public function entrepriseAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function economiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function geographiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function juridiqueAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
public function financiereAction(){
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/criteres/'.$this->getRequest()->getActionName().'.css', 'all');
|
||||
}
|
||||
|
||||
}
|
@ -1,227 +1,481 @@
|
||||
<?php
|
||||
/**
|
||||
* Tableau de bord de gestion pour le client
|
||||
* Permet de retrouver ces différents comptages et export
|
||||
*
|
||||
*/
|
||||
class DashboardController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche le tableau de bord
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste des derniers comptages
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$sql = $criteresM->select(true)
|
||||
->columns(array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limit(5);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
|
||||
$results = array();
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->assign('comptages', $results);
|
||||
|
||||
//Rechercher un comptage
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function menuAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Affiche la liste des ciblages avec pagination
|
||||
*/
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$page = $request->getParam('page', 1);
|
||||
$offset = 20;
|
||||
|
||||
//Liste des ciblages par paquet de n
|
||||
$auth = Zend_Auth::getInstance();
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()
|
||||
->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
|
||||
$this->view->headScript()
|
||||
->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
$count = $criteresM->fetchRow($sql);
|
||||
$nbCiblage = $count->nb;
|
||||
|
||||
//Récupérer les informations
|
||||
$position = ($page-1)*$offset+1;
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limitPage($position, $offset);
|
||||
->limit(5);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
|
||||
//
|
||||
$results = array();
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$comptagesM = new Application_Model_CiblageComptages();
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
$sql = $comptagesM->select()
|
||||
->from($comptagesM, array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%Y/%m/%d %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->assign('ciblages', $results);
|
||||
$this->view->assign('nbCiblage', $nbCiblage);
|
||||
|
||||
}
|
||||
$this->view->comptages = $results;
|
||||
|
||||
/**
|
||||
* Affiche le détail du comptage
|
||||
* comptage multiple, fichier, etc....
|
||||
*/
|
||||
public function ciblagedetailAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
$sql = $criteresM->select()
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->where("id = ?", $id);
|
||||
$criteres = $criteresM->fetchRow($sql);
|
||||
$this->view->assign('criteres', $criteres->toArray());
|
||||
|
||||
if ($criteres != null){
|
||||
$comptagesM = new Application_Model_Comptages($db);
|
||||
$sql = $comptagesM->select()
|
||||
->where('idDefinition = ?', $id);
|
||||
$comptages = $comptagesM->fetchAll($sql);
|
||||
|
||||
$this->view->assign('comptages', $comptages->toArray());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche un comptage avec la référence ou la date
|
||||
*/
|
||||
public function rcomptageAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
//
|
||||
$enrichissements = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $enrichissements->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'ciblage_criteres'), 'i.idCriteres = c.id',
|
||||
array('')
|
||||
)
|
||||
->where('c.idClient = ?', $user->idClient)
|
||||
->where('c.login = ?', $user->username)
|
||||
->order('i.dateAdded DESC');
|
||||
|
||||
$this->view->enrichissements = $enrichissements->fetchAll($sql);
|
||||
|
||||
}
|
||||
|
||||
public function ciblagesAction()
|
||||
{
|
||||
|
||||
$request = $this->getRequest();
|
||||
$page = $request->getParam('page', 1);
|
||||
|
||||
|
||||
$offset = 20;
|
||||
//Liste des ciblages par paquet de n
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('nb' => 'COUNT(*)'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username);
|
||||
$count = $criteresM->fetchRow($sql);
|
||||
$nbCiblage = $count->nb;
|
||||
|
||||
//Récupérer les informations
|
||||
$position = ($page-1)*$offset+1;
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', 'dateAjout'))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->order('dateAjout DESC')
|
||||
->limitPage($position, $offset);
|
||||
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
$results = array();
|
||||
$comptagesM = new Application_Model_CiblageComptages();
|
||||
foreach($rows->toArray() as $item)
|
||||
{
|
||||
$info = array(
|
||||
'id' => $item['id'],
|
||||
'reference' => $item['reference'],
|
||||
'dateCriteres' => $item['dateAjout'],
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select()
|
||||
->from($comptagesM, array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%d/%m/%Y %H:%i:%s') as dateAjoutF"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjoutF'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->ciblages = $results;
|
||||
$this->view->nbCiblage = $nbCiblage;
|
||||
|
||||
$this->view->page = $page;
|
||||
$this->view->nbPages = ceil($nbCiblage/$offset);
|
||||
}
|
||||
|
||||
public function ciblageAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$comptageId = $request->getParam('id');
|
||||
|
||||
//Lecture des paramètres du ciblage
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->where('idClient = ?', $user->idClient)
|
||||
->where('login = ?', $user->username)
|
||||
->where('id = ?', $comptageId);
|
||||
$criteres = $criteresM->fetchRow($sql)->toArray();
|
||||
|
||||
$infosCriteres = array();
|
||||
if ($criteres != null) {
|
||||
$comptageRef = $criteres['reference'];
|
||||
|
||||
$decodeCriteres = json_decode($criteres['criteres'], true);
|
||||
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$sessionValue->setSelectedValues($decodeCriteres, false);
|
||||
|
||||
//Construction affichage des critères
|
||||
$infosCriteres = array();
|
||||
$allFields = $fields->getItems(true);
|
||||
foreach ( $allFields as $key => $params )
|
||||
{
|
||||
$valueSelected = $sessionValue->getSelectedValue($key);
|
||||
if ( $valueSelected !== null ) {
|
||||
|
||||
$isMultiple = $fields->isMultiple($key);
|
||||
|
||||
$inValue = array();
|
||||
if ( array_key_exists('in', $valueSelected) ) {
|
||||
$inValue = $valueSelected['in'];
|
||||
}
|
||||
|
||||
$exValue = array();
|
||||
if ( array_key_exists('in', $valueSelected) ) {
|
||||
$exValue = $valueSelected['ex'];
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($key);
|
||||
Zend_Registry::get('firebug')->info($inValue);
|
||||
|
||||
$inLabel = array();
|
||||
if ( is_array($inValue) && count($inValue) > 0 ) {
|
||||
foreach ( $inValue as $value ) {
|
||||
if ( $isMultiple === true ) {
|
||||
$inLabel[] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
else if ( array_key_exists($value, $params['values']) ) {
|
||||
$inLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( array_key_exists($inValue, $params['values']) ) {
|
||||
$inLabel[] = $params['values'][$inValue];
|
||||
}
|
||||
}
|
||||
|
||||
$exLabel = array();
|
||||
if ( is_array($exValue) && count($exValue)>0 ) {
|
||||
foreach ( $exValue as $value ) {
|
||||
if ( $isMultiple === true ) {
|
||||
$inLabel[] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
else if ( array_key_exists($value, $params['values']) ) {
|
||||
$exLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( array_key_exists($exValue, $params['values']) ) {
|
||||
$exLabel[] = $params['values'][$inValue];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $params['label'],
|
||||
'in' => $inLabel,
|
||||
'ex' => $exLabel,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//Lecture des comptages
|
||||
$comptageM = new Application_Model_CiblageComptages();
|
||||
$sql = $comptageM->select()
|
||||
->where('idDefinition = ?', $comptageId)
|
||||
->order('dateAjout DESC');
|
||||
$comptages = $comptageM->fetchAll($sql)->toArray();
|
||||
|
||||
//Lecture enrichissement existe
|
||||
$enrichissementsM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $enrichissementsM->select()
|
||||
->where('idCriteres = ?', $comptageId);
|
||||
|
||||
$enrichissements = $enrichissementsM->fetchAll($sql);
|
||||
|
||||
//Affichage
|
||||
$this->view->comptageId = $comptageId;
|
||||
$this->view->comptageRef = $comptageRef;
|
||||
$this->view->criteres = $infosCriteres;
|
||||
$this->view->comptages = $comptages;
|
||||
$this->view->enrichissements = $enrichissements;
|
||||
}
|
||||
}
|
||||
|
||||
public function rcomptageAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$q = strtolower($this->getRequest()->getParam('q', ''));
|
||||
|
||||
|
||||
$request = $this->getRequest();
|
||||
$q = $request->getParam('q');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Application_Model_Criteres($db);
|
||||
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->from($criteresM, array('id', 'reference', "DATE_FORMAT(dateAjout, '%d/%m/%Y') as date"))
|
||||
->where("idClient = ?", $user->idClient)
|
||||
->where("login = ?", $user->username)
|
||||
->where("reference LIKE ?", $q.'%');
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
$rows = $criteresM->fetchAll($sql);
|
||||
if (count($rows)>0){
|
||||
$separator = " , ";
|
||||
foreach ($rows as $item) {
|
||||
foreach ($rows as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->reference . $separator . $item->date,
|
||||
'value' => $item->reference,
|
||||
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblagedetail', 'id'=>$item->id)),
|
||||
'value' => $item->reference,
|
||||
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblage', 'id'=>$item->id)),
|
||||
);
|
||||
}
|
||||
}
|
||||
echo json_encode($output);
|
||||
echo json_encode($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* Liste des enrichissements
|
||||
*/
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
|
||||
$enrichissementsM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
|
||||
// Pending
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'ciblage_comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'ciblage_criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('i.dateStop = ?', 0)
|
||||
->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username);
|
||||
$encours = $enrichissementsM->fetchAll($sql);
|
||||
$this->view->encours = $encours;
|
||||
|
||||
$sql = $enrichissementsM->select()
|
||||
->setIntegrityCheck(false)
|
||||
->from(
|
||||
array('i' => 'enrichissement_identifiants'),
|
||||
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
|
||||
)
|
||||
->join(
|
||||
array('c' => 'ciblage_comptages'), 'i.idComptage = c.id',
|
||||
array('')
|
||||
)
|
||||
->join(
|
||||
array('criteres' => 'ciblage_criteres'), 'i.idCriteres = criteres.id',
|
||||
array('')
|
||||
);
|
||||
$sql->where('criteres.idClient = ?', $user->idClient)
|
||||
->where('criteres.login = ?', $user->username)
|
||||
->where('i.dateStart != ?', '0000-00-00 00:00:00');
|
||||
$fini = $enrichissementsM->fetchAll($sql)->toArray();
|
||||
$this->view->fini = $fini;
|
||||
$this->view->pathfile = $config->path->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Détail d'un enrichissment
|
||||
*/
|
||||
public function enrichissementAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gestion de la configuration de l'application
|
||||
* Display information about user's profil
|
||||
*/
|
||||
public function configurationAction()
|
||||
{
|
||||
//Préférences
|
||||
//Profil extraction
|
||||
|
||||
|
||||
|
||||
//User's params
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
if (array_key_exists('filter', $user->preferences) && count($user->preferences['filter'])>0) {
|
||||
$liste = $user->preferences['filter'];
|
||||
foreach ( $liste as $name => $value ){
|
||||
$this->view->assign('prefFilter'.ucfirst($name), $value);
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('interface', $user->preferences) && count($user->preferences['interface'])>0) {
|
||||
$liste = $user->preferences['interface'];
|
||||
foreach ( $liste as $name => $value ){
|
||||
$this->view->assign('prefInterface'.ucfirst($name), $value);
|
||||
}
|
||||
}
|
||||
|
||||
$timestamp = strtotime( $user->dateContrat );
|
||||
$dateBegin = date( 'd/m/Y', $timestamp );
|
||||
|
||||
$timestamp = mktime(0,0,0,substr($dateBegin,3,2)+$user->periodContrat,substr($dateBegin,0,2), substr($dateBegin,6,4));
|
||||
$dateEnd = date( 'd/m/Y', $timestamp );
|
||||
|
||||
$this->view->assign('dateBegin', $dateBegin);
|
||||
$this->view->assign('dateEnd', $dateEnd);
|
||||
|
||||
//Customer params have an option on the RNCS filter
|
||||
$this->view->assign('filterRNCS', $user->filterRNCS);
|
||||
$this->view->assign('licenceINSEE', $user->licenceINSEE);
|
||||
$this->view->assign('immediatExtract', $user->immediatExtract);
|
||||
|
||||
$tarifText = '';
|
||||
//Tarifs
|
||||
if ($user->forfait!=0) {
|
||||
//Forfait de
|
||||
$tarifText = 'Forfait de '.$user->forfait.' euros';
|
||||
} else {
|
||||
$tarifText = 'Tarif unitaire à la ligne de '.$user->priceLine.' euros';
|
||||
}
|
||||
|
||||
//Paramètres
|
||||
if ( $user->limitFiles!=0 && $user->limitLines!=0 ) {
|
||||
$tarifText.= ' limité à '.$user->limitFiles.' fichiers et à '.$user->limitLines.' lignes par fichier.';
|
||||
} elseif ( $user->limitFiles!=0 && $user->limitLines==0 ) {
|
||||
$tarifText.= ' limité à '.$user->limitFiles.' fichiers';
|
||||
} elseif ( $user->limitFiles==0 && $user->limitLines!=à ) {
|
||||
$tarifText.= ' limité à '.$user->limitLines.' lignes par fichier.';
|
||||
}
|
||||
$this->view->assign('tarifText', $tarifText);
|
||||
|
||||
//List of data to extract
|
||||
$profilsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->where('login = ?', $user->username)
|
||||
->where('idClient = ?', $user->idClient);
|
||||
$result = $profilsM->fetchRow($sql);
|
||||
if ($result) {
|
||||
$criteres = json_decode($result['criteres'], true);
|
||||
$enrichissement = new Scores_Ciblage_Extract();
|
||||
$data = $enrichissement->getFields();
|
||||
$profilLabels = array();
|
||||
foreach ( $data as $key => $item ) {
|
||||
if (in_array($key, $criteres)) {
|
||||
$profilLabels[] = $item['label'];
|
||||
}
|
||||
}
|
||||
$profil = new stdClass();
|
||||
$profil->labels = $profilLabels;
|
||||
$profil->reference = $result['reference'];
|
||||
$this->view->assign('profil', $profil);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Liste des exportations simple non lié à un ciblage
|
||||
* Set preferences
|
||||
*/
|
||||
public function exportsAction()
|
||||
public function prefAction()
|
||||
{
|
||||
|
||||
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Read prefs table to load actual config
|
||||
$prefsM = new Application_Model_CiblagePrefs();
|
||||
$userPrefs = $prefsM->find($user->username);
|
||||
|
||||
if ($userPrefs) {
|
||||
$data = json_decode($userPrefs->current()->json, true);
|
||||
} else {
|
||||
$data = array('interface'=>array(),'filter'=>array());
|
||||
$prefsM->insert(array('login'=>$user->username, 'json'=>json_encode($data)));
|
||||
}
|
||||
|
||||
$request = $this->getRequest();
|
||||
$sendParam = $request->getParams();
|
||||
|
||||
$prefsFilter = array('rncs');
|
||||
$prefsInterface = array('insee');
|
||||
|
||||
$filter = array();
|
||||
foreach ( $prefsFilter as $item ) {
|
||||
if (array_key_exists($item, $sendParam)) {
|
||||
$filter = array($item => $sendParam[$item]);
|
||||
}
|
||||
}
|
||||
if (array_key_exists('filter', $data)) {
|
||||
$filter = array_merge($data['filter'], $filter);
|
||||
}
|
||||
$data['filter'] = $filter;
|
||||
|
||||
$interface = array();
|
||||
foreach ( $prefsInterface as $item ) {
|
||||
if (array_key_exists($item, $sendParam)) {
|
||||
$interface = array($item => $sendParam[$item]);
|
||||
}
|
||||
}
|
||||
if (array_key_exists('interface', $data)) {
|
||||
$interface = array_merge($data['interface'], $interface);
|
||||
}
|
||||
$data['interface'] = $interface;
|
||||
$newjson = json_encode($data);
|
||||
|
||||
$nbRow = $prefsM->update(array('json'=>$newjson), "login='".$user->username."'");
|
||||
|
||||
//Don't forget to save new preferences in session
|
||||
|
||||
$this->view->assign('nbRow', $nbRow);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -6,47 +6,47 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/enrichissement.js', 'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/enrichissement.css');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function indexAction(){}
|
||||
|
||||
|
||||
public function fileformAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/jquery.form.js', 'text/javascript');
|
||||
$this->view->headScript()->appendFile('/libs/form/jquery.form.js', 'text/javascript');
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/jqueryprogressbar.js', 'text/javascript');
|
||||
$this->view->assign('filesize', ini_get('upload_max_filesize'));
|
||||
$this->view->assign('filesize', ini_get('upload_max_filesize'));
|
||||
}
|
||||
|
||||
|
||||
public function fileuploadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
|
||||
$path = realpath($config->data).'/clients';
|
||||
|
||||
$c = Zend_Registrey::get('config');
|
||||
$path = realpath($c->profil->path->data).'/clients';
|
||||
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'];
|
||||
$name = $_REQUEST['ref'];
|
||||
|
||||
|
||||
$extValide = array('csv');
|
||||
$extension = strrchr($n,'.');
|
||||
$extension = substr($extension,1);
|
||||
//@todo : vérifier l'extension du fichier
|
||||
|
||||
|
||||
if (move_uploaded_file($tmp_name, $path.'/'.$name.'.'.$extension)){
|
||||
echo "Uploadé !";
|
||||
} else {
|
||||
echo "Erreur : ".$_FILES['fichier']['error'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Etat de progression de l'upload du fichier
|
||||
*/
|
||||
@ -54,15 +54,319 @@ class EnrichissementController extends Zend_Controller_Action
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key', '');
|
||||
if (!empty($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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Enregistrement de la commande pour l'ennrichissement
|
||||
*/
|
||||
public function commandeAction()
|
||||
{
|
||||
/**
|
||||
* @todo : Si forfait check si le montant restant est suffisant
|
||||
* @todo : Vérifier le nombre d'éléments avec le nombre de ligne
|
||||
* @todo : ajouter la valeur (prix) du fichier au compteur global afin de décompter du forfait
|
||||
*/
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
// --- Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
// --- Paramètres
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id', null);
|
||||
$idProfil = $request->getParam('profil', null);
|
||||
$ref = $request->getParam('ref');
|
||||
|
||||
// --- Identifiant comptage
|
||||
try {
|
||||
$comptage = new Application_Model_CiblageComptages();
|
||||
$sql = $comptage->select()->where('id=?', $id);
|
||||
$result = $comptage->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info('SQL : '.$e->getMessage());
|
||||
}
|
||||
|
||||
if ($result === null) {
|
||||
$this->view->msg = 'Erreur';
|
||||
} else {
|
||||
$idComptage = $result->idDefinition;
|
||||
|
||||
// --- Récupération des critères du ciblage
|
||||
try {
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()->where('id=?', $idComptage);
|
||||
$criteres = $criteresM->fetchRow($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info('SQL : '.$e->getMessage());
|
||||
}
|
||||
|
||||
if ($criteres === null) {
|
||||
$this->view->msg = 'Erreur';
|
||||
} else {
|
||||
$structure = json_decode($criteres->criteres, true);
|
||||
|
||||
// --- Récupération des SIRET
|
||||
$ciblage = new Scores_Ciblage_Engine($structure, $user->globalRNCS);
|
||||
$infosExtraction = $ciblage->execute(true);
|
||||
|
||||
// -- Calcul uniteInsee réelle car si donnée insee alors toutes les lignes doivent être comptés en unité insee
|
||||
$data = array(
|
||||
'idComptage' => $idComptage,
|
||||
'reference' => $ref,
|
||||
'idCriteres' => $criteres->id,
|
||||
'idProfil' => $idProfil,
|
||||
'identifiants' => json_encode($infosExtraction),
|
||||
'idProfil' => $idProfil,
|
||||
'fichier' => '',
|
||||
'nbLigneTotales' => count($infosExtraction),
|
||||
'nbLigneTraites' => 0,
|
||||
'uniteInsee' => $result['uniteInsee'],
|
||||
'error' => '',
|
||||
'dateAdded' => date('YmdHis'),
|
||||
);
|
||||
try {
|
||||
$identifiantsM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$idIdentifiant = $identifiantsM->insert($data);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info('SQL : '.$e->getMessage());
|
||||
}
|
||||
|
||||
$this->view->assign('ref', $ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Demande de référence pour l'enrichissement
|
||||
*/
|
||||
public function referenceAction()
|
||||
{
|
||||
//Constantes
|
||||
$resultatMax = 50000;
|
||||
$redevanceInsee = 3.295/100;
|
||||
$redevanceInseeMax = 52734; //Seuil de facturation 52 734 euros
|
||||
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
|
||||
$selectprofil = $request->getParam('profil', 'default');
|
||||
|
||||
//Récupération du profil de l'utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$priceLine = $user->priceLine;
|
||||
|
||||
//Other profil for this login ?
|
||||
$profilsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id', 'reference', 'criteres'))
|
||||
->where('actif=1')
|
||||
->where('login=?', $user->username);
|
||||
$profils = $profilsM->fetchAll($sql)->toArray();
|
||||
|
||||
$profilId = 0;
|
||||
foreach($profils as $item) {
|
||||
if ($selectprofil == $item['id']) {
|
||||
$profilId = $item['id'];
|
||||
}
|
||||
if ($item['reference']=='default') {
|
||||
$defaultProfilId = $item['id'];
|
||||
}
|
||||
}
|
||||
if ($profilId == 0) {
|
||||
$profilId = $defaultProfilId;
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($profilId);
|
||||
|
||||
if ( count($profils)>0 ) {
|
||||
|
||||
$this->view->assign('profil', $profilId);
|
||||
$idCritere = $request->getParam('id', null);
|
||||
|
||||
$comptagesM = new Application_Model_CiblageComptages();
|
||||
$sql = $comptagesM->select()
|
||||
->where('idDefinition = ?', $idCritere)
|
||||
->order('dateAjout DESC')
|
||||
->limit(1);
|
||||
$comptages = $comptagesM->fetchAll($sql);
|
||||
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$criteres = $criteresM->find($idCritere)->current();
|
||||
$criteresValue = json_decode($criteres->criteres, true);
|
||||
|
||||
if ( $comptages->count()>0 ) {
|
||||
$item = $comptages[0];
|
||||
$date = explode(' ', $item->dateAjout);
|
||||
$date = $date[0];
|
||||
|
||||
if($date != '0000-00-00' && $date != date('Y-m-d')) {
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$count = new Ciblage($criteresValue);
|
||||
$item['resultat'] = $count->execute();
|
||||
$item['uniteInsee'] = $count->calculRedevanceInsee();
|
||||
}
|
||||
|
||||
$this->view->assign('resultat', $item['resultat']);
|
||||
$this->view->assign('uniteInsee', $item['uniteInsee']);
|
||||
|
||||
// --- Calcul du prix
|
||||
//@todo : Si le client a déjà payé la redevance INSEE
|
||||
$prixInsee = $item['uniteInsee']*$redevanceInsee;
|
||||
$infoInsee = '';
|
||||
if ($profil->dataInsee){
|
||||
$prixInsee = $item['resultat']*$redevanceInsee;
|
||||
$infoInsee = "Votre profil inclus au moins une donnée Insee, la redevance sera applicable sur chaque ligne.";
|
||||
}
|
||||
$this->view->prixInsee = round($prixInsee, 2);
|
||||
$this->view->infoInsee = $infoInsee;
|
||||
|
||||
$prix = round($item['resultat'] * $user->priceLine + $prixInsee, 2);
|
||||
|
||||
// --- Dépassement du nombre d'unité max à enrichir
|
||||
if ( $item['resultat'] > $resultatMax ) {
|
||||
$this->view->assign('resultatOver', true);
|
||||
}
|
||||
// --- Pas de forfait
|
||||
elseif ( $user->forfait == 0 ) {
|
||||
// --- Fichier illimité (avec nombre de lignes max définies)
|
||||
if ( $user->limitFiles == 0 ) {
|
||||
// --- Nombres de lignes dépassées
|
||||
if ( $item['resultat'] > $user->limitLines ) {
|
||||
$this->view->assign('resultatOver', 'lines');
|
||||
}
|
||||
}
|
||||
// --- Fichier limité (avec nombre de lignes définies)
|
||||
elseif ( $user->limitFiles > 0 ) {
|
||||
// --- Nombres de lignes dépassées
|
||||
if ( $user->limitLines != 0 && $item['resultat'] > $user->limitLines ) {
|
||||
$this->view->assign('resultatOver', 'lines');
|
||||
} else {
|
||||
// --- Nombre de fichier dépassés
|
||||
$dateBegin = $user->dateContrat;
|
||||
$dateEnd = date('Y-m-d H:i:s', mktime(0,0,0,substr($user->dateContrat,5,2)+$user->periodContrat, substr($user->dateContrat,8,2), substr($user->dateContrat,0,4)));
|
||||
try {
|
||||
$commandesM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from( array('commande' => 'enrichissement_identifiants'), array('id'))
|
||||
->join( array('critere' => 'ciblage_criteres'), 'critere.id = commande.idCriteres', array())
|
||||
->where("dateAdded BETWEEN '".$dateBegin."' AND '".$dateEnd."'")
|
||||
->where('idClient = ?', $user->idClient);
|
||||
$result = $commandesM->fetchAll($sql);
|
||||
} catch (Zend_Db_Exception $e) {
|
||||
echo "Erreur."; /*echo $sql->__toString();*/ exit;
|
||||
}
|
||||
if ( count($result)+1 > $user->limitFiles) {
|
||||
$this->view->assign('resultatOver', 'files');
|
||||
}
|
||||
|
||||
$result = $commandesM->fetchAll($sql);
|
||||
if ( $result->count()+1 > $user->limitFiles) {
|
||||
$this->view->assign('resultatOver', 'files');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// --- Forfait - Liste des commandes et calcul
|
||||
else {
|
||||
if ( $user->priceLine != 0 ) {
|
||||
$dateBegin = $user->dateContrat;
|
||||
$dateEnd = date('YmdHis', mktime(0,0,0,substr($user->dateContrat,5,2)+$user->periodContrat,
|
||||
substr($user->dateContrat,8,2), substr($user->dateContrat,0,4)));
|
||||
$commandesM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from( array('commande' => 'enrichissement_identifiants'), array(
|
||||
'SUM(nbLigneTotales) as total', 'SUM(uniteInsee) as insee'))
|
||||
->join( array('critere' => 'ciblage_criteres'), 'critere.id = commande.idCriteres', array())
|
||||
->where("dateAdded BETWEEN '".$dateBegin."' AND '".$dateEnd."'")
|
||||
->where('idClient = ?', $user->idClient);
|
||||
$result = $commandesM->fetchRow($sql);
|
||||
if ($result) {
|
||||
$total = $result['total'];
|
||||
$insee = $result['insee'];
|
||||
$conso = round($total * $user->priceLine + $insee * $redevanceInsee, 2);
|
||||
}
|
||||
$this->view->forfaitRemain = $user->forfait - $conso - $prix;
|
||||
$this->view->Paiement = 'LINE';
|
||||
} else {
|
||||
$this->view->Paiement = 'FORFAIT';
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->prix = $prix;
|
||||
$this->view->id = $item['id'];
|
||||
$this->view->ref = $criteres->reference.'-'.uniqid();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function downloadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$identity = $auth->getIdentity();
|
||||
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
|
||||
/*
|
||||
* Do not download file that not own by the user
|
||||
* List profil
|
||||
*/
|
||||
$profilM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$sql = $profilM->select()
|
||||
->from($profilM, array('id'))
|
||||
->where('login=?',$identity->username);
|
||||
|
||||
$profils = $profilM->fetchAll($sql);
|
||||
if ( $profils->count()>0 ) {
|
||||
$profilList = array();
|
||||
foreach ( $profils->toArray() as $item ) {
|
||||
$profilList[] = $item['id'];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* List finish file
|
||||
*/
|
||||
$table = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('idProfil IN('.join(',', $profilList).')')
|
||||
->where('id = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$date = substr($result['dateAdded'],0,4).substr($result['dateAdded'],5,2);
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->data.'/'.$date.'/';
|
||||
$file = $result['fichier'];
|
||||
}
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
} else {
|
||||
echo 'Impossible de charger le fichier.';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
42
application/controllers/ErreurController.php
Normal file
42
application/controllers/ErreurController.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
class ErreurController extends Zend_Controller_Action
|
||||
{
|
||||
protected $correlation = array(
|
||||
'siege' => array('fax', 'tel'),
|
||||
'fax'=> array('siege'))
|
||||
;
|
||||
|
||||
public function getAction()
|
||||
{
|
||||
$session = new Zend_Session_Namespace('erreurs');
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$valeur = $request->getParam('valeur');
|
||||
|
||||
$this->correlation($key, $valeur);
|
||||
$this->view->erreurs = $session->erreurs;
|
||||
}
|
||||
|
||||
protected function correlation($key, $valeurs)
|
||||
{
|
||||
$session = new Zend_Session_Namespace('erreurs');
|
||||
$session->erreurs[$key] = array('erreur' => false, 'valeur' => $valeurs);
|
||||
|
||||
foreach($session->erreurs as $erreur => $valeurs)
|
||||
{
|
||||
if(in_array($erreur, $this->correlation[$key]))
|
||||
{
|
||||
if($session->erreurs[$key]['valeur'] != 'tous')
|
||||
$session->erreurs[$key]['erreur'] = true;
|
||||
else
|
||||
unset($session->erreurs[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ class ErrorController extends Zend_Controller_Action
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
switch ($errors->type) {
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||
|
||||
@ -14,13 +14,42 @@ class ErrorController extends Zend_Controller_Action
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
$this->view->message = 'Page not found';
|
||||
break;
|
||||
|
||||
default:
|
||||
// application error
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
$this->view->message = 'Application error';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$identity = $auth->getIdentity();
|
||||
|
||||
//Envoyer les erreurs par mail
|
||||
$message = '';
|
||||
$message.= 'Erreur Applicative : ';
|
||||
$message.= "\n";
|
||||
$message.= 'Message : '.$errors->exception->getMessage();
|
||||
$message.= "\n";
|
||||
$message.= 'Utilisateur : '.$identity->username;
|
||||
$message.= "\n";
|
||||
$message.= "File :".$errors->exception->getFile().", Ligne : ".$errors->exception->getLine();
|
||||
$message.= "\n";
|
||||
$message.= "Detail :\n".$errors->exception->getTraceAsString();
|
||||
$message.= "\n\n";
|
||||
$message.= "Request Parameters :\n ".print_r($this->getRequest()->getParams(), true)."\n";
|
||||
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n";
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
require_once 'Scores/Mail.php';
|
||||
$mail = new Mail();
|
||||
$mail->setSubject('[ERREUR APPLICATIVE] - '.$c->profil->server->name.' -'.date('Ymd'));
|
||||
$mail->setBodyTexte($message);
|
||||
$mail->setFrom('supportdev');
|
||||
$mail->addToKey('supportdev');
|
||||
$mail->send();
|
||||
|
||||
// Log exception, if logger available
|
||||
if ($log = $this->getLog()) {
|
||||
$log->crit($this->view->message, $errors->exception);
|
||||
@ -33,7 +62,7 @@ class ErrorController extends Zend_Controller_Action
|
||||
|
||||
$this->view->request = $errors->request;
|
||||
}
|
||||
|
||||
|
||||
public function getLog()
|
||||
{
|
||||
$bootstrap = $this->getInvokeArg('bootstrap');
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class ExtractionController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction(){
|
||||
}
|
||||
}
|
||||
|
98
application/controllers/FieldsController.php
Normal file
98
application/controllers/FieldsController.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
class FieldsController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Display fields
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->headLink()
|
||||
->appendStylesheet('/libs/tree-3.1.1/themes/default/style.css', 'all')
|
||||
->appendStylesheet('/libs/nouislider/jquery.nouislider.min.css', 'all')
|
||||
->appendStylesheet('/libs/daterangepicker/daterangepicker-bs3.css', 'all');
|
||||
|
||||
$this->view->headScript()
|
||||
->appendFile('/libs/moment.min.js', 'text/javascript')
|
||||
->appendFile('/libs/tree-3.1.1/jstree.min.js', 'text/javascript')
|
||||
->appendFile('/libs/nouislider/jquery.nouislider.all.min.js')
|
||||
->appendFile('/libs/daterangepicker/daterangepicker.js')
|
||||
->appendFile('/themes/default/scripts/scripts.js', 'text/javascript')
|
||||
->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
|
||||
$families = array(
|
||||
'entreprise',
|
||||
'economique',
|
||||
'geographique',
|
||||
'juridique',
|
||||
'financier',
|
||||
'chiffrescles',
|
||||
);
|
||||
|
||||
$fields = array();
|
||||
|
||||
$scoresFields = new Scores_Ciblage_FieldList();
|
||||
foreach ( $families as $family ) {
|
||||
$fields = $scoresFields->getItemsByFamily($family);
|
||||
$this->view->{'Fields'.ucfirst($family)} = $fields;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage tag
|
||||
*/
|
||||
public function tagAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Nom de la clé de ciblage
|
||||
$name = $request->getParam('name');
|
||||
//Clé pour le lancement de la fonction de recherche
|
||||
$key = $request->getParam('key');
|
||||
//Query
|
||||
$q = strtolower(trim($request->getParam('q')));
|
||||
|
||||
$scoresFields = new Scores_Ciblage_FieldList();
|
||||
$values = $scoresFields->searchValues($name, $q);
|
||||
Zend_Registry::get('firebug')->info($values);
|
||||
if (count($values) == 0) {
|
||||
$values[] = array('label' => 'Aucun résultat.', 'value' => '');
|
||||
}
|
||||
$this->view->values = $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Tree
|
||||
*/
|
||||
public function treeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
$this->view->key = $key;
|
||||
|
||||
$parent = $request->getParam('id');
|
||||
$level = $request->getParam('level');
|
||||
|
||||
//Init
|
||||
if ( $parent === null ) {
|
||||
$this->view->init = true;
|
||||
}
|
||||
// First level
|
||||
elseif ( $parent == '#' ) {
|
||||
$scoresFields = new Scores_Ciblage_FieldList();
|
||||
$session = new Scores_Ciblage_Session($scoresFields);
|
||||
$values = $session->getTreeValues($key, null, $level);
|
||||
$this->view->values = $values;
|
||||
}
|
||||
// Get level
|
||||
else {
|
||||
$scoresFields = new Scores_Ciblage_FieldList();
|
||||
$session = new Scores_Ciblage_Session($scoresFields);
|
||||
$values = $session->getTreeValues($key, $parent, $level);
|
||||
$this->view->values = $values;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
615
application/controllers/GestionController.php
Normal file
615
application/controllers/GestionController.php
Normal file
@ -0,0 +1,615 @@
|
||||
<?php
|
||||
class GestionController extends Zend_Controller_Action
|
||||
{
|
||||
protected $dbMetier;
|
||||
|
||||
public function preDispatch()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
|
||||
|
||||
//Get Database
|
||||
$c = Zend_Registry::get('config');
|
||||
try {
|
||||
$this->dbMetier = Zend_Db::factory($c->profil->db->jo);
|
||||
} catch ( Exception $e ) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display all links
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Display profils to get data
|
||||
* Filter with login and idClient
|
||||
*
|
||||
*/
|
||||
public function profilsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$login = $request->getParam('login', '');
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
|
||||
$profilsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('id', 'idClient', 'login', 'reference', 'tarifLigne', 'dateAjout', 'dateSuppr', 'actif'));
|
||||
|
||||
if ( !empty($login) ) {
|
||||
$sql->where('login = ?', $login.'%');
|
||||
}
|
||||
if ( $idClient!=null ) {
|
||||
$sql->where('idClient = ?', $idClient);
|
||||
}
|
||||
|
||||
$profils = $profilsM->fetchAll($sql);
|
||||
|
||||
if ( count($profils)>0 ) {
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
$i = 0;
|
||||
foreach ($profils as $profil) {
|
||||
$infoClient = $clientM->find($profil->idClient);
|
||||
$profils[$i]->nom = $infoClient->nom;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('profils', $profils);
|
||||
}
|
||||
|
||||
/**
|
||||
* Define fields for extraction to user
|
||||
*/
|
||||
public function profiladdAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Sauvegarde du formulaire
|
||||
if ( $request->isPost() )
|
||||
{
|
||||
$params = $request->getParams();
|
||||
|
||||
if ($params['reference']=='default') {
|
||||
//Get default profil
|
||||
$profilClientM = new Application_Model_CiblageCustomerParams();
|
||||
$sql = $profilClientM->select()->where('idClient=?',$request->getParam('idClient'));
|
||||
$profilClient = $profilClientM->fetchRow($sql);
|
||||
if ( null !== $profilClient ) {
|
||||
$params['criteres'] = json_decode($profilClient->criteres,true);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($params['criteres'])) {
|
||||
|
||||
$this->view->assign('message', "Erreur profil vide");
|
||||
|
||||
} else {
|
||||
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'service' => $params['service'],
|
||||
'login' => $params['login'],
|
||||
'reference' => $params['reference'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'dataInsee' => 0,
|
||||
'dateAjout' => date('Y-m-d H:i:s'),
|
||||
'actif' => 1,
|
||||
);
|
||||
$profilM = new Application_Model_CiblageEnrichissementProfils();
|
||||
if ( $profilM->insert($data) ) {
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
$this->view->assign('disableForm', true);
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//Affichage du formulaire
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$allFields = $fieldsM->getFields();
|
||||
$this->view->assign('fields', $allFields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark profil as deleted
|
||||
*/
|
||||
public function profildelAction()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List commands which must be done
|
||||
*/
|
||||
public function commandesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$month = $request->getParam('month', date('m'));
|
||||
$year = $request->getParam('year', date('Y'));
|
||||
|
||||
$this->view->assign('month', $month);
|
||||
$this->view->assign('year', $year);
|
||||
|
||||
$commandesM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from('enrichissement_identifiants AS e', array(
|
||||
'e.id',
|
||||
'e.reference AS commandeReference',
|
||||
'e.nbLigneTotales',
|
||||
'e.uniteInsee',
|
||||
"DATE_FORMAT(e.dateAdded, '%Y/%m/%d %H:%i:%s') AS dateAdded"
|
||||
))
|
||||
->join('ciblage_criteres', 'idCriteres = ciblage_criteres.id', array(
|
||||
'ciblage_criteres.reference AS critereReference',
|
||||
'ciblage_criteres.login',
|
||||
))
|
||||
->where('e.dateStart = ?', "0000-00-00 00:00:00")
|
||||
->where('fichier = ""')
|
||||
->where("e.dateAdded LIKE '".$year."-".$month."%'")
|
||||
->order('e.dateAdded DESC');
|
||||
|
||||
$this->view->commandes = $commandesM->fetchAll($sql)->toArray();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List commands with a file
|
||||
*/
|
||||
public function enrichissementsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$month = $request->getParam('month', date('m'));
|
||||
$year = $request->getParam('year', date('Y'));
|
||||
|
||||
$this->view->assign('month', $month);
|
||||
$this->view->assign('year', $year);
|
||||
|
||||
$commandesM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $commandesM->select()->setIntegrityCheck(false)
|
||||
->from('enrichissement_identifiants AS e', array(
|
||||
'e.id',
|
||||
'e.reference AS commandeReference',
|
||||
'e.nbLigneTotales',
|
||||
'e.uniteInsee',
|
||||
"DATE_FORMAT(e.dateAdded, '%Y/%m/%d %H:%i:%s') AS dateAdded",
|
||||
"DATE_FORMAT(e.dateStart, '%Y/%m/%d %H:%i:%s') AS dateStart",
|
||||
'e.fichier'
|
||||
))
|
||||
->join('ciblage_criteres', 'idCriteres = ciblage_criteres.id', array(
|
||||
'ciblage_criteres.reference AS critereReference',
|
||||
'ciblage_criteres.login',
|
||||
))
|
||||
->where('fichier != ""')
|
||||
->where("e.dateAdded LIKE '".$year."-".$month."%'")
|
||||
->order('e.dateAdded DESC');
|
||||
|
||||
$this->view->commandes = $commandesM->fetchAll($sql)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Téléchargement des fichiers créer par les clients pour analyse
|
||||
*/
|
||||
public function enrichissementdlAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$identity = $auth->getIdentity();
|
||||
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
|
||||
$table = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $table->select()
|
||||
->where('id = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if( !empty($result) ) {
|
||||
$result = $result->toArray();
|
||||
$date = substr($result['dateAdded'],0,4).substr($result['dateAdded'],5,2);
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->data.'/'.$date.'/';
|
||||
$file = $result['fichier'];
|
||||
}
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
} else {
|
||||
echo 'Impossible de charger le fichier.';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load enrichissement batch to complete data
|
||||
*/
|
||||
public function enrichitAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
exec('php '.APPLICATION_PATH.'/../scripts/jobs/enrichissement.php --id '.$id.' &');
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract only SIRETs from database
|
||||
* @todo : To csv file
|
||||
*/
|
||||
public function extractAction()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
$table = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$sql = $table->select()->where('idComptage = ?', $id);
|
||||
$result = $table->fetchRow($sql);
|
||||
if(!empty($result)) {
|
||||
$result = $result->toArray();
|
||||
$sirets = json_decode($result['identifiants'], true);
|
||||
$content = '';
|
||||
foreach($sirets as $siret) {
|
||||
$content.= $siret.",";
|
||||
}
|
||||
$this->view->assign('content', $content);
|
||||
|
||||
}else {
|
||||
$this->view->assign('message', 'Aucune commande d\'enrichissement sur ce comptage');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List criteres and the last count
|
||||
*/
|
||||
public function ciblagesAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$month = $request->getParam('month', date('m'));
|
||||
$year = $request->getParam('year', date('Y'));
|
||||
|
||||
$this->view->assign('month', $month);
|
||||
$this->view->assign('year', $year);
|
||||
|
||||
$comptagesM = new Application_Model_CiblageComptages();
|
||||
|
||||
$sql = $comptagesM->select()->setIntegrityCheck(false)
|
||||
->from('ciblage_comptages', array(
|
||||
'ciblage_comptages.idDefinition',
|
||||
'ciblage_comptages.resultat',
|
||||
'ciblage_comptages.uniteInsee',
|
||||
"DATE_FORMAT(ciblage_comptages.dateAjout, '%Y/%m/%d %H:%i:%s') as dateAjout"
|
||||
))
|
||||
->join('ciblage_criteres', 'ciblage_comptages.idDefinition = ciblage_criteres.id', array('ciblage_criteres.reference'))
|
||||
->order('ciblage_comptages.dateAjout DESC')
|
||||
->group('ciblage_criteres.id')
|
||||
->where("ciblage_comptages.dateAjout LIKE '".$year."-".$month."%'")
|
||||
->order('ciblage_comptages.dateAjout DESC');
|
||||
|
||||
$comptages = $comptagesM->fetchAll($sql)->toArray();
|
||||
Zend_Registry::get('firebug')->info($comptages);
|
||||
|
||||
$this->view->comptages = $comptages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage des critères du ciblage
|
||||
*/
|
||||
public function ciblagecriteresAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$id = $request->getParam('id');
|
||||
|
||||
//Lecture des paramètres du ciblage
|
||||
$criteresM = new Application_Model_CiblageCriteres();
|
||||
$sql = $criteresM->select()
|
||||
->where('id = ?', $id);
|
||||
$criteres = $criteresM->fetchRow($sql)->toArray();
|
||||
|
||||
$decodeCriteres = json_decode($criteres['criteres'], true);
|
||||
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$sessionValue->setSelectedValues($decodeCriteres);
|
||||
|
||||
//Construction affichage des critères
|
||||
$infosCriteres = array();
|
||||
$allFields = $fields->getItems(true);
|
||||
foreach ( $allFields as $key => $params )
|
||||
{
|
||||
$valueSelected = $sessionValue->getSelectedValue($key);
|
||||
if ( $valueSelected !== null ) {
|
||||
|
||||
$isMultiple = $fields->isMultiple($key);
|
||||
|
||||
$inValue = array();
|
||||
if ( array_key_exists('in', $valueSelected) ) {
|
||||
$inValue = $valueSelected['in'];
|
||||
}
|
||||
|
||||
$exValue = array();
|
||||
if ( array_key_exists('in', $valueSelected) ) {
|
||||
$exValue = $valueSelected['ex'];
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($key);
|
||||
Zend_Registry::get('firebug')->info($inValue);
|
||||
|
||||
$inLabel = array();
|
||||
if ( is_array($inValue) && count($inValue) > 0 ) {
|
||||
foreach ( $inValue as $value ) {
|
||||
if ( $isMultiple === true ) {
|
||||
$inLabel[] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
else if ( array_key_exists($value, $params['values']) ) {
|
||||
$inLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( array_key_exists($inValue, $params['values']) ) {
|
||||
$inLabel[] = $params['values'][$inValue];
|
||||
}
|
||||
}
|
||||
|
||||
$exLabel = array();
|
||||
if ( is_array($exValue) && count($exValue)>0 ) {
|
||||
foreach ( $exValue as $value ) {
|
||||
if ( $isMultiple === true ) {
|
||||
$inLabel[] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
else if ( array_key_exists($value, $params['values']) ) {
|
||||
$exLabel[] = $params['values'][$value];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( array_key_exists($exValue, $params['values']) ) {
|
||||
$exLabel[] = $params['values'][$inValue];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $params['label'],
|
||||
'in' => $inLabel,
|
||||
'ex' => $exLabel,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->criteres = $infosCriteres;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* List customers
|
||||
*/
|
||||
public function customerparamsAction()
|
||||
{
|
||||
//@todo : what's in database
|
||||
$customersM = new Application_Model_CiblageCustomerParams();
|
||||
$sql = $customersM->select()
|
||||
->from($customersM,array('idClient', 'service' , 'dateContrat', 'periodContrat'))
|
||||
->order('dateAdded DESC')
|
||||
->group('idClient');
|
||||
$customers = $customersM->fetchAll($sql)->toArray();
|
||||
|
||||
//List login
|
||||
$customerlist = array();
|
||||
$profilsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
foreach($customers as $item) {
|
||||
$sql = $profilsM->select()
|
||||
->from($profilsM, array('login'))
|
||||
->where('idClient=?',$item['idClient']);
|
||||
$result = $profilsM->fetchAll($sql)->toArray();
|
||||
|
||||
$logins = array();
|
||||
if (count($result)>0) {
|
||||
foreach($result as $login) {
|
||||
$logins[] = $login['login'];
|
||||
}
|
||||
}
|
||||
$item['logins'] = $logins;
|
||||
|
||||
$sql = $clientM->select()->where('id=?', $item['idClient']);
|
||||
$result = $clientM->fetchRow($sql);
|
||||
$item['nom'] = $result->nom;
|
||||
|
||||
$customerlist[] = $item;
|
||||
}
|
||||
$this->view->assign('customerlist', $customerlist);
|
||||
}
|
||||
|
||||
/**
|
||||
* List customer's params
|
||||
*/
|
||||
public function customerparamAction()
|
||||
{
|
||||
//Fields
|
||||
require_once 'Scores/Ciblage/Extract.php';
|
||||
$fieldsM = new Scores_Ciblage_Extract();
|
||||
$allFields = $fieldsM->getFields();
|
||||
$this->view->assign('fields', $allFields);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$idClient= $request->getParam('idClient', null);
|
||||
$this->view->assign('idClient', $idClient);
|
||||
|
||||
if ($idClient !== null) {
|
||||
$paramsM = new Application_Model_CiblageCustomerParams();
|
||||
$sql = $paramsM->select()->where('idClient = ?', $idClient);
|
||||
$params = $paramsM->fetchRow($sql);
|
||||
$infos = null;
|
||||
if ($params!==null){
|
||||
$infos = $params->toArray();
|
||||
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
$sql = $clientM->select()->where('id=?', $idClient);
|
||||
$result = $clientM->fetchRow($sql);
|
||||
$infos['nom'] = $result->nom;
|
||||
|
||||
$infos['criteres'] = json_decode($infos['criteres'], true);
|
||||
}
|
||||
$this->view->assign('infos',$infos);
|
||||
|
||||
$loginsM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$sql = $loginsM->select()->where('idClient = ?', $idClient);
|
||||
$logins = $loginsM->fetchAll($sql)->toArray();
|
||||
$this->view->assign('logins', $logins);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function customerparamaddAction()
|
||||
{
|
||||
//Fields
|
||||
require_once 'Scores/Ciblage/Extract.php';
|
||||
$fieldsM = new Scores_Ciblage_Extract();
|
||||
$allFields = $fieldsM->getFields();
|
||||
$this->view->assign('fields', $allFields);
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Sauvegarde du formulaire
|
||||
if ( $request->isPost() && in_array($request->getParam('submit'), array('Enregistrer','Modifier')) ) {
|
||||
$params = $request->getParams();
|
||||
|
||||
//Vérifier le formulaire
|
||||
$errForm = 0;
|
||||
foreach ( $params as $key => $value ) {
|
||||
if ($value=='' && $key!='service') {
|
||||
$errForm++;
|
||||
}
|
||||
}
|
||||
if (!$errForm) {
|
||||
|
||||
$checkValues = array(
|
||||
'filterRNCS' => 0,
|
||||
'licenceINSEE' => 0,
|
||||
'immediatExtract' => 0,
|
||||
);
|
||||
foreach ($checkValues as $key => $value) {
|
||||
if (!array_key_exists($key, $params)) {
|
||||
$params[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'idClient' => $params['idClient'],
|
||||
'service' => $params['service'],
|
||||
'filterRNCS' => $params['filterRNCS'],
|
||||
'licenceINSEE' => $params['licenceINSEE'],
|
||||
'immediatExtract' => $params['immediatExtract'],
|
||||
'dateContrat' => $params['dateContrat'],
|
||||
'periodContrat' => $params['periodContrat'],
|
||||
'periodPaiement' => $params['periodPaiement'],
|
||||
'priceLine' => $params['priceLine'],
|
||||
'forfait' => $params['forfait'],
|
||||
'limitLines' => $params['limitLines'],
|
||||
'limitFiles' => $params['limitFiles'],
|
||||
'criteres' => json_encode($params['criteres']),
|
||||
'dateAdded' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
|
||||
if ($request->getParam('submit')=='Modifier') {
|
||||
//Overwrite default profil for each login
|
||||
try {
|
||||
$profilM = new Application_Model_CiblageEnrichissementProfils();
|
||||
$profilM->update(array(
|
||||
'criteres' => json_encode($params['criteres'])
|
||||
), "reference='default' AND idClient=".$params['idClient']);
|
||||
} catch ( Zend_Db_Adapter_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info($e->getMessage());
|
||||
}
|
||||
|
||||
//Set parameters
|
||||
try {
|
||||
$customerParamsM = new Application_Model_CiblageCustomerParams();
|
||||
$customerParamsM->update($data, 'id='.$params['id']);
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
} catch ( Zend_Db_Adapter_Exception $e) {
|
||||
Zend_Registry::get('firebug')->info($e->getMessage());
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
|
||||
} else {
|
||||
//Set parameters
|
||||
$customerParamsM = new Application_Model_CiblageCustomerParams();
|
||||
if ( $customerParamsM->insert($data) ){
|
||||
$this->view->assign('message', "Profil enregistré");
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la sauvegarde");
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->view->assign('message', "Erreur lors de la saisie");
|
||||
}
|
||||
} else {
|
||||
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
|
||||
$clientM = new Application_Model_Sdv1Clients();
|
||||
$sql = $clientM->select()->where('actif=?',1);
|
||||
$selectClient = $clientM->fetchAll($sql);
|
||||
$this->view->assign('selectClient',$selectClient);
|
||||
|
||||
if ($idClient !== null) {
|
||||
$paramsM = new Application_Model_CiblageCustomerParams();
|
||||
$sql = $paramsM->select()->where('idClient = ?', $idClient);
|
||||
$params = $paramsM->fetchRow($sql);
|
||||
if ( $params!==null ) {
|
||||
foreach ( $params as $key => $value ) {
|
||||
switch ( $key ) {
|
||||
case 'criteres':
|
||||
$this->view->assign($key, json_decode($value,true));
|
||||
break;
|
||||
case 'dateContrat':
|
||||
$this->view->assign($key, substr($value,0,10));
|
||||
break;
|
||||
default:
|
||||
$this->view->assign($key, $value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->view->assign('filterRNCS', 1);
|
||||
$this->view->assign('licenceINSEE', 0);
|
||||
$this->view->assign('immediatExtract', 0);
|
||||
$this->view->assign('limitLines', 50000);
|
||||
$this->view->assign('limitFiles', 0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,72 +1,140 @@
|
||||
<?php
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
public function init(){}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
if ($user->customisation) {
|
||||
$this->view->assign('preferences', $user->customisation);
|
||||
}
|
||||
}
|
||||
|
||||
public function selectionAction(){}
|
||||
|
||||
public function historiqueAction(){}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
$session = new SessionCiblage();
|
||||
//Chargement de la structure des champs et des préférences utilisateurs
|
||||
require_once 'Scores/Field.php';
|
||||
$fields = new Fields($user->username);
|
||||
$this->view->fields = $fields;
|
||||
$this->view->criteres = $session->getCriteres();
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->clearCiblage();
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$field = $this->getRequest()->getParam('name');
|
||||
$fields = $this->fields->getFields();
|
||||
$fields[$field]['activated'] = (($fields[$field]['activated'] == false)?true:false);
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefsModel = new Application_Model_Prefs($db);
|
||||
$data = array(
|
||||
'login' => $user->username,
|
||||
'json' => $this->fields->getNotActivated($fields),
|
||||
);
|
||||
|
||||
$prefsModel->select()->where('login = "?"', $user->username);
|
||||
$rows =$prefsModel->fetchRow();
|
||||
$rows = $rows->toArray();
|
||||
if (count($rows) > 0) {
|
||||
$prefsModel->update($data, 'login = "'.$user->unsername.'"');
|
||||
} else {
|
||||
$prefsModel->insert($data);
|
||||
}
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage des éléments de sélection avec leur valeurs
|
||||
*/
|
||||
public function criteresAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
if ( $request->isXmlHttpRequest() ) {
|
||||
$this->_helper->layout()->disableLayout();
|
||||
}
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
|
||||
//Nombre d'unités
|
||||
$total = $request->getParam('total');
|
||||
if ( $total !== null ) {
|
||||
$this->view->dataCount = number_format($total, 0, '', ' ');
|
||||
} else {
|
||||
//@todo : total quand aucune sélection
|
||||
$this->view->dataCount = number_format($sessionValue->getCountTotal(), 0, '', ' ');
|
||||
}
|
||||
|
||||
$insee = $request->getParam('insee');
|
||||
if ( $insee !== null ) {
|
||||
$this->view->dataInsee = number_format($insee, 0, '', ' ');
|
||||
} else {
|
||||
if ( $user->preferences['interface']['insee'] == 1 ) {
|
||||
$insee = number_format($sessionValue->getCountInsee(), 0, '', ' ');
|
||||
} else {
|
||||
$insee = null;
|
||||
}
|
||||
}
|
||||
|
||||
//Construction affichage des critères
|
||||
$infosCriteres = array();
|
||||
$allFields = $fields->getItems(true);
|
||||
foreach ( $allFields as $key => $params ) {
|
||||
$valueSelected = $sessionValue->getSelectedValue($key);
|
||||
if ( $valueSelected !== null ) {
|
||||
|
||||
$resultLabel = $sessionValue->resumeLabel($key);
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $params['label'],
|
||||
'in' => $resultLabel['in'],
|
||||
'ex' => $resultLabel['ex'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Zend_Registry::get('firebug')->info($infosCriteres);
|
||||
$this->view->infos = $infosCriteres;
|
||||
}
|
||||
|
||||
public function criterelistAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key');
|
||||
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
$values = $sessionValue->getSelectedValue($key);
|
||||
|
||||
$inLabels = array();
|
||||
if (count($values['in'])>0) {
|
||||
foreach ($values['in'] as $value) {
|
||||
$inLabels[$value] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$exLabels = array();
|
||||
if (count($values['ex'])>0) {
|
||||
foreach ($values['ex'] as $value) {
|
||||
$exLabels[$value] = $fields->labelValueDetail($key, $value);
|
||||
}
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info('LABEL');
|
||||
Zend_Registry::get('firebug')->info($inLabels);
|
||||
$this->view->critereName = $key;
|
||||
$this->view->inLabels = $inLabels;
|
||||
$this->view->exLabels = $exLabels;
|
||||
}
|
||||
|
||||
public function removeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$name = $request->getParam('critere');
|
||||
$valueIn = $request->getParam('in');
|
||||
$valueEx = $request->getParam('ex');
|
||||
|
||||
$sessionValue = new Scores_Ciblage_Session();
|
||||
|
||||
if ($valueIn !== null) {
|
||||
$sessionValue->unsetSelectedValue($name, $valueIn);
|
||||
} elseif ($valueEx !== null) {
|
||||
$sessionValue->unsetSelectedValue($name, $valueEx, true);
|
||||
} else {
|
||||
$sessionValue->unsetSelected($name);
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
$ciblage = new Scores_Ciblage_Engine($sessionValue->getSelectedValues(), $user->globalRNCS);
|
||||
$total = $ciblage->execute();
|
||||
$sessionValue->setCountTotal($total);
|
||||
if ($user->preferences['interface']['insee']==1) {
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
} else {
|
||||
$insee = null;
|
||||
}
|
||||
$sessionValue->setCountInsee($insee);
|
||||
$sessionValue->setCritereSession();
|
||||
|
||||
$this->redirect('/');
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
class PreferencesController extends Zend_Controller_Action
|
||||
{
|
||||
public function saveAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$fields = $this->getRequest()->getParam('fields');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefsModel = new Application_Model_Prefs($db);
|
||||
$data = array(
|
||||
'login' => $user->username,
|
||||
'json' => json_encode($this->getNotActivated(json_decode($fields))),
|
||||
);
|
||||
$sql = $prefsModel->select()->where('login = ?', $user->username);
|
||||
$rows = $prefsModel->fetchAll($sql);
|
||||
if (count($rows)>0) {
|
||||
$prefsModel->update($data, 'login = '.$user->unsername);
|
||||
} else {
|
||||
$prefsModel->insert($data);
|
||||
}
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
public function getNotActivated($fields)
|
||||
{
|
||||
foreach($fields as $name => $field)
|
||||
{
|
||||
if(!$field['activated']) {
|
||||
$desactivated[] = array($name => "");
|
||||
}
|
||||
}
|
||||
return ($desactivated);
|
||||
}
|
||||
|
||||
/**
|
||||
* Place un marqueur d'activation du mode de personnalisation dans la session Utilisateur
|
||||
* On retourne ensuite dans index/index pour permettre le choix des préférences d'affichage
|
||||
*/
|
||||
public function activeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
//@todo : Vérifier que l'utilisateur à le droit de customiser
|
||||
$user->customisation = true;
|
||||
$auth->getStorage()->write($user);
|
||||
$this->_redirect('./');
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class PrefsController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$prefs = new Application_Model_Prefs($db);
|
||||
$sql = $prefs->select()->where('login = ?', $user->username);
|
||||
|
||||
$this->view->entries = $prefs->fetchAll($sql);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php
|
||||
class RechercheController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function nafAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function geographiqueAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter description here ...
|
||||
*/
|
||||
public function juridiqueAction()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
38
application/controllers/UploadController.php
Normal file
38
application/controllers/UploadController.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
Class UploadController extends Zend_Controller_Action
|
||||
{
|
||||
protected $path;
|
||||
protected $extensions;
|
||||
|
||||
public function upload()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
if(!empty($_FILES) and count($_FILES) == 1)
|
||||
{
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
$extension = strrchr($_FILES['fichier']['name'], '.');
|
||||
if(in_array($extension, $this->extensions)) {
|
||||
if (move_uploaded_file($tmp_name, $path.'/'.$tmp_name.'.'.$extension))
|
||||
return ($tmp_name);
|
||||
}
|
||||
}
|
||||
return (false);
|
||||
}
|
||||
|
||||
public function arborescanceAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
$url = implode('/', $this->getRequest()->getParams());
|
||||
echo $url;
|
||||
//$file = $this->upload();
|
||||
/*if($file)
|
||||
{
|
||||
$csv = fgetcsv($file);
|
||||
$csv = str_replace(';', ',', $csv);
|
||||
echo $csv;
|
||||
}*/
|
||||
}
|
||||
}
|
@ -1,91 +1,84 @@
|
||||
<?php
|
||||
class UserController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
require_once 'Forms/Login.php';
|
||||
require_once 'Scores/WebAuthAdapter.php';
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de l'authentification
|
||||
*/
|
||||
public function loginAction()
|
||||
{
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new 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 WebAuthAdapter($login, md5($login.'|'.$pass));
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()){
|
||||
$this->view->message = '';
|
||||
Zend_Registry::get('firebug')->info($result);
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
} else {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
$url = '';
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
if (isset($session->url)) {
|
||||
$url = $session->url;
|
||||
}
|
||||
}
|
||||
if (!empty($url) && $url!='/user/login' && $url!='/localauth'){
|
||||
$this->_redirect($url);
|
||||
}
|
||||
$this->_redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->render('login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de la déconnexion
|
||||
* Gestion de l'authentification
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
//Suppression des critères de comptage en session
|
||||
require_once 'Scores/SessionCiblage.php';
|
||||
$session = new SessionCiblage();
|
||||
$session->clearCiblage();
|
||||
|
||||
//Suppression de l'identité
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$url = 'http://www.scores-decisions.com/';
|
||||
$refresh = 5;
|
||||
|
||||
if (APPLICATION_ENV != 'production'){
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
));
|
||||
}
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', '5; url='.$url);
|
||||
$this->render('logout');
|
||||
}
|
||||
}
|
||||
public function loginAction()
|
||||
{
|
||||
$this->view->headLink()->appendStylesheet('/themes/default/styles/signin.css', 'all');
|
||||
$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_Ws($login, md5($login.'|'.$pass));
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if ( $result->isValid() ) {
|
||||
$this->redirect('/');
|
||||
} else {
|
||||
$this->view->message = '';
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_helper->layout()->disableLayout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestion de la déconnexion
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$message = $request->getParam('message');
|
||||
$this->view->assign('message', $message);
|
||||
|
||||
$ajax = $request->getParam('ajax', 0);
|
||||
$this->view->assign('ajax', $ajax);
|
||||
|
||||
$refresh = 5;
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
), null, true);
|
||||
|
||||
$this->view->assign('url', $url);
|
||||
|
||||
if (!$ajax) {
|
||||
$this->view->assign('refresh', $refresh);
|
||||
$this->view->headMeta()->appendHttpEquiv('refresh', $refresh.'; url='.$url);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Changer la langue de l'utilisateur
|
||||
*/
|
||||
public function langAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$lang = $this->getRequest()->getParam('lang', null);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$identity = $auth->getIdentity();
|
||||
|
||||
$identity->langtmp = $lang;
|
||||
|
||||
$auth->getStorage()->write($identity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
BIN
application/languages/en.mo
Normal file
BIN
application/languages/en.mo
Normal file
Binary file not shown.
1908
application/languages/en.po
Normal file
1908
application/languages/en.po
Normal file
File diff suppressed because it is too large
Load Diff
BIN
application/languages/fr.mo
Normal file
BIN
application/languages/fr.mo
Normal file
Binary file not shown.
2341
application/languages/fr.po
Normal file
2341
application/languages/fr.po
Normal file
File diff suppressed because it is too large
Load Diff
27
application/languages/totranslate.php
Normal file
27
application/languages/totranslate.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
//Home
|
||||
$this->translate('Accueil');
|
||||
$this->translate('Préambule');
|
||||
$this->translate('Ajouter un profil');
|
||||
$this->translate('Désactiver');
|
||||
$this->translate('Ajouter un login avec le profil du client');
|
||||
$this->translate('Type d\'établissement');
|
||||
$this->translate('Sièges');
|
||||
$this->translate('Oui');
|
||||
$this->translate('Non');
|
||||
$this->translate('au');
|
||||
$this->translate('Appartient à un groupe');
|
||||
$this->translate('Téléphone renseigné');
|
||||
$this->translate('Télécopie renseignée');
|
||||
$this->translate('Site Web renseigné');
|
||||
$this->translate('Email de contact renseigné');
|
||||
$this->translate('Etablissement présent au RNCS');
|
||||
$this->translate('Adresse de domiciliation');
|
||||
$this->translate('Nom du principal dirigeant présent');
|
||||
$this->translate('Date de création de l\'établissement');
|
||||
$this->translate('Présence de participations');
|
||||
$this->translate('Valider');
|
||||
$this->translate('Réinitialiser les critères entreprises');
|
||||
$this->translate('à');
|
||||
$this->translate('Scores & Décisions SAS');
|
||||
?>
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Codepostaux extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'codepostaux';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Comptages extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'comptages';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Criteres extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'criteres';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Departements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'departements';
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Formejuridique extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'formejuridique';
|
||||
protected $_primary = 'fjCode';
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Naf extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'naf';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Prefs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'prefs';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_ProfilExtraction extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'profilExtraction';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_RefExport extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'refexport';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Regions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'regions';
|
||||
}
|
||||
|
14
application/views/default/helpers/DataDate.php
Normal file
14
application/views/default/helpers/DataDate.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
class Zend_View_Helper_DataDate extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function dataDate()
|
||||
{
|
||||
if ( $this->view->DataDate ) {
|
||||
$date = new Zend_Date($this->view->DataDate, 'yyyy-MM-dd');
|
||||
return $date->toString('dd/MM/yyyy');
|
||||
}
|
||||
|
||||
return '...';
|
||||
}
|
||||
}
|
@ -1,202 +1,19 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function Field($name, $field)
|
||||
class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function Field($name)
|
||||
{
|
||||
$html = '';
|
||||
if($field != null) {
|
||||
$html.= '<div class="fieldgrp">';
|
||||
$type = $field['type'];
|
||||
switch($type)
|
||||
{
|
||||
case 'select':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->selectHTML($name, $field));
|
||||
break;
|
||||
case 'selectMultiple':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->selectMultipleHTML($name, $field));
|
||||
break;
|
||||
case 'intervalSelect':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->intervalSelectHTML($name, $field));
|
||||
break;
|
||||
case 'interval':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->intervalHTML($name, $field));
|
||||
break;
|
||||
case 'date':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->dateHTML($name, $field));
|
||||
break;
|
||||
case 'text':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->textHTML($name, $field));
|
||||
break;
|
||||
case 'textarea':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->textareaHTML($name, $field));
|
||||
break;
|
||||
case 'radio':
|
||||
$html.= $this->structureHTML(
|
||||
$field['label'],
|
||||
$this->radioHTML($name, $field));
|
||||
break;
|
||||
}
|
||||
$html.= '</div>';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function structureHTML($label, $html, $liens = array())
|
||||
{
|
||||
$out = '';
|
||||
$out.= $this->structureLabel($label);
|
||||
$out.= '<div class="field">'.$html.$this->structureLink($liens).'</div>';
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Définition du label
|
||||
* @param unknown_type $label
|
||||
*/
|
||||
private function structureLabel($label)
|
||||
{
|
||||
return '<label>'.$label.'</label>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Définition des liens
|
||||
*/
|
||||
private function structureLink($liens = array())
|
||||
{
|
||||
$html = '';
|
||||
if (count($liens)>0) {
|
||||
foreach($liens as $lien){
|
||||
$html.= '<a href="'.$lien['url'].'">'.$lien['lib'].'</a>';
|
||||
}
|
||||
}
|
||||
if (!empty($html)) {
|
||||
return '<span>'.$html.'</span>';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
private function intervalSelectHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<select class="intervalSelect" name="'.$name.'1" id="'.$name.'" number="1">';
|
||||
foreach($field['fields'][$field['type']]['value'] as $elements) {
|
||||
$return .= '<option value="'. $elements[0].'">'.number_format($elements[0], 0,'', ' ').'</option>';
|
||||
}
|
||||
|
||||
$return .= '</select> à ';
|
||||
$return .= '<select class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
|
||||
foreach($field['fields'][$field['type']]['value'] as $elements) {
|
||||
$return .= '<option value="'. $elements[1].'">'.number_format($elements[1], 0,'', ' ').'</option>';
|
||||
}
|
||||
|
||||
$return .= '</select>';
|
||||
$return .= ' <span id="'.$name.'"><a href="" class="intervalSelect" id="'.$name.'">Valider</a></span>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Select */
|
||||
private function selectMultipleHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($session->getCritere($name) != null) and $session->getCritere($name) == $value)
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Select Multiple */
|
||||
private function selectHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
if(is_array($sessionValeur))
|
||||
$sessionValeur = implode(',', $sessionValeur);
|
||||
$return = '<select class="criteres '.$field['type']['class'].'" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($sessionValeur != null) and $sessionValeur == $value)
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Interval */
|
||||
private function intervalHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
$valeur = $session->getCritere($name);
|
||||
|
||||
$return = '<div class="interval" >';
|
||||
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'1" value="'.$valeur[0].'" /> à ';
|
||||
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'2" value="'.$valeur[1].'" />';
|
||||
$return .= ' <a href="" class="interval" id="'.$name.'">Valider</a>';
|
||||
$return .= '</div>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Dates */
|
||||
private function dateHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<div class="date" >';
|
||||
$return .= '<input value="'.$session->getCritere($name).'" type="text" class="datepicker" name="'.$name.'1" /> a ';
|
||||
$return .= '<input type="text" class="datepicker" name="'.$name.'2" />';
|
||||
$return .= '</div>';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Textes */
|
||||
private function textHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$session->getCritere($name).'" />';
|
||||
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Textarea */
|
||||
private function textareaHTML($name, $field)
|
||||
{
|
||||
$return = '<a class="arborescence" title="'.$field['title'].'" href="'.$this->view->url(array('controller' => 'arborescence', 'action' => $field['action'], 'key' => $name)).'">
|
||||
Selection dans une arborescence
|
||||
</a>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Radios */
|
||||
private function radioHTML($name, $field, $item)
|
||||
{
|
||||
$return = '<input type="radio" name="'.$name.'" />';
|
||||
return ($return);
|
||||
$fields = new Scores_Ciblage_FieldList();
|
||||
|
||||
$sessionValue = new Scores_Ciblage_Session($fields);
|
||||
|
||||
$valueSelected = $sessionValue->getSelectedValue($name);
|
||||
$html = $fields->getItemHtml($name, $valueSelected);
|
||||
|
||||
if ($html) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
return "<div>Impossible d'afficher ".$name."</div>";
|
||||
}
|
||||
}
|
17
application/views/default/helpers/ProfileLink.php
Normal file
17
application/views/default/helpers/ProfileLink.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function profileLink()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->username;
|
||||
$logoutUrl = $this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'logout'
|
||||
), null, true);
|
||||
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
Class Zend_View_Helper_Radio extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function Radio($name, $libelle)
|
||||
{
|
||||
$champ = '<div>';
|
||||
$champ .= '<div style="float:left;text-align:left;">
|
||||
<label>'.$libelle.'</label>
|
||||
</div>';
|
||||
$champ .= '<div style="text-align:right;">
|
||||
<input type="radio" name="'.$name.'" value="" />
|
||||
<input type="radio" name="'.$name.'" value="0" />
|
||||
<input type="radio" name="'.$name.'" value="1" />
|
||||
</div>';
|
||||
$champ .= '<div>
|
||||
<hr />
|
||||
</div>';
|
||||
$champ .= '</div>';
|
||||
|
||||
return ($champ);
|
||||
}
|
||||
}
|
12
application/views/default/scripts/aide/apropos.phtml
Normal file
12
application/views/default/scripts/aide/apropos.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<h2>A propos de</h2>
|
||||
|
||||
<p>ODEA vous permet d'extraire des informations sur toutes les entreprises françaises actives.</p>
|
||||
|
||||
<p>Pour une demande commercial vous pouvez contacter <a href="mailto:contact@scores-decisions.com">contact@scores-decisions.com</a>.</p>
|
||||
|
||||
<p>Pour une demande concernant votre contrat ou l'utilisation, vous pouvez prendre contact avec
|
||||
<a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>, en rappelant vos références.</p>
|
||||
|
||||
</div>
|
@ -1 +1,54 @@
|
||||
<?php
|
||||
<div class="container-fluid">
|
||||
<div id="help">
|
||||
<h2>Préambule</h2>
|
||||
<p>
|
||||
L'application se décompose en deux parties : <br/>
|
||||
- La partie ciblage<br/>
|
||||
|
||||
<br/><br/>
|
||||
- La partie enrichissement<br/>
|
||||
|
||||
<br/>
|
||||
</p>
|
||||
|
||||
<h2>Description de l'interface</h2>
|
||||
<p>
|
||||
Menu
|
||||
|
||||
Résumé des critères
|
||||
|
||||
</p>
|
||||
<br/>
|
||||
|
||||
|
||||
<h2>Fonctionnement des champs</h2>
|
||||
|
||||
<ul>
|
||||
<li>Champs de sélection simple
|
||||
image
|
||||
<p>Plusieurs choix sont proposés, une seul sélection possible ,à chaque changement le
|
||||
ciblage est actualisé</p>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
Champs de sélection multiple
|
||||
<p>Plusieurs choix et sélection multiple, maintenir la touche CTRL lors de chaque selection pour des
|
||||
critères multiples. Utiliser les liens "Sélectionner" pour inclure les filtres ou "Exclure".
|
||||
</p>
|
||||
</li>
|
||||
|
||||
<li>Arborescence
|
||||
<p>Les arborescences propose</p>
|
||||
</li>
|
||||
|
||||
<li>Intervalle
|
||||
<p>Les intervalles prédéfinies avec des valeurs,</p>
|
||||
<p>Les intervalles à remplir, permette de définir une tranche, seul le minimum ou le maximum peuvent
|
||||
être inscrit, les valeurs extrêmes sont automatiquement définies .</p>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
10
application/views/default/scripts/aide/message.phtml
Normal file
10
application/views/default/scripts/aide/message.phtml
Normal file
@ -0,0 +1,10 @@
|
||||
<div class="container-fluid">
|
||||
<div id="help">
|
||||
<?php if ($this->typeMsg == 'support') {?>
|
||||
Les paramètres de votre compte n'ont pas été définis. <br/>Veuillez contacter le <a href="mailto:support@scores-decisions.com">support</a>.
|
||||
<br/>Par mail : <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
|
||||
<br/>Par téléphone : 00 00 00 00 00
|
||||
<br/>Ou contactez votre commercial.
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
@ -1,16 +1,16 @@
|
||||
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
|
||||
<script>
|
||||
$("#<?=$this->key?>").jstree({
|
||||
$("div#<?=$this->key?>").jstree({
|
||||
"themes" : {
|
||||
"theme" : "default",
|
||||
"url" : "/themes/jstree/default/style.css",
|
||||
"url" : "/libs/tree/themes/classic/style.css",
|
||||
"dots" : true,
|
||||
"icons" : false,
|
||||
"icons" : false,
|
||||
},
|
||||
"plugins" : ["themes", "json_data", "checkbox"],
|
||||
"json_data" : {
|
||||
"data" : <?=$this->regions?>,
|
||||
"ajax" : {
|
||||
"json_data" : {
|
||||
"data" : <?=$this->regions?>,
|
||||
"ajax" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'geographiqueajax', 'key'=> $this->key))?>',
|
||||
"data" : function(n) { return { id: n.attr ? n.attr("id") : '' , niveau : n.attr ? n.attr("niveau") : 1 }; },
|
||||
"cache" : true,
|
||||
|
@ -0,0 +1,4 @@
|
||||
<br /><br />
|
||||
<div id="view-content">
|
||||
<p>View script for controller <b>Arborescence</b> and script/action name <b>index</b></p>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
|
||||
<script>
|
||||
$("div#<?=$this->key?>").jstree({
|
||||
"themes" : {
|
||||
"theme" : "default",
|
||||
"url" : "/libs/tree/themes/classic/style.css",
|
||||
"dots" : true,
|
||||
"icons" : false,
|
||||
},
|
||||
"plugins" : ["themes", "json_data", "checkbox"],
|
||||
"json_data" : {
|
||||
"data" : <?=$this->formejuridiques?>,
|
||||
"ajax" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'juridiqueajax', 'key'=> $this->key))?>',
|
||||
"data" : function(n)
|
||||
{
|
||||
return { id: n.attr ? n.attr("id") : 0 };
|
||||
},
|
||||
"cache" : true,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -1,16 +1,16 @@
|
||||
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
|
||||
<script>
|
||||
$("#<?=$this->key?>").jstree({
|
||||
$("div#<?=$this->key?>").jstree({
|
||||
"themes" : {
|
||||
"theme" : "default",
|
||||
"url" : "/themes/jstree/default/style.css",
|
||||
"url" : "/libs/tree/themes/classic/style.css",
|
||||
"dots" : true,
|
||||
"icons" : false,
|
||||
"icons" : false,
|
||||
},
|
||||
"plugins" : ["themes", "json_data", "checkbox"],
|
||||
"json_data" : {
|
||||
"data" : <?=$this->naf?>,
|
||||
"ajax" : {
|
||||
"json_data" : {
|
||||
"data" : <?=$this->naf?>,
|
||||
"ajax" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'nafajax', 'key'=> $this->key))?>',
|
||||
"data" : function(n) { return { parent: n.attr ? n.attr("id") : '' , niveau : n.attr ? n.attr("niveau") : 1 }; },
|
||||
"cache" : true,
|
||||
|
1
application/views/default/scripts/comptage/index.phtml
Normal file
1
application/views/default/scripts/comptage/index.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?=json_encode($this->result)?>
|
@ -0,0 +1,27 @@
|
||||
<style>
|
||||
.color{ background-color: #DCE3FC; }
|
||||
</style>
|
||||
<div style="width:100%;">
|
||||
<table width="100%" style="font-size:10px;">
|
||||
<tr>
|
||||
<?php foreach($this->label as $label): ?>
|
||||
<th style="border-left:1px solid black;padding:2px;"><b><?=$label?></b></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php
|
||||
$i=0;
|
||||
if(count($this->liste) > 0) {
|
||||
foreach($this->liste as $line) {
|
||||
echo '<tr '.((($i%2) == 0)?'class="color"':'').'>';
|
||||
foreach($line as $col) {
|
||||
echo '<td style="border-left:1px solid silver;padding:2px">'.$col.'</td>';
|
||||
}
|
||||
echo '</tr>';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
echo '<tr><td>Vous n\'avez selectionné aucuns critères</td></tr>';
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div>
|
@ -1,37 +1,63 @@
|
||||
<?php if ($this->noSelection): ?>
|
||||
Vous n'avez pas sélectionné de critères !
|
||||
<?php else:?>
|
||||
<?php if ($this->typeMsg) {?>
|
||||
|
||||
<div id="help">
|
||||
<?php if ($this->typeMsg == 'support') {?>
|
||||
Les paramètres de votre compte n'ont pas été définis. <br/>Veuillez contacter le <a href="mailto:support@scores-decisions.com">support</a>.
|
||||
<br/>Par mail : <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
|
||||
<br/>Ou prendre contact avec votre commercial.
|
||||
<?php } elseif ($this->typeMsg == 'contrat') {?>
|
||||
Votre contrat est arrivé à expiration. <br/>Veuillez contacter le <a href="mailto:support@scores-decisions.com">support</a>.
|
||||
<br/>Par mail : <a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
|
||||
<br/>Ou prendre contact avec votre commercial.
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<?php } elseif ($this->noSelection) { ?>
|
||||
Vous n'avez pas sélectionné de critères !
|
||||
<?php } else {?>
|
||||
<style>
|
||||
span.message {
|
||||
font-size:0.7em;
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
||||
<div id="result">
|
||||
<form method="post" id="save" name="save" action="<?=$this->url(array('controller'=>'comptage', 'action'=>'save'))?>">
|
||||
<label>Votre référence</label>
|
||||
<input type="text" name="ref" value="" />
|
||||
<input type="submit" name="submit" value="Enregistrer">
|
||||
<label>Votre référence : </label><input type="text" name="ref" value="<?=$this->reference?>" />
|
||||
</form>
|
||||
<span class="message" style="color:#ff0000;"></span>
|
||||
<br/>
|
||||
<span class="message">
|
||||
La saisie d'une référence vous permettra de suivre vos ciblages et vos commandes.<br/>
|
||||
Les accents et les carractères spéciaux, seront remplacés automatiquement.<br/>
|
||||
Les espaces seront remplacés par "_"
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
|
||||
<script type="text/javascript" src="/libs/form/jquery.form.js"></script>
|
||||
<script>
|
||||
$('form#save').bind('submit', function(){
|
||||
var options = {
|
||||
target: '#result',
|
||||
dataType: 'json',
|
||||
beforeSubmit: function(){},
|
||||
success: function(data){
|
||||
if (data.error == 0){
|
||||
$('#result').html(data.msg);
|
||||
} else {
|
||||
$('#result span.message').html(data.msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
$(this).ajaxSubmit(options);
|
||||
return false;
|
||||
});
|
||||
$('#dialog').dialog({
|
||||
buttons: [ {
|
||||
text: "Enregistrer",
|
||||
click: function() {
|
||||
var options = {
|
||||
target: '#result',
|
||||
dataType: 'json',
|
||||
beforeSubmit: function(){
|
||||
$('#result').html('Enregistrement...');
|
||||
},
|
||||
success: function(data){
|
||||
if (data.error == 0) {
|
||||
$('#result').html(data.msg);
|
||||
$(location).attr('href',data.href);
|
||||
} else {
|
||||
$('#result span.message').html(data.msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
$('form#save').ajaxSubmit(options);
|
||||
}
|
||||
},
|
||||
{ text: "Annuler", click: function() { $(this).dialog("close"); } }
|
||||
] });
|
||||
</script>
|
||||
|
||||
<?php endif;?>
|
||||
<pre>
|
||||
<?php print_r($this->criteres)?>
|
||||
</pre>
|
||||
<?php }?>
|
1
application/views/default/scripts/comptage/update.phtml
Normal file
1
application/views/default/scripts/comptage/update.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?=json_encode($this->result)?>
|
@ -1,20 +0,0 @@
|
||||
<div id="economique">
|
||||
<div style="display:none" class="error">
|
||||
<div>Erreur :</div>
|
||||
</div>
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('capital', $this->fields->get('capital'));?></li>
|
||||
<li><?php echo $this->Field('ape_etab', $this->fields->get('ape_etab'));?></li>
|
||||
<li><?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'));?></li>
|
||||
<li><?php echo $this->Field('age_entrep', $this->fields->get('age_entrep'));?></li>
|
||||
<li><?php echo $this->Field('age_etab', $this->fields->get('age_etab'));?></li>
|
||||
<li><?php echo $this->Field('teff_entrep', $this->fields->get('teff_entrep'));?></li>
|
||||
<li><?php echo $this->Field('teff_etab', $this->fields->get('teff_etab'));?></li>
|
||||
<li><?php echo $this->Field('eff_entrep', $this->fields->get('eff_entrep'));?></li>
|
||||
<li><?php echo $this->Field('eff_etab', $this->fields->get('eff_etab'));?></li>
|
||||
<li><?php echo $this->Field('nbEtab', $this->fields->get('nbEtab'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a href="">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
@ -1,21 +0,0 @@
|
||||
<div id="entreprise">
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('siege', $this->fields->get('siege'));?></li>
|
||||
<li><?php echo $this->Field('sirenGrp', $this->fields->get('sirenGrp'));?></li>
|
||||
<li><?php echo $this->Field('tel', $this->fields->get('tel'));?></li>
|
||||
<li><?php echo $this->Field('fax', $this->fields->get('fax'));?></li>
|
||||
<li><?php echo $this->Field('web', $this->fields->get('web'));?></li>
|
||||
<li><?php echo $this->Field('mail', $this->fields->get('mail'));?></li>
|
||||
<li><?php echo $this->Field('presentRcs', $this->fields->get('presentRcs'));?></li>
|
||||
<li><?php echo $this->Field('adrDom', $this->fields->get('adrDom'));?></li>
|
||||
<li><?php echo $this->Field('dirNom', $this->fields->get('dirNom'));?></li>
|
||||
<li><?php echo $this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
|
||||
<li><?php echo $this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
|
||||
<li><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
|
||||
<li><?php echo $this->Field('nbActio', $this->fields->get('nbActio'));?></li>
|
||||
<li><?php echo $this->Field('nbPart', $this->fields->get('nbPart'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="link">
|
||||
<a href="">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
@ -1,24 +0,0 @@
|
||||
<div id="financiere">
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('bilType', $this->fields->get('bilType'));?></li>
|
||||
<li><?php echo $this->Field('avisCs', $this->fields->get('avisCs'));?></li>
|
||||
<li><?php echo $this->Field('bilAnnee', $this->fields->get('bilAnnee'));?></li>
|
||||
<li><?php echo $this->Field('bilCloture', $this->fields->get('bilCloture'));?></li>
|
||||
<li><?php echo $this->Field('bilDuree', $this->fields->get('bilDuree'));?></li>
|
||||
<li><?php echo $this->Field('bilTca', $this->fields->get('bilTca'));?></li>
|
||||
<li><?php echo $this->Field('bilEE', $this->fields->get('bilEE'));?></li>
|
||||
<li><?php echo $this->Field('bilFL', $this->fields->get('bilFL'));?></li>
|
||||
<li><?php echo $this->Field('bilFK', $this->fields->get('bilFK'));?></li>
|
||||
<li><?php echo $this->Field('bilFR', $this->fields->get('bilFR'));?></li>
|
||||
<li><?php echo $this->Field('bilGF', $this->fields->get('bilGF'));?></li>
|
||||
<li><?php echo $this->Field('bilGP', $this->fields->get('bilGP'));?></li>
|
||||
<li><?php echo $this->Field('bilGW', $this->fields->get('bilGW'));?></li>
|
||||
<li><?php echo $this->Field('bilHD', $this->fields->get('bilHD'));?></li>
|
||||
<li><?php echo $this->Field('bilHH', $this->fields->get('bilHH'));?></li>
|
||||
<li><?php echo $this->Field('bilHL', $this->fields->get('bilHL'));?></li>
|
||||
<li><?php echo $this->Field('bilHM', $this->fields->get('bilHM'));?></li>
|
||||
<li><?php echo $this->Field('bilHN', $this->fields->get('bilHN'));?></li>
|
||||
<li><?php echo $this->Field('bilYP', $this->fields->get('bilYP'));?></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
@ -1,9 +0,0 @@
|
||||
<div id="geographique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('adr_cp', $this->fields->get('adr_cp'));?></li>
|
||||
<li><?php echo $this->Field('adr_com', $this->fields->get('adr_com'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a href="">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
@ -1,12 +0,0 @@
|
||||
<div id="juridique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?php echo $this->Field('cj', $this->fields->get('cj'));?></li>
|
||||
<li><?php echo $this->Field('actifEco', $this->fields->get('actifEco'));?></li>
|
||||
<li><?php echo $this->Field('procolHisto', $this->fields->get('procolHisto'));?></li>
|
||||
<li><?php echo $this->Field('tvaIntraValide', $this->fields->get('tvaIntraValide'));?></li>
|
||||
<li><?php echo $this->Field('dateImmat', $this->fields->get('dateImmat'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a href="">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
113
application/views/default/scripts/dashboard/ciblage.phtml
Normal file
113
application/views/default/scripts/dashboard/ciblage.phtml
Normal file
@ -0,0 +1,113 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="btn-group" style="margin-bottom:10px;">
|
||||
<a type="button" class="btn btn-default update" href="<?=$this->url(array('controller'=> 'comptage',
|
||||
'action'=>'update', 'id'=>$this->comptageId))?>">Actualiser le ciblage</a>
|
||||
<a type="button" class="btn btn-default enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement',
|
||||
'action'=>'reference', 'id'=>$this->comptageId))?>">Commander un enrichissement</a>
|
||||
<a type="button" class="btn btn-default" href="<?=$this->url(array('controller'=> 'index','action'=>'index',
|
||||
'id'=>$this->comptageId))?>">Charger les critères de ciblage dans l'interface</a>
|
||||
</div>
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title">Critères</h3></div>
|
||||
<table class="table table-bordered table-condensed">
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<tr class="active">
|
||||
<td colspan="2"><strong><?=$criteres['label']?></strong></td>
|
||||
</tr>
|
||||
<?php if ( is_string($criteres['in']) ) {?>
|
||||
<tr>
|
||||
<td><?=$criteres['in']?></td>
|
||||
<td>Calcul intermédiaire</td>
|
||||
</tr>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<tr>
|
||||
<td><?=$item?><span class="label label-success pull-right">inclus</span></td>
|
||||
<td>Calcul intermédiaire</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<tr>
|
||||
<td><?=$item?><span class="label label-danger pull-right">exclus</span></td>
|
||||
<td>Calcul intermédiaire</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title">Comptages</h3></div>
|
||||
<table class="comptage table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Résultat</th>
|
||||
<th>Nombre d'unité Insee</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $comptage) {?>
|
||||
<tr>
|
||||
<td><?=substr($comptage['dateAjout'],8,2).'/'.substr($comptage['dateAjout'],5,2).'/'.substr($comptage['dateAjout'],0,4)
|
||||
.' '.substr($comptage['dateAjout'],11,2).':'.substr($comptage['dateAjout'],14,2).':'.substr($comptage['dateAjout'],17,2)?></td>
|
||||
<td><?=number_format($comptage['resultat'], 0, '', ' ')?></td>
|
||||
<td><?=number_format($comptage['uniteInsee'], 0, '', ' ')?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading"><h3 class="panel-title">Enrichissements</h3></div>
|
||||
<?php if ( count($this->enrichissements) > 0 ) {?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Reférence</th>
|
||||
<th>Nombre de lignes</th>
|
||||
<th>Fichier</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->enrichissements as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></td>
|
||||
<td>
|
||||
<?php if($item['dateStart']>0) { ?>
|
||||
<a href="/enrichissement/download/id/<?=$item['id']?>"><?=$item['fichier']?></a>
|
||||
<?php } else { ?>
|
||||
En attente de traitement
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else {?>
|
||||
<div class="panel-body">
|
||||
<a type="button" class="btn btn-primary enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement',
|
||||
'action'=>'reference', 'id'=>$this->comptageId))?>">Commander un enrichissement</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
@ -1,45 +0,0 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Détail du ciblage
|
||||
</div>
|
||||
|
||||
|
||||
<?php if (empty($this->criteres)){?>
|
||||
|
||||
<p>Aucun ciblage n'a été trouvé avec ces paramètres.</p>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<h1>Ciblage <?=$this->criteres['reference']?> (<?=$this->criteres['dateAjout']?>)</h1>
|
||||
|
||||
<h2>Critères</h2>
|
||||
<pre>
|
||||
<?=print_r(json_decode($this->criteres['criteres'], true))?>
|
||||
</pre>
|
||||
|
||||
<h2>Comptages</h2>
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Resultat</th>
|
||||
<th>Nombre d'unité Insee</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $comptage):?>
|
||||
<tr>
|
||||
<th><?=$comptage['dateAjout']?></th>
|
||||
<th><?=number_format($comptage['resultat'], 0, '', ' ')?></th>
|
||||
<th><?=number_format($comptage['uniteInsee'], 0, '', ' ')?></th>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php }?>
|
||||
|
||||
</div>
|
@ -1,47 +1,45 @@
|
||||
<div id="dashboard">
|
||||
<div id="dashboard" class="container-fluid">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Liste de vos ciblages
|
||||
</div>
|
||||
|
||||
<div style="margin:5px 0;">
|
||||
<h2>Liste de vos ciblages</h2>
|
||||
|
||||
<?php if(count($this->ciblages)>0):?>
|
||||
<?php if(count($this->ciblages)>0) {?>
|
||||
|
||||
<table class="ciblage">
|
||||
<table class="ciblage table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre d'entité</th>
|
||||
<th>Unité Insee</th>
|
||||
<th>Date</th>
|
||||
<th>Action</th>
|
||||
<th colspan="4"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->ciblages as $item):?>
|
||||
<?php foreach($this->ciblages as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateComptage']?></td>
|
||||
<td>
|
||||
[<a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblagedetail', 'id'=>$item['id']))?>">Détails</a>] -
|
||||
[<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a>] -
|
||||
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a>] -
|
||||
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a>]
|
||||
</td>
|
||||
<td class="reference"><?=$item['reference']?></td>
|
||||
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td class="update insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td class="update date"><?=$item['dateComptage']?></td>
|
||||
<td><a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
|
||||
<td><a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Charger les critères de ciblage dans l'interface</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php else:?>
|
||||
<?php if (count($this->page)>1) {?>
|
||||
<div class="btn-group">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages', 'page'=>1), null, true)?>" class="btn btn-default">«</a>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages', 'page'=>$this->page-1), null, true)?>" class="btn btn-default">‹</a>
|
||||
<button type="button" class="btn btn-default"><?=$this->page?> / <?=$this->nbPages?></button>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages', 'page'=>$this->page+1), null, true)?>" class="btn btn-default">›</a>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages', 'page'=>$this->nbPages), null, true)?>" class="btn btn-default">»</a>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php } else {?>
|
||||
<p>Aucun ciblage.<p>
|
||||
<?php endif;?>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -1,47 +1,85 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Préférences
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Paramètres de votre compte</div>
|
||||
<div class="panel-body">
|
||||
<p>Service ouvert du <?=$this->dateBegin?> au <?=$this->dateEnd?></p>
|
||||
<p><?=$this->tarifText?></p>
|
||||
<p>Licence INSEE :<?php if ($this->licenceINSEE) {?> Non comptabilisé (déjà licencié)<?php } else {?> Paiement à chaque extraction.<?php }?></p>
|
||||
<p>Filtre RNCS :<?php if ($this->filterRNCS) {?> Filtrer au seul paramètre RNCS.<?php } else {?> Aucun filtre.<?php }?></p>
|
||||
<p>Extraction de fichier : <?php if ($this->immediatExtract) {?>Immédiat<?php } else { ?>Différé<?php }?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Gestion des profils d'enrichissement</h2>
|
||||
<p>
|
||||
Afin de vous permettre un enrichissement de données à partir d'une liste de SIREN/SIRET,
|
||||
Suivant la configuration de votre compte, vous avez la possibilité de sélectionner les données
|
||||
disponible.
|
||||
</p>
|
||||
<br/>
|
||||
|
||||
<p>Cas profil défini pas S&D</p>
|
||||
<p>- Aucun profil d'enrichissement (Contacter le support)</p>
|
||||
<p>- Liste des profils avec référence, tarifs à la ligne</p>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Préférences d'affichage</div>
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
|
||||
utilisation correspondant à vos besoins.
|
||||
</p>
|
||||
<p>
|
||||
Afin de choisir les critères à masquer :
|
||||
<a href="#" title="Activer le mode personnalisation afin de créer/modifier les préférences d'affichage">
|
||||
Activer le mode personnalisation
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>Si droits création profil d'enrichissement</p>
|
||||
<p>- Aucun profil d'enrichissement (Sans profil d'enrichissement, vous ne pourrez pas extraire de données)</p>
|
||||
<p>- Liste des profils avec référence, tarifs à la ligne</p>
|
||||
<p> - Créer un profil d'enrichissement (avoir donc un tarifs à la colonne, pour créer le tarif à la ligne)</p>
|
||||
<div>
|
||||
<label>Filtrer au seul périmètre RNCS </label><br/>
|
||||
<span>Les éléments soumis à redevance INSEE sont automatiquement retirer du ciblage</span><br/>
|
||||
<?php if ($this->filterRNCS==1) {?>
|
||||
<i>Votre compte est paramétré pour ne sélectionner que les entités provenant du RNCS</i>
|
||||
<?php } else {?>
|
||||
<input type="checkbox" name="rncs" value="1" <?php if ($this->prefFilterRncs==1) echo ' checked="checked"';?>
|
||||
<?php if ($this->filterRNCS==1) echo ' disabled="disable"';?> />
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<p>Lister les colonnes disponibles (Association SQL/Libellé) pour la configuration<p>
|
||||
<div>
|
||||
<label>Afficher le nombre d'unité INSEE</label><br/>
|
||||
<?php if ($this->filterRNCS==1) {?>
|
||||
<i>Votre compte est paramétré pour ne sélectionner que les entités provenant du RNCS</i>
|
||||
<?php } else {?>
|
||||
<span><i>Pour permettre une estimation du cout de la redevance INSEE, en activant cette option,
|
||||
le nombre d'unité insee est affiché à chaque comptage</i></span><br/>
|
||||
<input type="checkbox" name="insee" value="1" <?php if ($this->prefInterfaceInsee==1) echo ' checked="checked"';?>
|
||||
<?php if ($this->filterRNCS==1) echo ' disabled="disable"';?>/>
|
||||
<?php }?>
|
||||
</div>
|
||||
<script>
|
||||
$('input[type=checkbox]').click(function(){
|
||||
if($(this).is(':checked')) {
|
||||
$.post('/dashboard/pref/'+$(this).attr('name')+'/1' , function(data, status) {});
|
||||
} else {
|
||||
$.post('/dashboard/pref/'+$(this).attr('name')+'/0' , function(data, status) {});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Gestion des préférences d'affichage</h2>
|
||||
<p>
|
||||
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
|
||||
utilisation correspondant à vos besoins.
|
||||
</p>
|
||||
<br/>
|
||||
<p>Vous n'avez pas les droits nécessaires pour créer/modifier les préférences d'affichage.</p>
|
||||
<p>Des préférences d'affichage ont été définies pour votre profil client.</p>
|
||||
<br/>
|
||||
<p>Aucune préférences d'affichage définies pour votre profil utilisateur.</p>
|
||||
<p>Des préférences d'affichage ont été définies pour votre profil utilisateur.</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="<?=$this->url(array('controller'=>'preferences', 'action'=>'active'))?>"
|
||||
title="Activer le mode personnalisation afin de créer/modifier les préférences d'affichage">
|
||||
Activer le mode personnalisation
|
||||
</a>
|
||||
</p>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Profils d'enrichissement</div>
|
||||
<div class="panel-body">
|
||||
<?php if ($this->profil) {?>
|
||||
<p>Référence : <?=$this->profil->reference?></p>
|
||||
<p>Liste des données extraites lors d'un enrichissement</p>
|
||||
<?php foreach($this->profil->labels as $label) {?>
|
||||
<?=$label?><br/>
|
||||
<?php }?>
|
||||
<?php } else {?>
|
||||
<p>Aucun profil d'enrichissement (Veuillez contacter le service commercial)</p>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,91 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Fichiers en cours d'enrichissement</h2>
|
||||
|
||||
<?php if(count($this->encours) > 0) {?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Nombre de lignes traitées</th>
|
||||
<th>Date</th>
|
||||
<th>Etat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i=0; foreach($this->encours as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=number_format($item['nbLigneTraites'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td>
|
||||
<?php if ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
|
||||
En cours de traitement
|
||||
<?php } else {?>
|
||||
En attente de traitement
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else {?>
|
||||
<p>Aucun enrichissement en cours.<p>
|
||||
<?php }?>
|
||||
|
||||
<h2>Fichiers enrichis</h2>
|
||||
|
||||
<?php if(count($this->fini) > 0) {?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Date</th>
|
||||
<th>Fichier</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->fini as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else {?>
|
||||
<p>Aucun enrichissement.<p>
|
||||
<?php }?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(document).focusin(function(){
|
||||
timer = setInterval(updateInfo, 10000);
|
||||
});
|
||||
$(document).focusout(function(){
|
||||
clearInterval(timer);
|
||||
});
|
||||
timer = setInterval(updateInfo, 10000);
|
||||
});
|
||||
|
||||
var timer;
|
||||
function updateInfo(){
|
||||
$('tr.encours').each(function(){
|
||||
var objet = $(this);
|
||||
var id = $(this).attr('id');
|
||||
$.getJSON('/index/getinfo', {id: id}, function(data){
|
||||
if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
@ -1,17 +0,0 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Enrichissement fichier
|
||||
</div>
|
||||
|
||||
<a href="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'fileform'))?>">Envoyer votre fichier pour enrichissement</a>
|
||||
|
||||
<h2>Fichiers en cours d'enrichissement</h2>
|
||||
|
||||
|
||||
<h2>Fichiers enrichis</h2>
|
||||
|
||||
|
||||
|
||||
</div>
|
@ -1,56 +1,85 @@
|
||||
<div class="container-fluid">
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>">Historique de vos ciblages</a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'configuration'))?>">Préférences de l'application</a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'exports'))?>">Enrichissement fichier</a>
|
||||
<div class="btn-group">
|
||||
<a type="button" class="btn btn-default" href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>"><?=$this->translate('Liste de vos ciblages')?></a>
|
||||
<a type="button" class="btn btn-default" href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'enrichissements'))?>"><?=$this->translate('Liste de vos enrichissements')?></a>
|
||||
<a type="button" class="btn btn-default" href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'configuration'))?>"><?=$this->translate('Préférences de l\'application')?></a>
|
||||
</div>
|
||||
|
||||
<div id="rechercheCiblage">
|
||||
<h2>Rechercher dans vos ciblages</h2>
|
||||
<h2><?=$this->translate('Rechercher dans vos ciblages')?></h2>
|
||||
<input type="text" name="searchCiblage" class="searchCiblage" />
|
||||
<input type="submit" value="Rechercher" class="submit"/>
|
||||
<input type="submit" value="<?=$this->translate('Rechercher')?>" class="submit"/>
|
||||
</div>
|
||||
|
||||
<div id="lastCiblage" style="">
|
||||
<h2>Vos derniers ciblages</h2>
|
||||
<?php if(count($this->comptages)>0):?>
|
||||
|
||||
<table class="ciblage">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre d'entité</th>
|
||||
<th>Unité Insee</th>
|
||||
<th>Date</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $item):?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateComptage']?></td>
|
||||
<td>
|
||||
[<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a>] -
|
||||
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser le comptage</a>] -
|
||||
[<a href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Enrichissement</a>]
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php else:?>
|
||||
<p>Aucun ciblage.<p>
|
||||
<?php endif;?>
|
||||
|
||||
<div id="lastCiblage">
|
||||
<h2><?=$this->translate('Vos derniers ciblages')?></h2>
|
||||
<?php if(count($this->comptages) > 0):?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=$this->translate('Référence')?></th>
|
||||
<th><?=$this->translate('Nombre d\'entité')?></th>
|
||||
<th><?=$this->translate('Unité Insee')?></th>
|
||||
<th>Date</th>
|
||||
<th colspan="4"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->comptages as $name => $item):?>
|
||||
<tr>
|
||||
<td class="reference"><?=$item['reference']?></td>
|
||||
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
|
||||
<td class="update insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
|
||||
<td class="update date"><?=$item['dateComptage']?></td>
|
||||
<td><a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
|
||||
<td><a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>"><?=$this->translate('Charger les critères de ciblage dans l\'interface')?></a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun ciblage')?>.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="lastEnrichissement">
|
||||
<h2><?=$this->translate('Vos derniers enrichissements')?></h2>
|
||||
<?php if(count($this->enrichissements) > 0):?>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Référence</th>
|
||||
<th>Nombre de lignes totales</th>
|
||||
<th>Date</th>
|
||||
<th>Etat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->enrichissements as $item):?>
|
||||
<tr>
|
||||
<td><?=$item['reference']?></td>
|
||||
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td>
|
||||
<?php if ( $item['dateStop']!='0000-00-00 00:00:00' ) {?>
|
||||
<a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
|
||||
<?php }elseif ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
|
||||
En cours de traitement
|
||||
<?php } else {?>
|
||||
En attente de traitement
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun enrichissement')?>.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
5
application/views/default/scripts/dashboard/pref.phtml
Normal file
5
application/views/default/scripts/dashboard/pref.phtml
Normal file
@ -0,0 +1,5 @@
|
||||
<?php if ($this->nbRow>0) { ?>
|
||||
Préférence enregistrée.
|
||||
<?php } else {?>
|
||||
Erreur lors de l'enregistrement de la préférence.
|
||||
<?php } ?>
|
@ -0,0 +1,11 @@
|
||||
<?php if ($this->msg) {?>
|
||||
<?=$this->msg?>
|
||||
<?php } else {?>
|
||||
Votre demande a bien été prise en compte sous la référence <?=$this->ref?>
|
||||
<?php }?>
|
||||
|
||||
<script>
|
||||
$('#dialog').dialog({ buttons: {
|
||||
'Quitter': function() { $(this).dialog('close'); }
|
||||
}, });
|
||||
</script>
|
123
application/views/default/scripts/enrichissement/reference.phtml
Normal file
123
application/views/default/scripts/enrichissement/reference.phtml
Normal file
@ -0,0 +1,123 @@
|
||||
<?php if ( !$this->profil ) {?>
|
||||
|
||||
Aucun profil d'enrichissement, Merci de prendre contact avec le service commercial.
|
||||
|
||||
<?php } elseif ( empty($this->id) ) {?>
|
||||
|
||||
Erreur
|
||||
|
||||
<?php } elseif ( $this->resultat === true) {?>
|
||||
|
||||
<p>Le nombre de lignes à enrichir est trop important.
|
||||
Vous pouvez prendre contact avec le service commercial.</p>
|
||||
|
||||
<?php } elseif ( $this->resultat == 'lines') {?>
|
||||
|
||||
<p>Le nombre de lignes à enrichir est supérieur au nombre de ligne maximum définies dans la contrat.
|
||||
Vous pouvez prendre contact avec le service commercial.</p>
|
||||
|
||||
<?php } elseif ( $this->resultat == 'files') {?>
|
||||
|
||||
<p>Le nombre maximum de fichier enrichit a été atteint.
|
||||
Vous pouvez prendre contact avec le service commercial.</p>
|
||||
|
||||
|
||||
<?php } elseif ( $this->forfaitRemain && $this->forfaitRemain<=0 ) { ?>
|
||||
|
||||
<p>Le montant de votre forfait est insuffisant
|
||||
Vous pouvez prendre contact avec le service commercial.
|
||||
</p>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div id="update">
|
||||
<p class="bg-classes bg-success">Votre ciblage a été actualisé</p>
|
||||
<p><a href="#" title="Afficher les paramètres du fichier" id="display-fileparams">Paramètres du fichier</a></p>
|
||||
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'), 'default', true)?>">
|
||||
<div id="fileparams" class="row" style="display:none;">
|
||||
<div class="col-xs-6">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">Possible output encoding</div>
|
||||
<div class="panel-body">
|
||||
<div class="btn-group" data-toggle="buttons">
|
||||
<label class="btn btn-sm btn-primary active">
|
||||
<input type="radio" name="options" id="option1"> UTF-8
|
||||
</label>
|
||||
<label class="btn btn-sm btn-primary">
|
||||
<input type="radio" name="options" id="option2"> ISO-8859-15
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">Possible separator</div>
|
||||
<div class="panel-body">
|
||||
<div class="btn-group" style='' data-toggle="buttons">
|
||||
<label class="btn btn-sm btn-primary active">
|
||||
<input type="radio" name="options" id="option1"> ,
|
||||
</label>
|
||||
<label class="btn btn-sm btn-primary">
|
||||
<input type="radio" name="options" id="option2"> ;
|
||||
</label>
|
||||
<label class="btn btn-sm btn-primary">
|
||||
<input type="radio" name="options" id="option3"> Tab
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="id" value="<?=$this->id?>" />
|
||||
<input type="hidden" type="text" value="<?=$this->ref?>" name="ref">
|
||||
<input type="hidden" type="text" value="<?=$this->profil?>" name="profil">
|
||||
</form>
|
||||
|
||||
<table class="table table-bordered table-condensed" id="enrichissement">
|
||||
<tr>
|
||||
<th>Référence</th><th><?=$this->ref?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nombre d'unités</td><td><?=number_format($this->resultat, 0, ',', ' ')?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nombre d'unités Insee</td><td><?=number_format($this->uniteInsee, 0, ',', ' ')?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if (!empty($this->infoInsee)) {?>
|
||||
<p><?=$this->infoInsee?></p>
|
||||
<?php }?>
|
||||
<p><small>Le prix du fichier est de <u><?=number_format($this->prix, 2, ',', ' ')?></u> €
|
||||
(avec <?=number_format($this->prixInsee, 2, ',', ' ')?> € de redevance Insee)</small></p>
|
||||
<?php if ($this->forfaitRemain) {?>
|
||||
<p>Forfait Restant : <?=number_format($this->forfaitRemain, 2, ',', ' ')?> €</p>
|
||||
<?php }?>
|
||||
<p class="text-warning"><small>Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.</small></p>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$('a#display-fileparams').click(function(){
|
||||
var state = $('div#fileparams').css('display');
|
||||
if (state == 'none') {
|
||||
$('div#fileparams').css('display', 'block');
|
||||
} else {
|
||||
$('div#fileparams').css('display', 'none');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialog').dialog({ buttons: {
|
||||
'Valider': function() {
|
||||
var action = $('form[name=commande]').attr('action');
|
||||
var values = $('form[name=commande]').serialize();
|
||||
$('#dialog div#update').html('Enregistrement...');
|
||||
$.post(action, values, function(data){
|
||||
$('div#update').html(data);
|
||||
}).error(function(){
|
||||
$('div#update').html('Erreur');
|
||||
});
|
||||
},
|
||||
'Annuler': function() { $(this).dialog('close'); }
|
||||
}, });
|
||||
</script>
|
||||
<?php }?>
|
12
application/views/default/scripts/error/get.phtml
Normal file
12
application/views/default/scripts/error/get.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<table style="width:100%">
|
||||
<?php if(!empty($this->erreurs)): ?>
|
||||
<?php foreach($this->erreurs as $erreur => $valeur):?>
|
||||
<?php if($valeur['erreur'] and $valeur['valeur'] != 'tous'): ?>
|
||||
<tr style="border:1px solid red;">
|
||||
<td style="padding:10px"><?php echo $erreur; ?></td>
|
||||
<td style="padding:10px"><?php echo $valeur['valeur']; ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endforeach;?>
|
||||
<?php endif; ?>
|
||||
</table>
|
77
application/views/default/scripts/fields/index.phtml
Normal file
77
application/views/default/scripts/fields/index.phtml
Normal file
@ -0,0 +1,77 @@
|
||||
<div id="tabs" class="col-sm-2 col-md-2 col-lg-2">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item list-group-item-info active" data-target="#tabs-1" data-toggle="tab">Critères Entreprise</li>
|
||||
<li class="list-group-item list-group-item-info" data-target="#tabs-2" data-toggle="tab">Situation Économique</li>
|
||||
<li class="list-group-item list-group-item-info" data-target="#tabs-3" data-toggle="tab">Secteur Géographique</li>
|
||||
<li class="list-group-item list-group-item-info" data-target="#tabs-4" data-toggle="tab">Situation Juridique</li>
|
||||
<li class="list-group-item list-group-item-info" data-target="#tabs-5" data-toggle="tab">Situation Financière</li>
|
||||
<li class="list-group-item list-group-item-info" data-target="#tabs-6" data-toggle="tab">Chiffres clés</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-md-6 col-lg-6">
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content" style="max-height:500px; overflow-y:auto;">
|
||||
|
||||
<div class="tab-pane active" id="tabs-1">
|
||||
<div id="entreprise">
|
||||
<?php if ( count($this->FieldsEntreprise)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsEntreprise as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabs-2">
|
||||
<div id="economique">
|
||||
<?php if ( count($this->FieldsEconomique)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsEconomique as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabs-3">
|
||||
<div id="geographique">
|
||||
<?php if ( count($this->FieldsGeographique)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsGeographique as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabs-4">
|
||||
<div id="juridique">
|
||||
<?php if ( count($this->FieldsJuridique)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsJuridique as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabs-5">
|
||||
<div id="financiere">
|
||||
<?php if ( count($this->FieldsFinancier)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsFinancier as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="tabs-6">
|
||||
<div id="chiffrescles">
|
||||
<?php if ( count($this->FieldsChiffrescles)>0 ) {?>
|
||||
<?php foreach ( $this->FieldsChiffrescles as $key => $params ) {?>
|
||||
<?=$this->Field($key)?>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
1
application/views/default/scripts/fields/tag.phtml
Normal file
1
application/views/default/scripts/fields/tag.phtml
Normal file
@ -0,0 +1 @@
|
||||
<?=json_encode($this->values)?>
|
33
application/views/default/scripts/fields/tree.phtml
Normal file
33
application/views/default/scripts/fields/tree.phtml
Normal file
@ -0,0 +1,33 @@
|
||||
<?php if ( $this->init ) {?>
|
||||
|
||||
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;">
|
||||
</div>
|
||||
<script>
|
||||
$("div#<?=$this->key?>").jstree({
|
||||
'core': {
|
||||
'themes' : { 'icons': false, },
|
||||
'animation': 0,
|
||||
'check_callback' : true,
|
||||
'data' : {
|
||||
'url' : '/fields/tree/key/<?=$this->key?>',
|
||||
'dataType': 'json',
|
||||
'data' : function (node) {
|
||||
var level = 0;
|
||||
console.log(node.id);
|
||||
if ( node.id != '#' ) {
|
||||
console.log(node.li_attr.level);
|
||||
level = node.li_attr.level ? node.li_attr.level : 0;
|
||||
}
|
||||
return { 'id' : node.id ? node.id : '', 'level': level };
|
||||
},
|
||||
},
|
||||
},
|
||||
'plugins': ['checkbox'],
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<?=json_encode($this->values)?>
|
||||
|
||||
<?php }?>
|
@ -0,0 +1,3 @@
|
||||
<div class="container">
|
||||
<p class="text-muted credit"> © <?=date('Y')?> <a href="http://www.scores-decisions.com">Scores & Décisions</a>.</p>
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
<table class="table table-bordered table-condensed">
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<tr class="active">
|
||||
<td><strong><?=$criteres['label']?></strong></td>
|
||||
</tr>
|
||||
<?php if ( is_string($criteres['in']) ) {?>
|
||||
<tr>
|
||||
<td><?=$criteres['in']?></td>
|
||||
</tr>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<tr>
|
||||
<td><?=$item?><span class="label label-success pull-right">inclus</span></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<tr>
|
||||
<td><?=$item?><span class="label label-danger pull-right">exclus</span></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</table>
|
74
application/views/default/scripts/gestion/ciblages.phtml
Normal file
74
application/views/default/scripts/gestion/ciblages.phtml
Normal file
@ -0,0 +1,74 @@
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
<?php for ( $i=1 ; $i<=12 ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->month) $select = ' selected';?>
|
||||
<option value="<?=$i?>"<?=$select?>><?=str_pad($i, 2, '0', STR_PAD_LEFT)?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="Ok"/>
|
||||
</form>
|
||||
<h2>Liste des ciblages</h2>
|
||||
<div>
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<th><b>Id</b></th>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->comptages as $comptage): ?>
|
||||
<tr class="criteres" title="Critères" data-url="<?=$this->url(array('controller'=>'gestion',
|
||||
'action'=>'ciblagecriteres', 'id'=>$comptage['idDefinition']), 'default', true)?>">
|
||||
<td><?=$comptage['idDefinition']?></td>
|
||||
<td><?=$comptage['dateAjout']?></td>
|
||||
<td><?=$comptage['reference']?></td>
|
||||
<td><?=$comptage['resultat']?></td>
|
||||
<td><?=$comptage['uniteInsee']?></td>
|
||||
<td>
|
||||
<a href="">Actualiser</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('table tr.criteres').on('click', function(){
|
||||
var href = $(this).data('url');
|
||||
if (href!='#' || href!='') {
|
||||
var title = $(this).attr('title');
|
||||
var dialogOpts = {
|
||||
bgiframe: true,
|
||||
title: title,
|
||||
width: 650,
|
||||
height: 600,
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(href);
|
||||
},
|
||||
buttons: {
|
||||
Quitter: function() { $(this).dialog('close'); }
|
||||
},
|
||||
close: function() { $('#dialog').remove(); }
|
||||
};
|
||||
$('<div id="dialog"></div>').dialog(dialogOpts);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
57
application/views/default/scripts/gestion/commandes.phtml
Normal file
57
application/views/default/scripts/gestion/commandes.phtml
Normal file
@ -0,0 +1,57 @@
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<div>
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
<?php for ( $i=1 ; $i<=12 ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->month) $select = ' selected';?>
|
||||
<option value="<?=$i?>"<?=$select?>><?=str_pad($i, 2, '0', STR_PAD_LEFT)?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="OK"/>
|
||||
</form>
|
||||
</div>
|
||||
<h2>Liste des commandes</h2>
|
||||
<div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><b>Date de création</b></th>
|
||||
<th><b>Référence</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
<th><b>login</b></th>
|
||||
<th><b>Reférence ciblage</b></th>
|
||||
<th><b>Actions</b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->commandes as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['dateAdded']?></td>
|
||||
<td><?=$item['commandeReference']?></td>
|
||||
<td><?=$item['nbLigneTotales']?></td>
|
||||
<td><?=$item['uniteInsee']?></td>
|
||||
<td><?=$item['login']?></td>
|
||||
<td><?=$item['critereReference']?></td>
|
||||
<td>
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'gestion','action'=>'enrichit', 'id'=>$item['id']))?>">Enrichissement</a>
|
||||
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$item['id']))?>">Extraire les sirets</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?php }?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,58 @@
|
||||
<div class="container-fluid">
|
||||
<div id="dashboard">
|
||||
<h2>Paramètres client</h2>
|
||||
|
||||
<table class="table table-condensed">
|
||||
<tr><td>Nom</td><td><?=$this->infos['nom']?></td></tr>
|
||||
<tr><td>service</td><td><?=$this->infos['service']?></td></tr>
|
||||
<tr><td>filterRNCS</td><td><?=$this->infos['filterRNCS']?></td></tr>
|
||||
<tr><td>licenceINSEE</td><td><?=$this->infos['licenceINSEE']?></td></tr>
|
||||
<tr><td>immediatExtract</td><td><?=$this->infos['immediatExtract']?></td></tr>
|
||||
<tr><td>dateContrat</td><td><?=$this->infos['dateContrat']?></td></tr>
|
||||
<tr><td>periodContrat</td><td><?=$this->infos['periodContrat']?></td></tr>
|
||||
<tr><td>periodPaiement</td><td><?=$this->infos['periodPaiement']?></td></tr>
|
||||
<tr><td>priceLine</td><td><?=$this->infos['priceLine']?></td></tr>
|
||||
<tr><td>forfait</td><td><?=$this->infos['forfait']?></td></tr>
|
||||
<tr><td>limitLines</td><td><?=$this->infos['limitLines']?></td></tr>
|
||||
<tr><td>limitFiles</td><td><?=$this->infos['limitFiles']?></td></tr>
|
||||
<tr><td>criteres</td><td>
|
||||
<?php foreach ( $this->infos['criteres'] as $item ) {?>
|
||||
<?=$this->fields[$item]['label']?><br/>
|
||||
<?php }?>
|
||||
</td>
|
||||
<tr><td>dataInsee</td><td><?=$this->infos['dataInsee']?></td></tr>
|
||||
<tr><td>dateAdded</td><td><?=$this->infos['dateAdded']?></td></tr>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-info" href="<?=$this->url(array('controller'=>'gestion','action'=>'customerparamadd','idClient'=>$this->idClient),null,true)?>">Modifier</a>
|
||||
|
||||
<h2>Logins autorisés</h2>
|
||||
<form class="form-inline" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'), null, true)?>">
|
||||
<input type="hidden" name="idClient" value="<?=$this->infos['idClient']?>" />
|
||||
<input type="hidden" name="service" value="<?=$this->infos['service']?>" />
|
||||
<input type="hidden" name="reference" value="default" />
|
||||
<div class="form-group">
|
||||
<label>Login </label><input class="form-control input-sm" type="text" name="login" value="" />
|
||||
</div>
|
||||
<input class="btn btn-info" type="submit" value="Ajouter un login avec le profil du client" />
|
||||
</form>
|
||||
|
||||
<table class="table table-condensed">
|
||||
<tr><td>Login</td><td>Service</td><td>Profil</td><td>Action</td></tr>
|
||||
<?php foreach ($this->logins as $login) {?>
|
||||
<tr>
|
||||
<td><?=$login['login']?></td>
|
||||
<td><?=$login['service']?></td>
|
||||
<td><?=$login['reference']?></td>
|
||||
<td>
|
||||
<?php if ($login['reference']=='default') {?>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Ajouter un profil</a>
|
||||
<a href="">Désactiver</a>
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
114
application/views/default/scripts/gestion/customerparamadd.phtml
Normal file
114
application/views/default/scripts/gestion/customerparamadd.phtml
Normal file
@ -0,0 +1,114 @@
|
||||
<div class="container-fluid">
|
||||
<div id="dashboard">
|
||||
|
||||
<?php if ($this->message) {?>
|
||||
|
||||
<?=$this->message?>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<form name="profil" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparamadd'))?>">
|
||||
|
||||
<?php if ($this->id) {?>
|
||||
<input type="hidden" name="id" value="<?=$this->id?>"/>
|
||||
<?php }?>
|
||||
|
||||
<div>
|
||||
<label>Client</label>
|
||||
<select name="idClient">
|
||||
<?php foreach ( $this->selectClient as $client ) {?>
|
||||
<?php $select = ''; if ($this->idClient==$client->id) { $select = ' selected'; }?>
|
||||
<option value="<?=$client->id?>"<?=$select?>><?=$client->nom?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>service</label>
|
||||
<input type="text" name="service" value="<?=$this->service?>"/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>filterRNCS</label>
|
||||
<?php $select = ''; if ($this->filterRNCS==1) $select = ' checked'?>
|
||||
<input type="checkbox" name="filterRNCS" value="1"<?=$select?>/>
|
||||
Filtrer au RNCS
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>licenceINSEE</label>
|
||||
<?php $select = ''; if ($this->licenceInsee==1) $select = ' checked'?>
|
||||
<input type="checkbox" name="licenceINSEE" value="1"<?=$select?>/>
|
||||
Le client possède la licence INSEE
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>immediatExtract</label>
|
||||
<input type="text" name="immediatExtract" value="<?=$this->immediatExtract?>" />
|
||||
Nombre de ligne maximum pour une extraction immédiate
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>dateContrat</label>
|
||||
<input type="text" name="dateContrat" value="<?=$this->dateContrat?>"/>
|
||||
Date de début du contract (AAAA-MM-JJ)
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>periodContrat</label>
|
||||
<input type="text" name="periodContrat" value="<?=$this->periodContrat?>"/>
|
||||
Durée du contrat (1,3,6,12 mois)
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>periodPaiement</label>
|
||||
<input type="text" name="periodPaiement" value="<?=$this->periodPaiement?>"/>
|
||||
Emission des factures (tous les 1,3,6,12 mois)
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>priceLine</label>
|
||||
<input type="text" name="priceLine" value="<?=$this->priceLine?>"/> €
|
||||
Prix à la ligne (obligatoire même en forfait pour pouvoir décompter)
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>forfait</label>
|
||||
<input type="text" name="forfait" value="<?=$this->forfait?>"/>
|
||||
Montant du forfait pour l'extraction de fichier
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>limitLines</label>
|
||||
<input type="text" name="limitLines" value="<?=$this->limitLines?>"/>
|
||||
Nombre maximal de lignes dans un fichier
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>limitFiles</label>
|
||||
<input type="text" name="limitFiles" value="<?=$this->limitFiles?>"/>
|
||||
Nombre maximal de fichier pouvant être extrait
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>Enrichissement</label>
|
||||
<select style="padding:5px;" name="criteres[]" multiple size="20">
|
||||
<?php if ( count($this->fields)>0 ) {?>
|
||||
<?php foreach ( $this->fields as $value => $item ) {?>
|
||||
<?php $select = ''; if (in_array($value, $this->criteres)) $select = ' selected'; ?>
|
||||
<option value="<?=$value?>"<?=$select?>><?=$item['label']?></option>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<?php if ($this->idClient) {?>
|
||||
<input type="submit" name="submit" value="Modifier"/>
|
||||
<?php } else {?>
|
||||
<input type="submit" name="submit" value="Enregistrer"/>
|
||||
<?php }?>
|
||||
</form>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,42 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<h2>Liste des paramètres clients</h2>
|
||||
<div class="paragraph">
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparamadd'))?>">Ajouter un client</a>
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Début du contrat</th>
|
||||
<th>Durée contrat</th>
|
||||
<th>Logins ouvert</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($this->customerlist as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['nom']?></td>
|
||||
<td><?=$item['dateContrat']?></td>
|
||||
<td><?=$item['periodContrat']?></td>
|
||||
<td>
|
||||
<ul class="list-group">
|
||||
<?php foreach ($item['logins'] as $login) {?>
|
||||
<li class="list-group-item"><?=$login?></li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparam',
|
||||
'idClient'=>$item['idClient']))?>">Détail</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,52 @@
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
$YearBegin = 2012;
|
||||
$Years = date('Y') - $YearBegin;
|
||||
?>
|
||||
<div id="dashboard">
|
||||
<form method="post" action="">
|
||||
<select name="year">
|
||||
<?php for ($i=0 ; $i<=$Years ; $i++ ) {?>
|
||||
<?php $select=''; if ($YearBegin+$Years-$i==$this->year) $select = ' selected';?>
|
||||
<option value="<?=$YearBegin+$Years-$i?>"<?=$select?>><?=$YearBegin+$Years-$i?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<select name="month">
|
||||
<?php for ( $i=1 ; $i<=12 ; $i++ ) {?>
|
||||
<?php $select=''; if ($i==$this->month) $select = ' selected';?>
|
||||
<option value="<?=$i?>"<?=$select?>><?=str_pad($i, 2, '0', STR_PAD_LEFT)?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<input type="submit" name="submit" value="Ok"/>
|
||||
</form>
|
||||
<h2>Liste des commandes</h2>
|
||||
<div>
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<th><b>Date</b></th>
|
||||
<th><b>login</b></th>
|
||||
<th><b>Références</b></th>
|
||||
<th><b>Résultat</b></th>
|
||||
<th><b>Insee</b></th>
|
||||
</tr>
|
||||
<?php foreach($this->commandes as $item) { ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?=$item['dateAdded']?><br/>
|
||||
<?=$item['dateStart']?>
|
||||
</td>
|
||||
<td><?=$item['login']?></td>
|
||||
<td>
|
||||
<?=$item['commandeReference']?><br/>
|
||||
<?=$item['critereReference']?><br/>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion','action'=>'enrichissementdl', 'id'=> $item['id']),
|
||||
'default', true)?>"><?=$item['fichier']?></a>
|
||||
</td>
|
||||
<td><?=$item['nbLigneTotales']?></td>
|
||||
<td><?=$item['uniteInsee']?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
12
application/views/default/scripts/gestion/extract.phtml
Normal file
12
application/views/default/scripts/gestion/extract.phtml
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
if ($this->content) {
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo $this->content;
|
||||
} else {
|
||||
echo $this->message;
|
||||
}
|
16
application/views/default/scripts/gestion/index.phtml
Normal file
16
application/views/default/scripts/gestion/index.phtml
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="container-fluid">
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Gestion des commandes</h2>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'commandes'))?>">Liste des commandes</a><br />
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'enrichissements'))?>">Liste des commandes terminées</a><br/>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'ciblages'))?>">Liste des ciblages</a><br />
|
||||
|
||||
<h2>Facturation</h2>
|
||||
<a href="<?=$this->url(array('controller' => 'gestion', 'action' => 'customerparams'))?>">Gestion des paramètres clients</a><br/>
|
||||
<a href="#">Extraction Logs</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
36
application/views/default/scripts/gestion/profiladd.phtml
Normal file
36
application/views/default/scripts/gestion/profiladd.phtml
Normal file
@ -0,0 +1,36 @@
|
||||
<div class="container-fluid">
|
||||
<div id="dashboard">
|
||||
|
||||
<?=$this->message?>
|
||||
|
||||
<?php if (!$this->disableForm) {?>
|
||||
<form name="profil" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">
|
||||
<input type="hidden" name="idClient" value="<?=$this->idClient?>"/>
|
||||
<label>login</label>
|
||||
<input type="text" name="login" />
|
||||
<br/>
|
||||
<label>service</label>
|
||||
<input type="text" name="service" />
|
||||
<br/>
|
||||
<label>Reference</label>
|
||||
<input type="text" name="reference" />
|
||||
(Pour appliquer les paramètres du client mettre "default")
|
||||
<br/>
|
||||
|
||||
<div>
|
||||
<label>Selection des données pour l'enrichissement</label>
|
||||
<select style="padding:5px;" name="criteres[]" multiple size="20">
|
||||
<?php if ( count($this->fields)>0 ) {?>
|
||||
<?php foreach ( $this->fields as $value => $item ) {?>
|
||||
<option value="<?=$value?>"><?=$item['label']?></option>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<input type="submit" name="submit" value="Enregistrer"/>
|
||||
</form>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
<?php
|
47
application/views/default/scripts/gestion/profils.phtml
Normal file
47
application/views/default/scripts/gestion/profils.phtml
Normal file
@ -0,0 +1,47 @@
|
||||
<div class="container">
|
||||
<div id="dashboard">
|
||||
|
||||
<div>
|
||||
<form method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profils'), null, true)?>">
|
||||
IdClient : <input type="text" name="idClient" /> - Login : <input type="text" name="login" />
|
||||
<input type="submit" name="rechercher" value="Rechercher"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Liste des profils</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>login</th>
|
||||
<th>reference</th>
|
||||
<th>tarifLigne</th>
|
||||
<th>dateAjout</th>
|
||||
<th>dateSuppr</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ( $this->profils as $profil ) {?>
|
||||
<tr>
|
||||
<td><?=$profil['nom']?></td>
|
||||
<td><?=$profil['login']?></td>
|
||||
<td><?=$profil['reference']?></td>
|
||||
<td><?=$profil['tarifLigne']?></td>
|
||||
<td><?=$profil['dateAjout']?></td>
|
||||
<td><?=$profil['dateSuppr']?></td>
|
||||
<td>
|
||||
<?php if ($profil['actif']==1) {?>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profildel', 'id'=>$profil['id']))?>">Désactiver</a>
|
||||
<?php } else {?>
|
||||
<a href="#">Activer</a>
|
||||
<?php }?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -1,34 +1,54 @@
|
||||
<div id="primaryNavigation" class="clearfix">
|
||||
<ul>
|
||||
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'), null, true)?>">Accueil</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'), null, true)?>">Tableau de bord</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'index'), null, true)?>">Aide</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'aproposde'), null, true)?>">A propos de</a></li>
|
||||
<li><a href="<?=$this->url(array('controller'=>'user', 'action'=>'logout'), null, true)?>">Déconnexion</a></li>
|
||||
</ul>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4"><img src="/themes/default/images/logos/logo.png" alt="Scores & Décisions"/></div>
|
||||
<div class="col-md-8"><h3>Outils D'Extraction Automatique</h3></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Fixed navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="<?=$this->url(array('controller'=>'index', 'action'=>'index'), null, true)?>">ODEA</a>
|
||||
</div>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<?php foreach ($this->navigation()->getContainer() as $page) {?>
|
||||
<li class="dropdown<?php if ( $page->isActive(true) ) { echo ' active'; } ?>">
|
||||
<?php if ( $page->hasPages() ) {?>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?=$page->label?> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php foreach ( $page->getPages() as $child ) {?>
|
||||
<?php if ( $child->getHref() == '#') {?>
|
||||
<li class="divider"></li>
|
||||
<?php } else {?>
|
||||
<li <?php if ( $child->isActive(true) ) { echo "class='active'"; } ?>><a href="<?=$child->getHref()?>"><?=$child->label?></a></li>
|
||||
<?php }?>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?php } else {?>
|
||||
<a href="<?=$page->getHref()?>"><?=$page->label?></a>
|
||||
<?php }?>
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
<p class="navbar-text">
|
||||
<span class="label label-info" title="Date de mise à jour des données">Données à jour au <?=$this->DataDate()?></span>
|
||||
</p>
|
||||
<p class="navbar-text pull-right"><?=$this->profileLink()?></p>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="logo">
|
||||
<h1>Odea</h1>
|
||||
<!-- Breadcrumbs -->
|
||||
<?php if ($this->navigation()->breadcrumbs() != '') {?>
|
||||
<div class="container-fluid">
|
||||
<ol class="breadcrumb">
|
||||
<?php echo $this->navigation()->breadcrumbs()->setLinkLast(false)->setSeparator(' / '); ?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div id="message">
|
||||
<?php if ($this->msgComptage){?>
|
||||
<div id="comptage" >
|
||||
<?php if (!empty($this->total)) {?>
|
||||
Nombre sélectionnées :
|
||||
<span class="valeur"><?=$this->total?></span>
|
||||
(dont <span class="valeur"><?=$this->insee?></span> unité(s) insee)
|
||||
<?php } else {?>
|
||||
Aucune sélection.
|
||||
<?php }?>
|
||||
</div>
|
||||
<div id="attente" style="display:none;">
|
||||
<img src="/themes/default/images/ajax.gif" />
|
||||
</div>
|
||||
<div id="control">
|
||||
[<a href="<?=$this->url(array('controller'=>'index', 'action'=> 'reset'))?>">Initialiser les critères</a>],
|
||||
[<a id="saveciblage" href="<?=$this->url(array('controller'=>'comptage', 'action'=>'savedialog'))?>">Sauvegarder le profil du ciblage</a>]
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
28
application/views/default/scripts/index/criterelist.phtml
Normal file
28
application/views/default/scripts/index/criterelist.phtml
Normal file
@ -0,0 +1,28 @@
|
||||
<?php if (count($this->inLabels)>0) {?>
|
||||
<ul class="list-group">
|
||||
<?php foreach ($this->inLabels as $i => $item) {?>
|
||||
|
||||
<li class="list-group-item">
|
||||
<a class="close" href="<?=$this->url(array('controller'=>'index', 'action'=>'remove',
|
||||
'critere'=>$this->critereName, 'in'=>$i ), 'default', true)?>" aria-hidden="true">×</a>
|
||||
<?=$item?>
|
||||
</li>
|
||||
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?php }?>
|
||||
|
||||
<?php if (count($this->exLabels)>0) {?>
|
||||
<ul class="list-group">
|
||||
<?php foreach ($this->exLabels as $i => $item) {?>
|
||||
|
||||
<li class="list-group-item">
|
||||
<a class="close" title="Supprimer" href="<?=$this->url(array('controller'=>'index',
|
||||
'action'=>'remove', 'critere'=>$this->critereName, 'ex'=>$i ), 'default', true)?>"
|
||||
aria-hidden="true">×</a>
|
||||
<?=$item?>
|
||||
</li>
|
||||
|
||||
<?php }?>
|
||||
</ul>
|
||||
<?php }?>
|
@ -1,79 +1,41 @@
|
||||
<?php if ($this->preferences) {?>
|
||||
<p class="alert alert-info" id="comptage">
|
||||
<span class="valeur">Unités : <?=$this->dataCount?></span>
|
||||
<?php if ( $this->dataInsee > 0 ) {?>
|
||||
(dont <span class="valeur"><?=$this->dataInsee?></span> unitée(s) insee)
|
||||
<?php }?>
|
||||
</p>
|
||||
|
||||
<h3><a href="#">Entreprise</a></h3>
|
||||
<div>
|
||||
<ul class="critereSelection">
|
||||
<?php foreach($this->fields->getByFamille('entreprise') as $name => $label): ?>
|
||||
<li class="liHover printCritere tooltip" name="<?=$name?>">
|
||||
<a title="<?=$label['label']?>" href="<?=$this->url(array('controller' => 'index', 'action' => 'save', 'name' => $name))?>">
|
||||
<?=$label['label']?>
|
||||
<img src="/themes/default/images/<?=(($label['activated'])?'moins':'ajouter')?>.png" style="float:right"/>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<h3><a href="#">Situation economique</a></h3>
|
||||
<div>
|
||||
<ul class="critereSelection">
|
||||
<?php foreach($this->fields->getByFamille('economique') as $name => $label): ?>
|
||||
<li class="liHover printCritere tooltip" name="<?=$name?>">
|
||||
<a title="<?=$label['label']?>">
|
||||
<?=$label['label']?>
|
||||
<img src="/themes/default/images/<?=(($label['activated'])?'moins':'ajouter')?>.png" style="float:right"/>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<h3><a href="#">Secteur géographique</a></h3>
|
||||
<div>
|
||||
<ul class="critereSelection">
|
||||
<?php foreach($this->fields->getByFamille('geographique') as $name => $label): ?>
|
||||
<li class="liHover printCritere tooltip" name="<?=$name?>">
|
||||
<a title="<?=$label['label']?>">
|
||||
<?=$label['label']?>
|
||||
<img src="/themes/default/images/<?=(($label['activated'])?'moins':'ajouter')?>.png" style="float:right"/>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<h3><a href="#">Situation juridique</a></h3>
|
||||
<div>
|
||||
<ul class="critereSelection">
|
||||
<?php foreach($this->fields->getByFamille('juridique') as $name => $label): ?>
|
||||
<li class="liHover printCritere tooltip" name="<?=$name?>">
|
||||
<a title="<?=$label['label']?>">
|
||||
<?=$label['label']?>
|
||||
<img src="/themes/default/images/<?=(($label['activated'])?'moins':'ajouter')?>.png" style="float:right"/>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
<h3><a href="#">Situation financiére</a></h3>
|
||||
<div>
|
||||
<ul class="critereSelection">
|
||||
<?php foreach($this->fields->getByFamille('financier') as $name => $label): ?>
|
||||
<li class="liHover printCritere tooltip" name="<?=$name?>">
|
||||
<a class="tooltip" title="<?=$label['label']?>">
|
||||
<?=$label['label']?>
|
||||
<img src="/themes/default/images/<?=(($label['activated'])?'moins':'ajouter')?>.png" style="float:right"/>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Résumé de vos critères
|
||||
<a href="/comptage/reset" id="reset" class="btn btn-danger btn-xs pull-right" title="Initialiser tous les critères.">
|
||||
<span aria-hidden="true" class="glyphicon glyphicon-remove"></span>
|
||||
Réinitialiser
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<?php if ( count($this->infos)>0 ) {?>
|
||||
<?php foreach($this->infos as $critere => $item) {?>
|
||||
<div class="alert alert-info">
|
||||
<a class="close" data-dismiss="alert" href="<?=$this->url(array(
|
||||
'controller'=>'index', 'action'=>'remove', 'critere'=>$critere), null, true)?>" aria-hidden="true">×</a>
|
||||
<strong><?=$item['label']?>:</strong>
|
||||
<?php if ( $item['in'] == 'Liste' ) { ?>
|
||||
<a class="itemlist" title="<?=$item['label']?>" href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist',
|
||||
'key'=>$critere), null, true)?>">Éléments inclus.</a>
|
||||
<?php } elseif ( !empty($item['in']) ) {?>
|
||||
<span><?=$item['in']?>.</span>
|
||||
<?php }?>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div>
|
||||
<h2>Vos critères</h2>
|
||||
<ul style="padding:5px;">
|
||||
<?php foreach($this->criteres as $critere => $valeur):?>
|
||||
<li><?php echo $critere.':'.$valeur;?></li>
|
||||
<?php endforeach;?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php if ( $item['ex'] == 'Liste' ) { ?>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'criterelist',
|
||||
'key'=>$critere), null, true)?>">Éléments exclus.</a>
|
||||
<?php } elseif ( !empty($item['ex']) ) {?>
|
||||
<span><s><?=$item['ex']?></s>.</span>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<?php } else {?><div class="alert alert-warning">Aucune sélection.</div><?}?>
|
||||
<a href="/comptage/previsualisation" id="preview" class="btn btn-primary btn-block">Prévisualiser</a>
|
||||
<a href="/comptage/savedialog" id="extract" class="saveciblage btn btn-primary btn-block">Extraire</a>
|
||||
</div>
|
@ -1,27 +1,21 @@
|
||||
<div id="panel">
|
||||
<?=$this->action('criteres', 'index');?>
|
||||
<?php if ($this->CiblageError) { ?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="alert alert-danger">
|
||||
<?=$this->translate('Erreur ! Le moteur de ciblage n\'est pas disponible !')?>
|
||||
</div>
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">Critères Entreprise</a></li>
|
||||
<li><a href="#tabs-2">Situation économique</a></li>
|
||||
<li><a href="#tabs-3">Secteur géographique</a></li>
|
||||
<li><a href="#tabs-4">Situation juridique</a></li>
|
||||
<li><a href="#tabs-5">Situation financière</a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<?=$this->action('entreprise', 'criteres')?>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<?=$this->action('economique', 'criteres')?>
|
||||
</div>
|
||||
<div id="tabs-3">
|
||||
<?=$this->action('geographique', 'criteres')?>
|
||||
</div>
|
||||
<div id="tabs-4">
|
||||
<?=$this->action('juridique', 'criteres')?>
|
||||
</div>
|
||||
<div id="tabs-5">
|
||||
<?=$this->action('financiere', 'criteres')?>
|
||||
</div>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div id="actionMessage"></div>
|
||||
<div class="row">
|
||||
<?=$this->action('index', 'fields')?>
|
||||
<div id="panel" class="col-sm-4 col-md-4 col-lg-4">
|
||||
<?=$this->action('criteres', 'index')?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php }?>
|
||||
|
24
application/views/default/scripts/layout.phtml
Normal file
24
application/views/default/scripts/layout.phtml
Normal file
@ -0,0 +1,24 @@
|
||||
<?php echo $this->doctype()?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta()?>
|
||||
<?php echo $this->headTitle()?>
|
||||
<?php echo $this->headStyle()?>
|
||||
<?php echo $this->headLink()?>
|
||||
<?php echo $this->headScript()?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="wrap" class="clearfix">
|
||||
<?php echo $this->render('header.phtml')?>
|
||||
|
||||
<?php echo $this->layout()->content?>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml')?>
|
||||
</div>
|
||||
|
||||
<?php echo $this->inlineScript()?>
|
||||
</body>
|
||||
</html>
|
@ -1,23 +0,0 @@
|
||||
<?php echo $this->doctype(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta(); ?>
|
||||
<?php echo $this->headTitle(); ?>
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
<?php echo $this->headScript(); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="global">
|
||||
<div id="header" class="clearfix">
|
||||
<?php echo $this->render('header.phtml') ?>
|
||||
</div>
|
||||
<div id="content" class="clearfix">
|
||||
<?php echo $this->layout()->content; ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
application/views/default/scripts/user/lang.phtml
Normal file
1
application/views/default/scripts/user/lang.phtml
Normal file
@ -0,0 +1 @@
|
||||
<div class="infoData"></div>
|
@ -1,13 +1,32 @@
|
||||
<?php echo $this->doctype();?>
|
||||
<?php echo $this->doctype()?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta();?>
|
||||
<?php echo $this->headTitle();?>
|
||||
<link rel="shortcut icon" type="image/x-icon" href="<?='http://'.$_SERVER['SERVER_NAME']?>/favicon.ico" />
|
||||
<?php echo $this->headMeta()?>
|
||||
<?php echo $this->headTitle()?>
|
||||
<?php echo $this->headStyle()?>
|
||||
<?php echo $this->headLink()?>
|
||||
<?php echo $this->headScript()?>
|
||||
</head>
|
||||
<body>
|
||||
<h2>CONNEXION ODEA</h2>
|
||||
<?=$this->message?>
|
||||
<?=$this->form?>
|
||||
<div id="wrap">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<form class="form-signin" method="<?=$this->form->getMethod()?>" action="<?=$this->form->getAction()?>">
|
||||
<h2 class="form-signin-heading">ODEA</h2>
|
||||
<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>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml')?>
|
||||
</div>
|
||||
|
||||
<?php echo $this->inlineScript()?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -1,16 +1,25 @@
|
||||
<?php echo $this->doctype();?>
|
||||
<?php if ($this->ajax) {?>
|
||||
|
||||
<h4 class="logout">Vous avez été déconnecté.</h4>
|
||||
<h5 class="logout">Veuillez cliquer <a href="<?=$this->url?>">ici</a>
|
||||
</h5>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<?php echo $this->doctype()?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta();?>
|
||||
<?php echo $this->headTitle();?>
|
||||
<?=$this->headMeta();?>
|
||||
<?=$this->headTitle();?>
|
||||
</head>
|
||||
<body>
|
||||
<h4 class="logout">Vous avez été déconnecté.</h4>
|
||||
<p><?=$this->message?></p>
|
||||
<h5 class="logout">
|
||||
Si cette page ne disparait pas au bout de <?=$this->refresh?> seconde(s),
|
||||
Si cette page ne disparait pas au bout de <?=$this->refresh?> seconde(s),
|
||||
veuillez cliquer <a href="<?=$this->url?>">ici</a>
|
||||
</h5>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php }?>
|
39778
batch/codepostaux.csv
39778
batch/codepostaux.csv
File diff suppressed because it is too large
Load Diff
@ -1,110 +0,0 @@
|
||||
num,libelle,numRegion,codeRegionInsee
|
||||
03,Allier,3,83
|
||||
04,Alpes-de-Haute-Provence,21,93
|
||||
02,Aisne,19,26
|
||||
01,Ain,22,82
|
||||
05,Hautes-Alpes,21,93
|
||||
06,Alpes-Maritimes,21,93
|
||||
07,Ardèche,22,82
|
||||
08,Ardennes,7,21
|
||||
09,Ariège,15,73
|
||||
10,Aube,7,21
|
||||
11,Aude,11,91
|
||||
12,Aveyron,15,73
|
||||
13,Bouches-du-Rhône,21,93
|
||||
14,Calvados,18,25
|
||||
15,Cantal,3,83
|
||||
16,Charente,20,54
|
||||
17,Charente-Maritime,20,54
|
||||
18,Cher,6,24
|
||||
19,Corrèze,12,74
|
||||
2A,Corse-du-Sud,8,94
|
||||
20,Corse,8,94
|
||||
21,Côte-d'Or,4,26
|
||||
22,Côtes-d'Armor,5,53
|
||||
23,Creuse,12,74
|
||||
24,Dordogne,2,72
|
||||
25,Doubs,9,43
|
||||
26,Drôme,22,82
|
||||
27,Eure,17,23
|
||||
28,Eure-et-Loir,6,24
|
||||
29,Finistère,5,53
|
||||
30,Gard,11,91
|
||||
33,Gironde,2,72
|
||||
32,Gers,15,73
|
||||
34,Hérault,11,91
|
||||
31,Haute-Garonne,15,73
|
||||
36,Indre,6,24
|
||||
37,Indre-et-Loire,6,24
|
||||
35,Ille-et-Vilaine,5,53
|
||||
39,Jura,9,43
|
||||
38,Isère,22,82
|
||||
40,Landes,2,72
|
||||
41,Loir-et-Cher,6,24
|
||||
42,Loire,22,82
|
||||
43,Haute-Loire,3,83
|
||||
44,Loire-Atlantique,13,52
|
||||
45,Loiret,6,24
|
||||
46,Lot,15,73
|
||||
47,Lot-et-Garonne,2,72
|
||||
48,Lozère,11,91
|
||||
49,Maine-et-Loire,13,52
|
||||
53,Mayenne,13,52
|
||||
51,Marne,7,21
|
||||
50,Manche,18,25
|
||||
52,Haute-Marne,7,21
|
||||
54,Meurthe-et-Moselle,14,41
|
||||
56,Morbihan,5,53
|
||||
55,Meuse,14,41
|
||||
57,Moselle,14,41
|
||||
58,Nièvre,4,26
|
||||
59,Nord,16,31
|
||||
60,Oise,19,26
|
||||
62,Pas-de-Calais,16,31
|
||||
61,Orne,18,25
|
||||
63,Puy-de-Dôme,3,83
|
||||
67,Bas-Rhin,1,42
|
||||
68,Haut-Rhin,1,42
|
||||
69,Rhône,22,82
|
||||
64,Pyrénées-Atlantiques,2,72
|
||||
65,Hautes-Pyrénées,15,73
|
||||
66,Pyrénées-Orientales,11,91
|
||||
70,Haute-Saône,9,43
|
||||
71,Saône-et-Loire,4,26
|
||||
72,Sarthe,13,52
|
||||
73,Savoie,22,82
|
||||
74,Haute-Savoie,22,82
|
||||
75,Paris,10,11
|
||||
76,Seine-Maritime,17,23
|
||||
77,Seine-et-Marne,10,11
|
||||
78,Yvelines,10,11
|
||||
79,Deux-Sèvres,20,54
|
||||
80,Somme,19,26
|
||||
81,Tarn,15,73
|
||||
82,Tarn-et-Garonne,15,73
|
||||
83,Var,21,93
|
||||
84,Vaucluse,21,93
|
||||
85,Vendée,13,52
|
||||
86,Vienne,20,54
|
||||
87,Haute-Vienne,12,74
|
||||
88,Vosges,14,41
|
||||
89,Yonne,4,26
|
||||
90,"Territoire de Belfort",9,43
|
||||
91,Essonne,10,11
|
||||
92,Hauts-de-Seine,10,11
|
||||
93,Seine-Saint-Denis,10,11
|
||||
94,Val-de-Marne,10,11
|
||||
95,Val-d'Oise,10,11
|
||||
971,Guadeloupe,23,1
|
||||
972,Martinique,23,2
|
||||
973,Guyane,23,3
|
||||
974,Réunion,24,4
|
||||
200,Corse-du-Sud,8,94
|
||||
201,Corse-du-Sud,8,94
|
||||
202,Haute-Corse,8,94
|
||||
976,Mayotte,0,0
|
||||
988,Nouvelle-Calédonie,0,0
|
||||
987,Polynésie-Française,0,0
|
||||
975,Saint-Pierre-et-Miquelon,0,0
|
||||
986,Wallis-et-Futuna,0,0
|
||||
2B,Haute-Corse,8,94
|
|
@ -1,323 +0,0 @@
|
||||
fjCode,fjLibelle,fjInsee
|
||||
0,Indéterminée,0
|
||||
1,"Personne physique",1
|
||||
2,"Groupement de droit privé non doté de la personnalité morale",1
|
||||
3,"Personne morale de droit étranger",1
|
||||
4,"Personne morale de droit public soumise au droit commercial",1
|
||||
5,"Société commerciale",1
|
||||
6,"Autre personne morale immatriculée au RCS",1
|
||||
7,"Personne morale et organisme soumis au droit administratif",1
|
||||
8,"Organisme privé spécialisé",1
|
||||
9,"Groupement de droit privé",1
|
||||
11,"Artisan Commerçant",1
|
||||
12,Commerçant,1
|
||||
13,Artisan,1
|
||||
14,"Officier public ou ministériel",1
|
||||
15,"Profession libérale",1
|
||||
16,"Exploitant agricole",1
|
||||
17,"Agent commercial",1
|
||||
18,"Associé Gérant de société",1
|
||||
19,"(Autre) personne physique",1
|
||||
21,Indivision,1
|
||||
22,"Société créée de fait",1
|
||||
23,"Société en participation",1
|
||||
27,"Paroisse hors zone concordataire",1
|
||||
29,"Autre groupement de droit privé non doté de la personnalité morale",1
|
||||
31,"Personne morale de droit étranger, immatriculée au RCS (registre du commerce et des sociétés)",1
|
||||
32,"Personne morale de droit étranger, non immatriculée au RCS",1
|
||||
41,"Établissement public ou régie à caractère industriel ou commercial",1
|
||||
51,"Société coopérative commerciale particulière",1
|
||||
52,"Société en nom collectif",1
|
||||
53,"Société en commandite",1
|
||||
54,"Société à responsabilité limité",1
|
||||
55,"Société anonyme à conseil d'administration",1
|
||||
56,"Société anonyme à directoire",1
|
||||
57,"Société par actions simplifiée",1
|
||||
61,"Caisse d'épargne et de prévoyance",1
|
||||
62,"Groupement d'intérêt économique",1
|
||||
63,"Société coopérative agricole",1
|
||||
64,"Société d'assurance mutuelle",1
|
||||
65,"Société civile",1
|
||||
69,"Autre personne morale de droit privé inscrite au registre du commerce et des sociétés",1
|
||||
71,"Administration de l'état",1
|
||||
72,"Collectivité territoriale",1
|
||||
73,"Établissement public administratif",1
|
||||
74,"Autre personne morale de droit public administratif",1
|
||||
81,"Organisme gérant un régime de protection sociale à adhésion obligatoire",1
|
||||
82,"Organisme mutualiste",1
|
||||
83,"Comité d'entreprise",1
|
||||
84,"Organisme professionnel",1
|
||||
91,"Syndicat de propriétaires",1
|
||||
92,"Association loi 1901 ou assimilé",1
|
||||
93,Fondation,1
|
||||
99,"Autre personne morale de droit privé",1
|
||||
1000,"Entrepreneur Individuel à Responsabilité Limité",0
|
||||
1100,"Artisan Commerçant",1
|
||||
1200,Commerçant,1
|
||||
1300,Artisan,1
|
||||
1400,"Officier public ou ministériel",1
|
||||
1500,"Profession libérale",1
|
||||
1600,"Exploitant agricole",1
|
||||
1700,"Agent commercial",1
|
||||
1800,"Associé Gérant de société",1
|
||||
1900,"(Autre) personne physique",1
|
||||
2100,Indivision,0
|
||||
2110,"Indivision entre personnes physiques",1
|
||||
2120,"Indivision avec personne morale",1
|
||||
2200,"Société créée de fait",0
|
||||
2210,"Société créée de fait entre personnes physiques",1
|
||||
2220,"Société créée de fait avec personne morale",1
|
||||
2300,"Société en participation",0
|
||||
2310,"Société en participation entre personnes physiques",1
|
||||
2320,"Société en participation avec personne morale",1
|
||||
2385,"Société en participation de professions libérales",1
|
||||
2400,Fiducie,1
|
||||
2700,"Paroisse hors zone concordataire",1
|
||||
2900,"Autre groupement de droit privé non doté de la personnalité morale",1
|
||||
3110,"Représentation ou agence commerciale d'état ou organisme public étranger immatriculé au RCS",1
|
||||
3120,"Société étrangère immatriculée au RCS",1
|
||||
3205,"Organisation internationale",1
|
||||
3210,"État collectivité ou établissement public étranger",1
|
||||
3220,"Société étrangère non immatriculée au RCS",1
|
||||
3290,"(Autre) personne morale de droit étranger",1
|
||||
4110,"Établissement public national à caractère industriel ou commercial doté d'un comptable public",1
|
||||
4120,"Établissement public national à caractère industriel ou commercial non doté d'un comptable public",1
|
||||
4130,"Exploitant public",1
|
||||
4140,"Établissement public local à caractère industriel ou commercial",1
|
||||
4150,"Régie d'une collectivité locale à caractère industriel ou commercial",1
|
||||
4160,"Institution Banque de France",1
|
||||
5191,"Société de caution mutuelle",1
|
||||
5192,"Société coopérative de banque populaire",1
|
||||
5193,"Caisse de crédit maritime mutuel",1
|
||||
5194,"Caisse (fédérale) de crédit mutuel",1
|
||||
5195,"Association coopérative inscrite ( droit local Alsace Moselle )",1
|
||||
5196,"Caisse d'épargne et de prévoyance à forme coopérative",1
|
||||
5202,"Société en nom collectif",1
|
||||
5203,"Société en nom collectif coopérative",1
|
||||
5306,"Société en commandite simple",1
|
||||
5307,"Société en commandite simple coopérative",1
|
||||
5308,"Société en commandite par actions",1
|
||||
5309,"Société en commandite par actions coopérative",1
|
||||
5385,"Société d'exercice libéral en commandite par action",1
|
||||
5410,"SARL nationale",1
|
||||
5415,"SARL d'économie mixte",1
|
||||
5422,"SARL immobilière pour le commerce et l'industrie (SICOMI)",1
|
||||
5426,"Société immobilière de gestion",1
|
||||
5430,"Safer en SARL",1
|
||||
5431,"SARL mixte d'intérêt agricole",1
|
||||
5432,"SARL d'intérêt collectif agricole",1
|
||||
5442,"SARL d'attribution",1
|
||||
5443,"SARL coopérative de construction",1
|
||||
5451,"SARL coopérative de consommation",1
|
||||
5453,"SARL coopérative artisanale",1
|
||||
5454,"SARL coopérative d'intérêt maritime",1
|
||||
5455,"SARL coopérative de transports",1
|
||||
5458,"SARL coopérative ouvrière de production et de crédit",1
|
||||
5459,"SARL union de sociétés coopératives",1
|
||||
5460,"Autre SARL coopérative",1
|
||||
5485,"Société d'exercice libéral à responsabilité limitée",1
|
||||
5488,"Entreprise Unipersonnelle à Responsabilité Limitée",1
|
||||
5498,"SARL unipersonnelle",1
|
||||
5499,"Autre société à responsabilité limitée",1
|
||||
5505,"SA à participation ouvrière à conseil d'administration",1
|
||||
5510,"SA nationale à conseil d'administration",1
|
||||
5515,"SA d'économie mixte à conseil d'administration",1
|
||||
5520,"Société d'investissement à capital variable (SICAV) à conseil d'administration",1
|
||||
5522,"Société anonyme immobilière pour le commerce et l'industrie (SICOMI) à conseil d'administration",1
|
||||
5525,"Société anonyme immobilière d'investissement à conseil d'administration",1
|
||||
5530,"Safer anonyme à conseil d'administration",1
|
||||
5531,"Société anonyme mixte d'intérêt agricole (SMIA) à conseil d'administration",1
|
||||
5532,"Société anonyme mixte d'intérêt collectif agricole (SICA) à conseil d'administration",1
|
||||
5542,"Société anonyme d'attribution à conseil d'administration",1
|
||||
5543,"Société anonyme coopérative de construction à conseil d'administration",1
|
||||
5546,"SA de HLM à conseil d'administration",1
|
||||
5547,"SA coopérative de production de HLM à conseil d'administration",1
|
||||
5548,"SA de crédit immobilier à conseil d'administration",1
|
||||
5551,"SA coopérative de consommation à conseil d'administration",1
|
||||
5552,"SA coopérative de commerçants détaillants à conseil d'administration",1
|
||||
5553,"SA coopérative artisanale à conseil d'administration",1
|
||||
5554,"SA coopérative (d'intérêt) maritime à conseil d'administration",1
|
||||
5555,"SA coopérative de transports à conseil d'administration",1
|
||||
5558,"SA coopérative ouvrière de production et de crédit (SCOP) à conseil d'administration",1
|
||||
5559,"SA union de sociétés coopératives à conseil d'administration",1
|
||||
5560,"Autre SA coopérative à conseil d'administration",1
|
||||
5585,"Société d'exercice libéral à forme anonyme à conseil d'administration",1
|
||||
5599,"Autre SA à conseil d'administration",1
|
||||
5605,"SA à participation ouvrière à directoire",1
|
||||
5610,"SA nationale à directoire",1
|
||||
5615,"SA d'économie mixte à directoire",1
|
||||
5620,"Société d'investissement à capital variable (SICAV) à directoire",1
|
||||
5622,"Société immobilière pour le commerce et l'industrie (SICOMI) anonyme à directoire",1
|
||||
5625,"Société immobilière d'investissement anonyme à directoire",1
|
||||
5630,"Safer anonyme à directoire",1
|
||||
5631,"Société anonyme mixte d'intérêt agricole",1
|
||||
5632,"Société anonyme d'intérêt collectif agricole",1
|
||||
5642,"Société anonyme d'attribution à directoire",1
|
||||
5643,"Société anonyme coopérative de construction à directoire",1
|
||||
5646,"Société anonyme de HLM à directoire",1
|
||||
5647,"Société coopérative de production de HLM anonyme à directoire",1
|
||||
5648,"SA de crédit immobilier à directoire",1
|
||||
5651,"SA coopérative de consommation à directoire",1
|
||||
5652,"SA coopérative de commerçants détaillants à directoire",1
|
||||
5653,"SA coopérative artisanale à directoire",1
|
||||
5654,"SA coopérative (d'intérêt) maritime à directoire",1
|
||||
5655,"SA coopérative de transport à directoire",1
|
||||
5658,"SA coopérative ouvrière de production et de crédit (SCOP) à directoire",1
|
||||
5659,"SA union de sociétés coopératives à directoire",1
|
||||
5660,"(Autre) SA coopérative à directoire",1
|
||||
5685,"Société d'exercice libéral à forme anonyme à directoire",1
|
||||
5699,"Autre SA à directoire",1
|
||||
5710,"Société par actions simplifiée",1
|
||||
5720,"Société par actions simplifiée à associé unique ou société par actions simplifiée unipersonnelle",1
|
||||
5785,"Société d’exercice libéral par action simplifiée",1
|
||||
5800,"Société européenne",1
|
||||
6100,"Caisse d’épargne et de prévoyance",1
|
||||
6200,"Groupement d'intérêt économique",0
|
||||
6210,"Groupement européen d’intérêt économique",1
|
||||
6220,"Groupement d’intérêt économique",1
|
||||
6316,"Coopérative d’utilisation de matériel agricole en commun",1
|
||||
6317,"Société coopérative agricole",1
|
||||
6318,"Union de sociétés coopératives agricoles",1
|
||||
6411,"Société d’assurance mutuelle",1
|
||||
6412,"Société mutuelle d'assurance",1
|
||||
6413,"Union de sociétés mutuelles d'assurances",1
|
||||
6414,"Autre société non commerciale d'assurance",1
|
||||
6521,"Société civile de placement collectif immobilier",1
|
||||
6532,"Société civile d’intérêt collectif agricole",1
|
||||
6533,"Groupement agricole d’exploitation en commun",1
|
||||
6534,"Groupement foncier agricole",1
|
||||
6535,"Groupement agricole foncier",1
|
||||
6536,"Groupement forestier",1
|
||||
6537,"Groupement pastoral",1
|
||||
6538,"Groupement foncier rural",1
|
||||
6539,"Société civile foncière",1
|
||||
6540,"Société civile immobilière",1
|
||||
6541,"Société civile immobilière de construction vente",1
|
||||
6542,"Société civile d’attribution",1
|
||||
6543,"Société civile coopérative de construction",1
|
||||
6544,"Société immobilière d'accession progressive à la propriété",1
|
||||
6551,"Société civile coopérative de consommation",1
|
||||
6554,"Société civile coopérative (d’intérêt) maritime",1
|
||||
6558,"Société civile coopérative entre médecins",1
|
||||
6560,"Autre société civile coopérative",1
|
||||
6561,"SCP d’avocats",1
|
||||
6562,"SCP d’avocats aux conseil",1
|
||||
6563,"SCP d’avoués d’appel",1
|
||||
6564,"SCP d’huissiers",1
|
||||
6565,"SCP de notaires",1
|
||||
6566,"SCP de commissaires-priseurs",1
|
||||
6567,"SCP de greffiers de tribunal de commerce",1
|
||||
6568,"SCP de conseils juridiques",1
|
||||
6569,"SCP de commissaires aux comptes",1
|
||||
6571,"SCP de médecins",1
|
||||
6572,"SCP de dentistes",1
|
||||
6573,"SCP d’infirmiers",1
|
||||
6574,"SCP de masseurs kinésithérapeutes",1
|
||||
6575,"SCP de directeurs de laboratoire d’analyse médicale",1
|
||||
6576,"SCP de vétérinaires",1
|
||||
6577,"SCP de géomètres-experts",1
|
||||
6578,"SCP d’architectes",1
|
||||
6585,"(Autres) Société Civile professionnelle",1
|
||||
6588,"Société civile laitière",0
|
||||
6589,"Société civile de moyens",1
|
||||
6595,"Caisse (locale) de crédit mutuel",1
|
||||
6596,"Caisse de crédit agricole mutuel",1
|
||||
6597,"Société civile d’exploitation agricole",1
|
||||
6598,"Exploitation agricole à responsabilité limitée",1
|
||||
6599,"Autre société civile",1
|
||||
6901,"Autres personnes de droit privé inscrites au registre du commerce et des sociétés",1
|
||||
7111,"Autorité constitutionnelle",1
|
||||
7112,"Autorité administrative indépendante",1
|
||||
7113,Ministère,1
|
||||
7120,"Service central d’un ministère",1
|
||||
7130,"Service du ministère des Postes et Télécommunications",1
|
||||
7150,"Service du ministère de la Défense",1
|
||||
7160,"Service déconcentré à compétence nation. D’un ministère (hors Défense)",1
|
||||
7171,"Service déconcentré de l’État à compétence (inter) régionale",1
|
||||
7172,"Service déconcentré de l’État à compétence (inter) départementale",1
|
||||
7179,"(Autre) Service déconcentré de l’État à compétence territoriale",1
|
||||
7190,"Ecole nationale non dotée de la personnalité morale",1
|
||||
7210,Commune,1
|
||||
7220,Département,1
|
||||
7225,"Territoire d’Outre-mer",1
|
||||
7229,"(Autre) Collectivité territoriale",1
|
||||
7230,Région,1
|
||||
7312,"Commune associée",1
|
||||
7313,"Section de commune",1
|
||||
7314,"Ensemble urbain",1
|
||||
7321,"Association syndicale autorisée",1
|
||||
7322,"Association foncière urbaine",1
|
||||
7323,"Association foncière de remembrement",1
|
||||
7331,"Établissement public local d’enseignement",1
|
||||
7341,"Secteur de commune",1
|
||||
7342,"District urbain",1
|
||||
7343,"Communauté urbaine",1
|
||||
7345,"Syndicat intercommunal à vocation multiple",1
|
||||
7346,"Communauté de communes",1
|
||||
7347,"Communauté de villes",1
|
||||
7348,"Communauté d'agglomération",1
|
||||
7349,"Autre établissement public local de coopération non spécialisé ou entente",1
|
||||
7351,"Institution interdépartemental ou entente",1
|
||||
7352,"Institution interrégionale ou entente",1
|
||||
7353,"Syndicat intercommunal à vocation unique",1
|
||||
7354,"Syndicat mixte communal",1
|
||||
7355,"Autre syndicat mixte",1
|
||||
7356,"Commission syndicale pour la gestion des biens indivis des communes",1
|
||||
7361,"Centre communal d'action sociale",1
|
||||
7362,"Caisse des écoles",1
|
||||
7363,"Caisse de crédit municipal",1
|
||||
7364,"Établissement d'hospitalisation",1
|
||||
7365,"Syndicat inter hospitalier",1
|
||||
7366,"Établissement public local social et médico-social",1
|
||||
7371,"Office public d'habitation à loyer modéré",1
|
||||
7372,"Service départemental d'incendie",1
|
||||
7373,"Établissement public local culturel",1
|
||||
7378,"Régie d'une collectivité locale à caractère administratif",1
|
||||
7379,"(Autre) Établissement public administratif local",1
|
||||
7381,"Organisme consulaire",1
|
||||
7382,"Établissement public national ayant fonction d'administration centrale",1
|
||||
7383,"Établissement public national à caractère scientifique culturel et professionnel",1
|
||||
7384,"Autre établissement public national d'enseignement",1
|
||||
7385,"Autre établissement public national administratif à compétence territoriale limitée",1
|
||||
7389,"Établissement public national à caractère administratif",1
|
||||
7410,"Groupement d'intérêt public",1
|
||||
7430,"Établissement public des cultes d'Alsace-Lorraine",1
|
||||
7450,"Etablissement public administratif, cercle et foyer dans les armées",1
|
||||
7470,"Groupement de coopération sanitaire à gestion publique",1
|
||||
7490,"Autre personne morale de droit administratif",1
|
||||
7510,"Service d'une collectivité locale à comptabilité distincte",1
|
||||
7520,"Régie d'une collectivité locale non dotée de la personnalité morale",1
|
||||
8110,"Régime général de la sécurité sociale",1
|
||||
8120,"Régime spécial de sécurité sociale",1
|
||||
8130,"Institution de retraite complémentaire",1
|
||||
8140,"Mutualité sociale agricole",1
|
||||
8150,"Régime maladie des non-salariés non agricoles",1
|
||||
8160,"Régime vieillesse ne dépendant pas du régime général de la sécurité sociale",1
|
||||
8170,"Régime d'assurance chômage",1
|
||||
8190,"Autre régime de prévoyance sociale",1
|
||||
8210,Mutuelle,1
|
||||
8250,"Assurance mutuelle agricole",1
|
||||
8290,"Autre organisme mutualiste",1
|
||||
8310,"Comité central d'entreprise",1
|
||||
8311,"Comité d'établissement",1
|
||||
8410,"Syndicat de salariés",1
|
||||
8420,"Syndicat patronal",1
|
||||
8450,"Ordre professionnel ou assimilé",1
|
||||
8470,"Centre technique industriel ou comité professionnel du développement économique",1
|
||||
8490,"Autre organisme professionnel",1
|
||||
8510,"Institution de prévoyance",1
|
||||
8520,"Institution de retraite supplémentaire ",1
|
||||
9110,"Syndicat de copropriété",1
|
||||
9150,"Association syndicale libre",1
|
||||
9210,"Association non déclarée",1
|
||||
9220,"Association déclarée",1
|
||||
9221,"Association déclarée ""entreprises d'insertion par l'économique""",1
|
||||
9222,"Association intermédiaire",1
|
||||
9223,"Groupement d'employeurs",1
|
||||
9224,"Association d'avocats à responsabilité professionnelle individuelle",1
|
||||
9230,"Association déclarée reconnue d'utilité publique",1
|
||||
9240,Congrégation,1
|
||||
9260,"Association de droit local",1
|
||||
9300,Fondation,1
|
||||
9900,"Autre personne morale de droit privé",1
|
||||
9970,"Groupement de coopération sanitaire à gestion privée",1
|
|
@ -1,110 +0,0 @@
|
||||
#!/usr/bin/php -q
|
||||
<?php
|
||||
// Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
|
||||
|
||||
// Define application environment
|
||||
defined('APPLICATION_ENV')
|
||||
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
realpath(APPLICATION_PATH . '/../library'),
|
||||
get_include_path(),
|
||||
)));
|
||||
|
||||
/** Zend_Application */
|
||||
require_once 'Zend/Application.php';
|
||||
|
||||
// Create application, bootstrap, and run
|
||||
$application = new Zend_Application(
|
||||
APPLICATION_ENV,
|
||||
APPLICATION_PATH . '/configs/application.ini'
|
||||
);
|
||||
|
||||
$configuration = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini');
|
||||
Zend_Registry::set('configuration', $configuration);
|
||||
|
||||
try {
|
||||
$opts = new Zend_Console_Getopt(
|
||||
//Options
|
||||
array(
|
||||
'help|?' => "Affiche l'aide.",
|
||||
'all' => "Charge tout les éléments",
|
||||
'one' => "Charge un élément",
|
||||
)
|
||||
);
|
||||
$opts->parse();
|
||||
} catch (Zend_Console_Getopt_Exception $e) {
|
||||
echo $e->getUsageMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
//Usage
|
||||
if(count($opts->getOptions())==0 || isset($opts->help))
|
||||
{
|
||||
echo "Charge les données nécessaire à l'applicatioon à partir du webservice.";
|
||||
echo "\n\n";
|
||||
echo $opts->getUsageMessage();
|
||||
echo "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
//Utilisateur webservice
|
||||
define('LOGIN', '');
|
||||
define('PASSWORD', '');
|
||||
|
||||
$args = $opts->getRemainingArgs();
|
||||
$elements = array('naf');
|
||||
|
||||
if ($opts->all || $opts->one){
|
||||
require_once 'Scores/WsScores.php';
|
||||
$ws = new WsScores(LOGIN, PASSWORD);
|
||||
}
|
||||
|
||||
if ($opts->all)
|
||||
{
|
||||
foreach($elements as $element)
|
||||
{
|
||||
$reponse = $ws->getDataCSV($element);
|
||||
}
|
||||
|
||||
} elseif ($opts->one) {
|
||||
//Vérification
|
||||
$element = $args[0];
|
||||
if (!in_array($args[0], $elements)){
|
||||
echo 'Element inconnu !';
|
||||
}
|
||||
$reponse = $ws->getDataCSV($element);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Méthodes interne
|
||||
|
||||
function getFichier($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE,TRUE);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $output;
|
||||
}
|
||||
|
||||
function saveToDatabase($key, $filename)
|
||||
{
|
||||
//Vider la table
|
||||
$sql = "TRUNCATE $key";
|
||||
|
||||
//Sauvegarder toutes les lignes
|
||||
$cmd = "mysqlimport --ignore-lines=1 --fields-enclosed-by=\\\" --fields-terminated-by=, --user=USERNAME --password=PASSWORD ciblage $filename";
|
||||
exec($command);
|
||||
}
|
||||
|
||||
|
||||
?>
|
1478
batch/naf.csv
1478
batch/naf.csv
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user