Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 755 Rev 838
Line 40... Line 40...
40
		} else {
40
		} else {
41
			$this->messages[] = "Vous devez indiquer un type de mode d'interrogation.";
41
			$this->messages[] = "Vous devez indiquer un type de mode d'interrogation.";
42
		}
42
		}
Line 43... Line 43...
43
 
43
 
44
		if (is_null($retour)) {
44
		if (is_null($retour)) {
45
			$contenu = 'Un problème est survenu : '.print_r($this->messages, true);
-
 
46
		} else {
-
 
47
			$contenu = $retour;
45
			$this->messages[] = "Un problème est survenu lors de l'appel au service CelImage";
48
		}
-
 
49
				
-
 
50
		// Envoi sur la sortie standard
-
 
51
		$mime = 'text/html';
-
 
52
		$encodage = 'UTF-8';
-
 
53
		$formatage_json = (isset($retour)) ? true : false;
46
		}
54
		$this->envoyer($contenu, $mime, $encodage, $formatage_json);
47
		$this->envoyerJson($retour);
Line 55... Line 48...
55
	}
48
	}
56
 
49
 
57
	/**
50
	/**
58
	 * Carte par défaut
51
	 * Carte par défaut
59
	 */
52
	 */
60
	private function getListeIds() {
53
	private function getListeIds() {
61
		$ids = array();
54
		$ids = array();
62
		if (isset($_GET['obsId'])) {
-
 
63
			$observations = explode(',', $_GET['obsId']);
-
 
64
			$obsIds = null;
-
 
65
			foreach ($observations as $obs) {
-
 
Line 66... Line 55...
66
				$obsIds[] = $this->bdd->quote($obs);
55
		if (isset($_GET['obsId'])) {
67
			}
56
			$observations = $this->traiterValeursMultiples($_GET['obsId']);
68
			
57
			
69
			if (! is_null($obsIds)) {
58
			if (! is_null($observations)) {
70
				$requete = 	'SELECT ci.id, cim.ci_id_image '.
59
				$requete = 	'SELECT ci.id, cim.ci_id_image '.
71
							'FROM cel_inventory AS ci  '.
60
							'FROM cel_inventory AS ci  '.
72
							'	LEFT JOIN cel_obs_images AS coi '.
61
							'	LEFT JOIN cel_obs_images AS coi '.
73
							'		ON (coi.coi_ce_observation = ci.ordre AND coi.coi_ce_utilisateur = ci.identifiant) '.
62
							'		ON (coi.coi_ce_observation = ci.ordre AND coi.coi_ce_utilisateur = ci.identifiant) '.
74
							'	LEFT JOIN cel_images AS cim '.
63
							'	LEFT JOIN cel_images AS cim '.
Line 75... Line 64...
75
							'		ON (coi.coi_ce_image = cim.ci_id_image) '.
64
							'		ON (coi.coi_ce_image = cim.ci_id_image) '.
-
 
65
							"WHERE ci.id IN ($observations) ";
76
							'WHERE ci.id IN ('.implode(',', $obsIds).') ';
66
				$infos = $this->requeter($requete);
-
 
67
				
77
				$infos = $this->executerRequete($requete);
68
				foreach ($infos as $info) {
78
				
69
					if ($info['ci_id_image'] != 0) {
79
				foreach ($infos as $info) {
70
						$ids[$info['id']][] = (int) $info['ci_id_image'];
80
					$ids[$info['id']][] = (int) $info['ci_id_image'];
71
					}
81
				}
72
				}