Tableau couleur ligne pour données
Posté : 25 janv. 2012, 10:31
Bonjour à tous.
J'ai actuellement un tableau qui est composé de 2 types de valeurs: il y a des actions et des notes dans un seul tableau.
j'aimerais pouvoir mettre la couleur de fond en jaune lorsque c'est une note
Je cherche depuis plusieurs jours mais sans trouvé la solution...
Pour être plus concret voici mon tableau:
Comme vous l'avez vu j'ai tenté de faire quelque chose (mais sans succès) dans la partie que j'ai mis en commentaire
Si ça peut vous aidez voici ma requête sql:
Merci bien de m'avoir lu et pour votre aide
J'ai actuellement un tableau qui est composé de 2 types de valeurs: il y a des actions et des notes dans un seul tableau.
j'aimerais pouvoir mettre la couleur de fond en jaune lorsque c'est une note
Je cherche depuis plusieurs jours mais sans trouvé la solution...
Pour être plus concret voici mon tableau:
echo " <table class=\"Tabledonnees\" ><thead><tr>";
echo "<th>Type action</th>
<th>Date action</th>
<th>Auteur</th>
<th>Contact</th>
<th>Téléphone/Mail</th>
<th>Résultat</th>
<th>Description de l'action</th>
<th>Date rappel</th>
<th>Réc.</th>
<th>Action <br>planifiée</th><th></th><th></th>
</tr></thead>";
$altenative=0; $numligne = 0; $vide="vrai"; $c_ligne=""; $c_ligne2="";
while ($ligne=mysql_fetch_array($resultset)){
/*if($_REQUEST["LIB_TYP_ACT"]='NOTE')
{?>
<td bgcolor='yellow' >
<?
}
else
{?>
<td bgcolor='white' >
<?}*/
echo "<tr valign=top>";
echo "<td >".$ligne["LIB_TYP_ACT"]."</td>";
echo "<td >".datemysql2francais($ligne["DATE_ACT"])."</td>";
echo "<td >".$ligne["EMP"]."</td>";
echo "<td >".$ligne["CON_LOC"]."</td>";
echo "<td >".$ligne["MAIL_CON_LOC"]."</td>";
echo "<td >".$ligne["LIB_RES"]."</td>";
echo "<td >".stripslashes($ligne["DESC_ACT"]);
if ($ligne["REF_ADR_LOC"] != "" && $ligne["REF_ADR_LOC"] != 0 ) echo " <br> <b>Adresse de visite:</b><br>".get_adresse_locataire($ligne["REF_ADR_LOC"]);
echo "</td>";
echo "<td >".datemysql2francaiscourt($ligne["DATE_RAPPEL"])."</td>";
echo "<td >";
//getACTION_RECURENTE($ligne["FLAG_ALE"]).
if ($ligne["FLAG_ALE"] == 1 ) echo "<img src=\"img/green_tick.gif\" border=0>";
echo "</td>";
echo "<td >". get_action_plannifiee($ligne["ACT_PLA"])."</td>";
echo "<td ><a href=\"modi_action.php?onglet=6&NUM_CON=".$NUM_CON."&NUM_ACT=".$ligne["NUM_ACT"]."&NUM_DOS=".$NUM_DOS."\"> <img border=\"0\" src=\"img/b_edit.png\" atl=\"Modi\"></a></td>";
echo "<td>";
if ($_SESSION['niveau'] == 1) {
echo "<a href=\"detail_dossier.php?onglet=6&libelle=l&supp_action=oui&NUM_ACT=".$ligne["NUM_ACT"]."&NUM_DOS=".$NUM_DOS."&NUM_CON=".$NUM_CON."\" onclick=\"return confirmLink(this, 'Confirmez-vous la suppression de l\'\action \<\ ".$ligne["LIB_TYP_ACT"]." \>\ du ".datemysql2francais($ligne["DATE_ACT"])."');\">";
echo "<img border=\"0\" src=\"img/b_drop.png\" atl=\"Supp\"\"></a>";
}
echo "</td> </tr>";
}
echo " </table>";
Comme vous l'avez vu j'ai tenté de faire quelque chose (mais sans succès) dans la partie que j'ai mis en commentaire
Si ça peut vous aidez voici ma requête sql:
(select action.REF_ADR_LOC, action.DATE_ACT,action.DESC_ACT,action.FLAG_ALE,type_action.LIB_TYP_ACT,employe.TRG AS EMP,action.NUM_ACT,action.NUM_DOS,resultat.LIB_RES ,c.NUM_CON,action.DATE_RAPPEL,
CONCAT(contact_locataire.PRE_CON_LOC,' ',contact_locataire.NOM_CON_LOC) AS CON_LOC,
CONCAT( action.TEL_CON_LOC, ' ', action.MAIL_CON_LOC) AS MAIL_CON_LOC , ACT_PLA
from action , contrat c
LEFT JOIN locataire On locataire.NUM_DOS = action.NUM_DOS
LEFT JOIN resultat ON action.NUM_RES = resultat.NUM_RES
LEFT JOIN type_action ON action.ID_TYPE_ACT = type_action.ID_TYPE_ACT
LEFT JOIN employe ON action.MATR_EMP = employe.MATR_EMP
LEFT JOIN contact_locataire ON action.REF_CON_LOC = contact_locataire.REF_CON_LOC
where
action.NUM_DOS='".$NUM_DOS."'
and c.NUM_DOS = locataire.NUM_DOS
and c.PRINCIPAL = '1' )
UNION
/*Récupération des notes des employés*/
(select '0' as REF_ADR_LOC,datecreer as DATE_ACT,note as DESC_ACT ,'1' as FLAG_ALE ,'NOTE' as LIB_TYP_ACT
, employe.TRG AS EMP,'1' as NUM_ACT ,'NUM_DOS' as NUM_DOS ,'' as LIB_RES ,'1' as NUM_CON ,'1' as DATE_RAPPEL,'' as CON_LOC,'' as MAIL_CON_LOC,'' as ACT_PLA
from notes n
JOIN employe On n.user_id=employe.MATR_EMP
where NUM_DOS='".$NUM_DOS."'
and employe.MATR_EMP < 100
)
UNION
/*Récupération des notes des clients*/
(select '0' as REF_ADR_LOC,datecreer as DATE_ACT,note as DESC_ACT ,'1' as FLAG_ALE ,'NOTE' as LIB_TYP_ACT
, concat(contact_client.NOM_CON_CLI,' ' , contact_client.PRE_CON_CLI) AS EMP,'1' as NUM_ACT ,'NUM_DOS' as NUM_DOS ,'' as LIB_RES ,'1' as NUM_CON ,'1' as DATE_RAPPEL,'' as CON_LOC,'' as MAIL_CON_LOC,'' as ACT_PLA
from notes n
JOIN contact_client on n.user_id=contact_client.REF_CON_CLI
where NUM_DOS='".$NUM_DOS."'
and contact_client.REF_CON_CLI >99
)
order by DATE_ACT asc
Merci bien de m'avoir lu et pour votre aide