This commit is contained in:
2024-10-11 16:36:56 +02:00
parent 0e0e141982
commit a390944917
5 changed files with 115 additions and 68 deletions

View File

@@ -37,6 +37,7 @@ require_once('close.php');
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style/style.css"/>
<title>Ajouter utilisateur</title>
</head>
@@ -45,7 +46,7 @@ require_once('close.php');
<label for="login">Utilisateur</label>
<input type="text" name="login" id="login">
<label for="password">Mot de passe</label>
<input type="text" name="password" , id="password" />
<input type="text" name="password" id="password" />
<label for="firstname">Prénom</label>
<input type="text" name="firstname" id="firstname">
<label for="lastname">Nom de famille</label>
@@ -53,7 +54,7 @@ require_once('close.php');
<label for="role">Role</label>
<input type="number" name="role" id="role">
<label for="description">Description</label>
<input type="text" name="description" id="description" />
<textarea name="description"></textarea>
<button>Enregistrer</button>
</form>
</body>

View File

@@ -27,20 +27,23 @@ require_once('close.php');
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des produits</title>
<title>Détails de l'utilisateur</title>
<link rel="stylesheet" href="style/style.css" />
</head>
<body>
<div>
<h1>Détails pour lutilisateur <?= $user['login'] ?></h1>
<p>ID : <?= $user['id'] ?></p>
<p>Login : <?= $user['login'] ?></p>
<p>FirstName : <?= $user['firstname'] ?></p>
<p>LastName : <?= $user['lastname'] ?></p>
<p>Role : <?= $user['role'] ?></p>
<p><a href="edit.php?id=<?= $user['id'] ?>">Modifier</a>
<a href="delete.php?id=<?= $user['id'] ?>">Supprimer</a>
<p>
<button onclick="window.location.href='edit.php?id=<?= $user['id'] ?>'">Modifier</button>
<button onclick="window.location.href='delete.php?id=<?= $user['id'] ?>'">Supprimer</button>
</p>
</div>
</body>
</html>

View File

@@ -38,14 +38,13 @@ require_once('close.php');
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des produits</title>
<title>Modification de l'utilisateur</title>
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
href="style/style.css">
</head>
<body>
<div>
<h1>Modifier un utilisateur</h1>
<form method="post">
<p>
@@ -68,6 +67,7 @@ require_once('close.php');
</p>
<input type="hidden" name="id" value="<?= $result['id'] ?>">
</form>
</div>
</body>
</html>

View File

@@ -16,11 +16,13 @@ require_once('close.php');
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style/style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Liste des utilisateurs</title>
</head>
<body>
<div>
<h1>Liste des utilisateurs</h1>
<table>
<thead>
@@ -29,6 +31,7 @@ require_once('close.php');
<th>Nom</th>
<th>Prenom</th>
<th>Rôle</th>
<th>Actions</th>
</thead>
<tbody>
<?php
@@ -40,16 +43,19 @@ require_once('close.php');
<td><?= $user['firstname'] ?></td>
<td><?= $user['lastname'] ?></td>
<td><?= $user['role'] ?></td>
<td><a href="details.php?id=<?= $user['id'] ?>">Voir</a> <a
href="edit.php?id=<?= $user['id'] ?>">Modifier</a> <a href="delete.php?id=<?=
$user['id'] ?>">Supprimer</a></td>
<td>
<button onclick="window.location.href='details.php?id=<?= $user['id'] ?>'">Voir</button>
<button onclick="window.location.href='edit.php?id=<?= $user['id'] ?>'">Modifier</button>
<button onclick="window.location.href='delete.php?id=<?= $user['id'] ?>'">Supprimer</button>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<a href="add.php">Ajouter</a>
<button onclick="window.location.href='add.php'">Ajouter</button>
</div>
</body>
</html>

37
crud/style/style.css Normal file
View File

@@ -0,0 +1,37 @@
table {
width: 100%;
margin: auto;
line-height: 2em;
}
table tr td {
border-style: solid;
border-color: black;
border-width: 0.1em;
text-align: center;
padding: 2px;
}
th {
background-color: gray;
}
table tr:nth-child(even) {
background-color: darkgray;
}
button {
font-size: 1em;
}
body {
display: flex;
align-items: center;
justify-content: space-around;
}
div {
background-color: lightgray;
padding: 10px;
text-align: center;
}