-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathafficheProf.php
195 lines (175 loc) · 5.86 KB
/
afficheProf.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
/*
*
* Copyright 2014 Régis Bouguin
*
* This file is part of GEPI.
*
* GEPI is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* GEPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GEPI; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
$annee = NULL;
if (isset($_GET['classe'])) {unset($_SESSION['classes']);}
// on passe par un tableau, reste
$classesChoisies = isset($_GET['classe']) ? $_GET['classe'] : (isset($_SESSION['classes']) ? $_SESSION['classes'] : NULL) ;
$_SESSION['classes'] = $classesChoisies;
//===== Recherche des classes =====
$classesProf = chercheClassesProf($_SESSION['login'], $anneeAPB);
//===== Recherche des élèves =====
if ($classesChoisies) {
$elevesChoisis = chercheElevesProf($classesChoisies, $_SESSION['login'], $anneeAPB);
}
//===== Recherche des notes =====
if(isset($_POST['appEleves'])) {
foreach ($_POST['app'] as $key => $value) {
if ($value) {
$clefs = explode ("_",$key) ;
setAppreciationProf($clefs[0], $clefs[1], $clefs[2], $value, $_SESSION['login']);
}
}
}
?>
<fieldset>
<legend>Liste des classes <?php echo $anneeLSL; ?>/<?php echo $anneeAPB; ?></legend>
<?php
if($classesProf->num_rows) {
while ($classeProf = $classesProf->fetch_object()){
if (lsl_get_ouvert_prof($classeProf->id)) { ?>
<p>
<a href="?classe[<?php echo $classeProf->id; ?>]=on<?php echo add_token_in_url(); ?>">
<?php echo $classeProf->nom_complet; ?>
</a>
</p>
<?php }
}
}
?>
</fieldset>
<?php if($classesChoisies) {?>
<?php if($elevesChoisis) {?>
<fieldset class="margin-top:1em">
<legend>Élèves</legend>
<form method="post" action="index.php" id="form_elv" enctype="multipart/form-data">
<table class="boireaus sortable resizable"
id="tableEleves"
>
<tr>
<th>
Classe
</th>
<th>
Nom Prénom
</th>
<th>
Notes
</th>
<th>
Appréciation (prof)
</th>
</tr>
<?php $cpt=1;?>
<?php while ($elvChoisi = $elevesChoisis->fetch_object()){?>
<tr class="lig<?php echo $cpt; ?>">
<td>
<?php echo cherche_classe_APB($elvChoisi->id_classe, $anneeAPB)->nom_court; ?>
</td>
<td style="text-align: left;">
<?php echo $elvChoisi->nom; ?> <?php echo $elvChoisi->prenom; ?>
</td>
<td style="text-align: left;">
<?php
$notes = chercheNotes($elvChoisi->ine,$_SESSION['login'],$anneeAPB);
if($notes) {?>
<?php
$exMatiere = "";
$moyenne = 0;
$nbNotes = 0;
while ($noteActive = $notes->fetch_object()) {
if ($exMatiere != $noteActive->code_service) {
//on change de matière
if (0 != $moyenne) {
//on change vraiment de matière, on ferme la case, on entre l'appréciation, on crée une autre ligne
echo " moyenne = ".number_format($moyenne/$nbNotes, 2, ',', ' ')." ";
?>
</td>
<td style="text-align: left;">
<?php if (lsl_getDroit('droitAppreciation')) { ?>
<textarea rows="4" cols="70"
name="app[<?php echo $elvChoisi->ine; ?>_<?php echo $exMatiere ?>_<?php echo $anneeAPB; ?>]"
id="app_<?php echo $elvChoisi->ine; ?>_<?php echo $exMatiere ?>_<?php echo $anneeAPB; ?>"
maxlength="300"
style="text-align: left;"
/><?php echo getAppreciationProf($elvChoisi->ine, $exMatiere, $anneeAPB); ?></textarea>
<?php $prof = getUtilisateur(getLoginProfAppreciation($elvChoisi->ine, $exMatiere, $anneeAPB)); ?>
<?php if ($prof) {echo " (".$prof->nom." ".$prof->prenom.")";} ?>
<?php } ?>
</td>
</tr>
<tr class="lig<?php echo $cpt; ?>">
<td><?php echo cherche_classe_APB($elvChoisi->id_classe, $anneeAPB)->nom_court; ?></td>
<td style="text-align: left;"><?php echo $elvChoisi->nom; ?> <?php echo $elvChoisi->prenom; ?></td>
<td style="text-align: left;">
<?php
//echo $moyenne;
$exMatiere = "";
$moyenne = 0;
$nbNotes = 0;
}
echo " ".getMatiere($noteActive->code_service,$anneeAPB)." ";
}
echo "-";
if("D" == $noteActive->etat) {
echo "Dispensé";
} elseif ("N" == $noteActive->etat) {
echo "Non noté";
} else {
echo $noteActive->moyenne;
$nbNotes++;
$moyenne += floatval($noteActive->moyenne);
}
echo "-";
$exMatiere = $noteActive->code_service;
}
if (0 != $nbNotes) {
echo " moyenne = ".number_format($moyenne/$nbNotes, 2, ',', ' ')." ";
}
?>
<?php } ?>
</td>
<td style="text-align: left;">
<?php if (lsl_getDroit('droitAppreciation')) { ?>
<textarea rows="4" cols="70"
name="app[<?php echo $elvChoisi->ine; ?>_<?php echo $exMatiere ?>_<?php echo $anneeAPB; ?>]"
id="app_<?php echo $elvChoisi->ine; ?>_<?php echo $exMatiere ?>_<?php echo $anneeAPB; ?>"
maxlength="300"
style="text-align: left;"
/>
<?php echo getAppreciationProf($elvChoisi->ine, $exMatiere, $anneeAPB); ?>
</textarea>
<?php $prof = getUtilisateur(getLoginProfAppreciation($elvChoisi->ine, $exMatiere, $anneeAPB)); ?>
<?php if ($prof) {echo " (".$prof->nom." ".$prof->prenom.")";} ?>
<?php } ?>
</td>
</tr>
<?php $cpt *= -1; ?>
<?php } ?>
</table>
<p class="center">
<?php if (function_exists("add_token_field")) echo add_token_field(); ?>
<input style="margin-top:1em;" type="submit" name="appEleves" id="appEleves" value="Enregistrer" />
</p>
</form>
</fieldset>
<?php } ?>
<?php }