Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 995 Rev 1020
Line 210... Line 210...
210
		$requete_maj_champs = rtrim($requete_maj_champs,' , ') ;
210
		$requete_maj_champs = rtrim($requete_maj_champs,' , ') ;
Line 211... Line 211...
211
		
211
		
212
		return $requete_maj_champs;
212
		return $requete_maj_champs;
Line 213... Line 213...
213
	}
213
	}
Line 214... Line 214...
214
	
214
	
215
	public function supprimerImage($id_utilisateur, $ordre_image_ou_tableau) {
215
	public function supprimerImageParOrdre($id_utilisateur, $ordre_image_ou_tableau) {
216
		
216
		
217
		if(is_array($ordre_image_ou_tableau)) {
217
		if(is_array($ordre_image_ou_tableau)) {
218
			$id_image_ou_tableau = array_map(array($this,'proteger'),$ordre_image_ou_tableau);
218
			$id_image_ou_tableau = array_map(array($this,'proteger'),$ordre_image_ou_tableau);
219
			$ids_images = implode(',',$ordre_image_ou_tableau);
219
			$ids_images = implode(',',$ordre_image_ou_tableau);
Line 220... Line 220...
220
		} else {
220
		} else {
221
			$ids_images = $this->proteger($ordre_image_ou_tableau);
221
			$ids_images = $this->proteger($ordre_image_ou_tableau);
222
		}
222
		}
223
		
223
		
224
		$requete_selection_ids_images = 'SELECT id_image FROM cel_images WHERE '.
224
		$requete_selection_ids_images = 'SELECT id_image FROM cel_images WHERE '.
225
										'ce_utilisateur = '.$this->proteger($id_utilisateur).' '.
225
												'ce_utilisateur = '.$this->proteger($id_utilisateur).' '.
226
										'AND ordre IN ('.$ids_images.') ';
226
												'AND ordre IN ('.$ids_images.') ';
227
							
227
					
228
		$tableau_ids_images = $this->requeter($requete_selection_ids_images);	
228
		$tableau_ids_images = $this->requeter($requete_selection_ids_images);
Line 229... Line 229...
229
		$chaine_ids_images = '';
229
		$chaine_ids_images = '';
230
		foreach($tableau_ids_images as $id_image) {
230
		foreach($tableau_ids_images as $id_image) {
-
 
231
			$chaine_ids_images .= $id_image['id_image'];
-
 
232
		}
-
 
233
		
-
 
234
		$chaine_ids_images = rtrim($chaine_ids_images,',');
-
 
235
		
-
 
236
		return $this->supprimerImage($id_utilisateur, $ordre_image_ou_tableau);
-
 
237
	}
-
 
238
	
-
 
239
	public function supprimerImage($id_utilisateur, $id_image_ou_tableau) {
-
 
240
		
-
 
241
		if(is_array($id_image_ou_tableau)) {
-
 
242
			$id_image_ou_tableau = array_map(array($this,'proteger'),$id_image_ou_tableau);
231
			$chaine_ids_images .= $id_image['id_image'];
243
			$chaine_ids_images = implode(',',$id_image_ou_tableau);
-
 
244
		} else {
232
		}							
245
			$chaine_ids_images = $this->proteger($id_image_ou_tableau);
233
		
246
		}
Line 234... Line 247...
234
		$chaine_ids_images = rtrim($chaine_ids_images,',');
247
						
235
				
248
		$requete_suppression_images = "DELETE FROM cel_images WHERE id_image in (".$chaine_ids_images.")";