Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 814 Rev 945
Line 386... Line 386...
386
		if (isset($_GET['debut'])) $this->start = $_GET['debut'];		
386
		if (isset($_GET['debut'])) $this->start = $_GET['debut'];		
387
		if (isset($_GET['limite'])) $this->limite = $_GET['limite'];
387
		if (isset($_GET['limite'])) $this->limite = $_GET['limite'];
Line 388... Line 388...
388
		
388
		
389
		// Construction de la requête
389
		// Construction de la requête
390
		$requete = 'SELECT * '.
390
		$requete = 'SELECT * '.
391
			'FROM cel_obs_images a '.
391
			'FROM cel_obs_images AS a '.
392
			'	INNER JOIN cel_inventory b '.
392
			'	INNER JOIN cel_inventory AS b '.
393
			'		ON (a.coi_ce_observation = b.ordre AND a.coi_ce_utilisateur = b.identifiant) '.
393
			'		ON (a.coi_ce_observation = b.ordre AND a.coi_ce_utilisateur = b.identifiant) '.
394
			'	INNER JOIN cel_images c '.
394
			'	INNER JOIN cel_images AS c '.
-
 
395
			'		ON (a.coi_ce_image = c.ci_id_image AND a.coi_ce_utilisateur = c.ci_ce_utilisateur) '. 
395
			'		ON (a.coi_ce_image = c.ci_id_image AND a.coi_ce_utilisateur = c.ci_ce_utilisateur) '. 
396
			'WHERE b.identifiant = c.ci_ce_utilisateur '.
396
			'WHERE '.(($this->etreFluxAdmin()) ? '' : ' b.transmission = 1  AND ').
-
 
397
			'	b.identifiant = c.ci_ce_utilisateur '.
397
			(($this->etreFluxAdmin()) ? '' : ' b.transmission = 1  AND ').
Line 398... Line 398...
398
			'	AND ';
398
			'	AND ';
399
		
399
		
400
		if ($this->estUneRechercheGenerale()) {
400
		if ($this->estUneRechercheGenerale()) {
Line 518... Line 518...
518
				$where .= " $i.cmc_id_proprietaire = ".$j.".cmc_id_proprietaire AND ";
518
				$where .= " $i.cmc_id_proprietaire = ".$j.".cmc_id_proprietaire AND ";
519
				$j++;
519
				$j++;
520
			}
520
			}
521
			$i++;
521
			$i++;
522
		}
522
		}
-
 
523
		$where = rtrim($where,' AND ');
523
		$where = rtrim($where,' AND '); $champs = rtrim($champs,' , '); $table = rtrim($table,' , ');
524
		$champs = rtrim($champs,' , ');
-
 
525
		$table = rtrim($table,' , ');
Line 524... Line 526...
524
		
526
		
525
		// Construction de la requête
527
		// Construction de la requête
526
		$prerequete = 	"SELECT $champs FROM $table WHERE $where ";
528
		$prerequete = 	"SELECT $champs FROM $table WHERE $where ";
527
		$elements = $this->executerRequete($prerequete);//print_r($elements);
529
		$elements = $this->executerRequete($prerequete);//print_r($elements);
Line 602... Line 604...
602
				$where .= " $i.cmc_id_proprietaire = ".$j.".cmc_id_proprietaire AND ";
604
				$where .= " $i.cmc_id_proprietaire = ".$j.".cmc_id_proprietaire AND ";
603
				$j++;
605
				$j++;
604
			}
606
			}
605
			$i++;
607
			$i++;
606
		}
608
		}
-
 
609
		$where = rtrim($where, ' AND ');
607
		$where = rtrim($where,' AND '); $champs = rtrim($champs,' , '); $table = rtrim($table,' , ');
610
		$champs = rtrim($champs, ' , ');
-
 
611
		$table = rtrim($table, ' , ');
Line 608... Line 612...
608
		
612
		
609
		// Construction de la requête
613
		// Construction de la requête
610
		$prerequete = 	"SELECT $champs FROM $table WHERE $where "; 
614
		$prerequete = 	"SELECT $champs FROM $table WHERE $where "; 
611
		$elements = $this->executerRequete($prerequete);//print_r($elements);
615
		$elements = $this->executerRequete($prerequete);//print_r($elements);