-
Notifications
You must be signed in to change notification settings - Fork 3
/
aesh_delete.sql
69 lines (59 loc) · 1.73 KB
/
aesh_delete.sql
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
SELECT 'redirect' AS component,
'signin.sql?error' AS link
WHERE NOT EXISTS (SELECT 1 FROM login_session WHERE id=sqlpage.cookie('session'));
SET group_id = (SELECT user_info.groupe FROM login_session join user_info on user_info.username=login_session.username WHERE id = sqlpage.cookie('session'));
SELECT 'redirect' AS component,
'index.sql?restriction' AS link
WHERE $group_id<'3';
--Menu
SELECT 'dynamic' AS component, sqlpage.read_file_as_text('menu.json') AS properties;
-- Set a variable
SET var_eleve = (SELECT count(suivi.aesh_id) FROM suivi where suivi.aesh_id=$id);
SELECT
'alert' as component,
'Alerte' as title,
-- Avertissements
CASE WHEN $var_eleve>=1
THEN 'Cet AESH suit des élèves. Suppression impossible.'
ELSE 'Cet AESH va être supprimé. Toute suppression est définitive !'
END as description,
CASE WHEN $var_eleve>=1
THEN 'hand-stop'
ELSE 'alert-triangle'
END as icon,
CASE WHEN $var_eleve>=1
THEN 'yellow'
ELSE 'red'
END as color;
-- Isolement de l'AESH dans une liste
SELECT 'table' as component,
'Actions' as markdown,
'aesh_name' as Nom,
'aesh_firstname' as Prénom,
'tel_aesh' as Téléphone,
'quotite' as Quotité,
'courriel_aesh' as courriel;
SELECT
aesh_name AS Nom,
aesh_firstname AS Prénom,
tel_aesh as Téléphone,
courriel_aesh as courriel,
quotite as Quotité,
CASE WHEN $var_eleve>=1
THEN
'[
![](./icons/user-plus.svg)
](aesh_suivi.sql?id='||aesh.id||')[
![](./icons/trash-off.svg)
]() '
ELSE
'[
![](./icons/trash.svg)
](aesh_delete_confirm.sql?id='||$id||') '
END
as Actions
FROM aesh Where aesh.id=$id;
SELECT
'hero' as component,
'/aesh.sql' as link,
'Retour à la liste' as link_text;