<?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");  $nom=$_GET['nom'];  /* Pour savoir si on coche la case Public pour chaque thème */ $queryTheme = "SELECT codeTheme FROM theme"; $resultTheme = mysql_query ($queryTheme) or die ("La requête de sélection des thèmes a échoué"); while ($lineTheme = mysql_fetch_row($resultTheme)) { $codeTheme = $lineTheme[0]; echo "if (document.getElementById(\"chkPublic".$codeTheme."\") != null) {"; echo 	"document.getElementById(\"chkPublic".$codeTheme."\").checked = false;"; echo 	"document.getElementById(\"chkPrive".$codeTheme."\").checked = false;"; echo 	"document.getElementById(\"chkVip".$codeTheme."\").checked = false;"; echo "}"; if ($nom == 'public') { echo "document.getElementById(\"chkPrive".$codeTheme."\").disabled = true;"; echo "document.getElementById(\"chkVip".$codeTheme."\").disabled = true;"; echo "document.getElementById(\"chkPublic".$codeTheme."\").disabled = false;"; } else { echo "document.getElementById(\"chkPrive".$codeTheme."\").disabled = false;"; echo "document.getElementById(\"chkVip".$codeTheme."\").disabled = false;"; echo "document.getElementById(\"chkPublic".$codeTheme."\").disabled = true;"; }  /* $queryNiveau = "SELECT prive FROM image WHERE codeTheme='$codeTheme'"; $resultNiveau = mysql_query ($queryNiveau) or die ("La requête de sélection du niveau d'habilitation du thème a échoué"); while ($lineNiveau = mysql_fetch_row($resultNiveau)) { $prive = $lineNiveau[0]; if ($prive == 0) { echo "document.getElementById(\"chkPublic".$codeTheme."\").checked = true;"; break; } } */ }  if($nom!='public'){ $queryRelation = "SELECT codeTheme,niveau FROM relationthemepersonne WHERE nomPers='public'"; $resultRelation = mysql_query ($queryRelation) or die ("La requête de sélection des relations thèmes/personnes a échoué"); while ($lineRelation = mysql_fetch_row($resultRelation)) { $codeTheme = $lineRelation[0];  echo "document.getElementById(\"chkPublic".$codeTheme."\").checked = true;"; } } $queryRelation = "SELECT codeTheme,niveau FROM relationthemepersonne WHERE nomPers='$nom'"; $resultRelation = mysql_query ($queryRelation) or die ("La requête de sélection des relations thèmes/personnes a échoué"); while ($lineRelation = mysql_fetch_row($resultRelation)) { $codeTheme = $lineRelation[0]; $niveau = $lineRelation[1]; if ($niveau == 2) { echo "document.getElementById(\"chkVip".$codeTheme."\").checked = true;"; echo "document.getElementById(\"chkPrive".$codeTheme."\").checked = true;"; } else if ($niveau == 1) { echo "document.getElementById(\"chkPrive".$codeTheme."\").checked = true;"; echo "document.getElementById(\"chkVip".$codeTheme."\").checked = false;"; } else if ($niveau == 0) { echo "document.getElementById(\"chkPublic".$codeTheme."\").checked = true;"; echo "document.getElementById(\"chkPrive".$codeTheme."\").checked = false;"; echo "document.getElementById(\"chkVip".$codeTheme."\").checked = false;"; } }  mysql_free_result($resultRelation); ?> 