salve,
c'è qualche anima gentile che può risolvere questo mio problema??
ho un database di access dove carico i dati delle spedizioni con i seguenti campi..
id - data - committente - mittente - indirizzo - localita - servizio - autista - destinatario - via - citta - colli - peso - volume - contrassegno - note - data_consegna - esito.
partendo dal presupposto che il campo "committente" è univoco e che la user al cliente la assegno io in base proprio a questo campo, vorrei che quando uno di essi inserisce i dati nella pagina di login visualizzi solo ed esclusivamente le sue spedizioni..si può fare? e come.. grazie!
ps. la pagina di visualizzazione spedizioni esiste già, ma è comune a tutti e questo non è giusto, ognuno deve visualizzare solo le proprie, di seguito riporto la pagina dati_list.asp
<%@ Language=VBScript %>
<link REL="stylesheet" href="include/style.css" type="text/css">
<%
If Session("UserID")="" then
Response.Write "<p>Your session has expired. Please <a href=""login.asp"">login</a> again</p>"
Response.End
End If
if ( CheckSecurity("", "Add")<>True and CheckSecurity("", "Search")<>True )Then
Response.Write "<p>You don't have permissions to access this table. <a href=""login.asp"">Back to login page</a></p>"
Response.End
end if
%>
<!--#include file="include/dati_dbconnection.asp"-->
<!--#include file="include/dati_variables.asp"-->
<!--#include file="include/dati_aspfunctions.asp"-->
<%
Session.LCID = 1040
On Error Resume Next
Dim rs, dbConnection
strOrderBy=""
strOrderImage=""
Call CalculateOrderBy
if request.Form("action")="" then
Session(strTableName & "SQL")=""
end if
TargetPageNumber=Request.Form("TargetPageNumber")
if TargetPageNumber="" or Request.Form("action")="search" then _
TargetPageNumber=1
if Request.Form("PageSize")<>"" then
Session("PageSize") = Request.Form("PageSize")
end if
if Session("PageSize")<>"" then PageSize = Session("PageSize")
' delete record
if (Request.Form("mdelete")<>"") then
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Call ReportError
for i=1 to request.form("mdelete").count
ind = CInt(request.form("mdelete")(i))
strSQL="delete from " & strTableName & _
" where " & AddWrappers(strKeyField) & "=" & gstrQuote & Replace(request.form("mdelete1")(ind), "'", "''") & gstrQuote
if strKeyField2<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField2) & "=" & gstrQuote2 & Replace(request.form("mdelete2")(ind), "'", "''") & gstrQuote2
if strKeyField3<>"" then _
strSQL = strSQL & " and " & AddWrappers(strKeyField3) & "=" & gstrQuote3 & Replace(request.form("mdelete3")(ind), "'", "''") & gstrQuote3
LogInfo(strSQL)
dbConnection.Execute strSQL
Call ReportError
next
dbConnection.close
set dbConnection = nothing
end if
if Request.Form("action")<>"Search" and Request.Form("action")<>"AdvancedSearch" and Len(Session(strTableName & "SQL"))>3 then
strSQL=Session(strTableName & "SQL")
if strOrderBy<>"" then
if InStr(1, strSQL, "order by")>0 then
strSQL = Left(strSQL,InStr(1, strSQL, "order by")-1) & strOrderBy
else
strSQL = strSQL & strOrderBy
end if
end if
else
if gstrSQL="" then
strSQL="select * from " & strTableName
else
strSQL = gstrSQL
if LCase(Left(strSQL,7)) = "select " then
if not InSQL(strKeyField, gstrSQL) then strSQL = "select " & AddWrappers(strKeyField) & ", " & Mid(strSQL, 8)
if not InSQL(strKeyField2, gstrSQL) then strSQL = "select " & AddWrappers(strKeyField2) & ", " & Mid(strSQL, 8)
if not InSQL(strKeyField3, gstrSQL) then strSQL = "select " & AddWrappers(strKeyField3) & ", " & Mid(strSQL, 8)
if RemoveWrappers("[]")<>"" and not InSQL("[]", gstrSQL) then strSQL = "select " & AddWrappers("[]") & ", " & Mid(strSQL, 8)
end if
end if
' see if we have some search parameters
' regular search
if Request.Form("action")="Search" and ( Request.Form("SearchFor")<>"" or Request.Form("SearchOption")="IsNull") then
strSearchFor=Trim(Request.Form("SearchFor"))
strSearchOption=Trim(Request.Form("SearchOption"))
if Request.Form("SearchField")<>"AnyField" then
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType(Request.Form("SearchField")))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = " where " & AddWrappers(Request.Form("SearchField")) & StrWhere(Request.Form("SearchField"), strSearchFor, strSearchOption, "")
end if
else
strAdd = " where 1=0"
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("ID"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("ID") & StrWhere("ID", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("data"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("data") & StrWhere("data", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("committente"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("committente") & StrWhere("committente", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("mittente"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("mittente") & StrWhere("mittente", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("indirizzo"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("indirizzo") & StrWhere("indirizzo", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("localita"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("localita") & StrWhere("localita", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("ddt"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("ddt") & StrWhere("ddt", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("servizio"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("servizio") & StrWhere("servizio", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("autista"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("autista") & StrWhere("autista", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("destinatario"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("destinatario") & StrWhere("destinatario", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("via"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("via") & StrWhere("via", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("citta"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("citta") & StrWhere("citta", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("colli"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("colli") & StrWhere("colli", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("peso"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("peso") & StrWhere("peso", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("volume"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("volume") & StrWhere("volume", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("contrassegno"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("contrassegno") & StrWhere("contrassegno", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("note"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("note") & StrWhere("note", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("data_consegna"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("data_consegna") & StrWhere("data_consegna", strSearchFor, strSearchOption, "")
end if
if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("esito"))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
strAdd = strAdd & " or " & AddWrappers("esito") & StrWhere("esito", strSearchFor, strSearchOption, "")
end if
end if
if InStr(strSQL, " where ") > 0 then strAdd = " and (" & Mid(strAdd, 8) & " ) "
strSQL = strSQL & strAdd
end if
' advanced search
if Request.Form("action")="AdvancedSearch" then
sWhere=""
For i = 1 To Request.Form("SearchFor").Count
strSearchFor=Trim(Request.Form("SearchFor")(i))
strSearchFor2=Trim(Request.Form("SearchFor2")(i))
if strSearchFor<>"" or Request.Form("SearchOption")(i)="IsNull" then
if sWhere="" then sWhere=" where 1=1"
strSearchOption=Trim(Request.Form("SearchOption")(i))
if (IsNumeric(strSearchFor) and (strSearchFor2="" or IsNumeric(strSearchFor2))) or IfNeedQuotes(GetFieldType(Request.Form("FieldName")(i)))="True" or _
strSearchOption="Contains" or strSearchOption="Starts with ..." then
sWhere = sWhere & " and " & AddWrappers(Request.Form("FieldName")(i)) & StrWhere(Request.Form("FieldName")(i), strSearchFor, strSearchOption, strSearchFor2)
end if
end if
next
if InStr(strSQL, " where ") > 0 then sWhere = " and (" & Mid(sWhere, 8) & " ) "
strSQL = strSQL & sWhere
end if
strSQL = strSQL & " " & Trim(strOrderBy)
end if
Session(strTableName & "SQL") = strSQL
Response.Write("<html>")
Response.Write("<head>")
Response.Write("<title>" & strTableName & "</title>")
Response.Write("</head>")
Response.Write("<body topmargin=5 bgcolor=white")
if Request.Form<>"" then Response.Write(" onLoad=""if (document.frmAdmin.SearchFor != null) document.frmAdmin.SearchFor.focus();""")
Response.Write(">")
%>
<!-- log out form -->
<form name=logout method=post action="login.asp">
<input type=hidden name=action value="logout">
</form>
<!-- edit form -->
<form method="POST" action="dati_edit.asp" name="editform">
<input type=hidden id="editid" name="editid" value="" >
<input type=hidden id="editid2" name="editid2" value="" >
<input type=hidden id="editid3" name="editid3" value="" >
<input type=hidden id="TargetPageNumber" name="TargetPageNumber" value=<%=TargetPageNumber%>>
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField)%>" name="NeedQuotes<%=BuildFieldName(strKeyField)%>" value="">
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField2)%>" name="NeedQuotes<%=BuildFieldName(strKeyField2)%>" value="">
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField3)%>" name="NeedQuotes<%=BuildFieldName(strKeyField3)%>" value="">
<input type=hidden id="todo" name="todo" value="view">
<input type=hidden id=masterkey name=masterkey value="<%=strMasterKey%>">
</form>
<%
' Pagination: Control Variables
dim iNumberOfRows
dim maxRecords
dim maxpages
dim mypage
iNumberOfRows =0
maxRecords = 0
maxpages = 0
mypage = TargetPageNumber
if mypage = "" then mypage =1
if CDBL(mypage)<=0 then mypage =1
%>
<table align='center' border='0' width="735">
<tr>
<td width=10 style="border: 1px solid #800000">
<img border="0" src="logo_piccolo.jpg" width="123" height="32"></td>
<%
If Session("UserID")<>"" Then
%>
<td align=center style="font-size: 10pt; font-family: Tahoma; font-weight: bold; border: 1px solid #800000">
<font color="#9CADA3">Benvenuto</font> <b><%=Session("UserID")%></b>
</td>
<td width=20 style="font-size: 10pt; font-family: Tahoma; font-weight: bold; border: 1px solid #800000" bgcolor="#CCFF66"><a href="#" onclick="document.forms.logout.submit();return true;">
<font face="Tahoma" size="3" color="#CC3300">Esci</font></a>
</td>
<% End If %>
<% if CheckSecurity("", "Export")=True then %>
<td align=center style="font-size: 8pt; font-family: Tahoma; font-weight: bold; border: 1px solid #800000">
<p>
<a href="dati_export.asp" onClick="document.exportto.submit();return false;">
<font face="Tahoma">Esporta dati</font></a>
</td>
<td width=20 style="font-size: 8pt; font-family: Tahoma; font-weight: bold; "> </td>
<td align=center style="font-size: 8pt; font-family: Tahoma; font-weight: bold; border: 1px solid #800000">
<p>
<a href="dati_print.asp" onClick="document.printerfriendly.submit();return false;">
<img src="images/printer.gif" border=0><font face="Tahoma"> Stampa la pagina</font></a>
</td>
<td width=9 style="font-size: 8pt; font-family: Tahoma; font-weight: bold; "> </td>
<% end if %>
</tr></table>
<%' Control Functions %>
<form method="POST" action="" name="frmAdmin">
<input type="hidden" id="TargetPageNumber" name="TargetPageNumber" value="1" >
<input type="hidden" id="cmdGotoPage" name="cmdGotoPage">
<input type="hidden" id="action" name="action" value="Search">
<input type="hidden" id="orderby" name="orderby" value="<%=strOrderBy%>">
<input type="hidden" id="PageSize" name="PageSize" value="<%=Session("PageSize")%>">
<input type=hidden id=masterkey name=masterkey value="<%=strMasterKey%>">
<script language="JavaScript" src="include/jsfunctions.js">
</script>
<script>
var bSelected=false;
function GotoPage(nPageNumber)
{
document.forms.frmAdmin.cmdGotoPage.value = 'GotoPage';
document.forms.frmAdmin.action.value = 'goto';
document.forms.frmAdmin.TargetPageNumber.value = nPageNumber;
document.forms.frmAdmin.submit();
}
</script>
<%
set rs = setupRs(strConnection,strSQL,PageSize)
Call ReportError
%>
<% if CheckSecurity("", "Search")=True then %>
<%' Pagination: Write Search result Header%>
<table rows='1' cols='1' align='center' width='95%' border='0'>
<tr><td align="right">
<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR><TD BGCOLOR=black align=center>
<table border=0 width=100% CELLPADDING=3 CELLSPACING=1><tr valign=center>
<% if CheckSecurity("", "Add")=True then %>
<!-- Add new record -->
<td align=center class='shade' style="font-size: 10pt; font-family: Tahoma; font-weight: bold; background-color: #CCCC00">
<a href=spedizioni.asp
onClick="javascript: document.forms.editform.action='spedizioni.asp';
document.forms.editform.todo.value = 'add';
document.forms.editform.TargetPageNumber.value=<%=mypage%>; document.forms.editform.submit(); return false;" >Aggiungi</a>
</td>
<% end if %>
<!-- Search form -->
<td align=center valign=middle class=shade>
<b><font face="Tahoma">Cerca per:</font> </b>
<SELECT ID="SearchField" NAME="SearchField" SIZE="1">
<OPTION VALUE="AnyField">Tutto</option>
<OPTION VALUE="data"><%=Label("data")%></option>
<OPTION VALUE="committente"><%=Label("committente")%></option>
<OPTION VALUE="mittente"><%=Label("mittente")%></option>
<OPTION VALUE="localita"><%=Label("localita")%></option>
<OPTION VALUE="ddt"><%=Label("ddt")%></option>
<OPTION VALUE="servizio"><%=Label("servizio")%></option>
<OPTION VALUE="autista"><%=Label("autista")%></option>
<OPTION VALUE="destinatario"><%=Label("destinatario")%></option>
<OPTION VALUE="citta"><%=Label("citta")%></option>
<OPTION VALUE="data_consegna"><%=Label("data_consegna")%></option>
<OPTION VALUE="esito"><%=Label("esito")%></option>
</SELECT>
<SELECT ID="SearchOption" NAME="SearchOption" SIZE="1">
<OPTION VALUE="Contains">Che contiene</option>
<OPTION VALUE="Equals">Uguale a</option>
<OPTION VALUE="Starts with ...">Comincia per</option>
</SELECT>
<%
if Request.Form("action")="Search" then
%>
<script>
var i;
for (i=0; i<document.forms.frmAdmin.SearchOption.options.length; ++i)
{
if (document.forms.frmAdmin.SearchOption.options[i].value=='<%=Request.Form("SearchOption")%>')
{
document.forms.frmAdmin.SearchOption.selectedIndex=i;
break;
}
}
for (i=0; i<document.forms.frmAdmin.SearchField.options.length; ++i)
{
if (document.forms.frmAdmin.SearchField.options[i].value=='<%=Request.Form("SearchField")%>')
{
document.forms.frmAdmin.SearchField.selectedIndex=i;
break;
}
}
</script>
<%
end if
%>
<input type=text size=20 name=SearchFor value="<%if Request.Form("action")="Search" then Response.Write Request.Form("SearchFor")%>">
<input type=button class=button name="SearchButton" value="Cerca"
onClick="javascript: document.forms.frmAdmin.action.value = 'Search';
document.forms.frmAdmin.submit();" style="font-size: 8pt; font-family: Tahoma; font-weight: bold">
<input type=button class=button value="Vedi tutto"
onClick="javascript: document.forms.frmAdmin.action.value = 'Search';
document.forms.frmAdmin.SearchFor.value=''; document.forms.frmAdmin.submit();" style="font-size: 8pt; font-family: Tahoma; font-weight: bold">
</td>
<!-- How many records found-->
<td align=center class=shade>
Risultati trovati: <%=maxRecords%> <br>Pagina <%=mypage%> di <%=maxpages%>
</td>
<td align=center class=shade>
<!--Records per page-->
Risultati per pagina:<br>
<SELECT name=PageSizeSelect onChange="javascript: document.forms.frmAdmin.action.value='pagesize'; document.forms.frmAdmin.PageSize.value = document.forms.frmAdmin.PageSizeSelect.options[document.forms.frmAdmin.PageSizeSelect.selectedIndex].value;document.forms.frmAdmin.submit();">
<OPTION value=10 <%if session("pagesize")=10 then Response.Write " selected"%>>10
<OPTION value=20 <%if session("pagesize")=20 then Response.Write " selected"%>>20
<OPTION value=30 <%if session("pagesize")=30 then Response.Write " selected"%>>30
<OPTION value=50 <%if session("pagesize")=50 then Response.Write " selected"%>>50
<OPTION value=100 <%if session("pagesize")=100 then Response.Write " selected"%>>100
<OPTION value=500 <%if session("pagesize")=500 then Response.Write " selected"%>>500
<!--START-->
<script language="JavaScript">DisplayHeader();</script>
<% else %>
<% if CheckSecurity("", "Add")=True then %>
<!-- Add new record -->
<td align=center class='shade'>
<a href=dati_add.asp
onClick="javascript: document.forms.editform.action='dati_add.asp';
document.forms.editform.todo.value = 'add';
document.forms.editform.TargetPageNumber.value=<%=mypage%>; document.forms.editform.submit(); return false;" >Add new</a>
</td>
<% end if %>
<% end if %>
<% if not rs.eof then %>
<%
end if
' quotes for search and edit fields
for i=0 to rs.Fields.Count-1
strNeedQuotes=IfNeedQuotes(rs.Fields(i).Type)
Response.Write "<input type=hidden name=NeedQuotes" & BuildFieldName(rs.Fields(i).Name) & " value=" & strNeedQuotes & ">" & vbCRLF
if rs.Fields(i).Name=strKeyField or rs.Fields(i).Name=strKeyField2 or rs.Fields(i).Name=strKeyField3 then
%>
<script language="JavaScript">
document.forms.editform.NeedQuotes<%=BuildFieldName(rs.Fields(i).Name)%>.value = "<%=strNeedQuotes%>";
</script>
<%
if rs.Fields(i).Name=strKeyField then if strNeedQuotes="True" then gstrQuote=GetQuote(rs.Fields(i).Name) else gstrQuote="" end if end if
if rs.Fields(i).Name=strKeyField2 then if strNeedQuotes="True" then gstrQuote2=GetQuote(rs.Fields(i).Name) else gstrQuote2="" end if end if
if rs.Fields(i).Name=strKeyField3 then if strNeedQuotes="True" then gstrQuote3=GetQuote(rs.Fields(i).Name) else gstrQuote3="" end if end if
end if
next
Session("gstrQuote")=gstrQuote
Session("gstrQuote2")=gstrQuote2
Session("gstrQuote3")=gstrQuote3
%>
</form>
<!-- advanced search form -->
<form name=advsearch method=post action="dati_search.asp">
<input type=hidden id=masterkey name=masterkey value="<%=strMasterKey%>">
<%
for i=0 to rs.Fields.Count-1
strNeedQuotes=IfNeedQuotes(rs.Fields(i).Type)
Response.Write "<input type=hidden name=NeedQuotes" & BuildFieldName(rs.Fields(i).Name) & " value=" & strNeedQuotes & ">" & vbCrLF
next
%>
</form>
<!-- export to form -->
<form target=_blank name=exportto method=post action="dati_export.asp">
<input type=hidden id=mypage name=mypage value=<%=CStr(TargetPageNumber)%>>
<input type=hidden id=pagesize name=pagesize value=<%=CStr(PageSize)%>>
</form>
<!-- printer-friendly form -->
<form target=_blank name=printerfriendly method=post action="dati_print.asp">
<input type=hidden id=mypage name=mypage value=<%=CStr(TargetPageNumber)%>>
<input type=hidden id=pagesize name=pagesize value=<%=CStr(PageSize)%>>
</form>
<!-- delete form -->
<form method="POST" action="dati_list.asp" name="deleteform">
<input type=hidden id=masterkey name=masterkey value="<%=strMasterKey%>">
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField)%>" name="NeedQuotes<%=BuildFieldName(strKeyField)%>" value="<%=IfNeedQuotes(rs.Fields(strKeyField).Type)%>">
<input type=hidden id="action" name="action" value="delete">
<input type="hidden" id="TargetPageNumber" name="TargetPageNumber" value=<%=TargetPageNumber%> >
<% if strKeyField2<>"" then %>
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField2)%>" name="NeedQuotes<%=BuildFieldName(strKeyField2)%>" value="<%=IfNeedQuotes(rs.Fields(strKeyField2).Type)%>">
<% end if %>
<% if strKeyField3<>"" then %>
<input type=hidden id="NeedQuotes<%=BuildFieldName(strKeyField3)%>" name="NeedQuotes<%=BuildFieldName(strKeyField3)%>" value="<%=IfNeedQuotes(rs.Fields(strKeyField3).Type)%>">
<% end if %>
<table align='center' width='95%' border='0' cellpadding=3 cellspacing=2>
<%
if CheckSecurity("", "Search")=True then
if rs.eof then
Response.Write "<p> </p><p align=center><b>No records found</b></p>"
else
call WriteTableHeader
call loopRs(rs, CLng(PageSize))
end if
end if
%>
<%
rs.Close
Set rs = Nothing
%>
</table>
</form>
<% if CheckSecurity("", "Search")=True then %>
<script language="JavaScript">WritePagination(<%=mypage%>,<%=maxpages%>);</script>
<% end if %>
<%
Response.Write("</body>")
Response.Write("</html>")
function setupRs(strConnection,strSQL,nPageSize)
Err.Clear
Set setupRs = server.CreateObject ("ADODB.Recordset")
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Open
Call ReportError
LogInfo(strSQL)
setupRs.open strSQL,dbConnection
Call ReportError
' Pagination:
if NOT setupRs.EOF then
setupRs.PageSize =nPageSize
maxRecords = cdbl(setupRs.RecordCount)
maxpages=cdbl(setupRs.PageCount)
if cdbl(mypage) > cdbl(maxpages) then
mypage = maxpages
End IF
setupRs.AbsolutePage = mypage
maxrecs=cdbl(setupRs.pagesize)
End IF
end function
sub WriteTableHeader
%>
<tr CLASS="blackshade" valign=top>
<TD align=center><img src=images/icon_edit.gif></td>
<TD align=center><img src=images/icon_view.gif></td>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("ID").Attributes and 128) and ( rs.Fields("ID").Type = 204 or rs.Fields("ID").Type=205 ) then
Response.Write Label("ID") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("ID","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("ID")%>
</td>
<%
if Request.Form("orderby")="ID" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("data").Attributes and 128) and ( rs.Fields("data").Type = 204 or rs.Fields("data").Type=205 ) then
Response.Write Label("data") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("data","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("data")%>
</td>
<%
if Request.Form("orderby")="data" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("committente").Attributes and 128) and ( rs.Fields("committente").Type = 204 or rs.Fields("committente").Type=205 ) then
Response.Write Label("committente") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("committente","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("committente")%>
</td>
<%
if Request.Form("orderby")="committente" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("mittente").Attributes and 128) and ( rs.Fields("mittente").Type = 204 or rs.Fields("mittente").Type=205 ) then
Response.Write Label("mittente") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("mittente","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("mittente")%>
</td>
<%
if Request.Form("orderby")="mittente" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("indirizzo").Attributes and 128) and ( rs.Fields("indirizzo").Type = 204 or rs.Fields("indirizzo").Type=205 ) then
Response.Write Label("indirizzo") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("indirizzo","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("indirizzo")%>
</td>
<%
if Request.Form("orderby")="indirizzo" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("localita").Attributes and 128) and ( rs.Fields("localita").Type = 204 or rs.Fields("localita").Type=205 ) then
Response.Write Label("localita") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("localita","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("localita")%>
</td>
<%
if Request.Form("orderby")="localita" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("ddt").Attributes and 128) and ( rs.Fields("ddt").Type = 204 or rs.Fields("ddt").Type=205 ) then
Response.Write Label("ddt") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("ddt","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("ddt")%>
</td>
<%
if Request.Form("orderby")="ddt" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("servizio").Attributes and 128) and ( rs.Fields("servizio").Type = 204 or rs.Fields("servizio").Type=205 ) then
Response.Write Label("servizio") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("servizio","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("servizio")%>
</td>
<%
if Request.Form("orderby")="servizio" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("autista").Attributes and 128) and ( rs.Fields("autista").Type = 204 or rs.Fields("autista").Type=205 ) then
Response.Write Label("autista") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("autista","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("autista")%>
</td>
<%
if Request.Form("orderby")="autista" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("destinatario").Attributes and 128) and ( rs.Fields("destinatario").Type = 204 or rs.Fields("destinatario").Type=205 ) then
Response.Write Label("destinatario") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("destinatario","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("destinatario")%>
</td>
<%
if Request.Form("orderby")="destinatario" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("via").Attributes and 128) and ( rs.Fields("via").Type = 204 or rs.Fields("via").Type=205 ) then
Response.Write Label("via") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("via","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("via")%>
</td>
<%
if Request.Form("orderby")="via" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("citta").Attributes and 128) and ( rs.Fields("citta").Type = 204 or rs.Fields("citta").Type=205 ) then
Response.Write Label("citta") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("citta","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("citta")%>
</td>
<%
if Request.Form("orderby")="citta" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("colli").Attributes and 128) and ( rs.Fields("colli").Type = 204 or rs.Fields("colli").Type=205 ) then
Response.Write Label("colli") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("colli","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("colli")%>
</td>
<%
if Request.Form("orderby")="colli" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("peso").Attributes and 128) and ( rs.Fields("peso").Type = 204 or rs.Fields("peso").Type=205 ) then
Response.Write Label("peso") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("peso","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("peso")%>
</td>
<%
if Request.Form("orderby")="peso" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("volume").Attributes and 128) and ( rs.Fields("volume").Type = 204 or rs.Fields("volume").Type=205 ) then
Response.Write Label("volume") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("volume","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("volume")%>
</td>
<%
if Request.Form("orderby")="volume" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("contrassegno").Attributes and 128) and ( rs.Fields("contrassegno").Type = 204 or rs.Fields("contrassegno").Type=205 ) then
Response.Write Label("contrassegno") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("contrassegno","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("contrassegno")%>
</td>
<%
if Request.Form("orderby")="contrassegno" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("note").Attributes and 128) and ( rs.Fields("note").Type = 204 or rs.Fields("note").Type=205 ) then
Response.Write Label("note") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("note","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("note")%>
</td>
<%
if Request.Form("orderby")="note" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("data_consegna").Attributes and 128) and ( rs.Fields("data_consegna").Type = 204 or rs.Fields("data_consegna").Type=205 ) then
Response.Write Label("data_consegna") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("data_consegna","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("data_consegna")%>
</td>
<%
if Request.Form("orderby")="data_consegna" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
<TD>
<table><tr><td class=blackshade>
<% if (rs.Fields("esito").Attributes and 128) and ( rs.Fields("esito").Type = 204 or rs.Fields("esito").Type=205 ) then
Response.Write Label("esito") & "</td>"
else
%>
<a class=blackshade href="dati_list.asp" onClick="javascript:
document.forms.frmAdmin.action.value = 'OrderBy';
document.forms.frmAdmin.orderby.value = '<%=Replace("esito","'","\'")%>';
document.forms.frmAdmin.submit(); return false; "><%=Label("esito")%>
</td>
<%
if Request.Form("orderby")="esito" and strOrderImage<>"" then
Response.Write "<td><img src=images/" & strOrderImage & " border=0></td>"
end if
end if
%>
</tr></table>
</TD>
</tr>
<%
end sub
' display table with results
sub loopRs(rs,nPageSize)
' Pagination:
dim iShadeTheDetail, iNumberOfRows, nColumns
iNumberOfRows = 0
nDelete=1
nColumns=0
if isObject(rs) then
' Pagination: UNTIL iNumberOfRows>=maxrecs
DO UNTIL rs.eof OR iNumberOfRows>=nPageSize
' To insure that every other one is shaded
If iShadeTheDetail = 0 then
sShadeClass = "class=shade"
iShadeTheDetail = 1
Else
sShadeClass = ""
iShadeTheDetail = 0
End If
%>
<tr valign=top
<%=sShadeClass%> onmouseover="rowRollover(<%=iNumberOfRows%>, 1);" onmouseout="rowRollover(<%=iNumberOfRows%>, 0);" id="tr_<%=iNumberOfRows%>" >
<td align=center>
<%
nColumns = nColumns + 1
strOwnerID = RemoveWrappers("[]")
if strOwnerID<>"" then strOwnerID = rs(strOwnerID)
if CheckSecurity(strOwnerID, "Edit")=True then
%>
<a href="dati_edit.asp"
onClick="javascript: document.forms.editform.TargetPageNumber.value=<%=mypage%>;
document.forms.editform.editid.value = '<%=EscapeQuotes(rs(strKeyField))%>';
<% if strKeyField2<>"" then %>
document.forms.editform.editid2.value = '<%=EscapeQuotes(rs(strKeyField2))%>';
<% end if %>
<% if strKeyField3<>"" then %>
document.forms.editform.editid3.value = '<%=EscapeQuotes(rs(strKeyField3))%>';
<% end if %>
document.forms.editform.todo.value = 'view';document.forms.editform.submit();
return false;" >Esito</a>
<% end if %>
</td>
<td align=center>
<a href="dati_view.asp"
onClick="javascript: document.forms.editform.action='dati_view.asp';
document.forms.editform.TargetPageNumber.value=<%=mypage%>;
document.forms.editform.editid.value = '<%=EscapeQuotes(rs(strKeyField))%>';
<%
nColumns = nColumns + 1
if strKeyField2<>"" then %>
document.forms.editform.editid2.value = '<%=EscapeQuotes(rs(strKeyField2))%>';
<% end if %>
<% if strKeyField3<>"" then %>
document.forms.editform.editid3.value = '<%=EscapeQuotes(rs(strKeyField3))%>';
<% end if %>
document.forms.editform.todo.value = 'readonly';document.forms.editform.submit();
return false;" >Visualizza</a>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("ID")) or Format("ID")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "ID", "")
else
strData = GetData(rs.Fields("ID"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("data")) or Format("data")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "data", "")
else
strData = GetData(rs.Fields("data"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("committente")) or Format("committente")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "committente", "")
else
strData = GetData(rs.Fields("committente"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("mittente")) or Format("mittente")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "mittente", "")
else
strData = GetData(rs.Fields("mittente"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("indirizzo")) or Format("indirizzo")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "indirizzo", "")
else
strData = GetData(rs.Fields("indirizzo"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("localita")) or Format("localita")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "localita", "")
else
strData = GetData(rs.Fields("localita"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("ddt")) or Format("ddt")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "ddt", "")
else
strData = GetData(rs.Fields("ddt"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("servizio")) or Format("servizio")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "servizio", "")
else
strData = GetData(rs.Fields("servizio"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("autista")) or Format("autista")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "autista", "")
else
strData = GetData(rs.Fields("autista"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("destinatario")) or Format("destinatario")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "destinatario", "")
else
strData = GetData(rs.Fields("destinatario"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("via")) or Format("via")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "via", "")
else
strData = GetData(rs.Fields("via"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("citta")) or Format("citta")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "citta", "")
else
strData = GetData(rs.Fields("citta"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("colli")) or Format("colli")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "colli", "")
else
strData = GetData(rs.Fields("colli"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("peso")) or Format("peso")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "peso", "")
else
strData = GetData(rs.Fields("peso"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("volume")) or Format("volume")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "volume", "")
else
strData = GetData(rs.Fields("volume"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("contrassegno")) or Format("contrassegno")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "contrassegno", "")
else
strData = GetData(rs.Fields("contrassegno"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("note")) or Format("note")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "note", "")
else
strData = GetData(rs.Fields("note"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("data_consegna")) or Format("data_consegna")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "data_consegna", "")
else
strData = GetData(rs.Fields("data_consegna"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
<TD>
<%
if IsBinaryField(rs.Fields("esito")) or Format("esito")=FORMAT_DATABASE_FILE then
Response.Write CreateImageControl(rs, "esito", "")
else
strData = GetData(rs.Fields("esito"), "")
Response.Write ProcessLargeText(strData)
end if
%>
</td>
</tr>
<%
iNumberOfRows = iNumberOfRows + 1
rs.movenext
Loop
end if
end sub
Sub CalculateOrderBy
if Request.Form("action")="OrderBy" then
strOrderBy = " order by " & AddWrappers(Request.Form("orderby"))
if Len(Session(strTableName & "SQL"))>3 then
nInd = InStr(1, Session(strTableName & "SQL"),"order by ")
if nInd>0 then
if Left(Mid(Session(strTableName & "SQL"),nInd+Len("order by ")),Len(AddWrappers(Request.Form("orderby")))) = AddWrappers(Request.Form("orderby")) _
and Right(Session(strTableName & "SQL"),3) = "asc" then
strOrderBy = strOrderBy & " desc"
else
strOrderBy = strOrderBy & " asc"
end if
else
strOrderBy = strOrderBy & " asc"
end if
else
strOrderBy = strOrderBy & " asc"
end if
if right(strOrderBy,3)="asc" then
strOrderImage="up.gif"
else
strOrderImage="down.gif"
end if
else
strOrderBy = Request.Form("orderby")
if strOrderBy="" and Len(Session(strTableName & "SQL"))<3 then strOrderBy=gstrOrderBy
end if
End Sub
Function GetTotal(value, stype, iNumberOfRows, sFormat)
if sFormat = FORMAT_CURRENCY and value<>"" then
value = FormatCurrency(value)
elseif sFormat = FORMAT_NUMBER and value<>"" then
value = FormatNumber(CDbl(value), 2)
end if
if stype="COUNT" then GetTotal= "Count: " & CStr(iNumberOfRows)
if stype="TOTAL" then GetTotal = "Total: " & CStr(value)
if stype="AVERAGE" then GetTotal="Average: " & CStr(CDbl(value)/iNumberOfRows)
End Function
%>