Ver Mensaje Individual
  #10 (permalink)  
Antiguo 29/09/2004, 10:54
leophp
 
Fecha de Ingreso: julio-2002
Ubicación: stgo rec
Mensajes: 438
Antigüedad: 22 años, 9 meses
Puntos: 3
Aqui esta mi codigo que hice para una encuestas, solo tendrias que ajustar para tu formato.


Código PHP:
    itotalvotos 0
    sSQL
="SELECT * FROM Encuesta WHERE ID = " tidencuesta
    set RS 
Conn.Execute(sSQL)
    If 
Not RS.EOF Then
        vencuesta 
True
        aencuesta 
RS.Getrows
        itotalvotos 
CCur(aencuesta(11,0)) + CCur(aencuesta(12,0)) + CCur(aencuesta(13,0)) + CCur(aencuesta(14,0)) + CCur(aencuesta(15,0))
    
End If
    
RS.Close 
Código PHP:
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1">
                    <% For 
2 to 6
                            
If trim(aencuesta(I,0)) <> "" Then
                                
If itotalvotos 0 Then
                                    ipopcion 
CInt((CCur(aencuesta(I+9,0))*100)/itotalvotos)
                                Else
                                    
ipopcion 0
                                End 
If %>                                
                                <
tr
                                    <
td width="21%" height="20" class="texto"><%= aencuesta(,0) %>&nbsp;</td>
                                    <
td align="left" class="texto2"><%= ipopcion "%" %></td>
                                    <
td width="45%" align="left" class="texto"><img src="imagenes/barra3.gif" width="6" height="17"><img src="imagenes/barra1.gif" width="20" height="<%= ipopcion %>"><img src="imagenes/barra2.gif" width="6" height="17"></td>
                                </
tr>
                            <% 
End If
                        
Next %>
                        <
tr
                            
                      <
td height="23" colspan="3" valign="bottom" class="texto2">Total 
                        votos 
<%= formatnumber(itotalvotos,0) %></td>
                        </
tr>
                        </
table
__________________
Saludos
Leo