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
|
<html>
<head>
<meta charset="utf-">
<title>ULAC</title>
<link rel="stylesheet" href="style_order.css" media="screen" type="text/css" />
<link rel="SHORTCUT ICON" href="u.ico"/>
</head>
<body>
<div id="content">
<p><a href='index.php'><span>Log off</span></a></p>
<p><a href='order.php'><span>New order</span></a></p>
<p><a href='pdf.php'><span>Generate PDFdoc</span></a></p>
<?php
session_start();
$datetime = date("Y-m-d H-i-s");
if (empty($_SESSION['username']))
{
header('location:index.php');
}
else
{
if(isset($_GET['deconnexion']))
{
if($_GET['deconnexion']==true)
{
session_destroy();
header("location:index.php");
}
}
else if($_SESSION['username'] !== ""){
$user = $_SESSION['username'];
// afficher un message
/*echo "<br>Confirmation de commande<br><br>";*/
}
}
?>
</div>
<div id="box_confirmation_commande">
<div>
<h3>CONFIRMATION DE COMMANDE</h3>
<p></p>
</div>
<?php
if(isset($_POST['list_mat'])){
foreach ($choix as $_POST['list_mat'])
{
echo "Choix utilisateur : ",$choix,"<br>";
}
}
try
{
$bdd = new PDO('mysql:host=mon_serveur;dbname=nom_BDD;charset=utf8', 'nom_table', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
echo 'Récapitulatif:<br><br>';
$req = $bdd->prepare('INSERT INTO commande(modele, reference, commentaire, utilisateur, date) VALUES(?, ?, ?, ?, NOW())');
$req->execute(array(
$_POST['modele'],
$_POST['reference'],
$_POST['commentaire'],
$user,
));
echo $datetime.'<br>'.$_POST['modele'].'<br>'.$_POST['reference'].'<br>'.$_POST['commentaire'].'<br>'.'Commande effectuée par '.$user.'<br><br>'.'Merci pour votre commande!';
?>
</div>
</body>
</html> |
Partager