Beispiel #1
0
 public function update_elements_champs($array, $id_element)
 {
     global $thisSite;
     $PDO = new myPDO();
     $temp = array();
     $this->get_champs();
     foreach ($array as $k => $row) {
         if (is_numeric($k)) {
             if (in_array($k, $this->list_champ_crypte)) {
                 $temp[$k] = crypt_string('KEY', $row);
             } else {
                 $temp[$k] = $row;
             }
         }
     }
     // UPDATE les valeurs saisie par l'utilisateur elements_champs
     foreach ($temp as $key => $data) {
         $result = $PDO->free_requete("UPDATE " . $thisSite->PREFIXE_TBL_CLI . "elements_champs \n                                SET valeur = '{$data}'\n                                WHERE " . $thisSite->PREFIXE_TBL_CLI . "elements_champs.id_element = {$id_element}\n                                AND " . $thisSite->PREFIXE_TBL_CLI . "elements_champs.id = {$key}");
     }
     /* decrypter le valeurs pour le rendre à la vue */
     foreach ($temp as $kk => $vv) {
         if (in_array($kk, $this->list_champ_crypte)) {
             $temp[$kk] = decrypt_string('KEY', $vv);
         }
     }
     $this->valeurs = $temp;
 }