1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
| <!-- #INCLUDE FILE="../../library/Common.asp" -->
<%
sFileName = "deletetravail.asp"
sTemplateFileName = "deletetravail.html"
sAction = GetParam("FormAction")
sForm = GetParam("FormName")
ssupprimerErr = ""
'call CheckSecurity("p")
Select Case sForm
Case "supprimer"
supprimerAction(sAction)
end select
LoadTemplate sAppPath & "../console/headerpopup.html", "Header"
LoadTemplate sAppPath & "../console/footerpopup.html", "Footer"
LoadTemplate sAppPath & sTemplateFileName, "main"
SetVar "FileName", sFileName
supprimer_Show
Parse "main", False
Response.write PrintVar("main")
cn.Close
Set cn = Nothing
UnloadTemplate
'===============================
Sub supprimerAction(sAction)
'===============================
Dim bExecSQL: bExecSQL = true
Dim sActionFileName : sActionFileName = ""
Dim sWhere : sWhere = ""
Dim bErr : bErr = False
Dim pPKID : pPKID = ""
sActionFileName = "deletetravail.asp"
if sAction = "update" or sAction = "delete" then
pPKID = GetParam("PK_ID")
if IsEmpty(pPKID) then exit sub
sWhere = "ID=" & ToSQL(pPKID, "Number")
end if
if sAction = "insert" or sAction = "update" then
If len(ssupprimerErr) > 0 then
exit sub
end if
end if
select case sAction
case "delete"
sSQL = "delete from con_traveaux where " & sWhere
end select
if len(ssupprimerErr) > 0 then Exit Sub
on error resume next
if bExecSQL then
cn.execute sSQL
TextMesage = "<b> Code : </b>" & pPKID
insert_logmessage Session("UserID"), "50", TextMesage
end if
ssupprimerErr = ProcessError
on error goto 0
if len(ssupprimerErr) > 0 then Exit Sub
cn.Close
Set cn = Nothing
response.Write("<script>opener.location.reload(true);window.close();</script>")
response.Flush()
response.End()
end sub
'======================
Sub supprimer_Show()
'======================
Dim sWhere : sWhere = ""
Dim bPK : bPK = True
if ssupprimerErr = "" then
pID = GetParam("ID")
SetVar "supprimerError", ""
else
fldID = GetParam("idNews")
pID = GetParam("PK_ID")
SetVar "ssupprimerErr", ssupprimerErr
Parse "supprimerError", False
end if
if IsEmpty(pID) then bPK = False
sWhere = sWhere & "idNews=" & ToSQL(pID, "Number")
SetVar "PK_ID", pID
sSQL = "select * from con_traveaux where " & sWhere
openrs rs, sSQL
bIsUpdateMode = (bPK and not(sAction = "insert" and sForm = "supprimer") and not rs.eof)
if bIsUpdateMode then
fldID = GetValue(rs, "idNews")
fldLabel = GetValue(rs, "SessionID")
fldRefLanguage = GetValue(rs, "TitreFR")
SetVar "supprimerUpdate", ""
SetVar "supprimerInsert", ""
Parse "supprimerEdit", False
else
SetVar "supprimerEdit", ""
SetVar "supprimerInsert", ""
end if
Parse "supprimerCancel", false
SetVar "idNews", ToHTML(fldID)
if (fldRefLanguage = "ar") or (fldRefLanguage = "jp")then
SetVar "SessionID", fldLabel
else
SetVar "SessionID", ToHTML(fldLabel)
end if
Parse "Formsupprimer", False
Set rs = Nothing
End Sub
%> |
Partager