1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| <!DOCTYPE html>
<html>
<head>
<title>Modification postit</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/postit.css" type="text/css" />
</head>
<body>
<?php
//connection au serveur
mysql_connect( "localhost", "root", "" ) ;
//sélection de la base de données:
mysql_select_db( "bdd" ) ;
//récupération de la variable d'URL,
//qui va nous permettre de savoir quel enregistrement modifier
$id = $_GET["q"] ;
//requête SQL + exécution:
$requete = mysql_query("SELECT * FROM postit WHERE numeropersonne = $id");
//date locale:
setlocale (LC_TIME, 'fr_FR','fra');
//affichage des données:
if( $resultat = mysql_fetch_object( $requete ) )
{
?>
<p style="text-align:center;"><a href="index.php"><img style="border: 0px solid ; width: 42px; height: 48px;" alt="Accueil" href="index.php" src="images/logo_accueil.png"/>Retour à l'accueil</a></p>
<br/>
<p align="center"><img src="images/letter_p.jpg" height="90" width="70" /><img src="images/letter_o.jpg" height="45" width="35"/><img src="images/letter_s.jpg" height="45" width="35" /><img src="images/letter_t.jpg" height="45" width="35" /><img src="images/letter_i.jpg" height="90" width="70"/><img src="images/letter_t.jpg" height="45" width="35" /></p>
<br/>
<br/>
<br/>
<br/>
<form action="modif.php" method="post">
<input type="hidden" name="q" value="<?php echo $id;?>">
<table border="2" align="center" cellspacing="3" cellpadding="3">
<tr>
<td><h4>Numero de personne</h4></td>
<td><h5><?php echo $id ;?></h5></td>
</tr>
<tr>
<td><h4>Date de creation</h4></td>
<td><h5><input type="text" name="dateCreation" size="30" value="<?php echo strftime("%A %d %B %Y", strtotime ($resultat->dateCreation)) ;?>"></h5></td>
</tr>
<tr>
<td><h4>Objet</h4></td>
<td><h5><input type="text" name="objet" size="50" value="<?php echo($resultat->objet);?>"></h5></td>
</tr>
<tr>
<td><h4>Commentaire</h4></td>
<td width="400" height="100"><h5><textarea name="commentaire" rows="10" cols="40"><?php echo($resultat->commentaire) ;?></textarea></h5></td>
</tr>
</table>
<p style="text-align:center;"><h6>Etes-vous sur de vouloir modifier? <input type="submit" value="Modifier" name="Modifier"></h6></p>
</form>
<?php
//On ferme la boucle while
}
// Fermeture de la connexion à la base de données
mysql_close();
?>
</body>
</html> |