Example #1
0
		if($temoin_modif_fichier>0) {
			$mode="modif";
			$valeur=$_POST['traitement'];
		}
	}



}

if(($mode=="suppr_sanction")&&(isset($id_sanction))) {
	check_token();

	$suppression_sanction_possible="y";
	if(($_SESSION['statut']=='professeur')&&(!sanction_saisie_par($id_sanction, $_SESSION['login']))) {
		$suppression_sanction_possible="n";
		$msg.="Vous n'avez pas le droit de supprimer cette sanction.<br />";
		// Tentative intrusion?
	}

	if($suppression_sanction_possible=="y") {
		$msg.=suppr_doc_joints_sanction($id_sanction);

		$sql="DELETE FROM s_travail WHERE id_sanction='$id_sanction';";
		$res=mysqli_query($GLOBALS["mysqli"], $sql);
		$sql="DELETE FROM s_exclusions WHERE id_sanction='$id_sanction';";
		$res=mysqli_query($GLOBALS["mysqli"], $sql);
		$sql="DELETE FROM s_retenues WHERE id_sanction='$id_sanction';";
		$res=mysqli_query($GLOBALS["mysqli"], $sql);
		$sql="DELETE FROM s_autres_sanctions WHERE id_sanction='$id_sanction';";
Example #2
0
    $insert = mysqli_query($GLOBALS["mysqli"], $sql);
}
if (!checkAccess()) {
    header("Location: ../logout.php?auto=1");
    die;
}
if (!getSettingAOui('active_mod_discipline')) {
    $mess = rawurlencode("Vous tentez d accéder au module Discipline qui est désactivé !");
    tentative_intrusion(1, "Tentative d'accès au module Discipline qui est désactivé.");
    header("Location: ../accueil.php?msg={$mess}");
    die;
}
require 'sanctions_func_lib.php';
if (isset($_GET['modif_sanction']) && $_GET['modif_sanction'] == "etat_effectuee" && isset($_GET['id_sanction']) && preg_match("/^[0-9]{1,}\$/", $_GET['id_sanction'])) {
    check_token();
    if (in_array($_SESSION['statut'], array('administrateur', 'scolarite', 'cpe')) || $_SESSION['statut'] == 'professeur' && sanction_saisie_par($_GET['id_sanction'], $_SESSION['login'])) {
        $sql = "SELECT effectuee FROM s_sanctions WHERE id_sanction='" . $_GET['id_sanction'] . "';";
        $res = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res) == 0) {
            echo "<span style='color:red'>Identifiant de sanction inconnu (<em>" . $_GET['id_sanction'] . "</em>)</span>";
        } else {
            $lig = mysqli_fetch_object($res);
            if ($lig->effectuee == "O") {
                $valeur_alt = "N";
            } else {
                $valeur_alt = "O";
            }
            $sql = "UPDATE s_sanctions SET effectuee='" . $valeur_alt . "' WHERE id_sanction='" . $_GET['id_sanction'] . "';";
            $update = mysqli_query($GLOBALS["mysqli"], $sql);
            if (!$update) {
                echo "<span style='color:red'>Erreur</span>";
         $tabdiv_infobulle[] = creer_div_infobulle("div_travail_sanction_{$lig_sanction->id_sanction}", "Travail (sanction n°{$lig_sanction->id_sanction})", "", $texte, "", 20, 0, 'y', 'y', 'n', 'n', 2);
         echo " <a href=\"" . $_SERVER['PHP_SELF'] . "?jour_sanction={$jour_sanction}&amp;details=y\"";
         //echo " onmouseover=\"delais_afficher_div('div_travail_sanction_$lig_sanction->id_sanction','y',10,-40,$delais_affichage_infobulle,$largeur_survol_infobulle,$hauteur_survol_infobulle);\"";
         //echo " onmouseover=\"cacher_toutes_les_infobulles();afficher_div('div_travail_sanction_$lig_sanction->id_sanction','y',20,20);\"";
         echo " onmouseover=\"cacher_toutes_les_infobulles();delais_afficher_div('div_travail_sanction_{$lig_sanction->id_sanction}','y',20,60,{$delais_affichage_infobulle},{$largeur_survol_infobulle},{$hauteur_survol_infobulle});\"";
         echo " onclick=\"return confirm_abandon (this, change, '{$themessage}')\" title=\"Afficher les détails en infobulle.\"";
         echo ">Détails</a>";
     }
 }
 echo "</td>\n";
 echo "<td>\n";
 echo civ_nom_prenom(get_login_declarant_incident($lig_sanction->id_incident));
 echo "</td>\n";
 echo "<td>\n";
 $marquer_sanction_effectuee_possible = "y";
 if ($_SESSION['statut'] == 'professeur' && !sanction_saisie_par($lig_sanction->id_sanction, $_SESSION['login'])) {
     $marquer_sanction_effectuee_possible = "n";
 }
 if ($marquer_sanction_effectuee_possible == "y") {
     echo "<input type='checkbox' name='sanction_effectuee[{$lig_sanction->id_sanction}]' value='effectuee' ";
     if ($lig_sanction->effectuee == "O") {
         echo "checked='checked' ";
     }
     echo "onchange='changement();' ";
     echo "/>\n";
     echo "<input type='hidden' name='form_id_sanction[]' value='{$lig_sanction->id_sanction}' />\n";
 } else {
     if ($lig_sanction->effectuee == "O") {
         echo "<span style='color:green'>O</span>";
     } else {
         echo "<span style='color:red'>N</span>";
Example #4
0
function liste_sanctions($id_incident, $ele_login)
{
    global $mod_disc_terme_incident;
    global $mod_disc_terme_sanction;
    // Pour que les infobulles définies ici fonctionnent même si elles sont appelées depuis une autre infobulle
    global $tabdiv_infobulle;
    global $delais_affichage_infobulle, $largeur_survol_infobulle, $hauteur_survol_infobulle;
    $retour = "";
    $sql = "SELECT etat FROM s_incidents WHERE id_incident='{$id_incident}';";
    $res = mysqli_query($GLOBALS["mysqli"], $sql);
    if (mysqli_num_rows($res) == 0) {
        $retour = "<p style='color:red;'>L'incident n°{$id_incident} n'existe pas???</p>\n";
    } else {
        $lig_inc = mysqli_fetch_object($res);
        $etat_incident = $lig_inc->etat;
        // Retenues
        $sql = "SELECT * FROM s_sanctions s, s_retenues sr WHERE s.id_incident={$id_incident} AND s.login='******' AND sr.id_sanction=s.id_sanction ORDER BY sr.date, sr.heure_debut;";
        //$retour.="$sql<br />\n";
        $res_sanction = mysqli_query($GLOBALS["mysqli"], $sql);
        $res_sanction_tmp = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res_sanction) > 0) {
            $retour .= "<table class='boireaus' border='1' summary='Retenues' style='margin:2px;'>\n";
            $retour .= "<tr>\n";
            $retour .= "<th>Nature</th>\n";
            $retour .= "<th>Date</th>\n";
            $retour .= "<th>Heure</th>\n";
            $retour .= "<th>Durée</th>\n";
            $retour .= "<th>Lieu</th>\n";
            $retour .= "<th>Travail</th>\n";
            $lig_sanction_tmp = mysqli_fetch_object($res_sanction_tmp);
            $nombre_de_report = nombre_reports($lig_sanction_tmp->id_sanction, 0);
            if ($nombre_de_report != 0) {
                $retour .= "<th>Nbre report</th>\n";
            }
            // 20141106
            //if(($etat_incident!='clos')&&($_SESSION['statut']!='professeur')) {
            $retour .= "<th>Effectuée</th>\n";
            //}
            //if($etat_incident!='clos') {
            if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                $retour .= "<th>Suppr</th>\n";
            }
            $retour .= "</tr>\n";
            $alt_b = 1;
            while ($lig_sanction = mysqli_fetch_object($res_sanction)) {
                $alt_b = $alt_b * -1;
                $retour .= "<tr class='lig{$alt_b}'>\n";
                //$retour.="<td>Retenue</td>\n";
                if ($etat_incident != 'clos' && ($_SESSION['statut'] != 'professeur' && $_SESSION['statut'] != 'autre')) {
                    $retour .= "<td><a href='saisie_sanction.php?mode=modif&amp;valeur={$lig_sanction->id_nature_sanction}&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}&amp;ele_login={$ele_login}'>" . ucfirst($lig_sanction->nature) . "</a></td>\n";
                } else {
                    $retour .= "<td>" . ucfirst($lig_sanction->nature) . "</td>\n";
                }
                $retour .= "<td>" . formate_date($lig_sanction->date) . "</td>\n";
                $retour .= "<td>{$lig_sanction->heure_debut}</td>\n";
                $retour .= "<td>{$lig_sanction->duree}</td>\n";
                $retour .= "<td>{$lig_sanction->lieu}</td>\n";
                //$retour.="<td>".nl2br($lig_sanction->travail)."</td>\n";
                $retour .= "<td>";
                $tmp_doc_joints = liste_doc_joints_sanction($lig_sanction->id_sanction);
                if ($lig_sanction->travail == "" && $tmp_doc_joints == "") {
                    $texte = "Aucun travail";
                } else {
                    $texte = nl2br($lig_sanction->travail);
                    if ($tmp_doc_joints != "") {
                        if ($texte != "") {
                            $texte .= "<br />";
                        }
                        $texte .= $tmp_doc_joints;
                    }
                }
                $tabdiv_infobulle[] = creer_div_infobulle("div_travail_sanction_{$lig_sanction->id_sanction}", "Travail (" . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction})", "", $texte, "", 20, 0, 'y', 'y', 'n', 'n', 2);
                $retour .= " <a href='#' onmouseover=\"document.getElementById('div_travail_sanction_{$lig_sanction->id_sanction}').style.zIndex=document.getElementById('sanctions_incident_{$id_incident}').style.zIndex+1;delais_afficher_div('div_travail_sanction_{$lig_sanction->id_sanction}','y',10,-40,{$delais_affichage_infobulle},{$largeur_survol_infobulle},{$hauteur_survol_infobulle});\" onclick=\"return false;\">Détails</a>";
                $retour .= "</td>\n";
                if ($nombre_de_report != 0) {
                    $retour .= "<td>\n";
                    $retour .= $nombre_de_report;
                    $retour .= "</td>";
                }
                // 20141106
                // Sanction effectuée
                if ($etat_incident == 'clos') {
                    $retour .= "<td>";
                    if ($lig_sanction->effectuee == "O") {
                        $retour .= "<span style='color:green'>O</span>";
                    } else {
                        $retour .= "<span style='color:red'>N</span>";
                    }
                    $retour .= "</td>\n";
                } else {
                    $retour .= "<td";
                    if (in_array($_SESSION['statut'], array('administrateur', 'scolarite', 'cpe')) || $_SESSION['statut'] == 'professeur' && sanction_saisie_par($lig_sanction->id_sanction, $_SESSION['login'])) {
                        $retour .= " title=\"Cliquez pour marquer la sanction comme effectuée ou non effectuée\"";
                        if ($lig_sanction->effectuee == "O") {
                            $valeur_alt = "N";
                        } else {
                            $valeur_alt = "O";
                        }
                        $retour .= "<a href='#' onclick=\"maj_etat_sanction_effectuee_ou_non({$lig_sanction->id_sanction}, '{$valeur_alt}')\">";
                        $retour .= "<span id='span_sanction_effectuee_" . $lig_sanction->id_sanction . "'>";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'> O </span>";
                        } else {
                            $retour .= "<span style='color:red'> N </span>";
                        }
                        $retour .= "</span>";
                        $retour .= "</a>";
                    } else {
                        $retour .= ">";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                    }
                    $retour .= "</td>\n";
                }
                if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                    //$retour.="<td><a href='".$_SERVER['PHP_SELF']."?mode=suppr_sanction&amp;id_sanction=$lig_sanction->id_sanction&amp;id_incident=$id_incident' title='Supprimer la sanction n°$lig_sanction->id_sanction'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la sanction n°$lig_sanction->id_sanction' /></a></td>\n";
                    $retour .= "<td><a href='saisie_sanction.php?mode=suppr_sanction&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}" . add_token_in_url() . "' title='Supprimer la sanction n°{$lig_sanction->id_sanction}'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la " . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction}' /></a></td>\n";
                }
                $retour .= "</tr>\n";
            }
            $retour .= "</table>\n";
        }
        // Exclusions
        $sql = "SELECT * FROM s_sanctions s, s_exclusions se WHERE s.id_incident={$id_incident} AND s.login='******' AND se.id_sanction=s.id_sanction ORDER BY se.date_debut, se.heure_debut;";
        //$retour.="$sql<br />\n";
        $res_sanction = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res_sanction) > 0) {
            $retour .= "<table class='boireaus' border='1' summary='Exclusions' style='margin:2px;'>\n";
            $retour .= "<tr>\n";
            $retour .= "<th>Nature</th>\n";
            $retour .= "<th>Date début</th>\n";
            $retour .= "<th>Heure début</th>\n";
            $retour .= "<th>Date fin</th>\n";
            $retour .= "<th>Heure fin</th>\n";
            $retour .= "<th>Lieu</th>\n";
            $retour .= "<th>Travail</th>\n";
            // 20141106
            //if(($etat_incident!='clos')&&($_SESSION['statut']!='professeur')) {
            $retour .= "<th>Effectuée</th>\n";
            //}
            if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                $retour .= "<th>Suppr</th>\n";
            }
            $retour .= "</tr>\n";
            $alt_b = 1;
            while ($lig_sanction = mysqli_fetch_object($res_sanction)) {
                $alt_b = $alt_b * -1;
                $retour .= "<tr class='lig{$alt_b}'>\n";
                //$retour.="<td>Exclusion</td>\n";
                if ($etat_incident != 'clos' && ($_SESSION['statut'] != 'professeur' && $_SESSION['statut'] != 'autre')) {
                    $retour .= "<td><a href='saisie_sanction.php?mode=modif&amp;valeur={$lig_sanction->id_nature_sanction}&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}&amp;ele_login={$ele_login}'>" . ucfirst($lig_sanction->nature) . "</a></td>\n";
                } else {
                    $retour .= "<td>" . ucfirst($lig_sanction->nature) . "</td>\n";
                }
                $retour .= "<td>" . formate_date($lig_sanction->date_debut) . "</td>\n";
                $retour .= "<td>{$lig_sanction->heure_debut}</td>\n";
                $retour .= "<td>" . formate_date($lig_sanction->date_fin) . "</td>\n";
                $retour .= "<td>{$lig_sanction->heure_fin}</td>\n";
                $retour .= "<td>{$lig_sanction->lieu}</td>\n";
                //$retour.="<td>".nl2br($lig_sanction->travail)."</td>\n";
                $retour .= "<td>";
                $tmp_doc_joints = liste_doc_joints_sanction($lig_sanction->id_sanction);
                if ($lig_sanction->travail == "" && $tmp_doc_joints == "") {
                    $texte = "Aucun travail";
                } else {
                    $texte = nl2br($lig_sanction->travail);
                    if ($tmp_doc_joints != "") {
                        if ($texte != "") {
                            $texte .= "<br />";
                        }
                        $texte .= $tmp_doc_joints;
                    }
                }
                $tabdiv_infobulle[] = creer_div_infobulle("div_travail_sanction_{$lig_sanction->id_sanction}", "Travail (" . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction})", "", $texte, "", 20, 0, 'y', 'y', 'n', 'n', 2);
                $retour .= " <a href='#' onmouseover=\"document.getElementById('div_travail_sanction_{$lig_sanction->id_sanction}').style.zIndex=document.getElementById('sanctions_incident_{$id_incident}').style.zIndex+1;delais_afficher_div('div_travail_sanction_{$lig_sanction->id_sanction}','y',10,-40,{$delais_affichage_infobulle},{$largeur_survol_infobulle},{$hauteur_survol_infobulle});\" onclick=\"return false;\">Détails</a>";
                $retour .= "</td>\n";
                // 20141106
                // Sanction effectuée
                if ($etat_incident == 'clos') {
                    $retour .= "<td>";
                    if ($lig_sanction->effectuee == "O") {
                        $retour .= "<span style='color:green'>O</span>";
                    } else {
                        $retour .= "<span style='color:red'>N</span>";
                    }
                    $retour .= "</td>\n";
                } else {
                    $retour .= "<td";
                    if (in_array($_SESSION['statut'], array('administrateur', 'scolarite', 'cpe')) || $_SESSION['statut'] == 'professeur' && sanction_saisie_par($lig_sanction->id_sanction, $_SESSION['login'])) {
                        $retour .= " title=\"Cliquez pour marquer la sanction comme effectuée ou non effectuée\"";
                        if ($lig_sanction->effectuee == "O") {
                            $valeur_alt = "N";
                        } else {
                            $valeur_alt = "O";
                        }
                        $retour .= "<a href='#' onclick=\"maj_etat_sanction_effectuee_ou_non({$lig_sanction->id_sanction}, '{$valeur_alt}')\">";
                        $retour .= "<span id='span_sanction_effectuee_" . $lig_sanction->id_sanction . "'>";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                        $retour .= "</span>";
                        $retour .= "</a>";
                    } else {
                        $retour .= ">";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                    }
                    $retour .= "</td>\n";
                }
                if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                    //$retour.="<td><a href='".$_SERVER['PHP_SELF']."?mode=suppr_sanction&amp;id_sanction=$lig_sanction->id_sanction&amp;id_incident=$id_incident' title='Supprimer la sanction n°$lig_sanction->id_sanction'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la sanction n°$lig_sanction->id_sanction' /></a></td>\n";
                    $retour .= "<td><a href='saisie_sanction.php?mode=suppr_sanction&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}" . add_token_in_url() . "' title='Supprimer la sanction n°{$lig_sanction->id_sanction}'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la " . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction}' /></a></td>\n";
                }
                $retour .= "</tr>\n";
            }
            $retour .= "</table>\n";
        }
        // Simple travail
        $sql = "SELECT * FROM s_sanctions s, s_travail st WHERE s.id_incident={$id_incident} AND s.login='******' AND st.id_sanction=s.id_sanction ORDER BY st.date_retour;";
        //$retour.="$sql<br />\n";
        $res_sanction = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res_sanction) > 0) {
            $retour .= "<table class='boireaus' border='1' summary='Travail' style='margin:2px;'>\n";
            $retour .= "<tr>\n";
            $retour .= "<th>Nature</th>\n";
            $retour .= "<th>Date retour</th>\n";
            $retour .= "<th>Travail</th>\n";
            // 20141106
            //if(($etat_incident!='clos')&&($_SESSION['statut']!='professeur')) {
            $retour .= "<th>Effectuée</th>\n";
            //}
            if ($etat_incident != 'clos') {
                $retour .= "<th>Suppr</th>\n";
            }
            $retour .= "</tr>\n";
            $alt_b = 1;
            while ($lig_sanction = mysqli_fetch_object($res_sanction)) {
                $alt_b = $alt_b * -1;
                $retour .= "<tr class='lig{$alt_b}'>\n";
                if ($etat_incident != 'clos' && ($_SESSION['statut'] != 'professeur' && $_SESSION['statut'] != 'autre')) {
                    $retour .= "<td><a href='saisie_sanction.php?mode=modif&amp;valeur={$lig_sanction->id_nature_sanction}&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}&amp;ele_login={$ele_login}'>" . ucfirst($lig_sanction->nature) . "</a></td>\n";
                } else {
                    $retour .= "<td>" . ucfirst($lig_sanction->nature) . "</td>\n";
                }
                $retour .= "<td>" . formate_date($lig_sanction->date_retour) . "</td>\n";
                $retour .= "<td>";
                $tmp_doc_joints = liste_doc_joints_sanction($lig_sanction->id_sanction);
                if ($lig_sanction->travail == "" && $tmp_doc_joints == "") {
                    $texte = "Aucun travail";
                } else {
                    $texte = nl2br($lig_sanction->travail);
                    if ($tmp_doc_joints != "") {
                        if ($texte != "") {
                            $texte .= "<br />";
                        }
                        $texte .= $tmp_doc_joints;
                    }
                }
                $tabdiv_infobulle[] = creer_div_infobulle("div_travail_sanction_{$lig_sanction->id_sanction}", "Travail (" . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction})", "", $texte, "", 20, 0, 'y', 'y', 'n', 'n', 2);
                $retour .= " <a href='#' onmouseover=\"document.getElementById('div_travail_sanction_{$lig_sanction->id_sanction}').style.zIndex=document.getElementById('sanctions_incident_{$id_incident}').style.zIndex+1;delais_afficher_div('div_travail_sanction_{$lig_sanction->id_sanction}','y',10,-40,{$delais_affichage_infobulle},{$largeur_survol_infobulle},{$hauteur_survol_infobulle});\" onclick=\"return false;\">Détails</a>";
                $retour .= "</td>\n";
                // 20141106
                // Sanction effectuée
                if ($etat_incident == 'clos') {
                    $retour .= "<td>";
                    if ($lig_sanction->effectuee == "O") {
                        $retour .= "<span style='color:green'>O</span>";
                    } else {
                        $retour .= "<span style='color:red'>N</span>";
                    }
                    $retour .= "</td>\n";
                } else {
                    $retour .= "<td";
                    if (in_array($_SESSION['statut'], array('administrateur', 'scolarite', 'cpe')) || $_SESSION['statut'] == 'professeur' && sanction_saisie_par($lig_sanction->id_sanction, $_SESSION['login'])) {
                        $retour .= " title=\"Cliquez pour marquer la sanction comme effectuée ou non effectuée\"";
                        if ($lig_sanction->effectuee == "O") {
                            $valeur_alt = "N";
                        } else {
                            $valeur_alt = "O";
                        }
                        $retour .= "<a href='#' onclick=\"maj_etat_sanction_effectuee_ou_non({$lig_sanction->id_sanction}, '{$valeur_alt}')\">";
                        $retour .= "<span id='span_sanction_effectuee_" . $lig_sanction->id_sanction . "'>";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                        $retour .= "</span>";
                        $retour .= "</a>";
                    } else {
                        $retour .= ">";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                    }
                    $retour .= "</td>\n";
                }
                if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                    //$retour.="<td><a href='".$_SERVER['PHP_SELF']."?mode=suppr_sanction&amp;id_sanction=$lig_sanction->id_sanction&amp;id_incident=$id_incident' title='Supprimer la sanction n°$lig_sanction->id_sanction'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la sanction n°$lig_sanction->id_sanction' /></a></td>\n";
                    $retour .= "<td><a href='saisie_sanction.php?mode=suppr_sanction&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}" . add_token_in_url() . "' title='Supprimer la " . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction}'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la " . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction}' /></a></td>\n";
                }
                $retour .= "</tr>\n";
            }
            $retour .= "</table>\n";
        }
        // Autres sanctions
        $sql = "SELECT * FROM s_sanctions s, s_autres_sanctions sa, s_types_sanctions2 sts WHERE s.id_incident='{$id_incident}' AND s.login='******' AND sa.id_sanction=s.id_sanction AND sa.id_nature=sts.id_nature ORDER BY sts.nature;";
        //echo "$sql<br />\n";
        $res_sanction = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res_sanction) > 0) {
            $retour .= "<table class='boireaus' border='1' summary='Autres " . $mod_disc_terme_sanction . "s' style='margin:2px;'>\n";
            $retour .= "<tr>\n";
            $retour .= "<th>Nature</th>\n";
            $retour .= "<th>Description</th>\n";
            // 20141106
            //if(($etat_incident!='clos')&&($_SESSION['statut']!='professeur')) {
            $retour .= "<th>Effectuée</th>\n";
            //}
            $retour .= "<th>Suppr</th>\n";
            $retour .= "</tr>\n";
            $alt_b = 1;
            while ($lig_sanction = mysqli_fetch_object($res_sanction)) {
                $alt_b = $alt_b * -1;
                $retour .= "<tr class='lig{$alt_b}'>\n";
                $retour .= "<td><a href='" . $_SERVER['PHP_SELF'] . "?mode=modif&amp;valeur=" . $lig_sanction->id_nature . "&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}&amp;ele_login={$ele_login}'>{$lig_sanction->nature}</a></td>\n";
                $retour .= "<td>\n";
                $texte = nl2br($lig_sanction->description);
                $tmp_doc_joints = liste_doc_joints_sanction($lig_sanction->id_sanction);
                if ($tmp_doc_joints != "") {
                    $texte .= "<br />";
                    $texte .= $tmp_doc_joints;
                }
                $tabdiv_infobulle[] = creer_div_infobulle("div_autre_sanction_{$lig_sanction->id_sanction}", "{$lig_sanction->nature} (" . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction})", "", $texte, "", 20, 0, 'y', 'y', 'n', 'n');
                $retour .= " <a href='#' onmouseover=\"document.getElementById('div_autre_sanction_{$lig_sanction->id_sanction}').style.zIndex=document.getElementById('sanctions_incident_{$id_incident}').style.zIndex+1;delais_afficher_div('div_autre_sanction_{$lig_sanction->id_sanction}','y',10,-40,{$delais_affichage_infobulle},{$largeur_survol_infobulle},{$hauteur_survol_infobulle});\" onclick=\"return false;\">Détails</a>";
                $retour .= "</td>\n";
                // 20141106
                // Sanction effectuée
                if ($etat_incident == 'clos') {
                    $retour .= "<td>";
                    if ($lig_sanction->effectuee == "O") {
                        $retour .= "<span style='color:green'>O</span>";
                    } else {
                        $retour .= "<span style='color:red'>N</span>";
                    }
                    $retour .= "</td>\n";
                } else {
                    $retour .= "<td";
                    if (in_array($_SESSION['statut'], array('administrateur', 'scolarite', 'cpe')) || $_SESSION['statut'] == 'professeur' && sanction_saisie_par($lig_sanction->id_sanction, $_SESSION['login'])) {
                        $retour .= " title=\"Cliquez pour marquer la sanction comme effectuée ou non effectuée\"";
                        if ($lig_sanction->effectuee == "O") {
                            $valeur_alt = "N";
                        } else {
                            $valeur_alt = "O";
                        }
                        $retour .= "<a href='#' onclick=\"maj_etat_sanction_effectuee_ou_non({$lig_sanction->id_sanction}, '{$valeur_alt}')\">";
                        $retour .= "<span id='span_sanction_effectuee_" . $lig_sanction->id_sanction . "'>";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                        $retour .= "</span>";
                        $retour .= "</a>";
                    } else {
                        $retour .= ">";
                        if ($lig_sanction->effectuee == "O") {
                            $retour .= "<span style='color:green'>O</span>";
                        } else {
                            $retour .= "<span style='color:red'>N</span>";
                        }
                    }
                    $retour .= "</td>\n";
                }
                if ($etat_incident != 'clos' && $_SESSION['statut'] != 'professeur') {
                    //$retour.="<td><a href='".$_SERVER['PHP_SELF']."?mode=suppr_sanction&amp;id_sanction=$lig_sanction->id_sanction&amp;id_incident=$id_incident' title='Supprimer la sanction n°$lig_sanction->id_sanction'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la sanction n°$lig_sanction->id_sanction' /></a></td>\n";
                    $retour .= "<td><a href='saisie_sanction.php?mode=suppr_sanction&amp;id_sanction={$lig_sanction->id_sanction}&amp;id_incident={$id_incident}" . add_token_in_url() . "' title='Supprimer la sanction n°{$lig_sanction->id_sanction}'><img src='../images/icons/delete.png' width='16' height='16' alt='Supprimer la " . $mod_disc_terme_sanction . " n°{$lig_sanction->id_sanction}' /></a></td>\n";
                }
                $retour .= "</tr>\n";
            }
            $retour .= "</table>\n";
        }
    }
    return $retour;
}