PROJET-WEB_STRI1A/WEB/profil/admin.php

49 lines
1.4 KiB
PHP
Raw Normal View History

2019-05-22 10:36:02 +02:00
<?php
session_start();
require_once('../connexionBD.php');
require_once ('../ressources/verifconnecte.php');
2019-05-22 17:12:09 +02:00
require_once ('../ressources/user.php');
2019-05-22 10:36:02 +02:00
$user = getUser($db, $mail);
2019-05-22 17:12:09 +02:00
if(!$user['estadmin']){
header('Location: ../index.php');
exit();
2019-05-22 10:36:02 +02:00
}
2019-05-22 17:12:09 +02:00
$delmail = isset($_POST['delmail']) ? $_POST['delmail'] : NULL;
2019-05-22 10:36:02 +02:00
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="profil.css">
2019-05-22 10:36:02 +02:00
<link rel="stylesheet" href="../ressources/navbaradminhtml.css">
<script src="../inscription/inscription.js"></script>
<title>Administration</title>
</head>
<body>
<?php require_once("../ressources/navbaradminhtml.php"); ?>
<div id="formulaire">
<h1>Administration</h1>
<div>
<h1>Supprimer un utilisateur</h1>
<fieldset>
<form action="admin.php" method="post">
<table>
<tr>
<td><p>mail de l'utilisateur a supprimer :</p></td>
<td><input type="text" name="delmail"/></td>
</tr>
<tr>
<td><p><input type="submit" name="deluserbutton" value="supprimer l'utilisateur"></td>
</tr>
<tr>
<td><?php if (isset($_POST['delmail'])) { if (deluser($db, $delmail)){ echo "Utilisateur supprimé"; }}?></td>
2019-05-22 10:36:02 +02:00
</tr>
</table>
</form>
</fieldset>
</div>
</body>
</html>