Subversion Repositories eFlore/Applications.cel

Rev

Rev 3196 | Rev 3233 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3196 Rev 3226
Line 20... Line 20...
20
 * @version     $Id$
20
 * @version     $Id$
21
 * @copyright   Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
21
 * @copyright   Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
22
 */
22
 */
23
class Manager extends WidgetCommun {
23
class Manager extends WidgetCommun {
Line 24... Line 24...
24
 
24
 
25
        const DS = DIRECTORY_SEPARATOR;
25
  const DS = DIRECTORY_SEPARATOR;
26
        const SERVICE_DEFAUT = 'manager';
26
  const SERVICE_DEFAUT = 'manager';
27
        private $cel_url_tpl = null;
27
  private $cel_url_tpl = null;
28
        /** Si spécifié, on ajoute une barre de navigation inter-applications */
28
  /** Si spécifié, on ajoute une barre de navigation inter-applications */
29
        private $bar;
29
  private $bar;
30
        //private $parametres_autorises = array('projet', 'type', 'langue', 'order');
30
  //private $parametres_autorises = array('projet', 'type', 'langue', 'order');
31
        private $parametres_autorises = array(
31
  private $parametres_autorises = array(
32
                        'projet' => 'projet',
32
    'projet' => 'projet',
33
                        'type' => 'type',
33
    'type' => 'type',
34
                        'langue' => 'langue',
34
    'langue' => 'langue',
35
                        'order' => 'order'
35
    'order' => 'order'
36
        );
36
  );
37
        /**
37
  /**
38
         * Méthode appelée par défaut pour charger ce widget.
38
   * Méthode appelée par défaut pour charger ce widget.
39
         */
39
   */
40
        public function executer() {
40
  public function executer() {
41
                $retour = null;
-
 
42
                // Pour la création de l'id du cache nous ne tenons pas compte du paramètre de l'url callback
-
 
43
                unset($this->parametres['callback']);
-
 
44
                extract($this->parametres);
-
 
45
                $this->bar = (isset($bar)) ? $bar : false;
-
 
46
 
-
 
47
                if (!isset($mode)) {
-
 
48
                        $mode = self::SERVICE_DEFAUT;
-
 
49
                }
-
 
50
 
-
 
51
                $this->cel_url_tpl = $this->config['manager']['celUrlTpl'];
-
 
52
				
-
 
53
                
-
 
54
                if ($_POST != array()) { //print_r($_POST);
-
 
55
                        $this->parametres['projet'] = $_POST['projet'];
-
 
56
                        $this->parametres['langue'] = $_POST['langue'];
-
 
57
                        if ($mode == 'modification') {
-
 
58
                                $parametres = $this->traiterParametresModif();
-
 
59
                                $json = $this->getDao()->modifier($this->cel_url_tpl, $parametres);
-
 
60
                        } else {
-
 
61
                                $json = $this->getDao()->ajouter($this->cel_url_tpl, $_POST);
-
 
62
                                $this->parametres['mode'] = $mode = 'modification';
-
 
63
                        }
-
 
64
                }
-
 
65
 
-
 
66
 
-
 
67
 
-
 
68
 
-
 
69
                $methode = $this->traiterNomMethodeExecuter($mode);
-
 
70
                if (method_exists($this, $methode)) {
-
 
71
                        $retour = $this->$methode();
-
 
72
                } else {
-
 
73
                        $this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
-
 
74
                }
-
 
75
                
-
 
76
                $contenu = '';
-
 
77
                if (is_null($retour)) {
-
 
78
                        $this->messages[] = 'La ressource demandée a retourné une valeur nulle.';
-
 
79
                } else {
-
 
80
                        if (isset($retour['donnees'])) {
-
 
81
                        		$retour['donnees']['params'] = '&projet='.$_POST['projet'].
-
 
82
                        			'&langue='.$_POST['langue'];
-
 
83
                                $retour['donnees']['prod'] = ($this->config['parametres']['modeServeur'] == "prod");
-
 
84
                                $retour['donnees']['bar'] = $this->bar;
-
 
85
                                $retour['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
-
 
86
                                $retour['donnees']['mode'] = $mode; //print_r($retour);
-
 
87
                                $squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$retour['squelette'].'.tpl.html';
-
 
88
                                $contenu = $this->traiterSquelettePhp($squelette, $retour['donnees']);
-
 
89
                        } else {
-
 
90
                                $this->messages[] = 'Les données à transmettre au squelette sont nulles.';
-
 
91
                        }
-
 
92
                }
-
 
93
                $this->envoyer($contenu);
-
 
Line 94... Line -...
94
        }
-
 
95
 
-
 
96
        private function executerManager() {
-
 
97
                $params = array();
-
 
98
                $retour['squelette'] = 'manager';
-
 
99
                foreach ($this->parametres_autorises as $id=>$pa) {
41
    $retour = null;
100
                        if (isset($this->parametres[$pa])) {
-
 
101
                                $params[] = $pa."=".$this->parametres[$pa];
-
 
102
                        }
42
 
103
                }
43
    // Pour la création de l'id du cache nous ne tenons pas compte du paramètre de l'url callback
104
                $param = implode($params, '&');
44
    unset( $this->parametres['callback'] );
105
                $url = $this->cel_url_tpl;
-
 
106
                if ($param != "") $url .= '?'.$param;
-
 
107
                $json = $this->getDao()->consulter($url);
-
 
108
                $retour['donnees']['widget'] = (array) json_decode($json, true); 
-
 
109
                $retour['donnees']['widgetUrlTpl'] = $this->config['manager']['widgetUrlTpl'];
-
 
Line 110... Line -...
110
                return $retour;
-
 
111
        }
-
 
112
 
-
 
113
        private function executerCreation() {
-
 
114
                //https://api.tela-botanica.org/service:cel:NomsChampsEtendus/cle
-
 
115
                $retour['squelette'] ='creation';
-
 
116
                $jsonlangue = $this->getDao()->consulter($this->config['manager']['languesUrl']);
-
 
117
                $tableaulangue = (array) json_decode($jsonlangue, true);
-
 
118
                $retour['donnees']['langues'] = $tableaulangue['resultat'] ;
-
 
119
                $retour['donnees']['widget'] = array();
-
 
120
                if (isset($this->parametres['projet'])) {
-
 
121
                        $url = $this->cel_url_tpl.'?projet='.$this->parametres['projet'];
-
 
122
                        $json = $this->getDao()->consulter($url);
-
 
123
                        $tableau = (array) json_decode($json, true);
-
 
124
                        $retour['donnees']['widget'] = $tableau[0];
45
    extract( $this->parametres );
125
 
-
 
126
                }
-
 
127
                $urltype = $this->cel_url_tpl.'?esttype=1';
-
 
128
                $jsontype = $this->getDao()->consulter($urltype);
-
 
129
                $tableautype= (array) json_decode($jsontype, true);
-
 
Line -... Line 46...
-
 
46
    $this->bar = ( isset( $bar ) ) ? $bar : false;
Line -... Line 47...
-
 
47
 
-
 
48
    $framework = dirname( __FILE__ ) . '/framework.php';
-
 
49
 
Line 130... Line 50...
130
                $retour['donnees']['type'] = $tableautype;
50
    if ( !file_exists( $framework ) ) {
131
                return $retour;
51
 
132
        }
52
      $e = 'Veuillez paramêtrer l\'emplacement et la version du Framework dans le fichier $framework';
-
 
53
      trigger_error( $e, E_USER_ERROR );
133
 
54
    } else {
-
 
55
 
-
 
56
      // Inclusion du Framework
-
 
57
      require_once $framework;
-
 
58
      // Ajout d'information concernant cette application
-
 
59
      Framework::setCheminAppli( __FILE__ );// Obligatoire
-
 
60
      Framework::setInfoAppli( Config::get( 'info' ) );// Optionnel
-
 
61
    }
134
 
62
 
-
 
63
    if ( !isset( $mode ) ) {
135
 
64
 
-
 
65
      $mode = self::SERVICE_DEFAUT;
136
        private function executerModification() {
66
    }
137
                $retour = array();
67
 
-
 
68
    $this->cel_url_tpl = $this->config['manager']['celUrlTpl'];
-
 
69
 
-
 
70
    if ( $_POST !== array() ) { //print_r($_POST);
-
 
71
 
138
                if (isset($this->parametres['projet'])) {
72
      $this->parametres['projet'] = $_POST['projet'];
-
 
73
      $this->parametres['langue'] = $_POST['langue'];
-
 
74
 
139
                        $retour['squelette'] = 'creation';
75
      if ( $mode === 'modification' ) {
140
                        $url = $this->cel_url_tpl.'?projet='.$this->parametres['projet'].'&langue='.$this->parametres['langue'];
76
 
141
                        $json = $this->getDao()->consulter($url);
77
        $parametres = $this->traiterParametresModif();
-
 
78
        $json       = $this->getDao()->modifier( $this->cel_url_tpl, $parametres );
-
 
79
      } else {
-
 
80
 
-
 
81
        $donnees = array_merge( $_POST, $this->traiterDonneesFiles() );
-
 
82
        $json  = $this->getDao()->ajouter( $this->cel_url_tpl, $donnees );
-
 
83
        $mode  = $this->parametres['mode'] = 'modification';
-
 
84
      }
142
                        $tableau = (array) json_decode($json, true);
85
    }
-
 
86
 
143
                        $retour['donnees']['widget'] = $tableau[0];
87
 
-
 
88
 
-
 
89
 
-
 
90
    $methode = $this->traiterNomMethodeExecuter( $mode );
144
                        $urltype = $this->cel_url_tpl.'?esttype=1';
91
    if ( method_exists( $this, $methode ) ) {
-
 
92
 
-
 
93
      $retour = $this->$methode();
145
                        $jsontype = $this->getDao()->consulter($urltype);
94
    } else {
-
 
95
 
-
 
96
      $this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
-
 
97
    }
-
 
98
 
146
                        $tableautype= (array) json_decode($jsontype, true);
99
    $contenu = '';
-
 
100
    if ( is_null( $retour ) ) {
147
                        $retour['donnees']['type'] = $tableautype;
101
      $this->messages[] = 'La ressource demandée a retourné une valeur nulle.';
148
                }//print_r($retour['donnees']);
102
 
149
                return $retour;
103
    } else {
150
        }
104
 
-
 
105
      if ( isset( $retour['donnees'] ) ) {
-
 
106
 
-
 
107
        $retour['donnees']['params']   = '&projet=' . $_POST['projet'] . '&langue=' . $_POST['langue'];
151
        private function traiterParametres() {
108
        $retour['donnees']['prod']     = ( $this->config['parametres']['modeServeur'] === 'prod' );
152
                $parametres_flux = '?';
109
        $retour['donnees']['bar']      = $this->bar;
-
 
110
        $retour['donnees']['url_base'] = sprintf( $this->config['chemins']['baseURLAbsoluDyn'], '' );
-
 
111
 
153
                $criteres = array('utilisateur', 'commune', 'dept', 'taxon', 'commentaire', 'date', 'tag', 'motcle', 'projet', 'num_taxon', 'num_nom', 'referentiel', 'groupe_zones_geo');
112
        $retour['donnees']['mode']     = $mode; //print_r($retour);
-
 
113
        $squelette = dirname( __FILE__ ) . self::DS . 'squelettes' . self::DS . $retour['squelette'] . '.tpl.html';
-
 
114
        $contenu   = $this->traiterSquelettePhp( $squelette, $retour['donnees'] );
-
 
115
      } else {
-
 
116
 
-
 
117
        $this->messages[] = 'Les données à transmettre au squelette sont nulles.';
-
 
118
      }
-
 
119
    }
154
                foreach($this->parametres as $nom_critere => $valeur_critere) {
120
    $this->envoyer($contenu);
155
                        if (in_array($nom_critere, $criteres)) {
121
  }
156
                                $valeur_critere = str_replace(' ', '%20', $valeur_critere);
122
 
-
 
123
  private function executerManager() {
157
                                $parametres_flux .= $nom_critere.'='.$valeur_critere.'&';
124
    $params = array();
-
 
125
    $retour['squelette'] = 'manager';
-
 
126
 
-
 
127
    foreach ( $this->parametres_autorises as $id => $pa ) {
158
                        }
128
      if ( isset( $this->parametres[$pa] ) ) {
-
 
129
 
-
 
130
        $params[] = $pa . '=' . $this->parametres[$pa];
159
                }
131
      }
-
 
132
    }
160
 
133
 
161
                if ($parametres_flux == '?') {
134
    $param = implode( $params, '&' );
-
 
135
    $url   = $this->cel_url_tpl;
-
 
136
 
-
 
137
    if ( $param !== '' ) {
-
 
138
 
Line -... Line 139...
-
 
139
      $url .= '?' . $param;
-
 
140
    }
-
 
141
 
-
 
142
    $json = $this->getDao()->consulter( $url );
-
 
143
    $retour['donnees']['widget']       = (array) json_decode( $json, true );
-
 
144
    $retour['donnees']['widgetUrlTpl'] = $this->config['manager']['widgetUrlTpl'];
-
 
145
 
-
 
146
    return $retour;
-
 
147
  }
-
 
148
 
-
 
149
  private function executerCreation() {
-
 
150
    //https://api.tela-botanica.org/service:cel:NomsChampsEtendus/cle
-
 
151
    $jsonlangue    = $this->getDao()->consulter( $this->config['manager']['languesUrl'] );
-
 
152
    $tableaulangue = (array) json_decode( $jsonlangue, true );
-
 
153
    $retour['squelette']          = 'creation';
-
 
154
    $retour['donnees']['langues'] = $tableaulangue['resultat'] ;
-
 
155
    $retour['donnees']['widget']  = array();
-
 
156
 
-
 
157
    if ( isset( $this->parametres['projet'] ) ) {
-
 
158
 
-
 
159
      $url     = $this->cel_url_tpl . '?projet=' . $this->parametres['projet'];
-
 
160
      $json    = $this->getDao()->consulter( $url );
-
 
161
      $tableau = (array) json_decode( $json, true );
-
 
162
      $retour['donnees']['widget'] = $tableau[0];
-
 
163
    }
-
 
164
 
-
 
165
    $urltype     = $this->cel_url_tpl . '?esttype=1';
-
 
166
    $jsontype    = $this->getDao()->consulter( $urltype );
-
 
167
    $tableautype = (array) json_decode( $jsontype, true );
-
 
168
    $retour['donnees']['type'] = $tableautype;
-
 
169
 
-
 
170
    return $retour;
-
 
171
  }
-
 
172
 
-
 
173
 
-
 
174
 
-
 
175
  private function executerModification() {
-
 
176
    $retour = array();
-
 
177
    if ( isset( $this->parametres['projet'] ) ) {
-
 
178
 
-
 
179
      $url     = $this->cel_url_tpl . '?projet=' . $this->parametres['projet'] . '&langue=' . $this->parametres['langue'];
-
 
180
      $json    = $this->getDao()->consulter( $url );
-
 
181
      $tableau = (array) json_decode( $json, true );
-
 
182
      $retour['squelette']         = 'creation';
-
 
183
      $retour['donnees']['widget'] = $tableau[0];
-
 
184
 
-
 
185
      $urltype     = $this->cel_url_tpl .'?esttype=1';
-
 
186
      $jsontype    = $this->getDao()->consulter( $urltype );
-
 
187
      $tableautype = (array) json_decode( $jsontype, true );
-
 
188
      $retour['donnees']['type'] = $tableautype;
-
 
189
    }//print_r($retour['donnees']);
-
 
190
 
-
 
191
    return $retour;
-
 
192
  }
-
 
193
  private function traiterParametres() {
-
 
194
    $parametres_flux = '?';
-
 
195
    $criteres        = array( 'utilisateur', 'commune', 'dept', 'taxon', 'commentaire', 'date', 'tag', 'motcle', 'projet', 'num_taxon', 'num_nom', 'referentiel', 'groupe_zones_geo' );
-
 
196
 
-
 
197
    foreach( $this->parametres as $nom_critere => $valeur_critere ) {
-
 
198
      if ( in_array( $nom_critere, $criteres ) ) {
-
 
199
 
-
 
200
        $valeur_critere   = str_replace( ' ', '%20', $valeur_critere );
-
 
201
        $parametres_flux .= $nom_critere . '=' . $valeur_critere . '&';
-
 
202
      }
162
                        $parametres_flux = '';
203
    }
163
                } else {
204
 
-
 
205
    $parametres_flux = ( $parametres_flux === '?' ) ? '' : rtrim( $parametres_flux, '&' );
164
                        $parametres_flux = rtrim($parametres_flux, '&');
206
 
165
                }
207
    return $parametres_flux;
-
 
208
  }
166
                return $parametres_flux;
209
 
-
 
210
  private function traiterParametresModif() {
-
 
211
    $parametres_modif = array();
-
 
212
 
167
        }
213
    foreach ( $_POST as $id => $parametres ) {
-
 
214
      if ($parametres !== '' ) {
-
 
215
 
-
 
216
        $parametres_modif[$id] = $parametres;
-
 
217
      }
-
 
218
    }
168
 
219
 
-
 
220
    return $parametres_modif;
-
 
221
  }
-
 
222
 
-
 
223
  private function traiterDonneesFiles() {
-
 
224
    $files_descriptions = array(
-
 
225
      'info',
-
 
226
      'logo',
-
 
227
      'fond'
-
 
228
    );
-
 
229
    $return = array();
-
 
230
    $dossier_url = dirname(__FILE__) . '/squelettes/img/images_projets/' . $_POST['projet'] . '/';
-
 
231
    $transmettre_donnees = false;
169
        private function traiterParametresModif() {
232
 
-
 
233
    foreach ( array_keys( $_FILES ) as $file ) {
-
 
234
      if ( $_FILES[$file]['name'] !== '' ) {
-
 
235
 
-
 
236
        $transmettre_donnees = true;
-
 
237
        $is_help_file = strstr( $file, 'help-');
-
 
238
 
-
 
239
        if ( $file === 'especes' ) {
-
 
240
 
-
 
241
          $return['especes']['name'] = 'especes.csv';
-
 
242
          $return['especes']['type'] = $_FILES['especes']['type'];
-
 
243
        } elseif ( in_array( $file, $files_descriptions ) ) {
-
 
244
 
-
 
245
          $return['images_description'][$file]['type'] = $_FILES[$file]['type'];
170
                $parametres_modif = array(); 
246
          $return['images_description'][$file]['name'] = $file . strrchr( $_FILES[$file]['name'], '.' );
-
 
247
 
-
 
248
        } elseif ( $is_help_file ) {
-
 
249
 
-
 
250
          $real_file_key = str_replace( 'help-', '', $file );
-
 
251
          $return['images_aide'][$real_file_key]['type'] = $_FILES[$file]['type'];
-
 
252
          $return['images_aide'][$real_file_key]['name'] = $real_file_key . strrchr( $_FILES[$file]['name'], '.' );
-
 
253
        }
-
 
254
      }
-
 
255
    }
-
 
256
    if ( $transmettre_donnees ) {
-
 
257
      if( !is_dir( $dossier_url ) ) {
-
 
258
 
-
 
259
        mkdir( $dossier_url, 0755 );
-
 
260
      }
-
 
261
 
-
 
262
      if ( count( $return['especes'] ) > 0 ) {
-
 
263
        $this->televerser( 'especes', $return['especes']['name'], $dossier_url );
-
 
264
      }
-
 
265
 
-
 
266
      foreach ( array_keys( $return['images_description'] ) as $file ) {
-
 
267
        $this->televerser( $file, $return['images_description'][ $file ]['name'], $dossier_url );
-
 
268
      }
-
 
269
 
-
 
270
      foreach ( array_keys( $return['images_aide'] ) as $file ) {
-
 
271
        $this->televerser( 'help-' . $file, $return['images_aide'][ $file ]['name'], $dossier_url );
-
 
272
      }
-
 
273
 
-
 
274
 
-
 
275
    }
-
 
276
 
-
 
277
    return $return;
-
 
278
  }
-
 
279
 
-
 
280
  private function televerser( $file, $new_file_name, $dossier_url ) {
-
 
281
 
-
 
282
    $fichier = $new_file_name;
-
 
283
    $taille_maxi = 5242880;
-
 
284
    $taille = filesize( $_FILES[$file]['tmp_name'] );
-
 
285
    $extension = strrchr( $_FILES[$file]['name'], '.' );
-
 
286
    $extensions = array( '.png', '.gif', '.jpg', '.jpeg', '.csv' );
-
 
287
 
-
 
288
    //Début des vérifications de sécurité...
-
 
289
    if ( file_exists( $dossier_url . $new_file_name ) ) {
-
 
290
      if ( $_POST['mode'] === 'modification' ) {
-
 
291
 
-
 
292
        // Le fichier existe déjà, c'est normal si on est en mode modification
-
 
293
        unlink ( $dossier_url . $new_file_name );
-
 
294
      } else {
-
 
295
 
-
 
296
        $erreur =
-
 
297
          "<p class=\"message\" style=\"background-color: #f9e2d7;border-color: #eca27e;color: #9c4217;fill: #9c4217;border: 0.1rem solid;border-radius: 0.4rem;padding: 0.5rem; display: inline-block;margin: 1rem\"> Echec du téléchargement : ".
-
 
298
          "Un fichier image pour \"" . str_replace( $extension, '', $new_file_name ) . "\", dans un projet \"" . $_POST['projet'] . "\".</p>";
-
 
299
      }
-
 
300
    }
-
 
301
 
-
 
302
    if ( !in_array( $extension, $extensions ) ) {
-
 
303
 
-
 
304
      //Si le format n'est pas bon
-
 
305
      $erreur = '<p class="message" style="background-color: #f9e2d7;border-color: #eca27e;color: #9c4217;fill: #9c4217;border: 0.1rem solid;border-radius: 0.4rem;padding: 0.5rem; display: inline-block;margin: 1rem"> Echec du téléchargement, formats acceptés : png, gif, jpg, jpeg, ou csv</p>';
-
 
306
    }
-
 
307
 
-
 
308
    if ( $taille > $taille_maxi ) {
-
 
309
 
-
 
310
      $erreur = '<p class="message" style="background-color: #f9e2d7;border-color: #eca27e;color: #9c4217;fill: #9c4217;border: 0.1rem solid;border-radius: 0.4rem;padding: 0.5rem; display: inline-block;margin: 1rem"> Echec du téléchargement : Max 5Mo</p>';
-
 
311
    }
-
 
312
 
-
 
313
    if ( !isset( $erreur ) ) {
-
 
314
 
-
 
315
      // Formatage du nom du fichier
-
 
316
      $fichier = $this->remove_accents( $fichier );
-
 
317
      $fichier = preg_replace( '/([^.a-z0-9]+)/i', '-', $fichier );
-
 
318
 
-
 
319
//////////// C'est ici que ça merde à priori ///////////////////////////////////////////////////
-
 
320
var_dump($dossier_url . $fichier);
-
 
321
      if ( move_uploaded_file( $_FILES[$file]['tmp_name'], $dossier_url . $fichier ) ) {
-
 
322
      // move_uploaded_file() renvoie false si l'upload a échoué
-
 
323
 
-
 
324
        echo 'Téléchargement effectué avec succès';
-
 
325
      } else {
-
 
326
 
-
 
327
        echo '<p class="message" style="background-color: #f9e2d7;border-color: #eca27e;color: #9c4217;fill: #9c4217;border: 0.1rem solid;border-radius: 0.4rem;padding: 0.5rem; display: inline-block;margin: 1rem"> Echec du téléchargement</p>';
-
 
328
      }
-
 
329
    } else {
-
 
330
 
-
 
331
      echo $erreur;
-
 
332
    }
-
 
333
  }
-
 
334
 
-
 
335
  private function remove_accents( $string ) {
-
 
336
    if ( !preg_match( '/[\x80-\xff]/' , $string ) ) {
-
 
337
 
-
 
338
      return $string;
-
 
339
    }
-
 
340
 
-
 
341
    $chars = array(
-
 
342
      // Decompositions for Latin-1 Supplement
-
 
343
      chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
-
 
344
      chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
-
 
345
      chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
-
 
346
      chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
-
 
347
      chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
-
 
348
      chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
-
 
349
      chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
-
 
350
      chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
-
 
351
      chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
-
 
352
      chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
-
 
353
      chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
-
 
354
      chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
-
 
355
      chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
-
 
356
      chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
-
 
357
      chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
-
 
358
      chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
-
 
359
      chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
-
 
360
      chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
-
 
361
      chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
-
 
362
      chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
-
 
363
      chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
-
 
364
      chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
-
 
365
      chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
-
 
366
      chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
-
 
367
      chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
-
 
368
      chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
-
 
369
      chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
-
 
370
      chr(195).chr(191) => 'y',
-
 
371
      // Decompositions for Latin Extended-A
-
 
372
      chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
-
 
373
      chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
-
 
374
      chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
-
 
375
      chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
-
 
376
      chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
-
 
377
      chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
-
 
378
      chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
-
 
379
      chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
-
 
380
      chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
-
 
381
      chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
-
 
382
      chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
-
 
383
      chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
-
 
384
      chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
-
 
385
      chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
-
 
386
      chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
-
 
387
      chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
-
 
388
      chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
-
 
389
      chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
-
 
390
      chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
-
 
391
      chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
-
 
392
      chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
-
 
393
      chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
-
 
394
      chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
-
 
395
      chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
-
 
396
      chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
-
 
397
      chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
-
 
398
      chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
-
 
399
      chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
-
 
400
      chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
-
 
401
      chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
-
 
402
      chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
-
 
403
      chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
-
 
404
      chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
-
 
405
      chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
-
 
406
      chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
-
 
407
      chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
-
 
408
      chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
-
 
409
      chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
-
 
410
      chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
-
 
411
      chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
-
 
412
      chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
-
 
413
      chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
-
 
414
      chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
-
 
415
      chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
-
 
416
      chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
-
 
417
      chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
-
 
418
      chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
-
 
419
      chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
-
 
420
      chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
-
 
421
      chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
-
 
422
      chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
-
 
423
      chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
-
 
424
      chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
-
 
425
      chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
-
 
426
      chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
-
 
427
      chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
-
 
428
      chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
-
 
429
      chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
-
 
430
      chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
-
 
431
      chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
-
 
432
      chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
-
 
433
      chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
-
 
434
      chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
-
 
435
      chr(197).chr(190) => 'z', chr(197).chr(191) => 's'
171
                foreach ($_POST as $id => $parametres) {
436
    );
172
                        if ($parametres != "") {
437