From 1975587df38180af3b11ac0f7499624e8b089268 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 22 May 2016 15:20:49 +0200 Subject: [PATCH] #14; Prototype du graphique du sexe (homme/femme) pour chaque communication --- automate.php | 2 +- config/modules.json | 8 + doc/phone_log.json | 149 ++++++++++--------- manager/module/chart.php | 72 ++++++++- src/dynamic/phone/dictionary.json | 236 +++++++++++++++--------------- test-charts/all.php | 137 +++++++++++++++++ test-charts/sexe.php | 57 ++++++++ 7 files changed, 464 insertions(+), 197 deletions(-) create mode 100644 test-charts/all.php create mode 100644 test-charts/sexe.php diff --git a/automate.php b/automate.php index 16b6e97..d506505 100755 --- a/automate.php +++ b/automate.php @@ -94,7 +94,7 @@ $db = new lightdb('phone_db', __ROOT__.'/src/dynamic/'); var_dump( array_keys($db->index())); $db->close(); - $req = new ModuleRequest('chart/communication_type', array( 'subject' => 273 )); + $req = new ModuleRequest('chart/sexe', array( 'subject' => 273 )); $res = $req->dispatch(); diff --git a/config/modules.json b/config/modules.json index 0c9e22d..edbc85a 100755 --- a/config/modules.json +++ b/config/modules.json @@ -120,6 +120,14 @@ "parameters": { "subject": { "description": "Identifiant du sujet à étudier,", "type": "id" } } + }, + + "sexe": { + "description": "Renvoie les données pour un graphique sur le sexe des contacts", + "permissions": ["admin"], + "parameters": { + "subject": { "description": "Identifiant du sujet à étudier,", "type": "id" } + } } }, diff --git a/doc/phone_log.json b/doc/phone_log.json index 990c742..86313a3 100644 --- a/doc/phone_log.json +++ b/doc/phone_log.json @@ -1,83 +1,82 @@ { - "logs": [ - { "id":"1", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"2", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"3", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"4", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"5", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"6", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"7", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"8", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"9", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"10", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"11", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, - { "id":"12", "date":"2014-02-28T15:00:10", "duration":"125", "direction":"1", "type":"1" }, - { "id":"13", "date":"2014-02-15T23:06:46", "duration":"0", "direction":"0", "type":"1" }, - { "id":"14", "date":"2014-02-15T23:06:18", "duration":"0", "direction":"0", "type":"1" }, - { "id":"15", "date":"2014-02-15T21:08:34", "duration":"349", "direction":"1", "type":"1" }, - { "id":"16", "date":"2014-02-15T20:51:38", "duration":"0", "direction":"1", "type":"1" }, - { "id":"17", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, - { "id":"18", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"2", "type":"1" }, - { "id":"19", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, - { "id":"20", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, - { "id":"21", "date":"2014-02-15T17:24:18", "duration":"276", "direction":"1", "type":"1" }, - { "id":"22", "date":"2014-02-15T16:34:29", "duration":"36", "direction":"1", "type":"1" } - ], + "logs": [ + { "id":"1", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"2", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"3", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"4", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"5", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"6", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"7", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"8", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"9", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"10", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"11", "date":"2014-05-28T14:43:25", "duration":"0", "direction":"0", "type":"0" }, + { "id":"12", "date":"2014-02-28T15:00:10", "duration":"125", "direction":"1", "type":"1" }, + { "id":"13", "date":"2014-02-15T23:06:46", "duration":"0", "direction":"0", "type":"1" }, + { "id":"14", "date":"2014-02-15T23:06:18", "duration":"0", "direction":"0", "type":"1" }, + { "id":"15", "date":"2014-02-15T21:08:34", "duration":"349", "direction":"1", "type":"1" }, + { "id":"16", "date":"2014-02-15T20:51:38", "duration":"0", "direction":"1", "type":"1" }, + { "id":"17", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, + { "id":"18", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"2", "type":"1" }, + { "id":"19", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, + { "id":"20", "date":"2014-02-15T19:06:33", "duration":"657", "direction":"1", "type":"1" }, + { "id":"21", "date":"2014-02-15T17:24:18", "duration":"276", "direction":"1", "type":"1" }, + { "id":"22", "date":"2014-02-15T16:34:29", "duration":"36", "direction":"1", "type":"1" } + ], - "contacts": [ - { "id":"0", "number":"0102030405", "name":"", "sexe":"0", "age":"1", "studies1":"1", "reltype":"1", "dist":"0" }, - { "id":"1", "number":"0502030405", "name":"", "sexe":"0", "age":"1", "studies1":"1", "reltype":"1", "dist":"0" }, - { "id":"2", "number":"0502030561", "name":"", "sexe":"0", "age":"2", "studies1":"2", "reltype":"2", "dist":"1" }, - { "id":"3", "number":"0502030717", "name":"", "sexe":"0", "age":"3", "studies1":"3", "reltype":"3", "dist":"2" }, - { "id":"4", "number":"0502030873", "name":"", "sexe":"0", "age":"4", "studies1":"4", "reltype":"4", "dist":"3" }, - { "id":"5", "number":"0502031029", "name":"", "sexe":"0", "age":"5", "studies1":"5", "reltype":"5", "dist":"4" }, - { "id":"6", "number":"0502031185", "name":"", "sexe":"0", "age":"6", "studies1":"6", "reltype":"6", "dist":"5" }, - { "id":"7", "number":"0502031341", "name":"", "sexe":"0", "age":"7", "studies1":"7", "reltype":"7", "dist":"6" }, - { "id":"8", "number":"0502031497", "name":"", "sexe":"0", "age":"8", "studies1":"8", "reltype":"8", "dist":"7" }, - { "id":"9", "number":"0502031653", "name":"", "sexe":"0", "age":"9", "studies1":"9", "reltype":"9", "dist":"8" }, - { "id":"10", "number":"0502031809", "name":"", "sexe":"0", "age":"10", "studies1":"10", "reltype":"autretext", "dist":"9" }, - { "id":"11", "number":"0502031965", "name":"", "sexe":"0", "age":"11", "studies1":"11", "reltype":"11", "dist":"10" }, - { "id":"12", "number":"0502032121", "name":"", "sexe":"1", "age":"12", "studies1":"12", "reltype":"12", "dist":"11" }, - { "id":"13", "number":"0502032277", "name":"", "sexe":"1", "age":"13", "studies1":"13", "reltype":"13", "dist":"12" }, - { "id":"14", "number":"0502032433", "name":"", "sexe":"1", "age":"14", "studies1":"14", "reltype":"14", "dist":"13" }, - { "id":"15", "number":"0502032589", "name":"", "sexe":"1", "age":"15", "studies1":"15", "reltype":"15", "dist":"14" }, - { "id":"16", "number":"0502032745", "name":"", "sexe":"1", "age":"16", "studies1":"16", "reltype":"16", "dist":"15" }, - { "id":"17", "number":"0502032901", "name":"", "sexe":"1", "age":"17", "studies1":"17", "reltype":"17", "dist":"16" }, - { "id":"18", "number":"0502033057", "name":"", "sexe":"1", "age":"18", "studies1":"18", "reltype":"18", "dist":"17" }, - { "id":"19", "number":"0502033213", "name":"", "sexe":"1", "age":"19", "studies1":"19", "reltype":"19", "dist":"18" }, - { "id":"20", "number":"0502033369", "name":"", "sexe":"1", "age":"20", "studies1":"20", "reltype":"20", "dist":"19" }, - { "id":"21", "number":"0502033525", "name":"", "sexe":"1", "age":"21", "studies1":"21", "reltype":"21", "dist":"20" }, - { "id":"22", "number":"0502033681", "name":"", "sexe":"1", "age":"22", "studies1":"22", "reltype":"22", "dist":"21" }, + "contacts": [ + { "id":"1", "number":"0502030405", "name":"", "sexe":"0", "age":"1", "studies1":"1", "reltype":"1", "dist":"0" }, + { "id":"2", "number":"0502030561", "name":"", "sexe":"0", "age":"2", "studies1":"2", "reltype":"2", "dist":"1" }, + { "id":"3", "number":"0502030717", "name":"", "sexe":"0", "age":"3", "studies1":"3", "reltype":"3", "dist":"2" }, + { "id":"4", "number":"0502030873", "name":"", "sexe":"0", "age":"4", "studies1":"4", "reltype":"4", "dist":"3" }, + { "id":"5", "number":"0502031029", "name":"", "sexe":"0", "age":"5", "studies1":"5", "reltype":"5", "dist":"4" }, + { "id":"6", "number":"0502031185", "name":"", "sexe":"0", "age":"6", "studies1":"6", "reltype":"6", "dist":"5" }, + { "id":"7", "number":"0502031341", "name":"", "sexe":"0", "age":"7", "studies1":"7", "reltype":"7", "dist":"6" }, + { "id":"8", "number":"0502031497", "name":"", "sexe":"0", "age":"8", "studies1":"8", "reltype":"8", "dist":"7" }, + { "id":"9", "number":"0502031653", "name":"", "sexe":"0", "age":"9", "studies1":"9", "reltype":"9", "dist":"8" }, + { "id":"10", "number":"0502031809", "name":"", "sexe":"0", "age":"10", "studies1":"10", "reltype":"autretext", "dist":"9" }, + { "id":"11", "number":"0502031965", "name":"", "sexe":"0", "age":"11", "studies1":"11", "reltype":"11", "dist":"10" }, + { "id":"12", "number":"0502032121", "name":"", "sexe":"1", "age":"12", "studies1":"12", "reltype":"12", "dist":"11" }, + { "id":"13", "number":"0502032277", "name":"", "sexe":"1", "age":"13", "studies1":"13", "reltype":"13", "dist":"12" }, + { "id":"14", "number":"0502032433", "name":"", "sexe":"1", "age":"14", "studies1":"14", "reltype":"14", "dist":"13" }, + { "id":"15", "number":"0502032589", "name":"", "sexe":"1", "age":"15", "studies1":"15", "reltype":"15", "dist":"14" }, + { "id":"16", "number":"0502032745", "name":"", "sexe":"1", "age":"16", "studies1":"16", "reltype":"16", "dist":"15" }, + { "id":"17", "number":"0502032901", "name":"", "sexe":"1", "age":"17", "studies1":"17", "reltype":"17", "dist":"16" }, + { "id":"18", "number":"0502033057", "name":"", "sexe":"1", "age":"18", "studies1":"18", "reltype":"18", "dist":"17" }, + { "id":"19", "number":"0502033213", "name":"", "sexe":"1", "age":"19", "studies1":"19", "reltype":"19", "dist":"18" }, + { "id":"20", "number":"0502033369", "name":"", "sexe":"1", "age":"20", "studies1":"20", "reltype":"20", "dist":"19" }, + { "id":"21", "number":"0502033525", "name":"", "sexe":"1", "age":"21", "studies1":"21", "reltype":"21", "dist":"20" }, + { "id":"22", "number":"0502033681", "name":"", "sexe":"1", "age":"22", "studies1":"22", "reltype":"22", "dist":"21" }, - { "id":"23", "number":"0606060606", "name":"", "sexe":"0", "age":".", "studies2":".", "reltype":"0", "dist":"0", - "job":"82", - "famsit":"1", - "city":"Toulouse", - "cp":"31000", - "duration":["2","5"], - "context":"11", - "contextExtra": ["facebook", "", ""], - "freq":["4","9","14","19","24"], - "connect":["1","3","5","7","9","11"], - "connectExtra":["",""]}, + { "id":"23", "number":"0606060606", "name":"", "sexe":"0", "age":".", "studies2":".", "reltype":"0", "dist":"0", + "job":"82", + "famsit":"1", + "city":"Toulouse", + "cp":"31000", + "duration":["2","5"], + "context":"11", + "contextExtra": ["facebook", "", ""], + "freq":["4","9","14","19","24"], + "connect":["1","3","5","7","9","11"], + "connectExtra":["",""]}, - { "id":"23", "number":"0606060606", "name":"", "sexe":"0", "age":".", "studies2":".", "reltype":"autretext", "dist":"0", - "job":"82", - "famsit":"1", - "city":"Toulouse", - "cp":"31000", - "duration":["2","5"], - "context":"10", - "contextExtra": ["", "", ""], - "freq":["4","9","14","19","24"], - "connect":["1","3","5","7","9","11"], - "connectExtra":["",""]} - ], + { "id":"23", "number":"0606060606", "name":"", "sexe":"0", "age":".", "studies2":".", "reltype":"autretext", "dist":"0", + "job":"82", + "famsit":"1", + "city":"Toulouse", + "cp":"31000", + "duration":["2","5"], + "context":"10", + "contextExtra": ["", "", ""], + "freq":["4","9","14","19","24"], + "connect":["1","3","5","7","9","11"], + "connectExtra":["",""]} + ], - "relations": { - "0": ["1", "4", "6", "8"], - "5": ["cd 4", "5", "6"] - } + "relations": { + "0": ["1", "4", "6", "8"], + "5": ["cd 4", "5", "6"] + } diff --git a/manager/module/chart.php b/manager/module/chart.php index 580df15..8e18421 100755 --- a/manager/module/chart.php +++ b/manager/module/chart.php @@ -119,9 +119,8 @@ }else{ /* (1) On initialise les compteurs */ - $MISSED = 0; - $OUTGOING = 0; - $INCOMING = 0; + $H = 0; + $F = 0; } @@ -133,6 +132,73 @@ ); } + + + + /* RETOURNE UN JEU DE DONNEES POUR LE SEXE DES CONTACTS + * + */ + public static function sexe($params){ + extract($params); + + $subject = intval($subject); + + + /* [1] On récupère les données de ce sujet + =========================================================*/ + $db = new lightdb('phone_db', __ROOT__.'/src/dynamic/'); + $data = $db->fetch($subject); + $db->close(); + + // Si erreur + if( $data === false ) + return array( 'ModuleError' => ManagerError::ModuleError ); + + + /* [2] S'il a un journal d'appel, on renvoie les données + =========================================================*/ + if( isset($data['logs']) && is_array($data['logs']) ){ + + /* (1) On initialise les compteurs */ + $H = 0; + $F = 0; + + /* (2) On incrémente les compteurs */ + foreach($data['logs'] as $log){ + + /* (3) On récupère le contact associé */ + $associatedContact = null; + foreach($data['contacts'] as $contact) + if( $log['id'] == $contact['id'] ) + $associatedContact = $contact; + + // Si on ne trouve pas, on passe au suivant + if( is_null($associatedContact) ) + continue; + + /* (4) On incrémente les compteurs */ + $H += ($associatedContact['sexe']==0) ? 1 : 0; + $F += ($associatedContact['sexe']==1) ? 1 : 0; + + } + + /* [3] Si aucun journal d'appel + =========================================================*/ + }else{ + + /* (1) On initialise les compteurs */ + $H = 0; + $F = 0; + + }/* (1) On initialise les compteurs */ + + + return array( + 'ModuleError' => ManagerError::Success, + 'labels' => array('HOMME', 'FEMME'), + 'data' => array($H, $F) + ); + } } diff --git a/src/dynamic/phone/dictionary.json b/src/dynamic/phone/dictionary.json index 9e97d40..812fa62 100755 --- a/src/dynamic/phone/dictionary.json +++ b/src/dynamic/phone/dictionary.json @@ -1,147 +1,147 @@ { - "logs": { - "direction": { "0": "INCOMING", "1": "OUTGOING", "2": "MISSED" }, - "type": { "0": "PHONE", "1": "SMS" } + "logs": { + "direction": { "0": "INCOMING", "1": "OUTGOING", "2": "MISSED" }, + "type": { "0": "PHONE", "1": "SMS" } - }, + }, - "contacts": { - "sexe": { "0":"Homme", "1":"Femme" }, - "age": { - ".": "NA", - "0": "5 à 10", "1": "10 à 15", "2": "15 à 20", "3": "20 à 25", "4": "25 à 30", - "5": "30 à 35", "6": "35 à 40", "7": "40 à 45", "8": "45 à 50", "9": "50 à 55", - "10": "55 à 60", "11": "60 à 65", "12": "65 à 70", "13": "70 à 75", "14": "75 à 80", - "15": "80 à 85", "16": "85 à 90", "17": "90 à 95", "18": "95 à 100" - }, + "contacts": { + "sexe": { "0":"Homme", "1":"Femme" }, + "age": { + ".": "NA", + "0": "5 à 10", "1": "10 à 15", "2": "15 à 20", "3": "20 à 25", "4": "25 à 30", + "5": "30 à 35", "6": "35 à 40", "7": "40 à 45", "8": "45 à 50", "9": "50 à 55", + "10": "55 à 60", "11": "60 à 65", "12": "65 à 70", "13": "70 à 75", "14": "75 à 80", + "15": "80 à 85", "16": "85 à 90", "17": "90 à 95", "18": "95 à 100" + }, - "studies1": { - ".": "NA", - "0": "Inconnu", - "1": "< BAC", - "2": "BAC", - "3": "BAC+2", - "4": "BAC+3", - "5": "BAC+4 et plus" - }, + "studies1": { + ".": "NA", + "0": "Inconnu", + "1": "< BAC", + "2": "BAC", + "3": "BAC+2", + "4": "BAC+3", + "5": "BAC+4 et plus" + }, - "studies2": { - ".": "NA", - "0": "Inconnue", - "01": "Pas de scolarité", - "02": "Aucun diplôme mais scolarité jusqu'en école primaire ou au collège", - "03": "Aucun diplôme mais scolarité au-delà du collège", - "04": "Certificat d'études primaires (CEP)", - "05": "BEPC, brevet élémentaire, brevet des collèges", - "06": "Certificat d'aptitudes professionnelles (CAP), brevet de compagnon, y compris CAPA", - "07": "Brevet d'études professionnelles (BEP), y compris BEPA et diplômes agricoles (BAA, BPA) Diplômes sociaux (aide-soignante, auxiliaire de puériculture, travailleuse familiale)", - "08": "Baccalauréat général, brevet supérieur BAC ( L, ES, S ou A, B , C, D, D’, E )", - "09": "Bac technologique ou professionnel, brevet professionnel ou de technicien BAC (STI, STL, SMS, STT ou F, G, H) BEC, BEI, BEH, capacité en droit Brevet de technicien agricole (BTA)", - "10": "Diplôme universitaire de 1er cycle BTS, DUT, DEUG Diplôme des professions sociales ou de santé, d'infirmier(ère) Diplôme universitaire propédeutique, DUEL, DUES, DEUG, PCEM", - "11": "Diplôme universitaire de 2ème ou 3ème cycle MASTER, DOCTORAT (y compris médecine, pharmacie, dentaire), Maîtrise, DEA, DESS, CAPES, CAPET, agrégation Diplôme d'ingénieur, d'une grande école, etc." - }, + "studies2": { + ".": "NA", + "0": "Inconnue", + "01": "Pas de scolarité", + "02": "Aucun diplôme mais scolarité jusqu'en école primaire ou au collège", + "03": "Aucun diplôme mais scolarité au-delà du collège", + "04": "Certificat d'études primaires (CEP)", + "05": "BEPC, brevet élémentaire, brevet des collèges", + "06": "Certificat d'aptitudes professionnelles (CAP), brevet de compagnon, y compris CAPA", + "07": "Brevet d'études professionnelles (BEP), y compris BEPA et diplômes agricoles (BAA, BPA) Diplômes sociaux (aide-soignante, auxiliaire de puériculture, travailleuse familiale)", + "08": "Baccalauréat général, brevet supérieur BAC ( L, ES, S ou A, B , C, D, D’, E )", + "09": "Bac technologique ou professionnel, brevet professionnel ou de technicien BAC (STI, STL, SMS, STT ou F, G, H) BEC, BEI, BEH, capacité en droit Brevet de technicien agricole (BTA)", + "10": "Diplôme universitaire de 1er cycle BTS, DUT, DEUG Diplôme des professions sociales ou de santé, d'infirmier(ère) Diplôme universitaire propédeutique, DUEL, DUES, DEUG, PCEM", + "11": "Diplôme universitaire de 2ème ou 3ème cycle MASTER, DOCTORAT (y compris médecine, pharmacie, dentaire), Maîtrise, DEA, DESS, CAPES, CAPET, agrégation Diplôme d'ingénieur, d'une grande école, etc." + }, - "job": { - ".": "NA", - "10": "Agriculteurs exploitants (Agriculteurs, maraîchers, viticulteurs…)", - "21": "Artisans (Maçons, électriciens, couturiers, boulangers, garagistes, coiffeurs…)", - "22": "Commerçants et assimilés (Commerçants en détail ou en gros, buralistes, cafetiers, agents immobiliers…)", - "23": "Chefs d'entreprise de 10 salariés ou plus", - "31": "Professions libérales et assimilés (Médecins, avocats, notaires, architectes libéraux…)", - "32": "Cadres de la fonction publique, professions intellectuelles et artistiques (Personnels administratifs de catégorie A, professeurs de l’enseignement secondaire ou supérieur, médecins hospitaliers, artistes…)", - "36": "Cadres d'entreprise (Cadres administratifs, cadres commerciaux, ingénieurs…)", - "41": "Professions intermédiaires de l'enseignement, de la santé, de la fonction publique et assimilés (Personnels administratifs de catégorie B, instituteurs, infirmiers, travailleurs sociaux…)", - "46": "Professions intermédiaires administratives et commerciales des entreprises (Comptables, chargés de clientèles…)", - "47": "Techniciens (Techniciens d’études, techniciens de contrôle, dessinateurs en bâtiment, géomètres…)", - "48": "Contremaîtres, agents de maîtrise (Conducteurs de travaux, chefs d’équipe…)", - "51": "Employés de la fonction publique (Personnels de catégorie C, agents administratifs, agents de service…)", - "54": "Employés administratifs d'entreprise (Secrétaires, agents d’accueil…)", - "55": "Employés de commerce (Vendeurs, caissiers…)", - "56": "Personnels des services directs aux particuliers (Serveurs, coiffeurs, assistantes maternelles…)", - "61": "Ouvriers qualifiés de type industriel ou artisanal (Mécaniciens, chauffeurs, cuisiniers…)", - "66": "Ouvriers non qualifiés de type industriel ou artisanal (Ouvrier de production, manœuvres…)", - "69": "Ouvriers agricoles (Bergers, ouvriers de la viticulture, bûcherons, ouvrier forestiers…)", - "71": "Anciens agriculteurs exploitants", - "72": "Anciens artisans, commerçants, chefs d'entreprise", - "73": "Anciens cadres", - "74": "Anciennes professions intermédiaires", - "75": "Anciens employés", - "76": "Anciens ouvriers", - "81": "Chômeurs n'ayant jamais travaillé", - "82": "Inactifs divers (autres que retraités)" - }, + "job": { + ".": "NA", + "10": "Agriculteurs exploitants (Agriculteurs, maraîchers, viticulteurs…)", + "21": "Artisans (Maçons, électriciens, couturiers, boulangers, garagistes, coiffeurs…)", + "22": "Commerçants et assimilés (Commerçants en détail ou en gros, buralistes, cafetiers, agents immobiliers…)", + "23": "Chefs d'entreprise de 10 salariés ou plus", + "31": "Professions libérales et assimilés (Médecins, avocats, notaires, architectes libéraux…)", + "32": "Cadres de la fonction publique, professions intellectuelles et artistiques (Personnels administratifs de catégorie A, professeurs de l’enseignement secondaire ou supérieur, médecins hospitaliers, artistes…)", + "36": "Cadres d'entreprise (Cadres administratifs, cadres commerciaux, ingénieurs…)", + "41": "Professions intermédiaires de l'enseignement, de la santé, de la fonction publique et assimilés (Personnels administratifs de catégorie B, instituteurs, infirmiers, travailleurs sociaux…)", + "46": "Professions intermédiaires administratives et commerciales des entreprises (Comptables, chargés de clientèles…)", + "47": "Techniciens (Techniciens d’études, techniciens de contrôle, dessinateurs en bâtiment, géomètres…)", + "48": "Contremaîtres, agents de maîtrise (Conducteurs de travaux, chefs d’équipe…)", + "51": "Employés de la fonction publique (Personnels de catégorie C, agents administratifs, agents de service…)", + "54": "Employés administratifs d'entreprise (Secrétaires, agents d’accueil…)", + "55": "Employés de commerce (Vendeurs, caissiers…)", + "56": "Personnels des services directs aux particuliers (Serveurs, coiffeurs, assistantes maternelles…)", + "61": "Ouvriers qualifiés de type industriel ou artisanal (Mécaniciens, chauffeurs, cuisiniers…)", + "66": "Ouvriers non qualifiés de type industriel ou artisanal (Ouvrier de production, manœuvres…)", + "69": "Ouvriers agricoles (Bergers, ouvriers de la viticulture, bûcherons, ouvrier forestiers…)", + "71": "Anciens agriculteurs exploitants", + "72": "Anciens artisans, commerçants, chefs d'entreprise", + "73": "Anciens cadres", + "74": "Anciennes professions intermédiaires", + "75": "Anciens employés", + "76": "Anciens ouvriers", + "81": "Chômeurs n'ayant jamais travaillé", + "82": "Inactifs divers (autres que retraités)" + }, - "context": { - "0": "De la même famille", - "1": "Grandi ensemble", - "2": "Par mon mari/ma femme/relation amoureuse", - "3": "Par mes parents", - "4": "Par mes enfants", - "5": "Par un ami", - "6": "Comme voisin", - "7": "Par d’autres membres de la famille", - "8": "Etudes", - "9": "Etudes supérieures", - "10": "Au travail", - "11": "Internet", - "12": "Association", - "13": "Autre" - }, + "context": { + "0": "De la même famille", + "1": "Grandi ensemble", + "2": "Par mon mari/ma femme/relation amoureuse", + "3": "Par mes parents", + "4": "Par mes enfants", + "5": "Par un ami", + "6": "Comme voisin", + "7": "Par d’autres membres de la famille", + "8": "Etudes", + "9": "Etudes supérieures", + "10": "Au travail", + "11": "Internet", + "12": "Association", + "13": "Autre" + }, - "famsit": { - "0": "Seul", - "1": "Seul avec enfant(s)", - "2": "En couple sans enfants", - "3": "En couple avec enfants" - }, + "famsit": { + "0": "Seul", + "1": "Seul avec enfant(s)", + "2": "En couple sans enfants", + "3": "En couple avec enfants" + }, - "reltype": { - "0": "Père, mère ou équivalent", - "1": "Frère ou soeur", - "2": "Autre membre de la famille", - "3": "Relation amoureuse", - "4": "Collègue", - "5": "Voisin", - "6": "Ami proche", - "7": "Ami", - "8": "Relation de service (médecin, ...)", - "9": "Inconnu" - }, + "reltype": { + "0": "Père, mère ou équivalent", + "1": "Frère ou soeur", + "2": "Autre membre de la famille", + "3": "Relation amoureuse", + "4": "Collègue", + "5": "Voisin", + "6": "Ami proche", + "7": "Ami", + "8": "Relation de service (médecin, ...)", + "9": "Inconnu" + }, - "dist": { - "0": "- de 5 minutes", - "1": "de 5 à 15 minutes", - "2": "de 15 à 60 minutes", - "3": "+ d'une heure" - }, + "dist": { + "0": "- de 5 minutes", + "1": "de 5 à 15 minutes", + "2": "de 15 à 60 minutes", + "3": "+ d'une heure" + }, - "freq": { - "0": "plusieurs fois par semaine", - "1": "1 fois par semaine", - "2": "1 fois par mois", - "3": "1 fois par an ou moins", - "4": "Jamais" - }, + "freq": { + "0": "plusieurs fois par semaine", + "1": "1 fois par semaine", + "2": "1 fois par mois", + "3": "1 fois par an ou moins", + "4": "Jamais" + }, - "connect": { - "0": "Oui", - "1": "Non" - } + "connect": { + "0": "Oui", + "1": "Non" + } - } + } } diff --git a/test-charts/all.php b/test-charts/all.php new file mode 100644 index 0000000..8256769 --- /dev/null +++ b/test-charts/all.php @@ -0,0 +1,137 @@ + + + + + Chart du sexe (HOMME/FEMME) + + + + + + + + + + + + + + diff --git a/test-charts/sexe.php b/test-charts/sexe.php new file mode 100644 index 0000000..87cd493 --- /dev/null +++ b/test-charts/sexe.php @@ -0,0 +1,57 @@ + + + + + Chart du sexe (HOMME/FEMME) + + + + + + + + + + +