Nouveau Document Texte
Nouveau Document Texte
Nouveau Document Texte
php
session_start();
include("connection.php");
if (!isset($_SESSION['username'])) {
header("Location: login.php");
exit();
}
$username = $_SESSION['username'];
if (!isset($_GET['id']) || empty($_GET['id'])) {
die("ID de commande non spécifié.");
}
if (!$result) {
die("Query Failed: " . mysqli_error($conn));
}
$order = mysqli_fetch_assoc($result);
if (!$order) {
die("Commande non trouvée.");
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$produit_declared = mysqli_real_escape_string($conn,
$_POST['produit_declared']);
$date_declaration = mysqli_real_escape_string($conn,
$_POST['date_declaration']);
$heure_declaration = mysqli_real_escape_string($conn,
$_POST['heure_declaration']);
$date_enregistrement = date('Y-m-d H:i:s', strtotime('-1 hour'));
$id = mysqli_real_escape_string($conn, $_POST['id']);
$previous_qty_restante = (int)$_POST['previous_qty_restante'];
if (mysqli_stmt_affected_rows($update_stmt) > 0) {
echo "<div class='alert alert-success'>Les informations ont été mises à
jour.</div>";
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Détails de la Commande</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"
rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f8f9fa;
color: #343a40;
}
.container {
background-color: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
font-size: 24px;
margin-bottom: 20px;
}
.table th, .table td {
vertical-align: middle;
}
.table th {
background-color: #f0f0f0;
}
.btn {
transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
transform: scale(1.02);
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.form-label {
font-weight: bold;
}
</style>
<script>
function updateRemainingQuantity() {
var previousQtyRestante =
parseInt(document.getElementById('previous_qty_restante').value);
var produitDeclared =
parseInt(document.getElementById('produit_declared').value) || 0;
var remainingQty = previousQtyRestante - produitDeclared;
document.getElementById('remaining_qty_display').innerText =
remainingQty;
}
</script>
</head>
<body>