<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="w3.css">
<title>Eleve Passe</title>
 
</head>
<style>
body {width:90%;}
</style>

<body>
<?php
$id=$_GET['id'];
$pass=$_GET['pass'];
$username=$_GET['username'];
include 'header.php';
include '_serveur.php';
echo '<div class="w3-card-4">
<form method="post" action="_modpass.php" >';
echo '<input type="hidden" name="id" value="'.$id.'"><br>';
echo 'Nom Utilisateur: <input type="text" name="username" value="'.$username.'"><br><br>';
echo 'Mot de Passe: <input type="text" name="pass" value="'.$pass.'"><br><br>';
 echo'  <input name="modifier" type="submit" class="style19" value="Modifier" bgcolor="#CC99FF" /></form></div>';
               
if (isset ($_POST['modifier'])){
	$id=$_POST['id'];
	$pass=$_POST['pass'];
    $username=$_POST['username'];
	 $sql='UPDATE users SET username="'.$username.'", password="'.$pass.'" where id="'.$id.'"';
	    if(!(mysqli_query($link, $sql))){
   echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
                      }
	    echo ' <div class="w3-panel w3-leftbar w3-sand w3-xxlarge w3-serif">
    <p align="center"><i>"Passe Modifiés"</i></p>';

}
?>
</body>
</html>
