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
| <html>
<head>
<title>Bons de prelevements</title>
</head>
<body>
<h1 align="center"> Bons de prélevement </h1>
<p align="center">
<?php
//déclaration des variables
$jour = date('Y-m-d');
$acquereur = $_POST['rayon_acquereur'];
$cedant = $_POST['rayon_cedant'];
$receptionnaire = $_POST['receptionnaire'];
$validation = $_POST['validation'];
$controle = $_POST['controle'];
$EAN = $_POST['EAN'];
$libelle = $_POST['libelle'];
$pu = $_POST['prix_unitaire'];
$quantite = $_POST['quantite'];
$resultat = $pu*$quantite;
$motif = $_POST['motif'];
?>
<table border="1">
<tr>
<th>Date</th>
<th>Rayon acquéreur</th>
<th>Rayon cédant</th>
<th>Receptionné par</th>
<th>Validé par</th>
<th>Controlé par</th>
<th>EAN</th>
<th>Libellé produit</th>
<th>Prix Unitaire</th>
<th>Quantité</th>
<th>Prix total</th>
</tr>
<tr>
<td><?php echo "$jour";?>
<td><?php echo "$acquereur";?>
<td><?php echo "$cedant";?>
<td><?php echo "$receptionnaire";?>
<td><?php echo "$validation";?>
<td><?php echo "$controle";?>
<td><?php echo "$EAN";?>
<td><?php echo "$libelle";?>
<td><?php echo "$pu";?>
<td><?php echo "$quantite";?>
<td><?php echo $pu*$quantite;?>
</tr>
</table></br>
<input type="button" value="Imprimer" onclick="print();">
<input type="button" value="Retour" onclick="location.href='index.php';">
</p>
<p align="center">
<?php
//connexion à la base
mysql_connect('localhost','garniouz','princesse');
//selection de la base
mysql_select_db('projet_bts');
//requete d'insertion
$query="INSERT INTO 'projet_bts'.'prelevements' ('date','ean_produit','matricule','num_rayon','num_service')
VALUES ('$jour', '$EAN', '$receptionnaire', '$acquereur', '$cedant');";
$resultat=mysql_query($query);
//test de la requète d'insertion
if ($resultat)
{
echo "Le prélevement a été archivé";
}
else
{
echo "Erreur lors de la saisie du prélevement, recommencez svp";
}
//fermeture de la base
mysql_close();
?>
</p>
</body>
</html> |
Partager