//echo "$sql<br />";
//echo "$sql2<br />";
$tab_lignes_OOo = array();
$nb_ligne = 0;
$res_incident = mysqli_query($GLOBALS["mysqli"], $sql);
while ($lig_incident = mysqli_fetch_object($res_incident)) {
    $tab_lignes_OOo[$nb_ligne] = array();
    $tab_lignes_OOo[$nb_ligne]['id_incident'] = $lig_incident->id_incident;
    $tab_lignes_OOo[$nb_ligne]['declarant'] = civ_nom_prenom($lig_incident->declarant, '');
    $tab_lignes_OOo[$nb_ligne]['date'] = formate_date($lig_incident->date);
    $tab_lignes_OOo[$nb_ligne]['heure'] = $lig_incident->heure;
    $tab_lignes_OOo[$nb_ligne]['nature'] = $lig_incident->nature;
    $tab_lignes_OOo[$nb_ligne]['description'] = $lig_incident->description;
    $tab_lignes_OOo[$nb_ligne]['etat'] = $lig_incident->etat;
    // Lieu
    $tab_lignes_OOo[$nb_ligne]['lieu'] = get_lieu_from_id($lig_incident->id_lieu);
    // Protagonistes
    $tab_protagonistes_eleves = array();
    $sql = "SELECT * FROM s_protagonistes WHERE id_incident='{$lig_incident->id_incident}' ORDER BY statut,qualite,login;";
    $res2 = mysqli_query($GLOBALS["mysqli"], $sql);
    if (mysqli_num_rows($res) == 0) {
        $tab_lignes_OOo[$nb_ligne]['protagonistes'] = "Aucun";
    } else {
        $liste_protagonistes = "";
        while ($lig2 = mysqli_fetch_object($res2)) {
            if ($liste_protagonistes != "") {
                $liste_protagonistes .= ", ";
            }
            if ($lig2->statut == 'eleve') {
                $liste_protagonistes .= get_nom_prenom_eleve($lig2->login, 'avec_classe');
                $tab_protagonistes_eleves[] = $lig2->login;
Ejemplo n.º 2
0
				echo "<tr class='lig$alt'>\n";
			}

			echo "<td>$lig->id_incident</td>\n";
			echo "<td>".formate_date($lig->date)."</td>\n";
			echo "<td>$lig->heure</td>\n";
			echo "<td>$lig->nature</td>\n";

			echo "<td>\n";
			if($lig->description=="") {
				$texte="Aucun détail n'a été saisi.";
			}
			else {
				$texte=nl2br($lig->description);
			}
			$lieu_incident=get_lieu_from_id($lig->id_lieu);
			if($lieu_incident!="") {$texte.="<br /><span style='font-size:x-small;'>Lieu&nbsp;:".$lieu_incident."</span>";}
			$texte.="<br /><span style='font-size:x-small;'>Incident signalé par ".u_p_nom($lig->declarant)."</span>";

			$tabdiv_infobulle[]=creer_div_infobulle("incident_".$lig->id_incident,"Incident n°$lig->id_incident","",$texte,"",30,0,'y','y','n','n');

			//if($lig->etat=='clos') {
			if(($lig->etat=='clos')||(($_SESSION['statut']=='professeur')&&($lig->declarant!=$_SESSION['login']))) {
				echo "<a href='#'";
				//echo " onmouseover=\"delais_afficher_div('incident_".$lig->id_incident."','y',20,20,$delais_affichage_infobulle,$largeur_survol_infobulle,$hauteur_survol_infobulle);\"";
				echo " onmouseover=\"cacher_toutes_les_infobulles();afficher_div('incident_".$lig->id_incident."','y',20,20);\"";
				echo " onclick='return false;'";
				echo ">Détails</a>";
			}
			else {
				//echo "<a href='saisie_incident.php?id_incident=$lig->id_incident&amp;step=2' onmouseover=\"delais_afficher_div('incident_".$lig->id_incident."','y',20,20,$delais_affichage_infobulle,$largeur_survol_infobulle,$hauteur_survol_infobulle);\"";
Ejemplo n.º 3
0
function rappel_incident($id_incident, $mode_retour = 'echo')
{
    global $mod_disc_terme_incident;
    $retour = "";
    $retour .= "<p class='bold'>Rappel de l'" . $mod_disc_terme_incident;
    if (isset($id_incident)) {
        $retour .= " n°{$id_incident}";
        $sql = "SELECT declarant FROM s_incidents WHERE id_incident='{$id_incident}';";
        $res_dec = mysqli_query($GLOBALS["mysqli"], $sql);
        if (mysqli_num_rows($res_dec) > 0) {
            $lig_dec = mysqli_fetch_object($res_dec);
            $retour .= " (<span style='font-size:x-small; font-style:italic;'>signalé par " . u_p_nom($lig_dec->declarant) . "</span>)";
        }
    }
    $retour .= "&nbsp;:</p>\n";
    $retour .= "<blockquote>\n";
    $sql = "SELECT * FROM s_incidents WHERE id_incident='{$id_incident}';";
    //$retour.="$sql<br />\n";
    $res_incident = mysqli_query($GLOBALS["mysqli"], $sql);
    if (mysqli_num_rows($res_incident) > 0) {
        $lig_incident = mysqli_fetch_object($res_incident);
        $retour .= "<table class='boireaus' border='1' summary='" . ucfirst($mod_disc_terme_incident) . "'>\n";
        $retour .= "<tr class='lig1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Date: </td><td style='text-align:left;'>" . formate_date($lig_incident->date) . "</td></tr>\n";
        $retour .= "<tr class='lig-1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Heure: </td><td style='text-align:left;'>{$lig_incident->heure}</td></tr>\n";
        $retour .= "<tr class='lig1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Lieu: </td><td style='text-align:left;'>";
        /*
        $sql="SELECT lieu FROM s_lieux_incidents WHERE id='$lig_incident->id_lieu';";
        $res_lieu_incident=mysql_query($sql);
        if(mysql_num_rows($res_lieu_incident)>0) {
        	$lig_lieu_incident=mysql_fetch_object($res_incident);
        	$retour.=$lig_lieu_incident->lieu;
        }
        */
        $retour .= get_lieu_from_id($lig_incident->id_lieu);
        $retour .= "</td></tr>\n";
        $retour .= "<tr class='lig-1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Nature: </td><td style='text-align:left;'>{$lig_incident->nature}</td></tr>\n";
        $retour .= "<tr class='lig1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Description: </td><td style='text-align:left;'>" . nl2br($lig_incident->description) . "</td></tr>\n";
        /*
        $sql="SELECT * FROM s_traitement_incident sti, s_mesures s WHERE sti.id_incident='$id_incident' AND sti.id_mesure=s.id;";
        $res_t_incident=mysql_query($sql);
        if(mysql_num_rows($res_t_incident)>0) {
        	$retour.="<tr class='lig-1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Mesures&nbsp;: </td>\n";
        	$retour.="<td style='text-align:left;'>";
        	while($lig_t_incident=mysql_fetch_object($res_t_incident)) {
        		$retour.="$lig_t_incident->mesure (<em style='color:green;'>mesure $lig_t_incident->type</em>)<br />";
        	}
        	$retour.="</td>\n";
        	$retour.="</tr>\n";
        }
        */
        $texte = affiche_mesures_incident($lig_incident->id_incident);
        if ($texte != '') {
            $retour .= "<tr class='lig-1'><td style='font-weight:bold;vertical-align:top;text-align:left;'>Mesures&nbsp;: </td>\n";
            $retour .= "<td style='text-align:left;'>";
            $retour .= $texte;
            $retour .= "</td>\n";
            $retour .= "</tr>\n";
        }
        $retour .= "</table>\n";
    } else {
        $retour .= "<p>L'" . $mod_disc_terme_incident . " n°{$id_incident} ne semble pas enregistré???</p>\n";
    }
    $retour .= "</blockquote>\n";
    if ($mode_retour == 'echo') {
        echo $retour;
    } else {
        return $retour;
    }
}