Bonjour
aide moi SVP
quand je cliquer sur ajouter aucune donnée ne s'ajouter à la base

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
session_start();
require('config.php');
 
 
?>
<html>
<head>
	<title> Ajouter une commande</title>
	<style type="text/css">
.container{
    box-shadow: 1px 1px 30px black;
    width:85%;
    background-color: rgb(151,199,222);
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1%;
 
    }
        button:hover{background-color: rgb(151,199,222);}
footer{text-align: center;margin-top: 3%; }
body{background-color: #EEE;}
.notifdiv{ border:1px  dotted black;text-align: center;margin-left:auto;margin-right:auto;margin-top:1%;background-color:#EEF;width:40%; }  
.notif,span{color:red;}
a{text-decoration: none;}
button{
  background-color: #EEF;
  text-align: right;
  width: 170px;
  height: 6%;
  background-repeat: no-repeat;
  background-position: center left;
}
header{text-align: center;background-color: #EEF;}
  fieldset{background-color:#EEF;margin-top:0px;margin-left: auto;margin-right: auto; width: 40%;}
	     .submit{text-align: center;}
input[Value="Ajouter le clients"]{
height: 50px;
width: 180px;
background-repeat: no-repeat;
background-position: center left;
text-align: right;
background-image: url('add.png');
background-color: #EEF;
}
.confirm{
	text-align: center;
	margin-top:0px; ;
margin-bottom: 1em;
color: ;
border:1px solid #a2d246;
width: 60%;
margin-left: auto;
margin-right: auto;
background-color: #ebf8a4;
}
	</style>
 
 
</head>
 
 
<?php
 
try
{
$bdd = new PDO('mysql:host=localhost;dbname=gestiondestock','root','');
}catch (Exception $e)
{die('Erreur : ' . $e->getMessage());}
?>
<?php
if(isset($_POST['matcommande'])   && isset($_POST['datecommande'])&&  isset($_POST['client'])&& isset($_POST['produits'])
	&& isset($_POST['quantiteachete'])&& isset($_POST['prixht'])) 
{
$req = $bdd->prepare('INSERT INTO commandeclient (matcommande,client,datecommande,produits,quantiteachete,prixht) 
VALUES(:matcommande,:client,:datecommande,:produits,:quantiteachete,:prixht)');
$req->execute(array(
':matcommande' => strtoupper(htmlspecialchars(trim($_POST['matcommande']))),
 
':datecommande' => htmlspecialchars($_POST['datecommande']),
':client' => ucfirst(strtolower(htmlspecialchars(trim($_POST['client'])))),
':produits' => ucfirst(strtolower(htmlspecialchars(trim($_POST['produits'])))),
':quantiteachete' => ucfirst(strtolower(htmlspecialchars(trim($_POST['quantiteachete'])))),
':prixht' => htmlspecialchars($_POST['prixht']),
 
));
$message= " commande a bien été ajouté !";
$req->debugDumpParams();
}
 
?>
 
<body>
<div class="container">
<?php include_once('header.php');?>	
<fieldset><legend><img src="pers.png"></legend>
	<?php if(isset($message)){?><p class="confirm"><em> <?php echo $message;}?></em></p>
<form method="post" action="commande.php">
	    <table border="0" cellspacing="5" >
	<tr><td><label> réference Commande: </label></td><td><input type="text" name="matcommande" required size="30"  /></td></tr>
	<tr><td>	<label>date commande :</label></td><td><input type="text" name="datecommande" required size="30" /></td></tr>
	<tr><td><label>client : </label></td><td><input type="text" name="client" required size="30"  /></td></tr>
 
 
<tr><td>	<label>produits :</label></td><td><input type="text"   name="produits" required size="30" /></td></tr>
<tr><td>	<label>qunatité  :</label></td><td><input type="text"   name="quantiteachete" required size="30" /></td></tr>
<tr><td>	<label>Prix unitaire :</label></td><td><input type="text"   name="prixht" required size="30" /></td></tr>
 
                <tr><td></td></tr><tr><td></td></tr>
 
 
    <tr class="submit"><td colspan="2"><input type="submit" Value="Ajouter commande " /></tr></td>
</table>
</form>
</fieldset>
<?php include_once("footer.html");?>
<br>
</div> 
</body>
</html>