Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 1289 Rev 1299
Line 258... Line 258...
258
            '	LEFT JOIN cel_export AS co '.
258
            '	LEFT JOIN cel_export AS co '.
259
            '		ON (ci.ce_observation = co.id_observation) '.
259
            '		ON (ci.ce_observation = co.id_observation) '.
260
            'WHERE '.
260
            'WHERE '.
261
            "	co.nom_ret_nn IN ($numNom) ".
261
            "	co.nom_ret_nn IN ($numNom) ".
262
            '	AND ci.date_prise_de_vue != "0000-00-00" '.
262
            '	AND ci.date_prise_de_vue != "0000-00-00" '.
263
            '	AND co.nom_referentiel LIKE '.$this->Bdd->proteger($refTax.'%').' '.
263
					'	AND co.nom_referentiel = '.$this->Bdd->proteger($refTax).' '.
264
            '	ORDER BY ci.date_prise_de_vue ASC '.
264
            '	ORDER BY ci.date_prise_de_vue ASC '.
265
            'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
265
            'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
Line 266... Line 266...
266
        
266
        
Line 304... Line 304...
304
        '	co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
304
        '	co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
305
        '	co.nom_sel, co.nom_sel_nn, '.
305
        '	co.nom_sel, co.nom_sel_nn, '.
306
        '	ci.id_image AS id_img, co.date_observation AS date '.
306
        '	ci.id_image AS id_img, co.date_observation AS date '.
307
        (isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
307
        (isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
308
        'FROM cel_images_export AS ci'.
308
        'FROM cel_images_export AS ci'.
309
        '	LEFT JOIN cel_export AS co '.
309
			'	JOIN cel_export AS co '.
310
        '		ON (ci.ce_observation = co.id_observation) '.
310
        '		ON (ci.ce_observation = co.id_observation) '.
311
        $this->formerRequeteConditions($numNomListe).' '.
311
        $this->formerRequeteConditions($numNomListe).' '.
312
        'GROUP BY id_img '.
-
 
313
        $this->formerRequeteTri().
312
        $this->formerRequeteTri().
314
        "LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
313
        "LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
Line 315... Line 314...
315
        
314
        
316
        $this->infosImages = $this->Bdd->recupererTous($requete);
315
        $this->infosImages = $this->Bdd->recupererTous($requete);
Line 319... Line 318...
319
    private function formerRequeteConditions($numNomListe) {
318
    private function formerRequeteConditions($numNomListe) {
320
        $refTax = $this->parametres['referentiel'];
319
        $refTax = $this->parametres['referentiel'];
321
        $where[] = "  co.nom_ret_nn IN ($numNomListe) ";
320
        $where[] = "  co.nom_ret_nn IN ($numNomListe) ";
322
        // exclusion des noms à déterminer, douteux ou plantnet-mobile
321
        // exclusion des noms à déterminer, douteux ou plantnet-mobile
323
        $where[] = " ((co.mots_cles_texte not like '%aDeterminer%' AND co.mots_cles_texte not like '%plantnet-mobile%') OR co.mots_cles_texte IS null) ";
322
        $where[] = " ((co.mots_cles_texte not like '%aDeterminer%' AND co.mots_cles_texte not like '%plantnet-mobile%') OR co.mots_cles_texte IS null) ";
324
        $where[] = " co.nom_referentiel LIKE ".$this->Bdd->proteger($refTax."%").' ';
323
        $where[] = " co.nom_referentiel = ".$this->Bdd->proteger($refTax).' ';
Line 325... Line 324...
325
        
324
        
326
        return ' WHERE '.implode(' AND ', $where);
325
        return ' WHERE '.implode(' AND ', $where);
Line 327... Line 326...
327
    }
326
    }
Line 533... Line 532...
533
    private function formaterCommune($infos) {
532
    private function formaterCommune($infos) {
534
        $commune = array();
533
        $commune = array();
535
        if ($this->avoirContenu($infos['zone_geo'])) {
534
        if ($this->avoirContenu($infos['zone_geo'])) {
536
            $commune[] = $infos['zone_geo'];
535
            $commune[] = $infos['zone_geo'];
537
        }
536
        }
538
        if (isset($infos['ce_zone_geo']) && $this->avoirContenu($infos['ce_zone_geo']) && $infos['ce_zone_geo'] != 'INSEE-C:') {
537
        if (isset($infos['ce_zone_geo']) && $this->avoirContenu($infos['ce_zone_geo']) && $infos['ce_zone_geo'] != '') {
539
            $commune[] = '('.substr(str_replace('INSEE-C:','',$infos['ce_zone_geo']), 0, 2).')';
538
            $commune[] = '('.substr(str_replace('INSEE-C:','',$infos['ce_zone_geo']), 0, 2).')';
540
        }
539
        }
541
        return implode(' ', $commune);
540
        return implode(' ', $commune);
542
    }
541
    }
Line 550... Line 549...
550
        $nn = substr($this->parametres['masque.nn'], strpos($this->parametres['masque.nn'], ':') + 1);
549
        $nn = substr($this->parametres['masque.nn'], strpos($this->parametres['masque.nn'], ':') + 1);
551
        $referentiel = isset($this->parametres['masque.referentiel']) ? $this->parametres['masque.referentiel'] : '';
550
        $referentiel = isset($this->parametres['masque.referentiel']) ? $this->parametres['masque.referentiel'] : '';
552
        $and = $referentiel ? ' AND referentiel = ' . $this->Bdd->proteger($referentiel) : '';
551
        $and = $referentiel ? ' AND referentiel = ' . $this->Bdd->proteger($referentiel) : '';
Line 553... Line 552...
553
        
552
        
554
        $requete =  'SELECT referentiel, ce_image as id_img, organe '.
553
        $requete =  'SELECT referentiel, ce_image as id_img, organe '.
555
            'FROM tb_del_test.del_image_top '.
554
            'FROM tb_del.del_image_top '.
Line 556... Line 555...
556
            'WHERE nn = '. $this->Bdd->proteger($nn) . $and . ' -- ' . __FILE__ . ':' . __LINE__;
555
            'WHERE nn = '. $this->Bdd->proteger($nn) . $and . ' -- ' . __FILE__ . ':' . __LINE__;
Line 557... Line 556...
557
        
556