Subversion Repositories eFlore/Applications.del

Rev

Rev 2174 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2174 Rev 2202
Line 24... Line 24...
24
	private $navigation;
24
	private $navigation;
25
	private $bdd;
25
	private $bdd;
Line 26... Line 26...
26
 
26
 
27
	private $parametres = array();
27
	private $parametres = array();
28
	private $ressources = array();
-
 
29
	private $date_defaut = '1900-01-01';
28
	private $ressources = array();
30
	private $ordre_defaut = 'asc';
29
	private $ordre_defaut = 'asc';
31
	private $idsObsImg = array();
30
	private $idsObsImg = array();
Line 52... Line 51...
52
	public function consulter($ressources, $parametres) {
51
	public function consulter($ressources, $parametres) {
53
		// initialiserRessourcesEtParametres()
52
		// initialiserRessourcesEtParametres()
54
		$this->ressources = $ressources;
53
		$this->ressources = $ressources;
55
		$this->parametres = $parametres;
54
		$this->parametres = $parametres;
Line -... Line 55...
-
 
55
 
-
 
56
		if (!isset($parametres['date.debut'])) {
-
 
57
			$this->parametres['date.debut'] = '1900-01-01';
-
 
58
		}
56
 
59
 
57
		if (!isset($parametres['date'])) {
60
		if (!isset($parametres['date.fin'])) {
58
			$this->parametres['date'] = $this->date_defaut;
61
			$this->parametres['date.fin'] = date('Y-m-d');
Line 59... Line 62...
59
		}
62
		}
60
 
63
 
61
		if (! isset($parametres['ordre'])) {
64
		if (! isset($parametres['ordre'])) {
Line 90... Line 93...
90
	/*-------------------------------------------------------------------------------
93
	/*-------------------------------------------------------------------------------
91
								CHARGEMENT DES IMAGES
94
								CHARGEMENT DES IMAGES
92
	--------------------------------------------------------------------------------*/
95
	--------------------------------------------------------------------------------*/
Line 93... Line 96...
93
 
96
 
94
	private function getIdsObsImg() {
97
	private function getIdsObsImg() {
-
 
98
		$date_debut = "'{$this->parametres['date.debut']}'";
95
		$date_debut = "'{$this->parametres['date']}'";
99
		$date_fin = "'{$this->parametres['date.fin']}'";
96
		$limite = @min(intval($this->parametres['navigation.limite']), 1000);
100
		$limite = @min(intval($this->parametres['navigation.limite']), 1000);
97
		$limite = $limite ? $limite : 100; // 0 => 10
101
		$limite = $limite ? $limite : 100; // 0 => 10
98
		$depart = intval(@$this->parametres['navigation.depart']);
102
		$depart = intval(@$this->parametres['navigation.depart']);
Line 105... Line 109...
105
			'modif_date '.
109
			'modif_date '.
Line 106... Line 110...
106
 
110
 
107
			'FROM del_plantnet AS p '.
111
			'FROM del_plantnet AS p '.
108
			'	JOIN del_observation_modif_date '.
112
			'	JOIN del_observation_modif_date '.
109
			'		ON (p.id_observation = del_observation_modif_date.id_observation '.
113
			'		ON (p.id_observation = del_observation_modif_date.id_observation '.
-
 
114
			'		AND modif_date >= '.date('U', strtotime($date_debut)).') '.
110
			'		AND modif_date >= '.$date_debut.') '.
115
			'		AND modif_date <= '.date('U', strtotime($date_fin)).') '.
111
			'	LEFT JOIN del_image_vote AS iv '.
116
			'	LEFT JOIN del_image_vote AS iv '.
112
			'		ON (id_image = iv.ce_image AND iv.ce_protocole = 3) '.
117
			'		ON (id_image = iv.ce_image AND iv.ce_protocole = 3) '.
113
			'	LEFT JOIN del_image_tag AS it '.
118
			'	LEFT JOIN del_image_tag AS it '.
114
			'		ON (id_image = it.ce_image AND it.actif = 1) '.
119
			'		ON (id_image = it.ce_image AND it.actif = 1) '.