-
Notifications
You must be signed in to change notification settings - Fork 3
/
dispo_ajout.sql
70 lines (60 loc) · 2.79 KB
/
dispo_ajout.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
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,
'notification.sql?id='||$id||'&restriction' AS link
WHERE $group_id<'3';
--Menu
SELECT 'dynamic' AS component, sqlpage.read_file_as_text('menu.json') AS properties;
--Bouton retour sans valider
select
'button' as component,
'sm' as size,
'pill' as shape;
select
'Retour à la liste' as title,
'eleves.sql' as link,
'arrow-back-up' as icon,
'green' as outline;
select
'Retour à la fiche élève' as title,
'notification.sql?id='|| $id || '&tab=Profil' as link,
'briefcase' as icon,
'green' as outline;
-- écrire le nom de l'élève dans le titre de la page
SELECT
'datagrid' as component,
CASE WHEN EXISTS (SELECT eleve.id FROM image WHERE eleve.id=image.eleve_id)
THEN image_url
ELSE './icons/profil.png'
END as image_url,
UPPER(nom) || ' ' || prenom as title,
'Sexe : '||sexe||' - INE : '||INE as description
FROM eleve LEFT JOIN image on image.eleve_id=eleve.id WHERE eleve.id = $id;
SELECT
adresse||' '||code_postal||' '||commune as title,
'né(e) le :'||strftime('%d/%m/%Y',eleve.naissance) as description, 'black' as color,
0 as active
FROM eleve LEFT JOIN image on image.eleve_id=eleve.id WHERE eleve.id = $id;
SELECT
'Dispositif(s) :' as title,
1 as active,
group_concat(DISTINCT dispositif.dispo) as description, 'orange' as color,
'etab_dispositifs.sql?id='||etab.id as link
FROM eleve INNER JOIN etab on eleve.etab_id=etab.id LEFT JOIN affectation on affectation.eleve_id=eleve.id LEFT JOIN dispositif on dispositif.id=affectation.dispositif_id WHERE eleve.id = $id;
select
etab.type||' '||etab.nom_etab as title,
'Classe : ' || classe as description,
1 as active, 'green' as color,
'etab_classes.sql?id='||etab.id||'&classe_select='||eleve.classe as link
FROM eleve INNER JOIN etab on eleve.etab_id=etab.id WHERE eleve.id = $id;
-- Formulaire pour ajouter un suivi
SELECT 'form' as component,
'Affecter sur un ou plusieurs dispositif' as title,
'notification.sql?id='|| $id || '&tab=Suivi' as action,
'Ajouter' as validate,
'La touche ''CTRL'' permet une sélection multiple.' as description,
'green' as validate_color,
'Recommencer' as reset;
SELECT 'dispositif[]' as name, 'dispositif(s)' as label, 6 as width, 'select' as type, true as multiple, true as dropdown, json_group_array(json_object("label", dispo, "value", id)) as options FROM (select * FROM dispositif ORDER BY dispo ASC);