Modificare il file:
\Admin\Admins_list.asp
<%@ Language=VBScript %> <link REL="stylesheet" href="include/style.css" type="text/css"> <!--#include file="Admins_dbconnection.asp"--> <!--#include file="include/Admins_variables.asp"--> <!--#include file="include/Admins_aspfunctions.asp"--> <% ' *** Restrict Access To Page: Grant or deny access to this page ' *** Restringa Accesso A Pagina: Grant o nega accesso a questa pagina '**************************************** ' ATORIZZAZIONI ALL'ACCESSO programma e-commerce '***************************************** MM_authorizedUsers="" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_UsernameDaMaSOFTLista") <> "" Then If (true Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% 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("Username"))="True" or _ strSearchOption="Contains" or strSearchOption="Starts with ..." then strAdd = strAdd & " or " & AddWrappers("Username") & StrWhere("Username", strSearchFor, strSearchOption, "") end if if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("Password"))="True" or _ strSearchOption="Contains" or strSearchOption="Starts with ..." then strAdd = strAdd & " or " & AddWrappers("Password") & StrWhere("Password", strSearchFor, strSearchOption, "") end if if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("accesso"))="True" or _ strSearchOption="Contains" or strSearchOption="Starts with ..." then strAdd = strAdd & " or " & AddWrappers("accesso") & StrWhere("accesso", strSearchFor, strSearchOption, "") end if if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("lista"))="True" or _ strSearchOption="Contains" or strSearchOption="Starts with ..." then strAdd = strAdd & " or " & AddWrappers("lista") & StrWhere("lista", strSearchFor, strSearchOption, "") end if if IsNumeric(strSearchFor) or IfNeedQuotes(GetFieldType("pin"))="True" or _ strSearchOption="Contains" or strSearchOption="Starts with ..." then strAdd = strAdd & " or " & AddWrappers("pin") & StrWhere("pin", 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="Admins_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'> <tr> <td width=10><img border="0" src="immagini/SHUTDOWN.png" width="32" height="32"></td> <td width=30><b><a title="Ritorna al menu di amministrazione" href="default.asp"> <font size="2">ESCI </font> </a></b></td> <% if CheckSecurity("", "Export")=True then %> <td align=center width=20> </td> <td align=center> <img border="0" src="immagini/esporta.png" width="32" height="32"> </td> <td align=center> <a href="Admins_export.asp" onClick="document.exportto.submit();return false;"> <font size="2">Esporta lista</font></a><font size="2"> </font> </td><td width=20> </td> <td align=center> <font size="2"> <img border="0" src="immagini/iCandy_Junior%20023.png" width="32" height="32"> </font> </td> <td align=center> <a href="Admins_print.asp" onClick="document.printerfriendly.submit();return false;"> <font size="2">Stampa la pagina</font></a><font size="2"> </font> </td> <td width=20> </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'> <a href=Admins_add.asp onClick="javascript: document.forms.editform.action='Admins_add.asp'; document.forms.editform.todo.value = 'add'; document.forms.editform.TargetPageNumber.value=<%=mypage%>; document.forms.editform.submit(); return false;" >Aggiungi Nuovo</a> </td> <% end if %> <!-- Search form --> <td align=center valign=middle class=shade> <b>Ricerca: </b> <SELECT ID="SearchField" NAME="SearchField" SIZE="1"> <OPTION VALUE="AnyField">Tutti i campi</option> <OPTION VALUE="ID"><%=Label("ID")%></option> <OPTION VALUE="Username"><%=Label("Username")%></option> <OPTION VALUE="Password"><%=Label("Password")%></option> <OPTION VALUE="accesso"><%=Label("accesso")%></option> <OPTION VALUE="lista"><%=Label("lista")%></option> <OPTION VALUE="pin"><%=Label("pin")%></option> </SELECT> <SELECT ID="SearchOption" NAME="SearchOption" SIZE="1"> <OPTION VALUE="Contains">Contiene</option> <OPTION VALUE="Equals">Uguale</option> <OPTION VALUE="Starts with ...">Inizia con ...</option> <OPTION VALUE="More than ...">> di ...</option> <OPTION VALUE="Less than ...">< minore di ...</option> <OPTION VALUE="Equal or more than ...">= o > di ...</option> <OPTION VALUE="Equal or less than ...">= o < di ...</option> <OPTION VALUE="IsNull">Vuoto</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="Ricerca" onClick="javascript: document.forms.frmAdmin.action.value = 'Search'; document.forms.frmAdmin.submit();"> <input type=button class=button value="Vis. tutti" onClick="javascript: document.forms.frmAdmin.action.value = 'Search'; document.forms.frmAdmin.SearchFor.value=''; document.forms.frmAdmin.submit();"> </td> <!-- How many records found--> <td align=center class=shade> Trovati: <%=maxRecords%> <br>Pag. <%=mypage%> di <%=maxpages%> </td> <td align=center class=shade> <!--Records per page--> Records Per Pag.:<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=Admins_add.asp onClick="javascript: document.forms.editform.action='Admins_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 %> <% if CheckSecurity("", "Delete")=True then %> <a href=# onClick = "var i; bSelected = !bSelected; for (i=0;i<document.forms.deleteform.mdelete.length;++i) document.forms.deleteform.mdelete[i].checked=bSelected;">Seleziona/Deseleziona tutti</a> <a href="#" onClick="if (confirm('Vuoi veramente cancellare questo record?')) { document.forms.deleteform.submit(); return false; } else {return true;}">Cancella i selezionati</a> <% end if %> <% 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> <!-- export to form --> <form target=_blank name=exportto method=post action="Admins_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="Admins_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="Admins_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 border="0" src="immagini/RENAME.png" width="32" height="32"></td> <TD align=center> <img border="0" src="immagini/occhio.png" width="32" height="32"></td> <TD align=center> <img border="0" src="immagini/cestino.png" width="32" height="32"></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="Admins_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("Username").Attributes and 128) and ( rs.Fields("Username").Type = 204 or rs.Fields("Username").Type=205 ) then Response.Write Label("Username") & "</td>" else %> <a class=blackshade href="Admins_list.asp" onClick="javascript: document.forms.frmAdmin.action.value = 'OrderBy'; document.forms.frmAdmin.orderby.value = '<%=Replace("Username","'","\'")%>'; document.forms.frmAdmin.submit(); return false; "><%=Label("Username")%> </td> <% if Request.Form("orderby")="Username" 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("Password").Attributes and 128) and ( rs.Fields("Password").Type = 204 or rs.Fields("Password").Type=205 ) then Response.Write Label("Password") & "</td>" else %> <a class=blackshade href="Admins_list.asp" onClick="javascript: document.forms.frmAdmin.action.value = 'OrderBy'; document.forms.frmAdmin.orderby.value = '<%=Replace("Password","'","\'")%>'; document.forms.frmAdmin.submit(); return false; "><%=Label("Password")%> </td> <% if Request.Form("orderby")="Password" 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("accesso").Attributes and 128) and ( rs.Fields("accesso").Type = 204 or rs.Fields("accesso").Type=205 ) then Response.Write Label("accesso") & "</td>" else %> <a class=blackshade href="Admins_list.asp" onClick="javascript: document.forms.frmAdmin.action.value = 'OrderBy'; document.forms.frmAdmin.orderby.value = '<%=Replace("accesso","'","\'")%>'; document.forms.frmAdmin.submit(); return false; "><%=Label("accesso")%> </td> <% if Request.Form("orderby")="accesso" 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("lista").Attributes and 128) and ( rs.Fields("lista").Type = 204 or rs.Fields("lista").Type=205 ) then Response.Write Label("lista") & "</td>" else %> <a class=blackshade href="Admins_list.asp" onClick="javascript: document.forms.frmAdmin.action.value = 'OrderBy'; document.forms.frmAdmin.orderby.value = '<%=Replace("lista","'","\'")%>'; document.forms.frmAdmin.submit(); return false; "><%=Label("lista")%> </td> <% if Request.Form("orderby")="lista" 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("pin").Attributes and 128) and ( rs.Fields("pin").Type = 204 or rs.Fields("pin").Type=205 ) then Response.Write Label("pin") & "</td>" else %> <a class=blackshade href="Admins_list.asp" onClick="javascript: document.forms.frmAdmin.action.value = 'OrderBy'; document.forms.frmAdmin.orderby.value = '<%=Replace("pin","'","\'")%>'; document.forms.frmAdmin.submit(); return false; "><%=Label("pin")%> </td> <% if Request.Form("orderby")="pin" 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="Admins_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;" >Modifica</a> <% end if %> </td> <td align=center> <a href="Admins_view.asp" onClick="javascript: document.forms.editform.action='Admins_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;" >Visual.</a> </td> <td align=center valign=middle> <% nColumns = nColumns + 1 strOwnerID = RemoveWrappers("") if strOwnerID<>"" then strOwnerID = rs(strOwnerID) if CheckSecurity(strOwnerID, "Delete")=True then %> <input type=checkbox name=mdelete value=<%=nDelete%>> <input type=hidden name=mdelete1 value="<%=rs(strKeyField)%>"> <% if strKeyField2<>"" then %> <input type=hidden name=mdelete2 value="<%=rs(strKeyField2)%>"> <% end if %> <% if strKeyField3<>"" then %> <input type=hidden name=mdelete3 value="<%=rs(strKeyField3)%>"> <% end if nDelete = nDelete + 1 %> <% end if %> </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("Username")) or Format("Username")=FORMAT_DATABASE_FILE then Response.Write CreateImageControl(rs, "Username", "") else strData = GetData(rs.Fields("Username"), "") Response.Write ProcessLargeText(strData) end if %> </td> <TD> <% if IsBinaryField(rs.Fields("Password")) or Format("Password")=FORMAT_DATABASE_FILE then Response.Write CreateImageControl(rs, "Password", "") else strData = GetData(rs.Fields("Password"), "") Response.Write ProcessLargeText(strData) end if %> </td> <TD> <% if IsBinaryField(rs.Fields("accesso")) or Format("accesso")=FORMAT_DATABASE_FILE then Response.Write CreateImageControl(rs, "accesso", "") else strData = GetData(rs.Fields("accesso"), "") Response.Write ProcessLargeText(strData) end if %> </td> <TD> <% if IsBinaryField(rs.Fields("lista")) or Format("lista")=FORMAT_DATABASE_FILE then Response.Write CreateImageControl(rs, "lista", "") else strData = GetData(rs.Fields("lista"), "") Response.Write ProcessLargeText(strData) end if %> </td> <TD> <% if IsBinaryField(rs.Fields("pin")) or Format("pin")=FORMAT_DATABASE_FILE then Response.Write CreateImageControl(rs, "pin", "") else strData = GetData(rs.Fields("pin"), "") 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 %>
[
Íàçàä
]