Modificare il file:
\Buoni-spesa-OLD\titolo_print.asp
<!--#include file="include/dbcommon.asp"--> <!--#include file="include/titolo_variables.asp"--> <!--#include file="libs/smarty.asp"--> <%if SESSION("UserID")="" then SESSION("MyURL")=request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERY_STRING") response.Redirect "login.asp?message=expired" response.End end if if not CheckSecurity(SESSION("_" & strTableName & "_OwnerID"),"Export") then response.Write "<p>" & "Non hai il permesso per accedere a questa tabella" & "<a href=""login.asp"">" & "Torna alla pagina di login" & "</a></p>" response.End end if dbConnection="" db_connect() DoEvent "BeforeProcessPrint dbConnection" Set rs = server.CreateObject("ADODB.Recordset") Set rss = server.CreateObject("ADODB.Recordset") strWhereClause="" if request("a")<>"" then sWhere = "1=0" 'process selection set selected_recs = CreateObject("Scripting.Dictionary") if request("mdelete[]").Count>0 then for ind=1 to request("mdelete[]").Count set keys = CreateObject("Scripting.Dictionary") AddDict keys,"titolo",request("mdelete1[]").Item(request("mdelete[]").Item(ind)) AddDict selected_recs, ind, keys next elseif request("selection[]").Count>0 then for ind=1 to request("selection[]").Count set keys = CreateObject("Scripting.Dictionary") arr = split(request("selection[]").Item(ind) ,"&") if UBound(arr)-LBound(arr) = 1 - 1 then AddDict keys,"titolo", HTMLDecode(arr(0)) AddDict selected_recs, ind, keys end if next end if sr = selected_recs.Items for ind=1 to selected_recs.Count set keys = sr(ind-1) sWhere=sWhere & " or " sWhere=sWhere & KeyWhere(keys,"") next strSQL = gSQLWhereAdd(sWhere) strWhereClause=sWhere else strWhereClause=SESSION(strTableName & "_where") strSQL = gSQLWhereAdd(strWhereClause) end if strOrderBy=SESSION(strTableName & "_order") if strOrderBy="" then _ strOrderBy=gstrOrderBy strSQL = strSQL & " " & trim(strOrderBy) strSQLbak = strSQL DoEvent "BeforeQueryPrint strSQL,strWhereClause,strOrderBy" ' Rebuild SQL if needed if strSQL<>strSQLbak then ' changed strSQL - old style numrows=GetRowCount(strSQL) else strSQL = gSQLWhereAdd(strWhereClause) strSQL = strSQL & " " & trim(strOrderBy) numrows = gSQLRowCount(strWhereClause) end if LogInfo(strSQL) DoEvent "BeforeQueryPrint strSQL" ' Pagination: mypage=cint(SESSION(strTableName & "_pagenumber")) if mypage=0 then mypage=1 ' page size PageSize=cint(SESSION(strTableName & "_pagesize")) if PageSize=0 then PageSize=gPageSize recno=1 if numrows>0 then maxRecords = numrows maxpages=int(maxRecords/PageSize) if maxRecords mod PageSize <> 0 then maxpages=maxpages+1 if mypage > maxpages then mypage = maxpages if mypage<1 then mypage=1 maxrecs=PageSize strSQL = AddTop(strSQL, mypage*PageSize) end if rs.Open strSQL, dbConnection,1,2 if not rs.EOF then rs.Move(PageSize*(mypage-1)) ' hide colunm headers if needed recordsonpage=numrows-(mypage-1)*PageSize if recordsonpage>PageSize then _ recordsonpage=PageSize if recordsonpage>=1 then smarty.Add "column1show",true else smarty.Add "column1show",false end if Set rowinfo = CreateObject("Scripting.Dictionary") ri=0 while not rs.EOF and recno<=PageSize Set row = CreateObject("Scripting.Dictionary") col=0 do while not rs.eof retval=true DoEvent "retval=BeforeProcessRowPrint(rs)" if retval=false then rs.MoveNext else exit do end if loop while not rs.EOF and recno<=PageSize and col<1 col=col+1 recno=recno+1 keylink="" keylink=keylink & "&key1=" & my_htmlspecialchars(server.urlencode(dbvalue(rs("titolo")))) Set fso = CreateObject("Scripting.FileSystemObject") ' titolo - value="" value = ProcessLargeText(GetData(rs,"titolo", ""),"field=titolo" & keylink,"",MODE_PRINT) row.Add col & "titolo_value",value & " " row.Add col & "show",true DoEvent "BeforeMoveNextPrint rs,row,col" rs.MoveNext do while not rs.eof retval=true DoEvent "retval=BeforeProcessRowPrint(rs)" if retval=false then rs.MoveNext else exit do end if loop wend rowinfo.Add ri,row ri=ri+1 wend smarty.Add "rowinfo",rowinfo rs.Close strSQL=SESSION(strTableName & "_sql") templatefile = "titolo_print.htm" DoEvent "BeforeShowPrint smarty,templatefile" smarty_display(templatefile) %>
[
Íàçàä
]