Torna al Thread

<table border="0" width="100%" border="0" cellspacing="0" cellpadding="5" style="border-width:1px; border-color:#CCCCCC; border-style:solid"> <style type="text/css"> .style1 { width: 29px; height: 20px; } .style2 { width: 425px; height: 10px; } .style3 { height: 20px; } </style> <% dim datrice1, datricerett1 , gio1, mes1, ann1 ', rsPunti , strSQLPunti ' dichiaro le variabili per convertire la data in formato SQL legibile al DB datrice1 = date ' definisco la data di sistema datricerett1 = Replace (datrice1, "/" , "") ' elimino le barre dalla data gio1 = left((datricerett1),2) ' ' recupero i giorni i primi due giorni della data GG/MM/AAAA mes1 = mid((datricerett1),3 ,2) ' recupero il mese ann1 = right((datricerett1),2) ' recupero l'anno datrice1 = gio1 & mes1 & ann1 ' assemblo il tutto come deve essere passato all'SQL If Session("Username") = Username Then Response.Redirect "pippo.asp" dim objRS , strquery 'strquery = "SELECT count(*) as totale FROM log WHERE codacc ='pippo' AND len(latitudine)>5 AND len(longitudine)>5 AND data='10102010' and ora_sys between '000000' AND '235959'" strquery = "SELECT * FROM [logcation] WHERE (ID IN (SELECT MAX(l.ID) FROM logcation l INNER JOIN Mezzi m ON l.codacc = m.codacc WHERE m.CodiceCliente = " & Session("Username") & " AND len(l.latitudine) > 5 AND len(l.longitudine) > 5 GROUP BY m.codacc))ORDER BY Targa" Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open strquery, Conn,3,3 i = 0 if not objRS.eof then %> <tr style="font-family:Verdana; font-size:12px; color:#003366; font-weight:bold;" bgcolor="#F3F3F3"> <!--<td width="5" align="center">Punto</td> --> <td width="63" align="center">Punti</td> <td width="63" align="center">Targa</td> <td width="45" align="center">Data</td> <td width="40" align="center">Ora</td> <td width="40" align="center">Latitudine</td> <td width="40" align="center">Longitudine</td> <!--<td width="40" align="center">Longitudine</td>--> <td width="425px" align="Left" class="style2">Località</td> <td width="20" align="center">Vel.</td> <td width="10" align="center">&nbsp; <a href="javascript:;" onClick="window.open('../pr/Popup_UltimePosizioni.asp','Popup_Percorso','width=850,height=620,left=0,top=0,resizable=no,status=no,location=no,toolbar=no');"> <img src="ico/veicolo.gif" width="30" height="30" border="0"> </a></td></td> </tr> <% END IF dim rsPuntii, strSQLPuntii %> <tr align="left" style="font-family:Verdana; font-size:12px; color:#003366;" bgcolor=<% = colore %>> <% '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' strSQLPuntii = "SELECT count(*) as totale FROM log WHERE Targa = '" & Targa & "' AND len(latitudine)>5 AND len(longitudine)>5 AND data_sys = '" & data & "' and ora_sys between '000000' AND '235959'" Set rsPuntii = Server.CreateObject("ADODB.Recordset") 'instanzio il recordset per i punti rsPuntii.Open strSQLPuntii, Conn,3,3 do while not rsPuntii.EOF 'ciclo il record set per recuperare i dati da visualizzare a video targa = objRS("Targa") ': response.write "," & targa data = objRS("data_sys")' : response.write data Do While Not objRS.EOF i = i + 1 colore = "#FFFFFF": if ( i mod 2 ) = 0 then colore = "#F3F3F3" %> <td width="5" align="center"> <% = rsPuntii("totale") %> </td> <% targa = objRS("Targa") data = objRS("data") %> <td valign="Top"> <% = objRS("Targa") %> </td> <td valign="Top"><% = objRS("data_sys") %> </td> <td valign="Top"><%= objRS("ora_sys") %> </td> <td valign="Top"><% = objRS("latitudine") %> </td> <td valign="Top" width="100"><%= objRS("longitudine") %> </td> <!-- <td valign="Top"><% = objRS("Quadro")%> </td>--> <td valign="Top"><% = objRS("localita")%> </td> <td valign="Top"><% = objRS("velocita")%> </td> <td><a href="javascript:;" onClick="window.open('../pr/Popup_Cartografia.asp?id=<% = objRS("ID") %>','Popup_Cartografia','width=850,height=620,left=0,top=0,resizable=no,status=no,location=no,toolbar=no');"><img src="images/visualizza.jpg" width="15" height="15" border="0"></a></td> </tr> <% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' objRS.MoveNext loop rsPuntii.movenext loop ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rsPuntii.close set rsPuntii = nothing objRS.close Set objRS = nothing %> </table>
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5