<html>
<title>HOMESITE Patrice DELPY - Modification d'un enregistrement dans la base powerball</title>
<body>

<script language="JavaScript">
function checkPwd() 
{ 
// on vérifie si le mot de passe est vide
alert('Marc tu as un cul gros comme un tracteur !!! .');
// si non on ouvre le fichier en question
}

 function fenetre() {
var win_opt="toolbar=0,location=0,directories=0,status=0,menubar=0,";
win_opt+="scrollbars=0,resizable=0,copyhistory=0,";
win_opt+="width=310"+",height=250,";
win_opt+="screenY=150"+",screenX=420";
NewWindow = window.open("test_popup.htm","popup",win_opt);
NewWindow.creator=self;
}

</script>

<?


// connexion avec la base
$db_type   = "mysql";
$db_user   = "analogde";
$db_pass   = "rainbow";
$db_name   = "analogde";
$db_host    = "sql2";


// authentification et connexion
  $connexion = mysql_connect($db_host,$db_user,$db_pass); 
  if(!$connexion)  
    { echo "Désolé, y a un bléme, connexion au serveur $db_host impossible\n";
      exit; 
    }

   // pointe sur la base
   $db = mysql_select_db($db_name,$connexion); 
   if(!$db)
      {  echo "Désolé accés a la base $db_name impossible\n";
      }
// récupération des informations
  while (list($var, $value) = each($HTTP_GET_VARS))
    {
      $tab_asso["$var"] = $value;
    }

if($id == 3)
  { //echo("document.write('ce que je veux affiche notamment $param');");
  	//checkPwd();
  	//echo "<a href='javascript:fenetre()'>Test </a>"
  }	


switch ($tab_asso[modifier]){

case 2;
$requete=mysql_db_query( "analogde" ,"update powerball set nom='$nom',prenom='$prenom',main_gauche='$main_gauche',main_droite='$main_droite',endurance='$endurance' where id=$id",$connexion);
echo "<h1 align=center>Mise à jour effectuée<br><br><a href='powerball.php'>Retour</a>";
break;

default;

$result=mysql_db_query( "analogde" ,"select * from powerball where id=$id" ,$connexion);
$number = MYSQL_NUM_ROWS($result);

	$nom=mysql_result($result,$i,"nom");
	$prenom=mysql_result($result,$i,"prenom");
	$main_gauche=mysql_result($result,$i,"main_gauche");
	$main_droite=mysql_result($result,$i,"main_droite");
	$endurance=mysql_result($result,$i,"endurance");
	
	
echo "<blockquote><table border=0><form method='get' action='modif.php'><input type='hidden' name=modifier value=2><input type='hidden' name=id value='$id'>
	<td>Nom</td><td><input type='text' name=nom value='$nom' size=10 maxlenght=15></td>
      	<td align=right>Prénom</td><td><input type='text' name=prenom value='$prenom' size=10 maxlenght=15></td><tr>
	
	<td>Gauche</td><td><input type='text' name=main_gauche value='$main_gauche' size=10 maxlenght=15></td>
	<td align=right>Droite</td><td><input type='text' name=main_droite value='$main_droite' size=10 maxlenght=15></td><tr>
	
	<td>Endurance</td><td><input type='text' name=endurance value='$endurance' size=30 maxlenght=5></td>
		
	
      </table></blockquote>";
      
      
if($id == 3)
  { //echo("document.write('ce que je veux affiche notamment $param');");
  	//checkPwd();
  	//echo "<a href='javascript:fenetre()'>Test </a>"
      
      
echo "<table align=center><tr><td><input type='submit' value='Modifier' onClick= checkPwd() ></td>
       
       <td><input type='reset' value='Tout effacer'></td></form><td>
       <form method=get action='powerball.php'>
       
       
       <input type=submit value='Annuler'></td></form></table>
        <form method=get action='powerball.php'>";
        
      }
        
        
else { echo "<table align=center><tr><td><input type='submit' value='Modifier'></td>
       
       <td><input type='reset' value='Tout effacer'></td></form><td>
       <form method=get action='powerball.php'>
       
       
       <input type=submit value='Annuler'></td></form></table>
        <form method=get action='powerball.php'>";
	   }        
        
break; }

// referme la connexion
mysql_close();
?>
</body></html>
