<?php
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate'); header('Pragma: no-cache');  include("fotoweb46.php"); include("fotoweb19.php");  $queryPart = "SELECT * FROM participants ORDER BY 'nom' ASC"; $resultPart = mysql_query ($queryPart) or die ("La requête de sélection des Participants a échoué");  if (isset($_GET['nom'])) { $nom = $_GET['nom']; $qui = "(".$nom.")"; } else { $qui = ""; $nom = ""; }   if (!isset($_GET['nbPhotos'])) $nbPhotos=10; else $nbPhotos=$_GET['nbPhotos'];  if (!isset($_GET['ord'])) $ord="DESC"; else $ord=$_GET['ord'];  if (isset($_GET['filter'])) { $filter=$_GET['filter'];  if ($filter=="sommeClic") { $filter = "sommeClic"; if ($ord=="DESC") $ord='ASC'; else $ord='DESC'; }  if ($filter=="dateclick") { $filter = "dtclick"; if ($ord=="DESC") $ord='ASC'; else $ord='DESC'; }  if ($filter=="") { $filter='dtclick'; $ord="DESC"; } }else { $filter='dtclick'; $ord="DESC"; }     if ($nom=="") $querySelect = "SELECT statclick.repertoire, image.nom, SUM(statclick.nbClick) AS sommeClic, image.prive,MAX(statclick.date) AS dtclick FROM theme,image,statclick " . "WHERE image.nom = statclick.nom AND image.codeTheme = theme.codeTheme and theme.repertoire=statclick.repertoire " . "GROUP BY statclick.nom,statclick.repertoire ORDER BY $filter $ord, date DESC LIMIT 0,$nbPhotos"; else $querySelect = "SELECT statclick.repertoire, image.nom, SUM(statclick.nbClick) AS sommeClic, image.prive,statclick.date AS dtclick FROM theme,image,statclick " . "WHERE image.nom = statclick.nom AND image.codeTheme = theme.codeTheme and theme.repertoire=statclick.repertoire " . " AND statclick.login='".$nom."'" . " GROUP BY statclick.nom,statclick.repertoire ORDER BY $filter $ord,date DESC LIMIT 0,$nbPhotos";  $resultSelect = mysql_query ($querySelect) or die ("La requête de sélection des stat images a échoué : ".$querySelect); ?> <html> <head> <link rel='stylesheet' href='../ergonomie/style.css'> <script language='javascript' src='script/scriptadmin.js'></script>  </head> <body> <form id='form_stat_vuePhotos'> <table width='60%' border='0' align='center' cellpadding='5' class='image'>   <tr> <td width='30%' class='valeur' align='left'>Nb photos : <?php
echo "<input id='nbPhotos' name='nbPhotos' size='4' value='".$nbPhotos."'></input>"; ?>  </td> <td width='30%'> <select id='selParticipant' name='selParticipant'><option value=""><- PAS DE FILTRE -></option> <?php
while ($linePart = mysql_fetch_row($resultPart)) { $user = $linePart[0]; if ( $user != getValeurIni("loginAdministrateur")  ) if ($nom==$user) echo "<option value='".$user."' SELECTED>&nbsp; ".$user."</option>"; else echo "<option value='".$user."'>&nbsp; ".$user."</option>"; }  /* Free resultset */ mysql_free_result($resultPart);  echo "</select>"; echo "</td>";  echo "<td width='40%' align='center'>"; echo "<img  src=\"../ergonomie/_images/ok.gif\" id=\"ok\"  name=\"ok\"  alt=\"exécuter la requête\" title=\"exécuter la requête\" style=\"cursor:pointer;cursor:hand\" onClick=\"filtreParticipant(document.forms['form_stat_vuePhotos'].elements['nbPhotos'].value,document.forms['form_stat_vuePhotos'].elements['selParticipant'].value,'".$filter."','".$ord."')\">&nbsp;&nbsp;&nbsp;"; echo "</td>";  echo "</tr>"; echo "</table>"; echo "<BR>";    echo "<table width='60%' border='1' align='center' cellpadding='5' class='image'>"; echo "<tr>"; echo "<td width='30%' class='valeur' align='center'>".$nbPhotos." photos ".$qui."</td>";  echo "<td width='30%' class='valeur' align='center' onClick=\"filtreParticipant(document.getElementById('nbPhotos').value,document.getElementById('selParticipant').value,'sommeClic','".$ord."')\">"; echo "<a href='#' class='valeur'  target='basAdmin'>Nombre de clic</a>"; if ($filter=="sommeClic") if ($ord =='ASC') echo " +"; else echo " -"; echo "</td>";  echo "<td width='40%' class='valeur' align='center' align='center' onClick=filtreParticipant(document.forms['form_stat_vuePhotos'].elements['nbPhotos'].value,document.forms['form_stat_vuePhotos'].elements['selParticipant'].value,'dateclick','".$ord."')>"; echo "<a href='#' class='valeur'  target='basAdmin'>Date dernier clic</a>"; if ($filter=="dtclick") if ($ord =='ASC') echo " +"; else echo " -"; echo "</td>";   echo "</tr>"; echo "<tr>";  while ($line = mysql_fetch_row($resultSelect)) { $repertoire = $line[0]; $nomImage = $line[1]; $nbClick = $line[2]; $prive = $line[3]; $dateclick = $line[4]; if ($prive == 0) { $acces = ""; } else if ($prive == 1) { $acces = "prive/"; } else if ($prive == 2) { $acces = "vip/"; }  $pathImage = "../../".$repertoire."/".$acces."petit_$nomImage";  echo "<tr>"; echo 	"<td align='center'><img src='".$pathImage."'></td>"; echo 	"<td class='data' align='center'>".$nbClick."</td>"; echo "<td class='data' align='center'>".$dateclick."</td>"; echo "</tr>"; } mysql_free_result($resultSelect); ?> </form> </body> </html> 