Subversion Repositories eFlore/Applications.cel

Rev

Rev 1304 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1304 Rev 1386
Line 64... Line 64...
64
		$informations_image['nom_utilisateur'] = $infos_utilisateur['nom'];
64
		$informations_image['nom_utilisateur'] = $infos_utilisateur['nom'];
65
		$informations_image['prenom_utilisateur'] = $infos_utilisateur['prenom'];
65
		$informations_image['prenom_utilisateur'] = $infos_utilisateur['prenom'];
Line 66... Line 66...
66
		
66
		
Line -... Line 67...
-
 
67
		$requete_insertion_infos_image = $this->construireRequeteInsertionImage($informations_image);
-
 
68
		
-
 
69
		// important ! ne pas utiliser la fonction executerRequete qui renvoie une erreur si la requete contient des | (pipes)
67
		$requete_insertion_infos_image = $this->construireRequeteInsertionImage($informations_image);
70
		// ce qui est fréquent dans les métadonnées 
Line 68... Line 71...
68
		
71
		// TODO: corriger la fonction ou bien continuer à utiliser executerRequeteSimple
69
		$resultat_insertion_infos_image = $this->executer($requete_insertion_infos_image);
72
		$resultat_insertion_infos_image = $this->executerRequeteSimple($requete_insertion_infos_image);
70
 
73
 
71
		if (!$resultat_insertion_infos_image) {
74
		if (!$resultat_insertion_infos_image) {
Line 95... Line 98...
95
	private function obtenirNouvelOrdrePourUtilisateur($id_utilisateur) {
98
	private function obtenirNouvelOrdrePourUtilisateur($id_utilisateur) {
Line 96... Line 99...
96
 
99
 
Line 97... Line 100...
97
		$nouvel_ordre = 0 ;
100
		$nouvel_ordre = 0 ;
98
		
101
		
Line 99... Line 102...
99
		$requete_selection_ordre_max ='SELECT MAX(ordre) as max_ordre FROM cel_images WHERE ce_utilisateur = '.$this->proteger($id_utilisateur) ;
102
		$requete_selection_ordre_max ='SELECT MAX(ordre) as max_ordre FROM cel_images WHERE ce_utilisateur = '.$this->proteger($id_utilisateur) ;
100
		$resultat_requete_ordre_max = $this->requeter($requete_selection_ordre_max);
103
		$resultat_requete_ordre_max = $this->executerRequete($requete_selection_ordre_max);
101
						
104
						
102
		if($resultat_requete_ordre_max !== false) {
105
		if($resultat_requete_ordre_max !== false) {
Line 110... Line 113...
110
	private function obtenirIdImagePourIdentifiantEtOrdre($id_utilisateur, $ordre) {
113
	private function obtenirIdImagePourIdentifiantEtOrdre($id_utilisateur, $ordre) {
Line 111... Line 114...
111
		
114
		
Line 112... Line 115...
112
		$id_image = false;
115
		$id_image = false;
113
		
116
		
Line 114... Line 117...
114
		$requete_id_image ='SELECT id_image FROM cel_images WHERE ce_utilisateur = '.$this->proteger($id_utilisateur).' AND ordre = '.$ordre ;
117
		$requete_id_image ='SELECT id_image FROM cel_images WHERE ce_utilisateur = '.$this->proteger($id_utilisateur).' AND ordre = '.$ordre ;
115
		$resultat_id_image = $this->requeter($requete_id_image);
118
		$resultat_id_image = $this->executerRequete($requete_id_image);
116
 
119
 
117
        if (count($resultat_id_image) > 0)
120
        if (count($resultat_id_image) > 0)
Line 171... Line 174...
171
		$requete_mise_a_jour_image .= $champs_a_mettre_a_jour;
174
		$requete_mise_a_jour_image .= $champs_a_mettre_a_jour;
Line 172... Line 175...
172
 
175
 
173
		$requete_mise_a_jour_image .= ' WHERE id_image = '.$this->proteger($id_image).
176
		$requete_mise_a_jour_image .= ' WHERE id_image = '.$this->proteger($id_image).
Line 174... Line 177...
174
									  ' AND ce_utilisateur = '.$this->proteger($utilisateur);
177
									  ' AND ce_utilisateur = '.$this->proteger($utilisateur);
Line 175... Line 178...
175
 
178
 
176
		$resultat_mise_a_jour = $this->executer($requete_mise_a_jour_image);
179
		$resultat_mise_a_jour = $this->executerRequeteSimple($requete_mise_a_jour_image);
Line 177... Line 180...
177
		
180
		
Line 225... Line 228...
225
		
228
		
226
		$requete_selection_ids_images = 'SELECT id_image FROM cel_images WHERE '.
229
		$requete_selection_ids_images = 'SELECT id_image FROM cel_images WHERE '.
227
												'ce_utilisateur = '.$this->proteger($id_utilisateur).' '.
230
												'ce_utilisateur = '.$this->proteger($id_utilisateur).' '.
Line 228... Line 231...
228
												'AND ordre IN ('.$ids_images.') ';
231
												'AND ordre IN ('.$ids_images.') ';
229
					
232
					
230
		$tableau_ids_images = $this->requeter($requete_selection_ids_images);
233
		$tableau_ids_images = $this->executerRequete($requete_selection_ids_images);
231
		$chaine_ids_images = '';
234
		$chaine_ids_images = '';
232
		foreach($tableau_ids_images as $id_image) {
235
		foreach($tableau_ids_images as $id_image) {
Line 250... Line 253...
250
		$requete_suppression_images = "DELETE FROM cel_images WHERE id_image in (".$chaine_ids_images.")";
253
		$requete_suppression_images = "DELETE FROM cel_images WHERE id_image in (".$chaine_ids_images.")";
Line 251... Line 254...
251
		
254
		
252
		$requete_suppression_lien_images_obs = "DELETE FROM cel_obs_images WHERE id_image in (".$chaine_ids_images.")";
255
		$requete_suppression_lien_images_obs = "DELETE FROM cel_obs_images WHERE id_image in (".$chaine_ids_images.")";
Line 253... Line 256...
253
		$requete_suppression_lien_images_mots_cles = "DELETE FROM cel_images_mots_cles WHERE id_image in (".$chaine_ids_images.")";
256
		$requete_suppression_lien_images_mots_cles = "DELETE FROM cel_images_mots_cles WHERE id_image in (".$chaine_ids_images.")";
254
		
257
		
255
		$resultat_suppression_image = $this->executer($requete_suppression_images);
258
		$resultat_suppression_image = $this->executerRequeteSimple($requete_suppression_images);
Line 256... Line 259...
256
		$resultat_suppression_lien_images_obs = $this->executer($requete_suppression_lien_images_obs);
259
		$resultat_suppression_lien_images_obs = $this->executerRequeteSimple($requete_suppression_lien_images_obs);
257
		$resultat_suppression_lien_images_mots_cles = $this->executer($requete_suppression_lien_images_mots_cles);
260
		$resultat_suppression_lien_images_mots_cles = $this->executerRequeteSimple($requete_suppression_lien_images_mots_cles);
258
		
261
		
259
		if ($resultat_suppression_image === false) {
262
		if ($resultat_suppression_image === false) {