Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/04/2012, 08:28
wendyl
 
Fecha de Ingreso: marzo-2012
Ubicación: Bogota
Mensajes: 177
Antigüedad: 12 años, 1 mes
Puntos: 2
alert javascript y php

hola a todos lo que pasa es que en la pagina necesito crear una alertas y le doy un if pero pues no me funciona no se que estoy haciendo mal porfavor ayudenme

Código PHP:
$sql=mysql_query("select logueados,disponibles,llamada_externa,campaña,auxiliar,acw,otros from estadosskill12 ")
or die (
"problemas en el select".mysql_error());

while(
$row=mysql_fetch_array($sql))
    {
        
$logueados=$row['logueados'];
        
$disponibles=$row['disponibles'];
        
$llamada_externa=$row['llamada_externa'];
        
$campaña=$row['campaña'];
        
$auxiliar=$row['auxiliar'];
        
$acw=$row['acw'];
        
$otros=$row['otros'];
        echo 
$logueados;
        if (
$logueados== " ")
        {
        echo 
1;
            echo 
"<body onclick='alert(alerta);'>";
        }
            else
            {
            echo 
"<body>";
            }
    } 
el alert lo tengo en el index asi

function ActualizarInfo(){
var alerta= "no hay agentes logueados";
alert(alerta);
nocacheurl = 'tablaactualizar_info.php';
}

en un div tengo los botones
Código PHP:
 $botones='
<div id="Principal" align="left">
<button id="Datos" onclick="Datos()">Datos<input type="image" src="images/alarma_apagada1.jpg"/ width="40" height="35"></button>
<button id="Voz" onclick="Voz()">Voz <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
<button id="Mintic" onclick="Mintic()">Mintic <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
<button id="InfoTicket" onclick="InfoTicket()">Info Ticket <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
<button id="SoporteOS" onclick="SoporteOS()">Soporte o/s <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
<button id="MCF(" onclick="MCF()">MCF <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
<button id="ActualizarInfo("onclick="ActualizarInfo()">AI C <input type="image" src="images/alarma_apagada1.jpg" width="40" height="35"/></button>
Alarma por: <input type="text" name="" value="" />
<img src="images/informe.jpg" width="228" height="290" align="center">
</div>'
;
echo 
$botones
y necesito que apenas logueados sea igual a 0 la imagen del boton se cambie a una .gif y cuando le de click me aparezca que alerta es

les agaradesco si me ayudan es un poco urgente