Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/10/2007, 06:01
kero-dono
 
Fecha de Ingreso: octubre-2007
Ubicación: agua dulce, veracruz
Mensajes: 22
Antigüedad: 16 años, 7 meses
Puntos: 1
Re: como mostrar resultados de la encuesta

asi, fijate en lso comentariso, apara que veas lo que cambie


Código PHP:
<?  
    
if(isset($_COOKIE['encuesta'])){ 
     
    echo 
"<script> window.alert('Ya votaste');  </script>";  //quite la redireccion para que se pueda ver los resultados

     
    
}else{ 
         
        include(
"encuesta/config1.php"); 
         
        
$file2=file($file);  
        
$lineas=count($file2); 
        
$n1=$file2[0];  
        
$n2=$file2[1];  
        
$n3=$file2[2];  
        
$n4=$file2[3];  
         
         
        if(
$En=="E1")  
        {
$nn1=intval($n1)+1;}else{$nn1=intval($n1);}  
        if(
$En=="E2")  
        {
$nn2=intval($n2)+1;}else{$nn2=intval($n2);}  
        if(
$En=="E3")  
        {
$nn3=intval($n3)+1;}else{$nn3=intval($n3);} 
        if(
$En=="E4")  
        {
$nn4=intval($n4)+1;}else{$nn4=intval($n4);}  
         
            
$fp=fopen($file,"w+");  
                
fwrite($fp,"$nn1\n$nn2\n$nn3\n$nn4");  
            
fclose($fp);  
         
        
$ntotal=$nn1+$nn2+$nn3+$nn4;  
     

        } 
//el final del else lo puse aqui, para que cualquier apueda ver los resultados
?>

<div align="center"> 
  <table border=0 cellpadding=0 cellspacing=0 width=273> 
    <tr> 
      <td colspan=3><strong><font face=Arial>Resultados Encuesta</font></strong></td> 
    </tr> 
    <tr> 
      <td width=92 height="77"><font face=Arial><? echo $c;?><strong>Newell 's </strong></font></td> 
      <td width=117><table border=0 cellpadding=0 cellspacing=1 width=100 
    bgcolor="#000080"> 
        <tr> 
          <td><table border=0 cellpadding=0 cellspacing=0 width=<? echo $nn1*100/$ntotal;?> bgcolor=#FFFFFF 
        height=5> 
            <tr> 
              <td></td> 
            </tr> 
            </table>          </td> 
        </tr> 
      </table>      </td> 
      <td width=64><p align=center><font face=Arial size=2><? echo $nn1;?></font></td> 
    </tr> 
    <tr> 
      <td width=92 height="83"><font face=Arial><? echo $c;?><strong>Central</strong></font></td> 
      <td width=117><table border=0 cellpadding=0 cellspacing=1 width=100% 
    bgcolor=#000080> 
        <tr> 
          <td width=100%><table border=0 cellpadding=0 cellspacing=0 width=<? echo $nn2*100/$ntotal;?> 
        bgcolor=#FFFFFF height=5> 
            <tr> 
              <td></td> 
            </tr> 
            </table>          </td> 
        </tr> 
      </table>      </td> 
      <td width=64><p align=center><font face=Arial size=2><? echo $nn2;?></font></td> 
    </tr> 
    <tr> 
      <td width=92 height="98"><font face=Arial><? echo $c;?><strong>No me Interesa </strong></font></td> 
      <td width=117><table border=0 cellpadding=0 cellspacing=1 width=100% 
    bgcolor=#000080> 
        <tr> 
          <td width=100%><table border=0 cellpadding=0 cellspacing=0 width=<? echo $nn3*100/$ntotal;?> 
        bgcolor=#FFFFFF height=5> 
            <tr> 
              <td></td> 
            </tr> 
            </table>          </td> 
        </tr> 
      </table>      </td> 
      <td width=64><p align=center><font face=Arial size=2><? echo $nn3;?></font></td> 
    </tr><tr> 
      <td colspan=3><font face=Arial>Total encuesta: </font><font 
    color=#004080 face=Arial size=2><strong><? echo $ntotal;?></strong></font></td> 
    </tr> 
  </table> 
  <br> 
   

  <a href="index.php">Volver</a> 
   
</div>

-Kerberos^^