-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgestionCodeInscription.php
More file actions
73 lines (60 loc) · 2.1 KB
/
gestionCodeInscription.php
File metadata and controls
73 lines (60 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
include_once('includes/AccesBase.php');
include_once('Modeles/fonction.php');
if(!empty($_SESSION)){
$bool = false;
if($_SESSION['Type']=='Administrateur'){
$bool=TRUE;
$req = $db->prepare("SELECT * FROM `codeinscription` ORDER BY fonction");
$req->execute();
$fonction = $req->fetchall();
}
else if($_SESSION['Type']=='Gestionnaire'){
$rep = getCodeEntite($db, $_SESSION['idEntite']);
$fonction = $rep->fetchall();
}
if(isset($_GET["action"]) ) {
if(($_GET["action"]=="supprimer")) {
$reponse=deleteCodeInscription($db,$_GET["id"]);
//on met a jour la fonction
if($_SESSION['Type']=='Gestionnaire'){
$req = $db->prepare("SELECT * FROM `codeinscription` WHERE fonction='Utilisateur'ORDER BY fonction");
$req->execute();
$fonction = $req->fetchall();
}
else if($_SESSION['Type']=='Administrateur'){
$req = $db->prepare("SELECT * FROM `codeinscription` ORDER BY fonction");
$req->execute();
$fonction = $req->fetchall();
}
}
if(($_GET["action"]=="ajouter")){
$reponse=addCodeUtilisateur($db,genererChaineAleatoire(10),$_SESSION['idEntite'],"Utilisateur");
//on met a jour la fonction
if($_SESSION['Type']=='Gestionnaire'){
$req = getCodeEntite($db, $_SESSION['idEntite']);
}
else if($_SESSION['Type']=='Administrateur'){
$req = $db->prepare("SELECT * FROM `codeinscription` ORDER BY fonction");
}
$req->execute();
$fonction = $req->fetchall();
}
if(($_GET["action"]=="ajouterAdmin")){
$reponse=addCodeUtilisateur($db,genererChaineAleatoire(10),$_SESSION['idEntite'],"Administrateur");
//on met a jour la fonction
$req = $db->prepare("SELECT * FROM `codeinscription` ORDER BY fonction");
$req->execute();
$fonction = $req->fetchall();
}
if(($_GET["action"]=="ajouterGestion")){
$reponse=addCodeUtilisateur($db,genererChaineAleatoire(10),$_SESSION['idEntite'],"Gestionnaire");
//on met a jour la fonction
$req = $db->prepare("SELECT * FROM `codeinscription` ORDER BY fonction");
$req->execute();
$fonction = $req->fetchall();
}
}
include_once('Vues/gestionCodeInscription.vue.php');
}
?>