css crud
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
<h1>Détails pour l’utilisateur <?= $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>
|
||||
<div>
|
||||
<h1>Détails pour l’utilisateur <?= $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>
|
||||
<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>
|
||||
@@ -38,36 +38,36 @@ 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>
|
||||
<h1>Modifier un utilisateur</h1>
|
||||
<form method="post">
|
||||
<p>
|
||||
<label for="login">Login</label>
|
||||
<input type="text" name="login" id="login" value="<?= $result['login']
|
||||
?>">
|
||||
</p>
|
||||
<p>
|
||||
<label for="description">Description</label>
|
||||
<input type="text" name="description" id="description" value="<?=
|
||||
$result['description'] ?>">
|
||||
</p>
|
||||
<p>
|
||||
<label for="role">Role</label>
|
||||
<input type="number" name="role" id="role" value="<?= $result['role']
|
||||
?>">
|
||||
</p>
|
||||
<p>
|
||||
<button>Enregistrer</button>
|
||||
</p>
|
||||
<input type="hidden" name="id" value="<?= $result['id'] ?>">
|
||||
</form>
|
||||
<div>
|
||||
<h1>Modifier un utilisateur</h1>
|
||||
<form method="post">
|
||||
<p>
|
||||
<label for="login">Login</label>
|
||||
<input type="text" name="login" id="login" value="<?= $result['login']
|
||||
?>">
|
||||
</p>
|
||||
<p>
|
||||
<label for="description">Description</label>
|
||||
<input type="text" name="description" id="description" value="<?=
|
||||
$result['description'] ?>">
|
||||
</p>
|
||||
<p>
|
||||
<label for="role">Role</label>
|
||||
<input type="number" name="role" id="role" value="<?= $result['role']
|
||||
?>">
|
||||
</p>
|
||||
<p>
|
||||
<button>Enregistrer</button>
|
||||
</p>
|
||||
<input type="hidden" name="id" value="<?= $result['id'] ?>">
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -16,40 +16,46 @@ 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>
|
||||
<h1>Liste des utilisateurs</h1>
|
||||
<table>
|
||||
<thead>
|
||||
<th>ID</th>
|
||||
<th>Login</th>
|
||||
<th>Nom</th>
|
||||
<th>Prenom</th>
|
||||
<th>Rôle</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($result as $user) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $user['id'] ?></td>
|
||||
<td><?= $user['login'] ?></td>
|
||||
<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>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="add.php">Ajouter</a>
|
||||
<div>
|
||||
<h1>Liste des utilisateurs</h1>
|
||||
<table>
|
||||
<thead>
|
||||
<th>ID</th>
|
||||
<th>Login</th>
|
||||
<th>Nom</th>
|
||||
<th>Prenom</th>
|
||||
<th>Rôle</th>
|
||||
<th>Actions</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($result as $user) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $user['id'] ?></td>
|
||||
<td><?= $user['login'] ?></td>
|
||||
<td><?= $user['firstname'] ?></td>
|
||||
<td><?= $user['lastname'] ?></td>
|
||||
<td><?= $user['role'] ?></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>
|
||||
<button onclick="window.location.href='add.php'">Ajouter</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
37
crud/style/style.css
Normal file
37
crud/style/style.css
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user