Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/01/2013, 14:30
Avatar de jmorasandi
jmorasandi
 
Fecha de Ingreso: enero-2013
Mensajes: 30
Antigüedad: 11 años, 3 meses
Puntos: 1
Color de fondo en texto segun "texto"

Buenas tardes,

Tengo este código y quiero que cuando el texto sea "x" se ponga el color de fondo de dicho texto de "x" color.

Por Ejemplo:

Si esta "pendiente" entonces que sea de color azul
Si esta "en proceso" entonces que sea de color verde
etc...

El problema es que no se puede ponerle <font> ya que es una variable o sea un consulta desde una base de datos sql..

Les dejo el código y espero me puedan guiar

Código:
<?php
include_once 'include/x.php';
$Login_Process = new Login_Process;
$Login_Process->check_status($_SERVER['SCRIPT_NAME']);

require("conexion.php");
require("funciones.php");

$query = "SELECT * FROM X ORDER BY nombre ASC";
$queEmp = mysql_query($query, $conexion);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>XXXXXXXX</title>
<link href="xxx.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center"><h3>X</h3>
<table width="600" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th>X</th>
    <th>X</th>
    <th>X</th>
   <th>X</th><th>X</th><th>X</th><th>&nbsp;</th><th>&nbsp;</th>
  </tr>
  <?php while ($rsEmp = mysql_fetch_assoc($queEmp)) { ?>
  <tr>
    <td><?php echo $rsEmp['x5']; ?></td>
    <td><?php echo $rsEmp['estado']; ?></td>
 <td><?php echo $rsEmp['x4']; ?></td> 
 <td><?php echo $rsEmp['x3']; ?></td> 
 <td><?php echo $rsEmp['x1']; ?></td> 
 <td><?php echo $rsEmp['xxxxx']; ?></td> 
   <td><a href="xxxx.php?id=<?php echo $rsEmp['id']; ?>" target="_parent">Editar</a></td>
 <td><a href="#" onclick="delEmpresa(<?php echo $rsEmp['id']; ?>);">Eliminar</a></td>
  </tr>
  <?php } ?>
</table>
</div>
<script type="text/javascript">
function delEmpresa(id) {
	if (window.confirm("Aviso:\nDesea eliminar el registro seleccionado?"))	{
		window.location = "delete.php?action=del&id="+id;	
	}
}
</script>
<p>&nbsp;</p>
</body>
</html>
La línea que esta en rojo y negrita es la que quiero que cambie de color segun su texto.. Todas las "X" son parte del codigo que ya esta configurado..