Modificare il file:
\Buoni-spesa-OLD\transizioni_list.asp
<!--#include file="include/dbcommon.asp"--> <!--#include file="include/transizioni_variables.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"),"Search") and not CheckSecurity(SESSION("_" & strTableName & "_OwnerID"),"Add") 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 %> <!--#include file="libs/smarty.asp"--> <% ' on error resume next dbConnection="" db_connect() call ReportError Set rs = server.CreateObject("ADODB.Recordset") Set rss = server.CreateObject("ADODB.Recordset") ' process reqest data, fill session variables if (Request.Form="" and Request.QueryString="") then For Each key in Session.Contents if left(key, len(strTableName)+1 ) = strTableName & "_" and _ InStr(Mid(key, len(strTableName)+2), "_" )<1 then Session.Contents.Remove(key) end if Next set strTableName_asearchnot = CreateObject("Scripting.Dictionary") set strTableName_asearchopt = CreateObject("Scripting.Dictionary") set strTableName_asearchfor = CreateObject("Scripting.Dictionary") set strTableName_asearchfortype = CreateObject("Scripting.Dictionary") set strTableName_asearchfor2 = CreateObject("Scripting.Dictionary") set session(strTableName & "_asearchnot")= strTableName_asearchnot set session(strTableName & "_asearchopt") = strTableName_asearchopt set session(strTableName & "_asearchfor") = strTableName_asearchfor set session(strTableName & "_asearchfor2") = strTableName_asearchfor2 set session(strTableName & "_asearchfortype") = strTableName_asearchfortype end if ' before process list event DoEvent "BeforeProcessList dbConnection" if REQUEST("a")="showall" then SESSION(strTableName & "_search")=0 elseif REQUEST("a")="search" then SESSION(strTableName & "_searchfield")=postvalue("SearchField") SESSION(strTableName & "_searchoption")=postvalue("SearchOption") SESSION(strTableName & "_searchfor")=postvalue("SearchFor") if postvalue("SearchFor")<>"" or postvalue("SearchOption")="Empty" then SESSION(strTableName & "_search")=1 else SESSION(strTableName & "_search")=0 end if SESSION(strTableName & "_pagenumber")=1 elseif REQUEST("a")="advsearch" then set strTableName_asearchnot = CreateObject("Scripting.Dictionary") set strTableName_asearchopt = CreateObject("Scripting.Dictionary") set strTableName_asearchfor = CreateObject("Scripting.Dictionary") set strTableName_asearchfor2 = CreateObject("Scripting.Dictionary") set strTableName_asearchfortype = CreateObject("Scripting.Dictionary") tosearch=0 asearchfield = postvalue("asearchfield[]") if not isarray(asearchfield) then dim t t=asearchfield redim asearchfield(1) asearchfield(0)=t end if SESSION(strTableName & "_asearchtype") = postvalue("type") if SESSION(strTableName & "_asearchtype")="" then SESSION(strTableName & "_asearchtype")="and" for field=0 to ubound(asearchfield) gfield=asearchfield(field) asopt=postvalue("asearchopt_" & GoodFieldName(asearchfield(field))) value1=postvalue("value_" & GoodFieldName(asearchfield(field))) if value1="" then value1=postvalue("value_" & GoodFieldName(asearchfield(field)) & "[]") ttype=postvalue("type_" & GoodFieldName(asearchfield(field))) value2=postvalue("value1_" & GoodFieldName(asearchfield(field))) if value2="" then value2=postvalue("value_1" & GoodFieldName(asearchfield(field)) & "[]") nnot=postvalue("not_" & GoodFieldName(asearchfield(field))) if not SafeIsEmpty(value1) or asopt="Empty" then tosearch=1 strTableName_asearchopt.Add gfield,asopt if not isArray(value1) then strTableName_asearchfor.Add gfield,value1 else strTableName_asearchfor.Add gfield,combinevalues(value1) end if strTableName_asearchfortype.Add gfield,ttype if not SafeIsEmpty(value2) then strTableName_asearchfor2.Add gfield,value2 strTableName_asearchnot.Add gfield,nnot end if next set SESSION(strTableName & "_asearchnot")= strTableName_asearchnot set SESSION(strTableName & "_asearchfortype")= strTableName_asearchfortype set SESSION(strTableName & "_asearchopt") = strTableName_asearchopt set SESSION(strTableName & "_asearchfor") = strTableName_asearchfor set SESSION(strTableName & "_asearchfor2") = strTableName_asearchfor2 if tosearch<>0 then SESSION(strTableName & "_search")=2 else SESSION(strTableName & "_search")=0 end if SESSION(strTableName & "_pagenumber")=1 end if if REQUEST("orderby")<> "" then SESSION(strTableName & "_orderby")=REQUEST("orderby") if REQUEST("pagesize")<>"" then SESSION(strTableName & "_pagesize")=REQUEST("pagesize") SESSION(strTableName & "_pagenumber")=1 end if if REQUEST("goto")<>"" then SESSION(strTableName & "_pagenumber")=REQUEST("goto") ' process reqest data - end includes="" if useAJAX then includes = includes & "<script language=""JavaScript"" type=""text/javascript"" src=""include/jquery.js""></script>" & vbCrLf includes = includes & "<script language=""JavaScript"" type=""text/javascript"" src=""include/ajaxsuggest.js""></script>" & vbCrLf ' validation stuff set editValidateTypes = Server.CreateObject("Scripting.Dictionary") set editValidateFields = Server.CreateObject("Scripting.Dictionary") set addValidateTypes = Server.CreateObject("Scripting.Dictionary") set addValidateFields = Server.CreateObject("Scripting.Dictionary") includes = includes & "<script type=""text/javascript"" src=""include/inlineedit.js""></script>" & vbCrLf validatetype="IsNumeric" editValidateTypes.Add "editValidateType1",validatetype editValidateFields.Add "editValidateField1","importo" validatetype="" validatetype=validatetype & "IsRequired" editValidateTypes.Add "editValidateType2",validatetype editValidateFields.Add "editValidateField2","data_emissione" validatetype="" addValidateTypes.Add "addValidateType1",validatetype addValidateFields.Add "addValidateField1","N_Buono" validatetype="IsNumeric" addValidateTypes.Add "addValidateType2",validatetype addValidateFields.Add "addValidateField2","importo" validatetype="" validatetype=validatetype & "IsRequired" addValidateTypes.Add "addValidateType3",validatetype addValidateFields.Add "addValidateField3","data_emissione" includes=includes & "<script language=""JavaScript"">" includes=includes & "var TEXT_INLINE_FIELD_REQUIRED='" & jsreplace("Campo richiesto") & "';" includes=includes & "var TEXT_INLINE_FIELD_ZIPCODE='" & jsreplace("Il campo deve contenere un Codice di Avviamento Postale valido") & "';" includes=includes & "var TEXT_INLINE_FIELD_EMAIL='" & jsreplace("Il campo deve contenere un indirizzo di posta elettronica valido") & "';" includes=includes & "var TEXT_INLINE_FIELD_NUMBER='" & jsreplace("Il campo deve essere un Numero") & "';" includes=includes & "var TEXT_INLINE_FIELD_CURRENCY='" & jsreplace("Il campo deve essere in valuta") & "';" includes=includes & "var TEXT_INLINE_FIELD_PHONE='" & jsreplace("Il campo deve contenere un Numero di Telefono") & "';" includes=includes & "var TEXT_INLINE_FIELD_PASSWORD1='" & jsreplace("Il campo non può contenere la parola 'password'") & "';" includes=includes & "var TEXT_INLINE_FIELD_PASSWORD2='" & jsreplace("Il campo deve essere lungo almeno 4 caratteri") & "';" includes=includes & "var TEXT_INLINE_FIELD_STATE='" & jsreplace("Il campo deve contenere un Nome di uno Stato") & "';" includes=includes & "var TEXT_INLINE_FIELD_SSN='" & jsreplace("Il campo deve contenere un Numero di Previdenza Sociale") & "';" includes=includes & "var TEXT_INLINE_FIELD_DATE='" & jsreplace("Il campo deve contenere una data valida") & "';" includes=includes & "var TEXT_INLINE_FIELD_TIME='" & jsreplace("Il campo deve contenere l'ora nel formato h24") & "';" includes=includes & "var TEXT_INLINE_FIELD_CC='" & jsreplace("Il campo deve contenere un Numero di Carta di Credito valido") & "';" includes=includes & "var TEXT_INLINE_FIELD_SSN='" & jsreplace("Il campo deve contenere un Numero di Previdenza Sociale") & "';" includes=includes & "</script>" types_separated = join(editValidateTypes.Items, ",") fields_separated = join(editValidateFields.Items, ",") includes = includes & "<script type=""text/javascript"">" & vbCrLf includes = includes & "var editValidateTypes = String('" & types_separated & "').split(',');" & vbCrLf includes = includes & "var editValidateFields = String('"& fields_separated & "').split(',');" & vbCrLf includes = includes & "</script>" & vbCrLf types_separated = join(addValidateTypes.Items, ",") fields_separated = join(addValidateFields.Items, ",") includes = includes & "<script type=""text/javascript"">" & vbCrLf includes = includes & "var addValidateTypes = String('" & types_separated & "').split(',');" & vbCrLf includes = includes & "var addValidateFields = String('"& fields_separated & "').split(',');" & vbCrLf includes = includes & "</script>" & vbCrLf '// include datepicker files includes=includes & "<script language=""JavaScript"" src=""include/calendar.js""></script>" end if includes = includes & "<script language=""JavaScript"" src=""include/jsfunctions.js""></script>" & vbCrLf includes = includes & "<script type=""text/javascript"">var bSelected=false;" & vbCrLf includes = includes & "var TEXT_FIRST = """ & "Primo" & """;" & vbCrLf includes = includes & "var TEXT_PREVIOUS = """ & "Precedente" & """;" & vbCrLf includes = includes & "var TEXT_NEXT = """ & "Prossimo" & """;" & vbCrLf includes = includes & "var TEXT_LAST = """ & "Ultimo" & """;" &vbCrLf includes = includes & "var TEXT_PLEASE_SELECT = """ & jsreplace("Prego seleziona") & """;" & vbCrLf includes = includes & "var TEXT_SAVE=""" & jsreplace("Salva") & """;" & vbCrLf includes = includes & "var TEXT_CANCEL=""" & jsreplace("Cancella") & """;" & vbCrLf includes = includes & "var TEXT_INLINE_ERROR=""" & jsreplace("E' accaduto un errore") & """;" & vbCrLf includes = includes & "var locale_dateformat = " & locale_info("LOCALE_IDATE") & ";" & vbCrLf includes = includes & "var locale_datedelimiter = """ & locale_info("LOCALE_SDATE") & """;" & vbCrLf includes = includes & "var bLoading=false;" & vbCrLf if useAJAX then includes = includes & "var AUTOCOMPLETE_TABLE = ""transizioni_autocomplete.asp"";" & vbCrLf includes = includes & "var INLINE_EDIT_TABLE = ""transizioni_edit.asp"";" & vbCrLf includes = includes & "var INLINE_ADD_TABLE = ""transizioni_add.asp"";" & vbCrLf includes = includes & "var INLINE_VIEW_TABLE = ""transizioni_view.asp"";" & vbCrLf includes = includes & "var SUGGEST_TABLE = ""transizioni_searchsuggest.asp"";" & vbCrLf includes = includes & "var MASTER_PREVIEW_TABLE = ""transizioni_masterpreview.asp"";" & vbCrLf includes = includes & "var SUGGEST_LOOKUP_TABLE = ""transizioni_lookupsuggest.asp"";" & vbCrLf end if includes = includes & "</script>" & vbCrLf if useAJAX then includes = includes & "<div id=""search_suggest""></div>" & vbCrLf includes = includes & "<div id=""master_details"" onmouseover=""RollDetailsLink.showPopup();"" onmouseout=""RollDetailsLink.hidePopup();""></div>" & vbCrLf includes = includes & "<div id=""inline_error""></div>" & vbCrLf end if smarty.Add "includes",includes smarty.Add "useAJAX",useAJAX ' process session variables ' order by strOrderBy="" order_ind=-1 smarty.Add "order_dir_N_Buono","a" smarty.Add "order_dir_importo","a" smarty.Add "order_dir_data_emissione","a" if SESSION(strTableName & "_orderby")<> "" then order_field=mid(SESSION(strTableName & "_orderby"),2) order_dir=mid(SESSION(strTableName & "_orderby"),1,1) order_ind=GetFieldIndex(order_field,"") AddDict smarty,"order_dir_N_Buono","a" if order_field="N_Buono" then if order_dir="a" then AddDict smarty,"order_dir_N_Buono","d" img="up" else img="down" end if AddDict smarty,"order_image_N_Buono","<img src=""images/" & img & ".gif"" border=0>" end if AddDict smarty,"order_dir_importo","a" if order_field="importo" then if order_dir="a" then AddDict smarty,"order_dir_importo","d" img="up" else img="down" end if AddDict smarty,"order_image_importo","<img src=""images/" & img & ".gif"" border=0>" end if AddDict smarty,"order_dir_data_emissione","a" if order_field="data_emissione" then if order_dir="a" then AddDict smarty,"order_dir_data_emissione","d" img="up" else img="down" end if AddDict smarty,"order_image_data_emissione","<img src=""images/" & img & ".gif"" border=0>" end if if order_ind<>"" then if order_dir="a" then strOrderBy="order by " & (order_ind) & " asc" else strOrderBy="order by " & (order_ind) & " desc" end if end if end if if strOrderBy="" then strOrderBy=gstrOrderBy ' page number mypage=cint(SESSION(strTableName & "_pagenumber")) if mypage=0 then mypage=1 ' page size PageSize=cint(SESSION(strTableName & "_pagesize")) if PageSize=0 then PageSize=gPageSize s="" if PageSize=10 then s="selected" smarty.Add "rpp10_selected",s s="" if PageSize=20 then s="selected" smarty.Add "rpp20_selected",s s="" if PageSize=30 then s="selected" smarty.Add "rpp30_selected",s s="" if PageSize=50 then s="selected" smarty.Add "rpp50_selected",s s="" if PageSize=100 then s="selected" smarty.Add "rpp100_selected",s s="" if PageSize=500 then s="selected" smarty.Add "rpp500_selected",s ' delete record 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,"N_Buono",request("mdelete1[]").Item(request("mdelete[]").Item(ind)) AddDict selected_recs, ind, keys next else if 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,"N_Buono", HTMLDecode(arr(0)) AddDict selected_recs, ind, keys end if next end if records_deleted=0 sr = selected_recs.Items for ind=1 to selected_recs.Count set keys = sr(ind-1) where = KeyWhere(keys,"") strSQL="delete from " & AddTableWrappers(strOriginalTableName) & " where " & where retval=true if retval then LogInfo(strSQL) dbConnection.Execute strSQL records_deleted = records_deleted + 1 DoEvent "AfterDelete """ & replace(where,"""","""""") & """, avalues" end if next if records_deleted>0 then DoEvent "AfterMassDelete(records_deleted)" end if end if ' make sql "select" string 'strSQL = gstrSQL strWhereClause="" ' add search params if SESSION(strTableName & "_search")=1 then ' regular search strSearchFor=trim(SESSION(strTableName & "_searchfor")) strSearchOption=trim(SESSION(strTableName & "_searchoption")) if SESSION(strTableName & "_searchfield")<> "" then strSearchField = SESSION(strTableName & "_searchfield") where = StrWhere(strSearchField, strSearchFor, strSearchOption, "") if where <>"" then strWhereClause = whereAdd(strWhereClause,where) else strWhereClause = whereAdd(strWhereClause,"1=0") end if else sstrWhere = "1=0" where=StrWhere("N_Buono", strSearchFor, strSearchOption, "") if where<>"" then sstrWhere=sstrWhere & " or " & where where=StrWhere("importo", strSearchFor, strSearchOption, "") if where<>"" then sstrWhere=sstrWhere & " or " & where where=StrWhere("data_emissione", strSearchFor, strSearchOption, "") if where<>"" then sstrWhere=sstrWhere & " or " & where strWhereClause = whereAdd(strWhereClause,sstrWhere) end if else if SESSION(strTableName & "_search")=2 then ' advanced search set strTableName_asearchfortype = SESSION(strTableName & "_asearchfortype") set strTableName_asearchnot = SESSION(strTableName & "_asearchnot") set strTableName_asearchopt = SESSION(strTableName & "_asearchopt") set strTableName_asearchfor = SESSION(strTableName & "_asearchfor") set strTableName_asearchfor2 = SESSION(strTableName & "_asearchfor2") sWhere="" for each f in strTableName_asearchfor strSearchFor=trim(strTableName_asearchfor.item(f)) strSearchFor2="" ttype=strTableName_asearchfortype.item(f) for each i in strTableName_asearchfor2 if f=i then strSearchFor2=trim(strTableName_asearchfor2.item(i)) next if strSearchFor<>"" or true then if sWhere="" then if session(strTableName & "_asearchtype")="and" then sWhere="1=1" else sWhere="1=0" end if end if snot=strTableName_asearchnot.item(f) strSearchOption=trim(strTableName_asearchopt.Item(f)) where="" where=StrWhereAdv(f, strSearchFor, strSearchOption, strSearchFor2,ttype) if where<>"" then if snot<>"" then where="not (" & where & ")" if SESSION(strTableName & "_asearchtype")="and" then sWhere=sWhere & " and " & where else sWhere=sWhere & " or " & where end if end if end if next strWhereClause = whereAdd(strWhereClause,sWhere) end if end if strSQL = gSQLWhereAdd(strWhereClause) ' order by strSQL=strSQL & " " & trim(strOrderBy) ' save SQL for use in "Export" and "Printer-friendly" pages SESSION(strTableName & "_sql") = strSQL SESSION(strTableName & "_where") = strWhereClause SESSION(strTableName & "_order") = strOrderBy ' select and display records if CheckSecurity(SESSION("_" & strTableName & "_OwnerID"),"Search") then strSQLbak = strSQL DoEvent "BeforeQueryList 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) ' Pagination: if numrows=0 then smarty("rowsfound")=false dim message message="Non sono stati trovati Record" message = "<span name=""notfound_message"">" & message & "</span>" smarty("message")=message else smarty("rowsfound")=true smarty("records_found")=numrows 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 smarty.Add "page",mypage smarty.Add "maxpages",maxpages ' write pagination smarty.Add "pagination","<script language=""JavaScript"">WritePagination(" & mypage & "," & maxpages & ");function GotoPage(nPageNumber){window.location='transizioni_list.asp?goto='+nPageNumber;}</script>" strSQL = AddTop(strSQL, mypage*PageSize) end if rs.Open strSQL, dbConnection,1,2 call ReportError 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 smarty("column1show")=true Set rowinfo = CreateObject("Scripting.Dictionary") shade=false recno=1 editlink="" copylink="" ri=0 Set fso = CreateObject("Scripting.FileSystemObject") while not rs.eof and recno<=PageSize Set row = CreateObject("Scripting.Dictionary") if not shade then row.Add "shadeclass","class=""shade""" row.Add "shadeclassname","shade" shade=true else row.Add "shadeclass","" row.Add "shadeclassname","" shade=false end if col=0 do while not rs.eof retval=true DoEvent "retval=BeforeProcessRowList(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 ' key fields keyblock="" row.Add col & "id1",my_htmlspecialchars(dbvalue(rs("N_Buono"))) keyblock = keyblock & my_htmlspecialchars(dbvalue(rs("N_Buono"))) row.Add col & "keyblock", my_htmlspecialchars(keyblock) row.Add col & "recno",recno ' detail tables ' edit page link editlink="" editlink=editlink & "editid1=" & my_htmlspecialchars(SafeURLEncode(dbvalue(rs("N_Buono")))) row.Add col & "editlink",editlink copylink="" copylink=copylink & "copyid1=" & my_htmlspecialchars(SafeURLEncode(dbvalue(rs("N_Buono")))) row.Add col & "copylink",copylink keylink="" keylink=keylink & "&key1=" & my_htmlspecialchars(SafeURLEncode(dbvalue(rs("N_Buono")))) ' N_Buono - value="" if len(rs("N_Buono"))>0 then strdata = make_db_value("N_Buono",rs("N_Buono"),"","") LookupSQL="SELECT " LookupSQL=LookupSQL & "[N_Buono]" LookupSQL=LookupSQL & " FROM [buono] WHERE [N_Buono] = " & strdata LogInfo(LookupSQL) rss.open LookupSQL,dbConnection call ReportError lookupvalue=rs("N_Buono") if not rss.eof then _ lookupvalue=rss(0) value=ProcessLargeText(GetDataInt(lookupvalue,rs,"N_Buono", ""),"field=N%5FBuono" & keylink,"",MODE_LIST) rss.Close else value="" end if row.Add col & "N_Buono_value",value ' importo - Number value="" value = ProcessLargeText(GetData(rs,"importo", "Number"),"field=importo" & keylink,"",MODE_LIST) row.Add col & "importo_value",value ' data_emissione - Short Date value="" value = ProcessLargeText(GetData(rs,"data_emissione", "Short Date"),"field=data%5Femissione" & keylink,"",MODE_LIST) row.Add col & "data_emissione_value",value row.Add col & "show",true DoEvent "BeforeMoveNextList rs,row,col" dim span span="<span " span = span & "id=""edit" & recno & "_N_Buono"" " span = span & ">" row(col & "N_Buono_value") = span & row(col & "N_Buono_value") & "</span>" span="<span " span = span & "id=""edit" & recno & "_importo"" " span = span & ">" row(col & "importo_value") = span & row(col & "importo_value") & "</span>" span="<span " span = span & "id=""edit" & recno & "_data_emissione"" " span = span & ">" row(col & "data_emissione_value") = span & row(col & "data_emissione_value") & "</span>" rs.MoveNext do while not rs.eof retval=true DoEvent "retval=BeforeProcessRowList(rs)" if retval=false then rs.MoveNext else exit do end if loop recno=recno+1 wend rowinfo.add ri,row ri=ri+1 wend smarty.Add "rowinfo",rowinfo rs.Close end if if CheckSecurity(SESSION("_" & strTableName & "_OwnerID"),"Search") then if SESSION(strTableName & "_search")=1 then onload = "onLoad=""if(document.getElementById('SearchFor')) document.getElementById('ctlSearchFor').focus();""" smarty.Add "onload",onload ' fill in search variables ' // field selection if SESSION(strTableName& "_searchfield")="N_Buono" then smarty.Add "search_N_Buono","selected" if SESSION(strTableName& "_searchfield")="importo" then smarty.Add "search_importo","selected" if SESSION(strTableName& "_searchfield")="data_emissione" then smarty.Add "search_data_emissione","selected" ' // search type selection if SESSION(strTableName & "_searchoption")="Contains" then smarty.Add "search_contains_option_selected","selected" if SESSION(strTableName & "_searchoption")="Equals" then smarty.Add "search_equals_option_selected","selected" if SESSION(strTableName & "_searchoption")="Starts with ..." then smarty.Add "search_startswith_option_selected","selected" if SESSION(strTableName & "_searchoption")="More than ..." then smarty.Add "search_more_option_selected","selected" if SESSION(strTableName & "_searchoption")="Less than ..." then smarty.Add "search_less_option_selected","selected" if SESSION(strTableName & "_searchoption")="Equal or more than ..." then smarty.Add "search_equalormore_option_selected","selected" if SESSION(strTableName & "_searchoption")="Equal or less than ..." then smarty.Add "search_equalorless_option_selected","selected" if SESSION(strTableName & "_searchoption")="Empty" then smarty.Add "search_empty_option_selected","selected" smarty.Add "search_searchfor","value=""" & my_htmlspecialchars(SESSION(strTableName & "_searchfor")) & """" end if end if smarty.Add "userid",my_htmlspecialchars(SESSION("UserID")) smarty.Add "displayheader","<script language=""JavaScript"">DisplayHeader();</script>" linkdata= "" if (useAJAX) then linkdata = linkdata & "<script type=""text/javascript"">" & vbCrLf linkdata = linkdata & "function SetDate(fldName, recordID)" & vbcrlf linkdata = linkdata & "{" & vbcrlf linkdata = linkdata & "if ( $('select#month'+fldName+'_'+recordID).get(0).value!='' && $('select#day'+fldName+'_'+recordID).get(0).value!='' && $('select#year'+fldName+'_'+recordID).get(0).value!='') {" & vbCrLf linkdata = linkdata & "$('input#'+fldName+'_'+recordID).get(0).value = '' + " & vbcrlf linkdata = linkdata & "$('select#year'+fldName+'_'+recordID).get(0).value + '-' + " & vbcrlf linkdata = linkdata & "$('select#month'+fldName+'_'+recordID).get(0).value + '-' + " & vbcrlf linkdata = linkdata & " $('select#day'+fldName+'_'+recordID).get(0).value; " & vbcrlf linkdata = linkdata & "if ( $('input#ts'+fldName+'_'+recordID)[0] ) " & vbcrlf linkdata = linkdata & "$('input#ts'+fldName+'_'+recordID).get(0).value = '' + " & vbcrlf linkdata = linkdata & "$('select#day'+fldName+'_'+recordID).get(0).value + '-' + " & vbcrlf linkdata = linkdata & "$('select#month'+fldName+'_'+recordID).get(0).value + '-' + " & vbcrlf linkdata = linkdata & "$('select#year'+fldName+'_'+recordID).get(0).value;" & vbcrlf linkdata = linkdata & " } else { " & vbcrlf linkdata = linkdata & " if ( $('input#ts'+fldName+'_'+recordID)[0] ) " & vbcrlf linkdata = linkdata & "$('input#ts'+fldName+'_'+recordID).get(0).value= '10-6-2007'; " & vbcrlf linkdata = linkdata & " if ( $('input#'+fldName+'_'+recordID)[0] ) " & vbcrlf linkdata = linkdata & "$('input#'+fldName+'_'+recordID).get(0).value= '';" & vbcrlf linkdata = linkdata & "}" & vbcrlf linkdata = linkdata & "}" & vbcrlf linkdata = linkdata & "function update(fldName, recordID, newDate, showTime)" & vbcrlf linkdata = linkdata & "{" & vbcrlf linkdata = linkdata & " var dt_datetime;" & vbcrlf linkdata = linkdata & "var curdate = new Date();" & vbcrlf linkdata = linkdata & "dt_datetime = newDate;" & vbcrlf linkdata = linkdata & "if ( $('select#day'+fldName+'_'+recordID)[0] ) {" & vbcrlf linkdata = linkdata & "$('input#'+fldName+'_'+recordID).get(0).value = dt_datetime.getFullYear() + '-' " & vbcrlf linkdata = linkdata & "+ (dt_datetime.getMonth()+1) + '-' + dt_datetime.getDate();" & vbcrlf linkdata = linkdata & "$('select#day'+fldName+'_'+recordID).get(0).selectedIndex = dt_datetime.getDate();" & vbcrlf linkdata = linkdata & "$('select#month'+fldName+'_'+recordID).get(0).selectedIndex = dt_datetime.getMonth() + 1;" & vbcrlf linkdata = linkdata & "for ( i=0; i<$('select#year'+fldName+'_'+recordID).get(0).options.length; i++ ) {" & vbcrlf linkdata = linkdata & "if ( $('select#year'+fldName+'_'+recordID).get(0).options[i].value == dt_datetime.getFullYear() ) { " & vbcrlf linkdata = linkdata & "$('select#year'+fldName+'_'+recordID).get(0).selectedIndex = i; " & vbcrlf linkdata = linkdata & " break; " & vbcrlf linkdata = linkdata & " } " & vbcrlf linkdata = linkdata & "$('input#ts'+fldName+'_'+recordID).get(0).value = dt_datetime.getDate() + '-' + " & vbcrlf linkdata = linkdata & "( dt_datetime.getMonth() + 1 ) + '-' + dt_datetime.getFullYear(); " & vbcrlf linkdata = linkdata & "}" & vbcrlf linkdata = linkdata & "} else {" & vbcrlf linkdata = linkdata & "$('input#'+fldName+'_'+ recordID).get(0).value = print_datetime(newDate," & locale_info("LOCALE_IDATE") & ",showTime);" & vbcrlf linkdata = linkdata & "$('input#ts'+fldName+'_'+ recordID).get(0).value = print_datetime(newDate,-1,showTime);" & vbcrlf linkdata = linkdata & "}" & vbcrlf linkdata = linkdata & "}" & vbcrlf linkdata = linkdata & "$("".addarea"").each(function(i) { $(this).hide();});" & vbcrlf linkdata = linkdata & "var newrecord_id=" & (recno+1) & ";" & vbcrlf linkdata = linkdata & "var newrecord_tempid=0;" & vbcrlf if numrows=0 then linkdata = linkdata & "$('[@name=record_controls]').hide(); $('[@name=maintable]').hide();" end if linkdata = linkdata &"</script>" & vbcrlf linkdata = linkdata & "<style>" & vbcrlf linkdata = linkdata & "#inline_error {" & vbcrlf linkdata = linkdata & " font-family: Verdana, Arial, Helvetica, sans serif;" & vbcrlf linkdata = linkdata & " font-size: 11px;" & vbcrlf linkdata = linkdata & " position: absolute;" & vbcrlf linkdata = linkdata & " background-color: white;" & vbcrlf linkdata = linkdata & " border: 1px solid red;" & vbcrlf linkdata = linkdata & " padding: 10px;" & vbcrlf linkdata = linkdata & " background-repeat: no-repeat;" & vbcrlf linkdata = linkdata & " display: none;" & vbcrlf linkdata = linkdata & " }" & vbcrlf linkdata = linkdata & "</style>" & vbcrlf end if if (useAJAX) then linkdata = linkdata & "<script>" & vbcrlf linkdata = linkdata & "if(!$(""[@disptype=control1]"").length && $(""[@disptype=controltable1]"").length)" & vbcrlf linkdata = linkdata & " $(""[@disptype=controltable1]"").hide();" & vbcrlf linkdata = linkdata & "</script>" & vbcrlf end if smarty.Add "linkdata",linkdata smarty.Add "guest",SESSION("AccessLevel") = ACCESS_LEVEL_GUEST strSQL=SESSION(strTableName & "_sql") templatefile = "transizioni_list.htm" DoEvent "BeforeShowList smarty,templatefile" smarty_display(templatefile) %>
[
Íàçàä
]