​*DONE*​: Remplissage de 'dictionary'.'context'

This commit is contained in:
xdrm-brackets 2016-05-13 16:06:04 +02:00
parent 869b51f69c
commit e79e2c3f07
4 changed files with 55 additions and 14 deletions

View File

@ -55,18 +55,20 @@
"city":"Toulouse",
"cp":"31000",
"duration":["2","5"],
"context":"0",
"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":"special1ou2ou3",
"context":"10",
"contextExtra": ["", "", ""],
"freq":["4","9","14","19","24"],
"connect":["1","3","5","7","9","11"],
"connectExtra":["",""]}

View File

@ -54,7 +54,7 @@
/* [1] On ajoute les colonnes à la sortie
=========================================================*/
foreach($columns as $i=>$column)
$output .= ($i < count($columns)-1) ? "$column," : "$column\n\r";
$output .= ($i < count($columns)-1) ? "\"$column\";" : "\"$column\"";
@ -97,7 +97,7 @@
}
// On ajoute une virgule sauf à la dernière valeur
$output .= ($c < count($columns)-1) ? "," : "";
$output .= ($c < count($columns)-1) ? ";" : "";
}
@ -137,7 +137,6 @@
/* [2] On construit le CSV
=========================================================*/
$output = array(
@ -148,11 +147,11 @@
/* [3] On construit le fichier du dictionnaire
=========================================================*/
$output['dict'] .= "\"sheet\",\"field\",\"key\",\"value\"\r\n";
$output['dict'] .= "\"sheet\";\"field\";\"key\";\"value\"\r\n";
foreach($dict as $ds=>$dataset)
foreach($dataset as $f=>$field)
foreach($field as $key=>$value)
$output['dict'] .= "\"$ds\",\"$f\",\"$key\",\"$value\"\r\n";
$output['dict'] .= "\"$ds\";\"$f\";\"$key\";\"$value\"\r\n";
/* [4] Création de l'archive
@ -172,7 +171,7 @@
return array(
'ModuleError' => ManagerError::Success,
'headers' => array(
'Content-Type' => 'application/zip',
'Content-Type' => 'application/zip; charset=utf-8',
'Content-Disposition' => 'attachment; filename=phone_data.zip',
'Pragma' => 'no-cache',
'Expires' => '0'

View File

@ -48,8 +48,30 @@
{ "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":"0", "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":"special1ou2ou3", "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":["",""]}
],
"relations": {

View File

@ -43,9 +43,9 @@
"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)</option>\n BEC, BEI, BEH, capacité en droit</option>\n Brevet de technicien agricole (BTA)",
"10": "Diplôme universitaire de 1er cycle BTS, DUT, DEUG</option>\n Diplôme des professions sociales ou de santé, d'infirmier(ère)</option>\n 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),</option>\n Maîtrise, DEA, DESS,</option>\n CAPES, CAPET, agrégation</option>\n Diplôme d'ingénieur, d'une grande école, etc."
"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": {
@ -78,6 +78,24 @@
"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 dautres 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)",