Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 761 Rev 874
Line 1... Line 1...
1
<?php
1
<?php
2
 
-
 
3
Class InventoryImageListPublic extends Cel {
2
class InventoryImageListPublic extends Cel {
Line 4... Line 3...
4
		
3
		
5
	private $criteres = array('mots-cles' => 'c.ci_meta_mots_cles', 
4
	private $criteres = array('tag' => 'c.ci_meta_mots_cles', 
6
							'auteur' => 'c.ci_ce_utilisateur', 
5
							'auteur' => 'c.ci_ce_utilisateur', 
7
							'commune' => 'b.location', 
6
							'commune' => 'b.location', 
8
							'dept' => 'b.id_location',
7
							'dept' => 'b.id_location',
Line 48... Line 47...
48
		
47
		
49
		if(isset($_GET['limit'])) {
48
		if(isset($_GET['limit'])) {
50
			$this->limit = $_GET['limit'];
49
			$this->limit = $_GET['limit'];
Line -... Line 50...
-
 
50
		}
51
		}
51
		
52
		
52
		
Line 53... Line 53...
53
		// Construction de la requête
53
		// Construction de la requête
Line 231... Line 231...
231
	}
231
	}
Line 232... Line 232...
232
	
232
	
233
		
233
		
234
	private function creerSousRequeteMotsCles($mot_cle) {
234
	private function creerSousRequeteMotsCles($mot_cle) {
235
        $requete = '';
235
        $requete = '';
236
        if (preg_match('/.*,.*/', $mot_cle)) {
236
        if (preg_match('/.*OU.*/', $mot_cle)) {
237
            $requete = $this->creerSousRequeteMotsClesOu($mot_cle);
237
            $requete = $this->creerSousRequeteMotsClesOu($mot_cle);
238
        } else if (preg_match('/.*ET.*/', $mot_cle)) {
238
        } else if (preg_match('/.*ET.*/', $mot_cle)) {
239
            $requete = $this->creerSousRequeteMotsClesEt($mot_cle);
239
            $requete = $this->creerSousRequeteMotsClesEt($mot_cle);
Line 254... Line 254...
254
    }
254
    }
Line 255... Line 255...
255
   
255
   
256
    private function creerSousRequeteMotsClesOu($mot_cle) {
256
    private function creerSousRequeteMotsClesOu($mot_cle) {
Line 257... Line 257...
257
        $requete = '';
257
        $requete = '';
258
       
258
       
259
        $tab_mots_cles = explode(',', $mot_cle);
259
        $tab_mots_cles = explode('OU', $mot_cle);
260
        $where = '';
260
        $where = '';
261
        foreach ($tab_mots_cles as $mot) {
261
        foreach ($tab_mots_cles as $mot) {
262
            $where .= 'cmc_id_mot_cle_general = '.$this->proteger($this->encoderMotCle($mot)).' OR ';
262
            $where .= 'cmc_id_mot_cle_general = '.$this->proteger($this->encoderMotCle($mot)).' OR ';