Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1326 → Rev 1327

/trunk/jrest/services/InventoryImportExcel.php
363,7 → 363,7
// creation lien image
foreach ($info_image as $pic) {
$requete_liaison = 'INSERT INTO cel_obs_images (id_image, id_utilisateur, id_observation ) VALUES ('.$this->proteger($pic['id_image']).','.$this->proteger($utilisateur).', '.$id_obs.') ON DUPLICATE KEY UPDATE id_image = id_image ';
$requete_liaison = 'INSERT INTO cel_obs_images (id_image, id_observation ) VALUES ('.$this->proteger($pic['id_image']).', '.$id_obs.') ON DUPLICATE KEY UPDATE id_image = id_image ';
$liaison = $this->executer($requete_liaison);
if ($liaison !== false) {
$this->cpt_images_liees++;
380,7 → 380,7
$info_image=$this->traiterImage($line[IMAGE][$i],$utilisateur); // Image separee par des / + utilisateur
// creation lien image
foreach ($info_image as $pic) {
$requete = 'INSERT INTO cel_obs_images (id_image, id_utilisateur, id_observation) VALUES ('.$this->proteger($pic['id_image']).','.$this->proteger($utilisateur).', '.$this->proteger($id_obs).') ON DUPLICATE KEY UPDATE id_image = id_image' ;
$requete = 'INSERT INTO cel_obs_images (id_image, id_observation) VALUES ('.$this->proteger($pic['id_image']).', '.$this->proteger($id_obs).') ON DUPLICATE KEY UPDATE id_image = id_image' ;
$resultat_liaison = $this->executer($requete);
if ($resultat_liaison !== false) {
$this->cpt_images_liees++;
504,6 → 504,7
$liste_images = explode("/",$images) ;
$row =array();
foreach($liste_images as $image) {
$image = remove_accent(fix_latin($image));
$requete = "SELECT * FROM cel_images WHERE ce_utilisateur = ".$this->proteger($utilisateur)." AND nom_original= ".$this->proteger($image);
$ligne = $this->requeter($requete);
if(is_array($ligne) && !empty($ligne)) {
/trunk/jrest/services/InventoryImageLink.php
48,9 → 48,9
{
foreach($ids_observations_liste as $observation)
{
$requete_creation_lien = 'INSERT INTO cel_obs_images (id_image, id_utilisateur, id_observation, date_liaison) '.
$requete_creation_lien = 'INSERT INTO cel_obs_images (id_image, id_observation, date_liaison) '.
'VALUES '.
'('.$this->proteger($image).','.$this->proteger($utilisateur).','.$this->proteger($observation).', NOW()) '.
'('.$this->proteger($image).','.$this->proteger($observation).', NOW()) '.
'ON DUPLICATE KEY UPDATE id_image = id_image' ;
$resultat_creation_lien = $this->executer($requete_creation_lien);
96,13 → 96,12
'SELECT id_image '.
'FROM cel_obs_images '.
'WHERE id_observation = '.$this->proteger($value).' '.
'AND id_utilisateur = '.$this->proteger($uid[0]).' '.
')';
}
else
{
$column = 'id_observation' ;
$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]).' ' ;
$requete_selection_liaison = 'SELECT * from cel_obs WHERE id_observation IN (SELECT '.$column.' FROM cel_obs_images WHERE '.$field.' = '.$this->proteger($value).') ' ;
}
 
}
143,7 → 142,7
if (isset($id)) {
$requete_suppression_lien = "DELETE FROM cel_obs_images ".
"WHERE id_image IN (".$id_img.") ".
"AND id_observation IN (".$id_obs.") AND id_utilisateur = '".$id."'" ;
"AND id_observation IN (".$id_obs.") " ;
}
 
$resultat_suppression_lien = $this->executer($requete_suppression_lien);