Compare commits

...

303 Commits
1.0 ... 1.1

Author SHA1 Message Date
Michael RICOIS
4bf2ca7a4b css et js inexistant 2012-05-01 09:42:19 +00:00
Michael RICOIS
8c4fb83566 Création des répertoires de sessions 2012-04-24 11:26:27 +00:00
Michael RICOIS
6889d5294a Suppression require_once inutile 2012-04-24 10:34:34 +00:00
Michael RICOIS
57aa0bc875 Ordre du plugin 2012-04-24 10:21:45 +00:00
Michael RICOIS
77368058b1 Modification complete de l'authentification 2012-04-24 10:17:18 +00:00
Michael RICOIS
286ad446cf Suppression include path déjà déclarer dans index.php 2012-04-24 10:03:38 +00:00
Michael RICOIS
676e15833e Suppression du style qui fait chier 2012-04-24 09:56:21 +00:00
Michael RICOIS
d9ac13d453 Mise à jour librairie JQuery-UI en version 1.8.18 2012-04-24 09:52:25 +00:00
Michael RICOIS
2d6c9545c8 Suppression style sur hover 2012-04-24 09:45:14 +00:00
Michael RICOIS
4adddfb061 Correction url lien 2012-04-24 09:30:15 +00:00
Michael RICOIS
b0c5b83115 Tri par ordre alphabétique et suppression des codes 2012-04-24 09:22:24 +00:00
Michael RICOIS
8bc286bdab Colonne référence à remplir 2012-04-20 14:55:28 +00:00
Michael RICOIS
5a47a6a24a Affichage de la reference 2012-04-20 14:53:42 +00:00
Michael RICOIS
4fd7614f58 Ajout de l'age : age_entrep, age_etab 2012-04-20 14:49:05 +00:00
Michael RICOIS
85ed70bdb0 Todo 2012-04-20 14:40:36 +00:00
Michael RICOIS
fcafbe31f8 Correction pour bonne detection des chiffres 2012-04-20 14:39:53 +00:00
Michael RICOIS
70e6ac262a Ajout des valeurs pour les tranches teff_entrep et teff_etab 2012-04-20 14:37:36 +00:00
Michael RICOIS
1f29e9f4d8 Ajout tranche effectif et effectif 2012-04-20 14:25:45 +00:00
Michael RICOIS
5f86ae58b6 Correction colunm 2012-04-20 14:17:55 +00:00
Damien LASSERRE
0f81a66b90 correction batch 2012-04-19 09:48:17 +00:00
Damien LASSERRE
f0285eb499 erreur 2012-04-18 15:59:02 +00:00
Damien LASSERRE
0eab5291e9 corection ex 2012-04-18 15:56:56 +00:00
Damien LASSERRE
511e2af345 corrdction ex 2012-04-18 15:56:45 +00:00
Damien LASSERRE
2180eb9f3a date 2012-04-18 15:54:10 +00:00
Damien LASSERRE
adaaa66dd1 css 2012-04-18 14:37:43 +00:00
Damien LASSERRE
0db3c8907c correction des mode avancé dans economique. 2012-04-18 14:36:07 +00:00
Damien LASSERRE
95a57d9446 correction des mode avancé dans economique. 2012-04-18 13:53:09 +00:00
Damien LASSERRE
fdd3dddbe1 ajouts des icones 2012-04-18 13:17:10 +00:00
Damien LASSERRE
8932eb138a la gestion des modes 2012-04-18 12:34:49 +00:00
Damien LASSERRE
619da73aae Ajout fonctionnalités 2012-04-17 15:10:17 +00:00
Damien LASSERRE
3a78d2bb5c Correction javascript + ajout de la fonction help 2012-04-17 14:08:12 +00:00
Damien LASSERRE
d8d52662f4 Correction prévu et autre bug 2012-04-16 15:23:17 +00:00
Damien LASSERRE
605e963695 correctioon des AGE entrep en filter et non pas en alpha 2012-04-16 15:14:29 +00:00
Damien LASSERRE
a153844832 ajout des teff 2012-04-13 15:33:59 +00:00
Damien LASSERRE
51cab1e5d2 correction 2012-04-13 14:49:08 +00:00
Damien LASSERRE
42710f7528 correction provisoir arbo geo 2012-04-13 12:57:58 +00:00
Damien LASSERRE
0610903073 Correction rapiditer de la prévisualisation 2012-04-13 12:37:55 +00:00
Damien LASSERRE
b62d3189e9 prérempli du formulaire enrichissement 2012-04-13 09:57:06 +00:00
Damien LASSERRE
4526fe80f0 indentation 2012-04-13 09:38:05 +00:00
Damien LASSERRE
a65a9fc2a2 formulaire de validation de comptage prédéfini et bouton popup associé 2012-04-13 09:36:57 +00:00
Damien LASSERRE
75c0391a19 ajout exclusion et corrections 2012-04-13 08:56:39 +00:00
Damien LASSERRE
d2cd06d96b gestion des download par id 2012-04-13 08:13:22 +00:00
Damien LASSERRE
2931f21cc4 format date 2012-04-13 07:47:50 +00:00
Damien LASSERRE
d99f974c7c correction bug dans les id 2012-04-13 07:33:23 +00:00
Damien LASSERRE
046db3272d Ajout du dossier mois a la création des fichiers d'enrichissement 2012-04-13 07:23:43 +00:00
Damien LASSERRE
d68cf89d21 nom du fichier rectifié 2012-04-12 16:00:15 +00:00
Damien LASSERRE
e097a2074d f 2012-04-12 14:26:33 +00:00
Damien LASSERRE
d4a3ca4360 enrichissement depuis la previsualisation 2012-04-12 14:23:02 +00:00
Damien LASSERRE
f7fd60c9a0 css 2012-04-12 14:08:42 +00:00
Damien LASSERRE
5399c57010 Prévisualisation 2012-04-12 13:54:45 +00:00
Damien LASSERRE
d0a0857987 Probleme SVN 2012-04-12 09:57:19 +00:00
Damien LASSERRE
35e837af81 Probleme SVN 2012-04-12 09:55:53 +00:00
Damien LASSERRE
fbb019c7d4 probleme svn 2012-04-12 09:55:33 +00:00
Damien LASSERRE
7ca32d69e4 nom a la création du fichier 2012-04-12 09:54:49 +00:00
Damien LASSERRE
088dd975a6 nom a la création du fichier 2012-04-12 09:53:08 +00:00
Damien LASSERRE
6487cb4532 gestion des headers 2012-04-12 09:52:48 +00:00
Damien LASSERRE
83d3cb5f4a gestion des headers 2012-04-12 09:48:08 +00:00
Damien LASSERRE
e96ce7127b gestion des headers 2012-04-12 09:47:29 +00:00
Damien LASSERRE
b06cd50d82 gestion des headers 2012-04-12 09:46:35 +00:00
Damien LASSERRE
6a22104b36 gestion des headers 2012-04-12 09:46:16 +00:00
Damien LASSERRE
3e48103956 cc 2012-04-12 09:34:22 +00:00
Damien LASSERRE
4ad4c24221 enrichissement par un admin 2012-04-12 09:25:37 +00:00
Damien LASSERRE
62fc0c17d5 correction faute orthographe 2012-04-12 08:16:38 +00:00
Damien LASSERRE
401dfa0cf3 correction faute orthographe 2012-04-12 08:16:23 +00:00
Damien LASSERRE
d2996c69f7 probleme svn 2012-04-12 08:14:26 +00:00
Damien LASSERRE
2ab8d3e583 probleme svn 2012-04-12 08:10:10 +00:00
Damien LASSERRE
55e05fbe63 probleme svn 2012-04-12 08:09:18 +00:00
Damien LASSERRE
512abb9d38 probleme svn 2012-04-12 08:07:35 +00:00
Damien LASSERRE
e6e169fbe7 exclusion sur ape_entrep 2012-04-11 07:20:54 +00:00
Damien LASSERRE
349dde60de exclusion sur ape_entrep 2012-04-11 07:11:48 +00:00
Damien LASSERRE
f6a9e222c1 exclusion sur les naf etablissements. 2012-04-10 15:53:10 +00:00
Damien LASSERRE
1bdce6771c gestion des exclusion sur bilType 2012-04-10 14:46:22 +00:00
Damien LASSERRE
4197ad76cb Gestion des exclusions 2012-04-10 14:02:40 +00:00
Damien LASSERRE
da28d19390 Exclusion OK ! geographique 2012-04-10 13:20:08 +00:00
Damien LASSERRE
38922b0fd0 vider le champs de recherche par régions. 2012-04-10 09:33:23 +00:00
Damien LASSERRE
9fc24e0ab1 correction libellé 2012-04-10 09:20:48 +00:00
Damien LASSERRE
697c7ebb5d Correction du bug avec les departements. 2012-04-10 09:16:59 +00:00
Damien LASSERRE
82a99a4efa localisation geogra dans les critères de rapelles 2012-04-10 08:15:07 +00:00
Damien LASSERRE
bb82175e59 correction order DESC sur les comptages 2012-04-10 07:29:26 +00:00
Damien LASSERRE
b0207bf239 redirection a l'enrigistrement du ciblage. 2012-04-10 07:24:57 +00:00
Damien LASSERRE
9510505afd redirection a l'enrigistrement du ciblage. 2012-04-10 07:24:44 +00:00
Damien LASSERRE
a346cf5505 images 2012-04-06 15:44:29 +00:00
Damien LASSERRE
7c18e4a4b1 Correction partiel des départements. 2012-04-06 15:15:13 +00:00
Damien LASSERRE
17e152ce0b Dashboard 2012-04-06 09:49:41 +00:00
Damien LASSERRE
0233d4b34f correction du rechargement des critères. 2012-04-06 09:27:33 +00:00
Damien LASSERRE
b0962b753c Exclusions 2012-04-06 08:29:25 +00:00
Damien LASSERRE
5ad2717112 correction javascript pour le popup enrigistrement. 2012-04-06 08:29:04 +00:00
Damien LASSERRE
2f26c2409d Gestion des exclusion sur la localisation 2012-04-06 08:28:37 +00:00
Damien LASSERRE
42c9f843e3 correction javascript pour le popup enrigistrement. 2012-04-06 08:28:13 +00:00
Damien LASSERRE
7cf0b68865 correction bug 2012-04-06 08:27:59 +00:00
Damien LASSERRE
0d1a39b237 correction javascript pour le popup enrigistrement. 2012-04-06 08:27:34 +00:00
Damien LASSERRE
e18f1b3b40 correction recomptage a la suppression d'un critère 2012-04-06 08:27:10 +00:00
Damien LASSERRE
3d867a8c7f Exclusions
voir #0001117 mantis
2012-04-05 15:50:33 +00:00
Damien LASSERRE
9db6f449a1 ajout des champs multiples 2012-04-05 09:04:59 +00:00
Damien LASSERRE
7f3954d470 ajout des champs multiples 2012-04-05 09:04:43 +00:00
Damien LASSERRE
e2bc5393a7 ajout des champs multiples 2012-04-05 09:04:34 +00:00
Damien LASSERRE
b3bc52e460 ajout des champs multiples 2012-04-05 09:04:25 +00:00
Damien LASSERRE
57c1766c60 affichage des enrichissements 2012-04-05 08:20:37 +00:00
Damien LASSERRE
003681a91d affichage des enrichissements 2012-04-05 08:20:14 +00:00
Damien LASSERRE
f83053458e affichage des enrichissements 2012-04-05 08:19:57 +00:00
Damien LASSERRE
cbe5f56cc4 correction date pour l'affichage des comptages 2012-04-05 07:39:15 +00:00
Damien LASSERRE
26fdd036c4 Création de la fonction de recupération des enrichissement / Comptage 2012-04-05 07:09:12 +00:00
Damien LASSERRE
e2c64172fb correction de enrichissement 2012-04-04 14:06:46 +00:00
Damien LASSERRE
a638ebf87f Calcule de date 2012-04-04 13:15:56 +00:00
Damien LASSERRE
bbd9d47187 correction 2012-04-04 09:12:58 +00:00
Damien LASSERRE
572eaf92c9 Création de la fonction de recupération des enrichissement / Comptage 2012-04-04 08:33:37 +00:00
Damien LASSERRE
875025e507 Création de la fonction de recupération des enrichissement / Comptage 2012-04-04 08:33:22 +00:00
Damien LASSERRE
4686cbc8d5 Modification du nombre de lignes afficher dans l'index dashboard pour les enrichissements 2012-04-04 08:09:59 +00:00
Damien LASSERRE
838c0aeb4a Modification du tableau enrichissement 2012-04-04 08:04:19 +00:00
Damien LASSERRE
26d4ad4ae0 image loader enrichissement 2012-04-04 08:03:54 +00:00
Damien LASSERRE
18bd65b991 modification de l'enrichissement + recomptage (actualisation du comptage) et rapelle des criteres 2012-04-03 13:49:38 +00:00
Damien LASSERRE
3993257e59 modification de l'enrichissement + recomptage (actualisation du comptage) et rapelle des criteres 2012-04-03 13:42:35 +00:00
Damien LASSERRE
27438be586 suppression du libeller dans la vue (information sur le champ). 2012-04-03 08:39:15 +00:00
Damien LASSERRE
b0ba3c25ba correction des bugs d'affichages 2012-04-03 08:38:34 +00:00
Damien LASSERRE
82fd8a3fae Gestion des min max 2012-04-03 08:37:54 +00:00
Damien LASSERRE
943eb22c7c ajout des min max 2012-04-03 08:37:39 +00:00
Damien LASSERRE
ee95e69664 Print_r oublié 2012-04-03 07:47:41 +00:00
Damien LASSERRE
bfe9a89091 correction des bug minmax 2012-04-03 07:41:47 +00:00
Damien LASSERRE
8cd4fe17d0 #0001135 resolu 2012-04-03 07:34:57 +00:00
Damien LASSERRE
fe9747f9e4 Correction de l'extraction des siret pour les nafs... 2012-03-28 07:40:36 +00:00
Damien LASSERRE
976e10b434 correction bug requete sphinx 2012-03-26 15:11:46 +00:00
Damien LASSERRE
6025314471 correction bug requete sphinx 2012-03-26 15:11:20 +00:00
Damien LASSERRE
9983e9c1eb Quelques corrections 2012-03-26 14:47:50 +00:00
Damien LASSERRE
d6bcd86464 Correction des codes postaux 2012-03-26 14:47:09 +00:00
Damien LASSERRE
b9cec9515b Correction de l'interpretations des données pour le count 2012-03-26 14:46:47 +00:00
Damien LASSERRE
af1730d2e6 Correction de Fields + ajouts des nouveaux champs 2012-03-26 14:46:20 +00:00
Damien LASSERRE
fa03081e67 Correction du moteur (departement + problèmes majeurs) 2012-03-26 14:45:42 +00:00
Damien LASSERRE
d9253f962e correction configuration 2012-03-22 10:51:38 +00:00
Michael RICOIS
a2568e417b Suppression table inexistante 2012-03-20 08:34:01 +00:00
Damien LASSERRE
21ddf64775 MAJ 2012-03-20 08:24:41 +00:00
Damien LASSERRE
7135be80d3 Grosse MAJ 2012-03-15 15:44:10 +00:00
Michael RICOIS
d668dbc2d1 Correction appel db 2012-03-15 10:07:49 +00:00
Michael RICOIS
9581c825db Ajout des boutons en javascript 2012-03-14 11:23:20 +00:00
Michael RICOIS
1da719624c Suppression javascript 2012-03-14 11:02:53 +00:00
Michael RICOIS
791e5c14ad Gestion pour l'enregistrement de la commande 2012-03-14 11:01:53 +00:00
Michael RICOIS
80e214a19b Boite de dialog plus grande en hauteur 2012-03-14 10:43:26 +00:00
Michael RICOIS
ecc492c1ce batch enrichissement à tester 2012-03-14 10:42:09 +00:00
Michael RICOIS
189a519597 Formattage 2012-03-14 10:41:37 +00:00
Michael RICOIS
58b1e456f7 Vue gestion en mode developement 2012-03-14 09:52:29 +00:00
Michael RICOIS
eb58f69819 Fonction pour récupérer les valeurs définies dans les colonnes 2012-03-14 08:45:26 +00:00
Michael RICOIS
23166356d4 Ajout définition champs pour l'enrichissement 2012-03-14 08:30:45 +00:00
Michael RICOIS
28f7d52e43 Ajout description des champs 2012-03-12 14:19:56 +00:00
Damien LASSERRE
75e6913ccf correction gros bug dans structure 2012-03-12 13:52:14 +00:00
Michael RICOIS
78c4d98eee Ajout de la classe Mail 2012-03-09 09:14:24 +00:00
Damien LASSERRE
4b4608f306 bug layout 2012-03-08 15:25:27 +00:00
Damien LASSERRE
edf7b7e028 bug layout 2012-03-08 15:25:16 +00:00
Damien LASSERRE
0e43da9d1c bug 2012-03-08 15:05:51 +00:00
Damien LASSERRE
3c89575003 optimisation du helper 2012-03-08 15:05:34 +00:00
Damien LASSERRE
e5929d53c4 Controller Upload pour l'insertion e fichier (en cours de réalisation...) 2012-03-08 15:04:52 +00:00
Damien LASSERRE
d6b00d4063 Commit de l'action de suppression des criteres 2012-03-08 15:04:08 +00:00
Damien LASSERRE
a4391f3886 ajout de l'icone cross pour la suppression des criteres 2012-03-08 15:03:01 +00:00
Damien LASSERRE
c1c8449c72 afficher les panel au rafraichissement 2012-03-08 15:01:21 +00:00
Michael RICOIS
d3684f6835 Fichier qui ont disparus de la 1.0 2012-03-07 11:18:08 +00:00
Damien LASSERRE
05b829d0d7 Critere dans les details des comptages. 2012-03-07 11:14:27 +00:00
Damien LASSERRE
2bb37b2e11 Critere dans les details des comptages. 2012-03-07 11:14:14 +00:00
Michael RICOIS
71b6864bcc Correction sauvegarde du comptage 2012-03-07 11:13:53 +00:00
Damien LASSERRE
90031051ee correction de bug javascript + le rafraichissement des page pour les familles. 2012-03-07 11:13:52 +00:00
Michael RICOIS
d6532f955a On définit le marqueur profil 2012-03-07 10:41:49 +00:00
Michael RICOIS
efa137c644 Correction 2012-03-07 09:01:38 +00:00
Michael RICOIS
2c816731ed Modification pour la gestion de l'enrichissement 2012-03-06 17:10:51 +00:00
Michael RICOIS
ffc27e0766 Gestion des données insee 2012-03-06 16:24:28 +00:00
Michael RICOIS
59df244e79 Enregistrer un profil 2012-03-06 15:02:50 +00:00
Michael RICOIS
85dd71c9fa Création d'une structure pour l'enrichissement 2012-03-06 14:06:38 +00:00
Damien LASSERRE
4a3f20b578 correction des champs labels 2012-03-06 13:38:42 +00:00
Damien LASSERRE
74187e5e35 premiére beta affichage des critères. 2012-03-06 13:15:01 +00:00
Damien LASSERRE
ad3c39fcfc premiére beta affichage des critères. 2012-03-06 13:14:53 +00:00
Michael RICOIS
9c860a1f1f Diverses corrections 2012-03-05 16:55:26 +00:00
Michael RICOIS
42c7be5e22 Correction batch 2012-03-05 15:31:31 +00:00
Michael RICOIS
fe9a39bd82 Ajout spécification pour l'enrichissement 2012-03-05 15:05:30 +00:00
Michael RICOIS
9a0853c2ea Gestion du profil, données pour l'enrichissement 2012-03-05 15:03:56 +00:00
Damien LASSERRE
e579d3a90a correction css sur les lien des arbos (juridique) 2012-03-05 08:19:42 +00:00
Damien LASSERRE
06c50d0d36 correction css sur les lien des arbos (geographique) 2012-03-05 08:19:12 +00:00
Damien LASSERRE
aaf95f0b35 correction css sur les lien des arbos (financier) 2012-03-05 08:18:02 +00:00
Damien LASSERRE
3d8bdbba8b correction css sur les lien des arbos (economique) 2012-03-05 08:17:26 +00:00
Damien LASSERRE
cee2fe1bd3 correction bug table minmax structure 2012-03-05 08:12:19 +00:00
Michael RICOIS
a76be3aae3 Suppression de la table Enrichissement_Commandes 2012-02-27 09:36:49 +00:00
Michael RICOIS
aade0196ae Renommage action ciblagedetail en ciblage 2012-02-27 08:31:19 +00:00
Michael RICOIS
b8933aa09a Javascript dans le controller pour de meilleur performance 2012-02-24 17:23:20 +00:00
Michael RICOIS
d8d87f04f2 Titre facturation 2012-02-24 17:14:21 +00:00
Michael RICOIS
23fae60167 Affichage des derniers enrichissements 2012-02-24 17:11:41 +00:00
Michael RICOIS
398171e813 Correction requete sql 2012-02-24 16:26:20 +00:00
Damien LASSERRE
1b7965fbd2 correction d'erreur dans la simplification 2012-02-24 16:19:50 +00:00
Michael RICOIS
4b99c809fc Suppression menu action 2012-02-24 15:46:43 +00:00
Michael RICOIS
b790b950f1 Correction incompatibilité 2012-02-24 15:45:15 +00:00
Michael RICOIS
878b621a08 Affichage des enrichissements 2012-02-24 15:32:15 +00:00
Damien LASSERRE
24eb5def51 ajout du script autocompleted 2012-02-24 15:05:23 +00:00
Damien LASSERRE
bb5b0b707a Modification des champs + création de nouveau champs et des recherches autocompleted 2012-02-24 14:59:27 +00:00
Michael RICOIS
26869a2fd8 Modification du titre 2012-02-24 13:41:07 +00:00
Michael RICOIS
41a7d74bfd Batch au couleur de zend 2012-02-24 11:19:34 +00:00
Michael RICOIS
db04d8c77e Création du script pour l'enrichissement 2012-02-24 11:02:36 +00:00
Michael RICOIS
6ec41300d2 Suppression condition inutile 2012-02-24 10:50:56 +00:00
Michael RICOIS
79dd70b755 Ajout du fichier pour le lancement des enrichissements 2012-02-24 10:49:48 +00:00
Michael RICOIS
0ea33fb71b Respect de la structure par rapport aux autres projets 2012-02-24 10:44:39 +00:00
Michael RICOIS
87e98e8848 Préparation ajout du profil 2012-02-24 10:43:39 +00:00
Michael RICOIS
3038e83be4 Affichage avant commande du fichier 2012-02-24 10:42:06 +00:00
Michael RICOIS
504d74b63e Ajout marqueur présence de données Insee 2012-02-24 10:27:10 +00:00
Michael RICOIS
eb097d1535 Liste des profils 2012-02-24 09:54:21 +00:00
Michael RICOIS
b530470273 Mise à jour du comptage OK 2012-02-22 20:28:44 +00:00
Michael RICOIS
ba61d4c817 Performance 2012-02-22 19:17:11 +00:00
Michael RICOIS
f4f050dadd Ajout Gestion 2012-02-22 17:08:39 +00:00
Michael RICOIS
a79970de29 Commande du ciblage 2012-02-22 16:30:54 +00:00
Michael RICOIS
b33b364f32 Update 2012-02-22 16:02:28 +00:00
Michael RICOIS
843bb1fb5b Mise à jour du comptage 2012-02-22 15:55:16 +00:00
Michael RICOIS
c1c655d84b Ajout des valeurs en dehors de la session 2012-02-22 15:43:35 +00:00
Michael RICOIS
537340d274 HTML et Javacript 2012-02-22 15:40:19 +00:00
Michael RICOIS
54c828c7ff Reference et Commande pour l'enrichissement 2012-02-22 15:39:44 +00:00
Michael RICOIS
219f23f227 Action update pour la mise à jour dans la liste du comptage 2012-02-22 15:38:57 +00:00
Michael RICOIS
cc1f7de75c Suppression fichier 2012-02-22 15:34:50 +00:00
Michael RICOIS
1568c4ad72 Simplification 2012-02-22 15:30:28 +00:00
Michael RICOIS
21f4d8824c Simplification 2012-02-22 15:28:19 +00:00
Michael RICOIS
f5f3711cbf Harmonisation 2012-02-22 14:47:16 +00:00
Michael RICOIS
2966e158cd Augmentation de la taille de la fenêtre en hauteur 2012-02-22 14:39:22 +00:00
Michael RICOIS
d2ff25fc12 Structure table minmax 2012-02-22 13:29:54 +00:00
Michael RICOIS
f6e540eb64 Ajout référence dans les structures 2012-02-22 13:16:41 +00:00
Michael RICOIS
626795a877 Ajout formulaire demande de référence d'enrichissement 2012-02-22 13:07:06 +00:00
Michael RICOIS
6bdf5bfa6e Ajout script pour dialog demande de référence dans l'enrichissement 2012-02-22 13:06:11 +00:00
Michael RICOIS
1e678a2311 Suppression style qui surcharge mal les paramètres par defaut 2012-02-22 13:05:28 +00:00
Michael RICOIS
f3805d0982 Demande de reference 2012-02-22 12:56:54 +00:00
Michael RICOIS
eb6586aaac Demande de reference 2012-02-22 11:38:57 +00:00
Michael RICOIS
a66664c166 Revu de la structure des tables d'enrichissements 2012-02-22 11:37:39 +00:00
Michael RICOIS
9a97455d5b Action pour l'affichage des informations d'enrichissements 2012-02-22 11:35:18 +00:00
Michael RICOIS
94503708a4 LIBRARY_PATH inconnue 2012-02-22 10:24:20 +00:00
Michael RICOIS
b28cf0c144 Vue pour l'action Enrichissement/Commande 2012-02-22 09:30:46 +00:00
Michael RICOIS
a7d3ac6158 Ajout préambule de l'action commande 2012-02-22 09:30:25 +00:00
Michael RICOIS
c88eb0c2fb Modification du retour de la méthode extract 2012-02-22 09:29:53 +00:00
Michael RICOIS
9a8d4b6967 Modification vue 2012-02-22 09:24:38 +00:00
Michael RICOIS
8cb021d031 Modification de l'affichage 2012-02-21 16:31:33 +00:00
Michael RICOIS
6e6d0e7eae Model pour les différentes table nécessaire à l'enrichissement 2012-02-21 16:07:43 +00:00
Michael RICOIS
d9bb3e8a74 Liaison entre la table Commandes et la table Identifiants 2012-02-21 14:37:56 +00:00
Michael RICOIS
d10344ae41 Table pour l'enregistrement des identifiants afin de réaliser l'enrichissement 2012-02-21 14:37:11 +00:00
Damien LASSERRE
faf22f9755 suppression extract 2012-02-21 13:39:23 +00:00
Damien LASSERRE
5bcee45652 Ajout de la fonction extract 2012-02-21 13:39:02 +00:00
Damien LASSERRE
915d54a719 correction bug login 2012-02-21 13:01:54 +00:00
Damien LASSERRE
57c6565b86 Fonction du controlleur enrichissement 2012-02-21 13:01:26 +00:00
Damien LASSERRE
2155ccfc3d simplification de la fonction execute 2012-02-21 12:59:50 +00:00
Damien LASSERRE
bc1a47cc5c Fonction d'extraction 2012-02-21 12:58:44 +00:00
Michael RICOIS
ef01f0d618 Lien commande enrichissement 2012-02-21 09:43:27 +00:00
Michael RICOIS
32d7023345 Enrichissement 2012-02-21 09:38:04 +00:00
Michael RICOIS
c81c3a6b29 Correction typo 2012-02-20 16:21:05 +00:00
Michael RICOIS
8881b8f576 Correction pour css 2012-02-20 16:19:49 +00:00
Damien LASSERRE
57c2bfa9a1 Ajouts des minmax et modification criteres 2012-02-20 14:08:40 +00:00
Damien LASSERRE
9fb82f87a1 Ajout des batchs 2012-02-20 14:08:13 +00:00
Damien LASSERRE
9a70310c6a Ajout des valeurs pas defaut mix max contenues dans la base local 2012-02-20 14:07:55 +00:00
Damien LASSERRE
af568d45d2 Correction moteur 2012-02-20 14:07:14 +00:00
Damien LASSERRE
38bb1176ee correction domtom 2012-02-17 09:33:09 +00:00
Damien LASSERRE
e235c8545b Remise a jours de la configuration 2012-02-16 14:25:54 +00:00
Damien LASSERRE
fb2d7b2c4e Correction d'un empty pas bon. 2012-02-16 10:03:24 +00:00
Damien LASSERRE
c5cdaa3e8c correction nbmpubli 2012-02-16 09:58:31 +00:00
Damien LASSERRE
52aecfd2e2 Correction des sessions sur les interval select 2012-02-16 09:20:21 +00:00
Damien LASSERRE
792c243f3a Correction session interval... 2012-02-16 09:17:20 +00:00
Damien LASSERRE
80e12eda14 correction dans le helper probleme avec les selected des selects... 2012-02-16 09:15:14 +00:00
Damien LASSERRE
fe2e2dfb74 Correction sur bilTca filterRange passé en filter simple. 2012-02-16 09:08:27 +00:00
Damien LASSERRE
71f591e16a Ajout de la fonction bilDuree 2012-02-16 09:06:11 +00:00
Damien LASSERRE
2100693b79 indentation 2012-02-16 08:52:02 +00:00
Damien LASSERRE
a3fe0d3af0 espace 2012-02-16 08:51:28 +00:00
Damien LASSERRE
abe6ad158e correction affichage du rapelle des critères. 2012-02-16 08:50:08 +00:00
Damien LASSERRE
04c7bb6f02 correction bug sur les départements... (majeur !) 2012-02-16 08:42:47 +00:00
Damien LASSERRE
3d54b21d08 Correction tritre + valeur null dans le rapelle des critères 2012-02-16 08:22:02 +00:00
Damien LASSERRE
a48e8eeaaf Création function reset (mise a jours) 2012-02-16 08:20:03 +00:00
Damien LASSERRE
d2a574d49e correction bug session FJ 2012-02-16 08:18:18 +00:00
Damien LASSERRE
9312fee50b correction bug 2012-02-15 17:19:36 +00:00
Damien LASSERRE
2bf6e1bb6d Mise a jours du JS pour IE6. 2012-02-15 17:07:12 +00:00
Michael RICOIS
c49a520bf5 Vue pour enrichissement 2012-02-15 16:18:35 +00:00
Michael RICOIS
f600df4cd6 Modification pour les enrichissements 2012-02-15 16:15:51 +00:00
Michael RICOIS
e3e2587a08 Suppression style pour les selections des dates avec jquery-ui 2012-02-15 13:03:12 +00:00
Michael RICOIS
55845ab56e Petit modification 2012-02-15 12:56:55 +00:00
Michael RICOIS
df51ce2355 Enrichissement 2012-02-15 12:46:40 +00:00
Michael RICOIS
25147d0665 On remet comme avant 2012-02-15 11:36:34 +00:00
Michael RICOIS
fed721dff2 On revient comme avant 2012-02-15 11:29:00 +00:00
Michael RICOIS
833dd45596 Suppression style 2012-02-15 11:19:11 +00:00
Michael RICOIS
9592b189b5 Suppression charset 2012-02-15 10:58:53 +00:00
Michael RICOIS
cceb47deaf Suppression du fichier reset.css et inclusion dans main 2012-02-15 10:50:48 +00:00
Michael RICOIS
31667cac6c Supprimer les truc inutils 2012-02-15 10:48:22 +00:00
Damien LASSERRE
8677f04e5a Correction du logout pour la reconnection. 2012-02-15 10:47:58 +00:00
Michael RICOIS
8d7fb98111 Set separator pour le titre 2012-02-15 10:40:34 +00:00
Michael RICOIS
6762b15a00 Simplification 2012-02-15 10:35:07 +00:00
Michael RICOIS
60b733b8b6 Suppression chargement fichier javascript inutile 2012-02-15 10:23:38 +00:00
Damien LASSERRE
e12080b214 remise à jours des fichiers 2012-02-15 09:41:59 +00:00
Damien LASSERRE
5fdd0a9e0a suppression du backend 2012-02-15 09:32:54 +00:00
Damien LASSERRE
bed36082ae comment de la route pour le backend 2012-02-15 09:32:34 +00:00
Damien LASSERRE
2677c972bf remise à jours des fichiers 2012-02-15 09:31:22 +00:00
Damien LASSERRE
6baa4f4edd remise à jours des fichiers 2012-02-15 09:30:57 +00:00
Damien LASSERRE
8f72a9e539 remise à jours des fichiers 2012-02-15 09:25:21 +00:00
Damien LASSERRE
68126b1576 remise à jours des fichiers 2012-02-15 09:13:31 +00:00
Damien LASSERRE
f7f2574321 remise à jours des fichiers 2012-02-15 09:12:22 +00:00
Michael RICOIS
6c3fa57080 Amélioration 2012-02-09 12:59:08 +00:00
Michael RICOIS
3f7061b48d On prend la configuration dans le fichier ini 2012-02-09 12:44:00 +00:00
Michael RICOIS
99ba700276 Suppression fichier de configuration 2012-02-09 11:16:18 +00:00
Michael RICOIS
6adc157fc9 Ajout du staging 2012-02-09 10:29:11 +00:00
Michael RICOIS
b906fc56ea Utilisateur unique mysql 2012-02-08 16:16:43 +00:00
Michael RICOIS
e6f1065c19 svn ignore 2012-02-08 16:08:14 +00:00
Michael RICOIS
8e6c107fe2 Suppression fichier de configuration 2012-02-08 16:07:07 +00:00
Michael RICOIS
65cc5b272b Ajout de la configuration 2012-02-08 16:06:17 +00:00
Michael RICOIS
dee2273c53 Suppression .htaccess 2012-02-08 16:02:56 +00:00
Michael RICOIS
f7a0c0d33a svn ignore 2012-02-08 15:51:59 +00:00
Michael RICOIS
b888f2b128 Suppression fichier 2012-02-08 15:37:02 +00:00
Damien LASSERRE
d0cac19a26 Version 1.1 de ODEA
Stable
2012-02-02 17:29:14 +00:00
Damien LASSERRE
3f4e689a90 erreur 2012-02-02 17:27:13 +00:00
Damien LASSERRE
9619043e94 Nouvelle version de ODEA
stable.
2012-02-02 17:26:53 +00:00
Damien LASSERRE
cbbc35290c Premiere version de ODEA
Peut stable...
2012-02-02 17:26:24 +00:00
Damien LASSERRE
ccfc6ac497 erreur 2012-02-02 17:25:38 +00:00
Damien LASSERRE
f9175c5e8b Premiere version de ODEA
Peut stable...
2012-02-02 17:24:48 +00:00
Damien LASSERRE
a72755c3a1 Premiere version de ODEA
Peut stable...
2012-02-02 17:24:48 +00:00
3106 changed files with 773973 additions and 0 deletions

90
application/Bootstrap.php Normal file
View File

@ -0,0 +1,90 @@
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initViewSettings()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$pathStyle = '/themes/default/styles';
$pathScript = '/themes/default/scripts';
$view->setEncoding('UTF-8');
$view->doctype('XHTML1_STRICT');
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink()
->appendStylesheet($pathStyle.'/jquery.qtip.css', 'all')
->appendStylesheet('/themes/jstree/default/style.css')
->appendStylesheet('/themes/jqueryui/jquery-ui.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all');
//->appendStylesheet('/themes/multiselect/css/ui.multiselect.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.'/upload.js', 'text/javascript')
->appendFile($pathScript.'/scripts.js', 'text/javascript');
//->appendFile($pathScript.'/ui.multiselect.js', 'text/javascript');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Odea');
}
protected function _initLogging()
{
//Logger de développement
$writer = new Zend_Log_Writer_Firebug();
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);
Zend_Db_Table::setDefaultAdapter ($db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
Zend_Registry::set('db', $db);
}
protected function _initAutoload()
{
require_once APPLICATION_PATH . '/../library/Zend/Loader/Autoloader.php';
$appPath = realpath(dirname(__FILE__));
$rootPath = dirname($appPath);
$autoload = Zend_Loader_Autoloader::getInstance();
$application = new Zend_Loader_Autoloader_Resource(array(
'basePath' => $appPath . '/modules/frontend/models/',
'namespace' => '',
'resourceTypes' => array('tables'=>array('path'=>'Tables/','namespace'=>'Table'),
'objects'=>array('path'=>'Objects/', 'namespace'=>'Object'),
'forms'=>array('path'=>'Forms/', 'namespace'=>'Form')
)));
$libs = new Zend_Loader_Autoloader_Resource(array(
'basePath' => $rootPath . '/library',
'namespace' => 'library',
'resourceTypes' => array('libs'=>array('path'=>'libs/','namespace'=>'Libs'),
)));
$loader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => APPLICATION_PATH));
return $loader;
}
}

View File

@ -0,0 +1,47 @@
[production]
phpSettings.date.timezone = "Europe/Paris"
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.session.save_path = APPLICATION_PATH "/../cache/sessions"
resources.session.gc_maxlifetime = 86400
resources.session.cookie_lifetime = 86400
resources.session.remember_me_seconds = 86400
; so auto-loading will find our classes in library/App
autoloaderNamespaces[] = "Structure_" ;Les structures de données
autoloaderNamespaces[] = "Libs_" ;Librairies de l'application
resources.view[] = ""
; initialize front controller resource
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "frontend"
autoloaderNamespaces[] = "Scores_"
autoloaderNamespaces[] = "Application_"
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
resources.frontController.plugins.Comptage = "Application_Controller_Plugin_Comptage"
;Resource router Backend
;resources.router.routes.admin.type = Zend_Controller_Router_Route
;resources.router.routes.admin.route = "/backend/*"
;resources.router.routes.admin.defaults.module = backend
;resources.router.routes.admin.defaults.controller = index
;resources.router.routes.admin.defaults.action = index
; initialize layout resource
resources.layout.layoutPath = APPLICATION_PATH "/layouts"
[staging : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,35 @@
<div id="primaryNavigation" class="clearfix">
<ul>
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'), null, true)?>">Accueil</a></li>
<li><a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'index'), null, true)?>">Tableau de bord</a></li>
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'index'), null, true)?>">Aide</a></li>
<li><a href="<?=$this->url(array('controller'=>'aide', 'action'=>'aproposde'), null, true)?>">A propos de</a></li>
<?php if ( $this->admin ) {?>
<li><a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'index'), null, true)?>">Gestion</a></li>
<?php }?>
<li><a href="<?=$this->url(array('controller'=>'user', 'action'=>'logout'), null, true)?>">Déconnexion</a></li>
</ul>
</div>
<div id="logo">
<h1>Odea</h1>
</div>
<div id="message">
<?php if ($this->msgComptage){?>
<div id="comptage" >
<?php if (!empty($this->total)) {?>
Nombre sélectionnées :
<span class="valeur"><?=$this->total?></span>
(dont <span class="valeur"><?=$this->insee?></span> unité(s) insee)
<?php } else {?>
Aucune sélection.
<?php }?>
</div>
<div id="attente" style="display:none;">
<img src="/themes/default/images/ajax.gif" />
</div>
<div id="control">
[<a href="<?=$this->url(array('controller'=>'comptage', 'action'=> 'reset'))?>">Initialiser les critères</a>],
[<a class="saveciblage" href="<?=$this->url(array('controller'=>'comptage', 'action'=>'savedialog'))?>">Sauvegarder le profil du ciblage</a>]
</div>
<?php }?>
</div>

View File

@ -0,0 +1,23 @@
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="global">
<div id="header" class="clearfix">
<?php echo $this->render('header.phtml') ?>
</div>
<div id="content" class="clearfix">
<?php echo $this->layout()->content; ?>
</div>
<div id="footer">
<?php echo $this->render('footer.phtml'); ?>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,9 @@
<?php
class AideController extends Zend_Controller_Action
{
public function indexAction(){}
public function aproposdeAction(){}
}

View File

@ -0,0 +1,88 @@
<?php
class ArborescenceController extends Libs_Controller
{
/* Nafs */
public function nafAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$key = $request->getParam('key');
$object = new Object_Naf();
$this->view->key = $key;
$this->view->naf = $object->naf($request->getParam('niveau', 1), $key);
}
public function nafajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$key = $request->getParam('key');
$object = new Object_Naf();
echo $object->ajax($request->getParam('parent', ''),
$request->getParam('niveau', 1),
$request->getParam('key')
);
}
/* Geographiques */
public function geographiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Codepostaux();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->regions = $object->_getRegions();
}
public function geographiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$id = $request->getParam('id');
$niveau = $request->getParam('niveau');
$object = new Object_Codepostaux();
if($niveau == 0) {
echo ($object->_getDepartements($id));
} else if ($niveau == 1) {
echo ($object->_getCommunes($id));
}
}
/* Forme Juridique */
public function juridiqueAction()
{
$this->_helper->layout()->disableLayout();
$object = new Object_Formejuridique();
$key = $this->getRequest()->getParam('key');
$this->view->key = $key;
$this->view->formejuridiques = $object->_getParents();
}
public function juridiqueajaxAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$object = new Object_Formejuridique();
$request = $this->getRequest();
$id = $request->getParam('id');
echo ($object->_getFils($id));
}
}

View File

@ -0,0 +1,137 @@
<?php
class ComptageController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Comptage();
echo $object->count($request->getParam('cle'), $request->getParam('valeur'));
}
public function resetAction()
{
require_once 'Scores/SessionCiblage.php';
$erreurs = new Zend_Session_Namespace('erreurs');
$session = new SessionCiblage();
$session->clearCiblage();
unset($erreurs->erreurs);
$this->_redirect('./');
}
public function savedialogAction()
{
$this->_helper->layout()->disableLayout();
//Récupération de la session pour le profil et les valeurs du comptage
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
$criteres = $session->getCriteres();
$this->view->criteres = $criteres;
if (count($criteres) == 0) {
$this->view->noSelection = true;
}
}
public function saveAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$object = new Object_Comptage();
$object->saveComptage($request->getParam('ref', ''));
}
public function updateAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$idCriteres = $request->getParam('id');
//Récupération des critères du ciblage
$criteresM = new Table_Criteres();
$criteresRow = $criteresM->find($idCriteres);
$criteres = $criteresRow->current();
$structure = json_decode($criteres->criteres, true);
require_once 'Scores/Field.php';
$field = new Fields();
$values = $field->getValues($structure);
//Comptage
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($values);
$data = array(
'idDefinition' => $idCriteres,
'resultat' => $ciblage->execute(),
'uniteInsee' => $ciblage->calculRedevanceInsee(),
'dateAjout' => date('YmdHis'),
);
//Enregistrement
$comptageM = new Table_Comptages();
$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'],6,2)
.' '.substr($data['dateAjout'],8,2).':'.substr($data['dateAjout'],10,2).':'.substr($data['dateAjout'],12,2),
);
$this->view->result = $result;
}
public function previsualisationAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$object = new Object_Comptage();
$sirets = $object->count(null, null, true);
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$dbMetier = Zend_Db::factory($dbConfig->jo);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
$i = 0;
foreach($sirets as $siret) {
if($i>10)
break;
$sql = $dbMetier->select()->from('etablissements_act')->where('siren = ?', substr($siret, 0, 9))
->where('nic = ?', substr($siret, 9, strlen($siret)));
$result = $dbMetier->fetchRow($sql);
/*Provisoir...*/
$result['tel'] = str_pad($result['tel'], 10, 0, STR_PAD_LEFT);
$result['fax'] = str_pad($result['fax'], 10, 0, STR_PAD_LEFT);
$previ[] = $result;
$i++;
}
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
//$object->getProfil($user->username, $user->idClient);
$table = new Table_EnrichissementProfils();
$sql = $table->select()
->where('login = ?', $user->username)
->where('idClient = ?', $user->idClient);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$result = $result->toArray();
$champs = json_decode($result['criteres']);
require_once('Scores/Enrichissement.php');
$fields = new Enrichissement();
$this->view->reference = $fields->getFields();
}
$this->view->champs = $champs;
$this->view->liste = $previ;
}
}

View File

@ -0,0 +1,152 @@
<?php
class DashboardController extends Libs_Controller
{
public function init()
{
$this->view->headLink()->appendStylesheet('/themes/default/styles/dashboard.css', 'all');
$this->view->headScript()->appendFile('/themes/default/scripts/dashboard.js', 'text/javascript');
}
public function indexAction()
{
$object = new Object_Dashboard();
$this->view->comptages = $object->index();
$this->view->enrichissements = $object->enrichissements();
}
public function ciblagesAction()
{
$object = new Object_Dashboard();
$request = $this->getRequest();
$assigns = $object->ciblage($request->getParam('page', 1));
$this->view->ciblages = $assigns['ciblages'];
$this->view->nbCiblage = $assigns['nbCiblage'];
}
public function ciblageAction()
{
require_once('Scores/Field.php');
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
$object = new Object_Dashboard();
$request = $this->getRequest();
$comptage = $object->ciblagedetail($request->getParam('id'));
$enrichissement = $object->enrichissement($request->getParam('id'));
$this->view->comptageId = $request->getParam('id');
$this->view->label = new Fields();
$this->view->criteres = $comptage['criteres'];
$this->view->comptages = $comptage['comptages'];
$this->view->enrichissements = $enrichissement;
$this->view->pathfile = $config->path->data;
}
public function rcomptageAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$q = $request->getParam('q');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres();
$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);
if (count($rows)>0){
$separator = " , ";
foreach ($rows as $item) {
$output[] = array(
'label' => $item->reference . $separator . $item->date,
'value' => $item->reference,
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblage', 'id'=>$item->id)),
);
}
}
echo json_encode($output);
}
/**
* Liste des enrichissements
*/
public function enrichissementsAction()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
//Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes
$enrichissementsM = new Table_EnrichissementIdentifiants();
$sql = $enrichissementsM->select()
->setIntegrityCheck(false)
->from(
array('i' => 'enrichissement_identifiants'),
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
)
->join(
array('c' => 'comptages'), 'i.idComptage = c.id',
array('')
)
->join(
array('criteres' => '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;
// Impossible de copie la varible issu d'un select car sinon elle conserve les meme propriété que sont parent
// donc les selects... donc obliger de faire deux requetes pour le moment.
$sql = $enrichissementsM->select()
->setIntegrityCheck(false)
->from(
array('i' => 'enrichissement_identifiants'),
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
)
->join(
array('c' => 'comptages'), 'i.idComptage = c.id',
array('')
)
->join(
array('criteres' => '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()
{
}
}

View File

@ -0,0 +1,46 @@
<?php
class EconomiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields();
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('economique');
}
public function completedAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$table = new Table_Nafs();
$sql = $table->select()
->where('lib LIKE "%'.$this->getRequest()->getParam('q').'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->lib . $separator . $item->code,
'value' => $item->code
);
}
echo json_encode($output);
}
}

View File

@ -0,0 +1,253 @@
<?php
class EnrichissementController extends Zend_Controller_Action
{
public function init()
{
$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('/themes/default/scripts/jqueryprogressbar.js', 'text/javascript');
$this->view->assign('filesize', ini_get('upload_max_filesize'));
}
public function fileuploadAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$config = Zend_Registrey::get('configuration');
$path = realpath($config->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
*/
public function fileprogressAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$request = $this->getRequest();
$key = $request->getParam('key', '');
if ( !empty($key) ) {
//$rep sera égal à false si la clef n'existe pas dans le cache apc
$rep = apc_fetch('upload_'.$key);
echo json_encode($rep);
}
}
/**
* Enregistrement de la commande pour l'ennrichissement
*/
public function commandeAction()
{
set_time_limit(60);
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$idCriteres = $request->getParam('id', null);
$idProfil = $request->getParam('profil', null);
//Vérifier les profils du client
if ( $idProfil===null ){
//Selection du profil du client
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$profilsM = new Table_EnrichissementProfils();
$sql = $profilsM->select()
->from($profilsM, array('id'))
->where('idClient=?', $user->idClient)
->where('login=?', $user->username)
->where('actif=?', 1);
$profil = $profilsM->fetchRow($sql);
$idProfil = $profil->id;
}
$comptage = new Table_Comptages();
$sql = $comptage->select()->where('idDefinition = ?', $idCriteres);
$result = $comptage->fetchRow($sql);
$idComptage = $result['id'];
//Récupération des critères du ciblage
$criteresM = new Table_Criteres();
$criteresRow = $criteresM->find($idCriteres);
$criteres = $criteresRow->current();
$structure = json_decode($criteres->criteres, true);
require_once 'Scores/Field.php';
$field = new Fields();
$values = $field->getValues($structure);
//Récupération des SIRET
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($values, true);
$infosExtraction = $ciblage->execute(true);
//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' => $this->getRequest()->getParam('ref'),
'idCriteres' => $criteres->id,
'idProfil' => $idProfil,
'identifiants' => json_encode($infosExtraction),
'idProfil' => $idProfil,
'fichier' => '',
'nbLigneTotales' => count($infosExtraction),
'nbLigneTraites' => 0,
'uniteInsee' => $ciblage->calculRedevanceInsee(),
'error' => '',
'dateAdded' => date('YmdHms'),
);
$identifiantsM = new Table_EnrichissementIdentifiants();
$idIdentifiant = $identifiantsM->insert($data);
exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$idIdentifiant);
}
/**
* Demande de référence pour l'enrichissement
*/
public function referenceAction()
{
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
//Récupération du profil de l'utilisateur
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$profilsM = new Table_EnrichissementProfils();
$sql = $profilsM->select()
->from($profilsM, array('id', 'reference', 'tarifLigne', 'dataInsee'))
->where('idClient=?', $user->idClient)
->where('login=?', $user->username)
->where('actif=?', 1);
$profil = $profilsM->fetchRow($sql);
//
if ($profil!==null)
{
$this->view->assign('profil', true);
$idCritere = $request->getParam('id', null);
$comptagesM = new Table_Comptages();
$sql = $comptagesM->select()
->where('idDefinition = ?', $idCritere)
->order('dateAjout DESC')
->limit(1);
$comptages = $comptagesM->fetchAll($sql);
$old = $comptages;
$oldResultat = $old[0]->resultat;
$oldResultatInsee = $old[0]->uniteInsee;
if ( $comptages->count()>0 ) {
$item = $comptages[0];
$date = explode(' ', $item->dateAjout);
$date = $date[0];
if($date != '0000-00-00') {
if($date != date('Y-m-d')) {
$criteres = new Table_Criteres();
$sql = $criteres->select()->where('id = ?', $idCritere);
$result = $criteres->fetchRow($sql)->toArray();
$criteres = json_decode($result['criteres'], true);
require_once('Scores/Field.php');
require_once('Scores/Ciblage.php');
$field = new Fields();
$count = new Ciblage($field->getValues($criteres));
$item['resultat'] = $count->execute();
$item['uniteInsee'] = $count->calculRedevanceInsee();
}
}
$this->view->assign('resultat', $item['resultat']);
$this->view->assign('uniteInsee', $item['uniteInsee']);
//Calcul du prix
$redevanceInsee = 3.295/100; //Seuil de facturation 52 734 euros
$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.";
}
$prix = $item['resultat'] * $profil->tarifLigne + $prixInsee;
$this->view->prix = round($prix, 2);
$this->view->prixInsee = round($prixInsee, 2);
$this->view->infoInsee = $infoInsee;
$this->view->id = $item['id'];
/*$this->view->oldDate = $date;
$this->view->oldResult = $oldResultat;
$this->view->oldResultInsee = $oldResultatInsee;
$this->view->oldPrice = round(($oldResultat* $profil->tarifLigne)+ $oldResultatInsee);
$this->view->oldPriceInsee = round($oldResultatInsee*$redevanceInsee, 2);*/
$this->view->criteres = $criteres;
}
}
}
public function downloadAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$id = $this->getRequest()->getParam('id');
$table = new Table_EnrichissementIdentifiants();
$sql = $table->select()
->where('id = ?', $id);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
$result = $result->toArray();
$date = explode(' ', $result['dateAdded']);
$path = $config->path->data.'/'.substr($date[0], 0, 7).'/';
$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.';
}
}
}

View File

@ -0,0 +1,27 @@
<?php
class EntrepriseController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields();
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('entreprise');
}
}

View File

@ -0,0 +1,43 @@
<?php
class ErreurController extends Libs_Controller
{
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]);
}
}
}
}

View File

@ -0,0 +1,48 @@
<?php
class ErrorController extends Zend_Controller_Action
{
public function errorAction()
{
$errors = $this->_getParam('error_handler');
switch ($errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Page not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = 'Application error';
break;
}
// Log exception, if logger available
if ($log = $this->getLog()) {
$log->crit($this->view->message, $errors->exception);
}
// conditionally display exceptions
if ($this->getInvokeArg('displayExceptions') == true) {
$this->view->exception = $errors->exception;
}
$this->view->request = $errors->request;
}
public function getLog()
{
$bootstrap = $this->getInvokeArg('bootstrap');
if (!$bootstrap->hasPluginResource('Log')) {
return false;
}
$log = $bootstrap->getResource('Log');
return $log;
}
}

View File

@ -0,0 +1,22 @@
<?php
Class ExtractController extends Zend_Controller_Action
{
public function indexAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
require_once 'Scores/Ciblage.php';
require_once 'Scores/Field.php';
$field = new Fields();
$ciblage = new Ciblage($field->getValues());
$ciblage->extract();
}
public function batchAction()
{
$action = $this->getRequest();
$request = $action->getParam('reference');
}
}

View File

@ -0,0 +1,30 @@
<?php
class FinancierController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields();
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('financier');
}
}

View File

@ -0,0 +1,113 @@
<?php
class GeographiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$field = new Fields();
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('geographique');
}
public function completedAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
if($request->getParam('dep')) {
$output = $this->completedDep($request->getParam('q'));
} else if ($request->getParam('reg')) {
$output = $this->completedReg($request->getParam('q'));
} else if($request->getParam('vil')) {
$output = $this->completedVil($request->getParam('q'));
}else if($request->getParam('adr_com')) {
$output = $this->completedVil($request->getParam('q'));
}else if($request->getParam('adr_com_ex')) {
$output = $this->completedVil($request->getParam('q'));
}
echo json_encode($output);
}
protected function completedDep($q)
{
$table = new Table_Departements();
$sql = $table->select()
->where('libdep LIKE "'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->libdep . $separator . $item->numdep,
'value' => $item->numdep
);
}
return ($output);
}
protected function completedVil($q)
{
$table = new Table_Codepostauxs();
$separator = ' ';
$sql = $table->select()->where('Commune LIKE "'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->Commune . $separator . $item->Codepos,
'value' => $item->INSEE
);
}
return ($output);
}
protected function getDeptFromReg($dep)
{
$table = new Table_Departements();
$sql = $table->select()
->where('codeRegionInsee = '.$dep);
$result = $table->fetchAll($sql)->toArray();
$string = '';
foreach ($result as $res) {
$string .= $res['numdep'].',';
}
$string = substr($string, 0, strlen($string)-1);
return ($string);
}
protected function completedReg($q)
{
$table = new Table_Regions();
$separator = ' ';
$sql = $table->select()
->where('NCCENR LIKE "%'.$q.'%" OR REGION LIKE "%'.$q.'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->REGION .' '.$item->NCCENR . $separator . $item->REGION,
'value' => $this->getDeptFromReg($item->REGION)
);
}
return ($output);
}
}

View File

@ -0,0 +1,127 @@
<?php
class GestionController extends Zend_Controller_Action
{
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');
}
public function indexAction()
{
}
public function profilsAction()
{
$profilsM = new Table_EnrichissementProfils();
$sql = $profilsM->select()
->from($profilsM, array('id', 'idClient', 'login', 'reference', 'tarifLigne', 'dateAjout', 'dateSuppr', 'actif'));
$profils = $profilsM->fetchAll($sql);
$this->view->assign('profils', $profils);
}
public function profilAction(){}
public function profiladdAction()
{
$request = $this->getRequest();
//Sauvegarde du formulaire
if ( $request->isPost() && $request->getParam('submit')=='Enregistrer' ){
$params = $request->getParams();
//Vérifier le formulaire
$errForm = 0;
foreach ( $params as $key => $value ) {
if (empty($value)) {
$errForm++;
}
}
if (!$errForm) {
$dataInsee = 0;
// Est ce qu'il existe une donnée insee
require_once 'Scores/Enrichissement.php';
$fieldsM = new Enrichissement();
$fields = $fieldsM->getFields();
foreach ( $fields as $key => $val) {
if ( array_key_exists('insee', $val) && $val['insee']===true) {
$dateInsee = 1;
break;
}
}
$data = array(
'idClient' => $params['idClient'],
'login' => $params['login'],
'reference' => $params['reference'],
'criteres' => json_encode($params['criteres']),
'tarifLigne' => $params['tarifLigne'],
'dataInsee' => $dataInsee,
'dateAjout' => date('Y-m-d H:i:s'),
'actif' => 1,
);
$profilM = new Table_EnrichissementProfils();
if ( $profilM->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");
}
}
//Affichage du formulaire
require_once 'Scores/Enrichissement.php';
$fieldsM = new Enrichissement();
$allFields = $fieldsM->getFields();
$this->view->assign('fields', $allFields);
}
public function profildelAction(){}
public function comptagesAction()
{
$table = new Table_Comptages();
$sql = $table->select()
->order('dateAjout DESC');
$this->view->comptages = $table->fetchAll($sql)->toArray();
}
public function enrichissementsAction()
{
$table = new Table_EnrichissementIdentifiants();
$sql = $table->select()
->order('dateAdded DESC');
$this->view->enrichissements = $table->fetchAll($sql)->toArray();
}
public function extractAction()
{
$id = $this->getRequest()->getParam('id');
$table = new Table_EnrichissementIdentifiants();
$sql = $table->select()
->where('idComptage = ?', $id);
$result = $table->fetchRow($sql);
if(!empty($result)) {
$result = $result->toArray();
$sirets = json_decode($result['identifiants']);
foreach($sirets as $siret) {
echo $siret."\n";
}
}else {
echo 'Aucune commande d\'enrichissement sur ce comptage';
}
exit;
}
}

View File

@ -0,0 +1,47 @@
<?php
Class IndexController extends Libs_Controller
{
public function init()
{
$this->view->headScript()
->appendFile('/themes/default/scripts/jquery.jstree.js', 'text/javascript')
->appendFile('/themes/default/scripts/fields.js', 'text/javascript')
->appendFile('/themes/default/scripts/autocompleted.js', 'text/javascript');
/* Initialize action controller here */
}
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
if ($user->customisation) {
$this->view->assign('preferences', $user->customisation);
}
}
public function criteresAction()
{
$ajax = $this->getRequest()->getParam('ajax');
if($ajax)
$this->_helper->layout()->disableLayout();
require_once 'Scores/SessionCiblage.php';
require_once 'Scores/Field.php';
$session = new SessionCiblage();
$this->view->field = new Fields();
$this->view->criteres = $session->getCriteres();
}
public function removeAction()
{
require_once('Scores/SessionCiblage.php');
$this->_helper->layout()->disableLayout();
$session = new SessionCiblage();
$session->unsetCritere($this->getRequest()->getParam('critere'));
$objet = new Object_Comptage();
$objet->count(null, null);
$this->_redirect('/');
}
}

View File

@ -0,0 +1,47 @@
<?php
class JuridiqueController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
require_once('Scores/Field.php');
$this->view->headLink()->appendStylesheet('/themes/default/styles/'.$this->getRequest()->getControllerName().'.css', 'all');
$field = new Fields();
$this->view->fields = $field;
}
public function resetAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$session->resetFamille('juridique');
}
public function completedAction()
{
$table = new Table_Formejuridiques();
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$request = $this->getRequest();
$sql = $table->select()
->where('fjLibelle LIKE "'.$request->getParam('q').'%"');
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->fjLibelle . $separator . $item->fjCode,
'value' => $item->fjCode
);
}
echo json_encode($output);
}
}

View File

@ -0,0 +1,18 @@
<?php
class LoginController extends Libs_Controller
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
}

View File

@ -0,0 +1,48 @@
<?php
Class UploadController extends Zend_Controller_Action
{
protected $path;
protected $extensions;
public function init()
{
/*$config = Zend_Registrey::get('configuration');
$path = realpath($config->path->data).'/clients';
$this->path = $path;
$this->extensions = array('.csv');
if(!file_exists($path)) mkdir($path);*/
}
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;
}*/
}
}

View File

@ -0,0 +1,78 @@
<?php
class UserController extends Libs_Controller
{
public function init()
{
require_once APPLICATION_PATH.'/modules/frontend/models/Forms/Login.php';
require_once 'Scores/WsScores.php';
}
/**
* Gestion de l'authentification
*/
public function loginAction()
{
//@todo : gestion des affichages particuliers pour les clients
$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 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 {
$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
*/
public function logoutAction()
{
Zend_Auth::getInstance()->clearIdentity();
$this->_helper->layout()->disableLayout();
$request = $this->getRequest();
$message = $request->getParam('message');
$this->view->assign('message', $message);
$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');
}
}

View File

@ -0,0 +1,28 @@
<?php
class Form_Login extends Zend_Form {
public function init()
{
$this->setName('login');
$this->setAction('/user/login');
$this->setMethod('post');
$this->addElement('text', 'login', array(
'filters' => array('StringTrim'),
'label' => 'Identifiant : ',
'required' => 'true',
)
);
$this->addElement('password', 'pass',
array(
'label' => 'Mot de passe : ',
'required' => 'true',
)
);
$this->addElement('submit', 'submit',
array(
'label' => 'Identification',
'ignore' => true,
));
}
}

View File

@ -0,0 +1,152 @@
<?php
class Object_Codepostaux extends Libs_Row
{
/* Selection des classes statut pour jstree */
public function _jstree_checked($type)
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$valeurs = $session->getCritere($type);
return (substr($valeurs, 0, strlen($valeurs)-1));
}
public function _jstree_undetermined($niveau, $type)
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$table = new Table_Departements();
$valeurs = explode(',', $session->getCritere($type));
//print_r($valeurs);
/*$valeurs = array_merge($valeurs, explode(',', $session->getCritere('adr_com')));*/
$in = array();
foreach($valeurs as $valeur) {
if($niveau == 0) {
if ($type == 'adr_dept'){
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
foreach ($insee as $code)
$in[] = 'adr_reg:'.$code['codeRegionInsee'];
} else{
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
foreach ($insee as $code)
$in[] = 'adr_reg:'.$code['codeRegionInsee'];
}
} else if ($niveau == 1) {
$insee = $table->fetchAll($table->select('departements', array('codeRegionInsee'))
->where('numdep = ?', substr($valeur, 0, 2)))->toArray();
foreach ($insee as $code)
$in[] = 'adr_dept:'.$code['numdep'];
}
}
return ($in);
}
public function _getClass($valeur, $niveau)
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$valeurs = explode(',', $valeur);
$key = ((strlen($valeur) < 5)?'adr_dept':'adr_com');
$session = explode(',', $session->getCritere('adr_dept'));
$row = 0;
foreach ($session as $dept) {
if(in_array($dept, $valeurs))
$row++;
}
if($row == count($valeurs) and $row != 1) {
return ('jstree-checked');
}
else if($row > 1)
return ('jstree-undetermined');
/*$type = explode(':', $valeur);
if($type[1] == $this->_jstree_checked($type[0]))
return ('jstree-checked');
else if (in_array($valeur, $this->_jstree_undetermined($niveau, $type[0])))
return ('jstree-undetermined');*/
}
protected function getDepartement($region)
{
$table = new Table_Departements();
$sql = $table->select()
->where('codeRegionInsee = '.$region);
$result = $table->fetchAll($sql)->toArray();
$depts = array();
foreach($result as $departement) {
$depts[] = $departement['numdep'];
}
return (implode(',', $depts));
}
/* Fonctions de construction de jstree */
public function _getRegions()
{
$region = new Table_Regions();
$regions = $region->fetchAll($region->select()->order('NCCENR ASC'))->toArray();
$structure = array();
foreach($regions as $nom) {
$structure[] = array(
'data' => $nom['NCCENR'],
'attr' => array('id' => $this->getDepartement($nom['REGION']),
'niveau' => 0,
'class' => $this->_getClass($this->getDepartement($nom['REGION']), 0)
),
'state' => 'closed',
'children' => array()
);
}
return (json_encode($structure));
}
public function _getDepartements($codeRegionInsee)
{
//$code = explode(':', $codeRegionInsee);
$departement = new Table_Departements();
foreach(explode(',', $codeRegionInsee) as $dept) {
$departements[] = $departement->fetchAll($departement->select()
->where('numdep ='.$dept))->toArray();
}
$structure = array();
foreach($departements as $nom) {
$structure[] = array(
'data' => $nom[0]['numdep'].' '.$nom[0]['libdep'],
'attr' => array('id' => $nom[0]['numdep'],
'niveau' => 1,
'class' => $this->_getClass($nom[0]['numdep'], 1)
),
'state' => 'closed',
'children' => array()
);
}
return (json_encode($structure));
}
public function _getCommunes($numdep)
{
//$numdep = explode(':', $numdep);
$codepostau = new Table_Codepostauxs();
$codepostaux = $codepostau->fetchAll($codepostau->select()->where('codepos LIKE "'.$numdep.'%"'))->toArray();
$structure = array();
foreach($codepostaux as $nom) {
$structure[] = array(
'data' => $nom['Codepos'].' '.$nom['Commune'],
'attr' => array('id'=> $nom['INSEE'],
'niveau' => 2,
'class' => $this->_getClass($nom['INSEE'], 2)
),
'state' => 'closed',
'children' => array()
);
}
return (json_encode($structure));
}
}

View File

@ -0,0 +1,156 @@
<?php
class Object_Comptage extends Libs_Row
{
public function saveComptage($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();
//Enregistrement des critères
$criteresM = new Table_Criteres();
$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 Table_Comptages();
$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",
'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 count($key, $valeur, $need = false)
{
require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage();
if(in_array($key, array('adr_dept', 'adr_com', 'adr_reg', 'adr_com_ex', 'adr_dept_ex')))
{
$valeurs = explode(',', $valeur);
if($key == 'adr_dept') {
$reg_ = $session->getCritere('adr_reg');
if(!empty($reg_)) {
$reg_ = explode(',', $reg_);
$table = new Table_Departements();
$result = array();
foreach($reg_ as $item) {
$sql = $table->select()->where('codeRegionInsee = ?', $item);
$donner = $table->fetchAll($sql)->toArray();
foreach ($donner as $don) {
$result[] = $don['numdep'];
}
foreach($result as $dep) {
if(in_array($dep, $valeurs)) {
$diff[] = $dep;
}
}
$session->unsetCritereValue('adr_reg', $item);
}
}
}
foreach($valeurs as $valeur)
{
$type = explode(':', $valeur);
if(count($type) == 2) {
$key = $type[0];
$valeur = $type[1];
}
switch($key) {
case 'adr_dept':
case 'adr_reg':
$dept .= trim($valeur).',';
break;
case 'adr_com':
case 'vil':
default:
$vil .= trim($valeur).',';
break;
case 'adr_com_ex':
$adr_com_ex .= trim($valeur).',';
break;
case 'adr_dept_ex':
$adr_dept_ex .= trim($valeur).',';
break;
}
}
if(strlen($dept)>0) {
$dept = substr($dept, 0, strlen($dept)-1);
$session->setCritere('adr_dept', $dept);
}
if(strlen($vil)>0) {
$vil = substr($vil, 0, strlen($vil)-1);
$session->setCritere('adr_com', $vil);
}
if(strlen($adr_com_ex)>0) {
$adr_com_ex = substr($adr_com_ex, 0, strlen($adr_com_ex)-1);
$session->setCritere('adr_com_ex', $adr_com_ex);
}
if(strlen($adr_dept_ex)>0) {
$adr_dept_ex = substr($adr_dept_ex, 0, strlen($adr_dept_ex)-1);
$session->setCritere('adr_dept_ex', $adr_dept_ex);
}
} else
$session->setCritere($key, $valeur);
require_once 'Scores/Field.php';
$field = new Fields();
//Comptage
require_once 'Scores/Ciblage.php';
$ciblage = new Ciblage($field->getValues());
if($need) {
return $ciblage->execute(true, 10);
}
$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, '', ' ')
);
return (json_encode($result));
}
}

View File

@ -0,0 +1,5 @@
<?php
class Object_Critere extends Libs_Row
{
}

View File

@ -0,0 +1,196 @@
<?php
Class Object_Dashboard
{
public function index()
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres();
$sql = $criteresM->select()
->from($criteresM, 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 Table_Comptages();
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();
if (count($comptage)>0){
$info['resultat'] = $comptage[0]['resultat'];
$info['uniteInsee'] = $comptage[0]['uniteInsee'];
$info['dateComptage'] = $comptage[0]['dateAjout'];
}
$results[] = $info;
}
return ($results);
}
public function enrichissement($idComptage)
{
$enrichissements = new Table_EnrichissementIdentifiants();
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$sql = $enrichissements->select()
->setIntegrityCheck(false)
->from(
array('i' => 'enrichissement_identifiants'),
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
)
->join(
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
array('')
)
->where('criteres.idClient = ?', $user->idClient)
->where('criteres.login = ?', $user->username)
->where('i.idCriteres = ?', $idComptage);
return ($enrichissements->fetchAll($sql));
}
public function enrichissements()
{
$enrichissementsM = new Table_EnrichissementIdentifiants();
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$sql = $enrichissementsM->select()
->setIntegrityCheck(false)
->from(
array('i' => 'enrichissement_identifiants'),
array('id', 'reference', 'fichier', 'nbLigneTotales', 'nbLigneTraites', 'error', 'dateAdded', 'dateStart', 'dateStop')
)
->join(
array('c' => 'comptages'), 'i.idComptage = c.id',
array('')
)
->join(
array('criteres' => 'criteres'), 'i.idCriteres = criteres.id',
array('')
)
->where('criteres.idClient = ?', $user->idClient)
->where('criteres.login = ?', $user->username)
->order('dateAdded DESC');
return ($enrichissementsM->fetchAll($sql));
}
public function menu()
{
}
public function ciblage($page)
{
$offset = 20;
//Liste des ciblages par paquet de n
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres();
//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 Table_Comptages();
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;
}
return (array('ciblages' => $results, 'nbCiblage' => $nbCiblage));
}
public function ciblagedetail($id)
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$table = new Table_Criteres();
$sql = $table->select()
->where('idClient = ?', $user->idClient)
->where('login = ?', $user->username)
->where('id = ?', $id);
$criteres = $table->fetchRow($sql)->toArray();
if ($criteres != null){
$comptage = new Table_Comptages();
$sql = $comptage->select()
->where('idDefinition = ?', $id)->order('dateAjout DESC');
$comptages = $comptage->fetchAll($sql)->toArray();
}
return (array_merge(array('comptages' => $comptages), array('criteres' => $criteres)));
}
public function rcomptage($q)
{
$auth = Zend_Auth::getInstance();
$user = $auth->getIdentity();
$criteresM = new Table_Criteres($db);
$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);
if (count($rows)>0){
$separator = " , ";
foreach ($rows as $item) {
$output[] = array(
'label' => $item->reference . $separator . $item->date,
'value' => $item->reference,
'url' => $this->view->url(array('controller'=>'dashboard', 'action'=>'ciblage', 'id'=>$item->id)),
);
}
}
return (json_encode($output));
}
}

View File

@ -0,0 +1,5 @@
<?php
class Object_Departement extends Libs_Row
{
}

View File

@ -0,0 +1,75 @@
<?php
class Object_Formejuridique extends Libs_Row
{
protected function _jstree_checked()
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$valeurs = explode(',', $session->getCritere('cj'));
foreach($valeurs as $valeur) {
if($valeur != '')
$return[] = $valeur;
}
if(is_array($return))
return ($return);
return (array($valeurs));
}
protected function _jstree_undetermined()
{
return (array());
}
public function _getClass($valeur)
{
if(in_array($valeur, $this->_jstree_checked()))
return ('jstree-checked');
else if (in_array($valeur, $this->_jstree_undetermined()))
return ('jstree-undetermined');
}
public function _getParents()
{
$formes = new Table_Formejuridiques();
$formes = $formes->fetchAll($formes->select()->where('LENGTH(fjCode) = 1'))->toArray();
$structure = array();
foreach($formes as $forme) {
$structure[] = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode'],
'class' => $this->_getClass($forme['fjCode'])),
'state' => 'closed',
'children' => array($this->_getFils($forme['fjCode'])),
);
}
return (json_encode($structure));
}
public function _getFils($fjcode)
{
$lenth = ((strlen($fjcode) == 2)?4:2);
$formes = new Table_Formejuridiques();
$sql = $formes->select()->from('formejuridique', array(
'size' => new Zend_Db_Expr('LENGTH(fjCode)'),
'fjCode',
'fjLibelle'))
->where('fjCode LIKE "'.$fjcode.'%"')
->having('size = ?', $lenth);
$formes = $formes->fetchAll($sql)->toArray();
$structure = array();
foreach($formes as $forme) {
$structure = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode'],
'class' => $this->_getClass($forme['fjCode'])),
'state' => 'close',
'children' => (($lenth < 6)?$this->_getFils($forme['fjCode']):array())
);
$tabfj[] = $structure;
}
return ($tabfj);
}
}

View File

@ -0,0 +1,5 @@
<?php
class Object_Minmax extends Libs_Row
{
}

View File

@ -0,0 +1,107 @@
<?php
class Object_Naf extends Libs_Row
{
public function naf($niveau, $key)
{
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));
}
}
$nafM = new Table_Nafs();
$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;
}
return 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 Table_Nafs();
$sql = $nafM->select()
->from($nafM, array('parent'))
->where('code = ?', $value);
$result = $nafM->fetchRow($sql);
$out[] = $result->parent;
}
return $out;
}
public function ajax($parent, $niveau, $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));
}
}
$niveau++;
$nafM = new Table_Nafs();
$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;
}
return json_encode($tabNaf);
}
}

View File

@ -0,0 +1,5 @@
<?php
class Object_Prefs extends Libs_Row
{
}

View File

@ -0,0 +1,5 @@
<?php
class Object_ProfilExtraction extends Libs_Row
{
}

View File

@ -0,0 +1,5 @@
<?php
class Object_RefExport extends Libs_Row
{
}

View File

@ -0,0 +1,6 @@
<?php
class Object_Region extends Libs_Row
{
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Codepostauxs extends Libs_Table
{
protected $_name = 'codepostaux';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Comptages extends Libs_Table
{
protected $_name = 'comptages';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Criteres extends Libs_Table
{
protected $_name = 'criteres';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Departements extends Libs_Table
{
public $_name = 'departements';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_EnrichissementIdentifiants extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_identifiants';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_EnrichissementProfils extends Zend_Db_Table_Abstract
{
public $_name = 'enrichissement_profils';
}

View File

@ -0,0 +1,7 @@
<?php
class Table_Formejuridique extends Libs_Table
{
protected $_name = 'formejuridique';
protected $_primary = 'fjCode';
}

View File

@ -0,0 +1,7 @@
<?php
class Table_Formejuridiques extends Libs_Table
{
protected $_name = 'formejuridique';
protected $_primary = 'fjCode';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Minmaxs extends Libs_Table
{
protected $_name = 'minmax';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Nafs extends Libs_Table
{
protected $_name = 'naf';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_Prefs extends Libs_Table
{
protected $_name = 'prefs';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_ProfilExtraction extends Libs_Table
{
protected $_name = 'profilExtraction';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_ProfilExtractions extends Libs_Table
{
protected $_name = 'profileExtraction';
}

View File

@ -0,0 +1,5 @@
<?php
class Table_RefExport extends Libs_Table
{
protected $_name = 'refexport';
}

View File

@ -0,0 +1,6 @@
<?php
class Table_Regions extends Libs_Table
{
protected $_name = 'regions';
}

View File

@ -0,0 +1,262 @@
<?php
Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
{
public function Field($name, $field, $type = null)
{
$html = '';
if($field != null) {
$html.= '<div class="fieldgrp">';
if($type == null)
$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':
switch($name) {
case 'reg':
$label = 'Localisation Régions';
break;
case 'vil':
case 'adr_com':
$label = 'Localisation Villes';
break;
case 'dep':
$label = 'Localisation Départements';
break;
default:
$label = $field['label'];
}
$html.= $this->structureHTML(
$label,
$this->textHTML($name, $field, $name), $field['help'][ucfirst($name)]);
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;
case 'file':
$html.= $this->structureHTML(
$field['label'],
$this->fileuploadHtml($name, $field));
break;
}
$html.= '</div>';
}
return $html;
}
private function structureHTML($label, $html, $help = null)
{
$out = '';
$out.= $this->structureLabel($label, $help);
$out.= '<div class="field">'.$html.'</div>';
return $out;
}
/**
* Définition du label
* @param unknown_type $label
*/
private function structureLabel($label, $help)
{
$return = '<label>'.$label.'</label>';
if($help)
$return .= '<p style="font-size:9px;">'.$help.'</p>';
return ($return);
}
protected function getMinMax($name, $valeur)
{
if(!empty($name)) {
$default = Fields::getMinMax($name);
if(empty($valeur[0])){$valeur[0] = $default[0]['min'];}
if(empty($valeur[1])){$valeur[1] = $default[0]['max'];}
}
return ($valeur);
}
private function intervalSelectHTML($name, $field)
{
$session = new SessionCiblage();
$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) {
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 class="intervalSelect" name="'.$name.'2" id="'.$name.'" number="2">';
foreach($field['fields'][$field['type']]['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 ($return);
}
/* Select */
private function selectMultipleHTML($name, $field)
{
$session = new SessionCiblage();
$sessionValeur = $session->getCritere($name);
/*if(is_array($sessionValeur))
$sessionValeur = implode(',', $sessionValeur);*/
$return = '<select size="'.count($field['fields'][$field['type']]['value']).'" class="criteres '.$field['type']['class'].'" name="'.$name.'" multiple>';
$return .= '<option '.(($sessionValeur == 'tous')?'selected':'').' value="tous">Tous</option>';
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
$selected = "";
if(($sessionValeur != null) and in_array($value, $sessionValeur) and $sessionValeur != "tous")
$selected = " selected";
$return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
}
$return .= '</select>';
return ($return);
}
/* Select Multiple */
private function selectHTML($name, $field)
{
$session = new SessionCiblage();
$sessionValeur = $session->getCritere($name);
if(is_array($sessionValeur))
$sessionValeur = implode(',', $sessionValeur);
$return = '<select class="criteres '.$field['type']['class'].'" name="'.$name.'">';
$return .= '<option '.(($sessionValeur == 'tous')?'selected':'').' value="tous">Tous</option>';
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
$selected = "";
if(($sessionValeur != null) and $sessionValeur == $value and $sessionValeur != "tous")
$selected = " selected";
$return .= '<option'.$selected.' value="'.$value.'">'.$label.'</option>';
}
$return .= '</select>';
return ($return);
}
/* Interval */
private function intervalHTML($name, $field)
{
$session = new SessionCiblage();
$valeur = $session->getCritere($name);
$valeur = explode(',', $valeur);
$return = '<div class="interval" >';
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'1" value="'.$valeur[0].'" /> à ';
$return .= '<input class="'.$field['class'].'" type="text" name="'.$name.'2" value="'.$valeur[1].'" />';
$return .= ' <a href="" class="interval" id="'.$name.'">Valider</a>';
$return .= '</div>';
return ($return);
}
/* Dates */
private function dateHTML($name, $field)
{
$session = new SessionCiblage();
$return = '<div class="date" >';
$return .= '<input value="'.$session->getCritere($name).'" type="text" class="datepicker" name="'.$name.'1" /> a ';
$return .= '<input type="text" class="datepicker" name="'.$name.'2" />';
$return .= '</div>';
return ($return);
}
/* Textes */
private function textHTML($name, $field, $name)
{
$session = new SessionCiblage();
switch($name) {
case 'ape_entrep':
case 'ape_etab':
$type = 'Naf';
break;
case 'vil':
$type= 'Vil';
break;
case 'adr_com':
case 'adr_com_ex':
$type= $name;
break;
case 'cj':
$type = 'Cj';
break;
case 'cj_ex':
$type = 'Cj_ex';
break;
case 'adr_dept':
case 'adr_dept_ex':
$type= $name;
break;
}
/* Modifier les données */
$return = '<textarea rows="5" style="border:1px inset silver;width:60%" class="criteres complited'.$type.'" id="textarea_'.$name.'" name="'.$name.'">'.$session->getCritere($name).'</textarea>';
$return .= '<a href="" class="autocomplet" textarea="'.$name.'">Valider</a> <a href="">Aide</a>';
return ($return);
}
/* Textarea */
private function textareaHTML($name, $field)
{
$return = '<a class="arborescence" title="'.$field['title'].'" href="'.$this->view->url(array('controller' => 'arborescence', 'action' => $field['action'], 'key' => $name)).'">
<img src="/themes/default/images/arborescence.gif" />
</a> <img style="cursor:pointer" class="manuel" ref="'.$name.'" src="/themes/default/images/Textarea.gif" title="Champs texte"/>';
if($name == 'adr_com')
$return .= ' <img src="/themes/default/images/img_carte_fr.gif" title="Carte de france"/>';
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 ($return);
}
}

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,20 @@
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
<script>
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/themes/jstree/classic/style.css",
"dots" : true,
"icons" : false,
},
"plugins" : ["themes", "json_data", "checkbox"],
"json_data" : {
"data" : <?=$this->regions?>,
"ajax" : {
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'geographiqueajax', 'key'=> $this->key))?>',
"data" : function(n) { return { id: n.attr ? n.attr("id") : '' , niveau : n.attr ? n.attr("niveau") : 1 }; },
"cache" : true,
}
}
});
</script>

View File

@ -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>

View File

@ -0,0 +1,23 @@
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
<script>
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/style.css",
"dots" : true,
"icons" : false,
},
"plugins" : ["themes", "json_data", "checkbox"],
"json_data" : {
"data" : <?=$this->formejuridiques?>,
"ajax" : {
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'juridiqueajax', 'key'=> $this->key))?>',
"data" : function(n)
{
return { id: n.attr ? n.attr("id") : 0 };
},
"cache" : true,
}
}
});
</script>

View File

@ -0,0 +1,20 @@
<div id="<?=$this->key?>" class="jstree jstree-default" style="overflow:auto;"></div>
<script>
$("#<?=$this->key?>").jstree({
"themes" : {
"theme" : "default",
"url" : "/jstree/style.css",
"dots" : true,
"icons" : false,
},
"plugins" : ["themes", "json_data", "checkbox"],
"json_data" : {
"data" : <?=$this->naf?>,
"ajax" : {
"url" : '<?=$this->url(array('controller'=>'arborescence', 'action'=>'nafajax', 'key'=> $this->key))?>',
"data" : function(n) { return { parent: n.attr ? n.attr("id") : '' , niveau : n.attr ? n.attr("niveau") : 1 }; },
"cache" : true,
}
}
});
</script>

View File

@ -0,0 +1,4 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Comptage</b> and script/action name <b>index</b></p>
</div>

View File

@ -0,0 +1,29 @@
<div style="width:100%;">
<style>
.color{
background-color: #DCE3FC;
}
</style>
<table width="100%" style="font-size:10px;">
<tr>
<?php foreach($this->champs as $champ): ?>
<th style="border-left:1px solid black;padding:2px;"><b><?php echo $champ; ?></b></th>
<?php endforeach; ?>
</tr>
<?php
$i=0;
if(count($this->liste) > 0) {
foreach($this->liste as $societe) {
echo '<tr '.((($i%2) == 0)?'class="color"':'').'>';
foreach($this->champs as $champ) {
echo '<td style="border-left:1px solid silver;padding:2px">'.$societe[$this->reference[$champ]['column']].'</td>';
}
echo '</tr>';
$i++;
}
} else {
echo '<tr><td>Vous n\'avez selectionné aucuns critères</td></tr>';
}
?>
</table>
<div>

View File

@ -0,0 +1,16 @@
<?php if ($this->noSelection): ?>
Vous n'avez pas sélectionné de critères !
<?php else:?>
<div id="result">
<form method="post" id="save" name="save" action="<?=$this->url(array('controller'=>'comptage', 'action'=>'save'))?>">
<center>
<label>Votre référence</label><br />
<input type="text" name="ref" value="<?=date('Y-m-d:H-i-m').'_'.uniqid()?>" />
</form>
<span class="message" style="color:#ff0000;"></span>
</center>
</div>
<script type="text/javascript" src="/themes/default/scripts/jquery.form.js"></script>
<?php endif;?>

View File

@ -0,0 +1 @@
<?=json_encode($this->result)?>

View File

@ -0,0 +1,81 @@
<div id="dashboard" style="padding:10px">
<a href="/dashboard/index">Tableau de bord</a> > Detail du ciblage<br /><br />
<a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$this->comptageId))?>">Actualiser</a> |
<a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$this->comptageId))?>">Recharger les critères de ciblage</a> |
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$this->comptageId))?>">Enrichissement</a>
<fieldset>
<legend>Critères</legend>
<?php foreach(json_decode($this->criteres['criteres'], true) as $critere => $valeur): ?>
<?php if(!empty($valeur) and $valeur != ',' and !empty($critere)): ?>
<?php $label = $this->label->get($critere); ?>
<?php if(!is_array($valeur)): ?>
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval') :?>
<?php echo '<b>'.$label['label'] . '</b> : '.$label['fields'][$label['type']]['value'][$valeur];?><br />
<?php else: ?>
<?php echo '<b>'.$label['label'] . '</b>:'.$valeur; ?><br />
<?php endif; ?>
<?php else:?>
<?php echo '<b>'.$label['label'] .'</b> : '. implode(',', $valeur).'<br />'; ?>
<?php endif; ?>
<?php endif; ?>
<?php endforeach;?>
</fieldset>
<fieldset>
<legend>Comptages</legend>
<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>
</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/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
<?php else: ?>
En attente de traitement
<?php endif; ?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php }?>
</fieldset>
</div>

View File

@ -0,0 +1,45 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Liste de vos ciblages
</div>
<div style="margin:5px 0;">
<h2>Liste de vos ciblages</h2>
<?php if(count($this->ciblages)>0):?>
<table class="ciblage">
<thead>
<tr>
<th>Référence</th>
<th>Nombre d'entité</th>
<th>Unité Insee</th>
<th>Date</th>
<th colspan="4"></th>
</tr>
</thead>
<tbody>
<?php foreach($this->ciblages as $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 class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser</a></td>
<td><a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a></td>
<td><a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
<td><a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$item['id']))?>">Enrichissement</a></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun ciblage.<p>
<?php endif;?>
</div>
</div>

View File

@ -0,0 +1,47 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Préférences
</div>
<h2>Gestion des profils d'enrichissement</h2>
<p>
Afin de vous permettre un enrichissement de données à partir d'une liste de SIREN/SIRET,
Suivant la configuration de votre compte, vous avez la possibilité de sélectionner les données
disponible.
</p>
<br/>
<p>Cas profil défini pas S&D</p>
<p>- Aucun profil d'enrichissement (Contacter le support)</p>
<p>- Liste des profils avec référence, tarifs à la ligne</p>
<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>
<p>
L'application permet la modification de l'affichage des critères de ciblage afin de permettre une
utilisation correspondant à vos besoins.
</p>
<br/>
<p>Vous n'avez pas les droits nécessaires pour créer/modifier les préférences d'affichage.</p>
<p>Des préférences d'affichage ont été définies pour votre profil client.</p>
<br/>
<p>Aucune préférences d'affichage définies pour votre profil utilisateur.</p>
<p>Des préférences d'affichage ont été définies pour votre profil utilisateur.</p>
<br/>
<p>
<a href="<?=$this->url(array('controller'=>'preferences', 'action'=>'active'))?>"
title="Activer le mode personnalisation afin de créer/modifier les préférences d'affichage">
Activer le mode personnalisation
</a>
</p>
</div>

View File

@ -0,0 +1,94 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Enrichissement à partir d'un ciblage
</div>
<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>

View File

@ -0,0 +1,89 @@
<div id="dashboard">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a>
</div>
<div id="menu">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'ciblages'))?>">Liste de vos ciblages</a> -
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>'enrichissements'))?>">Liste de vos enrichissements</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'=>''))?>">Enrichissement de fichier</a>
</div>
<div id="rechercheCiblage">
<h2>Rechercher dans vos ciblages</h2>
<input type="text" name="searchCiblage" class="searchCiblage" />
<input type="submit" value="Rechercher" class="submit"/>
</div>
<div id="lastCiblage">
<h2>Vos derniers ciblages</h2>
<?php if(count($this->comptages) > 0):?>
<table>
<thead>
<tr>
<th>Référence</th>
<th>Nombre d'entité</th>
<th>Unité Insee</th>
<th>Date</th>
<th colspan="4"></th>
</tr>
</thead>
<tbody>
<?php foreach($this->comptages as $name => $item):?>
<tr>
<td class="reference"><?=$item['reference']?></td>
<td class="update resultat"><?=number_format($item['resultat'], 0, ',', ' ')?></td>
<td class="update insee"><?=number_format($item['uniteInsee'], 0, ',', ' ')?></td>
<td class="update date"><?=$item['dateComptage']?></td>
<td><a class="update" href="<?=$this->url(array('controller'=> 'comptage','action'=>'update', 'id'=>$item['id']))?>">Actualiser</a></td>
<td><a href="<?=$this->url(array('controller'=> 'index','action'=>'index', 'id'=>$item['id']))?>">Recharger les critères de ciblage</a></td>
<td><a href="<?=$this->url(array('controller'=> 'dashboard','action'=>'ciblage', 'id'=>$item['id']))?>">Detail</a></td>
<td><a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$item['id']))?>">Enrichissement</a></td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun ciblage.<p>
<?php endif;?>
</div>
<div id="lastEnrichissement">
<h2>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 $i=0;foreach($this->enrichissements as $item):?>
<?php if($i++ == 5)break;?>
<tr>
<td><?=$item['reference']?></td>
<td><?=number_format($item['nbLigneTotales'], 0, ',', ' ')?></td>
<td><?=$item['dateAdded']?></td>
<td>
<?php if ( $item['dateStop']!='0000-00-00 00:00:00' ) {?>
<a href="/enrichissement/download/id/<?php echo $item['id'];?>"><?php echo $item['fichier']; ?></a>
<?php }elseif ( $item['dateStart']!='0000-00-00 00:00:00' ) {?>
En cours de traitement
<?php } else {?>
En attente de traitement
<?php } ?>
</td>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php else:?>
<p>Aucun enrichissement.<p>
<?php endif;?>
</div>

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,55 @@
<div id="economique">
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
</span>
<hr />
<div id="s_economique">
<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 class="ape_etab" style="display:none;background-image:none;height:100px;">
<div id="ape_etab_ex" class="exclusion" style="display:none">
<?php echo $this->Field('ape_etab_ex', $this->fields->get('ape_etab_ex'), 'text');?>
</div>
<div id="ape_etab_in" class="inclusion">
<?php echo $this->Field('ape_etab', $this->fields->get('ape_etab'), 'text');?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="ape_etab" />
</li>
<li class="ape_etab" style="display:none;background-image:none;height:100px;">
<div id="ape_entrep_ex" class="exclusion" style="display:none">
<?php echo $this->Field('ape_entrep_ex', $this->fields->get('ape_entrep_ex'), 'text');?>
</div>
<div id="ape_entrep_in" class="inclusion">
<?php echo $this->Field('ape_entrep', $this->fields->get('ape_entrep'), 'text');?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="ape_entrep" />
</li>
<li><?php echo $this->Field('age_etab', $this->fields->get('age_etab'));?></li>
<li><?php echo $this->Field('teff_etab', $this->fields->get('teff_etab'));?></li>
<li><?php echo $this->Field('teff_etabM', $this->fields->get('teff_etabM'));?></li>
<li><?php echo $this->Field('eff_etab', $this->fields->get('eff_etab'));?></li>
</ul>
</div>
<div id="a_economique" style="display:none">
<fieldset style="border:1px solid silver;padding:2px;">
<legend>Critères Avancés</legend>
<ul id="fieldsblock">
<li><?php echo $this->Field('age_entrep', $this->fields->get('age_entrep'));?></li>
<li><?php echo $this->Field('teff_entrep', $this->fields->get('teff_entrep'));?></li>
<li><?php echo $this->Field('teff_entrepM', $this->fields->get('teff_entrepM'));?></li>
<li><?php echo $this->Field('eff_entrep', $this->fields->get('eff_entrep'));?></li>
<li><?php echo $this->Field('nbEtab', $this->fields->get('nbEtab'));?></li>
</ul>
</fieldset>
</div>
<hr style="margin-top:5px;" />
<p>
<a class="mode" id="a_economique" style="cursor:pointer;margin-left:50%">
<img src="/themes/default/images/fleche-bas.gif" />
</a>
</p>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="economique">Réinitialiser les critères economiques</a>
</div>

View File

@ -0,0 +1,9 @@
Votre commande a bien été prise en compte sous la référence
<script>
$('#dialog').dialog({ buttons: [ {
text: "Quitter",
click: function() { $(this).dialog('close'); }
} ] });
</script>

View File

@ -0,0 +1,59 @@
<div id="enrichissement">
<div class="chemin">
<a href="<?=$this->url(array('controller'=>'dashboard', 'action'=>''))?>">Tableau de bord</a> >
Enrichissement fichier > Envoi d'un fichier
</div>
<h2>Intégration d'un fichier</h2>
<p>Taille maximale d'un fichier : <?=$this->filesize?></p>
<form enctype="multipart/form-data" name="sendfile" action="<?=$this->url(array('controller'=>'enrichissement','action'=>'fileupload'))?>" method="post">
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="key" value="<?=uniqid()?>"/>
<div class="fieldgrp">
<label>Référence</label>
<div class="field"><input type="text" name="ref" /></div>
</div>
<div class="fieldgrp">
<label>Fichier</label>
<div class="field">
<input type="file" id="fichier" name="fichier"/>
<input type="submit" value="Envoi"/>
<div id="progressbar"></div>
<div id="output"></div>
</div>
</div>
</form>
</div>
<script>
var timer;
$('form[name=sendfile]').ajaxForm({
beforeSubmit: function() {
timer = setInterval(checkProgress,200);
$('#progressbar').reportprogress(0);
$('#output').html('Envoi en cours...');
},
success: function(data) {
clearInterval(timer);
$('#progressbar').remove();
$('#output').html('<strong>' + data + '</strong>');
}
});
function checkProgress() {
$.get('<?=$this->url(array('controller'=>'enrichissement', 'action'=>'fileprogress'))?>',
{key: $('#key').val()}, function(data) {
var percent = data.current/data.total*100;
$('#progressbar').reportprogress(percent);
}, 'json');
}
</script>

View File

@ -0,0 +1,100 @@
<?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>50000) {?>
<p>Le nombre de lignes à enrichir est trop important.
Vous pouvez prendre contact avec le service commercial en cliquant ici.
Vos critères seront enregistrées et une référence vous sera fourni.</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/>
<div style="font-size:10px;padding:5px; border:1px dashed green">
Les informations permettant l'enrichissement seront enregistrées, après la saisie de votre référence.
</div>
<br />
<table id="enrichissement">
<tr>
<th>Libellé</th>
<th><?php echo date('Y-m-d');?></th>
</tr>
<tr>
<td>Nombre d'unités</td>
<td><?php echo $this->resultat;?></td>
</tr>
<tr>
<td>Nombre d'unités Insee</td>
<td><?php echo $this->uniteInsee;?></td>
</tr>
<tr>
<td>Prix du fichier</td>
<td><?php echo $this->prix;?></td>
</tr>
<tr>
<td>Redevance Insee</td>
<td><?php echo $this->prixInsee;?></td>
</tr>
<tr>
<td><b>Tapez votre référence</b></td>
<td colspan="2">
<form name="commande" method="post" action="<?=$this->url(array('controller'=>'enrichissement', 'action'=>'commande'))?>">
<input type="hidden" name="id" value="<?=$this->id?>" />
<input id="cache" type="text" value="<?php echo 'enr_'.date('Y-m-d_').uniqid();?>" name="ref">
<div id="progress"></div>
</form>
</td>
</tr>
</table>
<?php if (!empty($this->infoInsee)) {?>
<br/>
<p><?=$this->infoInsee?></p>
<?php }?>
<br/>
<script>
$('#dialog').dialog({ buttons: [ {
text: "Valider",
click: function() {
$('div#progress').html('<br /><center><img src="/themes/default/images/ajax_loader.gif" /></center>');
$('#cache').css('display', 'none');
$.post(
$('form[name=commande]').attr('action'),
$('form[name=commande]').serialize(),
function(data){
$('div#update').html(data);
});
}
},
{
text: "Quitter",
click: function() { $(this).dialog("close"); }
}
] });
</script>
</div>
<?php }?>

View File

@ -0,0 +1,45 @@
<!-- <div class="erreur" id="entreprise">
</div> -->
<div id="entreprise">
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
</span>
<hr />
<div id="s_entreprise">
<ul id="fieldsblock">
<li id="siege"><?php echo $this->Field('siege', $this->fields->get('siege'));?></li>
<li id="sirenGrp" ><?php echo $this->Field('sirenGrp', $this->fields->get('sirenGrp'));?></li>
<li id="tel" ><?php echo $this->Field('tel', $this->fields->get('tel'));?></li>
<li id="fax" ><?php echo $this->Field('fax', $this->fields->get('fax'));?></li>
<li id="web" ><?php echo $this->Field('web', $this->fields->get('web'));?></li>
<li id="mail" ><?php echo $this->Field('mail', $this->fields->get('mail'));?></li>
<li id="presentRcs" ><?php echo $this->Field('present cs', $this->fields->get('presentRcs'));?></li>
<li id="adrDom" ><?php echo $this->Field('adrDom', $this->fields->get('adrDom'));?></li>
<li id="dirNom" ><?php echo $this->Field('dirNom', $this->fields->get('dirNom'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_etab', $this->fields->get('dateCrea_etab'));?></li>
<li id="part" ><?php echo $this->Field('part', $this->fields->get('part'));?></li>
</ul>
</div>
<div id="a_entreprise" style="display:none">
<fieldset style="border:1px solid silver;padding:5px;">
<legend>Critères Avancés</legend>
<ul id="fieldsblock">
<li id="nbMPublic" ><?php echo $this->Field('nbMPubli', $this->fields->get('nbMPubli'));?></li>
<li id="li_dateCrea_etab" ><?php echo $this->Field('dateCrea_ent',$this->fields->get('dateCrea_ent'));?></li>
<li id="action" ><?php echo $this->Field('action', $this->fields->get('action'));?></li>
<li id="nbActio" ><?php echo $this->Field('nbActio', $this->fields->get('nbActio'));?></li>
<li id="nbPart" ><?php echo $this->Field('nbPart', $this->fields->get('nbPart'));?></li>
</ul>
</fieldset>
</div>
<hr style="margin-top:5px;" />
<p>
<a class="mode" id="a_entreprise" style="cursor:pointer;margin-left:50%">
<img src="/themes/default/images/fleche-bas.gif" />
</a>
</p>
</div>
<div id="link">
<a class="resetFamille" id="entreprise">Réinitialiser les critères entreprises</a>
</div>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zend Framework Default Application</title>
</head>
<body>
<h1>An error occurred</h1>
<h2><?php echo $this->message ?></h2>
<?php if (isset($this->exception)): ?>
<h3>Exception information:</h3>
<p>
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
</p>
<h3>Stack trace:</h3>
<pre><?php echo $this->exception->getTraceAsString() ?>
</pre>
<h3>Request Parameters:</h3>
<pre><?php echo var_export($this->request->getParams(), true) ?>
</pre>
<?php endif ?>
</body>
</html>

View 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>

View File

@ -0,0 +1,69 @@
<div id="financiere">
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
</span>
<hr />
<div id="s_financier">
<ul id="fieldsblock" style="width:100%;height:100%;">
<li style="background: none; height:80px;">
<div id="bilType_ex" class="exclusion" style="display:none">
<?php echo $this->Field('bilType_ex', $this->fields->get('bilType_ex'));?>
</div>
<div id="bilType_in" class="inclusion">
<?php echo $this->Field('bilType', $this->fields->get('bilType'));?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="bilType" />
</li>
<li style="background: none; height:150px;">
<div id="avisCs_ex" class="exclusion" style="display:none">
<?php echo $this->Field('avisCs_ex', $this->fields->get('avisCs_ex'));?>
</div>
<div id="avisCs_in" class="inclusion">
<?php echo $this->Field('avisCs', $this->fields->get('avisCs'));?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="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 style="background: none; height:190px;">
<div id="bilTca_ex" class="exclusion" style="display:none">
<?php echo $this->Field('bilTca_ex', $this->fields->get('bilTca_ex'));?>
</div>
<div id="bilTca_in" class="inclusion">
<?php echo $this->Field('bilTca', $this->fields->get('bilTca'));?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="bilTca" />
</li>
<li><?php echo $this->Field('bilFL', $this->fields->get('bilFL'));?></li>
</ul>
</div>
<div id="a_financiere" style="display:none">
<fieldset style="border:1px solid silver;padding:2px;">
<legend>Critères Avancés</legend>
<ul id="fieldsblock">
<li><?php echo $this->Field('bilEE', $this->fields->get('bilEE'));?></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>
</fieldset>
</div>
<hr style="margin-top:5px;" />
<p>
<a class="mode" id="a_financiere" style="cursor:pointer;margin-left:50%">
<img src="/themes/default/images/fleche-bas.gif" />
</a>
</p>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="financier">Réinitialiser les critères financiers</a>
</div>

View File

@ -0,0 +1,42 @@
<div id="geographique">
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
</span>
<hr />
<ul id="fieldsblock">
<li><?php echo $this->Field('adr_com', $this->fields->get('adr_com'));?></li>
<li class="adr_com" style="display:none;background-image:none;height:100px;">
<div id="adr_com_ex" class="exclusion" style="display:none">
<?php echo $this->Field('adr_com_ex', $this->fields->get('adr_com_ex'), 'text');?>
</div>
<div id="adr_com_in" class="inclusion">
<?php echo $this->Field('adr_com', $this->fields->get('adr_com'), 'text');?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="adr_com" />
</li>
<li class="adr_com" style="display:none;background-image:none;height:150px;">
<div id="adr_dept_ex" class="exclusion" style="display:none">
<?php echo $this->Field('adr_dept_ex', $this->fields->get('adr_dept_ex'), 'text');?>
</div>
<div id="adr_dept_in" class="inclusion">
<?php echo $this->Field('adr_dept', $this->fields->get('adr_dept'), 'text');?>
</div><br />
Recherche régions : <input type="text" name="" id="textarea_adr_reg" /><br />
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="adr_dept" />
</li>
<li style="height:50px;background-image:none">
Exclure DOM-TOM <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_domtom" /><br />
Exclure Etranger <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_entr" /><br />
Exclure Corse <input style="float:right" value="1" type="checkbox" class="ex_prede" name="ex_corse" /><br />
</li>
<li><?php echo $this->Field('zus', $this->fields->get('zus'), 'select');?></li>
<li><?php echo $this->Field('zru', $this->fields->get('zru'), 'select');?></li>
<li><?php echo $this->Field('zfu', $this->fields->get('zfu'), 'select');?></li>
<li><?php echo $this->Field('cucs', $this->fields->get('cucs'), 'select');?></li>
<li><?php echo $this->Field('zrr', $this->fields->get('zrr'), 'select');?></li>
<li><?php echo $this->Field('zafr', $this->fields->get('zafr'), 'select');?></li>
</ul>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="econmique">Réinitialiser les critères geographiques</a>
</div>

View File

@ -0,0 +1,30 @@
<div id="dashboard">
<h2>Liste des comptages</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>
<td><?php echo $comptage['id']; ?></td>
<td><?php echo $comptage['dateAjout']; ?></td>
<td></td>
<td><?php echo $comptage['resultat']; ?></td>
<td><?php echo $comptage['uniteInsee']; ?></td>
<td>
<a href="">Actualiser</a>
<a class="enrichissementref" href="<?=$this->url(array('controller'=> 'enrichissement','action'=>'reference', 'id'=>$comptage['idDefinition']))?>">Enrichissement</a>
<a href="<?=$this->url(array('controller'=> 'gestion','action'=>'extract', 'id'=>$comptage['idDefinition']))?>">Extraire les sirets</a>
<a href="">Supprimer</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>

View File

@ -0,0 +1,31 @@
<div id="dashboard">
<h2>Liste des comptages</h2>
<div>
<table>
<tr>
<th><b>Id comptage</b></th>
<th><b>Reference</b></th>
<th><b>NB Ligne Totales</b></th>
<th><b>NB Ligne Traites</b></th>
<th><b>Unitee INSEE</b></th>
<th><b>Date création</b></th>
<th><b>Date début</b></th>
<th><b>Date d'arret</b></th>
<th><b>Fichier</b></th>
</tr>
<?php foreach($this->enrichissements as $enrichissement): ?>
<tr>
<td><?php echo $enrichissement['idComptage']; ?></td>
<td><?php echo $enrichissement['reference']; ?></td>
<td><?php echo $enrichissement['nbLigneTotales']; ?></td>
<td><?php echo $enrichissement['nbLigneTraites']; ?></td>
<td><?php echo $enrichissement['uniteInsee']; ?></td>
<td><?php echo $enrichissement['dateAdded']; ?></td>
<td><?php echo $enrichissement['dateStart']; ?></td>
<td><?php echo $enrichissement['dateStop']; ?></td>
<td><a href="/enrichissement/download/id/<?php echo $enrichissement['id'];?>"><?php echo $enrichissement['fichier']; ?></a></td>
</tr>
<?php endforeach; ?>
</table>
</div>
</div>

View File

@ -0,0 +1,12 @@
<div id="dashboard">
<h2>Gestion des profils</h2>
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profils'))?>">Lister les profils</a><br/>
<a href="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">Créer un profil d'enrichissement pour un client (idClient, login)</a>
<h2>Gestion des commandes</h2>
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'comptages'));?>">Liste des comptages</a><br />
<a href="<?php echo $this->url(array('controller' => 'gestion', 'action' => 'enrichissements'));?>">Liste des enrichissements</a>
<h2>Facturation</h2>
</div>

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,37 @@
<div id="dashboard">
<?=$this->message?>
<form name="profil" method="post" action="<?=$this->url(array('controller'=>'gestion', 'action'=>'profiladd'))?>">
<label>idClient</label>
<input type="text" name="idClient" />
<br/>
<label>login</label>
<input type="text" name="login" />
<br/>
<label>Reference</label>
<input type="text" name="reference" />
<br/>
<label>tarifLigne</label>
<input type="text" name="tarifLigne" />
<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>
</div>
</div>

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,33 @@
<div id="dashboard">
<h2>Liste des profils</h2>
<table>
<thead>
<tr>
<th>idClient</th>
<th>login</th>
<th>reference</th>
<th>tarifLigne</th>
<th>dateAjout</th>
<th>dateSuppr</th>
<th>actif</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ( $this->profils as $profil ) {?>
<tr>
<td><?=$profil['idClient']?></td>
<td><?=$profil['login']?></td>
<td><?=$profil['reference']?></td>
<td><?=$profil['tarifLigne']?></td>
<td><?=$profil['dateAjout']?></td>
<td><?=$profil['dateSuppr']?></td>
<td><?=$profil['actif']?></td>
<td></td>
</tr>
<?php }?>
</tbody>
</table>
</div>

View File

@ -0,0 +1 @@
<?php

View File

@ -0,0 +1,70 @@
<style>
.color {
background-color:#DEDEDE;
}
a
{
text-decoration: none;
}
#criteres_ra
{
width:93%;
font-size: 11px;
}
#criteres_ra tr td {
border-left: 1px solid black;
border-right: 1px solid black;
padding-left:5px;
}
</style>
<table id="criteres_ra" style="margin:10px">
<tr>
<td class="Valide" style="text-align: center" colspan="3">
<a class="previsualisation" href="/comptage/previsualisation">Prévisualisation</a>
</td>
</tr>
<?php $color = 0;foreach($this->criteres as $critere => $valeur):?>
<?php $label = $this->field->get($critere); ?>
<?php if($valeur != 'tous' and $valeur != null and $valeur != 'null' and $valeur != ',' and !empty($valeur)):?>
<?php if(!is_array($valeur)) {$valeur = explode(',', $valeur);} ?>
<tr <?php echo ((($color%2) == 0)?'class="color"':''); $color++;?>>
<td valign="top" style="padding:5px;width:150px">
<?php echo $label['label'];?>
</td>
<td>
<?php if(is_array($valeur)):?>
<?php $i=0; foreach ($valeur as $val):?>
<?php if($i>5)break; ?>
<?php if($label['type'] != 'textarea' and $label['type'] != 'interval' and $label['type'] != 'intervalSelect') :?>
<?php echo $label['fields'][$label['type']]['value'][$val];?> <?php (($i%3 == 0)?'<br />':''); $i++;?>
<?php else :?>
<?php
if($label['type'] == 'interval') {
if(empty($val)) {
echo '-';
} else
echo $val;
} else
echo $val.', ';
?>
<?php $i++; endif;?>
<?php endforeach;?>
<?php else: ?>
<?php echo $val;?>
<?php endif; ?>
</td>
<td style="text-align: center">
<a class="remove" href="index/remove/critere/<?php echo $critere;?>">
<img width="14px;" src="/themes/default/images/cross.png" />
</a>
<img src="/themes/default/images/help.png" />
</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<tr>
<td class="Valide" style="text-align: center" colspan="3">
<a class="saveciblage" href="/comptage/savedialog">Valider mon comptage</a></td>
</tr>
</table>

View File

@ -0,0 +1,28 @@
<div id="panel">
<?php echo $this->action('criteres', 'index');?>
<div id="helper"></div>
</div>
<div id="tabs">
<ul>
<li class="overHelp" div="_entreprise"><a href="#tabs-1">Critères Entreprise</a></li>
<li class="overHelp" div="_economique"><a href="#tabs-2">Situation économique</a></li>
<li class="overHelp" div="_geographique"><a href="#tabs-3">Secteur géographique</a></li>
<li class="overHelp" div="_juridique"><a href="#tabs-4">Situation juridique</a></li>
<li class="overHelp" div="_financiere"><a href="#tabs-5">Situation financière</a></li>
</ul>
<div id="tabs-1">
<?php echo $this->action('index', 'entreprise')?>
</div>
<div id="tabs-2">
<?php echo $this->action('index', 'economique')?>
</div>
<div id="tabs-3">
<?php echo $this->action('index', 'geographique')?>
</div>
<div id="tabs-4">
<?php echo $this->action('index', 'juridique')?>
</div>
<div id="tabs-5">
<?php echo $this->action('index', 'financier')?>
</div>
</div>

View File

@ -0,0 +1,40 @@
<div id="juridique">
<span style="color:red;text-align:right;padding:5px;margin-top:-5px;">
*<sup>Il n'est pas nécessaire de remplire tous les champs.</sup>
</span>
<hr />
<div id="s_juridique">
<ul id="fieldsblock">
<li><?php echo $this->Field('cj', $this->fields->get('cj'));?></li>
<li class="cj" style="display:none;background-image:none;height:100px;">
<div id="cj_text_ex" class="exclusion" style="display:none">
<?php echo $this->Field('cj_ex', $this->fields->get('cj_ex'), 'text');?>
</div>
<div id="cj_text_in" class="inclusion">
<?php echo $this->Field('cj', $this->fields->get('cj'), 'text');?>
</div>
Valeurs exclusions : <input value="1" type="checkbox" class="checkbox_ex" name="cj_text" />
</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('dateImmat', $this->fields->get('dateImmat'));?></li>
</ul>
</div>
<div id="a_juridique" style="display:none">
<fieldset style="border:1px solid silver;padding:2px;">
<legend>Critères Avancés</legend>
<ul id="fieldsblock">
<li><?php echo $this->Field('tvaIntraValide', $this->fields->get('tvaIntraValide'));?></li>
</ul>
</fieldset>
</div>
<hr style="margin-top:5px;" />
<p>
<a class="mode" id="a_juridique" style="cursor:pointer;margin-left:50%">
<img src="/themes/default/images/fleche-bas.gif" />
</a>
</p>
</div>
<div style="text-align:right;margin-top:20px;">
<a class="resetFamille" id="econmique">Réinitialiser les critères juridique</a>
</div>

View File

@ -0,0 +1,4 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>Login</b> and script/action name <b>index</b></p>
</div>

View File

@ -0,0 +1,4 @@
<br /><br />
<div id="view-content">
<p>View script for controller <b>User</b> and script/action name <b>index</b></p>
</div>

View File

@ -0,0 +1,13 @@
<?=$this->doctype();?>
<html>
<head>
<?=$this->headMeta();?>
<?=$this->headTitle();?>
<link rel="shortcut icon" type="image/x-icon" href="<?='http://'.$_SERVER['SERVER_NAME']?>/favicon.ico" />
</head>
<body>
<h2>CONNEXION ODEA</h2>
<?=$this->message?>
<?=$this->form?>
</body>
</html>

View File

@ -0,0 +1,16 @@
<?=$this->doctype();?>
<html>
<head>
<?=$this->headMeta();?>
<?=$this->headTitle();?>
</head>
<body>
<h4 class="logout">Vous avez été déconnecté.</h4>
<p><?=$this->message?></p>
<h5 class="logout">
Si cette page ne disparait pas au bout de <?=$this->refresh?> seconde(s),
veuillez cliquer <a href="<?=$this->url?>">ici</a>
</h5>
</body>
</html>

70
batch/cron.php Normal file
View File

@ -0,0 +1,70 @@
#!/usr/bin/php
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
define('APPLICATION_ENV', 'production');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(isset($opts->help))
{
echo $opts->getUsageMessage();
exit;
}
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
$db = Zend_Db::factory($dbConfig->db);
$commandesM = new Table_EnrichissementCommandes($db);
$sql = $commandesM->select()
->where('idProfil != ?', 0)
->where("dateStart != '0000-00-00 00:00:00'")
->where("dateStop = '0000-00-00 00:00:00'");
$result = $commandesM->fetchAll($sql);
if (count($result)>0){
exit;
}
//Si pas de traitement en cours alors on lance
$sql = $commandesM->select()
->where('idProfil != ?', 0)
->where("dateStart = '0000-00-00 00:00:00'")
->where("dateStop = '0000-00-00 00:00:00'")
->order('dateAdded ASC')->limit(1);
$result = $commandesM->fetchAll($sql);
if (count($result)>0) {
$info = $result->current();
echo "Lancement enrichissement $info->id\n";
exec(realpath(dirname(__FILE__))."/enrichissement.php --id ".$info->id." &");
}

248
batch/enrichissement.php Normal file
View File

@ -0,0 +1,248 @@
#!/usr/bin/php
<?php
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
define('APPLICATION_ENV', 'production');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
'id=s' => "Identifiant du traitement",
'file=s' => "Identifiant pour les traitements par fichier"
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(isset($opts->help) || !isset($opts->id) && !isset($opts->file) )
{
echo $opts->getUsageMessage();
exit;
}
//Définition bdd
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$db = Zend_Db::factory($dbConfig->db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
//Définition bdd metier
try {
$dbMetier = Zend_Db::factory($dbConfig->jo);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
$liste = array();
if ($opts->id)
{
$sql = $db->select()
->from('enrichissement_identifiants')
->where('id = ?', intval($opts->id));
$commande = $db->fetchRow($sql);
$identifiants = json_decode($commande['identifiants'], true);
$sql = $db->select()
->from('enrichissement_profils')
->where('id = ?', $commande['idProfil']);
$profil = $db->fetchRow($sql);
$dataProfil = json_decode($profil['criteres'], true);
} else if ($opts->file)
{
}
if ( count($identifiants)>0 && count($dataProfil)>0 )
{
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini');
$mois = date('Y-m');
if(!file_exists($config->path->data.'/'.$mois))
mkdir($config->path->data.'/'.$mois);
$path = $config->path->data.'/'.$mois;
$outFile = $opts->id.'_'.$profil['login'].'_'.date('YmdHis').'.csv';
require_once 'Scores/Enrichissement.php';
$dico = new Enrichissement();
$fields = $dico->getFields();
//Entete, Valeur de remplacement et Requete SQL
$tabEntete = array('siren', 'nic');
$tabEnteteLabel = array('SIREN', 'NIC');
$sql = 'SELECT LPAD(siren, 9, 000000000) AS siren, LPAD(nic,5,00000) AS nic,';
foreach ( $dataProfil as $item ) {
//Définition de l'entete
$tabEnteteLabel[] = $fields[$item]['label'];
$tabEntete[] = $item;
//Construction de la requete SQL
if ( array_key_exists('sql', $fields[$item]) ) {
$sql.= ' '.$fields[$item]['sql'].', ';
} else {
$sql.= ' '.$fields[$item]['column'].' AS '.$item.',';
}
}
//Ajouter le champ presentRcs
$tabEntete[] = 'presentRcs';
$tabEnteteLabel[] = 'RCS';
$sql .= ' presentRcs';
//Pour chaque identifiant traiter les données
$row = 0;
$fp = fopen($path.'/'.$outFile, 'w');
//Ecrire l'entete
if (count($tabEnteteLabel)>0){
fputcsv($fp, $tabEnteteLabel, ',', '"');
}
$model = $sql;
$traite = 0;
//Date de debut de traitement.
$dateStart = date('YmdHms');
foreach ($identifiants as $siret )
{
$sql = $model.' FROM etablissements_act WHERE siren='.substr($siret,0,9).' AND nic='.substr($siret,9,5);
try {
$result = $dbMetier->fetchAll($sql);
$traite++;
} catch(Exception $e) {
echo $sql;
}
$tabData = $result[0];
//Trier pour la sortie
$tabSortie = array();
foreach($tabEntete as $key){
$tabSortie[] = isset($tabData[$key]) ? $tabData[$key] : '';
}
fputcsv($fp, $tabSortie, ',', '"');
$row++;
}
//Gestion de l'erreur
$error = 0;
if($traite < $commande['nbLigneTotales'])
$error = 1;
//date de fin de traitement.
$dateStop = date('YmdHms');
//Update de la ligne dans la base de donnée.
$datas = array(
'nbLigneTraites' => $traite,
'dateStart' => $dateStart,
'dateStop' => $dateStop,
'error' => $error,
'fichier' => $outFile
);
$db->update('enrichissement_identifiants', $datas, 'id = '.$opts->id);
fclose($fp);
}
/* == FUNCTION == */
/**
* Verifie si un SIREN est valide
* @param Le code SIREN dont on veut vérifier la validité.
* @return Un booléen qui vaut 'true' si le code SIREN passé en
* paramètre est valide, false sinon.
*/
function sirenValide($siren) {
if ( (strlen($siren) != 9) || (is_nan($siren)) )
$estValide = false;
else {
// Donc le SIREN est un numérique à 9 chiffres
$somme = 0;
$tmp = 0;
for ($cpt = 0; $cpt<strlen($siren); $cpt++) {
if (($cpt % 2) == 1) { // Les positions paires : 2ème, 4ème, 6ème et 8ème chiffre
$tmp = substr($siren, $cpt, 1) * 2; // On le multiplie par 2
if ($tmp > 9)
$tmp-= 9; // Si le résultat est supérieur à 9, on lui soustrait 9
}
else
$tmp = substr($siren, $cpt, 1);
$somme+= intval($tmp);
}
if (($somme % 10) == 0)
$estValide = true; // Si la somme est un multiple de 10 alors le SIREN est valide
else
$estValide = false;
}
return $estValide;
}
/**
* Verifie si un SIRET est valide
* @param Le code SIRET dont on veut vérifier la validité.
* @return Un booléen qui vaut 'true' si le code SIRET passé en
* paramètre est valide, false sinon.
*/
function siretValide($siret) {
if ( (strlen($siret) != 14) || (is_nan($siret)) )
$estValide = false;
else {
// Donc le SIRET est un numérique à 14 chiffres
// Les 9 premiers chiffres sont ceux du SIREN (ou RCS), les 4 suivants
// correspondent au numéro d'établissement
// et enfin le dernier chiffre est une clef de LUHN.
$somme = 0;
$tmp = 0;
for ($cpt = 0; $cpt<strlen($siret); $cpt++) {
if (($cpt % 2) == 0) { // Les positions impaires : 1er, 3è, 5è, etc...
$tmp = substr($siret, $cpt, 1) * 2; // On le multiplie par 2
if ($tmp > 9)
$tmp-= 9; // Si le résultat est supérieur à 9, on lui soustrait 9
}
else
$tmp = substr($siret, $cpt, 1);
$somme+= intval($tmp);
}
if (($somme % 10) == 0)
$estValide = true; // Si la somme est un multiple de 10 alors le SIRET est valide
else
$estValide = false;
}
return $estValide;
}
/**
* writeCSV
* @param array $list
* @param array $entete
* @param string $filename
*/
function writeCSV($list, $entete, $filename)
{
$fp = fopen($filename, 'w');
if (count($entete)>0){
fputcsv($fp, $entete, ',', '"');
}
foreach ($list as $fields) {
fputcsv($fp, $fields, ',', '"');
}
fclose($fp);
}

230
batch/extract.php Normal file
View File

@ -0,0 +1,230 @@
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
define('APPLICATION_ENV', 'production');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
require_once APPLICATION_PATH . '/../library/Zend/Loader/Autoloader.php';
Class extract
{
protected $db;
protected $dbMetier;
protected $reference;
public function __construct($reference)
{
$this->reference = $reference;
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$this->db = Zend_Db::factory($dbConfig->db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
}
public function getHttp()
{
/* Depuis le navigateur */
}
protected function getCj($liste)
{
foreach($liste as $valeur)
{
if(strlen($valeur) < 5) {
$sql = $this->db->select('formejuridique', array('fjCode'))
->from('formejuridique')
->where('fjCode LIKE "'.$valeur.'%"');
} else {
$sql = $this->db->select('formejuridique', array('fjCode'))
->from('formejuridique')
->where('fjCode = "'.$valeur.'"');
}
$result = $this->db->fetchAll($sql);
foreach ($result as $code) {
if(strlen($code['fjCode']) > 2) {
$return[] = $code['fjCode'];
}
}
}
return ($return);
}
protected function localisationArbo($name, $valeur)
{
if(strlen($valeur) == 2) {
switch($name) {
case 'adr_reg':
$return = array();
$sql = $this->db->select()
->from('departements')
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
->where('codeRegionInsee ='.$valeur);
$result = $this->db->fetchAll($sql);
foreach ($result as $res) {
$return[] = trim($res['INSEE']);
}
break;
case 'adr_dept':
$return = array();
$sql = $this->db->select()
->from('departements')
->join(array('cp' => 'codepostaux'), 'cp.codepos LIKE CONCAT(departements.numdep, "%")', array('INSEE'))
->where('numdep ='.$valeur);
$result = $this->db->fetchAll($sql);
foreach ($result as $res) {
$return[] = trim($res['INSEE']);
}
break;
}
}
return ($return);
}
public function getMinMax($name, $valeur)
{
$valeur = explode(',', $valeur);
if(count($valeur) > 1)
{
$sql = 'SELECT min, max FROM minmax WHERE cle ="'.$name.'"';
$result = $this->db->query($sql);
$result = $result->fetchAll();
if(empty($valeur[0])){
echo $name;
$valeur[0] = $result[0]['min'];
}
if(empty($valeur[1])){
$valeur[1] = $result[0]['max'];
}
}
return ($valeur);
}
protected function nafArbo($key, $valeur)
{
$value = array();
//$table = new Table_Nafs();
$valeur = trim($valeur);
if(strlen($valeur) == 1)
{
//$sql = $table->select()->where('parent = ?', $valeur);
$sql = 'SELECT * FROM naf WHERE parent ='.$valeur;
$result =$this->db->query($sql);
$result = $result->fetchAll();
foreach($result as $code) $where .= " code LIKE '".trim($code['code'])."%' and niveau = 5 or ";
$where = substr($where, 0, (strlen($where)) - 3);
$sql = 'SELECT * FROM naf '.$where;
$result = $this->db->query($sql);
$result = $result->fetchAll();
foreach($result as $code) $value[] = $code['code'];
} else if(strlen($valeur) < 5){
//$sql = $table->select()->where('code LIKE "'.trim($valeur).'%" and niveau = 5');
$sql = 'SELECT * FROM naf WHERE code LIKE "'.trim($valeur).'%" and niveau = 5';
$result = $this->db->query($sql);
$result = $result->fetchAll();
foreach($result as $code) $value[] = $code['code'];
} else if(strlen($valeur) == 5) {
$value[] = $valeur;
}
return ($value);
}
public function getCli()
{
require_once('Scores/Ciblage.php');
//require_once('Scores/Field.php');
$sql = 'SELECT id, idDefinition, uniteInsee FROM comptages WHERE id = '.$this->reference;
$fetch = $this->db->query($sql);
$result = $fetch->fetchAll();
$idComptage = $result[0]['id'];
$uniteInsee = $result[0]['uniteInsee'];
$sql = 'SELECT id, criteres.criteres FROM criteres WHERE id ='.$result[0]['idDefinition'];
$fetch = $this->db->query($sql);
$result = $fetch->fetchAll();
$idCriteres = $result[0]['id'];
$structure = json_decode($result[0]['criteres']);
$element = array();
foreach ($structure as $name => $valeur){
if($name == 'adr_com') {
$liste = explode(',', $valeur);
$codes = array();
foreach ($liste as $element) {
$val = explode(':', $element);
if(!empty($val[1]))
$codes = array_merge($this->localisationArbo($val[0], $val[1]), $codes);
}
$array['adr_com'] = $codes;
}
else if($name == 'cj') {
$array['cj'] = $this->getCj(explode(',', $valeur));
}
else if($name == 'ape_etab') {
$values = array();
$nafs = explode(',', $structure->ape_etab);
foreach($nafs as $naf) {
if($naf != ' ') {
$values = array_merge($values, $this->nafArbo('ape_etab', $naf));
}
}
$array['ape_etab'] = $values;
}else {
$valeur = $this->getMinMax($name, $valeur);
$array[$name] = $valeur;
}
}
unset($array['vil']);
unset($array['adr_com']);
unset($array['adr_dept']);
$array['bilTca'] = array(4, 5, 6);
$ciblage = new Ciblage($array, true);
$res = $ciblage->execute(true);
$data = array(
'idComptage' => $idComptage,
'idCriteres' => $idCriteres,
'idProfil' => 1,
'reference' => 'batch',
'identifiants' => json_encode($res),
'nbLigneTotales' => count($res),
'nbLigneTraites' => count($res),
'uniteInsee' => $uniteInsee,
'error' => 0
);
$this->db->insert('enrichissement_identifiants',$data);
$fd = fopen($idComptage.'_batch'.date('Y-m-d-hms').'.csv', 'x+');
try {
$array = array();
foreach($res as $field) {
fputcsv($fd, array($field), ';');
}
} catch(Exception $e) {
echo $e->getMessage();
}
fclose($fd);
echo count($res).' Success !';
}
}
$a = new extract('38');
$a->getCli();

88
batch/setMinMax.php Normal file
View File

@ -0,0 +1,88 @@
#!/usr/bin/php
<?php
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
// Define application environment
define('APPLICATION_ENV', 'production');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
try {
$opts = new Zend_Console_Getopt(
//Options
array(
'help|?' => "Aide.",
'cron' => "Mode automatique",
'manuel' => "Mode manuel",
)
);
$opts->parse();
} catch (Zend_Console_Getopt_Exception $e) {
echo $e->getUsageMessage();
exit;
}
//Usage
if(isset($opts->help))
{
echo $opts->getUsageMessage();
exit;
}
$dbConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'databases');
try {
$db = Zend_Db::factory($dbConfig->db);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
//Définition bdd metier
try {
$dbMetier = Zend_Db::factory($dbConfig->jo);
} catch ( Exception $e ) {
exit ( $e->getMessage() );
}
$keys = array(
'nbActio','nbPart', 'teff_entrep', 'teff_etab', 'nbEtab',
'eff_entrep', 'eff_etab', 'capital', 'bilEE', 'bilFL', 'bilFK', 'bilFR', 'bilGF',
'bilGP', 'bilGW', 'bilHD', 'bilHH', 'bilHL', 'bilHM', 'bilHN', 'bilYP', 'dateCrea_etab', 'dateCrea_ent',
'dateImmat'
);
$sql = 'TRUNCATE TABLE minmax';
if ( !$db->query($sql) ) {
die ('Impossible de vider la table minmax');
}
foreach($keys as $key) {
//Lecture
$sql = 'SELECT MIN('.$key.') AS min, MAX('.$key.') AS max FROM etablissements_act';
$stmt = $dbMetier->query($sql);
$result = $stmt->fetchObject();
//Insertion
$data = array(
'cle' => $key,
'min' => $result->min,
'max' => $result->max,
);
$db->insert('minmax', $data);
if ($opts->manuel) echo $key.' -> min:'.$result->min.' max:'.$result->max."\n";
}
if ($opts->manuel) print('Terminé');

View File

@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS `enrichissement_fichiers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idProfil` int(11) NOT NULL,
`reference` varchar(50) NOT NULL,
`identifiants` longtext NOT NULL,
`nbLigneTotales` int(11) NOT NULL,
`nbLigneTraites` int(11) NOT NULL,
`uniteInsee` int(11) NOT NULL DEFAULT '0',
`error` varchar(100) NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStop` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`fichierIn` varchar(100) NOT NULL,
`fichierOut` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,17 @@
CREATE TABLE IF NOT EXISTS `enrichissement_identifiants` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idComptage` int(11) NOT NULL,
`idCriteres` int(11) NOT NULL DEFAULT '0',
`idProfil` int(11) NOT NULL,
`reference` varchar(50) NOT NULL,
`identifiants` longtext NOT NULL,
`nbLigneTotales` int(11) NOT NULL,
`nbLigneTraites` int(11) NOT NULL,
`uniteInsee` int(11) NOT NULL DEFAULT '0',
`error` varchar(100) NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateStop` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`fichier` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS `enrichissement_profils` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idClient` int(11) NOT NULL,
`login` VARCHAR( 50 ) NOT NULL,
`reference` varchar(50) NOT NULL,
`criteres` text NOT NULL,
`tarifLigne` float NOT NULL,
`dataInsee` tinyint(4) NOT NULL,
`dateAjout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`dateSuppr` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`actif` tinyint(4) NOT NULL,
PRIMARY KEY (`id`),
KEY `idClient` (`idClient`)
) DEFAULT CHARSET=utf8 COMMENT='Profil d''extraction';

Some files were not shown because too many files have changed in this diff Show More