Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1308 Rev 1327
Line 46... Line 46...
46
 
46
 
47
		foreach($ids_images_liste as $image)
47
		foreach($ids_images_liste as $image)
48
		{
48
		{
49
			foreach($ids_observations_liste as $observation)
49
			foreach($ids_observations_liste as $observation)
50
			{
50
			{
51
				$requete_creation_lien = 'INSERT INTO cel_obs_images (id_image, id_utilisateur, id_observation, date_liaison) '.
51
				$requete_creation_lien = 'INSERT INTO cel_obs_images (id_image, id_observation, date_liaison) '.
52
					   	 'VALUES '. 
52
					   	 'VALUES '. 
53
						 '('.$this->proteger($image).','.$this->proteger($utilisateur).','.$this->proteger($observation).', NOW()) '.
53
						 '('.$this->proteger($image).','.$this->proteger($observation).', NOW()) '.
Line 54... Line 54...
54
						 'ON DUPLICATE KEY UPDATE id_image = id_image' ;
54
						 'ON DUPLICATE KEY UPDATE id_image = id_image' ;
Line 55... Line 55...
55
				
55
				
Line 94... Line 94...
94
						 'FROM cel_images '.
94
						 'FROM cel_images '.
95
						 'WHERE id_image IN ( '.
95
						 'WHERE id_image IN ( '.
96
						 	'SELECT id_image '.
96
						 	'SELECT id_image '.
97
							'FROM cel_obs_images '.						 	
97
							'FROM cel_obs_images '.						 	
98
							'WHERE id_observation = '.$this->proteger($value).' '.
98
							'WHERE id_observation = '.$this->proteger($value).' '.
99
							'AND id_utilisateur = '.$this->proteger($uid[0]).' '.
-
 
100
						 ')';
99
						 ')';
101
			}
100
			}
102
			else
101
			else
103
			{
102
			{
104
				$column = 'id_observation' ;
103
				$column = 'id_observation' ;
105
				$requete_selection_liaison = 'SELECT * from cel_obs WHERE id_observation IN (SELECT '.$column.' FROM cel_obs_images WHERE '.$field.' = '.$this->proteger($value).') AND ce_utilisateur = '.$this->proteger($uid[0]).' ' ;
104
				$requete_selection_liaison = 'SELECT * from cel_obs WHERE id_observation IN (SELECT '.$column.' FROM cel_obs_images WHERE '.$field.' = '.$this->proteger($value).') ' ;
106
			}
105
			}
Line 107... Line 106...
107
 
106
 
Line 108... Line 107...
108
		}
107
		}
Line 141... Line 140...
141
		$id = $uid[0] ;
140
		$id = $uid[0] ;
Line 142... Line 141...
142
 
141
 
143
		if (isset($id)) {
142
		if (isset($id)) {
144
	           	$requete_suppression_lien = "DELETE FROM cel_obs_images ".
143
	           	$requete_suppression_lien = "DELETE FROM cel_obs_images ".
145
											"WHERE id_image IN (".$id_img.") ".
144
											"WHERE id_image IN (".$id_img.") ".
146
											"AND id_observation IN (".$id_obs.") AND id_utilisateur = '".$id."'" ;
145
											"AND id_observation IN (".$id_obs.") " ;
Line 147... Line 146...
147
		}
146
		}
Line 148... Line 147...
148
 
147