Compare commits
691 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b161cf13a7 | ||
|
8dd8df9503 | ||
|
8ef3d03e11 | ||
|
90a9db1af9 | ||
|
ebb9c71832 | ||
|
ad492e74b7 | ||
|
425401f8eb | ||
|
3340c99443 | ||
|
a0981d0a66 | ||
|
a6dd1294d0 | ||
|
e10bc9d574 | ||
|
0a7f3b7c6d | ||
|
801993cd0b | ||
|
50ec0c9009 | ||
|
f6e5cc30a3 | ||
|
2b510ba1eb | ||
|
403411ec85 | ||
|
07e5d2d316 | ||
|
d5057c314d | ||
|
d51252b829 | ||
|
d0b6af7b1f | ||
|
80388d6e64 | ||
|
cfff5a3d74 | ||
|
f703eed68c | ||
|
577120979f | ||
|
3fe1ffa0e6 | ||
|
65c8980eb7 | ||
|
82c098cc6a | ||
|
89e1226ebf | ||
|
f968c9cb8c | ||
|
05c54cbf47 | ||
|
0b1512f9b1 | ||
|
e930a8bbeb | ||
|
7e439446d4 | ||
|
82b21d631d | ||
|
9e3545391f | ||
|
2eb5440573 | ||
|
cd8e318b1d | ||
|
f53575a435 | ||
|
4d32d30a14 | ||
|
f95a5f0927 | ||
|
a12873e7eb | ||
|
5a703145f6 | ||
|
81a4e690fa | ||
|
4ba0a041bb | ||
|
fc5cdc796e | ||
|
6f39ab82ae | ||
|
27c1e6964b | ||
|
af98ca2d07 | ||
|
c9f5ceb2c9 | ||
|
86bc121292 | ||
|
83d545c0c8 | ||
|
42865deac9 | ||
|
44e9dd0278 | ||
|
58495b61df | ||
|
0383b4d1f8 | ||
|
5383139da4 | ||
|
dbfaad4eea | ||
|
4de758ca38 | ||
|
15cdb9a46d | ||
|
6900b9a18b | ||
|
e1fdcf662e | ||
|
3f256dba7e | ||
|
75e191cbf0 | ||
|
e1305a5365 | ||
|
92e7788117 | ||
|
b5ff0b4654 | ||
|
caccc9d9fd | ||
|
9716e52619 | ||
|
07168bcb82 | ||
|
c7988a3953 | ||
|
09a3134052 | ||
|
e986fc30f1 | ||
|
fbaa25862e | ||
|
30c312b067 | ||
|
afcd6f0b4d | ||
|
acb2313b99 | ||
|
250e5c9819 | ||
|
e1951a6468 | ||
|
c1b1def04d | ||
|
39320764dc | ||
|
297acc9fcd | ||
|
5ebf98e79d | ||
|
3e78aad0c4 | ||
|
27df43931e | ||
|
7b2eb49921 | ||
|
1d827af35a | ||
|
d28ba0de01 | ||
|
05a7a3df36 | ||
|
f237db692b | ||
|
b92f2b1019 | ||
|
0dd41a8c11 | ||
|
eae1265e37 | ||
|
e2c371e251 | ||
|
1897655908 | ||
|
5ab102b6cf | ||
|
9de2875931 | ||
|
6eb2ed367b | ||
|
501533fc8f | ||
|
d622977dac | ||
|
08700967e2 | ||
|
33214f44dd | ||
|
d013580b01 | ||
|
010bc0fd87 | ||
|
4ae685d76d | ||
|
e91eed0e1a | ||
|
e5897edb25 | ||
|
337ff7750a | ||
|
4f37e8be76 | ||
|
dfb1be9d65 | ||
|
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 |
@ -1,65 +1,98 @@
|
||||
<?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 = $this->getResource('view');
|
||||
$pathStyle = '/themes/default/styles';
|
||||
$pathScript = '/themes/default/scripts';
|
||||
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('XHTML1_STRICT');
|
||||
$view->doctype('HTML5');
|
||||
|
||||
$view->headMeta()
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
|
||||
->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/qtip/jquery.qtip.min.css', 'all')
|
||||
->appendStylesheet('/libs/tree/themes/default/style.css')
|
||||
->appendStylesheet('/libs/ui-1.10.3/themes/smoothness/jquery-ui.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/jquery/jquery-1.11.3.min.js', 'text/javascript')
|
||||
->appendFile('/libs/jquery/jquery.cookie.js', 'text/javascript')
|
||||
->appendFile('/libs/ui-1.10.3/jquery-ui.min.js', 'text/javascript')
|
||||
->appendFile('/libs/qtip/jquery.qtip.min.js', 'text/javascript')
|
||||
->appendFile($pathScript.'/scripts.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
|
@ -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 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,374 @@
|
||||
<?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');
|
||||
|
||||
/**
|
||||
* 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_Fields();
|
||||
$insert = $fields->setCritere($cle, $valeur, $ex);
|
||||
|
||||
if ($insert) {
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($fields->getValues(), $user->globalRNCS);
|
||||
|
||||
//@todo : if $total = false then an error occured ?
|
||||
// et si nous avons une erreur alors faut-il retirer les critères de la session
|
||||
$total = $ciblage->execute();
|
||||
|
||||
//Define value return after counting
|
||||
$fields->setNb('total', $total);
|
||||
if ( $user->preferences['interface']['insee'] == 1 ) {
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
} else {
|
||||
$insee = null;
|
||||
}
|
||||
$fields->setNb('insee', $insee);
|
||||
|
||||
if ( $total !== false ) {
|
||||
//All is ok, save criteres and result to session
|
||||
$fields->setCritereSession();
|
||||
} else {
|
||||
$error = 1;
|
||||
}
|
||||
} else {
|
||||
$error = 2;
|
||||
}
|
||||
|
||||
//@todo : Ajouter les critères sous forme json_encode
|
||||
//Retour comptage, unité Insee
|
||||
$result = array(
|
||||
'count' => number_format($total, 0, '', ' '),
|
||||
'insee' => ($insee!==null) ? number_format($insee, 0, '', ' ') : null,
|
||||
'error' => $error,
|
||||
);
|
||||
echo json_encode($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage formulaire de sauvegarde
|
||||
*/
|
||||
|
||||
$this->view->assign('result', $result);
|
||||
}
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
$erreurs = new Zend_Session_Namespace('erreurs');
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$fields->clearCiblage();
|
||||
|
||||
unset($erreurs->erreurs);
|
||||
$this->_redirect('/');
|
||||
}
|
||||
|
||||
public function savedialogAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$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
|
||||
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);
|
||||
$fields = new Scores_Fields();
|
||||
$criteres = $fields->getCriteres();
|
||||
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 {
|
||||
//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"));
|
||||
|
||||
/**
|
||||
* 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
|
||||
$fields = new Scores_Fields();
|
||||
$criteres = $fields->getCriteres();
|
||||
$resultat = $fields->getNb('total');
|
||||
$nbInsee = $fields->getNb('insee');
|
||||
|
||||
//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) {
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($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);
|
||||
|
||||
$field = new Scores_Fields();
|
||||
$values = $field->getValues($structure);
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($values, $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();
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($fields->getValues(), $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();
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$enrichissement = new Enrichissement();
|
||||
$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[] = new Zend_Db_Expr($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, null, Zend_Db::FETCH_ASSOC);
|
||||
} catch(Zend_Db_Exception $e) {
|
||||
if (APPLICATION_ENV=='development') {
|
||||
echo $e->getMessage();
|
||||
echo "<br/>";
|
||||
echo $sql->__toString();
|
||||
}
|
||||
}
|
||||
|
||||
$liste = array();
|
||||
foreach ($result as $i => $tabData) {
|
||||
//Trier pour la sortie
|
||||
$tabSortie = array();
|
||||
foreach($tabEntete as $key) {
|
||||
//Add static values
|
||||
if ( array_key_exists($key, $fields) ) {
|
||||
if ( array_key_exists('values', $fields[$key]) ) {
|
||||
$values = $fields[$key]['values'];
|
||||
//Remplace value if exist
|
||||
if ( array_key_exists($tabData[$key], $values) ) {
|
||||
$tabData[$key] = $values[$tabData[$key]];
|
||||
}
|
||||
}
|
||||
}
|
||||
//Order data for CSV file
|
||||
$tabSortie[] = isset($tabData[$key]) ? $tabData[$key] : '';
|
||||
}
|
||||
$liste[] = $tabSortie;
|
||||
}
|
||||
|
||||
Zend_Registry::get('firebug')->info($liste);
|
||||
|
||||
$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,467 @@
|
||||
<?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();
|
||||
public function init()
|
||||
{
|
||||
$this->view->headLink()
|
||||
->appendStylesheet('/themes/default/styles/dashboard.css', 'all')
|
||||
->appendStylesheet('/libs/jqpagination/jqpagination.css', 'all');
|
||||
$this->view->headScript()
|
||||
->appendFile('/libs/jqpagination/jquery.jqpagination.min.js', 'text/javascript')
|
||||
->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);
|
||||
$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();
|
||||
$type = $request->getParam('type', null);
|
||||
$this->view->type = $type;
|
||||
|
||||
$page = $request->getParam('page', 1);
|
||||
$offset = 20;
|
||||
//cache data
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 86400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
|
||||
//Liste des ciblages par paquet de n
|
||||
$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;
|
||||
$sql = $criteresM->select()
|
||||
$backendOptions = array('cache_dir' => '../data/cache/');
|
||||
$cache = Zend_Cache::factory('Output','File',$frontendOptions,$backendOptions);
|
||||
if(($results = $cache->load($user->username)) === false) {
|
||||
$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);
|
||||
->order('dateAjout DESC');
|
||||
|
||||
$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'))
|
||||
$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, '%Y/%m/%d %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
if (count($comptage)>0){
|
||||
$info['resultat'] = $comptage[0]['resultat'];
|
||||
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
|
||||
$info['dateComptage'] = $comptage[0]['dateAjout'];
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
if (!empty($results)) {
|
||||
$cache->save($results, $user->username);
|
||||
}
|
||||
|
||||
$results[] = $info;
|
||||
}
|
||||
$this->view->assign('ciblages', $results);
|
||||
$this->view->assign('nbCiblage', $nbCiblage);
|
||||
//
|
||||
|
||||
|
||||
|
||||
//paginate results list
|
||||
$paginator = Zend_Paginator::factory($results);
|
||||
$this->view->paginator = $paginator;
|
||||
$itemCount = 5;
|
||||
$page = $this->_getParam('page', 1);
|
||||
$paginator->setCurrentPageNumber($page);
|
||||
$paginator->setItemCountPerPage($itemCount);
|
||||
$this->view->assign('itemCount', $itemCount);
|
||||
//end
|
||||
$this->view->comptages = $results;
|
||||
|
||||
}
|
||||
//
|
||||
$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');
|
||||
|
||||
/**
|
||||
* 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 = $enrichissements->fetchAll($sql);
|
||||
|
||||
//paginate results list
|
||||
$paginatorEnrichissements = Zend_Paginator::factory($enrichissements);
|
||||
$this->view->enrichissements = $paginatorEnrichissements;
|
||||
$itemCountEnrichissements = 5;
|
||||
$pageEnrichissements = $this->_getParam('pageEnrichissements', 1);
|
||||
$paginatorEnrichissements->setCurrentPageNumber($pageEnrichissements);
|
||||
$paginatorEnrichissements->setItemCountPerPage($itemCountEnrichissements);
|
||||
$this->view->assign('itemCountEnrichissements', $itemCountEnrichissements);
|
||||
//end
|
||||
}
|
||||
|
||||
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 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->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');
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
//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);
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
//Add label to struct for display
|
||||
$infosCriteres[] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
//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);
|
||||
require_once 'Scores/Enrichissement.php';
|
||||
$enrichissement = new Enrichissement();
|
||||
$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.min.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,306 @@ 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()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idCriteres = $request->getParam('id', null);
|
||||
$idProfil = $request->getParam('profil', null);
|
||||
$ref = $request->getParam('ref');
|
||||
|
||||
//Si forfait check si le montant restant est suffisant
|
||||
|
||||
|
||||
//Identifiant comptage
|
||||
$comptage = new Application_Model_CiblageComptages();
|
||||
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
|
||||
$result = $comptage->fetchRow($sql);
|
||||
$idComptage = $result['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);
|
||||
|
||||
//Informations utilisateur
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Récupération des SIRET
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($structure, $user->globalRNCS);
|
||||
$infosExtraction = $ciblage->execute(true);
|
||||
|
||||
|
||||
/*
|
||||
* @todo :
|
||||
* Vérifier le nombre d'éléments avec le nombre de ligne
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
//Attention 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'),
|
||||
);
|
||||
$identifiantsM = new Application_Model_CiblageEnrichissementIdentifiants();
|
||||
$idIdentifiant = $identifiantsM->insert($data);
|
||||
|
||||
//@todo : ajouter la valeur (prix) du fichier au compteur global afin de décompter du forfait
|
||||
|
||||
$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();
|
||||
|
||||
//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(){
|
||||
}
|
||||
}
|
||||
|
246
application/controllers/FieldsController.php
Normal file
246
application/controllers/FieldsController.php
Normal file
@ -0,0 +1,246 @@
|
||||
<?php
|
||||
class FieldsController extends Zend_Controller_Action
|
||||
{
|
||||
/**
|
||||
* Display fields
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->headScript()
|
||||
->appendFile('/libs/tree/jquery.jstree.js', 'text/javascript')
|
||||
->appendFile('/themes/default/scripts/fields.js', 'text/javascript');
|
||||
|
||||
$field = new Scores_Fields();
|
||||
$this->view->fields = $field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset criteres by family
|
||||
*/
|
||||
public function resetAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$family = $request->getParam('family');
|
||||
if ( !empty($family) )
|
||||
{
|
||||
$fields = new Scores_Fields();
|
||||
$fields->resetFamille($family);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage autocomplete
|
||||
*/
|
||||
public function autocompleteAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$request = $this->getRequest();
|
||||
$name = $request->getParam('name');
|
||||
$q = strtolower($request->getParam('q'));
|
||||
|
||||
$output = array();
|
||||
|
||||
switch ($name) {
|
||||
case 'ape_etab':
|
||||
case 'ape_entrep':
|
||||
/**
|
||||
* @todo : Ajouter la recherche par code
|
||||
*/
|
||||
$queries = explode(' ', $q);
|
||||
$separator = ' , ';
|
||||
$table = new Application_Model_CiblageNaf();
|
||||
$sql = $table->select();
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
$i = 0;
|
||||
foreach ($queries as $item) {
|
||||
$i++;
|
||||
if (empty($where)) {
|
||||
$op = 'LIKE ';
|
||||
} elseif ($i < count($queries)) {
|
||||
$op = ' OR ';
|
||||
}
|
||||
if (strlen($item)>2) {
|
||||
$where.= $op.'"%'.strtolower($item).'%"';
|
||||
}
|
||||
}
|
||||
$sql->where("LOWER(lib) ".$where);
|
||||
}
|
||||
$sql->where('niveau = 5');
|
||||
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->lib . $separator . $item->code,
|
||||
'value' => $item->code
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 'geo':
|
||||
|
||||
//Replace characters ' and - in space
|
||||
$q = preg_replace("/['-]/", ' ', $q);
|
||||
|
||||
//Remove characters
|
||||
$q = preg_replace("/^[a-z]\s/i", '', $q);
|
||||
|
||||
//Detect if we have string
|
||||
if ( preg_match("/[a-zA-Z]+/", $q) )
|
||||
{
|
||||
$queries = explode(' ', $q);
|
||||
Zend_Registry::get('firebug')->info($queries);
|
||||
//Région
|
||||
$table = new Application_Model_CiblageRegions();
|
||||
$sql = $table->select();
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
$i = 0;
|
||||
foreach ($queries as $item) {
|
||||
$i++;
|
||||
if (empty($where)) {
|
||||
$op = 'LIKE ';
|
||||
} else {
|
||||
$op = ' OR ';
|
||||
}
|
||||
if (strlen($item)>2) {
|
||||
$where.= $op.'"%'.strtolower($item).'%"';
|
||||
}
|
||||
}
|
||||
$sql->where("LOWER(NC) ".$where);
|
||||
}
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->NCCENR . ' (Région)',
|
||||
'value' => 'R'.$item->REGION
|
||||
);
|
||||
}
|
||||
|
||||
//Département
|
||||
$table = new Application_Model_CiblageDepartements();
|
||||
$sql = $table->select();
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
$i = 0;
|
||||
foreach ($queries as $item) {
|
||||
$i++;
|
||||
if (empty($where)) {
|
||||
$op = 'LIKE ';
|
||||
} else {
|
||||
$op = ' OR ';
|
||||
}
|
||||
if (strlen($item)>2) {
|
||||
$where.= $op.'"%'.strtolower($item).'%"';
|
||||
}
|
||||
}
|
||||
$sql->where("LOWER(libdep) ".$where);
|
||||
}
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->libdep . ' (Département)',
|
||||
'value' => 'D'.$item->numdep
|
||||
);
|
||||
}
|
||||
|
||||
//Ville
|
||||
$table = new Application_Model_CiblageCodePostaux();
|
||||
$sql = $table->select();
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
$i = 0;
|
||||
foreach ($queries as $item) {
|
||||
$i++;
|
||||
if (empty($where)) {
|
||||
$op = 'LIKE ';
|
||||
} else {
|
||||
$op = ' OR ';
|
||||
}
|
||||
if (strlen($item)>2) {
|
||||
$where.= $op.'"%'.strtolower($item).'%"';
|
||||
}
|
||||
}
|
||||
$sql->where("LOWER(Commune) ".$where);
|
||||
}
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->Commune . ', '. $item->Codepos .' (Ville)',
|
||||
'value' => 'C'.$item->INSEE
|
||||
);
|
||||
}
|
||||
|
||||
} elseif ( preg_match('/[0-9]{1,5}/', $q) ) {
|
||||
|
||||
//Code Département
|
||||
if (strlen($q)==2) {
|
||||
$table = new Application_Model_CiblageDepartements();
|
||||
$sql = $table->select()->where('numdep=?', $q);
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->libdep . ' (Département)',
|
||||
'value' => 'D'.$item->numdep
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//Code Postal
|
||||
$table = new Application_Model_CiblageCodePostaux();
|
||||
$sql = $table->select()->where('Codepos LIKE "'.$q.'%"');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->Commune . ', '. $item->Codepos .' (Ville)',
|
||||
'value' => 'C'.$item->INSEE
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case 'cj':
|
||||
$table = new Application_Model_CiblageFormeJuridique();
|
||||
$separator = ' , ';
|
||||
$sql = $table->select();
|
||||
|
||||
$queries = explode(' ', $q);
|
||||
if (count($queries)>0) {
|
||||
$where = '';
|
||||
$i = 0;
|
||||
foreach ($queries as $item) {
|
||||
$i++;
|
||||
if (empty($where)) {
|
||||
$op = 'LIKE ';
|
||||
} else {
|
||||
$op = ' OR ';
|
||||
}
|
||||
if (strlen($item)>3) {
|
||||
$where.= $op.'"%'.strtolower($item).'%"';
|
||||
}
|
||||
}
|
||||
$sql->where('LOWER(fjLibelle) '.$where);
|
||||
}
|
||||
$sql->where('LENGTH(fjCode) = 4');
|
||||
$result = $table->fetchAll($sql);
|
||||
foreach ($result as $item) {
|
||||
$output[] = array(
|
||||
'label' => $item->fjLibelle . $separator . $item->fjCode,
|
||||
'value' => $item->fjCode
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
//No results
|
||||
if (count($output) == 0) {
|
||||
$output[] = array('label' => 'Aucun résultat.', 'value' => '');
|
||||
}
|
||||
$this->view->assign('output', $output);
|
||||
}
|
||||
|
||||
public function checkvalue(){}
|
||||
|
||||
}
|
591
application/controllers/GestionController.php
Normal file
591
application/controllers/GestionController.php
Normal file
@ -0,0 +1,591 @@
|
||||
<?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_Fields();
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
//Add label to struct for display
|
||||
$infosCriteres[] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
$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/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$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/Enrichissement.php';
|
||||
$fieldsM = new Enrichissement();
|
||||
$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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function consoAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
$idClient= $request->getParam('idClient', null);
|
||||
$this->view->assign('idClient', $idClient);
|
||||
|
||||
// --- Contrat
|
||||
$paramsM = new Application_Model_CiblageCustomerParams();
|
||||
$sql = $paramsM->select()->where('idClient = ?', $idClient);
|
||||
$params = $paramsM->fetchRow($sql);
|
||||
|
||||
$contratDebut = new Zend_Date($params->dateContrat, 'yy-MM-dd');
|
||||
$contratFin = new Zend_Date($params->dateContrat, 'yy-MM-dd');
|
||||
$contratFin->addMonth($params->periodContrat)->subDay(1);
|
||||
|
||||
$this->view->ContratDateDebut = $contratDebut->toString('yyyy-MM-dd');
|
||||
$this->view->ContratDateFin = $contratFin->toString('yyyy-MM-dd');
|
||||
|
||||
// --- Création du tableau pour la consomation
|
||||
|
||||
// --- Recherche tous les idProfil - login
|
||||
|
||||
// --- Recherche des fichiers pour chaque id
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,72 +1,112 @@
|
||||
<?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('./');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function criteresAction()
|
||||
{
|
||||
$ajax = $this->getRequest()->getParam('ajax');
|
||||
if($ajax)
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
$infosCriteres = array();
|
||||
|
||||
$decodeCriteres = $fields->getCriteres();
|
||||
|
||||
//Construction affichage des critères
|
||||
foreach ( $decodeCriteres as $key => $item ) {
|
||||
|
||||
$inValue = $fields->getValueLabel($key, $item['in']);
|
||||
$exValue = $fields->getValueLabel($key, $item['ex']);
|
||||
|
||||
$infosCriteres[$key] = array(
|
||||
'label' => $fields->getLabel($key),
|
||||
'in' => $inValue,
|
||||
'ex' => $exValue,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->infos = $infosCriteres;
|
||||
}
|
||||
|
||||
public function criterelistAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$critere = $request->getParam('key');
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
$values = $fields->getCritere($critere);
|
||||
|
||||
$this->view->assign('critereName', $critere);
|
||||
|
||||
//Inclusion
|
||||
if (count($values['in'])>0) {
|
||||
$inLabels = $fields->getValueLabel($critere, $values['in']);
|
||||
$inValues = array_values($values['in']);
|
||||
$this->view->assign('inLabels', $inLabels);
|
||||
$this->view->assign('inValues', $inValues);
|
||||
}
|
||||
|
||||
//Exclusion
|
||||
if (count($values['ex'])>0) {
|
||||
$exLabels = $fields->getValueLabel($critere, $values['ex']);
|
||||
$exValues = array_values($values['ex']);
|
||||
$this->view->assign('exLabels', $exLabels);
|
||||
$this->view->assign('exValues', $exValues);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function removeAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
$nameCritereToDelete = $request->getParam('critere');
|
||||
$posInList = $request->getParam('in', false);
|
||||
$posExList = $request->getParam('ex', false);
|
||||
|
||||
$fields = new Scores_Fields();
|
||||
|
||||
if ($posInList!==false) {
|
||||
$fields->unsetCritereValue($nameCritereToDelete, $posInList);
|
||||
} elseif ($posExList!==false) {
|
||||
$fields->unsetCritereValue($nameCritereToDelete, $posExList, true);
|
||||
} else {
|
||||
$fields->unsetCritere($nameCritereToDelete);
|
||||
}
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($fields->getValues(), $user->globalRNCS);
|
||||
|
||||
$total = $ciblage->execute();
|
||||
$fields->setNb('total', $total);
|
||||
|
||||
if ($user->preferences['interface']['insee']==1) {
|
||||
$insee = $ciblage->calculRedevanceInsee();
|
||||
} else {
|
||||
$insee = null;
|
||||
}
|
||||
$fields->setNb('insee', $insee);
|
||||
$fields->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,89 @@
|
||||
<?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->inlineScript()
|
||||
->appendFile('/libs/jquery/jquery-1.10.1.min.js')
|
||||
->appendFile('/libs/jquery/jquery.infieldlabel.min.js');
|
||||
|
||||
//@todo : gestion des affichages particuliers pour les clients
|
||||
$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_AuthAdapter($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 {
|
||||
$this->_redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
$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');
|
||||
?>
|
6
application/models/CiblageCodePostaux.php
Normal file
6
application/models/CiblageCodePostaux.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageCodePostaux extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fields_codepostaux';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageComptages.php
Normal file
6
application/models/CiblageComptages.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageComptages extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'ciblage_comptages';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageCriteres.php
Normal file
6
application/models/CiblageCriteres.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageCriteres extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'ciblage_criteres';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageCustomerParams.php
Normal file
6
application/models/CiblageCustomerParams.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageCustomerParams extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'customer_params';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageDepartements.php
Normal file
6
application/models/CiblageDepartements.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageDepartements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'fields_departements';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageEnrichissementIdentifiants.php
Normal file
6
application/models/CiblageEnrichissementIdentifiants.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageEnrichissementIdentifiants extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'enrichissement_identifiants';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageEnrichissementProfils.php
Normal file
6
application/models/CiblageEnrichissementProfils.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageEnrichissementProfils extends Zend_Db_Table_Abstract
|
||||
{
|
||||
public $_name = 'enrichissement_profils';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
7
application/models/CiblageFormeJuridique.php
Normal file
7
application/models/CiblageFormeJuridique.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class Application_Model_CiblageFormeJuridique extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fields_formejuridique';
|
||||
protected $_primary = 'fjCode';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageMinMax.php
Normal file
6
application/models/CiblageMinMax.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageMinMax extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fields_minmax';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblageNaf.php
Normal file
6
application/models/CiblageNaf.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblageNaf extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fields_naf';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
6
application/models/CiblagePrefs.php
Normal file
6
application/models/CiblagePrefs.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_CiblagePrefs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'customer_prefs';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
7
application/models/CiblageRegions.php
Normal file
7
application/models/CiblageRegions.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
class Application_Model_CiblageRegions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fields_regions';
|
||||
protected $_schema = 'ciblage';
|
||||
}
|
||||
|
@ -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';
|
||||
|
||||
}
|
6
application/models/JoSphinxIdx.php
Normal file
6
application/models/JoSphinxIdx.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_JoSpinxIdx extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'sphinx_idx';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -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';
|
||||
}
|
||||
|
6
application/models/Sdv1Clients.php
Normal file
6
application/models/Sdv1Clients.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Clients extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
13
application/models/Sdv1Utilisateurs.php
Normal file
13
application/models/Sdv1Utilisateurs.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Utilisateurs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs';
|
||||
protected $_schema = 'sdv1';
|
||||
protected $_referenceMap = array(
|
||||
'Reporter' => array(
|
||||
'columns' => 'idClient',
|
||||
'refTableClass' => 'Sdv1Clients',
|
||||
'refColumns' => 'id'
|
||||
),
|
||||
);
|
||||
}
|
6
application/models/Sdv1UtilisateursService.php
Normal file
6
application/models/Sdv1UtilisateursService.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1UtilisateursService extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs_service';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,202 +1,380 @@
|
||||
<?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
|
||||
{
|
||||
protected $display = true;
|
||||
protected $name = '';
|
||||
|
||||
public function Field($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
//Read the dico
|
||||
$fields = new Scores_Fields();
|
||||
$params = $fields->get($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>';
|
||||
|
||||
$label = $labelG = $fields->getLabel($name);
|
||||
|
||||
$title = '';
|
||||
if ( array_key_exists('title', $params) && !empty($params['title']) ) {
|
||||
$title = $this->view->translate($params['title']);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function structureHTML($label, $html, $liens = array())
|
||||
{
|
||||
|
||||
//How many type of fields is defined
|
||||
$nbFields = count($params['fields']);
|
||||
|
||||
$display = true;
|
||||
$out = '';
|
||||
$out.= $this->structureLabel($label);
|
||||
$out.= '<div class="field">'.$html.$this->structureLink($liens).'</div>';
|
||||
|
||||
//If more than one field exist we need to make a special display
|
||||
if ( $nbFields > 1) {
|
||||
$out.= '<div class="fieldgrp clearfix">';
|
||||
$out.= $this->structureLabel($label);
|
||||
$out.= '<div class="field">';
|
||||
foreach ( $params['fields'] as $type => $options )
|
||||
{
|
||||
switch ($type) {
|
||||
case 'tree':
|
||||
$href = $this->view->url(array('controller' => 'arborescence', 'action' => $options['action'], 'key' => $name));
|
||||
$out.= '<a class="arborescence" title="'.$options['title'].'" href="'.$href.'">';
|
||||
$out.= 'Arborescence';
|
||||
$out.= '</a>';
|
||||
break;
|
||||
case 'text':
|
||||
$out.= '<a class="text" title="'.$options['title'].'" href="#" id="'.$name.'" >';
|
||||
$out.= 'Recherche';
|
||||
$out.= '</a>';
|
||||
break;
|
||||
case 'list':
|
||||
$out.= '<a class="dlist" title="'.$options['title'].'" href="#" id="'.$name.'" >';
|
||||
$out.= 'Liste';
|
||||
$out.= '</a>';
|
||||
break;
|
||||
}
|
||||
$out.= ' ';
|
||||
}
|
||||
$out.= '</div>';
|
||||
$out.= '</div>';
|
||||
//Masquer les champs
|
||||
$display = false;
|
||||
}
|
||||
|
||||
//Draw fields
|
||||
foreach ( $params['fields'] as $type => $options )
|
||||
{
|
||||
switch($type)
|
||||
{
|
||||
case 'select':
|
||||
$html = $this->selectHTML($name, $options);
|
||||
break;
|
||||
case 'selectMultiple':
|
||||
$html = $this->selectMultipleHTML($name, $options);
|
||||
break;
|
||||
case 'intervalSelect':
|
||||
$html = $this->intervalSelectHTML($name, $options);
|
||||
break;
|
||||
case 'checkbox':
|
||||
$html = $this->checkboxHTML($name, $options);
|
||||
break;
|
||||
case 'intervalDate':
|
||||
$html = $this->intervalDateHTML($name, $options);
|
||||
break;
|
||||
case 'interval':
|
||||
$html = $this->intervalHTML($name, $options);
|
||||
break;
|
||||
case 'date':
|
||||
$html = $this->dateHTML($name, $options);
|
||||
break;
|
||||
case 'text':
|
||||
$html = $this->textHTML($name, $options);
|
||||
break;
|
||||
case 'textarea':
|
||||
$html = $this->textareaHTML($name, $options);
|
||||
break;
|
||||
case 'radio':
|
||||
$html = $this->radioHTML($name, $options);
|
||||
break;
|
||||
case 'file':
|
||||
$html = $this->fileuploadHtml($name, $options);
|
||||
break;
|
||||
case 'tree':
|
||||
//Do nothing
|
||||
break;
|
||||
case 'list':
|
||||
$html = $this->textareaHTML($name, $options);
|
||||
break;
|
||||
default:
|
||||
$html = $this->structureHTML($name, '');
|
||||
break;
|
||||
}
|
||||
|
||||
$label = $labelG;
|
||||
if ( array_key_exists('label', $options) ) {
|
||||
$label = $options['label'];
|
||||
}
|
||||
|
||||
$style = '';
|
||||
$class = ' class="fieldgrp"';
|
||||
if ( $display===false ) {
|
||||
$style = ' style="display:none;"';
|
||||
}
|
||||
if ( !empty($title) ) {
|
||||
$title = ' title="'.$title.'"';
|
||||
}
|
||||
|
||||
$out.= '<div id="field_'.$type.'_'.$this->name.'" '.$class.''.$style.''.$title.'>';
|
||||
$out.= $this->structureLabel($this->view->translate($label));
|
||||
$out.= '<div class="field">'.$html.'</div>';
|
||||
$out.= '</div>';
|
||||
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Définition du label
|
||||
* @param unknown_type $label
|
||||
*/
|
||||
private function structureLabel($label)
|
||||
{
|
||||
return '<label>'.$label.'</label>';
|
||||
$return = '<label>'.$label.'</label>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Définition des liens
|
||||
*/
|
||||
private function structureLink($liens = array())
|
||||
|
||||
protected function getMinMax($name, $valeur)
|
||||
{
|
||||
$html = '';
|
||||
if (count($liens)>0) {
|
||||
foreach($liens as $lien){
|
||||
$html.= '<a href="'.$lien['url'].'">'.$lien['lib'].'</a>';
|
||||
}
|
||||
if(!empty($name)) {
|
||||
//$fields = new Scores_Fields();
|
||||
//$default = $fields->getMinMax($name);
|
||||
if(empty($valeur[0])){$valeur[0] = $default[0]['min'];}
|
||||
if(empty($valeur[1])){$valeur[1] = $default[0]['max'];}
|
||||
}
|
||||
if (!empty($html)) {
|
||||
return '<span>'.$html.'</span>';
|
||||
}
|
||||
return '';
|
||||
return ($valeur);
|
||||
}
|
||||
|
||||
private function intervalSelectHTML($name, $field)
|
||||
|
||||
private function intervalSelectHTML($name, $options)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$session = new Scores_Fields();
|
||||
$sessionValeur = explode(',', $session->getCritere($name));
|
||||
|
||||
$minMax = $this->getMinMax($name, array(0,0));
|
||||
|
||||
$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>';
|
||||
foreach($options['value'] as $elements) {
|
||||
if($elements[0] == 0)
|
||||
$return .= '<option value="'.$minMax[0].'">Min</option>';
|
||||
else
|
||||
$return .= '<option '.(($sessionValeur[0] == $elements[0])?'selected':'').' value="'. $elements[0].'">'.number_format($elements[0], 0,'', ' ').'</option>';
|
||||
}
|
||||
|
||||
$return .= '</select> à ';
|
||||
|
||||
$return .= '</select> '.$this->view->translate('à').' ';
|
||||
$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>';
|
||||
foreach($options['value'] as $elements) {
|
||||
if($elements[1] == 0)
|
||||
$return .= '<option value="'.$minMax[1].'">Max</option>';
|
||||
else
|
||||
$return .= '<option '.(($sessionValeur[1] == $elements[1])?'selected':'').' 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 .= ' <span id="'.$name.'"><a href="" class="intervalSelect" id="'.$name.'">'.$this->view->translate('Valider').'</a></span>';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
/* Select */
|
||||
private function selectMultipleHTML($name, $field)
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown_type $name
|
||||
* @param unknown_type $options
|
||||
*/
|
||||
protected function checkboxHTML($name, $options)
|
||||
{
|
||||
$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);
|
||||
$session = new Scores_Fields();
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
|
||||
$select = '';
|
||||
if ($sessionValeur==1) $select = ' checked';
|
||||
$return = '<input type="checkbox" class="criteres" name="'.$name.'" value="'.$options['value'].'"'.$select.'>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
/* Select Multiple */
|
||||
private function selectHTML($name, $field)
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown_type $name
|
||||
* @param unknown_type $options
|
||||
* @return string
|
||||
*/
|
||||
protected function selectMultipleHTML($name, $options)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$session = new Scores_Fields();
|
||||
$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) {
|
||||
|
||||
$return = '<select size="'.count($options['value']).'" class="criteres " name="'.$name.'" multiple>';
|
||||
foreach($options['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($sessionValeur != null) and $sessionValeur == $value)
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
if( !empty($sessionValeur) ) {
|
||||
if ( is_array($sessionValeur) && in_array($value, $sessionValeur) ) {
|
||||
$selected = " selected";
|
||||
}
|
||||
}
|
||||
$return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
return ($return);
|
||||
$return .= '<a href="#" class="selectMultiple">Sélectionner</a>';
|
||||
$return .= ' <a href="#" class="selectMultipleEx">Exclure</a>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown_type $name
|
||||
* @param unknown_type $options
|
||||
* @return string
|
||||
*/
|
||||
protected function selectHTML($name, $options)
|
||||
{
|
||||
$session = new Scores_Fields();
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
|
||||
if( is_array($sessionValeur) ) {
|
||||
$sessionValeur = implode(',', $sessionValeur);
|
||||
}
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option '.(($sessionValeur == '-')?'selected':'').' value="-">-</option>';
|
||||
|
||||
foreach($options['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if( $sessionValeur!==null && $sessionValeur != "-" && $sessionValeur==$value )
|
||||
$selected = " selected";
|
||||
$return .= '<option'.$selected.' value="'.$value.'">'.$this->view->translate($label).'</option>';
|
||||
}
|
||||
$return .= '</select>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
protected function intervalDateHTML($name, $options)
|
||||
{
|
||||
$session = new Scores_Fields();
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
|
||||
$return = '';
|
||||
|
||||
$return.= '<select name="'.$name.'1_j" style="width:45px;">';
|
||||
for ($i=1;$i<=31;$i++) {
|
||||
$return.= '<option>'.str_pad($i,2,'0',STR_PAD_LEFT).'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
$return.= '<select name="'.$name.'1_m" style="width:45px;">';
|
||||
for ($i=1;$i<=12;$i++) {
|
||||
$return.= '<option>'.str_pad($i,2,'0',STR_PAD_LEFT).'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
$return.= '<select name="'.$name.'1_a" style="width:60px;">';
|
||||
for ($i=1900;$i<=date('Y');$i++) {
|
||||
$return.= '<option>'.$i.'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
|
||||
$return.= ' '.$this->view->translate('au').' ';
|
||||
|
||||
$return.= '<select name="'.$name.'2_j" style="width:45px;">';
|
||||
for ($i=1;$i<=31;$i++) {
|
||||
$select = '';
|
||||
if ($i==date('d')) {
|
||||
$select = ' selected';
|
||||
}
|
||||
$return.= '<option'.$select.'>'.str_pad($i,2,'0',STR_PAD_LEFT).'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
$return.= '<select name="'.$name.'2_m" style="width:45px;">';
|
||||
for ($i=1;$i<=12;$i++) {
|
||||
$select = '';
|
||||
if ($i==date('m')) {
|
||||
$select = ' selected';
|
||||
}
|
||||
$return.= '<option'.$select.'>'.str_pad($i,2,'0',STR_PAD_LEFT).'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
$return.= '<select name="'.$name.'2_a" style="width:60px;">';
|
||||
$lastYear = date('Y');
|
||||
for ($i=1900;$i<=$lastYear;$i++) {
|
||||
$select = '';
|
||||
if ($i==$lastYear) {
|
||||
$select = ' selected';
|
||||
}
|
||||
$return.= '<option'.$select.'>'.$i.'</option>';
|
||||
}
|
||||
$return.= '</select>';
|
||||
$return .= '<br/><a href="#" id="'.$name.'" class="intervalDate">'.$this->view->translate('Valider').'</a>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/* Interval */
|
||||
private function intervalHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
$session = new Scores_Fields();
|
||||
$valeur = $session->getCritere($name);
|
||||
|
||||
|
||||
$class = '';
|
||||
if (array_key_exists('class', $field)) {
|
||||
$class = $field['class'];
|
||||
}
|
||||
$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 .= '<input class="'.$class.'" type="text" name="'.$name.'1" value="'.$valeur[0].'" /> '.$this->view->translate('à').' ';
|
||||
$return .= '<input class="'.$class.'" type="text" name="'.$name.'2" value="'.$valeur[1].'" />';
|
||||
$return .= ' <a href="" class="interval" id="'.$name.'">'.$this->view->translate('Valider').'</a>';
|
||||
$return .= '</div>';
|
||||
|
||||
return ($return);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/* Dates */
|
||||
private function dateHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$session = new Scores_Fields();
|
||||
|
||||
$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)
|
||||
protected function textHTML($name, $options)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
$return = '<input style="border:1px inset silver;width:60%" class="criteres" type="text" name="'.$name.'" value="'.$session->getCritere($name).'" />';
|
||||
|
||||
return ($return);
|
||||
$return = '<input type="text" class="criteres autocomplete" name="'.$name.'" />';
|
||||
$return.= '<ul id="'.$name.'" class="selectqueries"></ul>';
|
||||
$return.= '<a href="#" class="autocomplete">Sélectionner</a>';
|
||||
$return.= ' <a href="#" class="autocompleteEx">Exclure</a>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
/* Textarea */
|
||||
private function textareaHTML($name, $field)
|
||||
protected 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 = '<textarea class="criteres" name="'.$name.'" ></textarea>';
|
||||
$return.= '<a href="#" class="list">Sélectionner</a>';
|
||||
$return.= ' <a href="#" class="listEx">Exclure</a>';
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function fileuploadHtml($name, $field)
|
||||
{
|
||||
$return = '<input class="upload" type="file" name="fichier" id="'.$name.'" /> ';
|
||||
return ($return);
|
||||
}
|
||||
|
||||
|
||||
/* Radios */
|
||||
private function radioHTML($name, $field, $item)
|
||||
{
|
||||
$return = '<input type="radio" name="'.$name.'" />';
|
||||
$return = '<input type="radio" name="'.$name.'" />';
|
||||
return ($return);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -1 +1,9 @@
|
||||
<?php
|
||||
<div id="help" style="padding:5px;">
|
||||
<h2>A propos de</h2>
|
||||
|
||||
<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,53 @@
|
||||
<?php
|
||||
<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>
|
8
application/views/default/scripts/aide/message.phtml
Normal file
8
application/views/default/scripts/aide/message.phtml
Normal file
@ -0,0 +1,8 @@
|
||||
<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>
|
@ -1,17 +1,17 @@
|
||||
<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" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'geographiqueajax', 'key'=> $this->key))?>',
|
||||
"json_data" : {
|
||||
"data" : <?=$this->regions?>,
|
||||
"ajax" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'geographiqueajax', 'key'=> $this->key), 'default', true)?>',
|
||||
"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), 'default', true)?>',
|
||||
"data" : function(n)
|
||||
{
|
||||
return { id: n.attr ? n.attr("id") : 0 };
|
||||
},
|
||||
"cache" : true,
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
@ -1,17 +1,17 @@
|
||||
<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" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'nafajax', 'key'=> $this->key))?>',
|
||||
"json_data" : {
|
||||
"data" : <?=$this->naf?>,
|
||||
"ajax" : {
|
||||
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'nafajax', 'key'=> $this->key), 'default', true)?>',
|
||||
"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,29 @@
|
||||
<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;" nowrap><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.min.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>
|
104
application/views/default/scripts/dashboard/ciblage.phtml
Normal file
104
application/views/default/scripts/dashboard/ciblage.phtml
Normal file
@ -0,0 +1,104 @@
|
||||
<ul class="chemin clearfix rounded_t">
|
||||
<li class="e0"><a class="lir" href="/">Accueil</a></li>
|
||||
<li><a href="/dashboard/index"><span>Tableau de bord</span></a></li>
|
||||
<li class="last"><span>Detail du ciblage (<?=$this->comptageRef?>)</span></li>
|
||||
</ul>
|
||||
|
||||
<div id="dashboard" style="padding:10px">
|
||||
|
||||
<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$this->comptageId))?>">Charger les critères de ciblage dans l'interface</a> |
|
||||
<a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$this->comptageId))?>">Actualiser le comptage</a> |
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$this->comptageId))?>">Commander un enrichissement</a>
|
||||
|
||||
<fieldset>
|
||||
<legend>Critères</legend>
|
||||
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<div>
|
||||
<h3><?=$criteres['label']?></h3>
|
||||
<?php if (is_string($criteres['in'])) {?>
|
||||
<div><?=$criteres['in']?></div>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Inclus :</p>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Exclus :</p>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>Comptages</legend>
|
||||
<table class="comptages" style="width:100%">
|
||||
<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>
|
||||
<th><?=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)?></th>
|
||||
<th><?=number_format($comptage['resultat'], 0, '', ' ')?></th>
|
||||
<th><?=number_format($comptage['uniteInsee'], 0, '', ' ')?></th>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Enrichissements</legend>
|
||||
<?php if ( count($this->enrichissements)>0 ) {?>
|
||||
<table style="width:100%">
|
||||
<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>
|
||||
<th><?=$item['dateAdded']?></th>
|
||||
<th><?=$item['reference']?></th>
|
||||
<th><?=number_format($item['nbLigneTotales'], 0, '', ' ')?></th>
|
||||
<td>
|
||||
<?php if($item['dateStart']>0): ?>
|
||||
<a href="/enrichissement/download/id/<?=$item['id']?>"><?=$item['fichier']?></a>
|
||||
<?php else: ?>
|
||||
En attente de traitement
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php } else {?>
|
||||
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$this->comptageId))?>">Commander un enrichissement</a>
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
|
||||
</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,14 +1,21 @@
|
||||
<div id="dashboard">
|
||||
<ul class="chemin clearfix rounded_t">
|
||||
<li class="e0"><a class="lir" href="/">Accueil</a></li>
|
||||
<li>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'))?>">
|
||||
<span>Tableau de bord</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<span>Liste de vos ciblages</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Liste de vos ciblages
|
||||
</div>
|
||||
<div id="dashboard" class="clearfix">
|
||||
|
||||
<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">
|
||||
<thead>
|
||||
@ -17,30 +24,46 @@ Liste de vos ciblages
|
||||
<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:?>
|
||||
<div style="margin:5px auto;width:333px;">
|
||||
<div class="pagination">
|
||||
<a href="#" class="first" data-action="first">«</a>
|
||||
<a href="#" class="previous" data-action="previous">‹</a>
|
||||
<input type="text" readonly="readonly" data-current-page="<?=$this->page?>" data-max-page="<?=$this->nbPages?>" />
|
||||
<a href="#" class="next" data-action="next">›</a>
|
||||
<a href="#" class="last" data-action="last">»</a>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('.pagination').jqPagination({
|
||||
page_string: "Page {current_page} sur {max_page}",
|
||||
paged: function(page) {
|
||||
window.location.href = window.location.href + '/page/'+page;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
<?php } else {?>
|
||||
<p>Aucun ciblage.<p>
|
||||
<?php endif;?>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1,47 +1,86 @@
|
||||
<ul class="chemin clearfix rounded_t">
|
||||
<li class="e0"><a class="lir" href="/">Accueil</a></li>
|
||||
<li>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'))?>">
|
||||
<span>Tableau de bord</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<span>Préférences</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<div class="chemin">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
|
||||
Préférences
|
||||
</div>
|
||||
<h2>Paramètres de votre compte</h2>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<p>Lister les colonnes disponibles (Association SQL/Libellé) pour la configuration<p>
|
||||
|
||||
|
||||
<h2>Gestion des préférences d'affichage</h2>
|
||||
<h2>Préférences d'affichage</h2>
|
||||
<p>
|
||||
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
|
||||
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">
|
||||
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>
|
||||
|
||||
<br/>
|
||||
|
||||
<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>
|
||||
|
||||
<br/>
|
||||
|
||||
<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>
|
||||
|
||||
<br/>
|
||||
|
||||
<h2>Profils d'enrichissement</h2>
|
||||
|
||||
<?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>
|
@ -0,0 +1,19 @@
|
||||
<?php if ($this->pageCount) { ?>
|
||||
<!-- First page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->first)); ?>"><img src="/themes/default/images/pagination/first.png" title='Première page'/></a>
|
||||
<?php } ?>
|
||||
<!-- Previous page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->previous)); ?>"><img src="/themes/default/images/pagination/prev.png" title='Page précédente'/></a>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Next page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->next)); ?>"><img src="/themes/default/images/pagination/next.png" title='Page suivante'/></a>
|
||||
<?php } ?>
|
||||
<!-- Last page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('page' => $this->last)); ?>"><img src="/themes/default/images/pagination/last.png" title='Dernière page'/></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
@ -0,0 +1,19 @@
|
||||
<?php if ($this->pageCount) { ?>
|
||||
<!-- First page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->first)); ?>"><img src="/themes/default/images/pagination/first.png" title='Première page'/></a>
|
||||
<?php } ?>
|
||||
<!-- Previous page link -->
|
||||
<?php if (isset($this->previous)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->previous)); ?>"><img src="/themes/default/images/pagination/prev.png" title='Page précédente'/></a>
|
||||
<?php } ?>
|
||||
|
||||
<!-- Next page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->next)); ?>"><img src="/themes/default/images/pagination/next.png" title='Page suivante'/></a>
|
||||
<?php } ?>
|
||||
<!-- Last page link -->
|
||||
<?php if (isset($this->next)) { ?>
|
||||
<a href="<?php echo $this->url(array('pageEnrichissements' => $this->last)); ?>"><img src="/themes/default/images/pagination/last.png" title='Dernière page'/></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
@ -0,0 +1 @@
|
||||
<?php
|
@ -0,0 +1,101 @@
|
||||
<ul class="chemin clearfix rounded_t">
|
||||
<li class="e0"><a class="lir" href="/">Accueil</a></li>
|
||||
<li>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'))?>">
|
||||
<span>Tableau de bord</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<span>Enrichissements</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="dashboard">
|
||||
|
||||
<h2>Fichiers en cours d'enrichissement</h2>
|
||||
|
||||
<?php if(count($this->encours) > 0):?>
|
||||
<table>
|
||||
<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 endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun enrichissement en cours.<p>
|
||||
<?php endif;?>
|
||||
|
||||
<h2>Fichiers enrichis</h2>
|
||||
|
||||
<?php if(count($this->fini) > 0):?>
|
||||
<table>
|
||||
<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 endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php else:?>
|
||||
<p>Aucun enrichissement.<p>
|
||||
<?php endif;?>
|
||||
</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>
|
@ -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,98 @@
|
||||
<ul class="chemin clearfix rounded_t">
|
||||
<li class="e0"><a class="lir" href="/">Accueil</a></li>
|
||||
<li>
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'))?>">
|
||||
<span><?=$this->translate('Tableau de bord')?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="last">
|
||||
<span></span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<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 id="menu">
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>"><?=$this->translate('Liste de vos ciblages')?></a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'enrichissements'))?>"><?=$this->translate('Liste de vos enrichissements')?></a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'configuration'))?>"><?=$this->translate('Préférences de l\'application')?></a> -
|
||||
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>"><?=$this->translate('Enrichissement de fichier')?></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):?>
|
||||
<div id="lastCiblage">
|
||||
<h2><?=$this->translate('Vos derniers ciblages')?></h2>
|
||||
<?php if(count($this->comptages) > 0):?>
|
||||
<table>
|
||||
<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->paginator 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 echo $this->paginationControl($this->paginator,'Sliding','dashboard/controlsCiblages.phtml'); ?>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun ciblage')?>.<p>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
<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="lastEnrichissement">
|
||||
<h2><?=$this->translate('Vos derniers enrichissements')?></h2>
|
||||
<?php if(count($this->enrichissements) > 0):?>
|
||||
<table>
|
||||
<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 echo $this->paginationControl($this->enrichissements,'Sliding','dashboard/controlsEnrichissements.phtml'); ?>
|
||||
<?php else:?>
|
||||
<p><?=$this->translate('Aucun enrichissement')?>.<p>
|
||||
<?php endif;?>
|
||||
</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,10 @@
|
||||
Votre demande a bien été prise en compte sous la référence <?=$this->ref?>
|
||||
|
||||
<script>
|
||||
$('#dialog').dialog({
|
||||
buttons: [{ text: "Quitter",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
window.location.href= window.location.href;
|
||||
} }] });
|
||||
</script>
|
@ -0,0 +1,97 @@
|
||||
<?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">
|
||||
<style>
|
||||
#enrichissement { width:100%; }
|
||||
#enrichissement th { font-weight:800; }
|
||||
#enrichissement td, th { padding:5px; border-left:1px solid black; }
|
||||
#enrichissement tr { font-size:10px; border:1px solid silver; }
|
||||
</style>
|
||||
<p style="text-align:center;color:green">Votre ciblage a été actualisé</p>
|
||||
|
||||
<div style="font-size:10px;padding:5px; border:1px dashed green">
|
||||
Les tarifs sont données à titre indicatif et peuvent variées suivant les spécificités de votre compte.
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<table 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>
|
||||
<tr>
|
||||
<td>Redevance Insee</td>
|
||||
<td><?=number_format($this->prixInsee, 2, ',', ' ')?> €</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Prix du fichier</td><td><?=number_format($this->prix, 2, ',', ' ')?> €</td>
|
||||
</tr>
|
||||
<?php if ($this->forfaitRemain) {?>
|
||||
<tr><td colspan="2"></td></tr>
|
||||
<tr><td>Forfait Restant</td><td><?=number_format($this->forfaitRemain, 2, ',', ' ')?> €</td></tr>
|
||||
<?php }?>
|
||||
</table>
|
||||
<?php if (!empty($this->infoInsee)) {?>
|
||||
<br/>
|
||||
<p><?=$this->infoInsee?></p>
|
||||
<?php }?>
|
||||
<br/>
|
||||
|
||||
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'))?>">
|
||||
<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>
|
||||
</div>
|
||||
<script>
|
||||
$('#dialog').dialog({ buttons: [ {
|
||||
text: "Commander",
|
||||
click: function() {
|
||||
var action = $('form[name=commande]').attr('action');
|
||||
var values = $('form[name=commande]').serialize();
|
||||
$('div#update').html('Enregistrement...');
|
||||
$('#dialog').dialog({ buttons: [{}] });
|
||||
$.post(action, values, function(data){
|
||||
$('div#update').html(data);
|
||||
}).error(function(){
|
||||
$('div#update').html('Erreur');
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Quitter", click: 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>
|
@ -0,0 +1 @@
|
||||
<?=json_encode($this->output)?>
|
123
application/views/default/scripts/fields/index.phtml
Normal file
123
application/views/default/scripts/fields/index.phtml
Normal file
@ -0,0 +1,123 @@
|
||||
<ul>
|
||||
<li><a href="#tabs-1"><?=$this->translate('Critères Entreprise')?></a></li>
|
||||
<li><a href="#tabs-2"><?=$this->translate('Situation économique')?></a></li>
|
||||
<li><a href="#tabs-3"><?=$this->translate('Secteur géographique')?></a></li>
|
||||
<li><a href="#tabs-4"><?=$this->translate('Situation juridique')?></a></li>
|
||||
<li><a href="#tabs-5"><?=$this->translate('Situation financière')?></a></li>
|
||||
</ul>
|
||||
<div id="tabs-1">
|
||||
<div id="entreprise">
|
||||
<ul id="fieldsblock">
|
||||
<li><?=$this->Field('siege')?></li>
|
||||
<li><?=$this->Field('groupe')?></li>
|
||||
<li><?=$this->Field('tel')?></li>
|
||||
<li><?=$this->Field('fax')?></li>
|
||||
<li><?=$this->Field('web')?></li>
|
||||
<li><?=$this->Field('mail')?></li>
|
||||
<li><?=$this->Field('presentRcs')?></li>
|
||||
<li><?=$this->Field('adrDom')?></li>
|
||||
<li><?=$this->Field('dirNom')?></li>
|
||||
<li><?=$this->Field('dateCrea_etab')?></li>
|
||||
<li><?=$this->Field('participation')?></li>
|
||||
<li class="advanced"><?=$this->Field('nbMPubli')?></li>
|
||||
<li class="advanced"><?=$this->Field('dateCrea_ent')?></li>
|
||||
<li class="advanced"><?=$this->Field('action')?></li>
|
||||
<li class="advanced"><?=$this->Field('nbActio')?></li>
|
||||
<li class="advanced"><?=$this->Field('nbPart')?></li>
|
||||
<li class="mode"><img src="/themes/default/images/fleche-bas.gif" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="link">
|
||||
<a class="resetFamille" id="entreprise">Réinitialiser les critères entreprises</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-2">
|
||||
<div id="economique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?=$this->Field('capital')?></li>
|
||||
<li><?=$this->Field('ape_entrep')?></li>
|
||||
<li class="advanced"><?=$this->Field('ape_etab')?></li>
|
||||
<li><?=$this->Field('age_entrep')?></li>
|
||||
<li class="advanced"><?=$this->Field('age_etab')?></li>
|
||||
<li><?=$this->Field('teff_entrep')?></li>
|
||||
<li class="advanced"><?=$this->Field('teff_etab')?></li>
|
||||
<li><?=$this->Field('eff_entrep')?></li>
|
||||
<li class="advanced"><?=$this->Field('eff_etab')?></li>
|
||||
<li class="advanced"><?=$this->Field('nbEtab')?></li>
|
||||
<li class="mode"><img src="/themes/default/images/fleche-bas.gif" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="economique">Réinitialiser les critères economiques</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-3">
|
||||
<div id="geographique">
|
||||
<ul id="fieldsblock">
|
||||
<li>
|
||||
<?=$this->Field('geo')?>
|
||||
<?=$this->Field('geo_domtom')?>
|
||||
<?=$this->Field('geo_etranger')?>
|
||||
<?=$this->Field('geo_corse')?>
|
||||
</li>
|
||||
<li class="advanced"><?=$this->Field('codesdepts')?></li>
|
||||
<li class="advanced"><?=$this->Field('codespostaux')?></li>
|
||||
<li class="advanced"><?=$this->Field('codesinsee')?></li>
|
||||
<li><?=$this->Field('zus')?></li>
|
||||
<li><?=$this->Field('zru')?></li>
|
||||
<li><?=$this->Field('zfu')?></li>
|
||||
<li><?=$this->Field('cucs')?></li>
|
||||
<li><?=$this->Field('zrr')?></li>
|
||||
<li><?=$this->Field('zafr')?></li>
|
||||
<li class="mode"><img src="/themes/default/images/fleche-bas.gif" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="econmique">Réinitialiser les critères geographiques</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-4">
|
||||
<div id="juridique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?=$this->Field('cj')?></li>
|
||||
<li class="advanced"><?=$this->Field('cjlist')?></li>
|
||||
<li><?=$this->Field('actifEco')?></li>
|
||||
<li><?=$this->Field('procolHisto')?></li>
|
||||
<li><?=$this->Field('dateImmat')?></li>
|
||||
<li class="advanced"><?=$this->Field('tvaIntraValide')?></li>
|
||||
<li class="mode"><img src="/themes/default/images/fleche-bas.gif" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="econmique">Réinitialiser les critères juridique</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabs-5">
|
||||
<div id="financiere">
|
||||
<ul id="fieldsblock">
|
||||
<li><?=$this->Field('bilType')?></li>
|
||||
<li><?=$this->Field('avisCs')?></li>
|
||||
<li><?=$this->Field('bilAnnee')?></li>
|
||||
<li><?=$this->Field('bilCloture')?></li>
|
||||
<li><?=$this->Field('bilDuree')?></li>
|
||||
<li><?=$this->Field('bilTca')?></li>
|
||||
<li><?=$this->Field('bilFL')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilEE')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilFK')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilFR')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilGF')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilGP')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilGW')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilHD')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilHH')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilHL')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilHM')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilHN')?></li>
|
||||
<li class="advanced"><?=$this->Field('bilYP')?></li>
|
||||
<li class="mode"><img src="/themes/default/images/fleche-bas.gif" /></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div style="text-align:right;margin-top:20px;">
|
||||
<a class="resetFamille" id="financier">Réinitialiser les critères financiers</a>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<p class="info">
|
||||
<a href="http://www.scores-decisions.com/">Scores & Décisions SAS</a>
|
||||
<img class='flag' id='fr' src="/themes/default/images/drapeaux/fr.png"/>
|
||||
<img class='flag' id='en' src="/themes/default/images/drapeaux/en.png"/>
|
||||
</p>
|
@ -0,0 +1,32 @@
|
||||
<fieldset>
|
||||
<legend>Critères</legend>
|
||||
|
||||
<?php foreach ( $this->criteres as $criteres ) { ?>
|
||||
<div>
|
||||
<h3><?=$criteres['label']?></h3>
|
||||
<?php if (is_string($criteres['in'])) {?>
|
||||
<div><?=$criteres['in']?></div>
|
||||
<?php } else {?>
|
||||
|
||||
<?php if ( is_array($criteres['in']) && count($criteres['in'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Inclus :</p>
|
||||
<?php foreach( $criteres['in'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php if ( is_array($criteres['ex']) && count($criteres['ex'])>0 ) { ?>
|
||||
<div>
|
||||
<p>Exclus :</p>
|
||||
<?php foreach( $criteres['ex'] as $item ) {?>
|
||||
<p><?=$item?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</fieldset>
|
71
application/views/default/scripts/gestion/ciblages.phtml
Normal file
71
application/views/default/scripts/gestion/ciblages.phtml
Normal file
@ -0,0 +1,71 @@
|
||||
<?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>
|
||||
<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 id="<?=$comptage['idDefinition']?>">
|
||||
<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').on('click', function(){
|
||||
var href = '/gestion/ciblagecriteres/id/'+$(this).attr('id');
|
||||
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>
|
51
application/views/default/scripts/gestion/commandes.phtml
Normal file
51
application/views/default/scripts/gestion/commandes.phtml
Normal file
@ -0,0 +1,51 @@
|
||||
<?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="<?=str_pad($i, 2, '0', STR_PAD_LEFT)?>"<?=$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>
|
||||
<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>
|
||||
<?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>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
19
application/views/default/scripts/gestion/conso.phtml
Normal file
19
application/views/default/scripts/gestion/conso.phtml
Normal file
@ -0,0 +1,19 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<div>
|
||||
<p>Date de contrat : <?=$this->ContratDateDebut?> à <?=$this->ContratDateFin?></p>
|
||||
</div>
|
||||
|
||||
<h2>Consommation</h2>
|
||||
<div>
|
||||
<table>
|
||||
<thead>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,59 @@
|
||||
<div id="dashboard">
|
||||
<h2>Paramètres client</h2>
|
||||
|
||||
<table>
|
||||
<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 href="<?=$this->url(array('controller'=>'gestion','action'=>'customerparamadd','idClient'=>$this->idClient),null,true)?>">Modifier</a>
|
||||
|
||||
<h2>Logins autorisés</h2>
|
||||
<div class="paragraph">
|
||||
<form 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" />
|
||||
<label>Login : </label><input type="text" name="login" value="" />
|
||||
<input type="submit" value="Ajouter un login avec le profil du client" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="paragraph">
|
||||
<table>
|
||||
<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>
|
112
application/views/default/scripts/gestion/customerparamadd.phtml
Normal file
112
application/views/default/scripts/gestion/customerparamadd.phtml
Normal file
@ -0,0 +1,112 @@
|
||||
<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>
|
@ -0,0 +1,38 @@
|
||||
<div id="dashboard">
|
||||
|
||||
<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>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Début du contrat</th>
|
||||
<th>Durée contrat</th>
|
||||
<th>Logins ouvert</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
<?php foreach($this->customerlist as $item) {?>
|
||||
<tr>
|
||||
<td><?=$item['nom']?></td>
|
||||
<td><?=$item['dateContrat']?></td>
|
||||
<td><?=$item['periodContrat']?></td>
|
||||
<td>
|
||||
<?php foreach ($item['logins'] as $login) {?>
|
||||
<?=$login?><br/>
|
||||
<?php }?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'customerparam', 'idClient'=>$item['idClient']))?>">Détail</a>
|
||||
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'conso', 'idClient'=>$item['idClient']))?>">Conso</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
@ -0,0 +1,50 @@
|
||||
<?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="<?=str_pad($i, 2, '0', STR_PAD_LEFT)?>"<?=$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>
|
||||
<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>
|
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;
|
||||
}
|
10
application/views/default/scripts/gestion/index.phtml
Normal file
10
application/views/default/scripts/gestion/index.phtml
Normal file
@ -0,0 +1,10 @@
|
||||
<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/>
|
||||
</div>
|
34
application/views/default/scripts/gestion/profiladd.phtml
Normal file
34
application/views/default/scripts/gestion/profiladd.phtml
Normal file
@ -0,0 +1,34 @@
|
||||
<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>
|
@ -0,0 +1 @@
|
||||
<?php
|
45
application/views/default/scripts/gestion/profils.phtml
Normal file
45
application/views/default/scripts/gestion/profils.phtml
Normal file
@ -0,0 +1,45 @@
|
||||
<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>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user