<%@ Page Language="vb" Debug="true" %> <% @Import NameSpace="System.Data" %> <% @Import NameSpace="System.Data.SQLClient" %> <% @Import NameSpace="System.Diagnostics.Debug" %> <% @Import Namespace="System.Web.Mail" %> <% @Import Namespace="System.Text.RegularExpressions" %> <% @Import NameSpace="System.Data.OleDb" %> <%@ Import namespace="System.IO" %> <%@ Import namespace="System.Net" %>

Cerca Utente

<% Dim Codice = Request.Querystring ("Codice") Dim Who = Request.Querystring ("Who") Dim Page = Request.Querystring ("Page") Page = Page*5 Dim Pagine = 0 Dim counter = 0 %>



<% If Codice = "cerca" Then sqlConn.Open() sqlComm = New SqlCommand("SELECT COUNT(*) as Quanti FROM Utenti WHERE Utenti.Attivo = 'Si' AND Utenti.Username LIKE '%" & Who & "%' AND Utenti.Username <> 'Npc'", sqlConn) r = sqlComm.ExecuteReader() While r.Read() pagine = (r("Quanti")) End While r.Close() sqlConn.Close() Response.Write ("

") Response.Write ("") sqlConn.Open() sqlComm = New SqlCommand("SELECT TOP 5 Utenti.Id, Utenti.Username, SUM(Soldiers.Level) as Fama_Utente FROM Utenti JOIN Soldiers ON Utenti.Id = Soldiers.Id_Utente WHERE Utenti.Attivo = 'Si' AND Utenti.Username LIKE '%" & Who & "%' AND Utenti.Username <> 'Npc' AND Utenti.Id NOT IN (SELECT TOP "& Page &" Utenti.Id FROM Utenti WHERE Utenti.Username LIKE '%" & Who & "%' AND Utenti.Attivo = 'Si' AND Utenti.Username <> 'Npc' ORDER BY Username) GROUP BY Utenti.Id, Utenti.Username ORDER BY Username ", sqlConn) r = sqlComm.ExecuteReader() While r.Read() Response.Write ("") Response.Write ("") End While r.Close() sqlConn.Close() Response.Write ("

Utente

Fama

"& r("Username") &""& r("Fama_Utente") &"
") Dim x Response.Write ("

") If (Page/5) > 2 Then Response.Write ("...") End If For x = 0 to Pagine/5 If x > (Page/5 - 3) AND x < (Page/5 + 3) Then Response.Write ("") If x = (Page/5) Then Response.Write ("[") End If Response.Write (x+1) If x = (Page/5) Then Response.Write ("]") End If Response.Write ("") End If Next If (Page/5) < (Pagine/5)-3 Then Response.Write ("...") End If Response.Write ("

") End If %>