<?php
session_start();   $idMin=$_GET['idMin']; if (! is_numeric($idMin)) exit(); $nbResult=$_GET['nbResult']; if (! is_numeric($nbResult)) exit(); $nbPhotos=$_GET['nbPhotos']; if (! is_numeric($nbPhotos)) exit();  if (isset($_GET['chrono'])) { if ($_GET['chrono']=='date') $_SESSION['SESS_CHRONO']='date'; else $_SESSION['SESS_CHRONO']='rand';   $chrono=$_SESSION['SESS_CHRONO'];  } else  if (isset($_SESSION['SESS_CHRONO'])) $chrono = $_SESSION['SESS_CHRONO']; else $chrono = 'rand';   if (isset($_SESSION['SESS_LOGIN'])) $login=$_SESSION['SESS_LOGIN']; else $login='public';   include("fotoweb77.php"); include("script_outils.php"); include("fotoweb57.php");  $niveau = '0';   $tabPhotosPage=array();    if ($chrono == 'date' || !isset($_SESSION['picinfo'])){  if ($login=='public' || $niveau == '0') { $querySelect = "SELECT id,nom,repertoire,prive,dateOriginale FROM image,theme  WHERE  image.codeTheme=theme.codeTheme AND prive='0'AND bestof='1' ORDER BY dateOriginale,nom ASC LIMIT ".$idMin.",".$nbPhotos; } else { if($niveau == '1') $querySelect = "SELECT id,nom,codeTheme,prive,dateOriginale FROM image WHERE bestof='1' AND prive!='2' ORDER BY 'dateOriginale','nom' LIMIT ".$idMin.",".$nbPhotos; else if($niveau == '2') $querySelect = "SELECT id,nom,codeTheme,prive,dateOriginale FROM image WHERE bestof='1' ORDER BY 'dateOriginale','nom' ASC LIMIT ".$idMin.",".$nbPhotos; }  $resultSelect = mysql_query ($querySelect) or die ("La requête de sélection des photos a échouée ".$querySelect);  $imax = mysql_num_rows($resultSelect);  for( $i = 0; $i < $imax; $i++) { $tabPhotosPage[] = mysql_fetch_array($resultSelect); } mysql_free_result($resultSelect);  } else{  $picinfo=$_SESSION['picinfo']; for( $i = $idMin; ($i < $nbPhotos+$idMin) && ($i<sizeof($picinfo)); $i++) $tabPhotosPage[]=$picinfo[$i];  } $nbPage=ceil($nbResult/$nbPhotos); ?>  <head> <link rel='stylesheet' href='ergonomie/style.css'> <script language='javascript' src='script/script.js'></script> </head> <body> <?php
echo "<table class='operation' border='0' align='center'>"; for( $i = 0; $i < sizeof($tabPhotosPage); $i++) { $id = $tabPhotosPage[$i]['id']; $nom = $tabPhotosPage[$i]['nom']; $rep = $tabPhotosPage[$i]['repertoire']; $prive = $tabPhotosPage[$i]['prive']; $path = ""; if($prive == 2) { $path = "../".$rep."/vip/".getNomMiniature($nom); $pathPhoto = "../".$rep."/vip/".$nom; } if($prive == 1) { $path = "../".$rep."/prive/".getNomMiniature($nom); $pathPhoto = "../".$rep."/prive/".$nom; } if($prive == 0) { $path = "../".$rep."/".getNomMiniature($nom); $pathPhoto = "../".$rep."/".$nom; } $comment = str_replace("'","&#39",getTitreIptc($pathPhoto)); echo "<tr>"; echo 	"<td align='center' title='".$comment."'>"; echo 		"<img border='1' src='$path'  alt='".$comment."' class='lienImage' onClick=\"ouvrirImage('".$id."','".$pathPhoto."')\">"; echo 	"</td>"; echo "</tr>"; echo "<tr height='10px'><td> </td></tr>"; } echo "</table>";   $max = $idMin + $nbPhotos; $pageEnCours = ($idMin/$nbPhotos) + 1; echo "<input type='hidden' value='".$pageEnCours."' id='txtNumPage' name='txtNumPage'>"; echo "<table border='0' width='80%' align='center'>"; echo "<tr>"; echo 	"<td width='15%' align='left'>"; if ($idMin > 0) { echo "<img src='ergonomie/_images/precedent.gif' alt='Photos précédentes' title='Page précédente' style='cursor:pointer;cursor:hand' id='precedent' name='precedent' onClick=precedente(0,'".$nbPhotos."','".$idMin."','".$nbResult."','".$nbPage."',0,'".$chrono."') onMouseOver=rolloverIn('precedent') onMouseOut=rolloverOut('precedent')>"; } echo "</td>";  echo "	<td width='15%' align='right'>"; if ($max < $nbResult) { echo "<img src='ergonomie/_images/suivant.gif' alt='Photos suivantes' title='Page suivante' style='cursor:pointer;cursor:hand' id='suivant' name='suivant' onClick=suivante(0,'".$nbPhotos."','".$idMin."','".$nbResult."','".$nbPage."',0,'".$chrono."') onMouseOver=rolloverIn('suivant') onMouseOut=rolloverOut('suivant')>"; } echo "	</td>"; echo "</tr>"; echo "</table>"; ?> <br><br> </body> </html> 