-
Notifications
You must be signed in to change notification settings - Fork 3
/
aesh.sql
66 lines (62 loc) · 1.84 KB
/
aesh.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
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,
'etablissement.sql?restriction' AS link
WHERE $group_id<'2';
--Menu
SELECT 'dynamic' AS component, sqlpage.read_file_as_text('menu.json') AS properties;
select
'button' as component,
'sm' as size,
'pill' as shape;
select
'Accompagnants' as title,
'user-plus' as icon,
'green' as color;
select
'Ajouter un Accompagnant' as title,
'aesh_ajout.sql' as link,
'square-rounded-plus' as icon,
$group_id<3 as disabled,
'green' as outline;
SELECT 'table' as component,
TRUE as hover,
'Actions' as markdown,
'Admin' as markdown,
1 as sort,
1 as search;
SELECT
aesh_name AS Nom,
aesh_firstname AS Prénom,
etab.nom_etab AS Établissement,
CASE WHEN $group_id>2
THEN tel_aesh
ELSE 'numéro masqué'
END as Téléphone,
courriel_aesh as courriel,
quotite as Quotité,
'[
![](./icons/user-plus.svg)
](aesh_suivi.sql?id='||aesh.id||'&tab=Profils)' as Actions,
CASE WHEN $group_id=3 THEN
'[
![](./icons/pencil.svg)
](aesh_edit.sql?id='||aesh.id||')[
![](./icons/trash-off.svg)
]()'
WHEN $group_id=4 THEN
'[
![](./icons/pencil.svg)
](aesh_edit.sql?id='||aesh.id||'&username='||aesh.username||')[
![](./icons/trash.svg)
](aesh_delete.sql?id='||aesh.id||')'
ELSE
'[
![](./icons/pencil-off.svg)
]()[
![](./icons/trash-off.svg)
]()'
END as Admin
FROM aesh join user_info on aesh.username=user_info.username join etab on etab.id=user_info.etab ORDER BY aesh_name ASC;