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
| <?php
session_start();
//if(!isset($_SESSION['id_user'])) header('location:acceuil.php');
include('connexion base.php');
if(isset($_POST['capacite']))
{
$id=$_POST['id'];
$capacite=$_POST['capacite'];
$num_par_type=$_POST['num_par_type'];
$cle_equip=$_POST['cle_equip'];
$cle_categorie=$_POST['cle_categorie'];
mysql_query("update composant set capacite='$capacite',num_par_type='$num_par_type',cle_equip='$cle_equip',cle_categorie='$cle_categorie' where cle_composont='$id' ");
header("location:modif_composant.php");
}
?>
<html>
<head>
<title>valid_modif_composant</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($_GET['id']))
{
$id=$_GET['id'];
$res=mysql_query("select * from composant where cle_composant='$id'");
$rep=mysql_fetch_array($res);
$id=$rep['cle_composant'];
$capacite=$rep['capacite'];
$num_par_type=$rep['num_par_type'];
$cle_equip=$rep['cle_equip'];
$cle_categorie=$rep['cle_categorie'];
?>
<center>
<form action="valid composant.php" method="post">
capacité: <input name="capacite" type="text" value="<?php echo $capacite; ?>" /><br /><br />
numero par type : <input name="num_par_type" type="text" value="<?php echo $num_par_type; ?>" /><br /><br />
ref clé equipement: <input name="cle_equip" type="text" value="<?php echo $cle_equip; ?>" /><br /><br />
ref clé categorie: <input name="cle_categorie" type="text" value="<?php echo $cle_categorie; ?>" /><br /><br />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="submit" value="modifier" />
</form>
</center>
<?php
}
?> |