code
code
// 1.
class Voiture
$this->Matricule = $matr;
$this->Marque = $marq;
$this->Annee = $ann;
$this->NumClient = $nc;
return $this->Annee;
return $this->Marque;
{
return $this->Matricule;
return $this->NumClient;
$this->Annee = $Annee;
$this->Marque = $Marque;
$this->Matricule = $Matricule;
$this->NumClient = $NumClient;
###########################
);
Matricule INT,
Description TEXT,
DateRep Date,
Cout int,
);
////////////////////////////////////////////////////////////////////////////////////
##################
connection.php
##################
<?php
$user = "root";
$pass = "";
?>
<html lang="en">
<head>
<title>connection.php</title>
<!-- integrity="sha384-
rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous">-->
</head>
<body>
</form>
</div>
</body>
</html>
<?php
if (isset($_POST["Connect"])) {
$stmt = $conn->prepare($sql);
$stmt->execute([$_POST["matr"], $_POST["nc"]]);
if ($stmt->rowCount() == 1) {
session_start();
$_SESSION["client"] = $stmt->fetch();
header("location:Reparation.php");
} else {
echo "<script>";
echo "alert('error')";
echo "</script>";
##################################################################################
#######################
##############
Reparation.php
#############
<?php
$user = "root";
$pass = "";
session_start();
$data = $_SESSION["client"];
?>
<html lang="en">
<head>
<title>Reparation.php</title>
<!-- integrity="sha384-
rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous">-->
</head>
<body>
<div class="">
<h3>Info de la voiture</h3>
<ul>
</ul>
</div>
<div class="">
<thead>
<th>NumRep</th>
<th>Matricule</th>
<th>Description</th>
<th>DateRep</th>
<th>Cout</th>
</thead>
<tbody>
<?PHP
$stmt = $conn->prepare($sql);
$stmt->execute([$data["Matricule"]]);
$repData = $stmt->fetch();
?>
<tr>
</tr>
</tbody>
</table>
</div>
</body>
</html>
##################################################################################
#######################
##############
Liste Voiture.php
#############
<?php
$user = "root";
$pass = "";
?>
<html lang="en">
<head>
<title>Liste Voiture.php</title>
<!-- integrity="sha384-
rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous">-->
</head>
<body>
<div class="w-75">
</form>
</div>
<div class="">
<thead>
<th>Matricule</th>
<th>Marque</th>
<th>Annee</th>
<th>NumClient</th>
<th>Delete</th>
<th>Modifier</th>
</thead>
<tbody>
<?PHP
$stmt = $conn->prepare($sql);
$stmt->execute();
?>
<tr>
<td>
<a class=" btn btn-danger" href="del.php?matricule=<?PHP echo $element["Matricule"]
?>"
this element</a>
</td>
<td>
</a>
</td>
</tr>
<?PHP
?>
</tbody>
</table>
</div>
</body>
</html>
<?php
if (isset($_POST["add"])) {
$stmt = $conn->prepare($sql);
header("location:" . $_SERVER["PHP_SELF"]);
##################################################################################
#######################
##############
edit.php
#############
<?php
$user = "root";
$pass = "";
$matricule = $_GET["matricule"];
?>
<?php
$stmt = $conn->prepare($sql);
$stmt->execute([$matricule]);
$data = $stmt->fetch();
?>
<html lang="en">
<head>
<!-- integrity="sha384-
rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65"
crossorigin="anonymous">-->
</head>
<body>
<h2 class="text-center">modifier un voiture</h2>
<div class="w-75">
class="form-control w-25"><br>
class="form-control w-25"><br>
class="form-control w-25"
min="1"><br>
</form>
</div>
<?php
if (isset($_POST["modify"])) {
$sql = "UPDATE voiture SET Marque = ?, Annee = ?, NumClient = ? WHERE Matricule = ?";
$stmt = $conn->prepare($sql);
header("location:ListeVoiture.php");
} else {
}
##################################################################################
#######################
##############
del.php
#############
<?php
$user = "root";
$pass = "";
$matricule = $_GET["matricule"];
echo "<h1>$matricule</h1>";
$stmt = $conn->prepare($sql);
$stmt->execute([$matricule]);
header("location:ListeVoiture.php");