-
Notifications
You must be signed in to change notification settings - Fork 0
/
eliminar_foro.asp
55 lines (43 loc) · 1.35 KB
/
eliminar_foro.asp
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
<%@ Language=VBScript %>
<%
if isempty(session("id")) then
Response.Redirect("login.asp")
end if
dim db
dim resultado
dim foro
foro = Request.QueryString ("foro")
accion = request.form("accion")
set db = server.CreateObject("SQLComandos.Comandos")
if not isempty(accion) then
foros = request.form("publicar")
sql = "update foro set activo = 1 where autor = " &session("id") &" and id in ("& foros &")"
resultado = db.SQLOtras("DBBAECYS",sql)
response.redirect(session("destforo"))
else
'******************* Eliminar los documentos que hayan sido ingresados al foro
dim ObjUpload
dim rs
set ObjUpload = server.CreateObject("dundas.upload.2")
sql = "select archivo from documento where foro ="&foro
set rs = db.SQLSelect("DBBAECYS",sql)
if not rs.EOF then
while rs.eof <> true
archivo = rs("archivo")
RootFolderName = Server.MapPath(".") & "\"
Path = RootFolderName & "Foros" &"\" & archivo
objupload.FileDelete (Path)
rs.movenext
wend
end if
set rs = nothing
'*******************
sql = "delete from documento where foro = "&foro
resultado = db.SQLOtras("DBBAECYS",sql)
sql = "delete from foro where id = "& foro &" and autor = "& session("id")
resultado = db.SQLOtras("DBBAECYS",sql)
'*******************
response.redirect(session("destforo"))
end if
set db = nothing
%>