Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1895 Rev 1897
Line 28... Line 28...
28
		// Pré traitement des paramêtres
28
		// Pré traitement des paramêtres
29
		$p = $this->traiterParametresUrl(array('id_collection','source'), $param);
29
		$p = $this->traiterParametresUrl(array('id_collection','source'), $param);
Line 30... Line 30...
30
		
30
		
31
		// Construction de la requête
31
		// Construction de la requête
32
		$requete = 	(($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
32
		$requete = 	(($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
33
					'	ccapu.*, cpu.* '.
33
					'	ccapu.*, cpu.*, cs.* '.
34
					'FROM coel_collection_a_publication AS ccapu '.
34
					'FROM coel_collection_a_publication AS ccapu '.
35
					'	LEFT JOIN coel_meta_historique_ligne ON (ccapu_ce_meta = cmhl_id_historique_ligne) '.
35
					'	LEFT JOIN coel_meta_historique_ligne ON (ccapu_ce_meta = cmhl_id_historique_ligne) '.
-
 
36
					'	LEFT JOIN coel_publication AS cpu ON (ccapu_id_publication = cpu_id_publication) '.
36
					'	LEFT JOIN coel_publication AS cpu ON (ccapu_id_publication = cpu_id_publication) '.
37
					'	LEFT JOIN coel_structure AS cs ON (cs_id_structure = cpu_ce_truk_editeur) '.
37
					((count($p) != 0) ? 'WHERE ' : '').
38
					((count($p) != 0) ? 'WHERE ' : '').
38
					(isset($p['id_collection']) 	? "AND ccapu_id_collection = {$p['id_collection']} " : '').	
39
					(isset($p['id_collection']) 	? "AND ccapu_id_collection = {$p['id_collection']} " : '').	
39
					(isset($p['source']) 	? "AND ccapu_source = {$p['source']} " : '').
40
					(isset($p['source']) 	? "AND ccapu_source = {$p['source']} " : '').
40
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'ccapu_ce_meta DESC').' ';
41
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'ccapu_ce_meta DESC').' ';
41
		$requete = str_replace('WHERE AND', 'WHERE', $requete);
42
		$requete = str_replace('WHERE AND', 'WHERE', $requete);
42
		$requeteCount = $requete;
43
		$requeteCount = $requete;
-
 
44
		$requete .= "LIMIT $this->start, $this->limit ";
43
		$requete .= "LIMIT $this->start, $this->limit ";
45
		
44
		//echo $requete;exit;
46
		//echo $requete;exit;
45
		// Récupération des résultats
47
		// Récupération des résultats
46
		try {
48
		try {
47
			$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
49
			$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);