Line 88... |
Line 88... |
88 |
private function unifierNull() {
|
88 |
private function unifierNull() {
|
89 |
$requete_colonnes = "SELECT column_name FROM information_schema.columns WHERE table_name = 'cel_obs' AND table_schema='tb_cel';";
|
89 |
$requete_colonnes = "SELECT column_name FROM information_schema.columns WHERE table_name = 'cel_obs' AND table_schema='tb_cel';";
|
90 |
$colonnes = $this->bdd->recupererTous($requete_colonnes);
|
90 |
$colonnes = $this->bdd->recupererTous($requete_colonnes);
|
91 |
foreach ($colonnes as $colonne) {
|
91 |
foreach ($colonnes as $colonne) {
|
92 |
echo "Suppression des vides dans la colonne ".$colonne['column_name']." ...";
|
92 |
echo "Suppression des vides dans la colonne ".$colonne['column_name']." ...";
|
- |
|
93 |
$dsl = array( 'nom_sel_nn', 'nom_ret_nn', 'nt');
|
- |
|
94 |
if (isset($dsl[$colonne['column_name']])) {
|
- |
|
95 |
$requete = "UPDATE cel_obs SET ".$colonne['column_name']." = NULL WHERE ".$colonne['column_name']."= '' OR ".$colonne['column_name']." = 0";
|
- |
|
96 |
} else {
|
93 |
$requete = "UPDATE cel_obs SET ".$colonne['column_name']." = NULL WHERE ".$colonne['column_name']."= '' OR ".$colonne['column_name']." IN ('INSEE-C:', '0000-00-00 00:00:00', '0.00000')";
|
97 |
$requete = "UPDATE cel_obs SET ".$colonne['column_name']." = NULL WHERE ".$colonne['column_name']."= '' OR ".$colonne['column_name']." IN ('INSEE-C:', '0000-00-00 00:00:00', '0.00000')";
|
- |
|
98 |
}
|
94 |
$this->bdd->requeter($requete);
|
99 |
$this->bdd->requeter($requete);
|
95 |
echo "effectuée \n";
|
100 |
echo "effectuée \n";
|
96 |
}
|
101 |
}
|
97 |
}
|
102 |
}
|
Line 120... |
Line 125... |
120 |
echo "Uniformisation du nom de référentiel";
|
125 |
echo "Uniformisation du nom de référentiel";
|
121 |
$referentiels = array("BDTFX", "BDTRE", "BDTXA", "APD", "LBF", "ISFAN");
|
126 |
$referentiels = array("BDTFX", "BDTRE", "BDTXA", "APD", "LBF", "ISFAN");
|
122 |
foreach ($referentiels as $referentiel) {
|
127 |
foreach ($referentiels as $referentiel) {
|
123 |
$requete = "UPDATE cel_obs SET nom_referentiel = '".$referentiel."' WHERE nom_referentiel like '".$referentiel."%'";
|
128 |
$requete = "UPDATE cel_obs SET nom_referentiel = '".$referentiel."' WHERE nom_referentiel like '".$referentiel."%'";
|
124 |
$this->bdd->requeter($requete);
|
129 |
$this->bdd->requeter($requete);
|
- |
|
130 |
$requete = "UPDATE cel_obs SET nom_referentiel = NULL WHERE nom_sel_nn = '' or nom_sel_nn = '0'";
|
- |
|
131 |
$this->bdd->requeter($requete);
|
125 |
echo "effectuée \n";
|
132 |
echo "effectuée \n";
|
126 |
}
|
133 |
}
|
127 |
$requete_verif = "SELECT nom_referentiel FROM cel_obs WHERE nom_referentiel NOT IN ('".implode("', '", $referentiels)."')";
|
134 |
$requete_verif = "SELECT nom_referentiel FROM cel_obs WHERE nom_referentiel NOT IN ('".implode("', '", $referentiels)."')";
|
128 |
$verif = $this->bdd->recupererTous($requete_verif);
|
135 |
$verif = $this->bdd->recupererTous($requete_verif);
|
129 |
if ($verif != array()) print_r($verif);
|
136 |
if ($verif != array()) print_r($verif);
|