예제 #1
0
$eleve_id = isset($_POST['f_user']) ? Clean::entier($_POST['f_user']) : 0;
if (!in_array($action, array('proposer', 'enregistrer')) || !$serie_ref || !$classe_id || !$eleve_id) {
    exit('Erreur avec les données transmises !');
}
$DB_TAB_epreuves = DB_STRUCTURE_BREVET::DB_lister_brevet_epreuves($serie_ref);
if (empty($DB_TAB_epreuves)) {
    exit('Erreur : série inconnue !');
}
// Récupérer les paramètres des épreuves
$tab_epreuve = array();
foreach ($DB_TAB_epreuves as $DB_ROW) {
    $tab_epreuve[$DB_ROW['brevet_epreuve_code']] = array('epreuve_nom' => $DB_ROW['brevet_epreuve_nom'], 'epreuve_obligatoire' => (bool) $DB_ROW['brevet_epreuve_obligatoire'], 'epreuve_note_chiffree' => (bool) $DB_ROW['brevet_epreuve_note_chiffree'], 'epreuve_point_sup_10' => (bool) $DB_ROW['brevet_epreuve_point_sup_10'], 'epreuve_note_comptee' => (bool) $DB_ROW['brevet_epreuve_note_comptee'], 'epreuve_coefficient' => (int) $DB_ROW['brevet_epreuve_coefficient'], 'epreuve_code_speciaux' => $DB_ROW['brevet_epreuve_code_speciaux'], 'epreuve_choix_recherche' => (bool) $DB_ROW['brevet_epreuve_choix_recherche'], 'epreuve_choix_moyenne' => (bool) $DB_ROW['brevet_epreuve_choix_moyenne'], 'epreuve_choix_matieres' => $DB_ROW['brevet_epreuve_choix_matieres']);
}
// Récupérer les notes déjà enregistrées
$tab_notes_enregistrees = array();
$DB_TAB = DB_STRUCTURE_BREVET::DB_lister_brevet_notes_eleve($serie_ref, $eleve_id);
if (count($DB_TAB)) {
    foreach ($DB_TAB as $DB_ROW) {
        $tab_notes_enregistrees[$DB_ROW['brevet_epreuve_code']] = array('note' => $DB_ROW['saisie_note'], 'matieres_id' => $DB_ROW['matieres_id']);
    }
}
// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Proposer une note pour chaque épreuve
// ////////////////////////////////////////////////////////////////////////////////////////////////////
if ($action == 'proposer') {
    $tab_codes = array('AB' => 'AB (absent)', 'DI' => 'DI (dispensé)', 'VA' => 'VA (validé)', 'NV' => 'NV (non validé)');
    $optgroup_notes_chiffrees = '<optgroup label="Notes chiffrées">';
    for ($note = 0; $note <= 20; $note += 0.5) {
        $optgroup_notes_chiffrees .= '<option value="' . str_replace('.', 'v', (string) $note) . '">' . sprintf("%05.2f", $note) . ' / 20</option>';
    }
    $optgroup_notes_chiffrees .= '</optgroup>';