Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/06/2013, 09:39
hans2488
 
Fecha de Ingreso: septiembre-2010
Mensajes: 64
Antigüedad: 13 años, 7 meses
Puntos: 5
Respuesta: Funcion cambioar color, cambia a otros colores no establecidos

EN prioridad me salen:
Baja
Media
Alta que son los mismos valores que puse en el switch, y lo raro q me salen otros colores q no estableci no se de donde salen y no estoy usando nada de css, bueno dejo el codigo completo para ver cual es la falla porfavor:
Código PHP:
<!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>

<body>

          <form id="form1" name="form1" method="get" action="verpc.php">
            <p>
              <label for="cliente">Numero Id:</label>
              <input type="text" name="id" id="id" />
              <label for="nombre"><br />
                Nombre Nombre:</label>
              <input type="text" name="nombre" id="nombre" />
              <label for="agente"><br />
                Nombre Costo:</label>
              <input type="text" name="costo" id="costo" />
              <label for="zona"><br />
              </label>
            </p>
            <p>
              <input type="submit" name="buscar" id="buscar" value="Buscar" />
            </p>
</form>
          <?php 
//include('paginator.class.2.php');
include("conexion.php");
 
$id$_GET['id'];
$nombre$_GET['nombre'];
$costo$_GET['costo'];

$query "SELECT COUNT(*) FROM computadoras";
$result mysql_query($query) or die(mysql_error());
$num_rows mysql_fetch_row($result);

function 
switchColor($rowValue) { 

$color1 '#00ff00'
$color2 '#0000ff'
$color3 '#5CBFBF'
$color4 '#991C1C';

switch (
$rowValue) { 
case 
'Baja'
echo 
$color1
break; 
case 
'Media'
echo 
$color2
break; 
case 
'Alta'
echo 
$color3
break; 
default: 
echo 
$color4



$cadena "select * from computadoras";

$result mysql_query($cadena) or die(mysql_error());
echo 
"<center>";
echo 
"<table border='1' width='900px' align='center' cellspacing='0' cellpadding='0'><tr>
<th>Codigo</th>
<th>Encargado</th>
<th>Prioridad</th>
<th>Fecha del Problema</th>
<th>Numero de Computadora</th>
<th>Detalle</th>
<th>Estado</th>
<th>Fecha Que Se Reparo</th>"
;
while (
$row mysql_fetch_array($result)) 
{  
        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>"
;


echo
"</table>";    
echo 
"</center>";
echo 
"<center>";

echo 
"</center>"
?> 
</body>
</html>