<?php
session_start();  $codeTheme=$_GET['codeTheme']; if (! is_numeric($codeTheme)) exit();  $nbPhotos=$_GET['nbPhotos']; if (! is_numeric($nbPhotos)) exit();  $pano=$_GET['pano']; if (! is_numeric($pano)) exit();  include("fotoweb77.php"); include("script_outils.php");  $idMin = 0; echo "<html>"; echo "<head>"; echo 	"<link rel='stylesheet' href='ergonomie/style.css'>"; echo 	"<script language='javascript' src='script/script.js'></script>"; echo "</head>"; echo "<body>"; echo "<script>"; if (isset($_SESSION['SESS_LOGIN'])) $login=$_SESSION['SESS_LOGIN']; else $login='public';  if (isset($_SESSION['SESS_PWD'])) $pwd=$_SESSION['SESS_PWD']; else $pwd='public';  $queryRelation = "SELECT niveau FROM relationthemepersonne WHERE nomPers='".$login."' AND codeTheme='$codeTheme'"; $resultRelation = mysql_query ($queryRelation) or die ("La requête de sélection des thèmes a échoué"); $niveau = mysql_fetch_row($resultRelation);  if ($niveau == "") $niveau = '0'; else $niveau = $niveau[0]; /* Free resultset */ mysql_free_result($resultRelation);  if ($login=='public' || $niveau == '0') { $querySelect = "SELECT id,nom,codeTheme,prive,dateOriginale FROM image WHERE codeTheme='$codeTheme' AND prive='0' ORDER BY dateOriginale,nom"; } else { if($niveau == '1') $querySelect = "SELECT id,nom,codeTheme,prive,dateOriginale  FROM image WHERE codeTheme='$codeTheme' AND prive!='2' ORDER BY dateOriginale,nom"; if($niveau == '2') $querySelect = "SELECT id,nom,codeTheme,prive,dateOriginale  FROM image WHERE codeTheme='$codeTheme' ORDER BY dateOriginale,nom"; } $rslt = mysql_query ($querySelect) or die ("La requête de sélection du nombre de photos a échoué");  $nbResult = mysql_num_rows($rslt);  $picinfo=array();  for( $i = 0; $i < $nbResult; $i++) { $picinfo[] = mysql_fetch_array($rslt); }    if (!isset($_SESSION['SESS_CHRONO'])) $_SESSION['SESS_CHRONO']='rand';   if (($_SESSION['SESS_CHRONO']=='rand')) $picinfo = arrayShuffle($picinfo); $_SESSION['picinfo']=$picinfo ;   /* Free resultset */ mysql_free_result($rslt); echo "updateNavigation('$codeTheme','$nbPhotos','$nbResult','','','$pano','');"; if ($pano == 1) { echo 	"window.location = 'fotoweb59.php?codeTheme=".$codeTheme."&nbPhotos=".$nbPhotos."&idMin=".$idMin."&nbResult=".$nbResult."';"; } else { echo 	"window.location = 'fotoweb58.php?codeTheme=".$codeTheme."&nbPhotos=".$nbPhotos."&idMin=".$idMin."&nbResult=".$nbResult."';"; } echo "</script>";  ?> </body> </html> 