Nella pagina seguente mi puoi dire dove posso mantenere la sessione?
Ci ho provato. Ma non ci resta, quando una reimpaginazione viene effettuata.
Scusate se vi disturbo.
<!--#include file="OpenDb.asp"-->
<%
const RecordsPerPage = 5
%>
<%
dim rsData ' As Adodb.Recordset
dim sqlResult ' As String
dim intPageNum ' As Integer
dim strSortFlds 'as string
dim strSortOrder 'As string
Set cn = OpenDatabase()
if Request("so") <> "" then
strSortFlds = Request("so")
else
strSortFlds = "1"
end if
if Request("sd") <> "" then
strSortOrder = Request("sd")
else
strSortOrder = "ASC"
end if
If Request("pn") <> "" then
intPageNum = CInt(Request("pn"))
Else
intPageNum = 1
End if
sqlResult = ""
set rsData = Server.CreateObject ("ADODB.Recordset")
sqlResult = "Select ID_REC, IDINET, EMAIL, COGNOME, NOME, ENTEATTUALE, RUOLO, " & _
"REGIONE, PROV, CAP, CITTA, INDIRIZZO, DOMINIO, GRUPPO, " & _
"TELUFF, TELEXTRA, NOTES, DATAULT, MONITORATO From CENSIMENTO " & _
"WHERE LEN(EMAIL)>0 " & _
"order by " & strSortFlds & " " & strSortOrder
rsData.Open sqlResult, cn, 1, 3
If rsData.RecordCount < 1 then
Response.redirect ("welcome.asp")
end if
rsData.PageSize = RecordsPerPage
DisplayData rsData, intPageNum, strSortFlds, strSortOrder
rsData.Close
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<TITLE>API S.c.r.l Censimento Indirizzi di posta elettronica</TITLE>
</HEAD>
<body bgcolor=DarkGray leftMargin="25" rightmargin="25" topMargin="0" marginheight = "0" marginwidth = "0">
<%
'------------------------------------------------------------------
Sub DisplayData(rsData, intPageNum, strSortFlds, strSortOrder)
%>
<Form name=frmMonitor Id=frmMonitor Method=Post Action="UpdateMonitor.asp">
<Table width=100%>
<Tr>
<TD ALIGN=CENTER>
<FONT FACE=VERDANA SIZE=4 COLOR=WHITE>
ELENCO CENSIMENTO EMAIL PRESSO INET
<BR>
MONITORAGGIO
<br>
</Font>
</TD>
</TR>
</Table>
<%
Dim intCount ' As integer
%>
<FONT FACE=VERDANA SIZE=1 COLOR=WHITE>
<%
DisplayPageLinks rsData, intPageNum, strSortFlds, strSortOrder
DisplayNavigation rsData, intPageNum, strSortFlds, strSortOrder
%>
</FONT>
<INPUT type="reset" value="Reimposta" name="Reimposta">
<INPUT type="submit" value="Aggiorna" name="Aggiorna" Onclick="Submit()">
<TABLE width=100% BORDER="1" CellSpacing=0 CellPadding=4 bgcolor=#6699cc cols=18>
<Thead>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 color=White><% Response.Write CreateHeading(intPageNum, "PROG.", "ID_REC", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "ID-INET", "IDINET", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "EMAIL", "EMAIL", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "COGNOME", "COGNOME", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "NOME", "NOME", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "ENTE", "ENTEATTUALE", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "RUOLO", "RUOLO", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "CITTA'", "CITTA", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "INDIRIZZO", "INDIRIZZO", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "CAP", "CAP", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "PROV.", "PROV", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "REGIONE", "REGIONE", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "TELEFONO", "TELUFF", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "ALTRO TEL.", "TELEXTRA", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "NOTE", "NOTES", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "DATA RICEZIONE", "DATAULT", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "GRUPPO", "GRUPPO", strSortFlds, strSortOrder)%></Font></th>
<th style="cursor:pointer; cursor:hand"><Font Face=Verdana Size=1 Color=White><% Response.Write CreateHeading(intPageNum, "MONITORATO", "MONITORATO", strSortFlds, strSortOrder)%></Font>
<INPUT type="checkbox" id=chkBoxMonitorTitle name=chkBoxMonitorTitle Onclick="SelezionaTutto(this.form)"></th>
</Thead>
<%
rsData.AbsolutePage = intPageNum
For intCount = 1 to rsData.PageSize
%>
<tr>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("ID_REC") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("IDINET") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("EMAIL") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("COGNOME") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("NOME") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("ENTEATTUALE") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("RUOLO") %></Font></TD>
<TD align=center><Font Face=Verdana Size=1 color=White><% = rsData("CITTA") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("INDIRIZZO") %></Font></TD>
<TD align=center><Font Face=Verdana Size=1 color=White><% = rsData("CAP") %></Font></TD>
<TD align=center><Font Face=Verdana Size=1 color=White><% = rsData("PROV") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("REGIONE") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("TELUFF") %></Font></TD>
<TD><Font Face=Verdana Size=1 color=White><% = rsData("TELEXTRA") %></Font></TD>
<TD title="<%=TRIM(RSDATA.FIELDS("NOTES"))%>"><Font Face=Verdana Size=1 color=White><%if len(rsData.fields("notes"))>10 then Response.write MID(rsData("NOTES"), 1, 10) & "..." else Response.write (RSDATA.FIELDS("NOTES")) end if%></Font></TD>
<TD align=CEnter><Font Face=Verdana Size=1 color=White><% = rsData("DATAULT") %></Font></TD>
<TD align=center><Font Face=Verdana Size=1 color=White><% = rsData("GRUPPO") %></Font></TD>
<TD ALIGN=Center><Font Face=Verdana Size=1 color=White>
<INPUT type="checkbox" id=chkBoxMonitor name=chkBoxMonitor Value=CInt(<%=rsData.Fields("id_rec")%>) <%if rsData("MONITORATO")="Sì" then Response.Write " checked " end if%>>
</Font>
</TD>
</tr>
<%
rsData.MoveNext
if rsData.EOF then Exit For
Next 'intCount
%>
</Table>
</Form>
<FONT FACE=VERDANA SIZE=1 COLOR=WHITE>
<%
DisplayPageLinks rsData, intPageNum, strSortFlds, strSortOrder
DisplayNavigation rsData, intPageNum, strSortFlds, strSortOrder
%>
</fONT>
</Body>
</Html>
<%
end sub
%>
<%
'-------------------------------------------------------------------
Function CreateHeading(intPageNum, strTitle, strNewSort, strOldSort, strOldOrder)
dim strNewOrder 'as string
if strNewSort = strOldSort then
if strOldOrder = "ASC" then
strNewOrder = "DESC"
else
strNewOrder = "ASC"
end if
else
strNewOrder = "ASC"
end if
CreateHeading = "<a href=""" _
& Request.ServerVariables ("SCRIPT_NAME") _
& "?pn=" & intPageNum _
& "&so=" & strNewSort _
& "&sd=" & strNewOrder _
& """>" & strTitle & "</a>"
End Function
Sub DisplayPageLinks(rsData, intPageNum, strSortFlds, strSortOrder)
dim i 'as integer
Response.Write "<P>Passa alle pagine successive:"
for i = 1 to rsData.PageCount
If i = intPageNum then
Response.Write i & " "
Else
Response.Write "<a href=""" _
& Request.ServerVariables ("SCRIPT_NAME") _
& "?PN=" & i _
& "&so=" & strsortflds _
& "&sd=" & strSortOrder _
& """>" & i & "</a>"
end if
next 'i
Response.Write "</P>"
End sub
' ---------------------------------------------------------------------------
Sub DisplayNavigation(rsData, intPageNum, strSortFlds, strSortOrder)
Response.Write "<P>"
If intPageNum > 1 then
Response.Write "<< <a href=""" _
& Request.ServerVariables ("SCRIPT_NAME") _
& "?PN=" & intpageNum - 1 _
& "&so=" & strsortflds _
& "&sd=" & strSortOrder _
& """>Pagina precedente</a> "
end if
If intPageNum < rsData.PageCount then
Response.Write ">> <a href=""" _
& Request.ServerVariables ("SCRIPT_NAME") _
& "?PN=" & intpageNum + 1 _
& "&so=" & strsortflds _
& "&sd=" & strSortOrder _
& """>Pagina seguente</a> "
End if
Response.Write "</P>"
End sub
'---------------------------------
%>
<Script Language="JavaScript">
function SelezionaFiltro(selObj)
{
var filtro
var selObj
filtro = selObj.options[selObj.selectedIndex].value
alert(Filtro)
frmMonitor.action = "Monitor.asp?strSelection=" + filtro
frmMonitor.submit();
}
function SelezionaTutto()
{
if (document.frmMonitor.chkBoxMonitorTitle.checked == true)
{
var ele = document.frmMonitor.elements("chkBoxMonitor");
var x, len = ele.length;
for (x=0 ; x<len ; x++)
{
if (ele[x].type == "checkbox")
{
ele[x].checked = true
ele[x].value = "On"
}
}
}
if (document.frmMonitor.chkBoxMonitorTitle.checked == false)
{
var ele = document.frmMonitor.elements("chkBoxMonitor");
var x, len = ele.length;
for (x=0 ; x<len ; x++)
{
if (ele[x].type == "checkbox")
{
ele[x].checked = false
ele[x].value = "No"
}
}
}
}
function right(e)
{
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which ==2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3))
{
alert("Spiacenti, il tasto destro del mouse e' disabilitato");
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
// End
</script>
Modificato da Pushpam il 10 maggio 2005 19.25 -