%@ CodePage = 65001 LCID = 1040 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% If Session("lapinsitter_status") <> "login" Then Response.Redirect "login.asp" Else ' Restore Security Table - created in Login arrSecurity = Session("ewSecurity") ' Get Current Table Security sTmp1 = -1 For sTmp = 1 to UBound(arrSecurity, 2) If arrSecurity(0, sTmp) = "offro" Then sTmp1 = sTmp Exit For End If Next ewCurLvl = Session("lapinsitter_status_UserLevel") If IsNumeric(ewCurLvl) And sTmp1 <> -1 Then If ewCurLvl = -1 Then ' System Administrator ewCurSec = 31 ElseIf ewCurLvl > 0 and ewCurLvl <= 1 Then ewCurSec = arrSecurity(ewCurLvl, sTmp1) End If End If If (ewCurSec And ewAllowedit) <> ewAllowedit Then Response.Redirect "offrolist.asp" If Session("lapinsitter_status_UserID") = "" And Session("lapinsitter_status_UserID") <> -1 Then Response.Redirect "login.asp" End If %> <% ' Initialize common variables x_id = Null: ox_id = Null x_nome = Null: ox_nome = Null x_provincia = Null: ox_provincia = Null x_contatto = Null: ox_contatto = Null x_note = Null: ox_note = Null x_userid = Null: ox_userid = Null %> <% Response.Buffer = True ' Load key from QueryString x_id = Request.QueryString("id") ' Get action sAction = Request.Form("a_edit") If sAction = "" Or IsNull(sAction) Then sAction = "I" ' Display with input box Else ' Get fields from form x_id = Request.Form("x_id") x_nome = Request.Form("x_nome") x_provincia = Request.Form("x_provincia") x_contatto = Request.Form("x_contatto") x_note = Request.Form("x_note") x_userid = Request.Form("x_userid") End If ' Check if valid key If x_id = "" Or IsNull(x_id) Then Response.Redirect "offrolist.asp" ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "I": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session("ewmsg") = "Nessun Record trovato" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "offrolist.asp" End If Case "U": ' Update If EditData() Then ' Update Record based on key Session("ewmsg") = "Aggiornamento Record Effettuato" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "offrolist.asp" End If End Select %>
Modifica MI OFFRO COME LAPINSITTER
Torna alla lista