-
Notifications
You must be signed in to change notification settings - Fork 0
/
supprimer_historique.php
117 lines (95 loc) · 2.36 KB
/
supprimer_historique.php
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
session_start();
if (isset($_SESSION['privilege']) && $_SESSION['privilege']==1)
{
if (isset($_GET['id']))
{
require_once 'config.php';
$requete=$bdd->prepare('SELECT * FROM events WHERE id=?');
$requete->execute(array($_GET['id']));
$resultat=$requete->fetch();
if ($resultat!=NULL)
{
if (($resultat['date']<=date('Y-m-d')) || (($resultat['date']>date('Y-m-d'))&&($resultat['valide']>=2)))
{
$requete2=$bdd->prepare('DELETE FROM events WHERE id=?');
$requete2->execute(array($_GET['id']));
$requete3=$bdd->prepare('DELETE FROM salles_events WHERE id_event=?');
$requete3->execute(array($_GET['id']));
$requete4=$bdd->prepare('DELETE FROM notifications WHERE id_event=?'); // On supprime toutes les notifications en relation avec cet event
$requete4->execute(array($_GET['id']));
if (isset($_GET['gerer']))
{
header("Location: gerer_reservations.php");
}
else
{
if (isset($_GET['annule']))
{
header("Location: events_annules.php");
}
else
{
if (isset($_GET['reservationsadmin']))
{
header("Location: demandes_acceptees.php");
}
else
{
header("Location: historique_events.php");
}
}
}
exit;
}
else
{
if (isset($_GET['gerer']))
{
header("Location: gerer_reservations.php");
}
else
{
header("Location: historique_events.php");
}
exit;
}
}
else
{
if (isset($_GET['gerer']))
{
header("Location: gerer_reservations.php");
}
else
{
header("Location: historique_events.php");
}
exit;
}
}
else
{
if (isset($_GET['gerer']))
{
header("Location: gerer_reservations.php");
}
else
{
header("Location: historique_events.php");
}
exit;
}
}
else
{
if (!isset($_SESSION['privilege']))
{
$_SESSION['lien']=$_SERVER['REQUEST_URI'];
header("Location: connexion.php");
exit;
}
header("Location: interface.php");
exit;
}
?>