diff --git a/site/accesBase.php b/site/accesBase.php index 4d273a5..e78f8db 100644 --- a/site/accesBase.php +++ b/site/accesBase.php @@ -60,6 +60,19 @@ } } + function suppression($id) + { + $db = connexion(); + $query = "DELETE FROM membres WHERE identifiant = '$id'"; + $result = pg_query($db, $query) or die("La requête a echoué : ".pg_last_error()); + if (pg_affected_rows($result)!=0){ + return True; + } + else{ + return False; + } + } + function getGroupe($id) { $db = connexion(); diff --git a/site/formInscription.php b/site/formInscription.php index c69bd43..df527ed 100644 --- a/site/formInscription.php +++ b/site/formInscription.php @@ -52,7 +52,7 @@ $groupes = getGroupes(); - +
diff --git a/site/formSuppression.php b/site/formSuppression.php new file mode 100644 index 0000000..e85d1df --- /dev/null +++ b/site/formSuppression.php @@ -0,0 +1,23 @@ + +
+
+
+

Supprimer un compte

+
+ + + + + + + +
Identifiant :
+ +
+
+
+
diff --git a/site/header.php b/site/header.php index 897dbc3..2ed9ade 100644 --- a/site/header.php +++ b/site/header.php @@ -19,7 +19,7 @@ Compte'; + echo ' Compte'; } ?> Deconnexion diff --git a/site/inscription.php b/site/inscription.php index cdeb321..425ac9f 100644 --- a/site/inscription.php +++ b/site/inscription.php @@ -26,7 +26,7 @@ if(getGroupe($_SESSION['Login'])!=1) { if(inscription($_POST["id"], $_POST["pass1"], $_POST["nom"], $_POST["prenom"], $_POST["groupe"])) { - $retour = "Nouveau compte créé avec succès "; + $retour = "Nouveau compte créé avec succès !"; $color = "alert-success"; } else diff --git a/site/inscrire.php b/site/inscrire.php index fc9f5fd..6b6023b 100644 --- a/site/inscrire.php +++ b/site/inscrire.php @@ -15,7 +15,10 @@ session_start(); include("header.php"); require_once("accesBase.php"); if(getGroupe($_SESSION['Login'])==1) - { include("formInscription.php"); } + { + include("formSuppression.php"); + include("formInscription.php"); + } else { header("Location: accueil.php"); } ?> diff --git a/site/suppression.php b/site/suppression.php new file mode 100644 index 0000000..89bf9ad --- /dev/null +++ b/site/suppression.php @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ + + + + -- libgit2 0.21.2