Buenas compañeros estoy usando una funcion para cambia el color de mis tablas segun el valor y cambia el color pero no son los colore que establecí, cual puede ser el problema???
Mi funcion
Código PHP:
function switchColor($rowValue) {
//Define the colors first
$color1 = '#00ff00';
$color2 = '#0000ff';
$color3 = '#5CBFBF';
$color4 = '#991C1C';
/*Change the 'cases' to whatever you want them to be,
so if you want to change the color according to
occupation, write down the possible occupations or if
the color changes according to gender, name the gender
names that come out of the database (eg. case 'male':).*/
switch ($rowValue) {
case 'Baja':
echo $color1;
break;
case 'Media':
echo $color2;
break;
case 'Alta':
echo $color3;
break;
default:
echo $color4;
}
}
Y mi tabla donde cambio los colores
Código PHP:
echo"<tr bgcolor='switchColor($row[prioridad])'>
<td><span class='texto'>$row[id]</span></div></td>
<td><span class='texto'>$row[encargado]</span></td>
<td><span class='texto'>$row[prioridad]</span></td>
<td><span class='texto'>$row[fechapro]</span></td>
<td><span class='texto'>$row[numeropc]</span></td>
<td><span class='texto'>$row[detalle]</span></td>
<td><span class='texto'>$row[estado]</span></td>
<td><span class='texto'>$row[fechare]</span></td>
</tr>";