$value) { echo $value[0].","; $healthy[] = ", ".$value[0].", "; $yummy[] = ", ".$value[1].", "; }*/ if (($handle = fopen("mapping_migration.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 0, ";", '"')) !== FALSE) { $healthy[] = $data[0]; $yummy[] = $data[1]; $mapping_course[$data[0]] = $data[1]; } } $tabgroup19=array(); /** on parcours les groups csv **/ if (($handle = fopen("groups19.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 0, ";", '"')) !== FALSE) { $healthy[] = $data[0]; $yummy[] = $data[1]; if($mapping_course[$data[1]]) $tabgroup19[]=array($data[0],$mapping_course[$data[1]], $data[2], $data[3], $data[4], $data[5], $data[6], $data[7], $data[8]); } } $printtab = print_r($mapping_course, true); echo "
".$printtab."
"; $tabgroupings19=array(); /** on parcours les groups csv **/ if (($handle = fopen("groupings19.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 0, ";", '"')) !== FALSE) { $healthy[] = $data[0]; $yummy[] = $data[1]; if($mapping_course[$data[1]]) $tabgroupings19[]=array($data[0],$mapping_course[$data[1]], $data[2], $data[3], $data[4], $data[5], $data[6]); } } //echo "executer requete pour recuperer les groups, puis grouping puis mapping group grouping
SELECT * FROM `mdl_groups` WHERE `courseid` in (3229,1545,231,2440,2825,2423,2354,2122,1124,1097,347,226);
"; //echo " - pour la table groups, ajouter le champ descriptionformat et le mettre à 1
"; //echo " - pour la table grouping, ajouter le champ descriptionformat et le mettre à 1
"; $requetefinalegroupings = "INSERT INTO `mdl_groupings` (`id`, `courseid`, `name`, `description`, `descriptionformat`, `configdata`, `timecreated`, `timemodified`) VALUES\n"; foreach($tabgroupings19 as $key => $value) { $requetefinalegroupings .= "(".$value[0].", ".$value[1].", '".$value[2]."', '".$value[3]."', 1, ".$value[4].", ".$value[5].", ".$value[6]."),\n"; } $requetefinalegroups = "INSERT INTO `mdl_groups` (`id`, `courseid`, `name`, `description`, `descriptionformat`, `enrolmentkey`, `picture`, `hidepicture`, `timecreated`, `timemodified`) VALUES\n"; foreach($tabgroup19 as $key => $value) { $requetefinalegroups .= "(".$value[0].", ".$value[1].", '".$value[2]."', '".$value[3]."', 1, '".$value[4]."', ".$value[5].", ".$value[6].", ".$value[7].", ".$value[8]."),\n"; //(212, 6, 'FC', '', 'fc', 0, 0, 1220889444, 1317932029), } /* "(23, 226, 'Protostomiens', '', 1, NULL, 1220345990, 1253001681), (24, 226, 'Deutérostomiens', '', 1, NULL, 1220346012, 1252337237), (36, 226, 'Equipe Pédagogique', '', 1, NULL, 1221050265, 1221050265), (1043, 226, 'Protostomiens Section 3', '', 1, NULL, 1316373127, 1316373127), (1219, 3229, 'SVTE 63', 'Communication entre étudiants et l''enseignant ', 1, NULL, 1328016764, 1328016764);"; */ //$newphrase = str_replace($healthy, $yummy, $phrase); echo "
".$requetefinalegroupings."



".$requetefinalegroups."
"; ?>