"; ?>
"; //if ($theme1!='' and $trouve==1) if ($trouve==1) { for($i=0;$i<$nbr;$i++) { $photo="$evenement/"; $video=0; $theme=""; $queryE = "SELECT * FROM ".$base."photo_evenement where code_evenement='$evenement'"; $resultE = mysql_query($queryE,$db); $rowE=mysql_fetch_array($resultE); $theme=$rowE["titre"]." + "; $rowP=mysql_fetch_array($resultP); if ($rowP["theme1"]!='') { $queryT = "SELECT * FROM ".$base."photo_theme where code_theme='".$rowP["theme1"]."' and code_evenement='$evenement'"; $resultT = mysql_query($queryT,$db); $rowT=mysql_fetch_array($resultT); $theme.=$rowT["titre"]; $photo.=$rowP["theme1"]; } if ($rowP["theme2"]!='') { $queryT = "SELECT * FROM ".$base."photo_theme where code_theme='".$rowP["theme1"].$rowP["theme2"]."'"; $resultT = mysql_query($queryT,$db); $rowT=mysql_fetch_array($resultT); $theme.=" + ".$rowT["titre"]; $photo.="/".$rowP["theme2"]; } if ($rowP["theme3"]!='') { $queryT = "SELECT * FROM ".$base."photo_theme where code_theme='".$rowP["theme1"].$rowP["theme2"].$rowP["theme3"]."'"; $resultT = mysql_query($queryT,$db); $rowT=mysql_fetch_array($resultT); $theme.=" + ".$rowT["titre"]; $photo.="/".$rowP["theme3"]; } if ($rowP["theme4"]!='') { $queryT = "SELECT * FROM ".$base."photo_theme where code_theme='".$rowP["theme1"].$rowP["theme2"].$rowP["theme3"].$rowP["theme4"]."'"; $resultT = mysql_query($queryT,$db); $rowT=mysql_fetch_array($resultT); $theme.=" + ".$rowT["titre"]; $photo.="/".$rowP["theme4"]; } if ($rowP["theme5"]!='') { $queryT = "SELECT * FROM ".$base."photo_theme where code_theme='".$rowP["theme1"].$rowP["theme2"].$rowP["theme3"].$rowP["theme4"].$rowP["theme5"]."'"; $resultT = mysql_query($queryT,$db); $rowT=mysql_fetch_array($resultT); $theme.=" + ".$rowT["titre"]; $photo.="/".$rowP["theme5"]; } $photo_sav=$photo; $photo.="/vignette/".$rowP["code_photo"]; if (file_exists($photo_sav."/vignette/".$rowP["code_photo"] )) { $taille_photo=$photo_sav."/vignette/".$rowP["code_photo"]; } if (file_exists($photo_sav."/bd/".$rowP["code_photo"] )) { $taille_photo=$photo_sav."/bd/".$rowP["code_photo"]; } if (file_exists($photo_sav."/hd/".$rowP["code_photo"] )) { $taille_photo=$photo_sav."/hd/".$rowP["code_photo"]; } $size = getimagesize($taille_photo, $info); if (isset($info["APP13"])) { $iptc = iptcparse($info["APP13"]); } $descriptif="".$rowP["designation"]."
$theme
".$rowP["designation1"]."
".$iptc['2#120'][0]; $taille=strlen($photo)-3; if (substr($photo,$taille,3)=="mp3" || substr($photo,$taille,3)=="wav" || substr($photo,$taille,3)=="mpg" || substr($photo,$taille,3)=="avi") { $photo_sav=substr($photo,0,$taille-1).".jpg"; $video=1; $size = getimagesize($photo_sav, $info); } if (substr($photo,$taille,3)=="ppt" || substr($photo,$taille,3)=="doc" || substr($photo,$taille,3)=="xls" || substr($photo,$taille,3)=="txt" || substr($photo,$taille,3)=="pdf") { $photo_sav="images/".substr($photo,$taille,3).".jpg"; $video=2; $size = getimagesize($photo_sav, $info); } $x=$size[0]; $y=$size[1]; $pourcentage=$y/$x; if ($pourcentage>1) {$x1=$x*93/$y; $y1=93;} if ($pourcentage==1) {$x1=93; $y1=93;} if ($pourcentage<1) {$x1=100; $y1=$y*100/$x;} $taille="width=$x1 and height=$y1"; $x1=$x+40; $y1=$y+30; echo " "; } } else { } echo "
 
Lancer la recherche
"; $trouve=0; $queryE = "SELECT * FROM ".$base."photo_evenement order by titre"; $resultE = mysql_query($queryE,$db); if (mysql_num_rows($resultE)!=0) { echo " "; $rech=" 1"; } if ($theme1=='') {$theme2='';$theme3='';$theme4='';$theme5='';} if ($theme2=='') {$theme3='';$theme4='';$theme5='';} if ($theme3=='') {$theme4='';$theme5='';} if ($theme4=='') {$theme5='';} if ($evenement=='') {$theme1='';} if ($evenement!='') { $a=0; $queryS = "SELECT * FROM ".$base."photo_theme where niveau=1 and code_evenement='$evenement' order by titre"; $resultS = mysql_query($queryS,$db); if (mysql_num_rows($resultS)!=0) { echo " "; $rech.=" and code_evenement='$evenement' "; } } if ($theme1!='') { $queryS2 = "SELECT * FROM ".$base."photo_theme where niveau=2 and SUBSTRING(photo_theme.code_theme,1,2)='$theme1' and code_evenement='$evenement' order by titre"; $resultS2 = mysql_query($queryS2,$db); if (mysql_num_rows($resultS2)!=0) { echo " "; } else {$trouve=1;} $rech.=" and theme1='$theme1'"; } if ($theme2!='') { $queryS3 = "SELECT * FROM ".$base."photo_theme where niveau=3 and SUBSTRING(photo_theme.code_theme,1,4)='$theme2' and code_evenement='$evenement' order by titre"; $resultS3 = mysql_query($queryS3,$db); if (mysql_num_rows($resultS3)!=0) { echo " "; } else {$trouve=1;} $rech.=" and theme2='".substr($theme2,2,2)."'"; } if ($theme3!='') { $queryS4 = "SELECT * FROM ".$base."photo_theme where niveau=4 and SUBSTRING(photo_theme.code_theme,1,6)='$theme3' and code_evenement='$evenement' order by titre"; $resultS4 = mysql_query($queryS4,$db); if (mysql_num_rows($resultS4)!=0) { echo " "; } else {$trouve=1;} $rech.=" and theme3='".substr($theme3,4,2)."'"; } if ($theme4!='') { $queryS5 = "SELECT * FROM ".$base."photo_theme where niveau=5 and SUBSTRING(photo_theme.code_theme,1,8)='$theme4' and code_evenement='$evenement' order by titre"; $resultS5 = mysql_query($queryS5,$db); if (mysql_num_rows($resultS5)!=0) { echo " "; } else {$trouve=1;} $rech.=" and theme4='".substr($theme4,6,2)."'"; } if ($theme5!='') { $rech.=" and theme5='".substr($theme5,8,2)."'"; $trouve=1;} if ($editeur!="") { $rech.=" and photographe like '%$editeur%'"; $trouve=1;} if ($descriptif!="") { $rech.=" and (designation like '%descriptif%' or designation1 like '%descriptif%')"; $trouve=1;} if ($libelle!="") { $rech.=" and (commentaire like '%$libelle%' or designation like '%$libelle%')"; $trouve=1;} if ($mot_clef!="") { if (strpos($mot_clef,";")==0 & strpos($mot_clef,",")==0) { $rech.= " and (mot_clef like '%$mot_clef%'"; $rech.=") "; $trouve=1; } if (strpos($mot_clef,",")>0) { list($mot[1],$mot[2],$mot[3],$mot[4],$mot[5])=split('[,]',$mot_clef); if ($mot[1]!="") {$rech.= " and (mot_clef like '%$mot[1]%'";} if ($mot[2]!="") {$rech.= " or mot_clef like '%$mot[2]%'";} if ($mot[3]!="") {$rech.= " or mot_clef like '%$mot[3]%'";} if ($mot[4]!="") {$rech.= " or mot_clef like '%$mot[4]%'";} if ($mot[5]!="") {$rech.= " or mot_clef like '%$mot[5]%'";} $rech.=") "; $trouve=1; } if (strpos($mot_clef,";")>0) { list($mot[1],$mot[2],$mot[3],$mot[4],$mot[5])=split('[;]',$mot_clef); if ($mot[1]!="") {$rech.= " and (mot_clef like '%$mot[1]%'";} if ($mot[2]!="") {$rech.= " and mot_clef like '%$mot[2]%'";} if ($mot[3]!="") {$rech.= " and mot_clef like '%$mot[3]%'";} if ($mot[4]!="") {$rech.= " and mot_clef like '%$mot[4]%'";} if ($mot[5]!="") {$rech.= " and mot_clef like '%$mot[5]%'";} $rech.=") "; $trouve=1; } } $queryP = "SELECT * FROM ".$base."photo_photo where $rech order by theme1, theme2, theme3, theme4, theme5"; $resultP = mysql_query($queryP,$db);$nombre=mysql_num_rows($resultP);$nbr=$nombre; if ($theme1=='') {$nombre.=" article(s) dans la base";} else {$nombre.=" photo(s) correspondantes";} echo "
  Recherche par : 
Titre 
Photographe    
Descriptif    
Mots clefs 
Evénement 
Thème 1 
Thème 2 
Thème 3 
Thème 4 
Thème 5 
  
 
Il y a $nombre
";} if ($video==1) {echo "cliquer sur la photo";} echo " "; if ($rowP["tarif"]=="p") { echo ""; } else { $image=str_replace("vignette","bd",$photo); $x=$x+20; $y=$y+25; echo ""; } $queryU = "SELECT * FROM ".$base."photo_utilisateur where code_utilisateur='".$rowP["photographe"]."'"; $resultU = mysql_query($queryU,$db); $rowU=mysql_fetch_array($resultU); echo "
         
"; if ($video==2) { $photo=str_replace("vignette","bd",$photo); echo ""; } if ($video==0 || $video==1) {echo "";} if ($video==0) {echo "Cliquer sur la vignette pour agrandir la photo   ".$rowP["code_photo"]."
$theme
".$rowP["titre"]."
".$rowP["descriptif1"]."
".$rowP["descriptif2"]."
   Voir les photos selectionnées en diaporama Détail de la photo Ajouter au panier Zoom de la photo Détail de la photo
 Photographe => ".$rowU["prenom"]." ".$rowU["nom"]." - ".$rowU["societe"]."